Commit 31d9407e authored by Marshall Greenblatt's avatar Marshall Greenblatt
Browse files

Apply clang-format to all C, C++ and ObjC files (issue #2171)

parent a566549e
......@@ -8,6 +8,8 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=9b613878ab9c9f72136f890b1df4a145d6341790$
#
{
'variables': {
......
......@@ -56,14 +56,14 @@
// Annotations are not currently supported.
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
namespace base {
typedef subtle::Atomic32 AtomicRefCount;
// Increment a reference count by "increment", which must exceed 0.
inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
inline void AtomicRefCountIncN(volatile AtomicRefCount* ptr,
AtomicRefCount increment) {
subtle::NoBarrier_AtomicIncrement(ptr, increment);
}
......@@ -72,7 +72,7 @@ inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
// and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
inline bool AtomicRefCountDecN(volatile AtomicRefCount* ptr,
AtomicRefCount decrement) {
ANNOTATE_HAPPENS_BEFORE(ptr);
bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
......@@ -83,14 +83,14 @@ inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
}
// Increment a reference count by 1.
inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) {
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
base::AtomicRefCountIncN(ptr, 1);
}
// Decrement a reference count by 1 and return whether the result is non-zero.
// Insert barriers to ensure that state written before the reference count
// became zero will be visible to a thread that has just made the count zero.
inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
return base::AtomicRefCountDecN(ptr, 1);
}
......@@ -100,7 +100,7 @@ inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
// the test for a reference count of one, and performs the memory barrier
// needed for the owning thread to act on the object, knowing that it has
// exclusive access to the object.
inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
bool res = (subtle::Acquire_Load(ptr) == 1);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);
......@@ -111,7 +111,7 @@ inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
// Return whether the reference count is zero. With conventional object
// referencing counting, the object will be destroyed, so the reference count
// should never be zero. Hence this is generally used for a debug check.
inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
bool res = (subtle::Acquire_Load(ptr) == 0);
if (res) {
ANNOTATE_HAPPENS_AFTER(ptr);
......
......@@ -122,8 +122,7 @@ Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
// *ptr with the increment applied. This routine implies no memory barriers.
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment);
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
// These following lower-level operations are typically useful only to people
// implementing higher-level synchronization operations like spinlocks,
......
......@@ -32,8 +32,8 @@
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#pragma once
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
#include <limits.h> // For UINT_MAX
#include <stddef.h> // For size_t
#include "include/base/cef_build.h"
......@@ -43,34 +43,34 @@
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
typedef long int64; // NOLINT(runtime/int)
typedef unsigned long uint64; // NOLINT(runtime/int)
typedef long int64;
typedef unsigned long uint64;
#else
typedef long long int64; // NOLINT(runtime/int)
typedef unsigned long long uint64; // NOLINT(runtime/int)
typedef long long int64;
typedef unsigned long long uint64;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int int32;
typedef int int32;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int uint32;
typedef unsigned int uint32;
#endif
// UTF-16 character type.
// This should be kept synchronized with base/strings/string16.h
#ifndef char16
#if defined(WCHAR_T_IS_UTF16)
typedef wchar_t char16;
typedef wchar_t char16;
#elif defined(WCHAR_T_IS_UTF32)
typedef unsigned short char16;
typedef unsigned short char16;
#endif
#endif
......
This diff is collapsed.
......@@ -274,20 +274,20 @@ class SupportsAddRefAndRelease {
// instantiate Base is made. We disable the warning for this definition.
#if defined(OS_WIN)
#pragma warning(push)
#pragma warning(disable:4624)
#pragma warning(disable : 4624)
#endif
struct Base : public T, public BaseMixin {
};
struct Base : public T, public BaseMixin {};
#if defined(OS_WIN)
#pragma warning(pop)
#endif
template <void(BaseMixin::*)(void)> struct Helper {};
template <void (BaseMixin::*)(void)>
struct Helper {};
template <typename C>
static No& Check(Helper<&C::AddRef>*);
template <typename >
template <typename>
static Yes& Check(...);
public:
......@@ -297,22 +297,18 @@ class SupportsAddRefAndRelease {
// Helpers to assert that arguments of a recounted type are bound with a
// scoped_refptr.
template <bool IsClasstype, typename T>
struct UnsafeBindtoRefCountedArgHelper : false_type {
};
struct UnsafeBindtoRefCountedArgHelper : false_type {};
template <typename T>
struct UnsafeBindtoRefCountedArgHelper<true, T>
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
};
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {};
template <typename T>
struct UnsafeBindtoRefCountedArg : false_type {
};
struct UnsafeBindtoRefCountedArg : false_type {};
template <typename T>
struct UnsafeBindtoRefCountedArg<T*>
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
};
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {};
template <typename T>
class HasIsMethodTag {
......@@ -334,6 +330,7 @@ class UnretainedWrapper {
public:
explicit UnretainedWrapper(T* o) : ptr_(o) {}
T* get() const { return ptr_; }
private:
T* ptr_;
};
......@@ -343,6 +340,7 @@ class ConstRefWrapper {
public:
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
const T& get() const { return *ptr_; }
private:
const T* ptr_;
};
......@@ -355,7 +353,7 @@ struct IgnoreResultHelper {
};
template <typename T>
struct IgnoreResultHelper<Callback<T> > {
struct IgnoreResultHelper<Callback<T>> {
explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
const Callback<T>& functor_;
......@@ -409,8 +407,7 @@ class PassedWrapper {
public:
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
PassedWrapper(const PassedWrapper& other)
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {
}
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {}
T Pass() const {
CHECK(is_valid_);
is_valid_ = false;
......@@ -430,7 +427,7 @@ struct UnwrapTraits {
};
template <typename T>
struct UnwrapTraits<UnretainedWrapper<T> > {
struct UnwrapTraits<UnretainedWrapper<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
return unretained.get();
......@@ -438,7 +435,7 @@ struct UnwrapTraits<UnretainedWrapper<T> > {
};
template <typename T>
struct UnwrapTraits<ConstRefWrapper<T> > {
struct UnwrapTraits<ConstRefWrapper<T>> {
typedef const T& ForwardType;
static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
return const_ref.get();
......@@ -446,31 +443,27 @@ struct UnwrapTraits<ConstRefWrapper<T> > {
};
template <typename T>
struct UnwrapTraits<scoped_refptr<T> > {
struct UnwrapTraits<scoped_refptr<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
};
template <typename T>
struct UnwrapTraits<WeakPtr<T> > {
struct UnwrapTraits<WeakPtr<T>> {
typedef const WeakPtr<T>& ForwardType;
static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
};
template <typename T>
struct UnwrapTraits<OwnedWrapper<T> > {
struct UnwrapTraits<OwnedWrapper<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(const OwnedWrapper<T>& o) {
return o.get();
}
static ForwardType Unwrap(const OwnedWrapper<T>& o) { return o.get(); }
};
template <typename T>
struct UnwrapTraits<PassedWrapper<T> > {
struct UnwrapTraits<PassedWrapper<T>> {
typedef T ForwardType;
static T Unwrap(PassedWrapper<T>& o) {
return o.Pass();
}
static T Unwrap(PassedWrapper<T>& o) { return o.Pass(); }
};
// Utility for handling different refcounting semantics in the Bind()
......@@ -505,7 +498,7 @@ struct MaybeRefcount<true, T*> {
// No need to additionally AddRef() and Release() since we are storing a
// scoped_refptr<> inside the storage object already.
template <typename T>
struct MaybeRefcount<true, scoped_refptr<T> > {
struct MaybeRefcount<true, scoped_refptr<T>> {
static void AddRef(const scoped_refptr<T>& o) {}
static void Release(const scoped_refptr<T>& o) {}
};
......@@ -526,10 +519,10 @@ template <bool IsMethod, typename P1>
struct IsWeakMethod : public false_type {};
template <typename T>
struct IsWeakMethod<true, WeakPtr<T> > : public true_type {};
struct IsWeakMethod<true, WeakPtr<T>> : public true_type {};
template <typename T>
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T> > > : public true_type {};
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T>>> : public true_type {};
} // namespace cef_internal
......@@ -567,14 +560,14 @@ static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
}
template <typename T>
static inline cef_internal::IgnoreResultHelper<Callback<T> >
IgnoreResult(const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T> >(data);
static inline cef_internal::IgnoreResultHelper<Callback<T>> IgnoreResult(
const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T>>(data);
}
void DoNothing();
template<typename T>
template <typename T>
void DeletePointer(T* obj) {
delete obj;
}
......
......@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
#pragma once
......@@ -116,12 +115,10 @@
// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_UTF16
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
#define WCHAR_T_IS_UTF32
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
// compile in this mode (in particular, Chrome doesn't). This is intended for
......@@ -181,7 +178,7 @@
// Visual Studio 2010 and later support override.
#define OVERRIDE override
#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
#define OVERRIDE override
#else
......@@ -191,10 +188,9 @@
// Check for C++11 template alias support which was added in VS2013 and GCC4.7.
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
#if __cplusplus > 199711L || \
(defined(_MSC_VER) && _MSC_VER >= 1800) || \
(defined(__GNUC__) && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
#if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) || \
(defined(__GNUC__) && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
#define HAS_CPP11_TEMPLATE_ALIAS_SUPPORT
#endif
......
......@@ -45,9 +45,9 @@
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include "include/base/internal/cef_callback_internal.h"
#include "include/base/cef_callback_forward.h"
#include "include/base/cef_template_util.h"
#include "include/base/internal/cef_callback_internal.h"
// NOTE: Header files that do not require the full definition of Callback or
// Closure should #include "base/cef_callback_forward.h" instead of this file.
......@@ -407,21 +407,20 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)();
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -437,9 +436,7 @@ class Callback<R(void)> : public cef_internal::CallbackBase {
}
private:
typedef R(*PolymorphicInvoke)(
cef_internal::BindStateBase*);
typedef R (*PolymorphicInvoke)(cef_internal::BindStateBase*);
};
template <typename R, typename A1>
......@@ -447,21 +444,20 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1);
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -477,10 +473,9 @@ class Callback<R(A1)> : public cef_internal::CallbackBase {
}
private:
typedef R(*PolymorphicInvoke)(
typedef R (*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType);
};
template <typename R, typename A1, typename A2>
......@@ -488,21 +483,20 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2);
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -520,11 +514,10 @@ class Callback<R(A1, A2)> : public cef_internal::CallbackBase {
}
private:
typedef R(*PolymorphicInvoke)(
typedef R (*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType);
};
template <typename R, typename A1, typename A2, typename A3>
......@@ -532,21 +525,20 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3);
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -566,12 +558,11 @@ class Callback<R(A1, A2, A3)> : public cef_internal::CallbackBase {
}
private:
typedef R(*PolymorphicInvoke)(
typedef R (*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType);
};
template <typename R, typename A1, typename A2, typename A3, typename A4>
......@@ -579,21 +570,20 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4);
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -615,36 +605,38 @@ class Callback<R(A1, A2, A3, A4)> : public cef_internal::CallbackBase {
}
private:
typedef R(*PolymorphicInvoke)(
typedef R (*PolymorphicInvoke)(
cef_internal::BindStateBase*,
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
typename cef_internal::CallbackParamTraits<A1>::ForwardType,
typename cef_internal::CallbackParamTraits<A2>::ForwardType,
typename cef_internal::CallbackParamTraits<A3>::ForwardType,
typename cef_internal::CallbackParamTraits<A4>::ForwardType);
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5>
template <typename R,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
public:
typedef R(RunType)(A1, A2, A3, A4, A5);
Callback() : CallbackBase(NULL) { }
Callback() : CallbackBase(NULL) {}
// Note that this constructor CANNOT be explicit, and that Bind() CANNOT
// return the exact Callback<> type. See base/bind.h for details.
template <typename Runnable, typename BindRunType, typename BoundArgsType>
Callback(cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>* bind_state)
Callback(
cef_internal::BindState<Runnable, BindRunType, BoundArgsType>* bind_state)
: CallbackBase(bind_state) {
// Force the assignment to a local variable of PolymorphicInvoke
// so the compiler will typecheck that the passed in Run() method has
// the correct type.
PolymorphicInvoke invoke_func =
&cef_internal::BindState<Runnable, BindRunType, BoundArgsType>
::InvokerType::Run;
&cef_internal::BindState<Runnable, BindRunType,
BoundArgsType>::InvokerType::Run;
polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
}
......@@ -660,45 +652,47 @@ class Callback<R(A1, A2, A3, A4, A5)> : public cef_internal::CallbackBase {
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);