From 115288648041898b6d50f7d2e17391e2d1972a76 Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Wed, 14 Dec 2011 21:48:54 +0000 Subject: Revert 114494 - Remove BindStateHolder and have Bind() return a Callback<> object directly. This removes some complexity and also fixes a bug where if you call Bind() with the result of Bind(), the resulting Callback would only be valid during the first call. Ouch. BUG=none TEST=new unittests Review URL: http://codereview.chromium.org/8738001 TBR=ajwong@chromium.org Review URL: http://codereview.chromium.org/8914022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114495 0039d316-1c4b-4281-b951-d872f2087c98 --- base/bind.h.pump | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'base/bind.h.pump') diff --git a/base/bind.h.pump b/base/bind.h.pump index 494d716..9d4c5ee 100644 --- a/base/bind.h.pump +++ b/base/bind.h.pump @@ -71,12 +71,11 @@ $range ARG 1..ARITY template 0 [[, ]] $for ARG , [[typename P$(ARG)]]> -base::Callback< - typename internal::BindState< +internal::BindStateHolder< + internal::BindState< typename internal::FunctorTraits::RunnableType, typename internal::FunctorTraits::RunType, - void($for ARG , [[typename internal::CallbackParamTraits::StorageType]])> - ::UnboundRunType> + void($for ARG , [[typename internal::CallbackParamTraits::StorageType]])> > Bind(Functor functor $if ARITY > 0 [[, ]] $for ARG , [[const P$(ARG)& p$(ARG)]]) { // Typedefs for how to store and run the functor. @@ -126,13 +125,11 @@ $if ARG == 1 [[ ]] $$ $for ARG - typedef internal::BindState::StorageType]])> [[]] -BindState; - - return Callback( - new BindState(internal::MakeRunnable(functor)[[]] + return internal::MakeBindStateHolder( + new internal::BindState::StorageType]])>( + internal::MakeRunnable(functor)[[]] $if ARITY > 0 [[, ]] $for ARG , [[p$(ARG)]])); } -- cgit v1.1