summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/omnibox/browser/omnibox_field_trial.cc15
-rw-r--r--components/omnibox/browser/omnibox_field_trial.h13
-rw-r--r--components/omnibox/browser/scored_history_match.cc10
-rw-r--r--components/omnibox/browser/scored_history_match.h3
4 files changed, 28 insertions, 13 deletions
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
index b07ce44..2d03ad8 100644
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -410,10 +410,16 @@ float OmniboxFieldTrial::HQPExperimentalTopicalityThreshold() {
return static_cast<float>(topicality_threshold);
}
-bool OmniboxFieldTrial::HQPFixFrequencyScoringBugs() {
+bool OmniboxFieldTrial::HQPFixTypedVisitBug() {
return variations::GetVariationParamValue(
kBundledExperimentFieldTrialName,
- kHQPFixFrequencyScoringBugsRule) == "true";
+ kHQPFixTypedVisitBugRule) == "true";
+}
+
+bool OmniboxFieldTrial::HQPFixFewVisitsBug() {
+ return variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName,
+ kHQPFixFewVisitsBugRule) == "true";
}
size_t OmniboxFieldTrial::HQPNumTitleWordsToAllow() {
@@ -491,8 +497,9 @@ OmniboxFieldTrial::kMeasureSuggestPollingDelayFromLastKeystrokeRule[] =
"MeasureSuggestPollingDelayFromLastKeystroke";
const char OmniboxFieldTrial::kSuggestPollingDelayMsRule[] =
"SuggestPollingDelayMs";
-const char OmniboxFieldTrial::kHQPFixFrequencyScoringBugsRule[] =
- "HQPFixFrequencyScoringBugs";
+const char OmniboxFieldTrial::kHQPFixTypedVisitBugRule[] =
+ "HQPFixTypedVisitBug";
+const char OmniboxFieldTrial::kHQPFixFewVisitsBugRule[] = "HQPFixFewVisitsBug";
const char OmniboxFieldTrial::kHQPNumTitleWordsRule[] = "HQPNumTitleWords";
const char OmniboxFieldTrial::kHQPAlsoDoHUPLikeScoringRule[] =
"HQPAlsoDoHUPLikeScoring";
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h
index 674170f..566b89f 100644
--- a/components/omnibox/browser/omnibox_field_trial.h
+++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -285,9 +285,13 @@ class OmniboxFieldTrial {
// For the HQPFixFrequencyScoring experiment that's part of the
// bundled omnibox field trial.
- // Returns true if HQP should apply the bug fixes to the GetFrequency()
- // function.
- static bool HQPFixFrequencyScoringBugs();
+ // Returns true if HQP should apply the bug fix for correctly identifying
+ // typed visits.
+ static bool HQPFixTypedVisitBug();
+
+ // Returns true if HQP should apply the bug fix to discount the visits to
+ // pages visited less than ten times.
+ static bool HQPFixFewVisitsBug();
// ---------------------------------------------------------
// For the HQPNumTitleWords experiment that's part of the
@@ -359,7 +363,8 @@ class OmniboxFieldTrial {
static const char kDisableResultsCachingRule[];
static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[];
static const char kSuggestPollingDelayMsRule[];
- static const char kHQPFixFrequencyScoringBugsRule[];
+ static const char kHQPFixTypedVisitBugRule[];
+ static const char kHQPFixFewVisitsBugRule[];
static const char kHQPNumTitleWordsRule[];
static const char kHQPAlsoDoHUPLikeScoringRule[];
static const char kPreventUWYTDefaultForNonURLInputsRule[];
diff --git a/components/omnibox/browser/scored_history_match.cc b/components/omnibox/browser/scored_history_match.cc
index 936d912..b7d1640 100644
--- a/components/omnibox/browser/scored_history_match.cc
+++ b/components/omnibox/browser/scored_history_match.cc
@@ -108,7 +108,8 @@ void InitDaysAgoToRecencyScoreArray() {
const size_t ScoredHistoryMatch::kMaxVisitsToScore = 10;
bool ScoredHistoryMatch::also_do_hup_like_scoring_ = false;
int ScoredHistoryMatch::bookmark_value_ = 1;
-bool ScoredHistoryMatch::fix_frequency_bugs_ = false;
+bool ScoredHistoryMatch::fix_typed_visit_bug_ = false;
+bool ScoredHistoryMatch::fix_few_visits_bug_ = false;
bool ScoredHistoryMatch::allow_tld_matches_ = false;
bool ScoredHistoryMatch::allow_scheme_matches_ = false;
size_t ScoredHistoryMatch::num_title_words_to_allow_ = 10u;
@@ -410,7 +411,8 @@ void ScoredHistoryMatch::Init() {
initialized = true;
also_do_hup_like_scoring_ = OmniboxFieldTrial::HQPAlsoDoHUPLikeScoring();
bookmark_value_ = OmniboxFieldTrial::HQPBookmarkValue();
- fix_frequency_bugs_ = OmniboxFieldTrial::HQPFixFrequencyScoringBugs();
+ fix_typed_visit_bug_ = OmniboxFieldTrial::HQPFixTypedVisitBug();
+ fix_few_visits_bug_ = OmniboxFieldTrial::HQPFixFewVisitsBug();
allow_tld_matches_ = OmniboxFieldTrial::HQPAllowMatchInTLDValue();
allow_scheme_matches_ = OmniboxFieldTrial::HQPAllowMatchInSchemeValue();
num_title_words_to_allow_ = OmniboxFieldTrial::HQPNumTitleWordsToAllow();
@@ -586,7 +588,7 @@ float ScoredHistoryMatch::GetFrequency(const base::Time& now,
const size_t max_visit_to_score =
std::min(visits.size(), ScoredHistoryMatch::kMaxVisitsToScore);
for (size_t i = 0; i < max_visit_to_score; ++i) {
- const ui::PageTransition page_transition = fix_frequency_bugs_ ?
+ const ui::PageTransition page_transition = fix_typed_visit_bug_ ?
ui::PageTransitionStripQualifier(visits[i].second) : visits[i].second;
int value_of_transition =
(page_transition == ui::PAGE_TRANSITION_TYPED) ? 20 : 1;
@@ -596,7 +598,7 @@ float ScoredHistoryMatch::GetFrequency(const base::Time& now,
GetRecencyScore((now - visits[i].first).InDays());
summed_visit_points += (value_of_transition * bucket_weight);
}
- if (fix_frequency_bugs_)
+ if (fix_few_visits_bug_)
return summed_visit_points / ScoredHistoryMatch::kMaxVisitsToScore;
return visits.size() * summed_visit_points /
ScoredHistoryMatch::kMaxVisitsToScore;
diff --git a/components/omnibox/browser/scored_history_match.h b/components/omnibox/browser/scored_history_match.h
index d1e275d..d6a3fb9 100644
--- a/components/omnibox/browser/scored_history_match.h
+++ b/components/omnibox/browser/scored_history_match.h
@@ -170,7 +170,8 @@ struct ScoredHistoryMatch : public history::HistoryMatch {
static int bookmark_value_;
// True if we should fix certain bugs in frequency scoring.
- static bool fix_frequency_bugs_;
+ static bool fix_typed_visit_bug_;
+ static bool fix_few_visits_bug_;
// If true, we allow input terms to match in the TLD (e.g., ".com").
static bool allow_tld_matches_;