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

Issue 10458077: When the Google base URL changes and causes keyword updates, save those to the database. (Closed)

Created:
8 years, 6 months ago by Peter Kasting
Modified:
8 years, 6 months ago
Reviewers:
SteveT
CC:
chromium-reviews
Visibility:
Public.

Description

When the Google base URL changes and causes keyword updates, save those to the database and send them to sync. Note that even if the database had the wrong keyword, a TemplateURL would get reset to the correct keyword on next load (in the model, not in the database), so this is mostly useful for keeping state as consistent as possible rather than preventing visible local problems. One tricky bit here is that we don't want these sorts of changes to change the keywords of existing URLs in other sync clients, lest we give an entry the wrong keyword for the local environment. I could have dealt with this by never sending such updates to sync at all, but given that remote clients need to deal with these sorts of issues anyway for other reasons (e.g. a user adding a new TemplateURL that uses Google base URLs), it seemed less error-prone to use the standard UpdateNoNotify() functionality and then ensure remote clients handle things correctly. This will also ensure that if we e.g. change the TemplateURL's last_modified date when updating the base URL, that change will get propagated to sync, which is (once again) good for keeping the server and all clients seeing the most consistent state possible. BUG=128249 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=140608

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 6

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -145 lines) Patch
M chrome/browser/google/google_url_tracker.h View 1 2 3 4 5 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/google/google_url_tracker.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/search_engines/search_host_to_urls_map.h View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/search_engines/search_host_to_urls_map.cc View 1 2 3 4 2 chunks +4 lines, -25 lines 0 comments Download
M chrome/browser/search_engines/search_host_to_urls_map_unittest.cc View 1 2 3 4 2 chunks +2 lines, -22 lines 0 comments Download
M chrome/browser/search_engines/search_provider_install_data.cc View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url.h View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/search_engines/template_url.cc View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/search_engines/template_url_service.h View 1 2 3 4 3 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/search_engines/template_url_service.cc View 1 2 3 4 15 chunks +96 lines, -45 lines 0 comments Download
M chrome/browser/search_engines/template_url_service_sync_unittest.cc View 1 2 3 4 2 chunks +38 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service_test_util.cc View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service_unittest.cc View 1 2 3 4 2 chunks +22 lines, -19 lines 0 comments Download
M chrome/browser/search_engines/util.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_notification_types.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Peter Kasting
8 years, 6 months ago (2012-06-01 19:37:04 UTC) #1
SteveT
Looking good. Small things inline. http://codereview.chromium.org/10458077/diff/24001/chrome/browser/search_engines/template_url_service.cc File chrome/browser/search_engines/template_url_service.cc (right): http://codereview.chromium.org/10458077/diff/24001/chrome/browser/search_engines/template_url_service.cc#newcode1823 chrome/browser/search_engines/template_url_service.cc:1823: KeywordToTemplateMap::const_iterator i = nit: ...
8 years, 6 months ago (2012-06-05 15:11:42 UTC) #2
Peter Kasting
https://chromiumcodereview.appspot.com/10458077/diff/24001/chrome/browser/search_engines/template_url_service.cc File chrome/browser/search_engines/template_url_service.cc (right): https://chromiumcodereview.appspot.com/10458077/diff/24001/chrome/browser/search_engines/template_url_service.cc#newcode1823 chrome/browser/search_engines/template_url_service.cc:1823: KeywordToTemplateMap::const_iterator i = On 2012/06/05 15:11:42, SteveT wrote: > ...
8 years, 6 months ago (2012-06-05 20:49:03 UTC) #3
SteveT
8 years, 6 months ago (2012-06-05 20:57:12 UTC) #4
lgtm

Powered by Google App Engine
This is Rietveld 408576698