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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.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: third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc b/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
index e2dc0e49675a2b27f22bcc04b0c84cbc50f981d8..f3402943275de66e139c438966fc8bdb80a33c36 100644
--- a/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
@@ -4,6 +4,8 @@
#include "platform/scheduler/child/web_task_runner_impl.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
@@ -20,11 +22,11 @@ RefPtr<WebTaskRunnerImpl> WebTaskRunnerImpl::create(
}
void WebTaskRunnerImpl::postDelayedTask(const WebTraceLocation& location,
- const base::Closure& task,
+ base::Closure task,
double delayMs) {
DCHECK_GE(delayMs, 0.0) << location.function_name() << " "
<< location.file_name();
- task_queue_->PostDelayedTask(location, task,
+ task_queue_->PostDelayedTask(location, std::move(task),
base::TimeDelta::FromMillisecondsD(delayMs));
}

Powered by Google App Engine
This is Rietveld 408576698