Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: content/shell/browser/shell_url_request_context_getter.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed too much, back up a bit Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 mapped_host_resolver->SetRulesFromString( 192 mapped_host_resolver->SetRulesFromString(
193 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); 193 command_line.GetSwitchValueASCII(switches::kHostResolverRules));
194 host_resolver = mapped_host_resolver.Pass(); 194 host_resolver = mapped_host_resolver.Pass();
195 } 195 }
196 196
197 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. 197 // Give |storage_| ownership at the end in case it's |mapped_host_resolver|.
198 storage_->set_host_resolver(host_resolver.Pass()); 198 storage_->set_host_resolver(host_resolver.Pass());
199 network_session_params.host_resolver = 199 network_session_params.host_resolver =
200 url_request_context_->host_resolver(); 200 url_request_context_->host_resolver();
201 201
202 storage_->set_http_network_session(
203 make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
202 net::HttpCache* main_cache = new net::HttpCache( 204 net::HttpCache* main_cache = new net::HttpCache(
203 network_session_params, main_backend); 205 storage_->http_network_session(), main_backend, true);
pauljensen 2015/09/02 14:32:29 /* set_up_quic_server_info */
mmenke 2015/09/02 16:29:33 Done.
204 storage_->set_http_transaction_factory(main_cache); 206 storage_->set_http_transaction_factory(main_cache);
205 207
206 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( 208 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
207 new net::URLRequestJobFactoryImpl()); 209 new net::URLRequestJobFactoryImpl());
208 // Keep ProtocolHandlers added in sync with 210 // Keep ProtocolHandlers added in sync with
209 // ShellContentBrowserClient::IsHandledURL(). 211 // ShellContentBrowserClient::IsHandledURL().
210 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_); 212 InstallProtocolHandlers(job_factory.get(), &protocol_handlers_);
211 bool set_protocol = job_factory->SetProtocolHandler( 213 bool set_protocol = job_factory->SetProtocolHandler(
212 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler)); 214 url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler));
213 DCHECK(set_protocol); 215 DCHECK(set_protocol);
(...skipping 27 matching lines...) Expand all
241 scoped_refptr<base::SingleThreadTaskRunner> 243 scoped_refptr<base::SingleThreadTaskRunner>
242 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 244 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
243 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 245 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
244 } 246 }
245 247
246 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 248 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
247 return url_request_context_->host_resolver(); 249 return url_request_context_->host_resolver();
248 } 250 }
249 251
250 } // namespace content 252 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698