Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Issue 10382066: Now that TemplateURLs are guaranteed to have a unique, non-empty keyword, replace AutocompleteMatch… (Closed)

Created:
8 years, 7 months ago by Peter Kasting
Modified:
8 years, 7 months ago
Reviewers:
sky
CC:
chromium-reviews, Aaron Boodman, James Su, mihaip-chromium-reviews_chromium.org, aaron.randolph
Visibility:
Public.

Description

Now that TemplateURLs are guaranteed to have a unique, non-empty keyword, replace AutocompleteMatch's TemplateURL* with a std::string |keyword_|. This has two benefits: * It's safer in general, because the pointer can't be deleted out from under us. Users inherently have to recheck the TemplateURL* they get via the keyword each time they re-fetch it. * It allows the SearchProvider to stop keeping copied TemplateURLs for the default and keyword providers (in an attempt to mitigate the above problem) and instead just keep their keywords. This will also help in removing the TemplateURL copy constructor in a later patch. Note that there already was a |keyword_| field on AutocompleteMatch, so to make this change we have to expand its meaning a bit to cover the scenarios where before we would have had a |template_url_| but not a keyword. Code that cares about this distinction has already been migrated to using functions like GetKeywordUIState() instead of checking the member directly so this isn't terribly invasive. BUG=none TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=135905

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -179 lines) Patch
M chrome/browser/autocomplete/autocomplete.cc View 3 chunks +15 lines, -20 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_unittest.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.h View 4 chunks +22 lines, -18 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.cc View 6 chunks +13 lines, -10 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_model.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_unittest.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.cc View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 1 2 chunks +25 lines, -50 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 14 chunks +70 lines, -52 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 3 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/omnibox/omnibox_apitest.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/instant/instant_controller.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Peter Kasting
8 years, 7 months ago (2012-05-08 19:17:44 UTC) #1
sky
8 years, 7 months ago (2012-05-08 19:55:37 UTC) #2
LGTM

https://chromiumcodereview.appspot.com/10382066/diff/11002/chrome/browser/aut...
File chrome/browser/autocomplete/search_provider.h (right):

https://chromiumcodereview.appspot.com/10382066/diff/11002/chrome/browser/aut...
chrome/browser/autocomplete/search_provider.h:113: string16 default_provider()
const { return default_provider_; }
const string16& (same for keyword_provider()).

Powered by Google App Engine
This is Rietveld 408576698