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

Unified Diff: base/callback.h

Issue 10915080: Revert 154885 - Extend base::Callback to 8 arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « base/bind_internal_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback.h
===================================================================
--- base/callback.h (revision 154900)
+++ base/callback.h (working copy)
@@ -748,70 +748,7 @@
};
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7, typename A8>
-class Callback<R(A1, A2, A3, A4, A5, A6, A7, A8)>
- : public internal::CallbackBase {
- public:
- typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7, A8);
- Callback() : CallbackBase(NULL) { }
-
- // Note that this constructor CANNOT be explicit, and that Bind() CANNOT
- // return the exact Callback<> type. See base/bind.h for details.
- template <typename Runnable, typename BindRunType, typename BoundArgsType>
- Callback(internal::BindState<Runnable, BindRunType,
- BoundArgsType>* bind_state)
- : CallbackBase(bind_state) {
-
- // Force the assignment to a local variable of PolymorphicInvoke
- // so the compiler will typecheck that the passed in Run() method has
- // the correct type.
- PolymorphicInvoke invoke_func =
- &internal::BindState<Runnable, BindRunType, BoundArgsType>
- ::InvokerType::Run;
- polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
- }
-
- bool Equals(const Callback& other) const {
- return CallbackBase::Equals(other);
- }
-
- R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3,
- typename internal::CallbackParamTraits<A4>::ForwardType a4,
- typename internal::CallbackParamTraits<A5>::ForwardType a5,
- typename internal::CallbackParamTraits<A6>::ForwardType a6,
- typename internal::CallbackParamTraits<A7>::ForwardType a7,
- typename internal::CallbackParamTraits<A8>::ForwardType a8) const {
- PolymorphicInvoke f =
- reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
-
- return f(bind_state_.get(), internal::CallbackForward(a1),
- internal::CallbackForward(a2),
- internal::CallbackForward(a3),
- internal::CallbackForward(a4),
- internal::CallbackForward(a5),
- internal::CallbackForward(a6),
- internal::CallbackForward(a7),
- internal::CallbackForward(a8));
- }
-
- private:
- typedef R(*PolymorphicInvoke)(
- internal::BindStateBase*,
- typename internal::CallbackParamTraits<A1>::ForwardType,
- typename internal::CallbackParamTraits<A2>::ForwardType,
- typename internal::CallbackParamTraits<A3>::ForwardType,
- typename internal::CallbackParamTraits<A4>::ForwardType,
- typename internal::CallbackParamTraits<A5>::ForwardType,
- typename internal::CallbackParamTraits<A6>::ForwardType,
- typename internal::CallbackParamTraits<A7>::ForwardType,
- typename internal::CallbackParamTraits<A8>::ForwardType);
-
-};
-
// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
// will be used in a lot of APIs with delayed execution.
typedef Callback<void(void)> Closure;
« no previous file with comments | « base/bind_internal_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698