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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 10753022: TLS channel id field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/chrome_browser_main.h ('k') | net/base/ssl_config_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 4a279f3fef89db9349eeb1cc452ef56fcc5debcf..64548b08834bf226c4190e4fed0250f58e7f8223 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -115,6 +115,7 @@
#include "grit/platform_locale_settings.h"
#include "net/base/net_module.h"
#include "net/base/sdch_manager.h"
+#include "net/base/ssl_config_service.h"
#include "net/cookies/cookie_monster.h"
#include "net/http/http_basic_stream.h"
#include "net/http/http_network_layer.h"
@@ -1099,6 +1100,25 @@ void ChromeBrowserMainParts::DisableNewTabFieldTrialIfNecesssary() {
}
}
+void ChromeBrowserMainParts::ChannelIDFieldTrial() {
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
+ net::SSLConfigService::EnableChannelIDTrial();
+ } else if (channel == chrome::VersionInfo::CHANNEL_DEV &&
+ base::FieldTrialList::IsOneTimeRandomizationEnabled()) {
+ const base::FieldTrial::Probability kDivisor = 100;
+ // 10% probability of being in the enabled group.
+ const base::FieldTrial::Probability kEnableProbability = 10;
+ scoped_refptr<base::FieldTrial> trial =
+ base::FieldTrialList::FactoryGetFieldTrial(
+ "ChannelID", kDivisor, "disable", 2012, 8, 23, NULL);
+ trial->UseOneTimeRandomization();
+ int enable_group = trial->AppendGroup("enable", kEnableProbability);
+ if (trial->group() == enable_group)
+ net::SSLConfigService::EnableChannelIDTrial();
+ }
+}
+
// ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related --------------
void ChromeBrowserMainParts::SetupFieldTrials(bool proxy_policy_is_set) {
@@ -1121,6 +1141,7 @@ void ChromeBrowserMainParts::SetupFieldTrials(bool proxy_policy_is_set) {
SetupUniformityFieldTrials();
AutocompleteFieldTrial::Activate();
DisableNewTabFieldTrialIfNecesssary();
+ ChannelIDFieldTrial();
}
void ChromeBrowserMainParts::StartMetricsRecording() {
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | net/base/ssl_config_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698