summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjri <jri@chromium.org>2014-09-02 15:25:36 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-02 22:42:08 +0000
commit2b966f217ba9f38cb4e625bdabbae0044dd28523 (patch)
tree782871421f9fe761609acea5a957a29b4a2ea12d /chrome
parenta5f8ead45f469cb046403b250272b855de9fbba3 (diff)
downloadchromium_src-2b966f217ba9f38cb4e625bdabbae0044dd28523.zip
chromium_src-2b966f217ba9f38cb4e625bdabbae0044dd28523.tar.gz
chromium_src-2b966f217ba9f38cb4e625bdabbae0044dd28523.tar.bz2
Adds plumbing for always requiring handshake confirmation in QUIC, for use in Finch field trials.
BUG= Review URL: https://codereview.chromium.org/524463004 Cr-Commit-Position: refs/heads/master@{#293010}
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/io_thread.cc13
-rw-r--r--chrome/browser/io_thread.h6
-rw-r--r--chrome/browser/io_thread_unittest.cc11
3 files changed, 30 insertions, 0 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 736e757..e32efc2 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -1046,6 +1046,8 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals(
globals.enable_quic.CopyToIfSet(&params->enable_quic);
globals.enable_quic_time_based_loss_detection.CopyToIfSet(
&params->enable_quic_time_based_loss_detection);
+ globals.quic_always_require_handshake_confirmation.CopyToIfSet(
+ &params->quic_always_require_handshake_confirmation);
globals.enable_quic_port_selection.CopyToIfSet(
&params->enable_quic_port_selection);
globals.quic_max_packet_length.CopyToIfSet(&params->quic_max_packet_length);
@@ -1159,6 +1161,8 @@ void IOThread::ConfigureQuicGlobals(
globals->enable_quic_time_based_loss_detection.set(
ShouldEnableQuicTimeBasedLossDetection(command_line, quic_trial_group,
quic_trial_params));
+ globals->quic_always_require_handshake_confirmation.set(
+ ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params));
globals->enable_quic_port_selection.set(
ShouldEnableQuicPortSelection(command_line));
globals->quic_connection_options =
@@ -1334,6 +1338,15 @@ bool IOThread::ShouldEnableQuicTimeBasedLossDetection(
}
// static
+bool IOThread::ShouldQuicAlwaysRequireHandshakeConfirmation(
+ const VariationParameters& quic_trial_params) {
+ return LowerCaseEqualsASCII(
+ GetVariationParam(quic_trial_params,
+ "always_require_handshake_confirmation"),
+ "true");
+}
+
+// static
size_t IOThread::GetQuicMaxPacketLength(
const CommandLine& command_line,
base::StringPiece quic_trial_group,
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 8559217..a989118 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -187,6 +187,7 @@ class IOThread : public content::BrowserThreadDelegate {
Optional<bool> enable_quic;
Optional<bool> enable_quic_time_based_loss_detection;
Optional<bool> enable_quic_port_selection;
+ Optional<bool> quic_always_require_handshake_confirmation;
Optional<size_t> quic_max_packet_length;
net::QuicTagVector quic_connection_options;
Optional<std::string> quic_user_agent_id;
@@ -352,6 +353,11 @@ class IOThread : public content::BrowserThreadDelegate {
base::StringPiece quic_trial_group,
const VariationParameters& quic_trial_params);
+ // Returns true if QUIC should always require handshake confirmation during
+ // the QUIC handshake.
+ static bool ShouldQuicAlwaysRequireHandshakeConfirmation(
+ const VariationParameters& quic_trial_params);
+
// Returns the maximum length for QUIC packets, based on any flags in
// |command_line| or the field trial. Returns 0 if there is an error
// parsing any of the options, or if the default value should be used.
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
index 9cbf7e5..173ff58 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -132,6 +132,7 @@ TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
EXPECT_EQ(default_params.quic_supported_versions,
params.quic_supported_versions);
EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
+ EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
}
TEST_F(IOThreadTest, EnableQuicFromCommandLine) {
@@ -320,4 +321,14 @@ TEST_F(IOThreadTest, QuicConnectionOptionsFromDeprecatedFieldTrialParams) {
EXPECT_EQ(options, params.quic_connection_options);
}
+TEST_F(IOThreadTest,
+ QuicAlwaysRequireHandshakeConfirmationFromFieldTrialParams) {
+ field_trial_group_ = "Enabled";
+ field_trial_params_["always_require_handshake_confirmation"] = "true";
+ ConfigureQuicGlobals();
+ net::HttpNetworkSession::Params params;
+ InitializeNetworkSessionParams(&params);
+ EXPECT_TRUE(params.quic_always_require_handshake_confirmation);
+}
+
} // namespace test