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

Unified Diff: chrome/browser/browsing_data/media_licenses_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 | « chrome/browser/browsing_data/cache_counter.cc ('k') | chrome/browser/browsing_data/site_data_counter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/media_licenses_counter.cc
diff --git a/chrome/browser/browsing_data/media_licenses_counter.cc b/chrome/browser/browsing_data/media_licenses_counter.cc
index cd248ad469080e31a3c42b0f9523450bf1940a16..9f19f2766781f4c337a62bb85e98ff83e664e308 100644
--- a/chrome/browser/browsing_data/media_licenses_counter.cc
+++ b/chrome/browser/browsing_data/media_licenses_counter.cc
@@ -63,6 +63,8 @@ const char* MediaLicensesCounter::GetPrefName() const {
void MediaLicensesCounter::Count() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // Cancel existing requests.
+ weak_ptr_factory_.InvalidateWeakPtrs();
scoped_refptr<storage::FileSystemContext> filesystem_context =
make_scoped_refptr(
content::BrowserContext::GetDefaultStoragePartition(profile_)
« no previous file with comments | « chrome/browser/browsing_data/cache_counter.cc ('k') | chrome/browser/browsing_data/site_data_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698