| 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/ios_chrome_io_thread.h" | 5 #include "ios/chrome/browser/ios_chrome_io_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 context->set_transport_security_state( | 531 context->set_transport_security_state( |
| 532 globals->transport_security_state.get()); | 532 globals->transport_security_state.get()); |
| 533 context->set_cert_transparency_verifier( | 533 context->set_cert_transparency_verifier( |
| 534 globals->cert_transparency_verifier.get()); | 534 globals->cert_transparency_verifier.get()); |
| 535 context->set_ssl_config_service(globals->ssl_config_service.get()); | 535 context->set_ssl_config_service(globals->ssl_config_service.get()); |
| 536 context->set_http_auth_handler_factory( | 536 context->set_http_auth_handler_factory( |
| 537 globals->http_auth_handler_factory.get()); | 537 globals->http_auth_handler_factory.get()); |
| 538 context->set_proxy_service(globals->system_proxy_service.get()); | 538 context->set_proxy_service(globals->system_proxy_service.get()); |
| 539 context->set_ct_policy_enforcer(globals->ct_policy_enforcer.get()); | 539 context->set_ct_policy_enforcer(globals->ct_policy_enforcer.get()); |
| 540 | 540 |
| 541 net::URLRequestJobFactoryImpl* system_job_factory = | 541 std::unique_ptr<net::URLRequestJobFactoryImpl> system_job_factory = |
| 542 new net::URLRequestJobFactoryImpl(); | 542 net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers(); |
| 543 // Data URLs are always loaded through the system request context on iOS | 543 // Data URLs are always loaded through the system request context on iOS |
| 544 // (due to UIWebView limitations). | 544 // (due to UIWebView limitations). |
| 545 bool set_protocol = system_job_factory->SetProtocolHandler( | 545 bool set_protocol = system_job_factory->SetProtocolHandler( |
| 546 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); | 546 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); |
| 547 DCHECK(set_protocol); | 547 DCHECK(set_protocol); |
| 548 globals->system_url_request_job_factory.reset(system_job_factory); | 548 globals->system_url_request_job_factory = std::move(system_job_factory); |
| 549 context->set_job_factory(globals->system_url_request_job_factory.get()); | 549 context->set_job_factory(globals->system_url_request_job_factory.get()); |
| 550 | 550 |
| 551 context->set_cookie_store(globals->system_cookie_store.get()); | 551 context->set_cookie_store(globals->system_cookie_store.get()); |
| 552 context->set_channel_id_service(globals->system_channel_id_service.get()); | 552 context->set_channel_id_service(globals->system_channel_id_service.get()); |
| 553 context->set_network_delegate(globals->system_network_delegate.get()); | 553 context->set_network_delegate(globals->system_network_delegate.get()); |
| 554 context->set_http_user_agent_settings( | 554 context->set_http_user_agent_settings( |
| 555 globals->http_user_agent_settings.get()); | 555 globals->http_user_agent_settings.get()); |
| 556 context->set_network_quality_estimator( | 556 context->set_network_quality_estimator( |
| 557 globals->network_quality_estimator.get()); | 557 globals->network_quality_estimator.get()); |
| 558 | 558 |
| 559 context->set_http_server_properties(globals->http_server_properties.get()); | 559 context->set_http_server_properties(globals->http_server_properties.get()); |
| 560 | 560 |
| 561 net::HttpNetworkSession::Params system_params(params); | 561 net::HttpNetworkSession::Params system_params(params); |
| 562 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 562 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
| 563 context, &system_params); | 563 context, &system_params); |
| 564 | 564 |
| 565 globals->system_http_network_session.reset( | 565 globals->system_http_network_session.reset( |
| 566 new net::HttpNetworkSession(system_params)); | 566 new net::HttpNetworkSession(system_params)); |
| 567 globals->system_http_transaction_factory.reset( | 567 globals->system_http_transaction_factory.reset( |
| 568 new net::HttpNetworkLayer(globals->system_http_network_session.get())); | 568 new net::HttpNetworkLayer(globals->system_http_network_session.get())); |
| 569 context->set_http_transaction_factory( | 569 context->set_http_transaction_factory( |
| 570 globals->system_http_transaction_factory.get()); | 570 globals->system_http_transaction_factory.get()); |
| 571 | 571 |
| 572 return context; | 572 return context; |
| 573 } | 573 } |
| OLD | NEW |