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

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

Issue 1574423003: Revert of Add a whitelist for QUIC hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/io_thread_unittest.cc » ('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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id); 1171 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id);
1172 globals.quic_supported_versions.CopyToIfSet( 1172 globals.quic_supported_versions.CopyToIfSet(
1173 &params->quic_supported_versions); 1173 &params->quic_supported_versions);
1174 params->quic_connection_options = globals.quic_connection_options; 1174 params->quic_connection_options = globals.quic_connection_options;
1175 globals.quic_close_sessions_on_ip_change.CopyToIfSet( 1175 globals.quic_close_sessions_on_ip_change.CopyToIfSet(
1176 &params->quic_close_sessions_on_ip_change); 1176 &params->quic_close_sessions_on_ip_change);
1177 globals.quic_idle_connection_timeout_seconds.CopyToIfSet( 1177 globals.quic_idle_connection_timeout_seconds.CopyToIfSet(
1178 &params->quic_idle_connection_timeout_seconds); 1178 &params->quic_idle_connection_timeout_seconds);
1179 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet( 1179 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet(
1180 &params->quic_disable_preconnect_if_0rtt); 1180 &params->quic_disable_preconnect_if_0rtt);
1181 if (!globals.quic_host_whitelist.empty())
1182 params->quic_host_whitelist = globals.quic_host_whitelist;
1183 1181
1184 globals.origin_to_force_quic_on.CopyToIfSet( 1182 globals.origin_to_force_quic_on.CopyToIfSet(
1185 &params->origin_to_force_quic_on); 1183 &params->origin_to_force_quic_on);
1186 params->enable_user_alternate_protocol_ports = 1184 params->enable_user_alternate_protocol_ports =
1187 globals.enable_user_alternate_protocol_ports; 1185 globals.enable_user_alternate_protocol_ports;
1188 } 1186 }
1189 1187
1190 base::TimeTicks IOThread::creation_time() const { 1188 base::TimeTicks IOThread::creation_time() const {
1191 return creation_time_; 1189 return creation_time_;
1192 } 1190 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 globals->quic_close_sessions_on_ip_change.set( 1310 globals->quic_close_sessions_on_ip_change.set(
1313 ShouldQuicCloseSessionsOnIpChange(quic_trial_params)); 1311 ShouldQuicCloseSessionsOnIpChange(quic_trial_params));
1314 int idle_connection_timeout_seconds = GetQuicIdleConnectionTimeoutSeconds( 1312 int idle_connection_timeout_seconds = GetQuicIdleConnectionTimeoutSeconds(
1315 quic_trial_params); 1313 quic_trial_params);
1316 if (idle_connection_timeout_seconds != 0) { 1314 if (idle_connection_timeout_seconds != 0) {
1317 globals->quic_idle_connection_timeout_seconds.set( 1315 globals->quic_idle_connection_timeout_seconds.set(
1318 idle_connection_timeout_seconds); 1316 idle_connection_timeout_seconds);
1319 } 1317 }
1320 globals->quic_disable_preconnect_if_0rtt.set( 1318 globals->quic_disable_preconnect_if_0rtt.set(
1321 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params)); 1319 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params));
1322 globals->quic_host_whitelist =
1323 GetQuicHostWhitelist(command_line, quic_trial_params);
1324 } 1320 }
1325 1321
1326 size_t max_packet_length = GetQuicMaxPacketLength(command_line, 1322 size_t max_packet_length = GetQuicMaxPacketLength(command_line,
1327 quic_trial_params); 1323 quic_trial_params);
1328 if (max_packet_length != 0) { 1324 if (max_packet_length != 0) {
1329 globals->quic_max_packet_length.set(max_packet_length); 1325 globals->quic_max_packet_length.set(max_packet_length);
1330 } 1326 }
1331 1327
1332 std::string quic_user_agent_id = chrome::GetChannelString(); 1328 std::string quic_user_agent_id = chrome::GetChannelString();
1333 if (!quic_user_agent_id.empty()) 1329 if (!quic_user_agent_id.empty())
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 return 0; 1569 return 0;
1574 } 1570 }
1575 1571
1576 bool IOThread::ShouldQuicDisablePreConnectIfZeroRtt( 1572 bool IOThread::ShouldQuicDisablePreConnectIfZeroRtt(
1577 const VariationParameters& quic_trial_params) { 1573 const VariationParameters& quic_trial_params) {
1578 return base::LowerCaseEqualsASCII( 1574 return base::LowerCaseEqualsASCII(
1579 GetVariationParam(quic_trial_params, "disable_preconnect_if_0rtt"), 1575 GetVariationParam(quic_trial_params, "disable_preconnect_if_0rtt"),
1580 "true"); 1576 "true");
1581 } 1577 }
1582 1578
1583 std::unordered_set<std::string> IOThread::GetQuicHostWhitelist(
1584 const base::CommandLine& command_line,
1585 const VariationParameters& quic_trial_params) {
1586 std::string whitelist;
1587 if (command_line.HasSwitch(switches::kQuicHostWhitelist)) {
1588 whitelist = command_line.GetSwitchValueASCII(switches::kQuicHostWhitelist);
1589 } else {
1590 whitelist = GetVariationParam(quic_trial_params, "quic_host_whitelist");
1591 }
1592 std::unordered_set<std::string> hosts;
1593 for (const std::string& host :base::SplitString(whitelist, ",",
1594 base::TRIM_WHITESPACE,
1595 base::SPLIT_WANT_ALL)) {
1596 hosts.insert(host);
1597 }
1598 return hosts;
1599 }
1600
1601 size_t IOThread::GetQuicMaxPacketLength( 1579 size_t IOThread::GetQuicMaxPacketLength(
1602 const base::CommandLine& command_line, 1580 const base::CommandLine& command_line,
1603 const VariationParameters& quic_trial_params) { 1581 const VariationParameters& quic_trial_params) {
1604 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { 1582 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
1605 unsigned value; 1583 unsigned value;
1606 if (!base::StringToUint( 1584 if (!base::StringToUint(
1607 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), 1585 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength),
1608 &value)) { 1586 &value)) {
1609 return 0; 1587 return 0;
1610 } 1588 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 std::move(job_factory); 1748 std::move(job_factory);
1771 1749
1772 context->set_job_factory( 1750 context->set_job_factory(
1773 globals->proxy_script_fetcher_url_request_job_factory.get()); 1751 globals->proxy_script_fetcher_url_request_job_factory.get());
1774 1752
1775 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1753 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1776 // system URLRequestContext too. There's no reason this should be tied to a 1754 // system URLRequestContext too. There's no reason this should be tied to a
1777 // profile. 1755 // profile.
1778 return context; 1756 return context;
1779 } 1757 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/io_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698