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

Unified Diff: content/browser/dom_storage/dom_storage_task_runner.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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/dom_storage/dom_storage_task_runner.cc
diff --git a/content/browser/dom_storage/dom_storage_task_runner.cc b/content/browser/dom_storage/dom_storage_task_runner.cc
index ba2842802d4318a6f5a4d4099d756c3d7b41a1bc..9f73fc1e0f13088a3a2d294f0366e8e991446551 100644
--- a/content/browser/dom_storage/dom_storage_task_runner.cc
+++ b/content/browser/dom_storage/dom_storage_task_runner.cc
@@ -35,30 +35,31 @@ DOMStorageWorkerPoolTaskRunner::~DOMStorageWorkerPoolTaskRunner() {
bool DOMStorageWorkerPoolTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeDelta delay) {
// Note base::TaskRunner implements PostTask in terms of PostDelayedTask
// with a delay of zero, we detect that usage and avoid the unecessary
// trip thru the message loop.
if (delay.is_zero()) {
return sequenced_worker_pool_->PostSequencedWorkerTaskWithShutdownBehavior(
- primary_sequence_token_, from_here, task,
+ primary_sequence_token_, from_here, std::move(task),
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
}
// Post a task to call this->PostTask() after the delay.
return task_runner_->PostDelayedTask(
FROM_HERE,
- base::Bind(base::IgnoreResult(&DOMStorageWorkerPoolTaskRunner::PostTask),
- this, from_here, task),
+ base::BindOnce(
+ base::IgnoreResult(&DOMStorageWorkerPoolTaskRunner::PostTask), this,
+ from_here, std::move(task)),
delay);
}
bool DOMStorageWorkerPoolTaskRunner::PostShutdownBlockingTask(
const tracked_objects::Location& from_here,
SequenceID sequence_id,
- const base::Closure& task) {
+ base::OnceClosure task) {
return sequenced_worker_pool_->PostSequencedWorkerTaskWithShutdownBehavior(
- IDtoToken(sequence_id), from_here, task,
+ IDtoToken(sequence_id), from_here, std::move(task),
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
}
@@ -93,16 +94,16 @@ MockDOMStorageTaskRunner::~MockDOMStorageTaskRunner() {
bool MockDOMStorageTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeDelta delay) {
- return task_runner_->PostTask(from_here, task);
+ return task_runner_->PostTask(from_here, std::move(task));
}
bool MockDOMStorageTaskRunner::PostShutdownBlockingTask(
const tracked_objects::Location& from_here,
SequenceID sequence_id,
- const base::Closure& task) {
- return task_runner_->PostTask(from_here, task);
+ base::OnceClosure task) {
+ return task_runner_->PostTask(from_here, std::move(task));
}
bool MockDOMStorageTaskRunner::IsRunningOnSequence(SequenceID) const {
« no previous file with comments | « content/browser/dom_storage/dom_storage_task_runner.h ('k') | content/browser/startup_task_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698