| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/prerender/prerender_field_trial.h" | 5 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 PrerenderManager::GetMode(), | 160 PrerenderManager::GetMode(), |
| 161 PrerenderManager::PRERENDER_MODE_MAX); | 161 PrerenderManager::PRERENDER_MODE_MAX); |
| 162 | 162 |
| 163 ConfigurePrerenderFromOmnibox(); | 163 ConfigurePrerenderFromOmnibox(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void ConfigurePrerenderFromOmnibox() { | 166 void ConfigurePrerenderFromOmnibox() { |
| 167 // Field trial to see if we're enabled. | 167 // Field trial to see if we're enabled. |
| 168 const base::FieldTrial::Probability kDivisor = 100; | 168 const base::FieldTrial::Probability kDivisor = 100; |
| 169 | 169 |
| 170 const base::FieldTrial::Probability kEnabledProbability = 40; | 170 const base::FieldTrial::Probability kEnabledProbability = 90; |
| 171 scoped_refptr<base::FieldTrial> enabled_trial( | 171 scoped_refptr<base::FieldTrial> enabled_trial( |
| 172 new base::FieldTrial(kPrerenderFromOmniboxTrialName, kDivisor, | 172 new base::FieldTrial(kPrerenderFromOmniboxTrialName, kDivisor, |
| 173 "OmniboxPrerenderDisabled", 2012, 8, 30)); | 173 "OmniboxPrerenderDisabled", 2012, 8, 30)); |
| 174 enabled_trial->AppendGroup("OmniboxPrerenderEnabled", kEnabledProbability); | 174 enabled_trial->AppendGroup("OmniboxPrerenderEnabled", kEnabledProbability); |
| 175 | 175 |
| 176 // Field trial to see which heuristic to use. | 176 // Field trial to see which heuristic to use. |
| 177 const base::FieldTrial::Probability kExactFullProbability = 50; | 177 const base::FieldTrial::Probability kExactFullProbability = 50; |
| 178 scoped_refptr<base::FieldTrial> heuristic_trial( | 178 scoped_refptr<base::FieldTrial> heuristic_trial( |
| 179 new base::FieldTrial(kPrerenderFromOmniboxHeuristicTrialName, kDivisor, | 179 new base::FieldTrial(kPrerenderFromOmniboxHeuristicTrialName, kDivisor, |
| 180 "OriginalAlgorithm", 2012, 8, 30)); | 180 "OriginalAlgorithm", 2012, 8, 30)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 // If we don't have a group just return the exact heuristic. | 226 // If we don't have a group just return the exact heuristic. |
| 227 return OMNIBOX_HEURISTIC_EXACT; | 227 return OMNIBOX_HEURISTIC_EXACT; |
| 228 } | 228 } |
| 229 | 229 |
| 230 std::string GetOmniboxHistogramSuffix() { | 230 std::string GetOmniboxHistogramSuffix() { |
| 231 return NameFromOmniboxHeuristic(prerender::GetOmniboxHeuristicToUse()); | 231 return NameFromOmniboxHeuristic(prerender::GetOmniboxHeuristicToUse()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace prerender | 234 } // namespace prerender |
| OLD | NEW |