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

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed)

Created:
4 years, 5 months ago by msramek
Modified:
4 years, 4 months ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, extensions-reviews_chromium.org, msramek+watch_chromium.org, michaelpg+watch-options_chromium.org, cbentzel+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, markusheintz_, davemoore+watch_chromium.org, Dan Beam
Base URL:
https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement a task scheduler for BrowsingDataRemover BrowsingDataRemover now processes each Remove() call by adding a task to a queue; the tasks are then processed serially. Design doc and discussion: https://docs.google.com/document/d/1oIbmZJlq5m5FvHcN7trCpp0h4mtydA0UfZasxEIe3P8/ Changes in this CL: 1. Add a RemovalTask struct that will represent an enqueued task. 2. Since BrowsingDataFilterBuilder and its subclasses are not copyable, change the interface so that it's passed in a unique_ptr (it must be owned by a RemovalTask so that it outlives the Remove() call). 3. Split the Remove() and RemoveWithFilter() interfaces into two versions, one with an observer and one without. Thus, RemoveAndReply() and RemoveWithFilterAndReply() are added. They must explicitly specify a *single* observer that will receive a callback from that particular task. 4. Despite the change #3, every observer must still explicitly register and unregister itself. This is needed so that if a caller is destroyed before its scheduled tasks are executed, it can unregister itself and we know that we should *not* call it back. 5. The recently added OnBrowsingDataRemoving() call which communicates a busy / idle state of BrowsingDataRemover still calls all registered observers. 6. Updated the tests with the new interface. To consider in follow-up CLs: - Use a base::Callback instead of an Observer pointer (see the discussion in the design doc), or use a task handles whose destruction will cancel the task. - Consider changing BrowsingDataFilterBuilder to be copyable. This is still not needed in production, but could simplify tests. TBR=mmenke@chromium.org,engedy@chromium.org,meacer@chromium.org,johnme@chromium.org,stevenjb@chromium.org BUG=630327 Committed: https://crrev.com/6f166831372df3044052eda2459982671c24ea5e Cr-Commit-Position: refs/heads/master@{#410016}

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressed comments. #

Patch Set 3 : Missing include #

Patch Set 4 : Rebase #

Patch Set 5 : RemoveInternal #

Total comments: 5

Patch Set 6 : virtual RemoveInternal() #

Patch Set 7 : Formatting. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+509 lines, -76 lines) Patch
M chrome/browser/android/preferences/pref_service_bridge.cc View 3 chunks +11 lines, -8 lines 0 comments Download
M chrome/browser/android/signin/signin_manager_android.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover.h View 1 2 3 4 5 11 chunks +113 lines, -12 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover.cc View 1 2 3 4 5 chunks +131 lines, -15 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_browsertest.cc View 1 2 chunks +16 lines, -9 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 3 4 6 chunks +210 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/profiles/profile_helper.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/browsing_data/browsing_data_api.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/net/sdch_browsertest.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/profile_resetter/profile_resetter.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc View 1 2 3 4 5 6 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/options/clear_browser_data_handler.cc View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 99 (79 generated)
msramek
Hi Bernhard, Can you please have a look? This is the implementation of the task ...
4 years, 4 months ago (2016-07-26 13:36:40 UTC) #53
Bernhard Bauer
https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode383 chrome/browser/browsing_data/browsing_data_remover.cc:383: DCHECK(!observer || observer_list_.HasObserver(observer)) If you allow the |observer| to ...
4 years, 4 months ago (2016-07-26 14:51:39 UTC) #56
msramek
https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode383 chrome/browser/browsing_data/browsing_data_remover.cc:383: DCHECK(!observer || observer_list_.HasObserver(observer)) On 2016/07/26 14:51:38, Bernhard Bauer wrote: ...
4 years, 4 months ago (2016-07-28 09:57:42 UTC) #60
Bernhard Bauer
https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode383 chrome/browser/browsing_data/browsing_data_remover.cc:383: DCHECK(!observer || observer_list_.HasObserver(observer)) On 2016/07/28 09:57:42, msramek wrote: > ...
4 years, 4 months ago (2016-08-03 16:42:46 UTC) #67
msramek
https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/2175703002/diff/200001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode383 chrome/browser/browsing_data/browsing_data_remover.cc:383: DCHECK(!observer || observer_list_.HasObserver(observer)) On 2016/08/03 16:42:46, Bernhard Bauer wrote: ...
4 years, 4 months ago (2016-08-03 21:16:44 UTC) #70
Bernhard Bauer
LGTM! https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h File chrome/browser/browsing_data/browsing_data_remover.h (right): https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h#newcode286 chrome/browser/browsing_data/browsing_data_remover.h:286: Observer* observer); You might want to make these ...
4 years, 4 months ago (2016-08-04 12:30:51 UTC) #73
msramek
Thanks Bernhard! https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h File chrome/browser/browsing_data/browsing_data_remover.h (right): https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h#newcode286 chrome/browser/browsing_data/browsing_data_remover.h:286: Observer* observer); On 2016/08/04 12:30:51, Bernhard Bauer ...
4 years, 4 months ago (2016-08-04 12:48:57 UTC) #74
Bernhard Bauer
https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h File chrome/browser/browsing_data/browsing_data_remover.h (right): https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h#newcode286 chrome/browser/browsing_data/browsing_data_remover.h:286: Observer* observer); On 2016/08/04 12:48:57, msramek wrote: > On ...
4 years, 4 months ago (2016-08-04 12:57:41 UTC) #75
msramek
https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h File chrome/browser/browsing_data/browsing_data_remover.h (right): https://codereview.chromium.org/2175703002/diff/300001/chrome/browser/browsing_data/browsing_data_remover.h#newcode286 chrome/browser/browsing_data/browsing_data_remover.h:286: Observer* observer); On 2016/08/04 12:57:41, Bernhard Bauer wrote: > ...
4 years, 4 months ago (2016-08-04 13:20:27 UTC) #78
msramek
The signature of Remove() calls has changed, so this CL also updates the callsites. Adding ...
4 years, 4 months ago (2016-08-04 13:47:05 UTC) #83
msramek
And explicitly +cc dbeam@ FYI this will probably be able to supersede your solution for ...
4 years, 4 months ago (2016-08-04 13:49:11 UTC) #84
mmenke
On 2016/08/04 13:49:11, msramek wrote: > And explicitly +cc dbeam@ FYI this will probably be ...
4 years, 4 months ago (2016-08-04 13:52:18 UTC) #85
engedy
chrome/browser/profile_resetter/ LGTM.
4 years, 4 months ago (2016-08-04 14:36:52 UTC) #86
meacer
chrome/browser/ssl LGTM
4 years, 4 months ago (2016-08-04 17:21:38 UTC) #89
johnme
push_messaging/ lgtm
4 years, 4 months ago (2016-08-04 17:28:56 UTC) #90
stevenjb
RS owner lgtm
4 years, 4 months ago (2016-08-04 23:48:01 UTC) #91
msramek
Thanks everyone! I added y'all to TBR, but then decided to wait a day just ...
4 years, 4 months ago (2016-08-05 08:40:49 UTC) #92
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/2175703002/340001
4 years, 4 months ago (2016-08-05 08:41:10 UTC) #95
commit-bot: I haz the power
Committed patchset #7 (id:340001)
4 years, 4 months ago (2016-08-05 08:44:50 UTC) #97
commit-bot: I haz the power
4 years, 4 months ago (2016-08-05 08:46:50 UTC) #99
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6f166831372df3044052eda2459982671c24ea5e
Cr-Commit-Position: refs/heads/master@{#410016}

Powered by Google App Engine
This is Rietveld 408576698