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

Unified Diff: remoting/client/plugin/pepper_main_thread_task_runner.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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: remoting/client/plugin/pepper_main_thread_task_runner.cc
diff --git a/remoting/client/plugin/pepper_main_thread_task_runner.cc b/remoting/client/plugin/pepper_main_thread_task_runner.cc
index 8f3ca2430a68011378d09f282d100fea5bd8191c..c3505664a2b44f449e21854665e5c098a54eabf1 100644
--- a/remoting/client/plugin/pepper_main_thread_task_runner.cc
+++ b/remoting/client/plugin/pepper_main_thread_task_runner.cc
@@ -17,8 +17,9 @@ namespace remoting {
namespace {
void RunAndDestroy(void* task_ptr, int32_t) {
- std::unique_ptr<base::Closure> task(static_cast<base::Closure*>(task_ptr));
- task->Run();
+ std::unique_ptr<base::OnceClosure> task(
+ static_cast<base::OnceClosure*>(task_ptr));
+ std::move(*task).Run();
}
} // namespace
@@ -31,9 +32,9 @@ PepperMainThreadTaskRunner::PepperMainThreadTaskRunner()
bool PepperMainThreadTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- base::Closure task,
+ base::OnceClosure task,
base::TimeDelta delay) {
- auto task_ptr = base::MakeUnique<base::Closure>(base::Bind(
+ auto task_ptr = base::MakeUnique<base::OnceClosure>(base::Bind(
&PepperMainThreadTaskRunner::RunTask, weak_ptr_, base::Passed(&task)));
core_->CallOnMainThread(
delay.InMillisecondsRoundedUp(),
@@ -43,7 +44,7 @@ bool PepperMainThreadTaskRunner::PostDelayedTask(
bool PepperMainThreadTaskRunner::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
- base::Closure task,
+ base::OnceClosure task,
base::TimeDelta delay) {
return PostDelayedTask(from_here, std::move(task), delay);
}
@@ -54,7 +55,7 @@ bool PepperMainThreadTaskRunner::RunsTasksOnCurrentThread() const {
PepperMainThreadTaskRunner::~PepperMainThreadTaskRunner() {}
-void PepperMainThreadTaskRunner::RunTask(base::Closure task) {
+void PepperMainThreadTaskRunner::RunTask(base::OnceClosure task) {
std::move(task).Run();
}
« no previous file with comments | « remoting/client/plugin/pepper_main_thread_task_runner.h ('k') | third_party/WebKit/Source/platform/WebTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698