73 lines
3.5 KiB
Diff
73 lines
3.5 KiB
Diff
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
|
|
index 4960b1067e1c4..2686fa5bc550b 100644
|
|
--- content/browser/blob_storage/chrome_blob_storage_context.cc
|
|
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
|
|
@@ -120,7 +120,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
|
|
|
|
// 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) {
|
|
file_task_runner = base::ThreadPool::CreateTaskRunner(
|
|
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
|
|
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
|
|
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
|
|
index a7734981fc762..7137c46a38d5c 100644
|
|
--- content/browser/browser_context.cc
|
|
+++ content/browser/browser_context.cc
|
|
@@ -141,7 +141,7 @@ StoragePartition* BrowserContext::GetStoragePartition(
|
|
StoragePartition* BrowserContext::GetStoragePartition(
|
|
const StoragePartitionConfig& storage_partition_config,
|
|
bool can_create) {
|
|
- if (IsOffTheRecord()) {
|
|
+ if (IsOffTheRecord() || GetPath().empty()) {
|
|
// An off the record profile MUST only use in memory storage partitions.
|
|
CHECK(storage_partition_config.in_memory());
|
|
}
|
|
@@ -385,7 +385,8 @@ BrowserContext::CreateVideoDecodePerfHistory() {
|
|
const bool kUseInMemoryDBDefault = false;
|
|
bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool(
|
|
media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName,
|
|
- kUseInMemoryDBDefault);
|
|
+ kUseInMemoryDBDefault) ||
|
|
+ GetPath().empty();
|
|
|
|
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
|
|
index 0095de1d05fd1..0e651cbcbe541 100644
|
|
--- content/public/browser/storage_partition_config.cc
|
|
+++ content/public/browser/storage_partition_config.cc
|
|
@@ -7,6 +7,7 @@
|
|
#include <sstream>
|
|
|
|
#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"
|
|
@@ -36,7 +37,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=(
|
|
// static
|
|
StoragePartitionConfig StoragePartitionConfig::CreateDefault(
|
|
BrowserContext* browser_context) {
|
|
- return StoragePartitionConfig("", "", browser_context->IsOffTheRecord());
|
|
+ return StoragePartitionConfig("", "", browser_context->IsOffTheRecord() ||
|
|
+ browser_context->GetPath().empty());
|
|
}
|
|
|
|
// static
|
|
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
|
|
index 2bdd932ceb3a0..5a35d16ccd5aa 100644
|
|
--- storage/browser/database/database_tracker.cc
|
|
+++ storage/browser/database/database_tracker.cc
|
|
@@ -495,7 +495,7 @@ bool DatabaseTracker::LazyInit() {
|
|
databases_table_ = std::make_unique<DatabasesTable>(db_.get());
|
|
meta_table_ = std::make_unique<sql::MetaTable>();
|
|
|
|
- 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))) &&
|