summaryrefslogtreecommitdiffstats
path: root/base/worker_pool.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:38:38 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:38:38 +0000
commit43a973aeb04b5d0ac64bb730cadf0737de8b0cd9 (patch)
treeb1e1a322efd6c17a0446169da51ec376c6ab9a65 /base/worker_pool.h
parentb124be829f4d6907c17238ab1c84eed5acc817eb (diff)
downloadchromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.zip
chromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.tar.gz
chromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.tar.bz2
Do not use RecycleOrDelete since it is not ready for prime-time.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/worker_pool.h')
-rw-r--r--base/worker_pool.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/base/worker_pool.h b/base/worker_pool.h
index 3b0039f..486bf9a 100644
--- a/base/worker_pool.h
+++ b/base/worker_pool.h
@@ -30,21 +30,20 @@
#ifndef BASE_WORKER_POOL_H_
#define BASE_WORKER_POOL_H_
-#include "base/task.h"
+#include "base/tracked.h"
+
+class Task;
// This is a facility that runs tasks that don't require a specific thread or
// a message loop.
class WorkerPool {
public:
- // This function posts |task| to run on a worker thread. |slow| should be used
- // for tasks that will take a long time to execute. |task| will be recycled
- // even if the function fails.
- static bool Run(Task* task, bool slow);
-
- // Recycles the task.
- static void RecycleTask(Task* task) {
- task->RecycleOrDelete();
- }
+ // This function posts |task| to run on a worker thread. |task_is_slow|
+ // should be used for tasks that will take a long time to execute. Returns
+ // false if |task| could not be posted to a worker thread. Regardless of
+ // return value, ownership of |task| is transferred to the worker pool.
+ static bool PostTask(const tracked_objects::Location& from_here,
+ Task* task, bool task_is_slow);
};
#endif // BASE_WORKER_POOL_H_