// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This defines helpful methods for dealing with Callbacks. Because Callbacks // are implemented using templates, with a class per callback signature, adding // methods to Callback<> itself is unattractive (lots of extra code gets // generated). Instead, consider adding methods here. #ifndef BASE_CALLBACK_HELPERS_H_ #define BASE_CALLBACK_HELPERS_H_ #include #include #include "base/atomicops.h" #include "base/bind.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ptr_util.h" namespace base { namespace internal { template struct IsBaseCallbackImpl : std::false_type {}; template struct IsBaseCallbackImpl> : std::true_type {}; template struct IsBaseCallbackImpl> : std::true_type {}; } // namespace internal template using IsBaseCallback = internal::IsBaseCallbackImpl>; // SFINAE friendly enabler allowing to overload methods for both Repeating and // OnceCallbacks. // // Usage: // template