diff options
-rw-r--r-- | android_webview/browser/net/aw_url_request_context_getter.cc | 2 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.cc | 29 | ||||
-rw-r--r-- | content/browser/gpu/shader_disk_cache.cc | 2 | ||||
-rw-r--r-- | content/shell/shell_url_request_context_getter.cc | 2 | ||||
-rw-r--r-- | net/base/cache_type.h | 7 | ||||
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 20 | ||||
-rw-r--r-- | net/disk_cache/cache_creator.cc | 46 | ||||
-rw-r--r-- | net/disk_cache/disk_cache.h | 1 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_perftest.cc | 6 | ||||
-rw-r--r-- | net/http/http_cache.cc | 11 | ||||
-rw-r--r-- | net/http/http_cache.h | 4 | ||||
-rw-r--r-- | net/tools/dump_cache/simple_cache_dumper.cc | 3 | ||||
-rw-r--r-- | net/tools/dump_cache/upgrade_win.cc | 9 | ||||
-rw-r--r-- | net/url_request/url_request_context_builder.cc | 2 | ||||
-rw-r--r-- | webkit/appcache/appcache_disk_cache.cc | 5 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.cc | 4 |
16 files changed, 111 insertions, 42 deletions
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc index e84e2dac..a3320c9 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -16,6 +16,7 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_client.h" #include "content/public/common/url_constants.h" +#include "net/base/cache_type.h" #include "net/cookies/cookie_store.h" #include "net/http/http_cache.h" #include "net/proxy/proxy_service.h" @@ -69,6 +70,7 @@ void AwURLRequestContextGetter::Init() { network_session_params, new net::HttpCache::DefaultBackend( net::DISK_CACHE, + net::CACHE_BACKEND_DEFAULT, browser_context_->GetPath().Append(FILE_PATH_LITERAL("Cache")), 10 * 1024 * 1024, // 10M BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE))); diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 6de8780..32be9ba 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -8,10 +8,12 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/metrics/field_trial.h" #include "base/prefs/pref_member.h" #include "base/prefs/pref_service.h" #include "base/sequenced_task_runner.h" #include "base/stl_util.h" +#include "base/string_util.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/worker_pool.h" #include "chrome/browser/custom_handlers/protocol_handler_registry.h" @@ -35,6 +37,7 @@ #include "content/public/browser/resource_context.h" #include "content/public/browser/storage_partition.h" #include "extensions/common/constants.h" +#include "net/base/cache_type.h" #include "net/ftp/ftp_network_layer.h" #include "net/http/http_cache.h" #include "net/ssl/server_bound_cert_service.h" @@ -42,6 +45,29 @@ #include "net/url_request/url_request_job_factory_impl.h" #include "webkit/quota/special_storage_policy.h" +namespace { + +net::BackendType ChooseCacheBackendType() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { + const std::string opt_value = + command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); + if (LowerCaseEqualsASCII(opt_value, "off")) + return net::CACHE_BACKEND_BLOCKFILE; + if (opt_value == "" || LowerCaseEqualsASCII(opt_value, "on")) + return net::CACHE_BACKEND_SIMPLE; + } + const std::string experiment_name = + base::FieldTrialList::FindFullName("SimpleCacheTrial"); + if (experiment_name == "ExperimentYes" || + experiment_name == "ExperimentYes2") { + return net::CACHE_BACKEND_SIMPLE; + } + return net::CACHE_BACKEND_BLOCKFILE; +} + +} // namespace + using content::BrowserThread; ProfileImplIOData::Handle::Handle(Profile* profile) @@ -382,6 +408,7 @@ void ProfileImplIOData::InitializeInternal( net::HttpCache::DefaultBackend* main_backend = new net::HttpCache::DefaultBackend( net::DISK_CACHE, + ChooseCacheBackendType(), lazy_params_->cache_path, lazy_params_->cache_max_size, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); @@ -500,6 +527,7 @@ ProfileImplIOData::InitializeAppRequestContext( } else { app_backend = new net::HttpCache::DefaultBackend( net::DISK_CACHE, + ChooseCacheBackendType(), cache_path, app_cache_max_size_, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); @@ -590,6 +618,7 @@ ProfileImplIOData::InitializeMediaRequestContext( net::HttpCache::BackendFactory* media_backend = new net::HttpCache::DefaultBackend( net::MEDIA_CACHE, + ChooseCacheBackendType(), cache_path, cache_max_size, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); diff --git a/content/browser/gpu/shader_disk_cache.cc b/content/browser/gpu/shader_disk_cache.cc index 621d7d53..4623208 100644 --- a/content/browser/gpu/shader_disk_cache.cc +++ b/content/browser/gpu/shader_disk_cache.cc @@ -7,6 +7,7 @@ #include "base/threading/thread_checker.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/public/browser/browser_thread.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -518,6 +519,7 @@ void ShaderDiskCache::Init() { int rv = disk_cache::CreateCacheBackend( net::SHADER_CACHE, + net::CACHE_BACKEND_BLOCKFILE, cache_path_.Append(kGpuCachePath), max_cache_size_, true, diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc index 3f5f6bc..9c66f0c 100644 --- a/content/shell/shell_url_request_context_getter.cc +++ b/content/shell/shell_url_request_context_getter.cc @@ -15,6 +15,7 @@ #include "content/public/common/url_constants.h" #include "content/shell/common/shell_switches.h" #include "content/shell/shell_network_delegate.h" +#include "net/base/cache_type.h" #include "net/cert/cert_verifier.h" #include "net/cookies/cookie_monster.h" #include "net/dns/host_resolver.h" @@ -125,6 +126,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { net::HttpCache::DefaultBackend* main_backend = new net::HttpCache::DefaultBackend( net::DISK_CACHE, + net::CACHE_BACKEND_DEFAULT, cache_path, 0, BrowserThread::GetMessageLoopProxyForThread( diff --git a/net/base/cache_type.h b/net/base/cache_type.h index a7a21df..69b5646 100644 --- a/net/base/cache_type.h +++ b/net/base/cache_type.h @@ -16,6 +16,13 @@ enum CacheType { SHADER_CACHE // Backing store for the GL shader cache. }; +// The types of disk cache backend, only used at backend instantiation. +enum BackendType { + CACHE_BACKEND_DEFAULT, + CACHE_BACKEND_BLOCKFILE, // The |BackendImpl|. + CACHE_BACKEND_SIMPLE // The |SimpleBackendImpl|. +}; + } // namespace disk_cache #endif // NET_BASE_CACHE_TYPE_H_ diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 3908f409..a50fc19 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -10,6 +10,7 @@ #include "base/third_party/dynamic_annotations/dynamic_annotations.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_restrictions.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -237,8 +238,9 @@ TEST_F(DiskCacheTest, CreateBackend) { cache = NULL; // Now test the public API. - int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, cache_path_, 0, - false, + int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, + net::CACHE_BACKEND_DEFAULT, + cache_path_, 0, false, cache_thread.message_loop_proxy(), NULL, &cache, cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); @@ -246,7 +248,9 @@ TEST_F(DiskCacheTest, CreateBackend) { delete cache; cache = NULL; - rv = disk_cache::CreateCacheBackend(net::MEMORY_CACHE, base::FilePath(), 0, + rv = disk_cache::CreateCacheBackend(net::MEMORY_CACHE, + net::CACHE_BACKEND_DEFAULT, + base::FilePath(), 0, false, NULL, NULL, &cache, cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); @@ -472,7 +476,7 @@ TEST_F(DiskCacheTest, TruncatedIndex) { disk_cache::Backend* backend = NULL; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, cache_path_, 0, false, + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, false, cache_thread.message_loop_proxy(), NULL, &backend, cb.callback()); ASSERT_NE(net::OK, cb.GetResult(rv)); @@ -1688,7 +1692,9 @@ TEST_F(DiskCacheBackendTest, DeleteOld) { net::TestCompletionCallback cb; bool prev = base::ThreadRestrictions::SetIOAllowed(false); base::FilePath path(cache_path_); - int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, path, 0, true, + int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, + net::CACHE_BACKEND_BLOCKFILE, path, + 0, true, cache_thread.message_loop_proxy(), NULL, &cache_, cb.callback()); path.clear(); // Make sure path was captured by the previous call. @@ -2573,11 +2579,11 @@ TEST_F(DiskCacheTest, MultipleInstances) { disk_cache::Backend* cache[kNumberOfCaches]; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, store1.path(), 0, false, + net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, store1.path(), 0, false, cache_thread.message_loop_proxy(), NULL, &cache[0], cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); rv = disk_cache::CreateCacheBackend( - net::MEDIA_CACHE, store2.path(), 0, false, + net::MEDIA_CACHE, net::CACHE_BACKEND_DEFAULT, store2.path(), 0, false, cache_thread.message_loop_proxy(), NULL, &cache[1], cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); diff --git a/net/disk_cache/cache_creator.cc b/net/disk_cache/cache_creator.cc index fb2bd34..e5259af 100644 --- a/net/disk_cache/cache_creator.cc +++ b/net/disk_cache/cache_creator.cc @@ -5,6 +5,7 @@ #include "base/file_util.h" #include "base/metrics/field_trial.h" #include "base/stringprintf.h" +#include "net/base/cache_type.h" #include "net/base/net_errors.h" #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/cache_util.h" @@ -23,7 +24,7 @@ namespace { class CacheCreator { public: CacheCreator(const base::FilePath& path, bool force, int max_bytes, - net::CacheType type, uint32 flags, + net::CacheType type, net::BackendType backend_type, uint32 flags, base::MessageLoopProxy* thread, net::NetLog* net_log, disk_cache::Backend** backend, const net::CompletionCallback& callback); @@ -43,6 +44,7 @@ class CacheCreator { bool retry_; int max_bytes_; net::CacheType type_; + net::BackendType backend_type_; uint32 flags_; scoped_refptr<base::MessageLoopProxy> thread_; disk_cache::Backend** backend_; @@ -55,7 +57,7 @@ class CacheCreator { CacheCreator::CacheCreator( const base::FilePath& path, bool force, int max_bytes, - net::CacheType type, uint32 flags, + net::CacheType type, net::BackendType backend_type, uint32 flags, base::MessageLoopProxy* thread, net::NetLog* net_log, disk_cache::Backend** backend, const net::CompletionCallback& callback) @@ -64,37 +66,32 @@ CacheCreator::CacheCreator( retry_(false), max_bytes_(max_bytes), type_(type), + backend_type_(backend_type), flags_(flags), thread_(thread), backend_(backend), callback_(callback), created_cache_(NULL), net_log_(net_log) { - } +} CacheCreator::~CacheCreator() { } int CacheCreator::Run() { - // TODO(pasko): The two caches should never coexist on disk. Each individual - // cache backend should fail to initialize if it observes the index that does - // not belong to it. - const std::string experiment_name = - base::FieldTrialList::FindFullName("SimpleCacheTrial"); - if (experiment_name == "ExplicitYes" || experiment_name == "ExperimentYes" || - experiment_name == "ExperimentYes2") { - // TODO(gavinp,pasko): While simple backend development proceeds, we're only - // testing it against net::DISK_CACHE. Turn it on for more cache types as - // appropriate. - if (type_ == net::DISK_CACHE) { - disk_cache::SimpleBackendImpl* simple_cache = - new disk_cache::SimpleBackendImpl(path_, max_bytes_, type_, thread_, - net_log_); - created_cache_ = simple_cache; - return simple_cache->Init( - base::Bind(&CacheCreator::OnIOComplete, base::Unretained(this))); - } + // TODO(gavinp,pasko): While simple backend development proceeds, we're only + // testing it against net::DISK_CACHE. Turn it on for more cache types as + // appropriate. + if (backend_type_ == net::CACHE_BACKEND_SIMPLE && type_ == net::DISK_CACHE) { + disk_cache::SimpleBackendImpl* simple_cache = + new disk_cache::SimpleBackendImpl(path_, max_bytes_, type_, thread_, + net_log_); + created_cache_ = simple_cache; + return simple_cache->Init( + base::Bind(&CacheCreator::OnIOComplete, base::Unretained(this))); } + DCHECK(backend_type_ == net::CACHE_BACKEND_BLOCKFILE || + backend_type_ == net::CACHE_BACKEND_DEFAULT); disk_cache::BackendImpl* new_cache = new disk_cache::BackendImpl(path_, thread_, net_log_); created_cache_ = new_cache; @@ -148,7 +145,9 @@ void CacheCreator::OnIOComplete(int result) { namespace disk_cache { -int CreateCacheBackend(net::CacheType type, const base::FilePath& path, +int CreateCacheBackend(net::CacheType type, + net::BackendType backend_type, + const base::FilePath& path, int max_bytes, bool force, base::MessageLoopProxy* thread, net::NetLog* net_log, Backend** backend, @@ -159,7 +158,8 @@ int CreateCacheBackend(net::CacheType type, const base::FilePath& path, return *backend ? net::OK : net::ERR_FAILED; } DCHECK(thread); - CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, kNone, + CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, + backend_type, kNone, thread, net_log, backend, callback); return creator->Run(); } diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index 13edd92..3b5c912 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -48,6 +48,7 @@ class Backend; // The pointer to receive the |backend| must remain valid until the operation // completes (the callback is notified). NET_EXPORT int CreateCacheBackend(net::CacheType type, + net::BackendType backend_type, const base::FilePath& path, int max_bytes, bool force, base::MessageLoopProxy* thread, diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc index 029277f..66c1131 100644 --- a/net/disk_cache/disk_cache_perftest.cc +++ b/net/disk_cache/disk_cache_perftest.cc @@ -13,6 +13,7 @@ #include "base/threading/thread.h" #include "base/test/test_file_util.h" #include "base/timer.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -166,7 +167,7 @@ TEST_F(DiskCacheTest, CacheBackendPerformance) { net::TestCompletionCallback cb; disk_cache::Backend* cache; int rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, cache_path_, 0, false, + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, false, cache_thread.message_loop_proxy(), NULL, &cache, cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); @@ -194,7 +195,8 @@ TEST_F(DiskCacheTest, CacheBackendPerformance) { cache_path_.AppendASCII("data_3"))); rv = disk_cache::CreateCacheBackend( - net::DISK_CACHE, cache_path_, 0, false, cache_thread.message_loop_proxy(), + net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, false, + cache_thread.message_loop_proxy(), NULL, &cache, cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 421300e..8905695 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -27,6 +27,7 @@ #include "base/string_util.h" #include "base/stringprintf.h" #include "base/threading/worker_pool.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -52,10 +53,12 @@ void DeletePath(base::FilePath path) { namespace net { HttpCache::DefaultBackend::DefaultBackend(CacheType type, + BackendType backend_type, const base::FilePath& path, int max_bytes, base::MessageLoopProxy* thread) : type_(type), + backend_type_(backend_type), path_(path), max_bytes_(max_bytes), thread_(thread) { @@ -65,15 +68,17 @@ HttpCache::DefaultBackend::~DefaultBackend() {} // static HttpCache::BackendFactory* HttpCache::DefaultBackend::InMemory(int max_bytes) { - return new DefaultBackend(MEMORY_CACHE, base::FilePath(), max_bytes, NULL); + return new DefaultBackend(MEMORY_CACHE, net::CACHE_BACKEND_DEFAULT, + base::FilePath(), max_bytes, NULL); } int HttpCache::DefaultBackend::CreateBackend( NetLog* net_log, disk_cache::Backend** backend, const CompletionCallback& callback) { DCHECK_GE(max_bytes_, 0); - return disk_cache::CreateCacheBackend(type_, path_, max_bytes_, true, - thread_, net_log, backend, callback); + return disk_cache::CreateCacheBackend(type_, backend_type_, path_, max_bytes_, + true, thread_, net_log, backend, + callback); } //----------------------------------------------------------------------------- diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 9e6b73c..fcba80e 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -99,7 +99,8 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // |path| is the destination for any files used by the backend, and // |cache_thread| is the thread where disk operations should take place. If // |max_bytes| is zero, a default value will be calculated automatically. - DefaultBackend(CacheType type, const base::FilePath& path, int max_bytes, + DefaultBackend(CacheType type, BackendType backend_type, + const base::FilePath& path, int max_bytes, base::MessageLoopProxy* thread); virtual ~DefaultBackend(); @@ -113,6 +114,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, private: CacheType type_; + BackendType backend_type_; const base::FilePath path_; int max_bytes_; scoped_refptr<base::MessageLoopProxy> thread_; diff --git a/net/tools/dump_cache/simple_cache_dumper.cc b/net/tools/dump_cache/simple_cache_dumper.cc index cb2bc47..d72e707ac 100644 --- a/net/tools/dump_cache/simple_cache_dumper.cc +++ b/net/tools/dump_cache/simple_cache_dumper.cc @@ -11,6 +11,7 @@ #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/threading/thread.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/disk_cache/disk_cache.h" @@ -124,7 +125,7 @@ int SimpleCacheDumper::DoCreateCache() { DCHECK(!cache_); state_ = STATE_CREATE_CACHE_COMPLETE; return disk_cache::CreateCacheBackend( - DISK_CACHE, input_path_, 0, false, + DISK_CACHE, CACHE_BACKEND_DEFAULT, input_path_, 0, false, cache_thread_->message_loop_proxy(), NULL, &cache_, io_callback_); } diff --git a/net/tools/dump_cache/upgrade_win.cc b/net/tools/dump_cache/upgrade_win.cc index 67496cf..e371560 100644 --- a/net/tools/dump_cache/upgrade_win.cc +++ b/net/tools/dump_cache/upgrade_win.cc @@ -14,6 +14,7 @@ #include "base/threading/thread.h" #include "base/win/scoped_handle.h" #include "googleurl/src/gurl.h" +#include "net/base/cache_type.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -318,7 +319,9 @@ bool MasterSM::DoInit() { disk_cache::Backend* cache; net::TestCompletionCallback cb; - int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, path_, 0, false, + int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, + net::CACHE_BACKEND_DEFAULT, path_, 0, + false, cache_thread_.message_loop_proxy(), NULL, &cache, cb.callback()); if (cb.GetResult(rv) != net::OK) { @@ -589,7 +592,9 @@ SlaveSM::SlaveSM(const base::FilePath& path, HANDLE channel) : BaseSM(channel), iterator_(NULL) { disk_cache::Backend* cache; net::TestCompletionCallback cb; - int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, path, 0, false, + int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, + net::CACHE_BACKEND_BLOCKFILE, path, 0, + false, cache_thread_.message_loop_proxy(), NULL, &cache, cb.callback()); if (cb.GetResult(rv) != net::OK) { diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index 893ada6..4dda0e9 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc @@ -12,6 +12,7 @@ #include "base/string_util.h" #include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" +#include "net/base/cache_type.h" #include "net/base/net_errors.h" #include "net/base/network_delegate.h" #include "net/cert/cert_verifier.h" @@ -275,6 +276,7 @@ URLRequestContext* URLRequestContextBuilder::Build() { context->StartCacheThread(); http_cache_backend = new HttpCache::DefaultBackend(DISK_CACHE, + net::CACHE_BACKEND_DEFAULT, http_cache_params_.path, http_cache_params_.max_size, context->cache_message_loop_proxy()); diff --git a/webkit/appcache/appcache_disk_cache.cc b/webkit/appcache/appcache_disk_cache.cc index 99bc8f8..9587d11 100644 --- a/webkit/appcache/appcache_disk_cache.cc +++ b/webkit/appcache/appcache_disk_cache.cc @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" +#include "net/base/cache_type.h" #include "net/base/net_errors.h" namespace appcache { @@ -271,8 +272,8 @@ int AppCacheDiskCache::Init(net::CacheType cache_type, create_backend_callback_ = new CreateBackendCallbackShim(this); int rv = disk_cache::CreateCacheBackend( - cache_type, cache_directory, cache_size, force, cache_thread, NULL, - &(create_backend_callback_->backend_ptr_), + cache_type, net::CACHE_BACKEND_DEFAULT, cache_directory, cache_size, + force, cache_thread, NULL, &(create_backend_callback_->backend_ptr_), base::Bind(&CreateBackendCallbackShim::Callback, create_backend_callback_)); if (rv == net::ERR_IO_PENDING) diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index cc6956f..af3df4e 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/thread_task_runner_handle.h" #include "base/threading/worker_pool.h" +#include "net/base/cache_type.h" #include "net/cert/cert_verifier.h" #include "net/cookies/cookie_monster.h" #include "net/dns/host_resolver.h" @@ -96,7 +97,8 @@ void TestShellRequestContext::Init( net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, - cache_path, 0, SimpleResourceLoaderBridge::GetCacheThread()); + net::CACHE_BACKEND_DEFAULT, cache_path, 0, + SimpleResourceLoaderBridge::GetCacheThread()); net::HttpNetworkSession::Params network_session_params; network_session_params.host_resolver = host_resolver(); |