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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.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: third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc b/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
index 017787917f4b05f6d10dfe1b1e0f64368e46be76..35373e0f4d60c6e7e0b19b12ea3081e80fb37a2c 100644
--- a/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
@@ -98,21 +98,21 @@ class WebThreadImplForWorkerSchedulerTest : public testing::Test {
}
void RunOnWorkerThread(const tracked_objects::Location& from_here,
- const base::Closure& task) {
+ base::OnceClosure task) {
base::WaitableEvent completion(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
thread_->GetTaskRunner()->PostTask(
from_here,
- base::Bind(&WebThreadImplForWorkerSchedulerTest::RunOnWorkerThreadTask,
- base::Unretained(this), task, &completion));
+ base::BindOnce(&WebThreadImplForWorkerSchedulerTest::RunOnWorkerThreadTask,
+ base::Unretained(this), std::move(task), &completion));
completion.Wait();
}
protected:
- void RunOnWorkerThreadTask(const base::Closure& task,
+ void RunOnWorkerThreadTask(base::OnceClosure task,
base::WaitableEvent* completion) {
- task.Run();
+ std::move(task).Run();
completion->Signal();
}

Powered by Google App Engine
This is Rietveld 408576698