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

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

Issue 1613513003: Early connection migration in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Comments addressed. Created 4 years, 10 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 globals.quic_close_sessions_on_ip_change.CopyToIfSet( 1211 globals.quic_close_sessions_on_ip_change.CopyToIfSet(
1212 &params->quic_close_sessions_on_ip_change); 1212 &params->quic_close_sessions_on_ip_change);
1213 globals.quic_idle_connection_timeout_seconds.CopyToIfSet( 1213 globals.quic_idle_connection_timeout_seconds.CopyToIfSet(
1214 &params->quic_idle_connection_timeout_seconds); 1214 &params->quic_idle_connection_timeout_seconds);
1215 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet( 1215 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet(
1216 &params->quic_disable_preconnect_if_0rtt); 1216 &params->quic_disable_preconnect_if_0rtt);
1217 if (!globals.quic_host_whitelist.empty()) 1217 if (!globals.quic_host_whitelist.empty())
1218 params->quic_host_whitelist = globals.quic_host_whitelist; 1218 params->quic_host_whitelist = globals.quic_host_whitelist;
1219 globals.quic_migrate_sessions_on_network_change.CopyToIfSet( 1219 globals.quic_migrate_sessions_on_network_change.CopyToIfSet(
1220 &params->quic_migrate_sessions_on_network_change); 1220 &params->quic_migrate_sessions_on_network_change);
1221 globals.quic_migrate_sessions_early.CopyToIfSet(
1222 &params->quic_migrate_sessions_early);
1221 globals.origin_to_force_quic_on.CopyToIfSet( 1223 globals.origin_to_force_quic_on.CopyToIfSet(
1222 &params->origin_to_force_quic_on); 1224 &params->origin_to_force_quic_on);
1223 params->enable_user_alternate_protocol_ports = 1225 params->enable_user_alternate_protocol_ports =
1224 globals.enable_user_alternate_protocol_ports; 1226 globals.enable_user_alternate_protocol_ports;
1225 params->enable_token_binding = globals.enable_token_binding; 1227 params->enable_token_binding = globals.enable_token_binding;
1226 } 1228 }
1227 1229
1228 base::TimeTicks IOThread::creation_time() const { 1230 base::TimeTicks IOThread::creation_time() const {
1229 return creation_time_; 1231 return creation_time_;
1230 } 1232 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 if (idle_connection_timeout_seconds != 0) { 1359 if (idle_connection_timeout_seconds != 0) {
1358 globals->quic_idle_connection_timeout_seconds.set( 1360 globals->quic_idle_connection_timeout_seconds.set(
1359 idle_connection_timeout_seconds); 1361 idle_connection_timeout_seconds);
1360 } 1362 }
1361 globals->quic_disable_preconnect_if_0rtt.set( 1363 globals->quic_disable_preconnect_if_0rtt.set(
1362 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params)); 1364 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params));
1363 globals->quic_host_whitelist = 1365 globals->quic_host_whitelist =
1364 GetQuicHostWhitelist(command_line, quic_trial_params); 1366 GetQuicHostWhitelist(command_line, quic_trial_params);
1365 globals->quic_migrate_sessions_on_network_change.set( 1367 globals->quic_migrate_sessions_on_network_change.set(
1366 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params)); 1368 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params));
1369 globals->quic_migrate_sessions_early.set(
1370 ShouldQuicMigrateSessionsEarly(quic_trial_params));
1367 } 1371 }
1368 1372
1369 size_t max_packet_length = GetQuicMaxPacketLength(command_line, 1373 size_t max_packet_length = GetQuicMaxPacketLength(command_line,
1370 quic_trial_params); 1374 quic_trial_params);
1371 if (max_packet_length != 0) { 1375 if (max_packet_length != 0) {
1372 globals->quic_max_packet_length.set(max_packet_length); 1376 globals->quic_max_packet_length.set(max_packet_length);
1373 } 1377 }
1374 1378
1375 std::string quic_user_agent_id = chrome::GetChannelString(); 1379 std::string quic_user_agent_id = chrome::GetChannelString();
1376 if (!quic_user_agent_id.empty()) 1380 if (!quic_user_agent_id.empty())
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 } 1660 }
1657 1661
1658 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange( 1662 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange(
1659 const VariationParameters& quic_trial_params) { 1663 const VariationParameters& quic_trial_params) {
1660 return base::LowerCaseEqualsASCII( 1664 return base::LowerCaseEqualsASCII(
1661 GetVariationParam(quic_trial_params, 1665 GetVariationParam(quic_trial_params,
1662 "migrate_sessions_on_network_change"), 1666 "migrate_sessions_on_network_change"),
1663 "true"); 1667 "true");
1664 } 1668 }
1665 1669
1670 bool IOThread::ShouldQuicMigrateSessionsEarly(
1671 const VariationParameters& quic_trial_params) {
1672 return base::LowerCaseEqualsASCII(
1673 GetVariationParam(quic_trial_params, "migrate_sessions_early"), "true");
1674 }
1675
1666 size_t IOThread::GetQuicMaxPacketLength( 1676 size_t IOThread::GetQuicMaxPacketLength(
1667 const base::CommandLine& command_line, 1677 const base::CommandLine& command_line,
1668 const VariationParameters& quic_trial_params) { 1678 const VariationParameters& quic_trial_params) {
1669 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { 1679 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
1670 unsigned value; 1680 unsigned value;
1671 if (!base::StringToUint( 1681 if (!base::StringToUint(
1672 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), 1682 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength),
1673 &value)) { 1683 &value)) {
1674 return 0; 1684 return 0;
1675 } 1685 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 std::move(job_factory); 1845 std::move(job_factory);
1836 1846
1837 context->set_job_factory( 1847 context->set_job_factory(
1838 globals->proxy_script_fetcher_url_request_job_factory.get()); 1848 globals->proxy_script_fetcher_url_request_job_factory.get());
1839 1849
1840 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1850 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1841 // system URLRequestContext too. There's no reason this should be tied to a 1851 // system URLRequestContext too. There's no reason this should be tied to a
1842 // profile. 1852 // profile.
1843 return context; 1853 return context;
1844 } 1854 }
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