| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // should be used for tasks that will take a long time to execute. Returns | 31 // should be used for tasks that will take a long time to execute. Returns |
| 32 // false if |task| could not be posted to a worker thread. Regardless of | 32 // false if |task| could not be posted to a worker thread. Regardless of |
| 33 // return value, ownership of |task| is transferred to the worker pool. | 33 // return value, ownership of |task| is transferred to the worker pool. |
| 34 // | 34 // |
| 35 // TODO(ajwong): Remove the Task* based overload once we've finishsed the | 35 // TODO(ajwong): Remove the Task* based overload once we've finishsed the |
| 36 // Task -> Closure migration. | 36 // Task -> Closure migration. |
| 37 static bool PostTask(const tracked_objects::Location& from_here, | 37 static bool PostTask(const tracked_objects::Location& from_here, |
| 38 Task* task, bool task_is_slow); | 38 Task* task, bool task_is_slow); |
| 39 static bool PostTask(const tracked_objects::Location& from_here, | 39 static bool PostTask(const tracked_objects::Location& from_here, |
| 40 const base::Closure& task, bool task_is_slow); | 40 const base::Closure& task, bool task_is_slow); |
| 41 |
| 42 // Just like MessageLoopProxy::PostTaskAndReply, except the destination |
| 43 // for |task| is a worker thread and you can specify |task_is_slow| just |
| 44 // like you can for PostTask above. |
| 45 static bool PostTaskAndReply(const tracked_objects::Location& from_here, |
| 46 const Closure& task, |
| 47 const Closure& reply, |
| 48 bool task_is_slow); |
| 41 }; | 49 }; |
| 42 | 50 |
| 43 } // namespace base | 51 } // namespace base |
| 44 | 52 |
| 45 #endif // BASE_THREADING_WORKER_POOL_H_ | 53 #endif // BASE_THREADING_WORKER_POOL_H_ |
| OLD | NEW |