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

Unified Diff: chrome/browser/browsing_data_remover.h

Issue 6308001: When clearing plugin data at shutdown, wait for it to finish. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary stuff Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data_remover.h
diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h
index 9a8addbc0989ece5a911aaa48a5eb90ea8b3dcc7..b5aa6e8ac8b91ee263bf7a83294d5014697e6477 100644
--- a/chrome/browser/browsing_data_remover.h
+++ b/chrome/browser/browsing_data_remover.h
@@ -10,6 +10,7 @@
#include "base/observer_list.h"
#include "base/ref_counted.h"
+#include "base/synchronization/waitable_event_watcher.h"
#include "base/time.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/cancelable_request.h"
@@ -30,7 +31,8 @@ class DatabaseTracker;
// BrowsingDataRemover is responsible for removing data related to browsing:
// visits in url database, downloads, cookies ...
-class BrowsingDataRemover : public NotificationObserver {
+class BrowsingDataRemover : public NotificationObserver,
+ public base::WaitableEventWatcher::Delegate {
public:
// Time period ranges available when doing browsing data removals.
enum TimePeriod {
@@ -106,6 +108,10 @@ class BrowsingDataRemover : public NotificationObserver {
const NotificationSource& source,
const NotificationDetails& details);
+ // WaitableEventWatcher implementation.
+ // Called when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone.
+ virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event);
+
// If we're not waiting on anything, notifies observers and deletes this
// object.
void NotifyAndDeleteIfDone();
@@ -142,9 +148,6 @@ class BrowsingDataRemover : public NotificationObserver {
void OnAppCacheDeleted(int rv);
ChromeAppCacheService* GetAppCacheService();
- // Callback when plug-in data has been cleared. Invokes NotifyAndDeleteIfDone.
- void OnClearedPluginData();
-
// Calculate the begin time for the deletion range specified by |time_period|.
base::Time CalculateBeginDeleteTime(TimePeriod time_period);
@@ -191,6 +194,7 @@ class BrowsingDataRemover : public NotificationObserver {
// Used to delete plugin data.
scoped_refptr<PluginDataRemover> plugin_data_remover_;
+ base::WaitableEventWatcher watcher_;
// True if we're waiting for various data to be deleted.
bool waiting_for_clear_databases_;

Powered by Google App Engine
This is Rietveld 408576698