summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prerender/prerender_field_trial.cc
diff options
context:
space:
mode:
authordominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 21:40:02 +0000
committerdominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 21:40:02 +0000
commit5b4fc5b7c88b94d0e8b61eddd1c9203723ebd29e (patch)
treefac0fa0930794b2bd5f497ebc7cb117a46d3e981 /chrome/browser/prerender/prerender_field_trial.cc
parent47df8bbb283f8bfee7c2cef75b876ba51119e643 (diff)
downloadchromium_src-5b4fc5b7c88b94d0e8b61eddd1c9203723ebd29e.zip
chromium_src-5b4fc5b7c88b94d0e8b61eddd1c9203723ebd29e.tar.gz
chromium_src-5b4fc5b7c88b94d0e8b61eddd1c9203723ebd29e.tar.bz2
Add database to use as the source of an alternative algorithm for Network Action Prediction
BUG=98110 TEST=unit_tests:NetworkActionPredictor*,interactive_ui_tests:OmniboxViewTest* Review URL: http://codereview.chromium.org/8241014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_field_trial.cc')
-rw-r--r--chrome/browser/prerender/prerender_field_trial.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc
index 4956ffa..4c3344e9 100644
--- a/chrome/browser/prerender/prerender_field_trial.cc
+++ b/chrome/browser/prerender/prerender_field_trial.cc
@@ -22,10 +22,12 @@ namespace {
int omnibox_original_group_id = 0;
int omnibox_conservative_group_id = 0;
+int omnibox_exact_group_id = 0;
const char* kOmniboxHeuristicNames[] = {
"Original",
"Conservative",
+ "Exact"
};
COMPILE_ASSERT(arraysize(kOmniboxHeuristicNames) == OMNIBOX_HEURISTIC_MAX,
OmniboxHeuristic_name_count_mismatch);
@@ -170,7 +172,8 @@ void ConfigurePrerenderFromOmnibox() {
enabled_trial->AppendGroup("OmniboxPrerenderEnabled", kEnabledProbability);
// Field trial to see which heuristic to use.
- const base::FieldTrial::Probability kConservativeProbability = 50;
+ const base::FieldTrial::Probability kConservativeProbability = 33;
+ const base::FieldTrial::Probability kExactProbability = 33;
scoped_refptr<base::FieldTrial> heuristic_trial(
new base::FieldTrial("PrerenderFromOmniboxHeuristic", kDivisor,
"OriginalAlgorithm", 2012, 8, 30));
@@ -178,6 +181,8 @@ void ConfigurePrerenderFromOmnibox() {
omnibox_conservative_group_id =
heuristic_trial->AppendGroup("ConservativeAlgorithm",
kConservativeProbability);
+ omnibox_exact_group_id =
+ heuristic_trial->AppendGroup("ExactAlgorithm", kExactProbability);
}
bool IsOmniboxEnabled(Profile* profile) {
@@ -218,6 +223,8 @@ OmniboxHeuristic GetOmniboxHeuristicToUse() {
return OMNIBOX_HEURISTIC_ORIGINAL;
if (group == omnibox_conservative_group_id)
return OMNIBOX_HEURISTIC_CONSERVATIVE;
+ if (group == omnibox_exact_group_id)
+ return OMNIBOX_HEURISTIC_EXACT;
// If we don't have a group just return the original heuristic.
return OMNIBOX_HEURISTIC_ORIGINAL;