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

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

Issue 2802013002: Move BrowsingDataRemoverImpl:: CompletionInhibitor to the public interface (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dae8f2a50550e79b47e876a2c491c14138561e7a 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.h
+++ b/chrome/browser/browsing_data/browsing_data_remover.h
@@ -127,6 +127,22 @@ class BrowsingDataRemover : public KeyedService {
virtual ~Observer() {}
};
+ // The completion inhibitor can artificially delay completion of the browsing
+ // data removal process. It is used during testing to simulate scenarios in
+ // which the deletion stalls or takes a very long time.
+ class CompletionInhibitor {
+ public:
+ // Invoked when a |remover| is just about to complete clearing browser data,
+ // and will be prevented from completing until after the callback
+ // |continue_to_completion| is run.
+ virtual void OnBrowsingDataRemoverWouldComplete(
Bernhard Bauer 2017/04/06 15:13:07 You could consider replacing this with a Callback.
msramek 2017/04/07 10:58:42 Note that we're in content/public, so everything n
Bernhard Bauer 2017/04/07 15:14:17 No, what I meant was replacing the whole Completio
msramek 2017/04/10 13:20:08 Got it. Done. I changed the naming to WouldComplet
+ BrowsingDataRemover* remover,
+ const base::Closure& continue_to_completion) = 0;
+
+ protected:
+ virtual ~CompletionInhibitor() {}
+ };
+
// Called by the embedder to provide the delegate that will take care of
// deleting embedder-specific data.
virtual void SetEmbedderDelegate(
@@ -179,6 +195,12 @@ class BrowsingDataRemover : public KeyedService {
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
+ // Sets a CompletionInhibitor, which will be notified each time an instance is
+ // about to complete a browsing data removal process, and will be able to
+ // artificially delay the completion.
+ virtual void SetCompletionInhibitorForTesting(
+ CompletionInhibitor* inhibitor) = 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,
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698