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

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

Issue 2867033002: Fix BrowsingDataCounter race condition (Closed)
Patch Set: Created 3 years, 7 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/media_licenses_counter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/cache_counter.cc
diff --git a/chrome/browser/browsing_data/cache_counter.cc b/chrome/browser/browsing_data/cache_counter.cc
index 557be8a39e14d9b52d2036af2657d79b13c30017..d131033608d252204bd70105a4bd5a213afe24b4 100644
--- a/chrome/browser/browsing_data/cache_counter.cc
+++ b/chrome/browser/browsing_data/cache_counter.cc
@@ -32,6 +32,8 @@ const char* CacheCounter::GetPrefName() const {
}
void CacheCounter::Count() {
+ // Cancel existing requests.
+ weak_ptr_factory_.InvalidateWeakPtrs();
base::WeakPtr<browsing_data::ConditionalCacheCountingHelper> counter =
browsing_data::ConditionalCacheCountingHelper::CreateForRange(
content::BrowserContext::GetDefaultStoragePartition(profile_),
« no previous file with comments | « no previous file | chrome/browser/browsing_data/media_licenses_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698