summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 18:40:10 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 18:40:10 +0000
commitf870252fda3d5724feeda33aeb6deaf502643a31 (patch)
treeac8b4391c15be1d0bb3af6def8cba95d0587caae /webkit
parent2c9be01dc74d1b0edff9c9288abcb66516083af0 (diff)
downloadchromium_src-f870252fda3d5724feeda33aeb6deaf502643a31.zip
chromium_src-f870252fda3d5724feeda33aeb6deaf502643a31.tar.gz
chromium_src-f870252fda3d5724feeda33aeb6deaf502643a31.tar.bz2
Http Cache: Add a backend factory class so that the caller
has more control about the backend instantiation. BUG=none TEST=current unit tests. Review URL: http://codereview.chromium.org/2000011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
index 64563e7..25cf877 100644
--- a/webkit/tools/test_shell/test_shell_request_context.cc
+++ b/webkit/tools/test_shell/test_shell_request_context.cc
@@ -78,16 +78,15 @@ void TestShellRequestContext::Init(
base::EnsureNSPRInit();
#endif
- net::HttpCache *cache;
- if (cache_path.empty()) {
- cache = new net::HttpCache(NULL, host_resolver_, proxy_service_,
- ssl_config_service_, http_auth_handler_factory_,
- 0);
- } else {
- cache = new net::HttpCache(NULL, host_resolver_, proxy_service_,
- ssl_config_service_, http_auth_handler_factory_,
- cache_path, NULL, 0);
- }
+ net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
+ cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
+ cache_path, 0, NULL);
+
+ net::HttpCache* cache =
+ new net::HttpCache(NULL, host_resolver_, proxy_service_,
+ ssl_config_service_, http_auth_handler_factory_,
+ backend);
+
cache->set_mode(cache_mode);
http_transaction_factory_ = cache;