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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover_impl.cc

Issue 2802013002: Move BrowsingDataRemoverImpl:: CompletionInhibitor to the public interface (Closed)
Patch Set: Finishing after shutdown is still OK. 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.cc
diff --git a/chrome/browser/browsing_data/browsing_data_remover_impl.cc b/chrome/browser/browsing_data/browsing_data_remover_impl.cc
index 68de911c55f96e185d6238384b436518978b2b49..88603ec631dad33c0b8972df2c8e11d6f4f0f738 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_impl.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover_impl.cc
@@ -151,9 +151,6 @@ void ClearChannelIDsOnIOThread(
} // namespace
-BrowsingDataRemoverImpl::CompletionInhibitor*
- BrowsingDataRemoverImpl::completion_inhibitor_ = nullptr;
-
BrowsingDataRemoverImpl::SubTask::SubTask(const base::Closure& forward_callback)
: is_pending_(false),
forward_callback_(forward_callback),
@@ -196,6 +193,7 @@ BrowsingDataRemoverImpl::BrowsingDataRemoverImpl(
clear_channel_ids_(sub_task_forward_callback_),
clear_http_auth_cache_(sub_task_forward_callback_),
clear_storage_partition_data_(sub_task_forward_callback_),
+ storage_partition_for_testing_(nullptr),
weak_ptr_factory_(this) {
DCHECK(browser_context_);
}
@@ -577,6 +575,12 @@ void BrowsingDataRemoverImpl::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
+void BrowsingDataRemoverImpl::SetWouldCompleteCallbackForTesting(
+ const base::Callback<void(const base::Closure& continue_to_completion)>&
+ callback) {
+ would_complete_callback_ = callback;
+}
+
void BrowsingDataRemoverImpl::OverrideStoragePartitionForTesting(
content::StoragePartition* storage_partition) {
storage_partition_for_testing_ = storage_partition;
@@ -667,9 +671,9 @@ void BrowsingDataRemoverImpl::NotifyIfDone() {
if (!AllDone())
return;
- if (completion_inhibitor_) {
- completion_inhibitor_->OnBrowsingDataRemoverWouldComplete(
- this, base::Bind(&BrowsingDataRemoverImpl::Notify, GetWeakPtr()));
+ if (!would_complete_callback_.is_null()) {
+ would_complete_callback_.Run(
+ base::Bind(&BrowsingDataRemoverImpl::Notify, GetWeakPtr()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698