diff --git a/patch/patch.cfg b/patch/patch.cfg index 15cc069fa..f64c9db99 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -234,6 +234,9 @@ patches = [ # (b) Adding BrowserContext::GetStoragePartitionProxy(); # (c) Removing static_cast<> of StoragePartition to StoragePartitionImpl. # https://bitbucket.org/chromiumembedded/cef/issues/1973 + # + # Don't create a "databases" directory when cache_path is empty. + # https://bitbucket.org/chromiumembedded/cef/issues/2289 'name': 'storage_partition_1973', }, { diff --git a/patch/patches/storage_partition_1973.patch b/patch/patches/storage_partition_1973.patch index 69a12c657..52e161bb9 100644 --- a/patch/patches/storage_partition_1973.patch +++ b/patch/patches/storage_partition_1973.patch @@ -59,11 +59,15 @@ index 13d802fa72cd..a2d34d1d72eb 100644 partition->GetBluetoothAllowedDevicesMap(); return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin()); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 1e3eb64f87ba..e895554337c6 100644 +index 1e3eb64f87ba..593e3d15d5ec 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -126,8 +126,15 @@ StoragePartition* GetStoragePartitionFromConfig( - if (browser_context->IsOffTheRecord()) +@@ -123,11 +123,18 @@ StoragePartition* GetStoragePartitionFromConfig( + StoragePartitionImplMap* partition_map = + GetStoragePartitionMap(browser_context); + +- if (browser_context->IsOffTheRecord()) ++ if (browser_context->IsOffTheRecord() || browser_context->GetPath().empty()) in_memory = true; - return partition_map->Get(partition_domain, partition_name, in_memory, @@ -664,3 +668,16 @@ index c3c1aa9d5351..08555f42ac39 100644 protected: virtual ~StoragePartition() {} }; +diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc +index 86fb9f41fc71..7a8be02473a3 100644 +--- storage/browser/database/database_tracker.cc ++++ storage/browser/database/database_tracker.cc +@@ -495,7 +495,7 @@ bool DatabaseTracker::LazyInit() { + meta_table_.reset(new sql::MetaTable()); + + is_initialized_ = +- base::CreateDirectory(db_dir_) && ++ (is_incognito_ ? true : base::CreateDirectory(db_dir_)) && + (db_->is_open() || + (is_incognito_ ? db_->OpenInMemory() : + db_->Open(kTrackerDatabaseFullPath))) && diff --git a/tests/shared/browser/client_app_browser.cc b/tests/shared/browser/client_app_browser.cc index d688ff8f0..fe2f2caee 100644 --- a/tests/shared/browser/client_app_browser.cc +++ b/tests/shared/browser/client_app_browser.cc @@ -48,6 +48,12 @@ void ClientAppBrowser::OnBeforeCommandLineProcessing( command_line->AppendSwitchWithValue("top-chrome-md", "non-material"); } + if (!command_line->HasSwitch(switches::kCachePath) && + !command_line->HasSwitch("disable-gpu-shader-disk-cache")) { + // Don't create a "GPUCache" directory when cache-path is unspecified. + command_line->AppendSwitch("disable-gpu-shader-disk-cache"); + } + DelegateSet::iterator it = delegates_.begin(); for (; it != delegates_.end(); ++it) (*it)->OnBeforeCommandLineProcessing(this, command_line);