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

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

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: merge Created 4 years, 9 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() { 296 net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
297 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 297 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
298 InitializeSystemContextDependencies(); 298 InitializeSystemContextDependencies();
299 net::HttpNetworkSession::Params system_params; 299 net::HttpNetworkSession::Params system_params;
300 PopulateNetworkSessionParams(false, &system_params); 300 PopulateNetworkSessionParams(false, &system_params);
301 system_transaction_factory_.reset(new net::HttpNetworkLayer( 301 system_transaction_factory_.reset(new net::HttpNetworkLayer(
302 new net::HttpNetworkSession(system_params))); 302 new net::HttpNetworkSession(system_params)));
303 system_job_factory_.reset(new net::URLRequestJobFactoryImpl()); 303 system_job_factory_.reset(new net::URLRequestJobFactoryImpl());
304 system_cookie_store_ =
305 content::CreateCookieStore(content::CookieStoreConfig());
304 306
305 net::URLRequestContext* system_context = new net::URLRequestContext(); 307 net::URLRequestContext* system_context = new net::URLRequestContext();
306 system_context->set_host_resolver(host_resolver_.get()); 308 system_context->set_host_resolver(host_resolver_.get());
307 system_context->set_channel_id_service(channel_id_service_.get()); 309 system_context->set_channel_id_service(channel_id_service_.get());
308 system_context->set_cert_verifier(cert_verifier_.get()); 310 system_context->set_cert_verifier(cert_verifier_.get());
309 system_context->set_proxy_service(proxy_service_.get()); 311 system_context->set_proxy_service(proxy_service_.get());
310 system_context->set_ssl_config_service(ssl_config_service_.get()); 312 system_context->set_ssl_config_service(ssl_config_service_.get());
311 system_context->set_transport_security_state( 313 system_context->set_transport_security_state(
312 transport_security_state_.get()); 314 transport_security_state_.get());
313 system_context->set_http_auth_handler_factory( 315 system_context->set_http_auth_handler_factory(
314 http_auth_handler_factory_.get()); 316 http_auth_handler_factory_.get());
315 system_context->set_http_server_properties( 317 system_context->set_http_server_properties(
316 http_server_properties_->GetWeakPtr()); 318 http_server_properties_->GetWeakPtr());
317 system_context->set_http_transaction_factory( 319 system_context->set_http_transaction_factory(
318 system_transaction_factory_.get()); 320 system_transaction_factory_.get());
319 system_context->set_http_user_agent_settings( 321 system_context->set_http_user_agent_settings(
320 http_user_agent_settings_.get()); 322 http_user_agent_settings_.get());
321 system_context->set_job_factory(system_job_factory_.get()); 323 system_context->set_job_factory(system_job_factory_.get());
322 system_context->set_cookie_store( 324 system_context->set_cookie_store(system_cookie_store_.get());
323 content::CreateCookieStore(content::CookieStoreConfig()));
324 system_context->set_network_delegate(system_network_delegate_.get()); 325 system_context->set_network_delegate(system_network_delegate_.get());
325 system_context->set_net_log(net_log_); 326 system_context->set_net_log(net_log_);
326 return system_context; 327 return system_context;
327 } 328 }
328 329
329 net::URLRequestContext* URLRequestContextFactory::CreateMediaRequestContext() { 330 net::URLRequestContext* URLRequestContextFactory::CreateMediaRequestContext() {
330 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 331 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
331 DCHECK(main_getter_.get()) 332 DCHECK(main_getter_.get())
332 << "Getting MediaRequestContext before MainRequestContext"; 333 << "Getting MediaRequestContext before MainRequestContext";
333 net::URLRequestContext* main_context = main_getter_->GetURLRequestContext(); 334 net::URLRequestContext* main_context = main_getter_->GetURLRequestContext();
(...skipping 27 matching lines...) Expand all
361 net::HttpNetworkSession::Params network_session_params; 362 net::HttpNetworkSession::Params network_session_params;
362 PopulateNetworkSessionParams(ignore_certificate_errors, 363 PopulateNetworkSessionParams(ignore_certificate_errors,
363 &network_session_params); 364 &network_session_params);
364 InitializeMainContextDependencies( 365 InitializeMainContextDependencies(
365 new net::HttpNetworkLayer( 366 new net::HttpNetworkLayer(
366 new net::HttpNetworkSession(network_session_params)), 367 new net::HttpNetworkSession(network_session_params)),
367 protocol_handlers, std::move(request_interceptors)); 368 protocol_handlers, std::move(request_interceptors));
368 369
369 content::CookieStoreConfig cookie_config( 370 content::CookieStoreConfig cookie_config(
370 browser_context->GetPath().Append(kCookieStoreFile), 371 browser_context->GetPath().Append(kCookieStoreFile),
371 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES, 372 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES, nullptr, nullptr);
372 NULL, NULL); 373 main_cookie_store_ = content::CreateCookieStore(cookie_config);
373 cookie_config.background_task_runner =
374 scoped_refptr<base::SequencedTaskRunner>();
375 scoped_refptr<net::CookieStore> cookie_store =
376 content::CreateCookieStore(cookie_config);
377 374
378 net::URLRequestContext* main_context = new net::URLRequestContext(); 375 net::URLRequestContext* main_context = new net::URLRequestContext();
379 main_context->set_host_resolver(host_resolver_.get()); 376 main_context->set_host_resolver(host_resolver_.get());
380 main_context->set_channel_id_service(channel_id_service_.get()); 377 main_context->set_channel_id_service(channel_id_service_.get());
381 main_context->set_cert_verifier(cert_verifier_.get()); 378 main_context->set_cert_verifier(cert_verifier_.get());
382 main_context->set_proxy_service(proxy_service_.get()); 379 main_context->set_proxy_service(proxy_service_.get());
383 main_context->set_ssl_config_service(ssl_config_service_.get()); 380 main_context->set_ssl_config_service(ssl_config_service_.get());
384 main_context->set_transport_security_state(transport_security_state_.get()); 381 main_context->set_transport_security_state(transport_security_state_.get());
385 main_context->set_http_auth_handler_factory( 382 main_context->set_http_auth_handler_factory(
386 http_auth_handler_factory_.get()); 383 http_auth_handler_factory_.get());
387 main_context->set_http_server_properties( 384 main_context->set_http_server_properties(
388 http_server_properties_->GetWeakPtr()); 385 http_server_properties_->GetWeakPtr());
389 main_context->set_cookie_store(cookie_store.get()); 386 main_context->set_cookie_store(main_cookie_store_.get());
390 main_context->set_http_user_agent_settings( 387 main_context->set_http_user_agent_settings(
391 http_user_agent_settings_.get()); 388 http_user_agent_settings_.get());
392 389
393 main_context->set_http_transaction_factory( 390 main_context->set_http_transaction_factory(
394 main_transaction_factory_.get()); 391 main_transaction_factory_.get());
395 main_context->set_job_factory(main_job_factory_.get()); 392 main_context->set_job_factory(main_job_factory_.get());
396 main_context->set_network_delegate(app_network_delegate_.get()); 393 main_context->set_network_delegate(app_network_delegate_.get());
397 main_context->set_net_log(net_log_); 394 main_context->set_net_log(net_log_);
398 return main_context; 395 return main_context;
399 } 396 }
400 397
401 void URLRequestContextFactory::InitializeNetworkDelegates() { 398 void URLRequestContextFactory::InitializeNetworkDelegates() {
402 app_network_delegate_->Initialize(false); 399 app_network_delegate_->Initialize(false);
403 LOG(INFO) << "Initialized app network delegate."; 400 LOG(INFO) << "Initialized app network delegate.";
404 system_network_delegate_->Initialize(false); 401 system_network_delegate_->Initialize(false);
405 LOG(INFO) << "Initialized system network delegate."; 402 LOG(INFO) << "Initialized system network delegate.";
406 } 403 }
407 404
408 } // namespace shell 405 } // namespace shell
409 } // namespace chromecast 406 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/url_request_context_factory.h ('k') | components/policy/core/common/cloud/system_policy_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698