Move HTTP cache to a subfolder of CefSettings.cache_path (issue #1940)

This commit is contained in:
Marshall Greenblatt 2016-07-12 15:00:12 -04:00
parent 33d0fc3657
commit 7cf8c6ff5c
1 changed files with 4 additions and 1 deletions

View File

@ -241,11 +241,14 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
storage_->set_http_server_properties(base::WrapUnique( storage_->set_http_server_properties(base::WrapUnique(
new net::HttpServerPropertiesImpl)); new net::HttpServerPropertiesImpl));
base::FilePath http_cache_path;
if (!cache_path.empty())
http_cache_path = cache_path.Append(FILE_PATH_LITERAL("Cache"));
std::unique_ptr<net::HttpCache::DefaultBackend> main_backend( std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
new net::HttpCache::DefaultBackend( new net::HttpCache::DefaultBackend(
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
net::CACHE_BACKEND_DEFAULT, net::CACHE_BACKEND_DEFAULT,
cache_path, http_cache_path,
0, 0,
BrowserThread::GetMessageLoopProxyForThread( BrowserThread::GetMessageLoopProxyForThread(
BrowserThread::CACHE))); BrowserThread::CACHE)));