diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 02:02:17 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 02:02:17 +0000 |
commit | c18b1056be790c55f10e407a1f6a3706bff7df03 (patch) | |
tree | 7ed333791fc8dfeaef29c07307e8efcfa1b44fba /base/callback.h.pump | |
parent | b2e900f755ea4e66b5f41413716ecb55720e354d (diff) | |
download | chromium_src-c18b1056be790c55f10e407a1f6a3706bff7df03.zip chromium_src-c18b1056be790c55f10e407a1f6a3706bff7df03.tar.gz chromium_src-c18b1056be790c55f10e407a1f6a3706bff7df03.tar.bz2 |
Callback support for unbound reference and array arguments.
Because the callback object uses const An& for the type of the Run() function in argument forwarding, the code breaks for An=T& or An=T[]. This CL adds in code to modify the parameter type to remove duplicate references, and other fun.
BUG=35223
TEST=new unittests
Review URL: http://codereview.chromium.org/6718021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79239 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/callback.h.pump')
-rw-r--r-- | base/callback.h.pump | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/base/callback.h.pump b/base/callback.h.pump index 34b0eb0..542a84f 100644 --- a/base/callback.h.pump +++ b/base/callback.h.pump @@ -240,10 +240,10 @@ class Callback<R($for ARG , [[A$(ARG)]])> : public internal::CallbackBase { ]] public: - typedef R(*PolymorphicInvoke)(internal::InvokerStorageBase*[[]] + typedef R(*PolymorphicInvoke)( + internal::InvokerStorageBase*[[]] $if ARITY != 0 [[, ]] -$for ARG , - [[const A$(ARG)&]]); +$for ARG , [[typename internal::ParamTraits<A$(ARG)>::ForwardType]]); Callback() : CallbackBase(NULL, NULL) { } @@ -262,7 +262,7 @@ $for ARG , } R Run($for ARG , - [[const A$(ARG)& a$(ARG)]]) const { + [[typename internal::ParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) const { PolymorphicInvoke f = reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |