OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( | 376 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( |
377 new net::HttpCache::DefaultBackend( | 377 new net::HttpCache::DefaultBackend( |
378 net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, | 378 net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, |
379 lazy_params_->cache_path, lazy_params_->cache_max_size, | 379 lazy_params_->cache_path, lazy_params_->cache_max_size, |
380 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE))); | 380 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE))); |
381 http_network_session_ = CreateHttpNetworkSession(*profile_params); | 381 http_network_session_ = CreateHttpNetworkSession(*profile_params); |
382 main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(), | 382 main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(), |
383 std::move(main_backend)); | 383 std::move(main_backend)); |
384 main_context->set_http_transaction_factory(main_http_factory_.get()); | 384 main_context->set_http_transaction_factory(main_http_factory_.get()); |
385 | 385 |
386 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 386 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory = |
387 new net::URLRequestJobFactoryImpl()); | 387 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers(); |
388 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 388 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
389 | 389 |
390 // TODO(crbug.com/592012): Delete request_interceptor and its handling if | 390 // TODO(crbug.com/592012): Delete request_interceptor and its handling if |
391 // it's not needed in the future. | 391 // it's not needed in the future. |
392 URLRequestInterceptorScopedVector request_interceptors; | 392 URLRequestInterceptorScopedVector request_interceptors; |
393 main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory), | 393 main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory), |
394 std::move(request_interceptors), | 394 std::move(request_interceptors), |
395 main_context->network_delegate()); | 395 main_context->network_delegate()); |
396 main_context->set_job_factory(main_job_factory_.get()); | 396 main_context->set_job_factory(main_job_factory_.get()); |
397 main_context->set_network_quality_estimator( | 397 main_context->set_network_quality_estimator( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 std::unique_ptr<net::CookieStore> cookie_store = | 439 std::unique_ptr<net::CookieStore> cookie_store = |
440 cookie_util::CreateCookieStore(ios_cookie_config); | 440 cookie_util::CreateCookieStore(ios_cookie_config); |
441 | 441 |
442 // Transfer ownership of the ChannelIDStore, HttpNetworkSession, cookies, and | 442 // Transfer ownership of the ChannelIDStore, HttpNetworkSession, cookies, and |
443 // cache to AppRequestContext. | 443 // cache to AppRequestContext. |
444 context->SetChannelIDService(std::move(channel_id_service)); | 444 context->SetChannelIDService(std::move(channel_id_service)); |
445 context->SetHttpNetworkSession(std::move(http_network_session)); | 445 context->SetHttpNetworkSession(std::move(http_network_session)); |
446 context->SetCookieStore(std::move(cookie_store)); | 446 context->SetCookieStore(std::move(cookie_store)); |
447 context->SetHttpTransactionFactory(std::move(app_http_cache)); | 447 context->SetHttpTransactionFactory(std::move(app_http_cache)); |
448 | 448 |
449 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 449 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory = |
450 new net::URLRequestJobFactoryImpl()); | 450 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers(); |
451 // TODO(crbug.com/592012): Delete request_interceptor and its handling if | 451 // TODO(crbug.com/592012): Delete request_interceptor and its handling if |
452 // it's not needed in the future. | 452 // it's not needed in the future. |
453 URLRequestInterceptorScopedVector request_interceptors; | 453 URLRequestInterceptorScopedVector request_interceptors; |
454 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( | 454 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( |
455 SetUpJobFactoryDefaults(std::move(job_factory), | 455 SetUpJobFactoryDefaults(std::move(job_factory), |
456 std::move(request_interceptors), | 456 std::move(request_interceptors), |
457 main_context->network_delegate())); | 457 main_context->network_delegate())); |
458 context->SetJobFactory(std::move(top_job_factory)); | 458 context->SetJobFactory(std::move(top_job_factory)); |
459 | 459 |
460 return context; | 460 return context; |
(...skipping 14 matching lines...) Expand all Loading... |
475 const base::Closure& completion) { | 475 const base::Closure& completion) { |
476 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 476 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
477 DCHECK(initialized()); | 477 DCHECK(initialized()); |
478 | 478 |
479 DCHECK(transport_security_state()); | 479 DCHECK(transport_security_state()); |
480 // Completes synchronously. | 480 // Completes synchronously. |
481 transport_security_state()->DeleteAllDynamicDataSince(time); | 481 transport_security_state()->DeleteAllDynamicDataSince(time); |
482 DCHECK(http_server_properties_manager_); | 482 DCHECK(http_server_properties_manager_); |
483 http_server_properties_manager_->Clear(completion); | 483 http_server_properties_manager_->Clear(completion); |
484 } | 484 } |
OLD | NEW |