Commit 38a35336 authored by mpearson's avatar mpearson Committed by Commit bot

Omnibox - HQP - Frequency Scoring Bug Fix

The previous fix to detecting page transition types was wrong, but close
enough to correct that it seemed right when I tested it.  I realized it was
wrong when reviewing some other history-processing code today.

(The only places where it was wrong were places that had the same bits set
or more as PAGE_TRANSITION_TYPED: i.e., PAGE_TRANSITION_AUTO_SUBFRAME,
PAGE_TRANSITION_GENERATED, PAGE_TRANSITION_FORM_SUBMIT, and
PAGE_TRANSITION_KEYWORD.  None of these other page transition types
typically make it into HQP in-memory index, which is I why I didn't notice
the effect of my incorrect fix.)

BUG=369989

Review URL: https://codereview.chromium.org/1030913002

Cr-Commit-Position: refs/heads/master@{#322256}
parent 999677e0
......@@ -587,10 +587,10 @@ 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 bool typed_visit = fix_frequency_bugs_ ?
(visits[i].second & ui::PAGE_TRANSITION_TYPED) :
(visits[i].second == ui::PAGE_TRANSITION_TYPED);
int value_of_transition = typed_visit ? 20 : 1;
const ui::PageTransition page_transition = fix_frequency_bugs_ ?
ui::PageTransitionStripQualifier(visits[i].second) : visits[i].second;
int value_of_transition =
(page_transition == ui::PAGE_TRANSITION_TYPED) ? 20 : 1;
if (bookmarked)
value_of_transition = std::max(value_of_transition, bookmark_value_);
const float bucket_weight =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment