Index: base/callback_helpers.cc |
diff --git a/base/callback_helpers.cc b/base/callback_helpers.cc |
index ef02b2bde0cdfed5dbd02cb97cabd246ea18d611..8fd3dde6ca49089e9e4cc66e0089706f902ae678 100644 |
--- a/base/callback_helpers.cc |
+++ b/base/callback_helpers.cc |
@@ -8,18 +8,25 @@ |
namespace base { |
-ScopedClosureRunner::ScopedClosureRunner() { |
-} |
+ScopedClosureRunner::ScopedClosureRunner() {} |
ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) |
- : closure_(closure) { |
-} |
+ : closure_(closure) {} |
ScopedClosureRunner::~ScopedClosureRunner() { |
if (!closure_.is_null()) |
closure_.Run(); |
} |
+ScopedClosureRunner::ScopedClosureRunner(ScopedClosureRunner&& other) |
+ : closure_(other.Release()) {} |
+ |
+ScopedClosureRunner& ScopedClosureRunner::operator=( |
+ ScopedClosureRunner&& other) { |
+ Reset(other.Release()); |
+ return *this; |
+} |
+ |
void ScopedClosureRunner::Reset() { |
Closure old_closure = Release(); |
if (!old_closure.is_null()) |