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

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

Issue 811073004: QUIC - don't load data from disk cache if alternate protocol map doesn't (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments from Patch Set 2 Created 6 years 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 <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 globals.alternate_protocol_probability_threshold.CopyToIfSet( 1053 globals.alternate_protocol_probability_threshold.CopyToIfSet(
1054 &params->alternate_protocol_probability_threshold); 1054 &params->alternate_protocol_probability_threshold);
1055 1055
1056 globals.enable_quic.CopyToIfSet(&params->enable_quic); 1056 globals.enable_quic.CopyToIfSet(&params->enable_quic);
1057 globals.quic_always_require_handshake_confirmation.CopyToIfSet( 1057 globals.quic_always_require_handshake_confirmation.CopyToIfSet(
1058 &params->quic_always_require_handshake_confirmation); 1058 &params->quic_always_require_handshake_confirmation);
1059 globals.quic_disable_connection_pooling.CopyToIfSet( 1059 globals.quic_disable_connection_pooling.CopyToIfSet(
1060 &params->quic_disable_connection_pooling); 1060 &params->quic_disable_connection_pooling);
1061 globals.quic_load_server_info_timeout_ms.CopyToIfSet( 1061 globals.quic_load_server_info_timeout_ms.CopyToIfSet(
1062 &params->quic_load_server_info_timeout_ms); 1062 &params->quic_load_server_info_timeout_ms);
1063 globals.quic_disable_loading_server_info_for_new_servers.CopyToIfSet(
1064 &params->quic_disable_loading_server_info_for_new_servers);
1063 globals.enable_quic_port_selection.CopyToIfSet( 1065 globals.enable_quic_port_selection.CopyToIfSet(
1064 &params->enable_quic_port_selection); 1066 &params->enable_quic_port_selection);
1065 globals.quic_max_packet_length.CopyToIfSet(&params->quic_max_packet_length); 1067 globals.quic_max_packet_length.CopyToIfSet(&params->quic_max_packet_length);
1066 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id); 1068 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id);
1067 globals.quic_supported_versions.CopyToIfSet( 1069 globals.quic_supported_versions.CopyToIfSet(
1068 &params->quic_supported_versions); 1070 &params->quic_supported_versions);
1069 params->quic_connection_options = globals.quic_connection_options; 1071 params->quic_connection_options = globals.quic_connection_options;
1070 1072
1071 globals.origin_to_force_quic_on.CopyToIfSet( 1073 globals.origin_to_force_quic_on.CopyToIfSet(
1072 &params->origin_to_force_quic_on); 1074 &params->origin_to_force_quic_on);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 globals->quic_always_require_handshake_confirmation.set( 1205 globals->quic_always_require_handshake_confirmation.set(
1204 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); 1206 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params));
1205 globals->quic_disable_connection_pooling.set( 1207 globals->quic_disable_connection_pooling.set(
1206 ShouldQuicDisableConnectionPooling(quic_trial_params)); 1208 ShouldQuicDisableConnectionPooling(quic_trial_params));
1207 int load_server_info_timeout_ms = 1209 int load_server_info_timeout_ms =
1208 GetQuicLoadServerInfoTimeout(quic_trial_params); 1210 GetQuicLoadServerInfoTimeout(quic_trial_params);
1209 if (load_server_info_timeout_ms != 0) { 1211 if (load_server_info_timeout_ms != 0) {
1210 globals->quic_load_server_info_timeout_ms.set( 1212 globals->quic_load_server_info_timeout_ms.set(
1211 load_server_info_timeout_ms); 1213 load_server_info_timeout_ms);
1212 } 1214 }
1215 globals->quic_disable_loading_server_info_for_new_servers.set(
1216 ShouldDisableLoadingServerInfoForNewServers(quic_trial_params));
1213 globals->enable_quic_port_selection.set( 1217 globals->enable_quic_port_selection.set(
1214 ShouldEnableQuicPortSelection(command_line)); 1218 ShouldEnableQuicPortSelection(command_line));
1215 globals->quic_connection_options = 1219 globals->quic_connection_options =
1216 GetQuicConnectionOptions(command_line, quic_trial_params); 1220 GetQuicConnectionOptions(command_line, quic_trial_params);
1217 if (ShouldEnableQuicPacing(command_line, quic_trial_group, 1221 if (ShouldEnableQuicPacing(command_line, quic_trial_group,
1218 quic_trial_params)) { 1222 quic_trial_params)) {
1219 globals->quic_connection_options.push_back(net::kPACE); 1223 globals->quic_connection_options.push_back(net::kPACE);
1220 } 1224 }
1221 } 1225 }
1222 1226
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 int value; 1371 int value;
1368 if (base::StringToInt(GetVariationParam(quic_trial_params, 1372 if (base::StringToInt(GetVariationParam(quic_trial_params,
1369 "load_server_info_timeout"), 1373 "load_server_info_timeout"),
1370 &value)) { 1374 &value)) {
1371 return value; 1375 return value;
1372 } 1376 }
1373 return 0; 1377 return 0;
1374 } 1378 }
1375 1379
1376 // static 1380 // static
1381 bool IOThread::ShouldDisableLoadingServerInfoForNewServers(
1382 const VariationParameters& quic_trial_params) {
1383 return LowerCaseEqualsASCII(
1384 GetVariationParam(quic_trial_params,
1385 "disable_loading_server_info_for_new_servers"),
1386 "true");
1387 }
1388
1389 // static
1377 size_t IOThread::GetQuicMaxPacketLength( 1390 size_t IOThread::GetQuicMaxPacketLength(
1378 const CommandLine& command_line, 1391 const CommandLine& command_line,
1379 base::StringPiece quic_trial_group, 1392 base::StringPiece quic_trial_group,
1380 const VariationParameters& quic_trial_params) { 1393 const VariationParameters& quic_trial_params) {
1381 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { 1394 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
1382 unsigned value; 1395 unsigned value;
1383 if (!base::StringToUint( 1396 if (!base::StringToUint(
1384 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), 1397 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength),
1385 &value)) { 1398 &value)) {
1386 return 0; 1399 return 0;
(...skipping 27 matching lines...) Expand all
1414 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1427 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1415 for (size_t i = 0; i < supported_versions.size(); ++i) { 1428 for (size_t i = 0; i < supported_versions.size(); ++i) {
1416 net::QuicVersion version = supported_versions[i]; 1429 net::QuicVersion version = supported_versions[i];
1417 if (net::QuicVersionToString(version) == quic_version) { 1430 if (net::QuicVersionToString(version) == quic_version) {
1418 return version; 1431 return version;
1419 } 1432 }
1420 } 1433 }
1421 1434
1422 return net::QUIC_VERSION_UNSUPPORTED; 1435 return net::QUIC_VERSION_UNSUPPORTED;
1423 } 1436 }
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