| OLD | NEW |
| (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 g_low_mem_trial_group = trial->AppendGroup("LowMem", 50); // 5% | |
| 29 if (trial->group() == g_low_mem_trial_group) | |
| 30 g_low_mem_trial = true; | |
| 31 } | |
| 32 | |
| 33 // static | |
| 34 bool HistoryFieldTrial::IsLowMemFieldTrial() { | |
| 35 return g_low_mem_trial; | |
| 36 } | |
| 37 | |
| 38 // static | |
| 39 std::string HistoryFieldTrial::GetGroupSuffix() { | |
| 40 return g_low_mem_trial ? std::string("_LowMem") : std::string(); | |
| 41 } | |
| 42 | |
| 43 } // namespace history | |
| OLD | NEW |