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

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

Issue 2947753002: CacheStorage: Migrate to BindOnce/OnceCallback/OnceClosure (Closed)
Patch Set: Untangle Batch logic (relies on AdaptCallbackForRepeating) Created 3 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_operation.cc
diff --git a/content/browser/cache_storage/cache_storage_operation.cc b/content/browser/cache_storage/cache_storage_operation.cc
index 4444483eb1ef2b7138d768a78defb3e41a0ad679..89502144f0b5f3c071b6772e20ab5c3b9dbda0f1 100644
--- a/content/browser/cache_storage/cache_storage_operation.cc
+++ b/content/browser/cache_storage/cache_storage_operation.cc
@@ -13,10 +13,10 @@ const int kNumSecondsForSlowOperation = 10;
}
CacheStorageOperation::CacheStorageOperation(
- const base::Closure& closure,
+ base::OnceClosure closure,
CacheStorageSchedulerClient client_type,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
- : closure_(closure),
+ : closure_(std::move(closure)),
creation_ticks_(base::TimeTicks::Now()),
client_type_(client_type),
task_runner_(std::move(task_runner)),
@@ -35,10 +35,11 @@ void CacheStorageOperation::Run() {
start_ticks_ = base::TimeTicks::Now();
task_runner_->PostDelayedTask(
- FROM_HERE, base::Bind(&CacheStorageOperation::NotifyOperationSlow,
- weak_ptr_factory_.GetWeakPtr()),
+ FROM_HERE,
+ base::BindOnce(&CacheStorageOperation::NotifyOperationSlow,
+ weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kNumSecondsForSlowOperation));
- closure_.Run();
+ std::move(closure_).Run();
}
void CacheStorageOperation::NotifyOperationSlow() {

Powered by Google App Engine
This is Rietveld 408576698