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

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

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 11 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "components/net_log/chrome_net_log.h" 52 #include "components/net_log/chrome_net_log.h"
53 #include "components/policy/core/common/policy_service.h" 53 #include "components/policy/core/common/policy_service.h"
54 #include "components/proxy_config/pref_proxy_config_tracker.h" 54 #include "components/proxy_config/pref_proxy_config_tracker.h"
55 #include "components/variations/variations_associated_data.h" 55 #include "components/variations/variations_associated_data.h"
56 #include "components/version_info/version_info.h" 56 #include "components/version_info/version_info.h"
57 #include "content/public/browser/browser_thread.h" 57 #include "content/public/browser/browser_thread.h"
58 #include "content/public/browser/cookie_store_factory.h" 58 #include "content/public/browser/cookie_store_factory.h"
59 #include "content/public/common/content_features.h" 59 #include "content/public/common/content_features.h"
60 #include "content/public/common/content_switches.h" 60 #include "content/public/common/content_switches.h"
61 #include "content/public/common/user_agent.h" 61 #include "content/public/common/user_agent.h"
62 #include "net/base/default_trusted_spdy_proxy_provider.h"
62 #include "net/base/external_estimate_provider.h" 63 #include "net/base/external_estimate_provider.h"
63 #include "net/base/host_mapping_rules.h" 64 #include "net/base/host_mapping_rules.h"
64 #include "net/base/net_util.h" 65 #include "net/base/net_util.h"
65 #include "net/base/network_quality_estimator.h" 66 #include "net/base/network_quality_estimator.h"
66 #include "net/base/sdch_manager.h" 67 #include "net/base/sdch_manager.h"
67 #include "net/cert/cert_policy_enforcer.h" 68 #include "net/cert/cert_policy_enforcer.h"
68 #include "net/cert/cert_verifier.h" 69 #include "net/cert/cert_verifier.h"
69 #include "net/cert/cert_verify_proc.h" 70 #include "net/cert/cert_verify_proc.h"
70 #include "net/cert/ct_known_logs.h" 71 #include "net/cert/ct_known_logs.h"
71 #include "net/cert/ct_known_logs_static.h" 72 #include "net/cert/ct_known_logs_static.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 // if indicated by user. 957 // if indicated by user.
957 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_if_supported); 958 net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_if_supported);
958 } 959 }
959 960
960 // static 961 // static
961 void IOThread::ConfigureSpdyGlobals( 962 void IOThread::ConfigureSpdyGlobals(
962 const base::CommandLine& command_line, 963 const base::CommandLine& command_line,
963 base::StringPiece spdy_trial_group, 964 base::StringPiece spdy_trial_group,
964 const VariationParameters& spdy_trial_params, 965 const VariationParameters& spdy_trial_params,
965 IOThread::Globals* globals) { 966 IOThread::Globals* globals) {
967 // Initialize trusted SPDY proxy based on command line switch.
968 std::string trusted_spdy_proxy;
966 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { 969 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) {
967 globals->trusted_spdy_proxy.set( 970 trusted_spdy_proxy =
968 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); 971 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy);
972 // Configure DefaultTrustedSpdyProxyGetter to return the trusted SPDY proxy
973 // set on command line.
bengr 2016/01/12 21:43:03 on the
tbansal1 2016/01/12 23:43:49 Done.
974 globals->trusted_spdy_proxy_provider.reset(
975 new net::DefaultTrustedSpdyProxyProvider(net::ProxyServer::FromURI(
976 trusted_spdy_proxy, net::ProxyServer::SCHEME_HTTP)));
969 } 977 }
978
970 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) 979 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests))
971 net::URLFetcher::SetIgnoreCertificateRequests(true); 980 net::URLFetcher::SetIgnoreCertificateRequests(true);
972 981
973 if (command_line.HasSwitch(switches::kUseSpdy)) { 982 if (command_line.HasSwitch(switches::kUseSpdy)) {
974 std::string spdy_mode = 983 std::string spdy_mode =
975 command_line.GetSwitchValueASCII(switches::kUseSpdy); 984 command_line.GetSwitchValueASCII(switches::kUseSpdy);
976 ConfigureSpdyGlobalsFromUseSpdyArgument(spdy_mode, globals); 985 ConfigureSpdyGlobalsFromUseSpdyArgument(spdy_mode, globals);
977 return; 986 return;
978 } 987 }
979 988
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 1134
1126 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( 1135 globals.initial_max_spdy_concurrent_streams.CopyToIfSet(
1127 &params->spdy_initial_max_concurrent_streams); 1136 &params->spdy_initial_max_concurrent_streams);
1128 globals.enable_spdy_compression.CopyToIfSet( 1137 globals.enable_spdy_compression.CopyToIfSet(
1129 &params->enable_spdy_compression); 1138 &params->enable_spdy_compression);
1130 globals.enable_spdy_ping_based_connection_checking.CopyToIfSet( 1139 globals.enable_spdy_ping_based_connection_checking.CopyToIfSet(
1131 &params->enable_spdy_ping_based_connection_checking); 1140 &params->enable_spdy_ping_based_connection_checking);
1132 globals.spdy_default_protocol.CopyToIfSet( 1141 globals.spdy_default_protocol.CopyToIfSet(
1133 &params->spdy_default_protocol); 1142 &params->spdy_default_protocol);
1134 params->next_protos = globals.next_protos; 1143 params->next_protos = globals.next_protos;
1135 globals.trusted_spdy_proxy.CopyToIfSet(&params->trusted_spdy_proxy);
1136 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; 1144 params->forced_spdy_exclusions = globals.forced_spdy_exclusions;
1137 globals.use_alternative_services.CopyToIfSet( 1145 globals.use_alternative_services.CopyToIfSet(
1138 &params->use_alternative_services); 1146 &params->use_alternative_services);
1139 globals.alternative_service_probability_threshold.CopyToIfSet( 1147 globals.alternative_service_probability_threshold.CopyToIfSet(
1140 &params->alternative_service_probability_threshold); 1148 &params->alternative_service_probability_threshold);
1141 1149
1142 globals.enable_npn.CopyToIfSet(&params->enable_npn); 1150 globals.enable_npn.CopyToIfSet(&params->enable_npn);
1143 1151
1144 globals.enable_brotli.CopyToIfSet(&params->enable_brotli); 1152 globals.enable_brotli.CopyToIfSet(&params->enable_brotli);
1145 1153
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 std::move(job_factory); 1756 std::move(job_factory);
1749 1757
1750 context->set_job_factory( 1758 context->set_job_factory(
1751 globals->proxy_script_fetcher_url_request_job_factory.get()); 1759 globals->proxy_script_fetcher_url_request_job_factory.get());
1752 1760
1753 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1761 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1754 // system URLRequestContext too. There's no reason this should be tied to a 1762 // system URLRequestContext too. There's no reason this should be tied to a
1755 // profile. 1763 // profile.
1756 return context; 1764 return context;
1757 } 1765 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698