| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 storage_->set_host_resolver(std::move(host_resolver)); | 213 storage_->set_host_resolver(std::move(host_resolver)); |
| 214 network_session_params.host_resolver = | 214 network_session_params.host_resolver = |
| 215 url_request_context_->host_resolver(); | 215 url_request_context_->host_resolver(); |
| 216 | 216 |
| 217 storage_->set_http_network_session( | 217 storage_->set_http_network_session( |
| 218 base::MakeUnique<net::HttpNetworkSession>(network_session_params)); | 218 base::MakeUnique<net::HttpNetworkSession>(network_session_params)); |
| 219 storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( | 219 storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( |
| 220 storage_->http_network_session(), std::move(main_backend), | 220 storage_->http_network_session(), std::move(main_backend), |
| 221 true /* set_up_quic_server_info */)); | 221 true /* set_up_quic_server_info */)); |
| 222 | 222 |
| 223 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 223 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory = |
| 224 new net::URLRequestJobFactoryImpl()); | 224 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers(); |
| 225 // Keep ProtocolHandlers added in sync with | 225 // Keep ProtocolHandlers added in sync with |
| 226 // ShellContentBrowserClient::IsHandledURL(). | 226 // ShellContentBrowserClient::IsHandledURL(). |
| 227 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 227 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
| 228 bool set_protocol = job_factory->SetProtocolHandler( | 228 bool set_protocol = job_factory->SetProtocolHandler( |
| 229 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); | 229 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); |
| 230 DCHECK(set_protocol); | 230 DCHECK(set_protocol); |
| 231 #if !defined(DISABLE_FILE_SUPPORT) | 231 #if !defined(DISABLE_FILE_SUPPORT) |
| 232 set_protocol = job_factory->SetProtocolHandler( | 232 set_protocol = job_factory->SetProtocolHandler( |
| 233 url::kFileScheme, | 233 url::kFileScheme, |
| 234 base::MakeUnique<net::FileProtocolHandler>( | 234 base::MakeUnique<net::FileProtocolHandler>( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 258 scoped_refptr<base::SingleThreadTaskRunner> | 258 scoped_refptr<base::SingleThreadTaskRunner> |
| 259 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 259 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 260 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 260 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 261 } | 261 } |
| 262 | 262 |
| 263 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 263 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
| 264 return url_request_context_->host_resolver(); | 264 return url_request_context_->host_resolver(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace content | 267 } // namespace content |
| OLD | NEW |