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

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

Issue 2041863002: Remove HttpServerProperies::GetWeakPtr(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 6 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
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | components/cronet/ios/cronet_environment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 void URLRequestContextFactory::PopulateNetworkSessionParams( 284 void URLRequestContextFactory::PopulateNetworkSessionParams(
285 bool ignore_certificate_errors, 285 bool ignore_certificate_errors,
286 net::HttpNetworkSession::Params* params) { 286 net::HttpNetworkSession::Params* params) {
287 params->host_resolver = host_resolver_.get(); 287 params->host_resolver = host_resolver_.get();
288 params->cert_verifier = cert_verifier_.get(); 288 params->cert_verifier = cert_verifier_.get();
289 params->channel_id_service = channel_id_service_.get(); 289 params->channel_id_service = channel_id_service_.get();
290 params->ssl_config_service = ssl_config_service_.get(); 290 params->ssl_config_service = ssl_config_service_.get();
291 params->transport_security_state = transport_security_state_.get(); 291 params->transport_security_state = transport_security_state_.get();
292 params->http_auth_handler_factory = http_auth_handler_factory_.get(); 292 params->http_auth_handler_factory = http_auth_handler_factory_.get();
293 params->http_server_properties = http_server_properties_->GetWeakPtr(); 293 params->http_server_properties = http_server_properties_.get();
294 params->ignore_certificate_errors = ignore_certificate_errors; 294 params->ignore_certificate_errors = ignore_certificate_errors;
295 params->proxy_service = proxy_service_.get(); 295 params->proxy_service = proxy_service_.get();
296 } 296 }
297 297
298 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() { 298 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
299 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 299 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
300 InitializeSystemContextDependencies(); 300 InitializeSystemContextDependencies();
301 net::HttpNetworkSession::Params system_params; 301 net::HttpNetworkSession::Params system_params;
302 PopulateNetworkSessionParams(false, &system_params); 302 PopulateNetworkSessionParams(false, &system_params);
303 system_transaction_factory_.reset(new net::HttpNetworkLayer( 303 system_transaction_factory_.reset(new net::HttpNetworkLayer(
304 new net::HttpNetworkSession(system_params))); 304 new net::HttpNetworkSession(system_params)));
305 system_job_factory_.reset(new net::URLRequestJobFactoryImpl()); 305 system_job_factory_.reset(new net::URLRequestJobFactoryImpl());
306 system_cookie_store_ = 306 system_cookie_store_ =
307 content::CreateCookieStore(content::CookieStoreConfig()); 307 content::CreateCookieStore(content::CookieStoreConfig());
308 308
309 net::URLRequestContext* system_context = new net::URLRequestContext(); 309 net::URLRequestContext* system_context = new net::URLRequestContext();
310 system_context->set_host_resolver(host_resolver_.get()); 310 system_context->set_host_resolver(host_resolver_.get());
311 system_context->set_channel_id_service(channel_id_service_.get()); 311 system_context->set_channel_id_service(channel_id_service_.get());
312 system_context->set_cert_verifier(cert_verifier_.get()); 312 system_context->set_cert_verifier(cert_verifier_.get());
313 system_context->set_proxy_service(proxy_service_.get()); 313 system_context->set_proxy_service(proxy_service_.get());
314 system_context->set_ssl_config_service(ssl_config_service_.get()); 314 system_context->set_ssl_config_service(ssl_config_service_.get());
315 system_context->set_transport_security_state( 315 system_context->set_transport_security_state(
316 transport_security_state_.get()); 316 transport_security_state_.get());
317 system_context->set_http_auth_handler_factory( 317 system_context->set_http_auth_handler_factory(
318 http_auth_handler_factory_.get()); 318 http_auth_handler_factory_.get());
319 system_context->set_http_server_properties( 319 system_context->set_http_server_properties(http_server_properties_.get());
320 http_server_properties_->GetWeakPtr());
321 system_context->set_http_transaction_factory( 320 system_context->set_http_transaction_factory(
322 system_transaction_factory_.get()); 321 system_transaction_factory_.get());
323 system_context->set_http_user_agent_settings( 322 system_context->set_http_user_agent_settings(
324 http_user_agent_settings_.get()); 323 http_user_agent_settings_.get());
325 system_context->set_job_factory(system_job_factory_.get()); 324 system_context->set_job_factory(system_job_factory_.get());
326 system_context->set_cookie_store(system_cookie_store_.get()); 325 system_context->set_cookie_store(system_cookie_store_.get());
327 system_context->set_network_delegate(system_network_delegate_.get()); 326 system_context->set_network_delegate(system_network_delegate_.get());
328 system_context->set_net_log(net_log_); 327 system_context->set_net_log(net_log_);
329 return system_context; 328 return system_context;
330 } 329 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 375
377 net::URLRequestContext* main_context = new net::URLRequestContext(); 376 net::URLRequestContext* main_context = new net::URLRequestContext();
378 main_context->set_host_resolver(host_resolver_.get()); 377 main_context->set_host_resolver(host_resolver_.get());
379 main_context->set_channel_id_service(channel_id_service_.get()); 378 main_context->set_channel_id_service(channel_id_service_.get());
380 main_context->set_cert_verifier(cert_verifier_.get()); 379 main_context->set_cert_verifier(cert_verifier_.get());
381 main_context->set_proxy_service(proxy_service_.get()); 380 main_context->set_proxy_service(proxy_service_.get());
382 main_context->set_ssl_config_service(ssl_config_service_.get()); 381 main_context->set_ssl_config_service(ssl_config_service_.get());
383 main_context->set_transport_security_state(transport_security_state_.get()); 382 main_context->set_transport_security_state(transport_security_state_.get());
384 main_context->set_http_auth_handler_factory( 383 main_context->set_http_auth_handler_factory(
385 http_auth_handler_factory_.get()); 384 http_auth_handler_factory_.get());
386 main_context->set_http_server_properties( 385 main_context->set_http_server_properties(http_server_properties_.get());
387 http_server_properties_->GetWeakPtr());
388 main_context->set_cookie_store(main_cookie_store_.get()); 386 main_context->set_cookie_store(main_cookie_store_.get());
389 main_context->set_http_user_agent_settings( 387 main_context->set_http_user_agent_settings(
390 http_user_agent_settings_.get()); 388 http_user_agent_settings_.get());
391 389
392 main_context->set_http_transaction_factory( 390 main_context->set_http_transaction_factory(
393 main_transaction_factory_.get()); 391 main_transaction_factory_.get());
394 main_context->set_job_factory(main_job_factory_.get()); 392 main_context->set_job_factory(main_job_factory_.get());
395 main_context->set_network_delegate(app_network_delegate_.get()); 393 main_context->set_network_delegate(app_network_delegate_.get());
396 main_context->set_net_log(net_log_); 394 main_context->set_net_log(net_log_);
397 return main_context; 395 return main_context;
398 } 396 }
399 397
400 void URLRequestContextFactory::InitializeNetworkDelegates() { 398 void URLRequestContextFactory::InitializeNetworkDelegates() {
401 app_network_delegate_->Initialize(false); 399 app_network_delegate_->Initialize(false);
402 LOG(INFO) << "Initialized app network delegate."; 400 LOG(INFO) << "Initialized app network delegate.";
403 system_network_delegate_->Initialize(false); 401 system_network_delegate_->Initialize(false);
404 LOG(INFO) << "Initialized system network delegate."; 402 LOG(INFO) << "Initialized system network delegate.";
405 } 403 }
406 404
407 } // namespace shell 405 } // namespace shell
408 } // namespace chromecast 406 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_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