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