Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Issue 55413002: Don't demote top match for certain match types. (Closed)

Created:
7 years, 1 month ago by H Fung
Modified:
7 years, 1 month ago
Reviewers:
Peter Kasting, Mark P
CC:
chromium-reviews, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Don't demote top match for certain match types. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=232979

Patch Set 1 : #

Total comments: 2

Patch Set 2 : Add tests, fix bugs. #

Total comments: 4

Patch Set 3 : Mark's comments #

Total comments: 6

Patch Set 4 : Simplify code, modify comments. #

Total comments: 13

Patch Set 5 : Fix bug depending on sorting. #

Patch Set 6 : Peter's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -2 lines) Patch
M chrome/browser/autocomplete/autocomplete_result.cc View 1 2 3 4 5 2 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/autocomplete_result_unittest.cc View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
M chrome/browser/omnibox/omnibox_field_trial.h View 1 2 3 4 5 4 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/omnibox/omnibox_field_trial.cc View 1 2 3 4 5 3 chunks +28 lines, -1 line 0 comments Download
M chrome/browser/omnibox/omnibox_field_trial_unittest.cc View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
H Fung
This is what I have so far to not demote the top suggestion as discussed ...
7 years, 1 month ago (2013-10-31 23:15:18 UTC) #1
Peter Kasting
https://codereview.chromium.org/55413002/diff/20001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/20001/chrome/browser/autocomplete/autocomplete_result.cc#newcode164 chrome/browser/autocomplete/autocomplete_result.cc:164: matches_.begin()->demoteable = false; Is this basically only used by ...
7 years, 1 month ago (2013-10-31 23:27:59 UTC) #2
H Fung
I've added tests now. PTAL. https://codereview.chromium.org/55413002/diff/20001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/20001/chrome/browser/autocomplete/autocomplete_result.cc#newcode164 chrome/browser/autocomplete/autocomplete_result.cc:164: matches_.begin()->demoteable = false; On ...
7 years, 1 month ago (2013-11-01 23:42:56 UTC) #3
Mark P
https://codereview.chromium.org/55413002/diff/110001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/110001/chrome/browser/autocomplete/autocomplete_result.cc#newcode156 chrome/browser/autocomplete/autocomplete_result.cc:156: size_t max_num_matches = std::min(kMaxMatches, matches_.size()); Can you put this ...
7 years, 1 month ago (2013-11-04 18:47:55 UTC) #4
H Fung
https://codereview.chromium.org/55413002/diff/110001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/110001/chrome/browser/autocomplete/autocomplete_result.cc#newcode156 chrome/browser/autocomplete/autocomplete_result.cc:156: size_t max_num_matches = std::min(kMaxMatches, matches_.size()); On 2013/11/04 18:47:56, Mark ...
7 years, 1 month ago (2013-11-04 19:44:08 UTC) #5
Mark P
once you fix comments below (no need to wait for me to look at those ...
7 years, 1 month ago (2013-11-04 20:30:12 UTC) #6
H Fung
Thanks Mark for the quick comments. I'm not sure your suggested changes to comments are ...
7 years, 1 month ago (2013-11-04 21:39:56 UTC) #7
Mark P
lgtm, but again please wait for Peter. (I'll leave it up to him to debate ...
7 years, 1 month ago (2013-11-04 21:50:42 UTC) #8
H Fung
After some more testing, I realized there was a bug and uploaded a fix and ...
7 years, 1 month ago (2013-11-05 00:43:47 UTC) #9
Peter Kasting
LGTM https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc#newcode162 chrome/browser/autocomplete/autocomplete_result.cc:162: (undemotable_top_types.find(matches_.begin()->type) != Nit: Instead of using find(), use ...
7 years, 1 month ago (2013-11-05 04:09:55 UTC) #10
H Fung
Thanks for the reviews! https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc#newcode162 chrome/browser/autocomplete/autocomplete_result.cc:162: (undemotable_top_types.find(matches_.begin()->type) != On 2013/11/05 04:09:55, ...
7 years, 1 month ago (2013-11-05 06:11:26 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hfung@chromium.org/55413002/700002
7 years, 1 month ago (2013-11-05 06:23:53 UTC) #12
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=93817
7 years, 1 month ago (2013-11-05 10:12:11 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hfung@chromium.org/55413002/700002
7 years, 1 month ago (2013-11-05 11:26:09 UTC) #14
commit-bot: I haz the power
Change committed as 232979
7 years, 1 month ago (2013-11-05 14:21:57 UTC) #15
Peter Kasting
https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocomplete/autocomplete_result.cc#newcode162 chrome/browser/autocomplete/autocomplete_result.cc:162: (undemotable_top_types.find(matches_.begin()->type) != On 2013/11/05 06:11:27, H Fung wrote: > ...
7 years, 1 month ago (2013-11-05 20:00:33 UTC) #16
Bart N.
7 years, 1 month ago (2013-11-05 20:52:47 UTC) #17
Message was sent while issue was closed.
On 2013/11/05 20:00:33, Peter Kasting wrote:
>
https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocompl...
> File chrome/browser/autocomplete/autocomplete_result.cc (right):
> 
>
https://codereview.chromium.org/55413002/diff/420001/chrome/browser/autocompl...
> chrome/browser/autocomplete/autocomplete_result.cc:162:
> (undemotable_top_types.find(matches_.begin()->type) !=
> On 2013/11/05 06:11:27, H Fung wrote:
> > On 2013/11/05 04:09:55, Peter Kasting wrote:
> > > Nit: Instead of using find(), use count() and check for the result being
> > > nonzero.
> > 
> > Done.  Actually, should ContainsKey() be used instead?  I won't do it now
> since
> > I don't see it used too often and might commit this change soon.
> 
> From stl_util.h?  I don't really know why we have that -- it's not
particularly
> shorter, less complicated, or more efficient than using count().  We should
> probably just remove that.
> 
> The only advantage I could see would be if this supports more containers than
> expose count(), and thus makes code a bit more "type-agnostic" in case the
> container type is changed later.
Using count() here is a perfect example of bad coding. I'll save my time of
explaining why, but we can chat offline :)

Powered by Google App Engine
This is Rietveld 408576698