| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 net::ProxyService::CreateSystemProxyConfigService( | 59 net::ProxyService::CreateSystemProxyConfigService( |
| 60 MessageLoop::current(), NULL)); | 60 MessageLoop::current(), NULL)); |
| 61 #endif | 61 #endif |
| 62 host_resolver_ = | 62 host_resolver_ = |
| 63 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 63 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 64 NULL); | 64 NULL); |
| 65 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), | 65 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), |
| 66 false, 0, NULL, NULL, NULL); | 66 false, 0, NULL, NULL, NULL); |
| 67 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); | 67 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); |
| 68 | 68 |
| 69 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); | 69 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
| 70 host_resolver_); |
| 70 | 71 |
| 71 net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( | 72 net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend( |
| 72 cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, | 73 cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, |
| 73 cache_path, 0, SimpleResourceLoaderBridge::GetCacheThread()); | 74 cache_path, 0, SimpleResourceLoaderBridge::GetCacheThread()); |
| 74 | 75 |
| 75 net::HttpCache* cache = | 76 net::HttpCache* cache = |
| 76 new net::HttpCache(host_resolver_, proxy_service_, ssl_config_service_, | 77 new net::HttpCache(host_resolver_, proxy_service_, ssl_config_service_, |
| 77 http_auth_handler_factory_, NULL, NULL, backend); | 78 http_auth_handler_factory_, NULL, NULL, backend); |
| 78 | 79 |
| 79 cache->set_mode(cache_mode); | 80 cache->set_mode(cache_mode); |
| 80 http_transaction_factory_ = cache; | 81 http_transaction_factory_ = cache; |
| 81 | 82 |
| 82 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 83 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
| 83 | 84 |
| 84 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); | 85 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); |
| 85 } | 86 } |
| 86 | 87 |
| 87 TestShellRequestContext::~TestShellRequestContext() { | 88 TestShellRequestContext::~TestShellRequestContext() { |
| 88 delete ftp_transaction_factory_; | 89 delete ftp_transaction_factory_; |
| 89 delete http_transaction_factory_; | 90 delete http_transaction_factory_; |
| 90 delete http_auth_handler_factory_; | 91 delete http_auth_handler_factory_; |
| 91 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); | 92 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); |
| 92 } | 93 } |
| 93 | 94 |
| 94 const std::string& TestShellRequestContext::GetUserAgent( | 95 const std::string& TestShellRequestContext::GetUserAgent( |
| 95 const GURL& url) const { | 96 const GURL& url) const { |
| 96 return webkit_glue::GetUserAgent(url); | 97 return webkit_glue::GetUserAgent(url); |
| 97 } | 98 } |
| OLD | NEW |