| Index: base/bind_internal.h
|
| diff --git a/base/bind_internal.h b/base/bind_internal.h
|
| index 41c34ffea3c704f3054ade3aca889bdbd470082c..4dcdc3a685c6c4ecd99e2725165f6f5fdc7afe58 100644
|
| --- a/base/bind_internal.h
|
| +++ b/base/bind_internal.h
|
| @@ -244,14 +244,16 @@ struct FunctorTraits<IgnoreResultHelper<T>> : FunctorTraits<T> {
|
| template <typename IgnoreResultType, typename... RunArgs>
|
| static void Invoke(IgnoreResultType&& ignore_result_helper,
|
| RunArgs&&... args) {
|
| - FunctorTraits<T>::Invoke(ignore_result_helper.functor_,
|
| - std::forward<RunArgs>(args)...);
|
| + FunctorTraits<T>::Invoke(
|
| + std::forward<IgnoreResultType>(ignore_result_helper).functor_,
|
| + std::forward<RunArgs>(args)...);
|
| }
|
| };
|
|
|
| // For Callbacks.
|
| -template <typename R, typename... Args, CopyMode copy_mode>
|
| -struct FunctorTraits<Callback<R(Args...), copy_mode>> {
|
| +template <typename R, typename... Args,
|
| + CopyMode copy_mode, RepeatMode repeat_mode>
|
| +struct FunctorTraits<Callback<R(Args...), copy_mode, repeat_mode>> {
|
| using RunType = R(Args...);
|
| static constexpr bool is_method = false;
|
| static constexpr bool is_nullable = true;
|
| @@ -327,6 +329,19 @@ struct Invoker<StorageType, R(UnboundArgs...)> {
|
| std::forward<UnboundArgs>(unbound_args)...);
|
| }
|
|
|
| + static R RunOneShot(BindStateBase* base, UnboundArgs&&... unbound_args) {
|
| + // Local references to make debugger stepping easier. If in a debugger,
|
| + // you really want to warp ahead and step through the
|
| + // InvokeHelper<>::MakeItSo() call below.
|
| + StorageType* storage = static_cast<StorageType*>(base);
|
| + static constexpr size_t num_bound_args =
|
| + std::tuple_size<decltype(storage->bound_args_)>::value;
|
| + return RunImpl(std::move(storage->functor_),
|
| + std::move(storage->bound_args_),
|
| + MakeIndexSequence<num_bound_args>(),
|
| + std::forward<UnboundArgs>(unbound_args)...);
|
| + }
|
| +
|
| private:
|
| template <typename Functor, typename BoundArgsTuple, size_t... indices>
|
| static inline R RunImpl(Functor&& functor,
|
|
|