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

Unified Diff: base/callback_helpers.cc

Issue 2091503004: Add move constructor in ScopedClosureRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
« base/callback_helpers.h ('K') | « base/callback_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_helpers.cc
diff --git a/base/callback_helpers.cc b/base/callback_helpers.cc
index ef02b2bde0cdfed5dbd02cb97cabd246ea18d611..cd7fd34aa4ef696f4eada083b682e265d0cad2eb 100644
--- a/base/callback_helpers.cc
+++ b/base/callback_helpers.cc
@@ -8,12 +8,13 @@
namespace base {
-ScopedClosureRunner::ScopedClosureRunner() {
-}
+ScopedClosureRunner::ScopedClosureRunner() {}
+
+ScopedClosureRunner::ScopedClosureRunner(ScopedClosureRunner&& other)
+ : closure_(other.Release()) {}
ScopedClosureRunner::ScopedClosureRunner(const Closure& closure)
- : closure_(closure) {
-}
+ : closure_(closure) {}
ScopedClosureRunner::~ScopedClosureRunner() {
if (!closure_.is_null())
« base/callback_helpers.h ('K') | « base/callback_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698