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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 804813010: QUIC - enabled FLAGS_allow_truncated_connection_ids_for_quic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 341e15877d02ea51e4f1256ba825b5010d6bc699..fe4d43e023dbe5feb2c5a454792034c44600a6ac 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -9,6 +9,7 @@
#include "base/cpu.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/profiler/scoped_tracker.h"
#include "base/rand_util.h"
@@ -32,6 +33,7 @@
#include "net/quic/quic_connection_helper.h"
#include "net/quic/quic_crypto_client_stream_factory.h"
#include "net/quic/quic_default_packet_writer.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_http_stream.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_server_id.h"
@@ -84,6 +86,25 @@ QuicConfig InitializeQuicConfig(const QuicTagVector& connection_options) {
QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds),
QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds));
config.SetConnectionOptionsToSend(connection_options);
+
+ // TODO(rtenneti): Delete the following enabling of
+ // FLAGS_allow_truncated_connection_ids_for_quic code when the flag is enabled
+ // by default.
Ryan Hamilton 2015/01/07 23:10:23 I think it would be better to make this finch cont
ramant (doing other things) 2015/01/08 02:54:51 Done.
+ CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::FieldTrial>, trial, ());
+ if (!trial.get()) {
+ // Set up a field trial to enable
+ // FLAGS_allow_truncated_connection_ids_for_quic for 50% of the users.
+ trial = base::FieldTrialList::FactoryGetFieldTrial(
+ "QuicConnection", 100, "allow_truncated_connection_ids", 2015, 1, 31,
+ base::FieldTrial::SESSION_RANDOMIZED, NULL);
+ int allow_truncated_connection_ids_group =
+ trial->AppendGroup("truncated_connection_ids", 50);
+ if (trial->group() == allow_truncated_connection_ids_group)
+ FLAGS_allow_truncated_connection_ids_for_quic = true;
+ }
+ if (FLAGS_allow_truncated_connection_ids_for_quic)
+ config.SetBytesForConnectionIdToSend(0);
+
return config;
}
« no previous file with comments | « no previous file | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698