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

Unified Diff: content/child/worker_thread_registry.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase without dcheck_in_ref_count 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/child/worker_thread_registry.cc
diff --git a/content/child/worker_thread_registry.cc b/content/child/worker_thread_registry.cc
index 26d7b18b32032fb52eb89c2fcc55fa3f866f7bb0..db35d220f87557fdf30e77182083c08db0420e4d 100644
--- a/content/child/worker_thread_registry.cc
+++ b/content/child/worker_thread_registry.cc
@@ -38,7 +38,7 @@ class DoNothingTaskRunner : public base::TaskRunner {
~DoNothingTaskRunner() override {}
bool PostDelayedTask(const tracked_objects::Location& from_here,
- base::Closure task,
+ base::OnceClosure task,
base::TimeDelta delay) override {
return false;
}
@@ -56,7 +56,7 @@ int WorkerThread::GetCurrentId() {
return base::PlatformThread::CurrentId();
}
-void WorkerThread::PostTask(int id, base::Closure task) {
+void WorkerThread::PostTask(int id, base::OnceClosure task) {
WorkerThreadRegistry::Instance()->PostTask(id, std::move(task));
}
@@ -79,7 +79,7 @@ void WorkerThread::RemoveObserver(Observer* observer) {
WorkerThreadRegistry::WorkerThreadRegistry()
: task_runner_for_dead_worker_(new DoNothingTaskRunner()) {}
-int WorkerThreadRegistry::PostTaskToAllThreads(base::Closure closure) {
+int WorkerThreadRegistry::PostTaskToAllThreads(base::OnceClosure closure) {
base::AutoLock locker(task_runner_map_lock_);
for (const auto& it : task_runner_map_)
it.second->PostTask(FROM_HERE, std::move(closure));
@@ -125,7 +125,7 @@ base::TaskRunner* WorkerThreadRegistry::GetTaskRunnerFor(int worker_id) {
: task_runner_for_dead_worker_.get();
}
-bool WorkerThreadRegistry::PostTask(int id, base::Closure closure) {
+bool WorkerThreadRegistry::PostTask(int id, base::OnceClosure closure) {
DCHECK(id > 0);
base::AutoLock locker(task_runner_map_lock_);
IDToTaskRunnerMap::iterator found = task_runner_map_.find(id);

Powered by Google App Engine
This is Rietveld 408576698