diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 02:18:18 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 02:18:18 +0000 |
commit | e7b3a61984f86ccb238664542699c3b8a75b54c6 (patch) | |
tree | a75e7830c5fa93c5af7bcebf0c60485513ce6a1e /base/task.h | |
parent | 9c66adca4f62f3b85593068aea30cf1568690987 (diff) | |
download | chromium_src-e7b3a61984f86ccb238664542699c3b8a75b54c6.zip chromium_src-e7b3a61984f86ccb238664542699c3b8a75b54c6.tar.gz chromium_src-e7b3a61984f86ccb238664542699c3b8a75b54c6.tar.bz2 |
base::Bind: Remove Task.
BUG=none
TEST=none
R=awong
Review URL: http://codereview.chromium.org/9086002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/task.h')
-rw-r--r-- | base/task.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/base/task.h b/base/task.h index a310e0d..dbef70b 100644 --- a/base/task.h +++ b/base/task.h @@ -42,20 +42,6 @@ namespace base { const size_t kDeadTask = 0xDEAD7A53; } -// Task ------------------------------------------------------------------------ -// -// A task is a generic runnable thingy, usually used for running code on a -// different thread or for scheduling future tasks off of the message loop. - -class BASE_EXPORT Task { - public: - Task(); - virtual ~Task(); - - // Tasks are automatically deleted after Run is called. - virtual void Run() = 0; -}; - template<typename T> void DeletePointer(T* obj) { delete obj; @@ -78,44 +64,6 @@ class BASE_EXPORT ScopedClosureRunner { DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedClosureRunner); }; -namespace subtle { - -// This class is meant for use in the implementation of MessageLoop classes -// such as MessageLoop, MessageLoopProxy, BrowserThread, and WorkerPool to -// implement the compatibility APIs while we are transitioning from Task to -// Callback. -// -// It should NOT be used anywhere else! -// -// In particular, notice that this is RefCounted instead of -// RefCountedThreadSafe. We rely on the fact that users of this class are -// careful to ensure that a lock is taken during transfer of ownership for -// objects from this class to ensure the refcount is not corrupted. -class TaskClosureAdapter : public RefCounted<TaskClosureAdapter> { - public: - explicit TaskClosureAdapter(Task* task); - - // |should_leak_task| points to a flag variable that can be used to determine - // if this class should leak the Task on destruction. This is important - // at MessageLoop shutdown since not all tasks can be safely deleted without - // running. See MessageLoop::DeletePendingTasks() for the exact behavior - // of when a Task should be deleted. It is subtle. - TaskClosureAdapter(Task* task, bool* should_leak_task); - - void Run(); - - private: - friend class base::RefCounted<TaskClosureAdapter>; - - ~TaskClosureAdapter(); - - Task* task_; - bool* should_leak_task_; - static bool kTaskLeakingDefault; -}; - -} // namespace subtle - } // namespace base #endif // BASE_TASK_H_ |