1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/chromium/src/base/worker_pool.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,24 @@ 1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef BASE_WORKER_POOL_H_ 1.9 +#define BASE_WORKER_POOL_H_ 1.10 + 1.11 +#include "base/tracked.h" 1.12 + 1.13 +class Task; 1.14 + 1.15 +// This is a facility that runs tasks that don't require a specific thread or 1.16 +// a message loop. 1.17 +class WorkerPool { 1.18 + public: 1.19 + // This function posts |task| to run on a worker thread. |task_is_slow| 1.20 + // should be used for tasks that will take a long time to execute. Returns 1.21 + // false if |task| could not be posted to a worker thread. Regardless of 1.22 + // return value, ownership of |task| is transferred to the worker pool. 1.23 + static bool PostTask(const tracked_objects::Location& from_here, 1.24 + Task* task, bool task_is_slow); 1.25 +}; 1.26 + 1.27 +#endif // BASE_WORKER_POOL_H_