Chromium Code Reviews| 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 #ifndef BASE_THREADING_WORKER_POOL_H_ | 5 #ifndef BASE_THREADING_WORKER_POOL_H_ |
| 6 #define BASE_THREADING_WORKER_POOL_H_ | 6 #define BASE_THREADING_WORKER_POOL_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 static bool PostTaskAndReply(const tracked_objects::Location& from_here, | 41 static bool PostTaskAndReply(const tracked_objects::Location& from_here, |
| 42 OnceClosure task, | 42 OnceClosure task, |
| 43 OnceClosure reply, | 43 OnceClosure reply, |
| 44 bool task_is_slow); | 44 bool task_is_slow); |
| 45 | 45 |
| 46 // Return true if the current thread is one that this WorkerPool runs tasks | 46 // Return true if the current thread is one that this WorkerPool runs tasks |
| 47 // on. (Note that if the Windows worker pool is used without going through | 47 // on. (Note that if the Windows worker pool is used without going through |
| 48 // this WorkerPool interface, RunsTasksOnCurrentThread would return false on | 48 // this WorkerPool interface, RunsTasksOnCurrentThread would return false on |
| 49 // those threads.) | 49 // those threads.) |
| 50 static bool RunsTasksOnCurrentThread(); | 50 static bool RunsTasksOnCurrentThread(); |
| 51 static bool RunsTasksInCurrentSequence(); | |
|
gab
2017/04/18 15:00:33
"sequence" isn't a concept of WorkerPool, leave th
| |
| 51 | 52 |
| 52 // Get a TaskRunner wrapper which posts to the WorkerPool using the given | 53 // Get a TaskRunner wrapper which posts to the WorkerPool using the given |
| 53 // |task_is_slow| behavior. | 54 // |task_is_slow| behavior. |
| 54 static const scoped_refptr<TaskRunner>& GetTaskRunner(bool task_is_slow); | 55 static const scoped_refptr<TaskRunner>& GetTaskRunner(bool task_is_slow); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace base | 58 } // namespace base |
| 58 | 59 |
| 59 #endif // BASE_THREADING_WORKER_POOL_H_ | 60 #endif // BASE_THREADING_WORKER_POOL_H_ |
| OLD | NEW |