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

Unified Diff: chrome/browser/io_thread.cc

Issue 25087007: Added a field trial (finch experiment) to disable SPDY for x% of users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small reorg of code Created 7 years, 3 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 | 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 d2745b3148316620a4bde35bac99abf9b1ce5b5b..2daee17044f47561e568f0535f18c537756447cc 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -103,6 +103,9 @@ const char kQuicFieldTrialName[] = "QUIC";
const char kQuicFieldTrialEnabledGroupName[] = "Enabled";
const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled";
+const char kSpdyFieldTrialName[] = "SPDY";
+const char kSpdyFieldTrialDisabledGroupName[] = "SpdyDisabled";
+
#if defined(OS_MACOSX) && !defined(OS_IOS)
void ObserveKeychainEvents() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -685,7 +688,14 @@ void IOThread::InitializeNetworkOptions(const CommandLine& command_line) {
// Only handle use-spdy command line flags if "spdy.disabled" preference is
// not disabled via policy.
- if (!is_spdy_disabled_by_policy_) {
+ if (is_spdy_disabled_by_policy_) {
+ base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName);
+ if (trial)
+ trial->Disable();
+ } else {
+ std::string spdy_trial_group =
+ base::FieldTrialList::FindFullName(kSpdyFieldTrialName);
+
if (command_line.HasSwitch(switches::kEnableIPPooling))
globals_->enable_spdy_ip_pooling.set(true);
@@ -699,6 +709,7 @@ void IOThread::InitializeNetworkOptions(const CommandLine& command_line) {
// Enable WebSocket over SPDY.
net::WebSocketJob::set_websocket_over_spdy_enabled(true);
}
+
if (command_line.HasSwitch(switches::kMaxSpdyConcurrentStreams)) {
globals_->max_spdy_concurrent_streams_limit.set(
GetSwitchValueAsInt(command_line,
@@ -726,8 +737,13 @@ void IOThread::InitializeNetworkOptions(const CommandLine& command_line) {
} else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) {
net::HttpStreamFactory::EnableNpnHttpOnly();
} else {
- // Use SPDY/3.1 by default.
- net::HttpStreamFactory::EnableNpnSpdy31();
+ if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName &&
+ !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
+ net::HttpStreamFactory::set_spdy_enabled(false);
+ } else {
+ // Use SPDY/3.1 by default.
+ net::HttpStreamFactory::EnableNpnSpdy31();
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698