OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return false; | 57 return false; |
58 } | 58 } |
59 | 59 |
60 return true; | 60 return true; |
61 } | 61 } |
62 | 62 |
63 } // namespace | 63 } // namespace |
64 | 64 |
65 // static | 65 // static |
66 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, | 66 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, |
67 base::Closure task, | 67 base::OnceClosure task, |
68 bool task_is_slow) { | 68 bool task_is_slow) { |
69 PendingTask* pending_task = new PendingTask(from_here, std::move(task)); | 69 PendingTask* pending_task = new PendingTask(from_here, std::move(task)); |
70 return PostTaskInternal(pending_task, task_is_slow); | 70 return PostTaskInternal(pending_task, task_is_slow); |
71 } | 71 } |
72 | 72 |
73 // static | 73 // static |
74 bool WorkerPool::RunsTasksOnCurrentThread() { | 74 bool WorkerPool::RunsTasksOnCurrentThread() { |
75 return GetWorkerPoolRunningOnThisThread()->Get(); | 75 return GetWorkerPoolRunningOnThisThread()->Get(); |
76 } | 76 } |
77 | 77 |
78 } // namespace base | 78 } // namespace base |
OLD | NEW |