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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 2860813002: IOThread::ConstructSystemRequestContext defrag. (Closed)
Patch Set: empty name by default Created 3 years, 7 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
« no previous file with comments | « no previous file | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 bool IOThread::PacHttpsUrlStrippingEnabled() const { 881 bool IOThread::PacHttpsUrlStrippingEnabled() const {
882 return pac_https_url_stripping_enabled_.GetValue(); 882 return pac_https_url_stripping_enabled_.GetValue();
883 } 883 }
884 884
885 // static 885 // static
886 net::URLRequestContext* IOThread::ConstructSystemRequestContext( 886 net::URLRequestContext* IOThread::ConstructSystemRequestContext(
887 IOThread::Globals* globals, 887 IOThread::Globals* globals,
888 const net::HttpNetworkSession::Params& params, 888 const net::HttpNetworkSession::Params& params,
889 net::NetLog* net_log) { 889 net::NetLog* net_log) {
890 net::URLRequestContext* context = new SystemURLRequestContext; 890 net::URLRequestContext* context = new SystemURLRequestContext;
891
892 context->set_network_quality_estimator(
893 globals->network_quality_estimator.get());
894 context->set_enable_brotli(globals->enable_brotli);
895 context->set_name("system");
896
897 context->set_http_user_agent_settings(
898 globals->http_user_agent_settings.get());
899 context->set_network_delegate(globals->system_network_delegate.get());
891 context->set_net_log(net_log); 900 context->set_net_log(net_log);
892 context->set_host_resolver(globals->host_resolver.get()); 901 context->set_host_resolver(globals->host_resolver.get());
893 context->set_cert_verifier(globals->cert_verifier.get()); 902 context->set_proxy_service(globals->system_proxy_service.get());
894 context->set_transport_security_state(
895 globals->transport_security_state.get());
896 context->set_cert_transparency_verifier(
897 globals->cert_transparency_verifier.get());
898 context->set_ct_policy_enforcer(globals->ct_policy_enforcer.get());
899 context->set_ssl_config_service(globals->ssl_config_service.get()); 903 context->set_ssl_config_service(globals->ssl_config_service.get());
900 context->set_http_auth_handler_factory( 904 context->set_http_auth_handler_factory(
901 globals->http_auth_handler_factory.get()); 905 globals->http_auth_handler_factory.get());
902 context->set_proxy_service(globals->system_proxy_service.get());
903
904 globals->system_url_request_job_factory.reset(
905 new net::URLRequestJobFactoryImpl());
906 context->set_job_factory(globals->system_url_request_job_factory.get());
907 906
908 context->set_cookie_store(globals->system_cookie_store.get()); 907 context->set_cookie_store(globals->system_cookie_store.get());
909 context->set_channel_id_service( 908 context->set_channel_id_service(
910 globals->system_channel_id_service.get()); 909 globals->system_channel_id_service.get());
911 context->set_network_delegate(globals->system_network_delegate.get()); 910 context->set_transport_security_state(
912 context->set_http_user_agent_settings( 911 globals->transport_security_state.get());
913 globals->http_user_agent_settings.get());
914 context->set_network_quality_estimator(
915 globals->network_quality_estimator.get());
916 912
917 context->set_http_server_properties(globals->http_server_properties.get()); 913 context->set_http_server_properties(globals->http_server_properties.get());
918 914
919 context->set_enable_brotli(globals->enable_brotli); 915 context->set_cert_verifier(globals->cert_verifier.get());
916 context->set_cert_transparency_verifier(
917 globals->cert_transparency_verifier.get());
918 context->set_ct_policy_enforcer(globals->ct_policy_enforcer.get());
920 919
921 net::HttpNetworkSession::Params system_params(params); 920 net::HttpNetworkSession::Params system_params(params);
922 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( 921 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(
923 context, &system_params); 922 context, &system_params);
924 923
925 globals->system_http_network_session.reset( 924 globals->system_http_network_session.reset(
926 new net::HttpNetworkSession(system_params)); 925 new net::HttpNetworkSession(system_params));
927 globals->system_http_transaction_factory.reset( 926 globals->system_http_transaction_factory.reset(
928 new net::HttpNetworkLayer(globals->system_http_network_session.get())); 927 new net::HttpNetworkLayer(globals->system_http_network_session.get()));
929 context->set_name("system"); 928
930 context->set_http_transaction_factory( 929 context->set_http_transaction_factory(
931 globals->system_http_transaction_factory.get()); 930 globals->system_http_transaction_factory.get());
932 931
932 globals->system_url_request_job_factory.reset(
933 new net::URLRequestJobFactoryImpl());
934 context->set_job_factory(globals->system_url_request_job_factory.get());
935
933 return context; 936 return context;
934 } 937 }
935 938
936 // static 939 // static
937 void IOThread::ConfigureParamsFromFieldTrialsAndCommandLine( 940 void IOThread::ConfigureParamsFromFieldTrialsAndCommandLine(
938 const base::CommandLine& command_line, 941 const base::CommandLine& command_line,
939 bool is_quic_allowed_by_policy, 942 bool is_quic_allowed_by_policy,
940 bool http_09_on_non_default_ports_enabled, 943 bool http_09_on_non_default_ports_enabled,
941 net::HttpNetworkSession::Params* params) { 944 net::HttpNetworkSession::Params* params) {
942 std::string quic_user_agent_id = chrome::GetChannelString(); 945 std::string quic_user_agent_id = chrome::GetChannelString();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 1102
1100 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1103 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1101 // system URLRequestContext too. There's no reason this should be tied to a 1104 // system URLRequestContext too. There's no reason this should be tied to a
1102 // profile. 1105 // profile.
1103 return context; 1106 return context;
1104 } 1107 }
1105 1108
1106 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { 1109 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() {
1107 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); 1110 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread);
1108 } 1111 }
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698