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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 context->set_cert_verifier(globals->cert_verifier.get()); | 1010 context->set_cert_verifier(globals->cert_verifier.get()); |
1011 context->set_transport_security_state( | 1011 context->set_transport_security_state( |
1012 globals->transport_security_state.get()); | 1012 globals->transport_security_state.get()); |
1013 context->set_cert_transparency_verifier( | 1013 context->set_cert_transparency_verifier( |
1014 globals->cert_transparency_verifier.get()); | 1014 globals->cert_transparency_verifier.get()); |
1015 context->set_ssl_config_service(globals->ssl_config_service.get()); | 1015 context->set_ssl_config_service(globals->ssl_config_service.get()); |
1016 context->set_http_auth_handler_factory( | 1016 context->set_http_auth_handler_factory( |
1017 globals->http_auth_handler_factory.get()); | 1017 globals->http_auth_handler_factory.get()); |
1018 context->set_proxy_service(globals->system_proxy_service.get()); | 1018 context->set_proxy_service(globals->system_proxy_service.get()); |
1019 | 1019 |
1020 net::URLRequestJobFactoryImpl* system_job_factory = | 1020 std::unique_ptr<net::URLRequestJobFactoryImpl> system_job_factory = |
1021 new net::URLRequestJobFactoryImpl(); | 1021 net::URLRequestJobFactoryImpl::CreateWithDefaultProtocolHandlers(); |
1022 // Data URLs are always loaded through the system request context on iOS | 1022 // Data URLs are always loaded through the system request context on iOS |
1023 // (due to UIWebView limitations). | 1023 // (due to UIWebView limitations). |
1024 bool set_protocol = system_job_factory->SetProtocolHandler( | 1024 bool set_protocol = system_job_factory->SetProtocolHandler( |
1025 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); | 1025 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); |
1026 DCHECK(set_protocol); | 1026 DCHECK(set_protocol); |
1027 globals->system_url_request_job_factory.reset(system_job_factory); | 1027 globals->system_url_request_job_factory = std::move(system_job_factory); |
1028 context->set_job_factory(globals->system_url_request_job_factory.get()); | 1028 context->set_job_factory(globals->system_url_request_job_factory.get()); |
1029 | 1029 |
1030 context->set_cookie_store(globals->system_cookie_store.get()); | 1030 context->set_cookie_store(globals->system_cookie_store.get()); |
1031 context->set_channel_id_service(globals->system_channel_id_service.get()); | 1031 context->set_channel_id_service(globals->system_channel_id_service.get()); |
1032 context->set_network_delegate(globals->system_network_delegate.get()); | 1032 context->set_network_delegate(globals->system_network_delegate.get()); |
1033 context->set_http_user_agent_settings( | 1033 context->set_http_user_agent_settings( |
1034 globals->http_user_agent_settings.get()); | 1034 globals->http_user_agent_settings.get()); |
1035 context->set_network_quality_estimator( | 1035 context->set_network_quality_estimator( |
1036 globals->network_quality_estimator.get()); | 1036 globals->network_quality_estimator.get()); |
1037 context->set_backoff_manager(globals->url_request_backoff_manager.get()); | 1037 context->set_backoff_manager(globals->url_request_backoff_manager.get()); |
1038 | 1038 |
1039 context->set_http_server_properties( | 1039 context->set_http_server_properties( |
1040 globals->http_server_properties->GetWeakPtr()); | 1040 globals->http_server_properties->GetWeakPtr()); |
1041 | 1041 |
1042 net::HttpNetworkSession::Params system_params; | 1042 net::HttpNetworkSession::Params system_params; |
1043 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); | 1043 InitializeNetworkSessionParamsFromGlobals(*globals, &system_params); |
1044 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 1044 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1045 context, &system_params); | 1045 context, &system_params); |
1046 | 1046 |
1047 globals->system_http_network_session.reset( | 1047 globals->system_http_network_session.reset( |
1048 new net::HttpNetworkSession(system_params)); | 1048 new net::HttpNetworkSession(system_params)); |
1049 globals->system_http_transaction_factory.reset( | 1049 globals->system_http_transaction_factory.reset( |
1050 new net::HttpNetworkLayer(globals->system_http_network_session.get())); | 1050 new net::HttpNetworkLayer(globals->system_http_network_session.get())); |
1051 context->set_http_transaction_factory( | 1051 context->set_http_transaction_factory( |
1052 globals->system_http_transaction_factory.get()); | 1052 globals->system_http_transaction_factory.get()); |
1053 | 1053 |
1054 return context; | 1054 return context; |
1055 } | 1055 } |
OLD | NEW |