Chromium Code Reviews| Index: chrome/browser/history/history_field_trial.cc |
| =================================================================== |
| --- chrome/browser/history/history_field_trial.cc (revision 0) |
| +++ chrome/browser/history/history_field_trial.cc (revision 0) |
| @@ -0,0 +1,47 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/history/history_field_trial.h" |
| + |
| +#include "base/metrics/field_trial.h" |
| + |
| +namespace history { |
| + |
| +namespace { |
| + |
| +int g_low_mem_trial_group = 0; |
| +bool g_low_mem_trial = false; |
| + |
| +static const char kHistoryFieldTrialName[] = "History"; |
| + |
| +} // namespace |
| + |
| +// static |
| +void HistoryFieldTrial::Activate() { |
| + if (g_low_mem_trial_group) |
| + return; // Already initialized. |
| + |
| + scoped_refptr<base::FieldTrial> trial(new base::FieldTrial( |
| + kHistoryFieldTrialName, 1000, "Inactive", 2012, 2, 1)); |
| + |
| + // Try to give the user a consistent experience, if possible. |
|
jar (doing other things)
2011/10/24 18:40:55
Why do we want "consistent" experience? Are you e
Scott Hess - ex-Googler
2011/10/24 19:15:27
I would rather have a poor experience some of the
brettw
2011/10/25 01:55:02
I actually wasn't entirely sure if this was good o
|
| + if (base::FieldTrialList::IsOneTimeRandomizationEnabled()) |
| + trial->UseOneTimeRandomization(); |
| + |
| + g_low_mem_trial_group = trial->AppendGroup("LowMem", 50); // 5% |
| + if (trial->group() == g_low_mem_trial_group) |
| + g_low_mem_trial = true; |
| +} |
| + |
| +// static |
| +bool HistoryFieldTrial::IsLowMemFieldTrial() { |
| + return g_low_mem_trial; |
| +} |
| + |
| +// static |
| +std::string HistoryFieldTrial::GetGroupSuffix() { |
| + return g_low_mem_trial ? std::string("_LowMem") : std::string(); |
| +} |
| + |
| +} // namespace history |
| Property changes on: chrome\browser\history\history_field_trial.cc |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |