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

Unified Diff: base/bind.h

Issue 1654973003: Revert of Do Perfect Forwarding from base::Bind to BindState storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | base/bind_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind.h
diff --git a/base/bind.h b/base/bind.h
index c6b73936a638229fc24b63e15435dcb7bf7c8258..770e45706b02da7a041f4415bbd387f47f50e1e4 100644
--- a/base/bind.h
+++ b/base/bind.h
@@ -6,6 +6,7 @@
#define BASE_BIND_H_
#include "base/bind_internal.h"
+#include "base/callback_internal.h"
// -----------------------------------------------------------------------------
// Usage documentation
@@ -51,8 +52,9 @@
typename internal::BindState<
typename internal::FunctorTraits<Functor>::RunnableType,
typename internal::FunctorTraits<Functor>::RunType,
- typename std::decay<Args>::type...>::UnboundRunType>
-Bind(Functor functor, Args&&... args) {
+ typename internal::CallbackParamTraits<Args>::StorageType...>
+ ::UnboundRunType>
+Bind(Functor functor, const Args&... args) {
// Type aliases for how to store and run the functor.
using RunnableType = typename internal::FunctorTraits<Functor>::RunnableType;
using RunType = typename internal::FunctorTraits<Functor>::RunType;
@@ -87,11 +89,11 @@
"a parameter is a refcounted type and needs scoped_refptr");
using BindState = internal::BindState<
- RunnableType, RunType, typename std::decay<Args>::type...>;
+ RunnableType, RunType,
+ typename internal::CallbackParamTraits<Args>::StorageType...>;
return Callback<typename BindState::UnboundRunType>(
- new BindState(internal::MakeRunnable(functor),
- std::forward<Args>(args)...));
+ new BindState(internal::MakeRunnable(functor), args...));
}
} // namespace base
« no previous file with comments | « no previous file | base/bind_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698