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

Side by Side Diff: chromecast/browser/url_request_context_factory.cc

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: rebase (needs fixing) Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/url_request_context_factory.h" 5 #include "chromecast/browser/url_request_context_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 void URLRequestContextFactory::InitializeMainContextDependencies( 224 void URLRequestContextFactory::InitializeMainContextDependencies(
225 net::HttpTransactionFactory* transaction_factory, 225 net::HttpTransactionFactory* transaction_factory,
226 content::ProtocolHandlerMap* protocol_handlers, 226 content::ProtocolHandlerMap* protocol_handlers,
227 content::URLRequestInterceptorScopedVector request_interceptors) { 227 content::URLRequestInterceptorScopedVector request_interceptors) {
228 if (main_dependencies_initialized_) 228 if (main_dependencies_initialized_)
229 return; 229 return;
230 230
231 main_transaction_factory_.reset(transaction_factory); 231 main_transaction_factory_.reset(transaction_factory);
232 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( 232 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory =
233 new net::URLRequestJobFactoryImpl()); 233 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers();
234 // Keep ProtocolHandlers added in sync with 234 // Keep ProtocolHandlers added in sync with
235 // CastContentBrowserClient::IsHandledURL(). 235 // CastContentBrowserClient::IsHandledURL().
236 bool set_protocol = false; 236 bool set_protocol = false;
237 for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin(); 237 for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin();
238 it != protocol_handlers->end(); 238 it != protocol_handlers->end();
239 ++it) { 239 ++it) {
240 set_protocol = job_factory->SetProtocolHandler( 240 set_protocol = job_factory->SetProtocolHandler(
241 it->first, base::WrapUnique(it->second.release())); 241 it->first, base::WrapUnique(it->second.release()));
242 DCHECK(set_protocol); 242 DCHECK(set_protocol);
243 } 243 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 params->proxy_service = proxy_service_.get(); 298 params->proxy_service = proxy_service_.get();
299 } 299 }
300 300
301 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() { 301 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
302 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 302 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
303 InitializeSystemContextDependencies(); 303 InitializeSystemContextDependencies();
304 net::HttpNetworkSession::Params system_params; 304 net::HttpNetworkSession::Params system_params;
305 PopulateNetworkSessionParams(false, &system_params); 305 PopulateNetworkSessionParams(false, &system_params);
306 system_transaction_factory_.reset(new net::HttpNetworkLayer( 306 system_transaction_factory_.reset(new net::HttpNetworkLayer(
307 new net::HttpNetworkSession(system_params))); 307 new net::HttpNetworkSession(system_params)));
308 system_job_factory_.reset(new net::URLRequestJobFactoryImpl()); 308 system_job_factory_ =
309 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers();
309 system_cookie_store_ = 310 system_cookie_store_ =
310 content::CreateCookieStore(content::CookieStoreConfig()); 311 content::CreateCookieStore(content::CookieStoreConfig());
311 312
312 net::URLRequestContext* system_context = new net::URLRequestContext(); 313 net::URLRequestContext* system_context = new net::URLRequestContext();
313 system_context->set_host_resolver(host_resolver_.get()); 314 system_context->set_host_resolver(host_resolver_.get());
314 system_context->set_channel_id_service(channel_id_service_.get()); 315 system_context->set_channel_id_service(channel_id_service_.get());
315 system_context->set_cert_verifier(cert_verifier_.get()); 316 system_context->set_cert_verifier(cert_verifier_.get());
316 system_context->set_proxy_service(proxy_service_.get()); 317 system_context->set_proxy_service(proxy_service_.get());
317 system_context->set_ssl_config_service(ssl_config_service_.get()); 318 system_context->set_ssl_config_service(ssl_config_service_.get());
318 system_context->set_transport_security_state( 319 system_context->set_transport_security_state(
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 401
401 void URLRequestContextFactory::InitializeNetworkDelegates() { 402 void URLRequestContextFactory::InitializeNetworkDelegates() {
402 app_network_delegate_->Initialize(false); 403 app_network_delegate_->Initialize(false);
403 LOG(INFO) << "Initialized app network delegate."; 404 LOG(INFO) << "Initialized app network delegate.";
404 system_network_delegate_->Initialize(false); 405 system_network_delegate_->Initialize(false);
405 LOG(INFO) << "Initialized system network delegate."; 406 LOG(INFO) << "Initialized system network delegate.";
406 } 407 }
407 408
408 } // namespace shell 409 } // namespace shell
409 } // namespace chromecast 410 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | components/cronet/ios/cronet_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698