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

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

Issue 2173443002: Fix a race condition in BrowsingDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover.cc
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc
index fc9f4b956eb593b925f4f181600d681cb7224020..9892d9ccd4b5004eba4a1def0dd4661e8ef21785 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -380,6 +380,7 @@ void BrowsingDataRemover::RemoveImpl(
const BrowsingDataFilterBuilder& filter_builder,
int origin_type_mask) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ waiting_for_synchronous_clear_operations_ = true;
// crbug.com/140910: Many places were calling this with base::Time() as
// delete_end, even though they should've used base::Time::Max().
@@ -1039,6 +1040,7 @@ void BrowsingDataRemover::RemoveImpl(
}
// Notify in case all actions taken were synchronous.
+ waiting_for_synchronous_clear_operations_ = false;
NotifyIfDone();
UMA_HISTOGRAM_ENUMERATION(
@@ -1085,7 +1087,8 @@ void BrowsingDataRemover::ClearSettingsForOneTypeWithPredicate(
}
bool BrowsingDataRemover::AllDone() {
- return !waiting_for_clear_autofill_origin_urls_ &&
+ return !waiting_for_synchronous_clear_operations_ &&
+ !waiting_for_clear_autofill_origin_urls_ &&
!waiting_for_clear_cache_ &&
!waiting_for_clear_flash_content_licenses_ &&
!waiting_for_clear_channel_ids_ && !waiting_for_clear_cookies_count_ &&
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698