summaryrefslogtreecommitdiffstats
path: root/components/cronet/url_request_context_config.cc
diff options
context:
space:
mode:
authorxunjieli <xunjieli@chromium.org>2015-11-23 10:05:26 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-23 18:06:17 +0000
commitf24ee5f5afeb59d2a9134a7b986efb6483629fe5 (patch)
treea8129919933d7c0745bea170481aa65e37467144 /components/cronet/url_request_context_config.cc
parent96ecfe9af345a389d1de338d953305f0287a522d (diff)
downloadchromium_src-f24ee5f5afeb59d2a9134a7b986efb6483629fe5.zip
chromium_src-f24ee5f5afeb59d2a9134a7b986efb6483629fe5.tar.gz
chromium_src-f24ee5f5afeb59d2a9134a7b986efb6483629fe5.tar.bz2
[Cronet] Add QUIC experimental params
This CL plumbs four QUIC experimental params ( quic_store_server_configs_in_properties, quic_delay_tcp_race, quic_max_number_of_lossy_connections, quic_packet_loss_threshold) from Cronet's setExperimentalOptions API to net::HttpNetworkSession. This CL also adds a unittests target to run the unittests. A followup CL will enable the unittests on the cronet bots. BUG=545118 Committed: https://crrev.com/fde0b72c603cd111c36ca4cc416d82a7395bcf6c Cr-Commit-Position: refs/heads/master@{#360454} Committed: https://crrev.com/8ece3aa6845350c1971a3e824bf148f3e8de3253 Cr-Commit-Position: refs/heads/master@{#360875} Review URL: https://codereview.chromium.org/1448583003 Cr-Commit-Position: refs/heads/master@{#361138}
Diffstat (limited to 'components/cronet/url_request_context_config.cc')
-rw-r--r--components/cronet/url_request_context_config.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
index 5cd24b8..ef94d0d 100644
--- a/components/cronet/url_request_context_config.cc
+++ b/components/cronet/url_request_context_config.cc
@@ -22,6 +22,12 @@ namespace {
// TODO(xunjieli): Refactor constants in io_thread.cc.
const char kQuicFieldTrialName[] = "QUIC";
const char kQuicConnectionOptions[] = "connection_options";
+const char kQuicStoreServerConfigsInProperties[] =
+ "store_server_configs_in_properties";
+const char kQuicDelayTcpRace[] = "delay_tcp_race";
+const char kQuicMaxNumberOfLossyConnections[] =
+ "max_number_of_lossy_connections";
+const char kQuicPacketLossThreshold[] = "packet_loss_threshold";
// Using a reference to scoped_ptr is unavoidable because of the semantics of
// RegisterCustomField.
@@ -41,6 +47,7 @@ void ParseAndSetExperimentalOptions(
if (experimental_options.empty())
return;
+ DVLOG(1) << "Experimental Options:" << experimental_options;
scoped_ptr<base::Value> options =
base::JSONReader::Read(experimental_options);
@@ -67,6 +74,32 @@ void ParseAndSetExperimentalOptions(
context_builder->set_quic_connection_options(
net::QuicUtils::ParseQuicConnectionOptions(quic_connection_options));
}
+
+ bool quic_store_server_configs_in_properties = false;
+ if (quic_args->GetBoolean(kQuicStoreServerConfigsInProperties,
+ &quic_store_server_configs_in_properties)) {
+ context_builder->set_quic_store_server_configs_in_properties(
+ quic_store_server_configs_in_properties);
+ }
+
+ bool quic_delay_tcp_race = false;
+ if (quic_args->GetBoolean(kQuicDelayTcpRace, &quic_delay_tcp_race)) {
+ context_builder->set_quic_delay_tcp_race(quic_delay_tcp_race);
+ }
+
+ int quic_max_number_of_lossy_connections = 0;
+ if (quic_args->GetInteger(kQuicMaxNumberOfLossyConnections,
+ &quic_max_number_of_lossy_connections)) {
+ context_builder->set_quic_max_number_of_lossy_connections(
+ quic_max_number_of_lossy_connections);
+ }
+
+ double quic_packet_loss_threshold = 0.0;
+ if (quic_args->GetDouble(kQuicPacketLossThreshold,
+ &quic_packet_loss_threshold)) {
+ context_builder->set_quic_packet_loss_threshold(
+ quic_packet_loss_threshold);
+ }
}
}