michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_WORKER_POOL_H_ michael@0: #define BASE_WORKER_POOL_H_ michael@0: michael@0: #include "base/tracked.h" michael@0: michael@0: class Task; michael@0: michael@0: // This is a facility that runs tasks that don't require a specific thread or michael@0: // a message loop. michael@0: class WorkerPool { michael@0: public: michael@0: // This function posts |task| to run on a worker thread. |task_is_slow| michael@0: // should be used for tasks that will take a long time to execute. Returns michael@0: // false if |task| could not be posted to a worker thread. Regardless of michael@0: // return value, ownership of |task| is transferred to the worker pool. michael@0: static bool PostTask(const tracked_objects::Location& from_here, michael@0: Task* task, bool task_is_slow); michael@0: }; michael@0: michael@0: #endif // BASE_WORKER_POOL_H_