OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_browser_field_trials_desktop.h" | 5 #include "chrome/browser/chrome_browser_field_trials_desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 } | 60 } |
61 | 61 |
62 void DisableShowProfileSwitcherTrialIfNecessary() { | 62 void DisableShowProfileSwitcherTrialIfNecessary() { |
63 // This trial is created by the VariationsService, but it needs to be disabled | 63 // This trial is created by the VariationsService, but it needs to be disabled |
64 // if multi-profiles isn't enabled. | 64 // if multi-profiles isn't enabled. |
65 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); | 65 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); |
66 if (trial && !profiles::IsMultipleProfilesEnabled()) | 66 if (trial && !profiles::IsMultipleProfilesEnabled()) |
67 trial->Disable(); | 67 trial->Disable(); |
68 } | 68 } |
69 | 69 |
70 void SetupLowLatencyFlashAudioFieldTrial() { | 70 void SetupFlashHardwareVideoDecodeFieldTrial() { |
71 #if defined(OS_WIN) | |
72 // End this trial on a patch Tuesday. | |
71 scoped_refptr<base::FieldTrial> trial( | 73 scoped_refptr<base::FieldTrial> trial( |
72 base::FieldTrialList::FactoryGetFieldTrial( | 74 base::FieldTrialList::FactoryGetFieldTrial( |
73 content::kLowLatencyFlashAudioFieldTrialName, 100, "Standard", | 75 content::kFlashHwVideoDecodeFieldTrialName, 100, "Standard", |
74 2013, 9, 1, base::FieldTrial::SESSION_RANDOMIZED, NULL)); | 76 2014, 6, 10, base::FieldTrial::ONE_TIME_RANDOMIZED, NULL)); |
Alexei Svitkine (slow)
2014/01/22 16:27:24
It's better to initialize field trials entirely fr
| |
75 | 77 |
76 // Trial is enabled for dev / beta / canary users only. | 78 // Hardware decode is enabled for Windows canary/dev/unbranded users. On beta |
77 if (chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_STABLE) | 79 // channel it is enabled with 50% and on stable with 1% probability. |
78 trial->AppendGroup(content::kLowLatencyFlashAudioFieldTrialEnabledName, 25); | 80 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
81 if (channel == chrome::VersionInfo::CHANNEL_STABLE) | |
82 trial->AppendGroup(content::kFlashHwVideoDecodeFieldTrialEnabledName, 1); | |
83 else if (channel == chrome::VersionInfo::CHANNEL_BETA) | |
84 trial->AppendGroup(content::kFlashHwVideoDecodeFieldTrialEnabledName, 50); | |
85 else | |
86 trial->AppendGroup(content::kFlashHwVideoDecodeFieldTrialEnabledName, 100); | |
87 #endif // defined(OS_WIN) | |
79 } | 88 } |
80 | 89 |
81 void SetupPreReadFieldTrial() { | 90 void SetupPreReadFieldTrial() { |
82 // The chrome executable will have set (or not) an environment variable with | 91 // The chrome executable will have set (or not) an environment variable with |
83 // the group name into which this client belongs. | 92 // the group name into which this client belongs. |
84 std::string group; | 93 std::string group; |
85 scoped_ptr<base::Environment> env(base::Environment::Create()); | 94 scoped_ptr<base::Environment> env(base::Environment::Create()); |
86 if (!env->GetVar(chrome::kPreReadEnvironmentVariable, &group) || | 95 if (!env->GetVar(chrome::kPreReadEnvironmentVariable, &group) || |
87 group.empty()) { | 96 group.empty()) { |
88 return; | 97 return; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 | 135 |
127 void SetupDesktopFieldTrials(const CommandLine& parsed_command_line, | 136 void SetupDesktopFieldTrials(const CommandLine& parsed_command_line, |
128 const base::Time& install_time, | 137 const base::Time& install_time, |
129 PrefService* local_state) { | 138 PrefService* local_state) { |
130 prerender::ConfigurePrerender(parsed_command_line); | 139 prerender::ConfigurePrerender(parsed_command_line); |
131 AutoLaunchChromeFieldTrial(); | 140 AutoLaunchChromeFieldTrial(); |
132 OmniboxFieldTrial::ActivateStaticTrials(); | 141 OmniboxFieldTrial::ActivateStaticTrials(); |
133 SetupInfiniteCacheFieldTrial(); | 142 SetupInfiniteCacheFieldTrial(); |
134 DisableShowProfileSwitcherTrialIfNecessary(); | 143 DisableShowProfileSwitcherTrialIfNecessary(); |
135 SetupShowAppLauncherPromoFieldTrial(local_state); | 144 SetupShowAppLauncherPromoFieldTrial(local_state); |
136 SetupLowLatencyFlashAudioFieldTrial(); | 145 SetupFlashHardwareVideoDecodeFieldTrial(); |
137 SetupPreReadFieldTrial(); | 146 SetupPreReadFieldTrial(); |
138 } | 147 } |
139 | 148 |
140 } // namespace chrome | 149 } // namespace chrome |
OLD | NEW |