Chromium Code Reviews| Index: base/threading/worker_pool.h |
| diff --git a/base/threading/worker_pool.h b/base/threading/worker_pool.h |
| index 6694830e7d7a560612bf48b5b6ed279737fa3964..02c5c99944f117eb62e0bd92b6c3b9ed617a762d 100644 |
| --- a/base/threading/worker_pool.h |
| +++ b/base/threading/worker_pool.h |
| @@ -8,6 +8,7 @@ |
| #include "base/base_export.h" |
| #include "base/callback_forward.h" |
| +#include "base/memory/ref_counted.h" |
| class Task; |
| @@ -17,6 +18,8 @@ class Location; |
| namespace base { |
| +class TaskRunner; |
| + |
| // This is a facility that runs tasks that don't require a specific thread or |
| // a message loop. |
| // |
| @@ -41,6 +44,16 @@ class BASE_EXPORT WorkerPool { |
| const Closure& task, |
| const Closure& reply, |
| bool task_is_slow); |
| + |
| + // Return true if the current thread is one that this WorkerPool runs tasks |
| + // on. (Note that if the Windows worker pool is used without going through |
| + // this WorkerPool interface, RunsTasksOnCurrentThread would return false on |
| + // those threads.) |
| + static bool RunsTasksOnCurrentThread(); |
| + |
| + // Get a TaskRunner wrapper which posts to the WorkerPool using the given |
| + // |task_is_slow| behavior. |
| + static scoped_refptr<TaskRunner> GetTaskRunner(bool task_is_slow); |
|
willchan no longer on Chromium
2012/04/24 23:41:50
How about you also store a leaky LazyInstance for
mattm
2012/04/25 00:57:35
Done. Had to make a holder class to initialize th
|
| }; |
| } // namespace base |