OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell_url_request_context_getter.h" | 5 #include "content/shell/browser/shell_url_request_context_getter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 storage_->set_host_resolver(std::move(host_resolver)); | 202 storage_->set_host_resolver(std::move(host_resolver)); |
203 network_session_params.host_resolver = | 203 network_session_params.host_resolver = |
204 url_request_context_->host_resolver(); | 204 url_request_context_->host_resolver(); |
205 | 205 |
206 storage_->set_http_network_session( | 206 storage_->set_http_network_session( |
207 base::WrapUnique(new net::HttpNetworkSession(network_session_params))); | 207 base::WrapUnique(new net::HttpNetworkSession(network_session_params))); |
208 storage_->set_http_transaction_factory(base::WrapUnique(new net::HttpCache( | 208 storage_->set_http_transaction_factory(base::WrapUnique(new net::HttpCache( |
209 storage_->http_network_session(), std::move(main_backend), | 209 storage_->http_network_session(), std::move(main_backend), |
210 true /* set_up_quic_server_info */))); | 210 true /* set_up_quic_server_info */))); |
211 | 211 |
212 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 212 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory = |
213 new net::URLRequestJobFactoryImpl()); | 213 net::URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers(); |
214 // Keep ProtocolHandlers added in sync with | 214 // Keep ProtocolHandlers added in sync with |
215 // ShellContentBrowserClient::IsHandledURL(). | 215 // ShellContentBrowserClient::IsHandledURL(). |
216 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 216 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
217 bool set_protocol = job_factory->SetProtocolHandler( | 217 bool set_protocol = job_factory->SetProtocolHandler( |
218 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); | 218 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); |
219 DCHECK(set_protocol); | 219 DCHECK(set_protocol); |
220 #if !defined(DISABLE_FILE_SUPPORT) | 220 #if !defined(DISABLE_FILE_SUPPORT) |
221 set_protocol = job_factory->SetProtocolHandler( | 221 set_protocol = job_factory->SetProtocolHandler( |
222 url::kFileScheme, | 222 url::kFileScheme, |
223 base::WrapUnique(new net::FileProtocolHandler( | 223 base::WrapUnique(new net::FileProtocolHandler( |
(...skipping 23 matching lines...) Expand all Loading... |
247 scoped_refptr<base::SingleThreadTaskRunner> | 247 scoped_refptr<base::SingleThreadTaskRunner> |
248 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 248 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
249 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 249 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
250 } | 250 } |
251 | 251 |
252 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 252 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
253 return url_request_context_->host_resolver(); | 253 return url_request_context_->host_resolver(); |
254 } | 254 } |
255 | 255 |
256 } // namespace content | 256 } // namespace content |
OLD | NEW |