Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2225)

Unified Diff: base/task.h

Issue 8120015: Add ScopedClosureRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/task.cc » ('j') | base/task.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task.h
diff --git a/base/task.h b/base/task.h
index 4a33de0e1f5d0fa378ea016d91a056f772b2d6a7..831ef0e4379848c95f4c68c0bf93c6fddd55ad0b 100644
--- a/base/task.h
+++ b/base/task.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/base_export.h"
+#include "base/callback.h"
#include "base/debug/alias.h"
#include "base/memory/raw_scoped_refptr_mismatch_checker.h"
#include "base/memory/weak_ptr.h"
@@ -566,6 +567,20 @@ class BASE_EXPORT ScopedTaskRunner {
DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTaskRunner);
};
+class BASE_EXPORT ScopedClosureRunner {
+ public:
+ // Takes ownership of the task.
awong 2011/10/04 00:22:42 Comment is stale.
Sergey Ulanov 2011/10/04 00:25:10 Done.
+ explicit ScopedClosureRunner(const Closure& closure);
+ ~ScopedClosureRunner();
+
+ Closure Release();
+
+ private:
+ Closure closure_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedClosureRunner);
+};
+
namespace subtle {
// This class is meant for use in the implementation of MessageLoop classes
« no previous file with comments | « no previous file | base/task.cc » ('j') | base/task.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698