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

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

Issue 606513002: Pass the system url request context getter to the cast service so that it can be used by various sy… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/shell/browser/url_request_context_factory.h" 5 #include "chromecast/shell/browser/url_request_context_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 params->use_alternate_protocols = true; 296 params->use_alternate_protocols = true;
297 } 297 }
298 298
299 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() { 299 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
300 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 300 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
301 InitializeSystemContextDependencies(); 301 InitializeSystemContextDependencies();
302 net::HttpNetworkSession::Params system_params; 302 net::HttpNetworkSession::Params system_params;
303 PopulateNetworkSessionParams(false, &system_params); 303 PopulateNetworkSessionParams(false, &system_params);
304 system_transaction_factory_.reset(new net::HttpNetworkLayer( 304 system_transaction_factory_.reset(new net::HttpNetworkLayer(
305 new net::HttpNetworkSession(system_params))); 305 new net::HttpNetworkSession(system_params)));
306 system_job_factory_.reset(new net::URLRequestJobFactoryImpl());
306 307
307 net::URLRequestContext* system_context = new net::URLRequestContext(); 308 net::URLRequestContext* system_context = new net::URLRequestContext();
308 system_context->set_host_resolver(host_resolver_.get()); 309 system_context->set_host_resolver(host_resolver_.get());
309 system_context->set_channel_id_service(channel_id_service_.get()); 310 system_context->set_channel_id_service(channel_id_service_.get());
310 system_context->set_cert_verifier(cert_verifier_.get()); 311 system_context->set_cert_verifier(cert_verifier_.get());
311 system_context->set_proxy_service(proxy_service_.get()); 312 system_context->set_proxy_service(proxy_service_.get());
312 system_context->set_ssl_config_service(ssl_config_service_.get()); 313 system_context->set_ssl_config_service(ssl_config_service_.get());
313 system_context->set_transport_security_state( 314 system_context->set_transport_security_state(
314 transport_security_state_.get()); 315 transport_security_state_.get());
315 system_context->set_http_auth_handler_factory( 316 system_context->set_http_auth_handler_factory(
316 http_auth_handler_factory_.get()); 317 http_auth_handler_factory_.get());
317 system_context->set_http_server_properties( 318 system_context->set_http_server_properties(
318 http_server_properties_->GetWeakPtr()); 319 http_server_properties_->GetWeakPtr());
319 system_context->set_http_transaction_factory( 320 system_context->set_http_transaction_factory(
320 system_transaction_factory_.get()); 321 system_transaction_factory_.get());
321 system_context->set_http_user_agent_settings( 322 system_context->set_http_user_agent_settings(
322 http_user_agent_settings_.get()); 323 http_user_agent_settings_.get());
324 system_context->set_job_factory(system_job_factory_.get());
323 system_context->set_cookie_store( 325 system_context->set_cookie_store(
324 content::CreateCookieStore(content::CookieStoreConfig())); 326 content::CreateCookieStore(content::CookieStoreConfig()));
325 return system_context; 327 return system_context;
326 } 328 }
327 329
328 net::URLRequestContext* URLRequestContextFactory::CreateMediaRequestContext() { 330 net::URLRequestContext* URLRequestContextFactory::CreateMediaRequestContext() {
329 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 331 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
330 DCHECK(main_getter_.get()) 332 DCHECK(main_getter_.get())
331 << "Getting MediaRequestContext before MainRequestContext"; 333 << "Getting MediaRequestContext before MainRequestContext";
332 net::URLRequestContext* main_context = main_getter_->GetURLRequestContext(); 334 net::URLRequestContext* main_context = main_getter_->GetURLRequestContext();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 http_user_agent_settings_.get()); 394 http_user_agent_settings_.get());
393 395
394 main_context->set_http_transaction_factory( 396 main_context->set_http_transaction_factory(
395 main_transaction_factory_.get()); 397 main_transaction_factory_.get());
396 main_context->set_job_factory(main_job_factory_.get()); 398 main_context->set_job_factory(main_job_factory_.get());
397 return main_context; 399 return main_context;
398 } 400 }
399 401
400 } // namespace shell 402 } // namespace shell
401 } // namespace chromecast 403 } // namespace chromecast
OLDNEW
« chromecast/service/cast_service.h ('K') | « chromecast/shell/browser/url_request_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698