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

Side by Side 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: Changed Disabled group name SpdyDisabled. Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 // The IOThread object must outlive any tasks posted to the IO thread before the 97 // The IOThread object must outlive any tasks posted to the IO thread before the
98 // Quit task, so base::Bind() calls are not refcounted. 98 // Quit task, so base::Bind() calls are not refcounted.
99 99
100 namespace { 100 namespace {
101 101
102 const char kQuicFieldTrialName[] = "QUIC"; 102 const char kQuicFieldTrialName[] = "QUIC";
103 const char kQuicFieldTrialEnabledGroupName[] = "Enabled"; 103 const char kQuicFieldTrialEnabledGroupName[] = "Enabled";
104 const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled"; 104 const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled";
105 105
106 const char kSpdyFieldTrialName[] = "SPDY";
107 const char kSpdyFieldTrialDisabledGroupName[] = "SpdyDisabled";
108
106 #if defined(OS_MACOSX) && !defined(OS_IOS) 109 #if defined(OS_MACOSX) && !defined(OS_IOS)
107 void ObserveKeychainEvents() { 110 void ObserveKeychainEvents() {
108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
109 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); 112 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents();
110 } 113 }
111 #endif 114 #endif
112 115
113 // Used for the "system" URLRequestContext. 116 // Used for the "system" URLRequestContext.
114 class SystemURLRequestContext : public net::URLRequestContext { 117 class SystemURLRequestContext : public net::URLRequestContext {
115 public: 118 public:
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 GetSwitchValueAsInt(command_line, 707 GetSwitchValueAsInt(command_line,
705 switches::kMaxSpdyConcurrentStreams)); 708 switches::kMaxSpdyConcurrentStreams));
706 } 709 }
707 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { 710 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) {
708 globals_->trusted_spdy_proxy.set( 711 globals_->trusted_spdy_proxy.set(
709 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); 712 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy));
710 } 713 }
711 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) 714 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests))
712 net::URLFetcher::SetIgnoreCertificateRequests(true); 715 net::URLFetcher::SetIgnoreCertificateRequests(true);
713 716
717 std::string spdy_trial_group =
718 base::FieldTrialList::FindFullName(kSpdyFieldTrialName);
719
714 if (command_line.HasSwitch(switches::kUseSpdy)) { 720 if (command_line.HasSwitch(switches::kUseSpdy)) {
Alexei Svitkine (slow) 2013/09/30 19:40:13 Either add all of these flags to the config for th
motek. 2013/09/30 20:44:29 From the Department of Redundancy Department: pret
ramant (doing other things) 2013/09/30 22:28:56 Done.
ramant (doing other things) 2013/09/30 22:28:56 Done.
715 std::string spdy_mode = 721 std::string spdy_mode =
716 command_line.GetSwitchValueASCII(switches::kUseSpdy); 722 command_line.GetSwitchValueASCII(switches::kUseSpdy);
717 EnableSpdy(spdy_mode); 723 EnableSpdy(spdy_mode);
718 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { 724 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) {
719 net::HttpStreamFactory::EnableNpnHttp2Draft04(); 725 net::HttpStreamFactory::EnableNpnHttp2Draft04();
720 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { 726 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) {
721 net::HttpStreamFactory::EnableNpnSpdy4a2(); 727 net::HttpStreamFactory::EnableNpnSpdy4a2();
722 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { 728 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) {
723 net::HttpStreamFactory::EnableNpnSpdy3(); 729 net::HttpStreamFactory::EnableNpnSpdy3();
724 } else if (command_line.HasSwitch(switches::kEnableNpn)) { 730 } else if (command_line.HasSwitch(switches::kEnableNpn)) {
725 net::HttpStreamFactory::EnableNpnSpdy(); 731 net::HttpStreamFactory::EnableNpnSpdy();
726 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { 732 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) {
727 net::HttpStreamFactory::EnableNpnHttpOnly(); 733 net::HttpStreamFactory::EnableNpnHttpOnly();
728 } else { 734 } else {
729 // Use SPDY/3.1 by default. 735 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName) {
730 net::HttpStreamFactory::EnableNpnSpdy31(); 736 net::HttpStreamFactory::set_spdy_enabled(false);
737 } else {
738 // Use SPDY/3.1 by default.
739 net::HttpStreamFactory::EnableNpnSpdy31();
740 }
731 } 741 }
732 } 742 }
733 743
734 // TODO(rch): Make the client socket factory a per-network session 744 // TODO(rch): Make the client socket factory a per-network session
735 // instance, constructed from a NetworkSession::Params, to allow us 745 // instance, constructed from a NetworkSession::Params, to allow us
736 // to move this option to IOThread::Globals & 746 // to move this option to IOThread::Globals &
737 // HttpNetworkSession::Params. 747 // HttpNetworkSession::Params.
738 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) 748 if (command_line.HasSwitch(switches::kEnableTcpFastOpen))
739 net::SetTCPFastOpenEnabled(true); 749 net::SetTCPFastOpenEnabled(true);
740 } 750 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 if (command_line.HasSwitch(switches::kDisableQuicHttps)) 1025 if (command_line.HasSwitch(switches::kDisableQuicHttps))
1016 return false; 1026 return false;
1017 1027
1018 if (command_line.HasSwitch(switches::kEnableQuicHttps)) 1028 if (command_line.HasSwitch(switches::kEnableQuicHttps))
1019 return true; 1029 return true;
1020 1030
1021 // HTTPS over QUIC should only be enabled if we are in the https 1031 // HTTPS over QUIC should only be enabled if we are in the https
1022 // field trial group. 1032 // field trial group.
1023 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; 1033 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName;
1024 } 1034 }
OLDNEW
« 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