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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 mapped_host_resolver->SetRulesFromString( | 194 mapped_host_resolver->SetRulesFromString( |
195 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); | 195 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); |
196 host_resolver = mapped_host_resolver.Pass(); | 196 host_resolver = mapped_host_resolver.Pass(); |
197 } | 197 } |
198 | 198 |
199 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. | 199 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. |
200 storage_->set_host_resolver(host_resolver.Pass()); | 200 storage_->set_host_resolver(host_resolver.Pass()); |
201 network_session_params.host_resolver = | 201 network_session_params.host_resolver = |
202 url_request_context_->host_resolver(); | 202 url_request_context_->host_resolver(); |
203 | 203 |
| 204 storage_->set_http_network_session( |
| 205 make_scoped_ptr(new net::HttpNetworkSession(network_session_params))); |
204 storage_->set_http_transaction_factory(make_scoped_ptr( | 206 storage_->set_http_transaction_factory(make_scoped_ptr( |
205 new net::HttpCache(network_session_params, main_backend))); | 207 new net::HttpCache(storage_->http_network_session(), main_backend, |
| 208 true /* set_up_quic_server_info */))); |
206 | 209 |
207 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 210 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
208 new net::URLRequestJobFactoryImpl()); | 211 new net::URLRequestJobFactoryImpl()); |
209 // Keep ProtocolHandlers added in sync with | 212 // Keep ProtocolHandlers added in sync with |
210 // ShellContentBrowserClient::IsHandledURL(). | 213 // ShellContentBrowserClient::IsHandledURL(). |
211 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); | 214 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); |
212 bool set_protocol = job_factory->SetProtocolHandler( | 215 bool set_protocol = job_factory->SetProtocolHandler( |
213 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); | 216 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); |
214 DCHECK(set_protocol); | 217 DCHECK(set_protocol); |
215 #if !defined(DISABLE_FILE_SUPPORT) | 218 #if !defined(DISABLE_FILE_SUPPORT) |
(...skipping 26 matching lines...) Expand all Loading... |
242 scoped_refptr<base::SingleThreadTaskRunner> | 245 scoped_refptr<base::SingleThreadTaskRunner> |
243 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 246 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
244 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 247 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
245 } | 248 } |
246 | 249 |
247 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 250 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
248 return url_request_context_->host_resolver(); | 251 return url_request_context_->host_resolver(); |
249 } | 252 } |
250 | 253 |
251 } // namespace content | 254 } // namespace content |
OLD | NEW |