| 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 "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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // TODO(port): rename "linux" to some nonspecific unix. | 48 // TODO(port): rename "linux" to some nonspecific unix. |
| 49 scoped_ptr<net::ProxyConfigService> proxy_config_service( | 49 scoped_ptr<net::ProxyConfigService> proxy_config_service( |
| 50 new net::ProxyConfigServiceFixed(net::ProxyConfig())); | 50 new net::ProxyConfigServiceFixed(net::ProxyConfig())); |
| 51 #else | 51 #else |
| 52 // Use the system proxy settings. | 52 // Use the system proxy settings. |
| 53 scoped_ptr<net::ProxyConfigService> proxy_config_service( | 53 scoped_ptr<net::ProxyConfigService> proxy_config_service( |
| 54 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL)); | 54 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL)); |
| 55 #endif | 55 #endif |
| 56 host_resolver_ = net::CreateSystemHostResolver(); | 56 host_resolver_ = net::CreateSystemHostResolver(); |
| 57 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), | 57 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), |
| 58 false, NULL, NULL); | 58 false, NULL, NULL, NULL); |
| 59 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); | 59 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); |
| 60 | 60 |
| 61 net::HttpCache *cache; | 61 net::HttpCache *cache; |
| 62 if (cache_path.empty()) { | 62 if (cache_path.empty()) { |
| 63 cache = new net::HttpCache(host_resolver_, proxy_service_, | 63 cache = new net::HttpCache(host_resolver_, proxy_service_, |
| 64 ssl_config_service_, 0); | 64 ssl_config_service_, 0); |
| 65 } else { | 65 } else { |
| 66 cache = new net::HttpCache(host_resolver_, proxy_service_, | 66 cache = new net::HttpCache(host_resolver_, proxy_service_, |
| 67 ssl_config_service_, cache_path, 0); | 67 ssl_config_service_, cache_path, 0); |
| 68 } | 68 } |
| 69 cache->set_mode(cache_mode); | 69 cache->set_mode(cache_mode); |
| 70 http_transaction_factory_ = cache; | 70 http_transaction_factory_ = cache; |
| 71 | 71 |
| 72 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 72 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TestShellRequestContext::~TestShellRequestContext() { | 75 TestShellRequestContext::~TestShellRequestContext() { |
| 76 delete ftp_transaction_factory_; | 76 delete ftp_transaction_factory_; |
| 77 delete http_transaction_factory_; | 77 delete http_transaction_factory_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 const std::string& TestShellRequestContext::GetUserAgent( | 80 const std::string& TestShellRequestContext::GetUserAgent( |
| 81 const GURL& url) const { | 81 const GURL& url) const { |
| 82 return webkit_glue::GetUserAgent(url); | 82 return webkit_glue::GetUserAgent(url); |
| 83 } | 83 } |
| OLD | NEW |