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

Side by Side Diff: base/threading/worker_pool_win.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase without dcheck_in_ref_count 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return false; 55 return false;
56 } 56 }
57 57
58 return true; 58 return true;
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 62
63 // static 63 // static
64 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, 64 bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
65 base::Closure task, 65 base::OnceClosure task,
66 bool task_is_slow) { 66 bool task_is_slow) {
67 PendingTask* pending_task = new PendingTask(from_here, std::move(task)); 67 PendingTask* pending_task = new PendingTask(from_here, std::move(task));
68 return PostTaskInternal(pending_task, task_is_slow); 68 return PostTaskInternal(pending_task, task_is_slow);
69 } 69 }
70 70
71 // static 71 // static
72 bool WorkerPool::RunsTasksOnCurrentThread() { 72 bool WorkerPool::RunsTasksOnCurrentThread() {
73 return GetWorkerPoolRunningOnThisThread()->Get(); 73 return GetWorkerPoolRunningOnThisThread()->Get();
74 } 74 }
75 75
76 } // namespace base 76 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698