diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 21:48:54 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 21:48:54 +0000 |
commit | 115288648041898b6d50f7d2e17391e2d1972a76 (patch) | |
tree | eee67d927a7ebb40e87848924a8f26c5c5cb99ca /base/bind.h.pump | |
parent | e91ac22d99252095839ca7c82c092972bd56445e (diff) | |
download | chromium_src-115288648041898b6d50f7d2e17391e2d1972a76.zip chromium_src-115288648041898b6d50f7d2e17391e2d1972a76.tar.gz chromium_src-115288648041898b6d50f7d2e17391e2d1972a76.tar.bz2 |
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
Diffstat (limited to 'base/bind.h.pump')
-rw-r--r-- | base/bind.h.pump | 17 |
1 files changed, 7 insertions, 10 deletions
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 <typename Functor[[]] $if ARITY > 0 [[, ]] $for ARG , [[typename P$(ARG)]]> -base::Callback< - typename internal::BindState< +internal::BindStateHolder< + internal::BindState< typename internal::FunctorTraits<Functor>::RunnableType, typename internal::FunctorTraits<Functor>::RunType, - void($for ARG , [[typename internal::CallbackParamTraits<P$(ARG)>::StorageType]])> - ::UnboundRunType> + void($for ARG , [[typename internal::CallbackParamTraits<P$(ARG)>::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<RunnableType, RunType, [[]] -void($for ARG , [[typename internal::CallbackParamTraits<P$(ARG)>::StorageType]])> [[]] -BindState; - - return Callback<typename BindState::UnboundRunType>( - new BindState(internal::MakeRunnable(functor)[[]] + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, [[]] +void($for ARG , [[typename internal::CallbackParamTraits<P$(ARG)>::StorageType]])>( + internal::MakeRunnable(functor)[[]] $if ARITY > 0 [[, ]] $for ARG , [[p$(ARG)]])); } |