summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_remover.h
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 11:46:17 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 11:46:17 +0000
commitdcdf7a71cba6ca313883c3f456e75c3b6d07259e (patch)
treeef18f899a0693d65d07ded449f0ce6df2dd44f8a /chrome/browser/browsing_data_remover.h
parent5697008597268b18c221e6f25eb234d90fac8b95 (diff)
downloadchromium_src-dcdf7a71cba6ca313883c3f456e75c3b6d07259e.zip
chromium_src-dcdf7a71cba6ca313883c3f456e75c3b6d07259e.tar.gz
chromium_src-dcdf7a71cba6ca313883c3f456e75c3b6d07259e.tar.bz2
Fix a race in BrowsingDataRemover.
We were accesing a flag from multiple threads, which cloud lead to BrowsingDataRemover::NotifyAndDeleteIfDone() to be called multiple times, which in turn would cause a DCHECK(). BUG=None TEST=No DCHECK on cancelling enterprise enrollment on CrOS. Review URL: http://codereview.chromium.org/7834023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_remover.h')
-rw-r--r--chrome/browser/browsing_data_remover.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h
index 115c0d5..48c99da 100644
--- a/chrome/browser/browsing_data_remover.h
+++ b/chrome/browser/browsing_data_remover.h
@@ -164,9 +164,13 @@ class BrowsingDataRemover : public NotificationObserver,
// Called to check whether all temporary and persistent origin data that
// should be deleted has been deleted. If everything's good to go, invokes
- // NotifyAndDeleteIfDone on the UI thread.
+ // OnQuotaManagedDataDeleted on the UI thread.
void CheckQuotaManagedDataDeletionStatus();
+ // Completion handler that runs on the UI thread once persistent data has been
+ // deleted. Updates the waiting flag and invokes NotifyAndDeleteIfDone.
+ void OnQuotaManagedDataDeleted();
+
// Callback when Cookies has been deleted. Invokes NotifyAndDeleteIfDone.
void OnClearedCookies(int num_deleted);
@@ -225,6 +229,7 @@ class BrowsingDataRemover : public NotificationObserver,
base::WaitableEventWatcher watcher_;
// True if we're waiting for various data to be deleted.
+ // These may only be accessed from UI thread in order to avoid races!
bool waiting_for_clear_history_;
bool waiting_for_clear_quota_managed_data_;
bool waiting_for_clear_networking_history_;