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 #include "net/base/cookie_monster.h" | 10 #include "net/base/cookie_monster.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); | 64 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); |
65 | 65 |
66 net::HttpCache *cache; | 66 net::HttpCache *cache; |
67 if (cache_path.empty()) { | 67 if (cache_path.empty()) { |
68 cache = new net::HttpCache(NULL, host_resolver_, proxy_service_, | 68 cache = new net::HttpCache(NULL, host_resolver_, proxy_service_, |
69 ssl_config_service_, http_auth_handler_factory_, | 69 ssl_config_service_, http_auth_handler_factory_, |
70 0); | 70 0); |
71 } else { | 71 } else { |
72 cache = new net::HttpCache(NULL, host_resolver_, proxy_service_, | 72 cache = new net::HttpCache(NULL, host_resolver_, proxy_service_, |
73 ssl_config_service_, http_auth_handler_factory_, | 73 ssl_config_service_, http_auth_handler_factory_, |
74 cache_path, 0); | 74 cache_path, NULL, 0); |
75 } | 75 } |
76 cache->set_mode(cache_mode); | 76 cache->set_mode(cache_mode); |
77 http_transaction_factory_ = cache; | 77 http_transaction_factory_ = cache; |
78 | 78 |
79 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 79 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
80 } | 80 } |
81 | 81 |
82 TestShellRequestContext::~TestShellRequestContext() { | 82 TestShellRequestContext::~TestShellRequestContext() { |
83 delete ftp_transaction_factory_; | 83 delete ftp_transaction_factory_; |
84 delete http_transaction_factory_; | 84 delete http_transaction_factory_; |
85 delete http_auth_handler_factory_; | 85 delete http_auth_handler_factory_; |
86 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); | 86 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); |
87 } | 87 } |
88 | 88 |
89 const std::string& TestShellRequestContext::GetUserAgent( | 89 const std::string& TestShellRequestContext::GetUserAgent( |
90 const GURL& url) const { | 90 const GURL& url) const { |
91 return webkit_glue::GetUserAgent(url); | 91 return webkit_glue::GetUserAgent(url); |
92 } | 92 } |
OLD | NEW |