diff options
author | tzik <tzik@chromium.org> | 2016-02-10 10:30:18 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 18:32:00 +0000 |
commit | 651fa1249144a42032c20e4e82f87e995f5d7dff (patch) | |
tree | acc0c325f26ca1124b019422291a4be66d3432fc /base | |
parent | a3a30cc274921b9124e92ac01a107c11874bda37 (diff) | |
download | chromium_src-651fa1249144a42032c20e4e82f87e995f5d7dff.zip chromium_src-651fa1249144a42032c20e4e82f87e995f5d7dff.tar.gz chromium_src-651fa1249144a42032c20e4e82f87e995f5d7dff.tar.bz2 |
Refactor gmock_mutant.h
This CL contains:
* Expose resulting type of Bind as MakeUnboundRunType.
* Refactor testing::CreateFunctor using base::Bind.
* Remove generate_gmock_mutant.py.
* Change argument ordering of testing::CreateFunctor to align to
base::Bind.
* Remove LATE_OBJECT_BINDING support, which no one use.
BUG=554299
Review URL: https://codereview.chromium.org/1680643002
Cr-Commit-Position: refs/heads/master@{#374689}
Diffstat (limited to 'base')
-rw-r--r-- | base/bind.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/base/bind.h b/base/bind.h index c6b7393..3a20feb 100644 --- a/base/bind.h +++ b/base/bind.h @@ -46,12 +46,26 @@ namespace base { +namespace internal { + +// Don't use Alias Template directly here to avoid a compile error on MSVC2013. +template <typename Functor, typename... Args> +struct MakeUnboundRunTypeImpl { + using Type = + typename BindState< + typename FunctorTraits<Functor>::RunnableType, + typename FunctorTraits<Functor>::RunType, + typename std::decay<Args>::type...>::UnboundRunType; +}; + +} // namespace internal + +template <typename Functor, typename... Args> +using MakeUnboundRunType = + typename internal::MakeUnboundRunTypeImpl<Functor, Args...>::Type; + template <typename Functor, typename... Args> -base::Callback< - typename internal::BindState< - typename internal::FunctorTraits<Functor>::RunnableType, - typename internal::FunctorTraits<Functor>::RunType, - typename std::decay<Args>::type...>::UnboundRunType> +base::Callback<MakeUnboundRunType<Functor, Args...>> Bind(Functor functor, Args&&... args) { // Type aliases for how to store and run the functor. using RunnableType = typename internal::FunctorTraits<Functor>::RunnableType; |