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

Unified Diff: base/callback.h

Issue 1709483002: Support move-only type on base::Callback::Run (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove Passed() whitelist check Created 4 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
« base/bind_internal.h ('K') | « base/bind_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback.h
diff --git a/base/callback.h b/base/callback.h
index 3bf0008b6d33bf73e075f502523327817ddb1345..5f2fe8cf07be85c1115fff4f1ed6c3412d6d5373 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -386,18 +386,14 @@ class Callback<R(Args...)> : public internal::CallbackBase {
return CallbackBase::Equals(other);
}
- R Run(typename internal::CallbackParamTraits<Args>::ForwardType... args)
- const {
+ R Run(Args... args) const {
dcheng 2016/03/02 00:25:45 So this costs an extra copy now, since we don't ha
tzik 2016/03/02 01:04:21 Acknowledged. Updating.
tzik 2016/03/02 12:44:51 Done.
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
-
- return f(bind_state_.get(), internal::CallbackForward(args)...);
+ return f(bind_state_.get(), std::forward<Args>(args)...);
}
private:
- using PolymorphicInvoke =
- R(*)(internal::BindStateBase*,
- typename internal::CallbackParamTraits<Args>::ForwardType...);
+ using PolymorphicInvoke = R (*)(internal::BindStateBase*, Args&&...);
};
} // namespace base
« base/bind_internal.h ('K') | « base/bind_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698