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

Unified Diff: chrome/browser/io_thread.cc

Issue 1041953003: QUIC - Added the following finch trial parameters to disable QUIC if (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos Created 5 years, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 5f8941abc2e4a208bc27084a9db31f4a20f38c96..cb31f17e60f67e4e433c32c9373b3391804e26e7 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -1211,6 +1211,10 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals(
&params->quic_enable_non_blocking_io);
globals.quic_disable_disk_cache.CopyToIfSet(
&params->quic_disable_disk_cache);
+ globals.quic_max_number_of_lossy_connections.CopyToIfSet(
+ &params->quic_max_number_of_lossy_connections);
+ globals.quic_packet_loss_threshold.CopyToIfSet(
+ &params->quic_packet_loss_threshold);
globals.quic_socket_receive_buffer_size.CopyToIfSet(
&params->quic_socket_receive_buffer_size);
globals.enable_quic_port_selection.CopyToIfSet(
@@ -1347,6 +1351,15 @@ void IOThread::ConfigureQuicGlobals(
ShouldQuicEnableNonBlockingIO(quic_trial_params));
globals->quic_disable_disk_cache.set(
ShouldQuicDisableDiskCache(quic_trial_params));
+ int max_number_of_lossy_connections = GetQuicMaxNumberOfLossyConnections(
+ quic_trial_params);
+ if (max_number_of_lossy_connections != 0) {
+ globals->quic_max_number_of_lossy_connections.set(
+ max_number_of_lossy_connections);
+ }
+ float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params);
+ if (packet_loss_threshold != 0)
+ globals->quic_packet_loss_threshold.set(packet_loss_threshold);
globals->enable_quic_port_selection.set(
ShouldEnableQuicPortSelection(command_line));
globals->quic_connection_options =
@@ -1547,6 +1560,30 @@ bool IOThread::ShouldQuicDisableDiskCache(
}
// static
+int IOThread::GetQuicMaxNumberOfLossyConnections(
+ const VariationParameters& quic_trial_params) {
+ int value;
+ if (base::StringToInt(GetVariationParam(quic_trial_params,
+ "max_number_of_lossy_connections"),
+ &value)) {
+ return value;
+ }
+ return 0;
+}
+
+// static
+float IOThread::GetQuicPacketLossThreshold(
+ const VariationParameters& quic_trial_params) {
+ double value;
+ if (base::StringToDouble(GetVariationParam(quic_trial_params,
+ "packet_loss_threshold"),
+ &value)) {
+ return (float)value;
+ }
+ return 0.0f;
+}
+
+// static
int IOThread::GetQuicSocketReceiveBufferSize(
const VariationParameters& quic_trial_params) {
int value;
« 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