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" |
11 #include "net/base/host_resolver.h" | 11 #include "net/base/host_resolver.h" |
12 #include "net/base/ssl_config_service.h" | 12 #include "net/base/ssl_config_service.h" |
13 #include "net/base/static_cookie_policy.h" | 13 #include "net/base/static_cookie_policy.h" |
14 #include "net/ftp/ftp_network_layer.h" | 14 #include "net/ftp/ftp_network_layer.h" |
15 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
16 #include "net/proxy/proxy_config_service.h" | 16 #include "net/proxy/proxy_config_service.h" |
17 #include "net/proxy/proxy_config_service_fixed.h" | 17 #include "net/proxy/proxy_config_service_fixed.h" |
18 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
| 19 #include "webkit/blob/blob_storage_controller.h" |
19 #include "webkit/glue/webkit_glue.h" | 20 #include "webkit/glue/webkit_glue.h" |
20 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 21 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
21 | 22 |
22 TestShellRequestContext::TestShellRequestContext() { | 23 TestShellRequestContext::TestShellRequestContext() { |
23 Init(FilePath(), net::HttpCache::NORMAL, false); | 24 Init(FilePath(), net::HttpCache::NORMAL, false); |
24 } | 25 } |
25 | 26 |
26 TestShellRequestContext::TestShellRequestContext( | 27 TestShellRequestContext::TestShellRequestContext( |
27 const FilePath& cache_path, | 28 const FilePath& cache_path, |
28 net::HttpCache::Mode cache_mode, | 29 net::HttpCache::Mode cache_mode, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 cache_path, 0, SimpleResourceLoaderBridge::GetCacheThread()); | 73 cache_path, 0, SimpleResourceLoaderBridge::GetCacheThread()); |
73 | 74 |
74 net::HttpCache* cache = | 75 net::HttpCache* cache = |
75 new net::HttpCache(host_resolver_, proxy_service_, ssl_config_service_, | 76 new net::HttpCache(host_resolver_, proxy_service_, ssl_config_service_, |
76 http_auth_handler_factory_, NULL, NULL, backend); | 77 http_auth_handler_factory_, NULL, NULL, backend); |
77 | 78 |
78 cache->set_mode(cache_mode); | 79 cache->set_mode(cache_mode); |
79 http_transaction_factory_ = cache; | 80 http_transaction_factory_ = cache; |
80 | 81 |
81 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); | 82 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); |
| 83 |
| 84 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); |
82 } | 85 } |
83 | 86 |
84 TestShellRequestContext::~TestShellRequestContext() { | 87 TestShellRequestContext::~TestShellRequestContext() { |
85 delete ftp_transaction_factory_; | 88 delete ftp_transaction_factory_; |
86 delete http_transaction_factory_; | 89 delete http_transaction_factory_; |
87 delete http_auth_handler_factory_; | 90 delete http_auth_handler_factory_; |
88 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); | 91 delete static_cast<net::StaticCookiePolicy*>(cookie_policy_); |
89 } | 92 } |
90 | 93 |
91 const std::string& TestShellRequestContext::GetUserAgent( | 94 const std::string& TestShellRequestContext::GetUserAgent( |
92 const GURL& url) const { | 95 const GURL& url) const { |
93 return webkit_glue::GetUserAgent(url); | 96 return webkit_glue::GetUserAgent(url); |
94 } | 97 } |
OLD | NEW |