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

Side by Side Diff: chrome/browser/history/history_field_trial.cc

Issue 8379009: Add a field trial for using lower sqlite cache sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/history/history_field_trial.h"
6
7 #include "base/metrics/field_trial.h"
8
9 namespace history {
10
11 namespace {
12
13 int g_low_mem_trial_group = 0;
14 bool g_low_mem_trial = false;
15
16 static const char kHistoryFieldTrialName[] = "History";
17
18 } // namespace
19
20 // static
21 void HistoryFieldTrial::Activate() {
22 if (g_low_mem_trial_group)
23 return; // Already initialized.
24
25 scoped_refptr<base::FieldTrial> trial(new base::FieldTrial(
26 kHistoryFieldTrialName, 1000, "Inactive", 2012, 2, 1));
27
28 // 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
29 if (base::FieldTrialList::IsOneTimeRandomizationEnabled())
30 trial->UseOneTimeRandomization();
31
32 g_low_mem_trial_group = trial->AppendGroup("LowMem", 50); // 5%
33 if (trial->group() == g_low_mem_trial_group)
34 g_low_mem_trial = true;
35 }
36
37 // static
38 bool HistoryFieldTrial::IsLowMemFieldTrial() {
39 return g_low_mem_trial;
40 }
41
42 // static
43 std::string HistoryFieldTrial::GetGroupSuffix() {
44 return g_low_mem_trial ? std::string("_LowMem") : std::string();
45 }
46
47 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698