OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/tools/test_shell/test_shell_request_context.h" | 5 #include "webkit/tools/test_shell/test_shell_request_context.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 71 matching lines...) Loading... |
82 CHECK(cache_thread_.StartWithOptions( | 82 CHECK(cache_thread_.StartWithOptions( |
83 base::Thread::Options(MessageLoop::TYPE_IO, 0))); | 83 base::Thread::Options(MessageLoop::TYPE_IO, 0))); |
84 | 84 |
85 net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( | 85 net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( |
86 cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, | 86 cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, |
87 cache_path, 0, cache_thread_.message_loop_proxy()); | 87 cache_path, 0, cache_thread_.message_loop_proxy()); |
88 | 88 |
89 net::HttpCache* cache = | 89 net::HttpCache* cache = |
90 new net::HttpCache(NULL, host_resolver_, proxy_service_, | 90 new net::HttpCache(NULL, host_resolver_, proxy_service_, |
91 ssl_config_service_, http_auth_handler_factory_, | 91 ssl_config_service_, http_auth_handler_factory_, |
92 backend); | 92 NULL, backend); |
93 | 93 |
94 cache->set_mode(cache_mode); | 94 cache->set_mode(cache_mode); |
95 http_transaction_factory_ = cache; | 95 http_transaction_factory_ = cache; |
96 | 96 |
97 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 97 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
98 } | 98 } |
99 | 99 |
100 TestShellRequestContext::~TestShellRequestContext() { | 100 TestShellRequestContext::~TestShellRequestContext() { |
101 delete ftp_transaction_factory_; | 101 delete ftp_transaction_factory_; |
102 delete http_transaction_factory_; | 102 delete http_transaction_factory_; |
103 delete http_auth_handler_factory_; | 103 delete http_auth_handler_factory_; |
104 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); | 104 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); |
105 } | 105 } |
106 | 106 |
107 const std::string& TestShellRequestContext::GetUserAgent( | 107 const std::string& TestShellRequestContext::GetUserAgent( |
108 const GURL& url) const { | 108 const GURL& url) const { |
109 return webkit_glue::GetUserAgent(url); | 109 return webkit_glue::GetUserAgent(url); |
110 } | 110 } |
OLD | NEW |