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

Unified Diff: chrome/browser/io_thread.cc

Issue 689923002: Add Spdy4Experiment group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use prefix instead. Created 6 years, 2 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') | no next file » | 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 b84a24ba1b0c41e2546763f887f4ef6dba0efed9..4a58250f2d06744df1ac8a776a97c80699566dd2 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -19,6 +19,7 @@
#include "base/prefs/pref_service.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -131,9 +132,10 @@ const char kQuicFieldTrialPacingSuffix[] = "WithPacing";
// * A SPDY/4 experiment, for SPDY/4 (aka HTTP/2) vs SPDY/3.1 comparisons and
// eventual SPDY/4 deployment.
const char kSpdyFieldTrialName[] = "SPDY";
-const char kSpdyFieldTrialHoldbackGroupName[] = "SpdyDisabled";
+const char kSpdyFieldTrialHoldbackGroupNamePrefix[] = "SpdyDisabled";
const char kSpdyFieldTrialHoldbackControlGroupName[] = "Control";
-const char kSpdyFieldTrialSpdy4GroupName[] = "Spdy4Enabled";
+const char kSpdyFieldTrialSpdy31GroupNamePrefix[] = "Spdy31Enabled";
+const char kSpdyFieldTrialSpdy4GroupNamePrefix[] = "Spdy4Enabled";
const char kSpdyFieldTrialSpdy4ControlGroupName[] = "Spdy4Control";
// Field trial for Cache-Control: stale-while-revalidate directive.
@@ -832,16 +834,21 @@ void IOThread::ConfigureTCPFastOpen(const CommandLine& command_line) {
net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_if_supported);
}
-void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group,
+void IOThread::ConfigureSpdyFromTrial(base::StringPiece spdy_trial_group,
Globals* globals) {
- if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) {
+ if (spdy_trial_group.starts_with(kSpdyFieldTrialHoldbackGroupNamePrefix)) {
// TODO(jgraettinger): Use net::NextProtosHttpOnly() instead?
net::HttpStreamFactory::set_spdy_enabled(false);
} else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) {
// Use the current SPDY default (SPDY/3.1).
globals->next_protos = net::NextProtosSpdy31();
globals->use_alternate_protocols.set(true);
- } else if (spdy_trial_group == kSpdyFieldTrialSpdy4GroupName) {
+ } else if (spdy_trial_group.starts_with(
+ kSpdyFieldTrialSpdy31GroupNamePrefix)) {
+ globals->next_protos = net::NextProtosSpdy4Http2();
+ globals->use_alternate_protocols.set(true);
+ } else if (spdy_trial_group.starts_with(
+ kSpdyFieldTrialSpdy4GroupNamePrefix)) {
globals->next_protos = net::NextProtosSpdy4Http2();
globals->use_alternate_protocols.set(true);
} else if (spdy_trial_group == kSpdyFieldTrialSpdy4ControlGroupName) {
Ryan Hamilton 2014/10/30 21:33:32 If you named the spdy/4 control group as: Spdy31E
« no previous file with comments | « chrome/browser/io_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698