diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 04:17:22 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 04:17:22 +0000 |
commit | c9c0d079c24a02f8f9b667f3cbf06d234a586625 (patch) | |
tree | 3190175cc6bd419a1f36d3a9265c1c61e1ba9884 /base/task.h | |
parent | 0c12ed8f62b3691f1fee9e5abd6b6bc2fa5af14a (diff) | |
download | chromium_src-c9c0d079c24a02f8f9b667f3cbf06d234a586625.zip chromium_src-c9c0d079c24a02f8f9b667f3cbf06d234a586625.tar.gz chromium_src-c9c0d079c24a02f8f9b667f3cbf06d234a586625.tar.bz2 |
Move media library AutoTaskRunner to base and rename ScopedTaskRunner.
This is needed to avoid faux dependencies on media/ creeping in to remoting/ code, and creating linker issues.
BUG=
TEST=Everything works as before.
Review URL: http://codereview.chromium.org/7062013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/task.h')
-rw-r--r-- | base/task.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/base/task.h b/base/task.h index b698576..a415b58 100644 --- a/base/task.h +++ b/base/task.h @@ -546,4 +546,24 @@ inline Task* NewRunnableFunction(Function function, const A& a, const B& b, function, MakeTuple(a, b, c, d, e, f, g, h)); } +namespace base { + +// ScopedTaskRunner is akin to scoped_ptr for Tasks. It ensures that the Task +// is executed and deleted no matter how the current scope exits. +class ScopedTaskRunner { + public: + // Takes ownership of the task. + explicit ScopedTaskRunner(Task* task); + ~ScopedTaskRunner(); + + Task* Release(); + + private: + Task* task_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTaskRunner); +}; + +} // namespace base + #endif // BASE_TASK_H_ |