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

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

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: erase Closure* Created 3 years, 9 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 21eb54dfc9f379c401b85ca2bd558e21f1e59f16..f4e18f0fb211ac945b1cfbe1e463cc8bceac0ccd 100644
--- a/content/browser/dom_storage/dom_storage_task_runner.cc
+++ b/content/browser/dom_storage/dom_storage_task_runner.cc
@@ -31,16 +31,17 @@ bool DOMStorageWorkerPoolTaskRunner::RunsTasksOnCurrentThread() const {
bool DOMStorageWorkerPoolTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay) {
- return primary_sequence_->PostDelayedTask(from_here, task, delay);
+ return primary_sequence_->PostDelayedTask(from_here, std::move(task), delay);
}
bool DOMStorageWorkerPoolTaskRunner::PostShutdownBlockingTask(
const tracked_objects::Location& from_here,
SequenceID sequence_id,
- const base::Closure& task) {
- return GetSequencedTaskRunner(sequence_id)->PostTask(from_here, task);
+ base::Closure task) {
+ return GetSequencedTaskRunner(sequence_id)
+ ->PostTask(from_here, std::move(task));
}
void DOMStorageWorkerPoolTaskRunner::AssertIsRunningOnPrimarySequence() const {
@@ -73,16 +74,16 @@ bool MockDOMStorageTaskRunner::RunsTasksOnCurrentThread() const {
bool MockDOMStorageTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure 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::Closure task) {
+ return task_runner_->PostTask(from_here, std::move(task));
}
void MockDOMStorageTaskRunner::AssertIsRunningOnPrimarySequence() 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