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

Unified Diff: base/callback_helpers.h

Issue 2662543002: Support OnceCallback on base::ResetAndReturn (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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 782371f6e71703059aeb6a4022a1aee785f1ad2d..5bac0d62f7d2b0eecf99a13c7abc4d9f3b3aa218 100644
--- a/base/callback_helpers.h
+++ b/base/callback_helpers.h
@@ -20,9 +20,12 @@
namespace base {
-template <typename Sig>
-base::Callback<Sig> ResetAndReturn(base::Callback<Sig>* cb) {
- base::Callback<Sig> ret(*cb);
+template <typename Signature,
+ internal::CopyMode copy_mode,
+ 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();
return ret;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698