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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( | 378 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( |
379 new net::HttpCache::DefaultBackend( | 379 new net::HttpCache::DefaultBackend( |
380 net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, | 380 net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, |
381 lazy_params_->cache_path, lazy_params_->cache_max_size, | 381 lazy_params_->cache_path, lazy_params_->cache_max_size, |
382 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE))); | 382 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE))); |
383 http_network_session_ = CreateHttpNetworkSession(*profile_params); | 383 http_network_session_ = CreateHttpNetworkSession(*profile_params); |
384 main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(), | 384 main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(), |
385 std::move(main_backend)); | 385 std::move(main_backend)); |
386 main_context->set_http_transaction_factory(main_http_factory_.get()); | 386 main_context->set_http_transaction_factory(main_http_factory_.get()); |
387 | 387 |
388 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 388 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory = |
389 new net::URLRequestJobFactoryImpl()); | 389 net::URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers(); |
390 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 390 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
391 | 391 |
392 // TODO(crbug.com/592012): Delete request_interceptor and its handling if | 392 // TODO(crbug.com/592012): Delete request_interceptor and its handling if |
393 // it's not needed in the future. | 393 // it's not needed in the future. |
394 URLRequestInterceptorScopedVector request_interceptors; | 394 URLRequestInterceptorScopedVector request_interceptors; |
395 main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory), | 395 main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory), |
396 std::move(request_interceptors), | 396 std::move(request_interceptors), |
397 main_context->network_delegate()); | 397 main_context->network_delegate()); |
398 main_context->set_job_factory(main_job_factory_.get()); | 398 main_context->set_job_factory(main_job_factory_.get()); |
399 main_context->set_network_quality_estimator( | 399 main_context->set_network_quality_estimator( |
(...skipping 26 matching lines...) Expand all Loading... |
426 base::FilePath(), | 426 base::FilePath(), |
427 cookie_util::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | 427 cookie_util::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, |
428 cookie_util::CookieStoreConfig::COOKIE_STORE_IOS, nullptr); | 428 cookie_util::CookieStoreConfig::COOKIE_STORE_IOS, nullptr); |
429 std::unique_ptr<net::CookieStore> cookie_store = | 429 std::unique_ptr<net::CookieStore> cookie_store = |
430 cookie_util::CreateCookieStore(ios_cookie_config); | 430 cookie_util::CreateCookieStore(ios_cookie_config); |
431 | 431 |
432 // Transfer ownership of the cookies and cache to AppRequestContext. | 432 // Transfer ownership of the cookies and cache to AppRequestContext. |
433 context->SetCookieStore(std::move(cookie_store)); | 433 context->SetCookieStore(std::move(cookie_store)); |
434 context->SetHttpTransactionFactory(std::move(app_http_cache)); | 434 context->SetHttpTransactionFactory(std::move(app_http_cache)); |
435 | 435 |
436 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 436 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory = |
437 new net::URLRequestJobFactoryImpl()); | 437 net::URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers(); |
438 // TODO(crbug.com/592012): Delete request_interceptor and its handling if | 438 // TODO(crbug.com/592012): Delete request_interceptor and its handling if |
439 // it's not needed in the future. | 439 // it's not needed in the future. |
440 URLRequestInterceptorScopedVector request_interceptors; | 440 URLRequestInterceptorScopedVector request_interceptors; |
441 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( | 441 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( |
442 SetUpJobFactoryDefaults(std::move(job_factory), | 442 SetUpJobFactoryDefaults(std::move(job_factory), |
443 std::move(request_interceptors), | 443 std::move(request_interceptors), |
444 main_context->network_delegate())); | 444 main_context->network_delegate())); |
445 context->SetJobFactory(std::move(top_job_factory)); | 445 context->SetJobFactory(std::move(top_job_factory)); |
446 | 446 |
447 return context; | 447 return context; |
(...skipping 14 matching lines...) Expand all Loading... |
462 const base::Closure& completion) { | 462 const base::Closure& completion) { |
463 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 463 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
464 DCHECK(initialized()); | 464 DCHECK(initialized()); |
465 | 465 |
466 DCHECK(transport_security_state()); | 466 DCHECK(transport_security_state()); |
467 // Completes synchronously. | 467 // Completes synchronously. |
468 transport_security_state()->DeleteAllDynamicDataSince(time); | 468 transport_security_state()->DeleteAllDynamicDataSince(time); |
469 DCHECK(http_server_properties_manager_); | 469 DCHECK(http_server_properties_manager_); |
470 http_server_properties_manager_->Clear(completion); | 470 http_server_properties_manager_->Clear(completion); |
471 } | 471 } |
OLD | NEW |