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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover_impl.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
Index: chrome/browser/browsing_data/browsing_data_remover_impl.h
diff --git a/chrome/browser/browsing_data/browsing_data_remover_impl.h b/chrome/browser/browsing_data/browsing_data_remover_impl.h
index 9889aea080b5a32f73939cc5e63899e996fa35eb..c283f43f77647642994e43f8258be89d06295026 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_impl.h
+++ b/chrome/browser/browsing_data/browsing_data_remover_impl.h
@@ -33,22 +33,6 @@ class StoragePartition;
class BrowsingDataRemoverImpl : public BrowsingDataRemover {
public:
- // 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(
- BrowsingDataRemoverImpl* remover,
- const base::Closure& continue_to_completion) = 0;
-
- protected:
- virtual ~CompletionInhibitor() {}
- };
-
// Used to track the deletion of a single data storage backend.
class SubTask {
public:
@@ -78,15 +62,6 @@ class BrowsingDataRemoverImpl : public BrowsingDataRemover {
// Is the BrowsingDataRemoverImpl currently in the process of removing data?
bool is_removing() { return is_removing_; }
- // 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.
- // TODO(crbug.com/483528): Make this non-static.
- static void set_completion_inhibitor_for_testing(
- CompletionInhibitor* inhibitor) {
- completion_inhibitor_ = inhibitor;
- }
-
// BrowsingDataRemover implementation:
void SetEmbedderDelegate(
std::unique_ptr<BrowsingDataRemoverDelegate> embedder_delegate) override;
@@ -122,6 +97,9 @@ class BrowsingDataRemoverImpl : public BrowsingDataRemover {
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
+ void SetCompletionInhibitorForTesting(
+ CompletionInhibitor* inhibitor) override;
+
const base::Time& GetLastUsedBeginTime() override;
const base::Time& GetLastUsedEndTime() override;
int GetLastUsedRemovalMask() override;
@@ -232,7 +210,7 @@ class BrowsingDataRemoverImpl : public BrowsingDataRemover {
// If non-NULL, the |completion_inhibitor_| is notified each time an instance
// is about to complete a browsing data removal process, and has the ability
// to artificially delay completion. Used for testing.
- static CompletionInhibitor* completion_inhibitor_;
+ CompletionInhibitor* completion_inhibitor_;
// A callback to NotifyIfDone() used by SubTasks instances.
const base::Closure sub_task_forward_callback_;
@@ -250,7 +228,7 @@ class BrowsingDataRemoverImpl : public BrowsingDataRemover {
base::ObserverList<Observer, true> observer_list_;
// We do not own this.
- content::StoragePartition* storage_partition_for_testing_ = nullptr;
+ content::StoragePartition* storage_partition_for_testing_;
base::WeakPtrFactory<BrowsingDataRemoverImpl> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698