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

Issue 2538763002: Data from the autocomplete predictor wasn't deleted immediately when deleting browsing history. (Closed)

Created:
4 years ago by dullweber
Modified:
4 years ago
Reviewers:
pasko, Benoit L
CC:
chromium-reviews, shishir+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Data from the autocomplete predictor wasn't deleted immediately when deleting browsing history. The cleanup method DeleteOldEntries() only deleted the data on next start because the corresponding history entries didn't exist anymore. The problem is that the AutocompleteActionPredictor unsubscribes from HistoryService events and doesn't get notified about history deletion. The deletion method was added in this cl: http://crrev.com/773103004 but it was never called as OnHistoryServiceLoaded() removed the subscription after initialization. The same issue exists and is fixed in the ResourcePrefetchPredictor code. BUG=668715 Committed: https://crrev.com/6a66fa4f05011ff93f2f4f5466662af9c7b16b9a Cr-Commit-Position: refs/heads/master@{#439077}

Patch Set 1 #

Patch Set 2 : fix prefetch predictor as well #

Total comments: 14

Patch Set 3 : remove boolean return declaration #

Patch Set 4 : change initialization check to DCHECK #

Patch Set 5 : fix destruction order #

Total comments: 6

Patch Set 6 : assume history_service always exist to ensure we definitly delete data when requested #

Total comments: 2

Patch Set 7 : revert dcheck(history_service) add dcheck(initialized_) #

Total comments: 1

Patch Set 8 : move TryDeleteOldEntries in condition #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -30 lines) Patch
M chrome/browser/predictors/autocomplete_action_predictor.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/predictors/autocomplete_action_predictor.cc View 1 2 3 4 5 6 7 5 chunks +11 lines, -17 lines 0 comments Download
M chrome/browser/predictors/autocomplete_action_predictor_unittest.cc View 1 2 3 4 5 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor.cc View 1 2 3 4 5 6 3 chunks +6 lines, -8 lines 0 comments Download

Messages

Total messages: 44 (30 generated)
dullweber
Zhen, please review these changes
4 years ago (2016-11-29 15:22:00 UTC) #8
Zhen Wang
+pasko, lizeb, can you review this as you guys worked on this lately?
4 years ago (2016-11-29 17:04:36 UTC) #10
pasko
https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc File chrome/browser/predictors/autocomplete_action_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc#newcode445 chrome/browser/predictors/autocomplete_action_predictor.cc:445: TryDeleteOldEntries(history_service); after this change the return value is never ...
4 years ago (2016-11-29 18:01:01 UTC) #11
dullweber
https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc File chrome/browser/predictors/autocomplete_action_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc#newcode445 chrome/browser/predictors/autocomplete_action_predictor.cc:445: TryDeleteOldEntries(history_service); On 2016/11/29 18:01:00, pasko wrote: > after this ...
4 years ago (2016-11-30 11:49:21 UTC) #13
pasko
thank you for responses. I still think we can make the code more straightforward and ...
4 years ago (2016-12-01 17:26:41 UTC) #14
dullweber
https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc File chrome/browser/predictors/autocomplete_action_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/20001/chrome/browser/predictors/autocomplete_action_predictor.cc#newcode447 chrome/browser/predictors/autocomplete_action_predictor.cc:447: history_service_observer_.Add(history_service); On 2016/12/01 17:26:41, pasko wrote: > On 2016/11/30 ...
4 years ago (2016-12-05 13:07:57 UTC) #21
pasko
I was OOO most of previous week, only had time to look at the change ...
4 years ago (2016-12-12 19:15:43 UTC) #24
dullweber
No problem. I removed the conditions and now always assume that a valid HistoryService is ...
4 years ago (2016-12-13 15:47:36 UTC) #27
pasko
https://codereview.chromium.org/2538763002/diff/80001/chrome/browser/predictors/resource_prefetch_predictor.cc File chrome/browser/predictors/resource_prefetch_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/80001/chrome/browser/predictors/resource_prefetch_predictor.cc#newcode1155 chrome/browser/predictors/resource_prefetch_predictor.cc:1155: if (!history_service) On 2016/12/13 15:47:35, dullweber wrote: > On ...
4 years ago (2016-12-15 12:57:36 UTC) #30
dullweber
https://codereview.chromium.org/2538763002/diff/80001/chrome/browser/predictors/resource_prefetch_predictor.cc File chrome/browser/predictors/resource_prefetch_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/80001/chrome/browser/predictors/resource_prefetch_predictor.cc#newcode1155 chrome/browser/predictors/resource_prefetch_predictor.cc:1155: if (!history_service) On 2016/12/15 12:57:35, pasko wrote: > On ...
4 years ago (2016-12-15 14:52:18 UTC) #33
pasko
lgtm, thank you! https://codereview.chromium.org/2538763002/diff/120001/chrome/browser/predictors/autocomplete_action_predictor.cc File chrome/browser/predictors/autocomplete_action_predictor.cc (right): https://codereview.chromium.org/2538763002/diff/120001/chrome/browser/predictors/autocomplete_action_predictor.cc#newcode444 chrome/browser/predictors/autocomplete_action_predictor.cc:444: if (history_service) nit: extra check for ...
4 years ago (2016-12-15 15:29:48 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2538763002/140001
4 years ago (2016-12-16 08:50:08 UTC) #39
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years ago (2016-12-16 09:42:33 UTC) #42
commit-bot: I haz the power
4 years ago (2016-12-16 09:44:14 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/6a66fa4f05011ff93f2f4f5466662af9c7b16b9a
Cr-Commit-Position: refs/heads/master@{#439077}

Powered by Google App Engine
This is Rietveld 408576698