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

Issue 2240883002: Make ClearBrowsingDataHandler only observe its own removal task (Closed)

Created:
4 years, 4 months ago by msramek
Modified:
4 years, 3 months ago
Reviewers:
Dan Beam, dpapad
CC:
chromium-reviews, msramek+watch_chromium.org, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, arv+watch_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, markusheintz_
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ClearBrowsingDataHandler only observe its own removal task In https://codereview.chromium.org/2133893002/, ClearBrowsingDataHandler was made to observe whether BrowsingDataRemover has any removal task in progress and disable the "Clear data" button if that is the case. This is no longer necessary. BrowsingDataRemover is nowadays able to accept a new removal task at any time and call back (only) the associated observer when the task is done. Callers no longer need to be aware of the possibility of other removal tasks running. We still disable the "Clear data" button while we execute the removal task started by pressing that button - this serves as a feedback to the user that their removal task has indeed been executed, i.e. that pressing the button had an effect. However, opening another instance of a dialog in a different tab (i.e. tied to a different handler) allows the user to execute another parallel removal task if they wish to do so. Finally, we remove the OnBrowsingDataRemoverRemoving(bool) method from BrowsingDataRemover::Observer, as the previous behavior of ClearBrowsingDataHandler was its only usecase. In practice, this CL is mostly a partial revert of https://codereview.chromium.org/2133893002/ BUG=630327 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/a946e92eaa55cb6da801ada49dfdd51d786fa06d Cr-Commit-Position: refs/heads/master@{#415925}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Observer as a subclass. #

Total comments: 2

Patch Set 3 : Only forward-declare in the header file #

Total comments: 1

Messages

Total messages: 54 (43 generated)
msramek
Hi guys, Please have a look! This is the change I mentioned in the email ...
4 years, 4 months ago (2016-08-16 13:09:12 UTC) #11
Dan Beam
https://codereview.chromium.org/2240883002/diff/60001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc File chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc (right): https://codereview.chromium.org/2240883002/diff/60001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc#newcode183 chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc:183: DCHECK(!webui_callback_id_.empty()); this could currently fail in the [very uncommon ...
4 years, 4 months ago (2016-08-16 22:09:09 UTC) #14
msramek
Hi Dan! Sorry for the delay on this. I was pondering several options how to ...
4 years, 3 months ago (2016-08-26 15:09:44 UTC) #36
Dan Beam
On 2016/08/26 15:09:44, msramek wrote: > Hi Dan! > > Sorry for the delay on ...
4 years, 3 months ago (2016-08-30 01:32:08 UTC) #39
msramek
On 2016/08/30 01:32:08, Dan Beam wrote: > On 2016/08/26 15:09:44, msramek wrote: > > Hi ...
4 years, 3 months ago (2016-08-30 08:34:32 UTC) #40
Dan Beam
lgtm, sorry for perf review lag your explanation makes sense. https://codereview.chromium.org/2240883002/diff/140001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h File chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h (right): https://codereview.chromium.org/2240883002/diff/140001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h#newcode46 ...
4 years, 3 months ago (2016-09-01 02:49:28 UTC) #41
msramek
Thanks! Happy perfing :) https://codereview.chromium.org/2240883002/diff/140001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h File chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h (right): https://codereview.chromium.org/2240883002/diff/140001/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h#newcode46 chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h:46: class TaskObserver : public BrowsingDataRemover::Observer ...
4 years, 3 months ago (2016-09-01 10:34:37 UTC) #46
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/2240883002/160001
4 years, 3 months ago (2016-09-01 10:35:18 UTC) #49
commit-bot: I haz the power
Committed patchset #3 (id:160001)
4 years, 3 months ago (2016-09-01 10:38:46 UTC) #51
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/a946e92eaa55cb6da801ada49dfdd51d786fa06d Cr-Commit-Position: refs/heads/master@{#415925}
4 years, 3 months ago (2016-09-01 10:40:22 UTC) #53
Dan Beam
4 years, 3 months ago (2016-09-01 15:49:32 UTC) #54
Message was sent while issue was closed.
https://codereview.chromium.org/2240883002/diff/160001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
(right):

https://codereview.chromium.org/2240883002/diff/160001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc:75: }
fwiw: i usually find inline function bodies better to read if the interface and
implementation are in the same file, i.e.

TaskObserver(BrowsingDataRemover* remover, const base::Closure& callback)
    : callback_(callback), remover_observer_(this) {}
~TaskObserver() override {}

void OnBrowsingDataRemoverDone() {
  remover_observer_.RemoveAll();
  callback_.Run();
}

Powered by Google App Engine
This is Rietveld 408576698