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

Unified Diff: base/callback_helpers.h

Issue 2709913002: Fix OnceCallback support of base::ResetAndReturn (Closed)
Patch Set: Created 3 years, 10 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/callback_helpers_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_helpers.h
diff --git a/base/callback_helpers.h b/base/callback_helpers.h
index 5bac0d62f7d2b0eecf99a13c7abc4d9f3b3aa218..ec3d6cbf168140766f710527a297c7b44a03efce 100644
--- a/base/callback_helpers.h
+++ b/base/callback_helpers.h
@@ -25,8 +25,8 @@ template <typename Signature,
internal::RepeatMode repeat_mode>
base::Callback<Signature, copy_mode, repeat_mode> ResetAndReturn(
base::Callback<Signature, copy_mode, repeat_mode>* cb) {
- base::Callback<Signature, copy_mode, repeat_mode> ret(*cb);
- cb->Reset();
+ base::Callback<Signature, copy_mode, repeat_mode> ret(std::move(*cb));
+ DCHECK(!*cb);
return ret;
}
« no previous file with comments | « no previous file | base/callback_helpers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698