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

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

Issue 1165283004: Add a new prefer_aes finch options for QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 <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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 globals.quic_always_require_handshake_confirmation.CopyToIfSet( 1167 globals.quic_always_require_handshake_confirmation.CopyToIfSet(
1168 &params->quic_always_require_handshake_confirmation); 1168 &params->quic_always_require_handshake_confirmation);
1169 globals.quic_disable_connection_pooling.CopyToIfSet( 1169 globals.quic_disable_connection_pooling.CopyToIfSet(
1170 &params->quic_disable_connection_pooling); 1170 &params->quic_disable_connection_pooling);
1171 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( 1171 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet(
1172 &params->quic_load_server_info_timeout_srtt_multiplier); 1172 &params->quic_load_server_info_timeout_srtt_multiplier);
1173 globals.quic_enable_connection_racing.CopyToIfSet( 1173 globals.quic_enable_connection_racing.CopyToIfSet(
1174 &params->quic_enable_connection_racing); 1174 &params->quic_enable_connection_racing);
1175 globals.quic_enable_non_blocking_io.CopyToIfSet( 1175 globals.quic_enable_non_blocking_io.CopyToIfSet(
1176 &params->quic_enable_non_blocking_io); 1176 &params->quic_enable_non_blocking_io);
1177 globals.quic_prefer_aes.CopyToIfSet(&params->quic_prefer_aes);
1177 globals.quic_disable_disk_cache.CopyToIfSet( 1178 globals.quic_disable_disk_cache.CopyToIfSet(
1178 &params->quic_disable_disk_cache); 1179 &params->quic_disable_disk_cache);
1179 globals.quic_max_number_of_lossy_connections.CopyToIfSet( 1180 globals.quic_max_number_of_lossy_connections.CopyToIfSet(
1180 &params->quic_max_number_of_lossy_connections); 1181 &params->quic_max_number_of_lossy_connections);
1181 globals.quic_packet_loss_threshold.CopyToIfSet( 1182 globals.quic_packet_loss_threshold.CopyToIfSet(
1182 &params->quic_packet_loss_threshold); 1183 &params->quic_packet_loss_threshold);
1183 globals.quic_socket_receive_buffer_size.CopyToIfSet( 1184 globals.quic_socket_receive_buffer_size.CopyToIfSet(
1184 &params->quic_socket_receive_buffer_size); 1185 &params->quic_socket_receive_buffer_size);
1185 globals.enable_quic_port_selection.CopyToIfSet( 1186 globals.enable_quic_port_selection.CopyToIfSet(
1186 &params->enable_quic_port_selection); 1187 &params->enable_quic_port_selection);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 if (load_server_info_timeout_srtt_multiplier != 0) { 1315 if (load_server_info_timeout_srtt_multiplier != 0) {
1315 globals->quic_load_server_info_timeout_srtt_multiplier.set( 1316 globals->quic_load_server_info_timeout_srtt_multiplier.set(
1316 load_server_info_timeout_srtt_multiplier); 1317 load_server_info_timeout_srtt_multiplier);
1317 } 1318 }
1318 globals->quic_enable_connection_racing.set( 1319 globals->quic_enable_connection_racing.set(
1319 ShouldQuicEnableConnectionRacing(quic_trial_params)); 1320 ShouldQuicEnableConnectionRacing(quic_trial_params));
1320 globals->quic_enable_non_blocking_io.set( 1321 globals->quic_enable_non_blocking_io.set(
1321 ShouldQuicEnableNonBlockingIO(quic_trial_params)); 1322 ShouldQuicEnableNonBlockingIO(quic_trial_params));
1322 globals->quic_disable_disk_cache.set( 1323 globals->quic_disable_disk_cache.set(
1323 ShouldQuicDisableDiskCache(quic_trial_params)); 1324 ShouldQuicDisableDiskCache(quic_trial_params));
1325 globals->quic_prefer_aes.set(
1326 ShouldQuicPreferAes(quic_trial_params));
1324 int max_number_of_lossy_connections = GetQuicMaxNumberOfLossyConnections( 1327 int max_number_of_lossy_connections = GetQuicMaxNumberOfLossyConnections(
1325 quic_trial_params); 1328 quic_trial_params);
1326 if (max_number_of_lossy_connections != 0) { 1329 if (max_number_of_lossy_connections != 0) {
1327 globals->quic_max_number_of_lossy_connections.set( 1330 globals->quic_max_number_of_lossy_connections.set(
1328 max_number_of_lossy_connections); 1331 max_number_of_lossy_connections);
1329 } 1332 }
1330 float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params); 1333 float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params);
1331 if (packet_loss_threshold != 0) 1334 if (packet_loss_threshold != 0)
1332 globals->quic_packet_loss_threshold.set(packet_loss_threshold); 1335 globals->quic_packet_loss_threshold.set(packet_loss_threshold);
1333 globals->enable_quic_port_selection.set( 1336 globals->enable_quic_port_selection.set(
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 } 1528 }
1526 1529
1527 // static 1530 // static
1528 bool IOThread::ShouldQuicDisableDiskCache( 1531 bool IOThread::ShouldQuicDisableDiskCache(
1529 const VariationParameters& quic_trial_params) { 1532 const VariationParameters& quic_trial_params) {
1530 return base::LowerCaseEqualsASCII( 1533 return base::LowerCaseEqualsASCII(
1531 GetVariationParam(quic_trial_params, "disable_disk_cache"), "true"); 1534 GetVariationParam(quic_trial_params, "disable_disk_cache"), "true");
1532 } 1535 }
1533 1536
1534 // static 1537 // static
1538 bool IOThread::ShouldQuicPreferAes(
1539 const VariationParameters& quic_trial_params) {
1540 return base::LowerCaseEqualsASCII(
1541 GetVariationParam(quic_trial_params, "prefer_aes"), "true");
1542 }
1543
1544 // static
1535 int IOThread::GetQuicMaxNumberOfLossyConnections( 1545 int IOThread::GetQuicMaxNumberOfLossyConnections(
1536 const VariationParameters& quic_trial_params) { 1546 const VariationParameters& quic_trial_params) {
1537 int value; 1547 int value;
1538 if (base::StringToInt(GetVariationParam(quic_trial_params, 1548 if (base::StringToInt(GetVariationParam(quic_trial_params,
1539 "max_number_of_lossy_connections"), 1549 "max_number_of_lossy_connections"),
1540 &value)) { 1550 &value)) {
1541 return value; 1551 return value;
1542 } 1552 }
1543 return 0; 1553 return 0;
1544 } 1554 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1617 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1608 for (size_t i = 0; i < supported_versions.size(); ++i) { 1618 for (size_t i = 0; i < supported_versions.size(); ++i) {
1609 net::QuicVersion version = supported_versions[i]; 1619 net::QuicVersion version = supported_versions[i];
1610 if (net::QuicVersionToString(version) == quic_version) { 1620 if (net::QuicVersionToString(version) == quic_version) {
1611 return version; 1621 return version;
1612 } 1622 }
1613 } 1623 }
1614 1624
1615 return net::QUIC_VERSION_UNSUPPORTED; 1625 return net::QUIC_VERSION_UNSUPPORTED;
1616 } 1626 }
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