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

Unified Diff: content/browser/cache_storage/cache_storage_cache.cc

Issue 2040173002: [CacheStorage] Clean up CacheStorageCache lifetimes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify and caught one more reference Created 4 years, 6 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: content/browser/cache_storage/cache_storage_cache.cc
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index 43fd58e77d5d347e51bb424f2146c32162f9d4dd..78d930f9e305372bbaa2dcf6565e846599a93ace 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -381,12 +381,12 @@ void CacheStorageCache::BatchOperation(
std::unique_ptr<ErrorCallback> callback_copy(new ErrorCallback(callback));
ErrorCallback* callback_ptr = callback_copy.get();
base::Closure barrier_closure = base::BarrierClosure(
- operations.size(),
- base::Bind(&CacheStorageCache::BatchDidAllOperations, this,
- base::Passed(std::move(callback_copy))));
+ operations.size(), base::Bind(&CacheStorageCache::BatchDidAllOperations,
+ weak_ptr_factory_.GetWeakPtr(),
+ base::Passed(std::move(callback_copy))));
ErrorCallback completion_callback =
- base::Bind(&CacheStorageCache::BatchDidOneOperation, this,
- barrier_closure, callback_ptr);
+ base::Bind(&CacheStorageCache::BatchDidOneOperation,
+ weak_ptr_factory_.GetWeakPtr(), barrier_closure, callback_ptr);
for (const auto& operation : operations) {
switch (operation.operation_type) {
« no previous file with comments | « content/browser/cache_storage/cache_storage.cc ('k') | content/browser/cache_storage/cache_storage_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698