OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "net/base/cookie_monster.h" | 7 #include "net/base/cookie_monster.h" |
8 #include "net/proxy/proxy_service.h" | 8 #include "net/proxy/proxy_service.h" |
9 #include "webkit/glue/webkit_glue.h" | 9 #include "webkit/glue/webkit_glue.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 const std::wstring& cache_path, | 23 const std::wstring& cache_path, |
24 net::HttpCache::Mode cache_mode, | 24 net::HttpCache::Mode cache_mode, |
25 bool no_proxy) { | 25 bool no_proxy) { |
26 cookie_store_ = new net::CookieMonster(); | 26 cookie_store_ = new net::CookieMonster(); |
27 | 27 |
28 // hard-code A-L and A-C for test shells | 28 // hard-code A-L and A-C for test shells |
29 accept_language_ = "en-us,en"; | 29 accept_language_ = "en-us,en"; |
30 accept_charset_ = "iso-8859-1,*,utf-8"; | 30 accept_charset_ = "iso-8859-1,*,utf-8"; |
31 | 31 |
32 net::ProxyConfig proxy_config; | 32 net::ProxyConfig proxy_config; |
33 proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL); | 33 proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL, |
| 34 false, NULL, NULL); |
34 | 35 |
35 net::HttpCache *cache; | 36 net::HttpCache *cache; |
36 if (cache_path.empty()) { | 37 if (cache_path.empty()) { |
37 cache = new net::HttpCache(proxy_service_, 0); | 38 cache = new net::HttpCache(proxy_service_, 0); |
38 } else { | 39 } else { |
39 cache = new net::HttpCache(proxy_service_, cache_path, 0); | 40 cache = new net::HttpCache(proxy_service_, cache_path, 0); |
40 } | 41 } |
41 cache->set_mode(cache_mode); | 42 cache->set_mode(cache_mode); |
42 http_transaction_factory_ = cache; | 43 http_transaction_factory_ = cache; |
43 } | 44 } |
44 | 45 |
45 TestShellRequestContext::~TestShellRequestContext() { | 46 TestShellRequestContext::~TestShellRequestContext() { |
46 delete cookie_store_; | 47 delete cookie_store_; |
47 delete http_transaction_factory_; | 48 delete http_transaction_factory_; |
48 delete proxy_service_; | 49 delete proxy_service_; |
49 } | 50 } |
50 | 51 |
51 const std::string& TestShellRequestContext::GetUserAgent( | 52 const std::string& TestShellRequestContext::GetUserAgent( |
52 const GURL& url) const { | 53 const GURL& url) const { |
53 return webkit_glue::GetUserAgent(url); | 54 return webkit_glue::GetUserAgent(url); |
54 } | 55 } |
OLD | NEW |