2019-03-24 01:39:54 +01:00
|
|
|
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
|
2023-04-26 21:55:59 +02:00
|
|
|
index 01d2a426e2c17..c239a2f6fc786 100644
|
2019-03-24 01:39:54 +01:00
|
|
|
--- content/browser/blob_storage/chrome_blob_storage_context.cc
|
|
|
|
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
|
2023-04-26 21:55:59 +02:00
|
|
|
@@ -125,7 +125,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
|
2019-03-24 01:39:54 +01:00
|
|
|
|
|
|
|
// If we're not incognito mode, schedule all of our file tasks to enable
|
|
|
|
// disk on the storage context.
|
|
|
|
- if (!context->IsOffTheRecord() && io_thread_valid) {
|
|
|
|
+ if (!context->GetPath().empty() && !context->IsOffTheRecord() &&
|
|
|
|
+ io_thread_valid) {
|
2020-03-30 22:13:42 +02:00
|
|
|
file_task_runner = base::ThreadPool::CreateTaskRunner(
|
|
|
|
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
|
|
|
|
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
|
2019-03-24 01:39:54 +01:00
|
|
|
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
|
2023-04-26 21:55:59 +02:00
|
|
|
index e4a0c8a1a55b7..7e2e0e3b1b987 100644
|
2019-03-24 01:39:54 +01:00
|
|
|
--- content/browser/browser_context.cc
|
|
|
|
+++ content/browser/browser_context.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -130,7 +130,7 @@ StoragePartition* BrowserContext::GetStoragePartition(
|
2021-06-04 03:34:56 +02:00
|
|
|
StoragePartition* BrowserContext::GetStoragePartition(
|
2021-04-21 00:52:34 +02:00
|
|
|
const StoragePartitionConfig& storage_partition_config,
|
|
|
|
bool can_create) {
|
2021-06-04 03:34:56 +02:00
|
|
|
- if (IsOffTheRecord()) {
|
|
|
|
+ if (IsOffTheRecord() || GetPath().empty()) {
|
2021-04-21 00:52:34 +02:00
|
|
|
// An off the record profile MUST only use in memory storage partitions.
|
|
|
|
CHECK(storage_partition_config.in_memory());
|
|
|
|
}
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -365,7 +365,8 @@ BrowserContext::CreateVideoDecodePerfHistory() {
|
2021-04-21 00:52:34 +02:00
|
|
|
const bool kUseInMemoryDBDefault = false;
|
|
|
|
bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool(
|
|
|
|
media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName,
|
|
|
|
- kUseInMemoryDBDefault);
|
|
|
|
+ kUseInMemoryDBDefault) ||
|
|
|
|
+ GetPath().empty();
|
2019-03-24 01:39:54 +01:00
|
|
|
|
2021-04-21 00:52:34 +02:00
|
|
|
std::unique_ptr<media::VideoDecodeStatsDB> stats_db;
|
|
|
|
if (use_in_memory_db) {
|
|
|
|
diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc
|
2022-09-26 21:30:45 +02:00
|
|
|
index 81013d6eb993a..89abfbe7fec6c 100644
|
2021-04-21 00:52:34 +02:00
|
|
|
--- content/public/browser/storage_partition_config.cc
|
|
|
|
+++ content/public/browser/storage_partition_config.cc
|
|
|
|
@@ -7,6 +7,7 @@
|
|
|
|
#include <sstream>
|
2019-03-24 01:39:54 +01:00
|
|
|
|
2021-04-21 00:52:34 +02:00
|
|
|
#include "base/check.h"
|
|
|
|
+#include "base/files/file_path.h"
|
|
|
|
#include "base/strings/string_number_conversions.h"
|
|
|
|
#include "content/public/browser/browser_context.h"
|
|
|
|
#include "url/gurl.h"
|
2022-02-21 23:23:40 +01:00
|
|
|
@@ -22,7 +23,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=(
|
2021-04-21 00:52:34 +02:00
|
|
|
// static
|
|
|
|
StoragePartitionConfig StoragePartitionConfig::CreateDefault(
|
|
|
|
BrowserContext* browser_context) {
|
|
|
|
- return StoragePartitionConfig("", "", browser_context->IsOffTheRecord());
|
|
|
|
+ return StoragePartitionConfig("", "", browser_context->IsOffTheRecord() ||
|
|
|
|
+ browser_context->GetPath().empty());
|
|
|
|
}
|
2019-07-16 19:59:21 +02:00
|
|
|
|
2021-04-21 00:52:34 +02:00
|
|
|
// static
|
2019-03-24 01:39:54 +01:00
|
|
|
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
|
2023-02-27 19:52:38 +01:00
|
|
|
index 3ee340ca7e21f..f341d1e25a0ab 100644
|
2019-03-24 01:39:54 +01:00
|
|
|
--- storage/browser/database/database_tracker.cc
|
|
|
|
+++ storage/browser/database/database_tracker.cc
|
2023-01-03 00:34:43 +01:00
|
|
|
@@ -568,7 +568,7 @@ bool DatabaseTracker::LazyInit() {
|
2021-04-21 00:52:34 +02:00
|
|
|
databases_table_ = std::make_unique<DatabasesTable>(db_.get());
|
|
|
|
meta_table_ = std::make_unique<sql::MetaTable>();
|
2019-03-24 01:39:54 +01:00
|
|
|
|
2021-03-04 23:36:57 +01:00
|
|
|
- is_initialized_ = base::CreateDirectory(db_dir_) &&
|
|
|
|
+ is_initialized_ = (is_incognito_ ? true : base::CreateDirectory(db_dir_)) &&
|
|
|
|
(db_->is_open() ||
|
|
|
|
(is_incognito_ ? db_->OpenInMemory()
|
|
|
|
: db_->Open(kTrackerDatabaseFullPath))) &&
|