|
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
Total comments: 1
|
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
|
Total messages: 2 (0 generated)
|