OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/shell_url_request_context_getter.h" | 5 #include "content/shell/shell_url_request_context_getter.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
70 | 70 |
71 std::swap(protocol_handlers_, *protocol_handlers); | 71 std::swap(protocol_handlers_, *protocol_handlers); |
72 | 72 |
73 // We must create the proxy config service on the UI loop on Linux because it | 73 // We must create the proxy config service on the UI loop on Linux because it |
74 // must synchronously run on the glib message loop. This will be passed to | 74 // must synchronously run on the glib message loop. This will be passed to |
75 // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). | 75 // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). |
76 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 76 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
77 proxy_config_service_.reset( | 77 proxy_config_service_.reset( |
78 net::ProxyService::CreateSystemProxyConfigService( | 78 net::ProxyService::CreateSystemProxyConfigService( |
79 io_loop_->message_loop_proxy(), file_loop_)); | 79 io_loop_->message_loop_proxy().get(), file_loop_)); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { | 83 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { |
84 } | 84 } |
85 | 85 |
86 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 86 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
88 | 88 |
89 if (!url_request_context_) { | 89 if (!url_request_context_) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); | 122 net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); |
123 storage_->set_http_server_properties(new net::HttpServerPropertiesImpl); | 123 storage_->set_http_server_properties(new net::HttpServerPropertiesImpl); |
124 | 124 |
125 base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache")); | 125 base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache")); |
126 net::HttpCache::DefaultBackend* main_backend = | 126 net::HttpCache::DefaultBackend* main_backend = |
127 new net::HttpCache::DefaultBackend( | 127 new net::HttpCache::DefaultBackend( |
128 net::DISK_CACHE, | 128 net::DISK_CACHE, |
129 net::CACHE_BACKEND_DEFAULT, | 129 net::CACHE_BACKEND_DEFAULT, |
130 cache_path, | 130 cache_path, |
131 0, | 131 0, |
132 BrowserThread::GetMessageLoopProxyForThread( | 132 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
133 BrowserThread::CACHE)); | 133 .get()); |
134 | 134 |
135 net::HttpNetworkSession::Params network_session_params; | 135 net::HttpNetworkSession::Params network_session_params; |
136 network_session_params.cert_verifier = | 136 network_session_params.cert_verifier = |
137 url_request_context_->cert_verifier(); | 137 url_request_context_->cert_verifier(); |
138 network_session_params.server_bound_cert_service = | 138 network_session_params.server_bound_cert_service = |
139 url_request_context_->server_bound_cert_service(); | 139 url_request_context_->server_bound_cert_service(); |
140 network_session_params.proxy_service = | 140 network_session_params.proxy_service = |
141 url_request_context_->proxy_service(); | 141 url_request_context_->proxy_service(); |
142 network_session_params.ssl_config_service = | 142 network_session_params.ssl_config_service = |
143 url_request_context_->ssl_config_service(); | 143 url_request_context_->ssl_config_service(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 scoped_refptr<base::SingleThreadTaskRunner> | 200 scoped_refptr<base::SingleThreadTaskRunner> |
201 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 201 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
202 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 202 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
203 } | 203 } |
204 | 204 |
205 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 205 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
206 return url_request_context_->host_resolver(); | 206 return url_request_context_->host_resolver(); |
207 } | 207 } |
208 | 208 |
209 } // namespace content | 209 } // namespace content |
OLD | NEW |