Chromium Code Reviews| Index: base/callback.h.pump |
| diff --git a/base/callback.h.pump b/base/callback.h.pump |
| index ef65e8322f21c2b969538b5148c12935f7492fde..57db9d03519c641a93e67cb31b32716b988f26e1 100644 |
| --- a/base/callback.h.pump |
| +++ b/base/callback.h.pump |
| @@ -44,6 +44,10 @@ $var MAX_ARITY = 7 |
| // The reason to pass via a const-reference is to avoid unnecessary |
| // AddRef/Release pairs to the internal state. |
| // |
| +// If a Callback variable must be empty during the Run() of a previous value of |
|
akalin
2012/03/19 21:53:20
I couldn't parse this comment. Maybe something li
|
| +// that variable, use ResetAndRun(). E.g. if MyClass has a member variable |
| +// Callback which gets set as a side-effect of Run()'ing the Callback (to |
| +// something else), ResetAndRun() can be handy. |
| // |
| // EXAMPLE USAGE: |
| // |
| @@ -292,6 +296,16 @@ $for ARG , |
| [[internal::CallbackForward(a$(ARG))]]); |
| } |
| + |
|
akalin
2012/03/19 21:53:20
remove extra space
|
| + R ResetAndRun($for ARG , |
| + [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) { |
| + Callback<RunType> tmp(*this); |
| + Reset(); |
| + tmp.Run( |
| +$for ARG , |
| + [[internal::CallbackForward(a$(ARG))]]); |
| + } |
| + |
| private: |
| typedef R(*PolymorphicInvoke)( |
| internal::BindStateBase*[[]] |