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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover.h

Issue 2802013002: Move BrowsingDataRemoverImpl:: CompletionInhibitor to the public interface (Closed)
Patch Set: Simplified ProfileManagerBrowsertest Created 3 years, 8 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/browsing_data_remover.h
diff --git a/chrome/browser/browsing_data/browsing_data_remover.h b/chrome/browser/browsing_data/browsing_data_remover.h
index 4edae603f8cec0bf941a4b7d46dc32c73dbfe4fd..9732a120e5c23d9cd8fe90ad9a09c4a3b32f1254 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.h
+++ b/chrome/browser/browsing_data/browsing_data_remover.h
@@ -7,6 +7,7 @@
#include <memory>
#include "base/callback_forward.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/browsing_data/browsing_data_remover_delegate.h"
@@ -179,6 +180,14 @@ class BrowsingDataRemover : public KeyedService {
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
+ // A |callback| that will be called just before a deletion task is completed
+ // and observers are notified. The receiver must respond by calling
+ // |continue_to_completion| to finish the task. Used in tests to artificially
+ // prolong execution.
+ virtual void SetWouldCompleteCallbackForTesting(
+ const base::Callback<void(const base::Closure& continue_to_completion)>&
+ callback) = 0;
+
// Parameters of the last call are exposed to be used by tests. Removal and
// origin type masks equal to -1 mean that no removal has ever been executed.
// TODO(msramek): If other consumers than tests are interested in this,
@@ -189,6 +198,9 @@ class BrowsingDataRemover : public KeyedService {
virtual const base::Time& GetLastUsedEndTime() = 0;
virtual int GetLastUsedRemovalMask() = 0;
virtual int GetLastUsedOriginTypeMask() = 0;
+
+ // Retrieve a UI thread-bound weak pointer to this BrowsingDataRemover.
+ virtual base::WeakPtr<BrowsingDataRemover> GetWeakPtr() = 0;
};
#endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_

Powered by Google App Engine
This is Rietveld 408576698