Index: base/task.cc |
diff --git a/base/task.cc b/base/task.cc |
index 8c614734863fb5c8e34959dd2b00b4ac8c80e538..89d2aa80e7fbb599113e6d6efd4fe5feb9e310ae 100644 |
--- a/base/task.cc |
+++ b/base/task.cc |
@@ -34,6 +34,21 @@ Task* ScopedTaskRunner::Release() { |
return tmp; |
} |
+ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) |
+ : closure_(closure) { |
+} |
+ |
+ScopedClosureRunner::~ScopedClosureRunner() { |
+ if (!closure_.is_null()) |
+ closure_.Run(); |
+} |
+ |
+Closure ScopedClosureRunner::Release() { |
+ Closure result = closure_; |
+ closure_.Reset(); |
+ return result; |
+} |
+ |
namespace subtle { |
TaskClosureAdapter::TaskClosureAdapter(Task* task) |