1diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc 2index df1a7ae70bdc3..10e9a0b3b881a 100644 3--- content/browser/blob_storage/chrome_blob_storage_context.cc 4+++ content/browser/blob_storage/chrome_blob_storage_context.cc 5@@ -120,7 +120,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( 6 7 // If we're not incognito mode, schedule all of our file tasks to enable 8 // disk on the storage context. 9- if (!context->IsOffTheRecord() && io_thread_valid) { 10+ if (!context->GetPath().empty() && !context->IsOffTheRecord() && 11+ io_thread_valid) { 12 file_task_runner = base::ThreadPool::CreateTaskRunner( 13 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, 14 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); 15diff --git content/browser/browser_context.cc content/browser/browser_context.cc 16index 967c0ea22204d..e1a64c68e00f8 100644 17--- content/browser/browser_context.cc 18+++ content/browser/browser_context.cc 19@@ -129,7 +129,7 @@ StoragePartition* BrowserContext::GetStoragePartition( 20 StoragePartition* BrowserContext::GetStoragePartition( 21 const StoragePartitionConfig& storage_partition_config, 22 bool can_create) { 23- if (IsOffTheRecord()) { 24+ if (IsOffTheRecord() || GetPath().empty()) { 25 // An off the record profile MUST only use in memory storage partitions. 26 CHECK(storage_partition_config.in_memory()); 27 } 28@@ -370,7 +370,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { 29 const bool kUseInMemoryDBDefault = false; 30 bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( 31 media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, 32- kUseInMemoryDBDefault); 33+ kUseInMemoryDBDefault) || 34+ GetPath().empty(); 35 36 std::unique_ptr<media::VideoDecodeStatsDB> stats_db; 37 if (use_in_memory_db) { 38diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc 39index b430ebb66bb5f..8fc54d2e7d713 100644 40--- content/public/browser/storage_partition_config.cc 41+++ content/public/browser/storage_partition_config.cc 42@@ -7,6 +7,7 @@ 43 #include <sstream> 44 45 #include "base/check.h" 46+#include "base/files/file_path.h" 47 #include "base/strings/string_number_conversions.h" 48 #include "content/public/browser/browser_context.h" 49 #include "url/gurl.h" 50@@ -37,7 +38,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=( 51 // static 52 StoragePartitionConfig StoragePartitionConfig::CreateDefault( 53 BrowserContext* browser_context) { 54- return StoragePartitionConfig("", "", browser_context->IsOffTheRecord()); 55+ return StoragePartitionConfig("", "", browser_context->IsOffTheRecord() || 56+ browser_context->GetPath().empty()); 57 } 58 59 // static 60diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc 61index 842886e2fce98..b77e43ea07458 100644 62--- storage/browser/database/database_tracker.cc 63+++ storage/browser/database/database_tracker.cc 64@@ -562,7 +562,7 @@ bool DatabaseTracker::LazyInit() { 65 databases_table_ = std::make_unique<DatabasesTable>(db_.get()); 66 meta_table_ = std::make_unique<sql::MetaTable>(); 67 68- is_initialized_ = base::CreateDirectory(db_dir_) && 69+ is_initialized_ = (is_incognito_ ? true : base::CreateDirectory(db_dir_)) && 70 (db_->is_open() || 71 (is_incognito_ ? db_->OpenInMemory() 72 : db_->Open(kTrackerDatabaseFullPath))) && 73