Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // * A "holdback" group with SPDY disabled, and corresponding control | 127 // * A "holdback" group with SPDY disabled, and corresponding control |
| 128 // (SPDY/3.1). The primary purpose of the holdback group is to encourage site | 128 // (SPDY/3.1). The primary purpose of the holdback group is to encourage site |
| 129 // operators to do feature detection rather than UA-sniffing. As such, this | 129 // operators to do feature detection rather than UA-sniffing. As such, this |
| 130 // trial runs continuously. | 130 // trial runs continuously. |
| 131 // * A SPDY/4 experiment, for SPDY/4 (aka HTTP/2) vs SPDY/3.1 comparisons and | 131 // * A SPDY/4 experiment, for SPDY/4 (aka HTTP/2) vs SPDY/3.1 comparisons and |
| 132 // eventual SPDY/4 deployment. | 132 // eventual SPDY/4 deployment. |
| 133 const char kSpdyFieldTrialName[] = "SPDY"; | 133 const char kSpdyFieldTrialName[] = "SPDY"; |
| 134 const char kSpdyFieldTrialHoldbackGroupName[] = "SpdyDisabled"; | 134 const char kSpdyFieldTrialHoldbackGroupName[] = "SpdyDisabled"; |
| 135 const char kSpdyFieldTrialHoldbackControlGroupName[] = "Control"; | 135 const char kSpdyFieldTrialHoldbackControlGroupName[] = "Control"; |
| 136 const char kSpdyFieldTrialSpdy4GroupName[] = "Spdy4Enabled"; | 136 const char kSpdyFieldTrialSpdy4GroupName[] = "Spdy4Enabled"; |
| 137 const char kSpdyFieldTrialSpdy4ExperimentGroupName[] = "Spdy4Experiment"; | |
| 137 const char kSpdyFieldTrialSpdy4ControlGroupName[] = "Spdy4Control"; | 138 const char kSpdyFieldTrialSpdy4ControlGroupName[] = "Spdy4Control"; |
| 138 | 139 |
| 139 // Field trial for Cache-Control: stale-while-revalidate directive. | 140 // Field trial for Cache-Control: stale-while-revalidate directive. |
| 140 const char kStaleWhileRevalidateFieldTrialName[] = "StaleWhileRevalidate"; | 141 const char kStaleWhileRevalidateFieldTrialName[] = "StaleWhileRevalidate"; |
| 141 | 142 |
| 142 #if defined(OS_MACOSX) && !defined(OS_IOS) | 143 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 143 void ObserveKeychainEvents() { | 144 void ObserveKeychainEvents() { |
| 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 145 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); | 146 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); |
| 146 } | 147 } |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 834 | 835 |
| 835 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, | 836 void IOThread::ConfigureSpdyFromTrial(const std::string& spdy_trial_group, |
| 836 Globals* globals) { | 837 Globals* globals) { |
| 837 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { | 838 if (spdy_trial_group == kSpdyFieldTrialHoldbackGroupName) { |
| 838 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? | 839 // TODO(jgraettinger): Use net::NextProtosHttpOnly() instead? |
| 839 net::HttpStreamFactory::set_spdy_enabled(false); | 840 net::HttpStreamFactory::set_spdy_enabled(false); |
| 840 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { | 841 } else if (spdy_trial_group == kSpdyFieldTrialHoldbackControlGroupName) { |
| 841 // Use the current SPDY default (SPDY/3.1). | 842 // Use the current SPDY default (SPDY/3.1). |
| 842 globals->next_protos = net::NextProtosSpdy31(); | 843 globals->next_protos = net::NextProtosSpdy31(); |
| 843 globals->use_alternate_protocols.set(true); | 844 globals->use_alternate_protocols.set(true); |
| 844 } else if (spdy_trial_group == kSpdyFieldTrialSpdy4GroupName) { | 845 } else if (spdy_trial_group == kSpdyFieldTrialSpdy4GroupName) { |
|
Ryan Hamilton
2014/10/30 17:34:32
We've been doing a lot of finch config work with Q
Bence
2014/10/30 18:39:03
This is a great idea. I am extenting this to Spdy
| |
| 845 globals->next_protos = net::NextProtosSpdy4Http2(); | 846 globals->next_protos = net::NextProtosSpdy4Http2(); |
| 846 globals->use_alternate_protocols.set(true); | 847 globals->use_alternate_protocols.set(true); |
| 848 } else if (spdy_trial_group == kSpdyFieldTrialSpdy4ExperimentGroupName) { | |
| 849 globals->next_protos = net::NextProtosSpdy4Http2(); | |
| 850 globals->use_alternate_protocols.set(true); | |
| 847 } else if (spdy_trial_group == kSpdyFieldTrialSpdy4ControlGroupName) { | 851 } else if (spdy_trial_group == kSpdyFieldTrialSpdy4ControlGroupName) { |
| 848 // This control group is pinned at SPDY/3.1. | 852 // This control group is pinned at SPDY/3.1. |
| 849 globals->next_protos = net::NextProtosSpdy31(); | 853 globals->next_protos = net::NextProtosSpdy31(); |
| 850 globals->use_alternate_protocols.set(true); | 854 globals->use_alternate_protocols.set(true); |
| 851 } else { | 855 } else { |
| 852 // Use the current SPDY default (SPDY/3.1). | 856 // Use the current SPDY default (SPDY/3.1). |
| 853 globals->next_protos = net::NextProtosSpdy31(); | 857 globals->next_protos = net::NextProtosSpdy31(); |
| 854 globals->use_alternate_protocols.set(true); | 858 globals->use_alternate_protocols.set(true); |
| 855 } | 859 } |
| 856 } | 860 } |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1432 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1436 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1433 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1437 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1434 net::QuicVersion version = supported_versions[i]; | 1438 net::QuicVersion version = supported_versions[i]; |
| 1435 if (net::QuicVersionToString(version) == quic_version) { | 1439 if (net::QuicVersionToString(version) == quic_version) { |
| 1436 return version; | 1440 return version; |
| 1437 } | 1441 } |
| 1438 } | 1442 } |
| 1439 | 1443 |
| 1440 return net::QUIC_VERSION_UNSUPPORTED; | 1444 return net::QUIC_VERSION_UNSUPPORTED; |
| 1441 } | 1445 } |
| OLD | NEW |