diff --git a/cef_paths.gypi b/cef_paths.gypi index 79360db03..f90116fab 100644 --- a/cef_paths.gypi +++ b/cef_paths.gypi @@ -8,6 +8,8 @@ # by hand. See the translator.README.txt file in the tools directory for # more information. # +# $hash=9b613878ab9c9f72136f890b1df4a145d6341790$ +# { 'variables': { diff --git a/include/base/cef_atomic_ref_count.h b/include/base/cef_atomic_ref_count.h index bdbad6c92..755f8a8fb 100644 --- a/include/base/cef_atomic_ref_count.h +++ b/include/base/cef_atomic_ref_count.h @@ -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); diff --git a/include/base/cef_atomicops.h b/include/base/cef_atomicops.h index ae74802f2..96aebabf8 100644 --- a/include/base/cef_atomicops.h +++ b/include/base/cef_atomicops.h @@ -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, diff --git a/include/base/cef_basictypes.h b/include/base/cef_basictypes.h index 193e910f8..0086a1dcb 100644 --- a/include/base/cef_basictypes.h +++ b/include/base/cef_basictypes.h @@ -32,8 +32,8 @@ #define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ #pragma once -#include // For UINT_MAX -#include // For size_t +#include // For UINT_MAX +#include // 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 // 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 diff --git a/include/base/cef_bind.h b/include/base/cef_bind.h index 8ee406d75..77c9c5573 100644 --- a/include/base/cef_bind.h +++ b/include/base/cef_bind.h @@ -89,34 +89,32 @@ namespace base { template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void()> - ::UnboundRunType> +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void()>::UnboundRunType> Bind(Functor functor) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; typedef cef_internal::BindState BindState; - return Callback( new BindState(cef_internal::MakeRunnable(functor))); } template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> Bind(Functor functor, const P1& p1) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -131,39 +129,39 @@ Bind(Functor functor, const P1& p1) { // invoked function will receive a reference to the stored copy of the // argument and not the original. COMPILE_ASSERT( - !(is_non_const_reference::value ), + !(is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); - typedef cef_internal::BindState::StorageType)> BindState; - + typedef cef_internal::BindState< + RunnableType, RunType, + void(typename cef_internal::CallbackParamTraits::StorageType)> + BindState; return Callback( new BindState(cef_internal::MakeRunnable(functor), p1)); } template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> Bind(Functor functor, const P1& p1, const P2& p2) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -179,43 +177,43 @@ Bind(Functor functor, const P1& p1, const P2& p2) { // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p2_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; - + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; return Callback( new BindState(cef_internal::MakeRunnable(functor), p1, p2)); } template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -231,18 +229,17 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value || + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); @@ -250,29 +247,30 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { p2_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p3_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; - + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; return Callback( new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3)); } template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -288,19 +286,18 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); @@ -310,33 +307,42 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { p3_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p4_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; - + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; return Callback( new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4)); } -template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> -Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, - const P5& p5) { +template +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> +Bind(Functor functor, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -352,20 +358,19 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); @@ -377,35 +382,46 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, p4_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p5_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; - + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; return Callback( new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); } -template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> -Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, - const P5& p5, const P6& p6) { +template +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> +Bind(Functor functor, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -421,21 +437,20 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); @@ -449,37 +464,50 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, p5_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p6_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; - - return Callback( - new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); + return Callback(new BindState( + cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); } -template -base::Callback< - typename cef_internal::BindState< - typename cef_internal::FunctorTraits::RunnableType, - typename cef_internal::FunctorTraits::RunType, - void(typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> - ::UnboundRunType> -Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, - const P5& p5, const P6& p6, const P7& p7) { +template +base::Callback::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)>:: + UnboundRunType> +Bind(Functor functor, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7) { // Typedefs for how to store and run the functor. - typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef + typename cef_internal::FunctorTraits::RunnableType RunnableType; typedef typename cef_internal::FunctorTraits::RunType RunType; // Use RunnableType::RunType instead of RunType above because our @@ -495,22 +523,21 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, // argument and not the original. COMPILE_ASSERT( !(is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value || - is_non_const_reference::value ), + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value), do_not_bind_functions_with_nonconst_ref); // For methods, we need to be careful for parameter 1. We do not require // a scoped_refptr because BindState<> itself takes care of AddRef() for // methods. We also disallow binding of an array as the method's target // object. - COMPILE_ASSERT( - cef_internal::HasIsMethodTag::value || - !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, - p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || !is_array::value, first_bound_argument_to_method_cannot_be_array); @@ -526,19 +553,19 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, p6_is_refcounted_type_and_needs_scoped_refptr); COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, p7_is_refcounted_type_and_needs_scoped_refptr); - typedef cef_internal::BindState::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType, - typename cef_internal::CallbackParamTraits::StorageType)> BindState; + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + BindState; - - return Callback( - new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, - p7)); + return Callback(new BindState( + cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7)); } } // namespace base diff --git a/include/base/cef_bind_helpers.h b/include/base/cef_bind_helpers.h index dde1d0dc0..2b4798b2c 100644 --- a/include/base/cef_bind_helpers.h +++ b/include/base/cef_bind_helpers.h @@ -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 struct Helper {}; + template + struct Helper {}; template static No& Check(Helper<&C::AddRef>*); - template + template 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 -struct UnsafeBindtoRefCountedArgHelper : false_type { -}; +struct UnsafeBindtoRefCountedArgHelper : false_type {}; template struct UnsafeBindtoRefCountedArgHelper - : integral_constant::value> { -}; + : integral_constant::value> {}; template -struct UnsafeBindtoRefCountedArg : false_type { -}; +struct UnsafeBindtoRefCountedArg : false_type {}; template struct UnsafeBindtoRefCountedArg - : UnsafeBindtoRefCountedArgHelper::value, T> { -}; + : UnsafeBindtoRefCountedArgHelper::value, T> {}; template 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 -struct IgnoreResultHelper > { +struct IgnoreResultHelper> { explicit IgnoreResultHelper(const Callback& functor) : functor_(functor) {} const Callback& 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 -struct UnwrapTraits > { +struct UnwrapTraits> { typedef T* ForwardType; static ForwardType Unwrap(UnretainedWrapper unretained) { return unretained.get(); @@ -438,7 +435,7 @@ struct UnwrapTraits > { }; template -struct UnwrapTraits > { +struct UnwrapTraits> { typedef const T& ForwardType; static ForwardType Unwrap(ConstRefWrapper const_ref) { return const_ref.get(); @@ -446,31 +443,27 @@ struct UnwrapTraits > { }; template -struct UnwrapTraits > { +struct UnwrapTraits> { typedef T* ForwardType; static ForwardType Unwrap(const scoped_refptr& o) { return o.get(); } }; template -struct UnwrapTraits > { +struct UnwrapTraits> { typedef const WeakPtr& ForwardType; static ForwardType Unwrap(const WeakPtr& o) { return o; } }; template -struct UnwrapTraits > { +struct UnwrapTraits> { typedef T* ForwardType; - static ForwardType Unwrap(const OwnedWrapper& o) { - return o.get(); - } + static ForwardType Unwrap(const OwnedWrapper& o) { return o.get(); } }; template -struct UnwrapTraits > { +struct UnwrapTraits> { typedef T ForwardType; - static T Unwrap(PassedWrapper& o) { - return o.Pass(); - } + static T Unwrap(PassedWrapper& o) { return o.Pass(); } }; // Utility for handling different refcounting semantics in the Bind() @@ -505,7 +498,7 @@ struct MaybeRefcount { // No need to additionally AddRef() and Release() since we are storing a // scoped_refptr<> inside the storage object already. template -struct MaybeRefcount > { +struct MaybeRefcount> { static void AddRef(const scoped_refptr& o) {} static void Release(const scoped_refptr& o) {} }; @@ -526,10 +519,10 @@ template struct IsWeakMethod : public false_type {}; template -struct IsWeakMethod > : public true_type {}; +struct IsWeakMethod> : public true_type {}; template -struct IsWeakMethod > > : public true_type {}; +struct IsWeakMethod>> : public true_type {}; } // namespace cef_internal @@ -567,14 +560,14 @@ static inline cef_internal::IgnoreResultHelper IgnoreResult(T data) { } template -static inline cef_internal::IgnoreResultHelper > -IgnoreResult(const Callback& data) { - return cef_internal::IgnoreResultHelper >(data); +static inline cef_internal::IgnoreResultHelper> IgnoreResult( + const Callback& data) { + return cef_internal::IgnoreResultHelper>(data); } void DoNothing(); -template +template void DeletePointer(T* obj) { delete obj; } diff --git a/include/base/cef_build.h b/include/base/cef_build.h index 81ee851f5..1e2065ce3 100644 --- a/include/base/cef_build.h +++ b/include/base/cef_build.h @@ -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 diff --git a/include/base/cef_callback.h b/include/base/cef_callback.h index 611fba50d..16e238a97 100644 --- a/include/base/cef_callback.h +++ b/include/base/cef_callback.h @@ -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 : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -437,9 +436,7 @@ class Callback : public cef_internal::CallbackBase { } private: - typedef R(*PolymorphicInvoke)( - cef_internal::BindStateBase*); - + typedef R (*PolymorphicInvoke)(cef_internal::BindStateBase*); }; template @@ -447,21 +444,20 @@ class Callback : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -477,10 +473,9 @@ class Callback : public cef_internal::CallbackBase { } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType); }; template @@ -488,21 +483,20 @@ class Callback : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -520,11 +514,10 @@ class Callback : public cef_internal::CallbackBase { } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; template @@ -532,21 +525,20 @@ class Callback : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -566,12 +558,11 @@ class Callback : public cef_internal::CallbackBase { } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; template @@ -579,21 +570,20 @@ class Callback : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -615,36 +605,38 @@ class Callback : public cef_internal::CallbackBase { } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; -template +template class Callback : 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -660,45 +652,47 @@ class Callback : public cef_internal::CallbackBase { PolymorphicInvoke f = reinterpret_cast(polymorphic_invoke_); - return f(bind_state_.get(), cef_internal::CallbackForward(a1), - cef_internal::CallbackForward(a2), - cef_internal::CallbackForward(a3), - cef_internal::CallbackForward(a4), - cef_internal::CallbackForward(a5)); + return f( + bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5)); } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; -template +template class Callback : public cef_internal::CallbackBase { public: typedef R(RunType)(A1, A2, A3, A4, A5, A6); - 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -715,47 +709,51 @@ class Callback : public cef_internal::CallbackBase { PolymorphicInvoke f = reinterpret_cast(polymorphic_invoke_); - return f(bind_state_.get(), cef_internal::CallbackForward(a1), - cef_internal::CallbackForward(a2), - cef_internal::CallbackForward(a3), - cef_internal::CallbackForward(a4), - cef_internal::CallbackForward(a5), - cef_internal::CallbackForward(a6)); + return f( + bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5), + cef_internal::CallbackForward(a6)); } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; -template -class Callback : public cef_internal::CallbackBase { +template +class Callback + : public cef_internal::CallbackBase { public: typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); - 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 - Callback(cef_internal::BindState* bind_state) + Callback( + cef_internal::BindState* 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 - ::InvokerType::Run; + &cef_internal::BindState::InvokerType::Run; polymorphic_invoke_ = reinterpret_cast(invoke_func); } @@ -773,29 +771,25 @@ class Callback : public cef_internal::CallbackBas PolymorphicInvoke f = reinterpret_cast(polymorphic_invoke_); - return f(bind_state_.get(), cef_internal::CallbackForward(a1), - cef_internal::CallbackForward(a2), - cef_internal::CallbackForward(a3), - cef_internal::CallbackForward(a4), - cef_internal::CallbackForward(a5), - cef_internal::CallbackForward(a6), - cef_internal::CallbackForward(a7)); + return f( + bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), cef_internal::CallbackForward(a5), + cef_internal::CallbackForward(a6), cef_internal::CallbackForward(a7)); } private: - typedef R(*PolymorphicInvoke)( + typedef R (*PolymorphicInvoke)( cef_internal::BindStateBase*, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType, - typename cef_internal::CallbackParamTraits::ForwardType); - + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); }; - // Syntactic sugar to make Callbacks easier to declare since it // will be used in a lot of APIs with delayed execution. typedef Callback Closure; diff --git a/include/base/cef_callback_list.h b/include/base/cef_callback_list.h index 73dd9f757..e0ef3665b 100644 --- a/include/base/cef_callback_list.h +++ b/include/base/cef_callback_list.h @@ -48,12 +48,12 @@ #include #include "include/base/cef_basictypes.h" -#include "include/base/cef_callback.h" -#include "include/base/internal/cef_callback_internal.h" #include "include/base/cef_build.h" +#include "include/base/cef_callback.h" #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" #include "include/base/cef_scoped_ptr.h" +#include "include/base/internal/cef_callback_internal.h" // OVERVIEW: // @@ -120,9 +120,7 @@ class CallbackListBase { public: Subscription(CallbackListBase* list, typename std::list::iterator iter) - : list_(list), - iter_(iter) { - } + : list_(list), iter_(iter) {} ~Subscription() { if (list_->active_iterator_count_) { @@ -167,14 +165,12 @@ class CallbackListBase { class Iterator { public: explicit Iterator(CallbackListBase* list) - : list_(list), - list_iter_(list_->callbacks_.begin()) { + : list_(list), list_iter_(list_->callbacks_.begin()) { ++list_->active_iterator_count_; } Iterator(const Iterator& iter) - : list_(iter.list_), - list_iter_(iter.list_iter_) { + : list_(iter.list_), list_iter_(iter.list_iter_) { ++list_->active_iterator_count_; } @@ -210,9 +206,7 @@ class CallbackListBase { // Returns an instance of a CallbackListBase::Iterator which can be used // to run callbacks. - Iterator GetIterator() { - return Iterator(this); - } + Iterator GetIterator() { return Iterator(this); } // Compact the list: remove any entries which were NULLed out during // iteration. @@ -242,11 +236,12 @@ class CallbackListBase { } // namespace cef_internal -template class CallbackList; +template +class CallbackList; template <> class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase> { public: typedef Callback CallbackType; @@ -267,7 +262,7 @@ class CallbackList template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase> { public: typedef Callback CallbackType; @@ -288,7 +283,7 @@ class CallbackList template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase> { public: typedef Callback CallbackType; @@ -310,7 +305,7 @@ class CallbackList template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase> { public: typedef Callback CallbackType; @@ -333,7 +328,7 @@ class CallbackList template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase> { public: typedef Callback CallbackType; @@ -357,7 +352,8 @@ class CallbackList template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase< + Callback> { public: typedef Callback CallbackType; @@ -380,11 +376,15 @@ class CallbackList DISALLOW_COPY_AND_ASSIGN(CallbackList); }; -template +template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase< + Callback> { public: typedef Callback CallbackType; @@ -408,11 +408,16 @@ class CallbackList DISALLOW_COPY_AND_ASSIGN(CallbackList); }; -template +template class CallbackList - : public cef_internal::CallbackListBase > { + : public cef_internal::CallbackListBase< + Callback> { public: typedef Callback CallbackType; diff --git a/include/base/cef_cancelable_callback.h b/include/base/cef_cancelable_callback.h index 8f5979eb4..febce3a32 100644 --- a/include/base/cef_cancelable_callback.h +++ b/include/base/cef_cancelable_callback.h @@ -83,8 +83,8 @@ // updated to match. #include "include/base/cef_bind.h" -#include "include/base/cef_callback.h" #include "include/base/cef_build.h" +#include "include/base/cef_callback.h" #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" #include "include/base/cef_weak_ptr.h" @@ -102,8 +102,7 @@ class CancelableCallback { // |callback| must not be null. explicit CancelableCallback(const base::Callback& callback) - : weak_factory_(this), - callback_(callback) { + : weak_factory_(this), callback_(callback) { DCHECK(!callback.is_null()); InitializeForwarder(); } @@ -118,9 +117,7 @@ class CancelableCallback { } // Returns true if the wrapped callback has been cancelled. - bool IsCancelled() const { - return callback_.is_null(); - } + bool IsCancelled() const { return callback_.is_null(); } // Sets |callback| as the closure that may be cancelled. |callback| may not // be null. Outstanding and any previously wrapped callbacks are cancelled. @@ -137,14 +134,10 @@ class CancelableCallback { } // Returns a callback that can be disabled by calling Cancel(). - const base::Callback& callback() const { - return forwarder_; - } + const base::Callback& callback() const { return forwarder_; } private: - void Forward() { - callback_.Run(); - } + void Forward() { callback_.Run(); } // Helper method to bind |forwarder_| using a weak pointer from // |weak_factory_|. @@ -154,7 +147,7 @@ class CancelableCallback { } // Used to ensure Forward() is not run when this object is destroyed. - base::WeakPtrFactory > weak_factory_; + base::WeakPtrFactory> weak_factory_; // The wrapper closure. base::Callback forwarder_; @@ -172,8 +165,7 @@ class CancelableCallback { // |callback| must not be null. explicit CancelableCallback(const base::Callback& callback) - : weak_factory_(this), - callback_(callback) { + : weak_factory_(this), callback_(callback) { DCHECK(!callback.is_null()); InitializeForwarder(); } @@ -188,9 +180,7 @@ class CancelableCallback { } // Returns true if the wrapped callback has been cancelled. - bool IsCancelled() const { - return callback_.is_null(); - } + bool IsCancelled() const { return callback_.is_null(); } // Sets |callback| as the closure that may be cancelled. |callback| may not // be null. Outstanding and any previously wrapped callbacks are cancelled. @@ -207,14 +197,10 @@ class CancelableCallback { } // Returns a callback that can be disabled by calling Cancel(). - const base::Callback& callback() const { - return forwarder_; - } + const base::Callback& callback() const { return forwarder_; } private: - void Forward(A1 a1) const { - callback_.Run(a1); - } + void Forward(A1 a1) const { callback_.Run(a1); } // Helper method to bind |forwarder_| using a weak pointer from // |weak_factory_|. @@ -224,7 +210,7 @@ class CancelableCallback { } // Used to ensure Forward() is not run when this object is destroyed. - base::WeakPtrFactory > weak_factory_; + base::WeakPtrFactory> weak_factory_; // The wrapper closure. base::Callback forwarder_; @@ -242,8 +228,7 @@ class CancelableCallback { // |callback| must not be null. explicit CancelableCallback(const base::Callback& callback) - : weak_factory_(this), - callback_(callback) { + : weak_factory_(this), callback_(callback) { DCHECK(!callback.is_null()); InitializeForwarder(); } @@ -258,9 +243,7 @@ class CancelableCallback { } // Returns true if the wrapped callback has been cancelled. - bool IsCancelled() const { - return callback_.is_null(); - } + bool IsCancelled() const { return callback_.is_null(); } // Sets |callback| as the closure that may be cancelled. |callback| may not // be null. Outstanding and any previously wrapped callbacks are cancelled. @@ -277,14 +260,10 @@ class CancelableCallback { } // Returns a callback that can be disabled by calling Cancel(). - const base::Callback& callback() const { - return forwarder_; - } + const base::Callback& callback() const { return forwarder_; } private: - void Forward(A1 a1, A2 a2) const { - callback_.Run(a1, a2); - } + void Forward(A1 a1, A2 a2) const { callback_.Run(a1, a2); } // Helper method to bind |forwarder_| using a weak pointer from // |weak_factory_|. @@ -294,7 +273,7 @@ class CancelableCallback { } // Used to ensure Forward() is not run when this object is destroyed. - base::WeakPtrFactory > weak_factory_; + base::WeakPtrFactory> weak_factory_; // The wrapper closure. base::Callback forwarder_; diff --git a/include/base/cef_lock.h b/include/base/cef_lock.h index 9f872bb58..6909bd6f2 100644 --- a/include/base/cef_lock.h +++ b/include/base/cef_lock.h @@ -125,9 +125,7 @@ class AutoLock { public: struct AlreadyAcquired {}; - explicit AutoLock(Lock& lock) : lock_(lock) { - lock_.Acquire(); - } + explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); } AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) { lock_.AssertAcquired(); @@ -153,9 +151,7 @@ class AutoUnlock { lock_.Release(); } - ~AutoUnlock() { - lock_.Acquire(); - } + ~AutoUnlock() { lock_.Acquire(); } private: Lock& lock_; diff --git a/include/base/cef_logging.h b/include/base/cef_logging.h index 75e35d961..8d8bb889e 100644 --- a/include/base/cef_logging.h +++ b/include/base/cef_logging.h @@ -158,9 +158,9 @@ // updated to match. #include -#include #include #include +#include #include "include/base/cef_build.h" #include "include/base/cef_macros.h" @@ -201,32 +201,27 @@ const LogSeverity LOG_DFATAL = LOG_FATAL; // A few definitions of macros that don't generate much code. These are used // by LOG() and LOG_IF, etc. Since these are used all over our code, it's // better to have compact code for these operations. -#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \ - cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO , \ - ##__VA_ARGS__) -#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \ - cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING , \ - ##__VA_ARGS__) -#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \ - cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR , \ - ##__VA_ARGS__) -#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \ - cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL , \ - ##__VA_ARGS__) -#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \ - cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL , \ - ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO, \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING, \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR, \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL, \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL, \ + ##__VA_ARGS__) -#define COMPACT_GOOGLE_LOG_INFO \ - COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) -#define COMPACT_GOOGLE_LOG_WARNING \ - COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) -#define COMPACT_GOOGLE_LOG_ERROR \ - COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) -#define COMPACT_GOOGLE_LOG_FATAL \ - COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage) -#define COMPACT_GOOGLE_LOG_DFATAL \ - COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) +#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) +#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) +#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) +#define COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage) +#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) #if defined(OS_WIN) // wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets @@ -236,7 +231,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL; // the Windows SDK does for consistency. #define ERROR 0 #define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \ - COMPACT_GOOGLE_LOG_EX_ERROR(ClassName , ##__VA_ARGS__) + COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ##__VA_ARGS__) #define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR // Needed for LOG_IS_ON(ERROR). const LogSeverity LOG_0 = LOG_ERROR; @@ -246,7 +241,7 @@ const LogSeverity LOG_0 = LOG_ERROR; // LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will // always fire if they fail. #define LOG_IS_ON(severity) \ - ((::cef::logging::LOG_ ## severity) >= ::cef::logging::GetMinLogLevel()) + ((::cef::logging::LOG_##severity) >= ::cef::logging::GetMinLogLevel()) // We can't do any caching tricks with VLOG_IS_ON() like the // google-glog version since it requires GCC extensions. This means @@ -257,8 +252,8 @@ const LogSeverity LOG_0 = LOG_ERROR; // Helper macro which avoids evaluating the arguments to a stream if // the condition doesn't hold. -#define LAZY_STREAM(stream, condition) \ - !(condition) ? (void) 0 : ::cef::logging::LogMessageVoidify() & (stream) +#define LAZY_STREAM(stream, condition) \ + !(condition) ? (void)0 : ::cef::logging::LogMessageVoidify() & (stream) // We use the preprocessor's merging operator, "##", so that, e.g., // LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny @@ -268,7 +263,7 @@ const LogSeverity LOG_0 = LOG_ERROR; // impossible to stream something like a string directly to an unnamed // ostream. We employ a neat hack by calling the stream() member // function of LogMessage which seems to avoid the problem. -#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() +#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_##severity.stream() #define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity)) #define LOG_IF(severity, condition) \ @@ -286,16 +281,18 @@ const LogSeverity LOG_0 = LOG_ERROR; #define VLOG_IF(verbose_level, condition) \ LAZY_STREAM(VLOG_STREAM(verbose_level), \ - VLOG_IS_ON(verbose_level) && (condition)) + VLOG_IS_ON(verbose_level) && (condition)) -#if defined (OS_WIN) -#define VPLOG_STREAM(verbose_level) \ - cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ - ::cef::logging::GetLastSystemErrorCode()).stream() +#if defined(OS_WIN) +#define VPLOG_STREAM(verbose_level) \ + cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()) \ + .stream() #elif defined(OS_POSIX) -#define VPLOG_STREAM(verbose_level) \ - cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ - ::cef::logging::GetLastSystemErrorCode()).stream() +#define VPLOG_STREAM(verbose_level) \ + cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()) \ + .stream() #endif #define VPLOG(verbose_level) \ @@ -303,34 +300,35 @@ const LogSeverity LOG_0 = LOG_ERROR; #define VPLOG_IF(verbose_level, condition) \ LAZY_STREAM(VPLOG_STREAM(verbose_level), \ - VLOG_IS_ON(verbose_level) && (condition)) + VLOG_IS_ON(verbose_level) && (condition)) // TODO(akalin): Add more VLOG variants, e.g. VPLOG. -#define LOG_ASSERT(condition) \ +#define LOG_ASSERT(condition) \ LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " #define SYSLOG_ASSERT(condition) \ SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " #if defined(OS_WIN) -#define PLOG_STREAM(severity) \ - COMPACT_GOOGLE_LOG_EX_ ## severity(Win32ErrorLogMessage, \ - ::cef::logging::GetLastSystemErrorCode()).stream() +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_##severity(Win32ErrorLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()) \ + .stream() #elif defined(OS_POSIX) -#define PLOG_STREAM(severity) \ - COMPACT_GOOGLE_LOG_EX_ ## severity(ErrnoLogMessage, \ - ::cef::logging::GetLastSystemErrorCode()).stream() +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_##severity(ErrnoLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()) \ + .stream() #endif -#define PLOG(severity) \ - LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) +#define PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) #define PLOG_IF(severity, condition) \ LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) // The actual stream used isn't important. -#define EAT_STREAM_PARAMETERS \ - true ? (void) 0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL) +#define EAT_STREAM_PARAMETERS \ + true ? (void)0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL) // CHECK dies with a fatal error if condition is not true. It is *not* // controlled by NDEBUG, so the check will be executed regardless of @@ -341,28 +339,27 @@ const LogSeverity LOG_0 = LOG_ERROR; #define CHECK(condition) \ LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \ - << "Check failed: " #condition ". " + << "Check failed: " #condition ". " -#define PCHECK(condition) \ +#define PCHECK(condition) \ LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \ - << "Check failed: " #condition ". " + << "Check failed: " #condition ". " // Helper macro for binary operators. // Don't use this macro directly in your code, use CHECK_EQ et al below. // // TODO(akalin): Rewrite this so that constructs like if (...) // CHECK_EQ(...) else { ... } work properly. -#define CHECK_OP(name, op, val1, val2) \ - if (std::string* _result = \ - cef::logging::Check##name##Impl((val1), (val2), \ - #val1 " " #op " " #val2)) \ - cef::logging::LogMessage(__FILE__, __LINE__, _result).stream() +#define CHECK_OP(name, op, val1, val2) \ + if (std::string* _result = cef::logging::Check##name##Impl( \ + (val1), (val2), #val1 " " #op " " #val2)) \ + cef::logging::LogMessage(__FILE__, __LINE__, _result).stream() // Build the error message string. This is separate from the "Impl" // function template because it is not performance critical and so can // be out of line, while the "Impl" code should be inline. Caller // takes ownership of the returned string. -template +template std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { std::ostringstream ss; ss << names << " (" << v1 << " vs. " << v2 << ")"; @@ -374,51 +371,60 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { #if !defined(COMPILER_MSVC) // Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated // in logging.cc. -extern template std::string* MakeCheckOpString( - const int&, const int&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned long&, const unsigned long&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned long&, const unsigned int&, const char* names); -extern template -std::string* MakeCheckOpString( - const unsigned int&, const unsigned long&, const char* names); -extern template -std::string* MakeCheckOpString( - const std::string&, const std::string&, const char* name); +extern template std::string* MakeCheckOpString(const int&, + const int&, + const char* names); +extern template std::string* MakeCheckOpString( + const unsigned long&, + const unsigned long&, + const char* names); +extern template std::string* MakeCheckOpString( + const unsigned long&, + const unsigned int&, + const char* names); +extern template std::string* MakeCheckOpString( + const unsigned int&, + const unsigned long&, + const char* names); +extern template std::string* MakeCheckOpString( + const std::string&, + const std::string&, + const char* name); #endif // Helper functions for CHECK_OP macro. // The (int, int) specialization works around the issue that the compiler // will not instantiate the template version of the function on values of // unnamed enum type - see comment below. -#define DEFINE_CHECK_OP_IMPL(name, op) \ - template \ - inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ - const char* names) { \ - if (v1 op v2) return NULL; \ - else return MakeCheckOpString(v1, v2, names); \ - } \ +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (v1 op v2) \ + return NULL; \ + else \ + return MakeCheckOpString(v1, v2, names); \ + } \ inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ - if (v1 op v2) return NULL; \ - else return MakeCheckOpString(v1, v2, names); \ + if (v1 op v2) \ + return NULL; \ + else \ + return MakeCheckOpString(v1, v2, names); \ } DEFINE_CHECK_OP_IMPL(EQ, ==) DEFINE_CHECK_OP_IMPL(NE, !=) DEFINE_CHECK_OP_IMPL(LE, <=) -DEFINE_CHECK_OP_IMPL(LT, < ) +DEFINE_CHECK_OP_IMPL(LT, <) DEFINE_CHECK_OP_IMPL(GE, >=) -DEFINE_CHECK_OP_IMPL(GT, > ) +DEFINE_CHECK_OP_IMPL(GT, >) #undef DEFINE_CHECK_OP_IMPL #define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2) #define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2) #define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2) -#define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(LT, <, val1, val2) #define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2) -#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(GT, >, val1, val2) #if defined(NDEBUG) #define ENABLE_DLOG 0 @@ -471,11 +477,9 @@ enum { DEBUG_MODE = ENABLE_DLOG }; #undef ENABLE_DLOG -#define DLOG(severity) \ - LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) +#define DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) -#define DPLOG(severity) \ - LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) +#define DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) #define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) @@ -486,7 +490,7 @@ enum { DEBUG_MODE = ENABLE_DLOG }; #if DCHECK_IS_ON() #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ - COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) + COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ##__VA_ARGS__) #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL const LogSeverity LOG_DCHECK = LOG_FATAL; @@ -494,7 +498,7 @@ const LogSeverity LOG_DCHECK = LOG_FATAL; // These are just dummy values. #define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ - COMPACT_GOOGLE_LOG_EX_INFO(ClassName , ##__VA_ARGS__) + COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ##__VA_ARGS__) #define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO const LogSeverity LOG_DCHECK = LOG_INFO; @@ -505,22 +509,23 @@ const LogSeverity LOG_DCHECK = LOG_INFO; // variable warnings if the only use of a variable is in a DCHECK. // This behavior is different from DLOG_IF et al. -#define DCHECK(condition) \ - LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \ +#define DCHECK(condition) \ + LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \ << "Check failed: " #condition ". " -#define DPCHECK(condition) \ - LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \ +#define DPCHECK(condition) \ + LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \ << "Check failed: " #condition ". " // Helper macro for binary operators. // Don't use this macro directly in your code, use DCHECK_EQ et al below. -#define DCHECK_OP(name, op, val1, val2) \ - if (DCHECK_IS_ON()) \ - if (std::string* _result = cef::logging::Check##name##Impl( \ - (val1), (val2), #val1 " " #op " " #val2)) \ - cef::logging::LogMessage(__FILE__, __LINE__, \ - ::cef::logging::LOG_DCHECK, _result).stream() +#define DCHECK_OP(name, op, val1, val2) \ + if (DCHECK_IS_ON()) \ + if (std::string* _result = cef::logging::Check##name##Impl( \ + (val1), (val2), #val1 " " #op " " #val2)) \ + cef::logging::LogMessage(__FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \ + _result) \ + .stream() // Equality/Inequality checks - compare two values, and log a // LOG_DCHECK message including the two values when the result is not @@ -544,13 +549,13 @@ const LogSeverity LOG_DCHECK = LOG_INFO; #define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) #define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) #define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) -#define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) +#define DCHECK_LT(val1, val2) DCHECK_OP(LT, <, val1, val2) #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) -#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) +#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2) #if defined(NDEBUG) && defined(OS_CHROMEOS) -#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \ - __FUNCTION__ << ". " +#define NOTREACHED() \ + LOG(ERROR) << "NOTREACHED() hit in " << __FUNCTION__ << ". " #else #define NOTREACHED() DCHECK(false) #endif @@ -577,7 +582,9 @@ class LogMessage { LogMessage(const char* file, int line, std::string* result); // Used for DCHECK_EQ(), etc. Takes ownership of the given string. - LogMessage(const char* file, int line, LogSeverity severity, + LogMessage(const char* file, + int line, + LogSeverity severity, std::string* result); ~LogMessage(); @@ -617,7 +624,7 @@ class LogMessage { // A non-macro interface to the log facility; (useful // when the logging level is not a compile-time constant). -inline void LogAtLevel(int const log_level, std::string const &msg) { +inline void LogAtLevel(int const log_level, std::string const& msg) { LogMessage(__FILE__, __LINE__, log_level).stream() << msg; } @@ -626,10 +633,10 @@ inline void LogAtLevel(int const log_level, std::string const &msg) { // is not used" and "statement has no effect". class LogMessageVoidify { public: - LogMessageVoidify() { } + LogMessageVoidify() {} // This has to be an operator with a precedence lower than << but // higher than ?: - void operator&(std::ostream&) { } + void operator&(std::ostream&) {} }; #if defined(OS_WIN) @@ -739,12 +746,13 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { #elif NOTIMPLEMENTED_POLICY == 4 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG #elif NOTIMPLEMENTED_POLICY == 5 -#define NOTIMPLEMENTED() do {\ - static bool logged_once = false;\ - LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ - logged_once = true;\ -} while(0);\ -EAT_STREAM_PARAMETERS +#define NOTIMPLEMENTED() \ + do { \ + static bool logged_once = false; \ + LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG; \ + logged_once = true; \ + } while (0); \ + EAT_STREAM_PARAMETERS #endif #endif // !USING_CHROMIUM_INCLUDES diff --git a/include/base/cef_macros.h b/include/base/cef_macros.h index df3f9b7c5..e99f0a8b8 100644 --- a/include/base/cef_macros.h +++ b/include/base/cef_macros.h @@ -41,7 +41,7 @@ // If the Chromium implementation diverges the below implementation should be // updated to match. -#include // For size_t. +#include // For size_t. #include "include/base/cef_build.h" // For COMPILER_MSVC #if !defined(arraysize) @@ -126,14 +126,13 @@ char (&ArraySizeHelper(const T (&array)[N]))[N]; namespace cef { template -struct CompileAssert { -}; +struct CompileAssert {}; } // namespace cef -#define COMPILE_ASSERT(expr, msg) \ - typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \ - ALLOW_UNUSED_TYPE +#define COMPILE_ASSERT(expr, msg) \ + typedef cef::CompileAssert<(bool(expr))> \ + msg[bool(expr) ? 1 : -1] ALLOW_UNUSED_TYPE // Implementation details of COMPILE_ASSERT: // @@ -187,8 +186,8 @@ struct CompileAssert { // MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled. // The warning remains disabled until popped by MSVC_POP_WARNING. -#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ - __pragma(warning(disable:n)) +#define MSVC_PUSH_DISABLE_WARNING(n) \ + __pragma(warning(push)) __pragma(warning(disable : n)) // MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level // remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all @@ -207,9 +206,9 @@ struct CompileAssert { // // Compiler warning C4355: 'this': used in base member initializer list: // http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx -#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \ - code \ - MSVC_POP_WARNING() +#define ALLOW_THIS_IN_INITIALIZER_LIST(code) \ + MSVC_PUSH_DISABLE_WARNING(4355) \ + code MSVC_POP_WARNING() #else // !COMPILER_MSVC #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code diff --git a/include/base/cef_move.h b/include/base/cef_move.h index 3c3c4913f..da47d2d32 100644 --- a/include/base/cef_move.h +++ b/include/base/cef_move.h @@ -240,20 +240,22 @@ // // The workaround is to explicitly declare your copy constructor. // -#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ - private: \ - struct rvalue_type { \ +#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ + private: \ + struct rvalue_type { \ explicit rvalue_type(type* object) : object(object) {} \ - type* object; \ - }; \ - type(type&); \ - void operator=(type&); \ - public: \ - operator rvalue_type() { return rvalue_type(this); } \ - type Pass() { return type(rvalue_type(this)); } \ - typedef void MoveOnlyTypeForCPP03; \ + type* object; \ + }; \ + type(type&); \ + void operator=(type&); \ + \ + public: \ + operator rvalue_type() { return rvalue_type(this); } \ + type Pass() { return type(rvalue_type(this)); } \ + typedef void MoveOnlyTypeForCPP03; \ + \ private: - + #endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_MOVE_H_ diff --git a/include/base/cef_platform_thread.h b/include/base/cef_platform_thread.h index 916113606..d3fdd798e 100644 --- a/include/base/cef_platform_thread.h +++ b/include/base/cef_platform_thread.h @@ -69,21 +69,14 @@ class PlatformThreadRef { public: typedef cef_platform_thread_handle_t RefType; - PlatformThreadRef() - : id_(0) { - } + PlatformThreadRef() : id_(0) {} - explicit PlatformThreadRef(RefType id) - : id_(id) { - } + explicit PlatformThreadRef(RefType id) : id_(id) {} - bool operator==(PlatformThreadRef other) const { - return id_ == other.id_; - } + bool operator==(PlatformThreadRef other) const { return id_ == other.id_; } + + bool is_null() const { return id_ == 0; } - bool is_null() const { - return id_ == 0; - } private: RefType id_; }; diff --git a/include/base/cef_ref_counted.h b/include/base/cef_ref_counted.h index 61d4de686..480b1ce9d 100644 --- a/include/base/cef_ref_counted.h +++ b/include/base/cef_ref_counted.h @@ -64,43 +64,43 @@ class RefCountedBase { protected: RefCountedBase() : ref_count_(0) - #if DCHECK_IS_ON() - , in_dtor_(false) - #endif - { +#if DCHECK_IS_ON() + , + in_dtor_(false) +#endif + { } ~RefCountedBase() { - #if DCHECK_IS_ON() +#if DCHECK_IS_ON() DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()"; - #endif +#endif } - void AddRef() const { - // TODO(maruel): Add back once it doesn't assert 500 times/sec. - // Current thread books the critical section "AddRelease" - // without release it. - // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); - #if DCHECK_IS_ON() +// TODO(maruel): Add back once it doesn't assert 500 times/sec. +// Current thread books the critical section "AddRelease" +// without release it. +// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); +#if DCHECK_IS_ON() DCHECK(!in_dtor_); - #endif +#endif ++ref_count_; } // Returns true if the object should self-delete. bool Release() const { - // TODO(maruel): Add back once it doesn't assert 500 times/sec. - // Current thread books the critical section "AddRelease" - // without release it. - // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); - #if DCHECK_IS_ON() +// TODO(maruel): Add back once it doesn't assert 500 times/sec. +// Current thread books the critical section "AddRelease" +// without release it. +// DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); +#if DCHECK_IS_ON() DCHECK(!in_dtor_); - #endif +#endif if (--ref_count_ == 0) { - #if DCHECK_IS_ON() +#if DCHECK_IS_ON() in_dtor_ = true; - #endif +#endif return true; } return false; @@ -160,9 +160,7 @@ class RefCounted : public cef_subtle::RefCountedBase { public: RefCounted() {} - void AddRef() const { - cef_subtle::RefCountedBase::AddRef(); - } + void AddRef() const { cef_subtle::RefCountedBase::AddRef(); } void Release() const { if (cef_subtle::RefCountedBase::Release()) { @@ -178,18 +176,19 @@ class RefCounted : public cef_subtle::RefCountedBase { }; // Forward declaration. -template class RefCountedThreadSafe; +template +class RefCountedThreadSafe; // Default traits for RefCountedThreadSafe. Deletes the object when its ref // count reaches 0. Overload to delete it on a different thread etc. -template +template struct DefaultRefCountedThreadSafeTraits { static void Destruct(const T* x) { // Delete through RefCountedThreadSafe to make child classes only need to be // friend with RefCountedThreadSafe instead of this struct, which is an // implementation detail. - RefCountedThreadSafe::DeleteInternal(x); + RefCountedThreadSafe::DeleteInternal( + x); } }; @@ -205,14 +204,12 @@ struct DefaultRefCountedThreadSafeTraits { // private: // friend class base::RefCountedThreadSafe; // ~MyFoo(); -template > +template > class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase { public: RefCountedThreadSafe() {} - void AddRef() const { - cef_subtle::RefCountedThreadSafeBase::AddRef(); - } + void AddRef() const { cef_subtle::RefCountedThreadSafeBase::AddRef(); } void Release() const { if (cef_subtle::RefCountedThreadSafeBase::Release()) { @@ -234,9 +231,9 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase { // A thread-safe wrapper for some piece of data so we can place other // things in scoped_refptrs<>. // -template +template class RefCountedData - : public base::RefCountedThreadSafe< base::RefCountedData > { + : public base::RefCountedThreadSafe> { public: RefCountedData() : data() {} RefCountedData(const T& in_value) : data(in_value) {} @@ -244,7 +241,7 @@ class RefCountedData T data; private: - friend class base::RefCountedThreadSafe >; + friend class base::RefCountedThreadSafe>; ~RefCountedData() {} }; @@ -303,8 +300,7 @@ class scoped_refptr { public: typedef T element_type; - scoped_refptr() : ptr_(NULL) { - } + scoped_refptr() : ptr_(NULL) {} scoped_refptr(T* p) : ptr_(p) { if (ptr_) @@ -364,9 +360,7 @@ class scoped_refptr { *pp = p; } - void swap(scoped_refptr& r) { - swap(&r.ptr_); - } + void swap(scoped_refptr& r) { swap(&r.ptr_); } protected: T* ptr_; diff --git a/include/base/cef_scoped_ptr.h b/include/base/cef_scoped_ptr.h index 563558979..eb9e0e29b 100644 --- a/include/base/cef_scoped_ptr.h +++ b/include/base/cef_scoped_ptr.h @@ -154,7 +154,8 @@ class RefCountedThreadSafeBase; template struct DefaultDeleter { DefaultDeleter() {} - template DefaultDeleter(const DefaultDeleter& other) { + template + DefaultDeleter(const DefaultDeleter& other) { // IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor // if U* is implicitly convertible to T* and U is not an array type. // @@ -194,7 +195,8 @@ struct DefaultDeleter { // References: // C++98 [expr.delete]p3 // http://cplusplus.github.com/LWG/lwg-defects.html#938 - template void operator()(U* array) const; + template + void operator()(U* array) const; }; template @@ -209,18 +211,18 @@ struct DefaultDeleter { // scoped_ptr foo_ptr( // static_cast(malloc(sizeof(int)))); struct FreeDeleter { - inline void operator()(void* ptr) const { - free(ptr); - } + inline void operator()(void* ptr) const { free(ptr); } }; namespace cef_internal { -template struct IsNotRefCounted { +template +struct IsNotRefCounted { enum { - value = !base::is_convertible::value && - !base::is_convertible:: - value + value = + !base::is_convertible::value && + !base::is_convertible::value }; }; @@ -229,7 +231,7 @@ template struct IsNotRefCounted { template class scoped_ptr_impl { public: - explicit scoped_ptr_impl(T* p) : data_(p) { } + explicit scoped_ptr_impl(T* p) : data_(p) {} // Initializer for deleters that have data parameters. scoped_ptr_impl(T* p, const D& d) : data_(p, d) {} @@ -309,7 +311,8 @@ class scoped_ptr_impl { private: // Needed to allow type-converting constructor. - template friend class scoped_ptr_impl; + template + friend class scoped_ptr_impl; // Use the empty base class optimization to allow us to have a D // member, while avoiding any space overhead for it when D is an @@ -346,7 +349,7 @@ class scoped_ptr_impl { // unique_ptr<> features. Known deficiencies include not supporting move-only // deleteres, function pointers as deleters, and deleters with reference // types. -template > +template > class scoped_ptr { MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) @@ -359,13 +362,13 @@ class scoped_ptr { typedef D deleter_type; // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } + scoped_ptr() : impl_(NULL) {} // Constructor. Takes ownership of p. - explicit scoped_ptr(element_type* p) : impl_(p) { } + explicit scoped_ptr(element_type* p) : impl_(p) {} // Constructor. Allows initialization of a stateful deleter. - scoped_ptr(element_type* p, const D& d) : impl_(p, d) { } + scoped_ptr(element_type* p, const D& d) : impl_(p, d) {} // Constructor. Allows construction from a scoped_ptr rvalue for a // convertible type and deleter. @@ -383,7 +386,7 @@ class scoped_ptr { } // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {} // operator=. Allows assignment from a scoped_ptr rvalue for a convertible // type and deleter. @@ -412,7 +415,7 @@ class scoped_ptr { assert(impl_.get() != NULL); return *impl_.get(); } - element_type* operator->() const { + element_type* operator->() const { assert(impl_.get() != NULL); return impl_.get(); } @@ -443,18 +446,14 @@ class scoped_ptr { bool operator!=(const element_type* p) const { return impl_.get() != p; } // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } + void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); } // Release a pointer. // The return value is the current pointer held by this object. // If this object holds a NULL pointer, the return value is NULL. // After this operation, this object will hold a NULL pointer, // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } + element_type* release() WARN_UNUSED_RESULT { return impl_.release(); } // C++98 doesn't support functions templates with default parameters which // makes it hard to write a PassAs() that understands converting the deleter @@ -469,7 +468,8 @@ class scoped_ptr { private: // Needed to reach into |impl_| in the constructor. - template friend class scoped_ptr; + template + friend class scoped_ptr; base::cef_internal::scoped_ptr_impl impl_; // Forbidden for API compatibility with std::unique_ptr. @@ -479,8 +479,10 @@ class scoped_ptr { // doesn't make sense, and if U == T, it still doesn't make sense // because you should never have the same object owned by two different // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; + template + bool operator==(scoped_ptr const& p2) const; + template + bool operator!=(scoped_ptr const& p2) const; }; template @@ -493,7 +495,7 @@ class scoped_ptr { typedef D deleter_type; // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } + scoped_ptr() : impl_(NULL) {} // Constructor. Stores the given array. Note that the argument's type // must exactly match T*. In particular: @@ -511,10 +513,10 @@ class scoped_ptr { // to work around this may use implicit_cast(). // However, because of the first bullet in this comment, users MUST // NOT use implicit_cast() to upcast the static type of the array. - explicit scoped_ptr(element_type* array) : impl_(array) { } + explicit scoped_ptr(element_type* array) : impl_(array) {} // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {} // operator=. Move operator= for C++03 move emulation of this type. scoped_ptr& operator=(RValue rhs) { @@ -553,18 +555,14 @@ class scoped_ptr { bool operator!=(element_type* array) const { return impl_.get() != array; } // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } + void swap(scoped_ptr& p2) { impl_.swap(p2.impl_); } // Release a pointer. // The return value is the current pointer held by this object. // If this object holds a NULL pointer, the return value is NULL. // After this operation, this object will hold a NULL pointer, // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } + element_type* release() WARN_UNUSED_RESULT { return impl_.release(); } private: // Force element_type to be a complete type. @@ -578,20 +576,24 @@ class scoped_ptr { // private and has no definition. This is disabled because it is not safe to // call delete[] on an array whose static type does not match its dynamic // type. - template explicit scoped_ptr(U* array); + template + explicit scoped_ptr(U* array); explicit scoped_ptr(int disallow_construction_from_null); // Disable reset() from any type other than element_type*, for the same // reasons as the constructor above. - template void reset(U* array); + template + void reset(U* array); void reset(int disallow_reset_from_null); // Forbid comparison of scoped_ptr types. If U != T, it totally // doesn't make sense, and if U == T, it still doesn't make sense // because you should never have the same object owned by two different // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; + template + bool operator==(scoped_ptr const& p2) const; + template + bool operator!=(scoped_ptr const& p2) const; }; // Free functions diff --git a/include/base/cef_string16.h b/include/base/cef_string16.h index 51760f435..427564073 100644 --- a/include/base/cef_string16.h +++ b/include/base/cef_string16.h @@ -112,26 +112,19 @@ struct string16_char_traits { typedef mbstate_t state_type; typedef std::fpos pos_type; - static void assign(char_type& c1, const char_type& c2) { - c1 = c2; - } + static void assign(char_type& c1, const char_type& c2) { c1 = c2; } - static bool eq(const char_type& c1, const char_type& c2) { - return c1 == c2; - } - static bool lt(const char_type& c1, const char_type& c2) { - return c1 < c2; - } + static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; } + static bool lt(const char_type& c1, const char_type& c2) { return c1 < c2; } static int compare(const char_type* s1, const char_type* s2, size_t n) { return c16memcmp(s1, s2, n); } - static size_t length(const char_type* s) { - return c16len(s); - } + static size_t length(const char_type* s) { return c16len(s); } - static const char_type* find(const char_type* s, size_t n, + static const char_type* find(const char_type* s, + size_t n, const char_type& a) { return c16memchr(s, a, n); } @@ -152,21 +145,15 @@ struct string16_char_traits { return eq_int_type(c, eof()) ? 0 : c; } - static char_type to_char_type(const int_type& c) { - return char_type(c); - } + static char_type to_char_type(const int_type& c) { return char_type(c); } - static int_type to_int_type(const char_type& c) { - return int_type(c); - } + static int_type to_int_type(const char_type& c) { return int_type(c); } static bool eq_int_type(const int_type& c1, const int_type& c2) { return c1 == c2; } - static int_type eof() { - return static_cast(EOF); - } + static int_type eof() { return static_cast(EOF); } }; typedef std::basic_string string16; @@ -217,8 +204,8 @@ extern void PrintTo(const string16& str, std::ostream* out); // // TODO(mark): File this bug with Apple and update this note with a bug number. -extern template -class std::basic_string; +extern template class std::basic_string; #endif // WCHAR_T_IS_UTF32 diff --git a/include/base/cef_template_util.h b/include/base/cef_template_util.h index 098bf463e..38fa5839c 100644 --- a/include/base/cef_template_util.h +++ b/include/base/cef_template_util.h @@ -53,70 +53,92 @@ namespace base { // template definitions from tr1 -template +template struct integral_constant { static const T value = v; typedef T value_type; typedef integral_constant type; }; -template const T integral_constant::value; +template +const T integral_constant::value; typedef integral_constant true_type; typedef integral_constant false_type; -template struct is_pointer : false_type {}; -template struct is_pointer : true_type {}; +template +struct is_pointer : false_type {}; +template +struct is_pointer : true_type {}; // Member function pointer detection up to four params. Add more as needed // below. This is built-in to C++ 11, and we can remove this when we switch. -template +template struct is_member_function_pointer : false_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; -template -struct is_member_function_pointer : true_type {}; -template : true_type {}; +template -struct is_member_function_pointer : true_type {}; +struct is_member_function_pointer : true_type {}; +template +struct is_same : public false_type {}; +template +struct is_same : true_type {}; -template struct is_same : public false_type {}; -template struct is_same : true_type {}; +template +struct is_array : public false_type {}; +template +struct is_array : public true_type {}; +template +struct is_array : public true_type {}; -template struct is_array : public false_type {}; -template struct is_array : public true_type {}; -template struct is_array : public true_type {}; +template +struct is_non_const_reference : false_type {}; +template +struct is_non_const_reference : true_type {}; +template +struct is_non_const_reference : false_type {}; -template struct is_non_const_reference : false_type {}; -template struct is_non_const_reference : true_type {}; -template struct is_non_const_reference : false_type {}; +template +struct is_const : false_type {}; +template +struct is_const : true_type {}; -template struct is_const : false_type {}; -template struct is_const : true_type {}; - -template struct is_void : false_type {}; -template <> struct is_void : true_type {}; +template +struct is_void : false_type {}; +template <> +struct is_void : true_type {}; namespace cef_internal { @@ -152,7 +174,7 @@ struct ConvertHelper { // is_class type_trait implementation. struct IsClassHelper { template - static YesType Test(void(C::*)(void)); + static YesType Test(void (C::*)(void)); template static NoType Test(...); @@ -168,22 +190,22 @@ template struct is_convertible : integral_constant( - cef_internal::ConvertHelper::Create())) == - sizeof(cef_internal::YesType)> { -}; + cef_internal::ConvertHelper::Create())) == + sizeof(cef_internal::YesType)> {}; template struct is_class : integral_constant(0)) == - sizeof(cef_internal::YesType)> { -}; + sizeof(cef_internal::YesType)> {}; -template +template struct enable_if {}; -template -struct enable_if { typedef T type; }; +template +struct enable_if { + typedef T type; +}; } // namespace base diff --git a/include/base/cef_thread_checker.h b/include/base/cef_thread_checker.h index 42bac7fc0..e48c8d033 100644 --- a/include/base/cef_thread_checker.h +++ b/include/base/cef_thread_checker.h @@ -58,7 +58,6 @@ #define ENABLE_THREAD_CHECKER 0 #endif - namespace base { namespace cef_internal { @@ -69,9 +68,7 @@ namespace cef_internal { // right version for your build configuration. class ThreadCheckerDoNothing { public: - bool CalledOnValidThread() const { - return true; - } + bool CalledOnValidThread() const { return true; } void DetachFromThread() {} }; @@ -110,11 +107,9 @@ class ThreadCheckerDoNothing { // // In Release mode, CalledOnValidThread will always return true. #if ENABLE_THREAD_CHECKER -class ThreadChecker : public cef_internal::ThreadCheckerImpl { -}; +class ThreadChecker : public cef_internal::ThreadCheckerImpl {}; #else -class ThreadChecker : public cef_internal::ThreadCheckerDoNothing { -}; +class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {}; #endif // ENABLE_THREAD_CHECKER #undef ENABLE_THREAD_CHECKER diff --git a/include/base/cef_thread_collision_warner.h b/include/base/cef_thread_collision_warner.h index 8f60a546d..53f6ef6d5 100644 --- a/include/base/cef_thread_collision_warner.h +++ b/include/base/cef_thread_collision_warner.h @@ -139,24 +139,22 @@ // DFAKE_MUTEX(shareable_section_); // }; - #if DCHECK_IS_ON() // Defines a class member that acts like a mutex. It is used only as a // verification tool. -#define DFAKE_MUTEX(obj) \ - mutable base::ThreadCollisionWarner obj +#define DFAKE_MUTEX(obj) mutable base::ThreadCollisionWarner obj // Asserts the call is never called simultaneously in two threads. Used at // member function scope. #define DFAKE_SCOPED_LOCK(obj) \ - base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj) + base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj) // Asserts the call is never called simultaneously in two threads. Used at // member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks. #define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \ - base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) + base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) // Asserts the code is always executed in the same thread. #define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \ - base::ThreadCollisionWarner::Check check_##obj(&obj) + base::ThreadCollisionWarner::Check check_##obj(&obj) #else @@ -187,13 +185,9 @@ class ThreadCollisionWarner { public: // The parameter asserter is there only for test purpose explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter()) - : valid_thread_id_(0), - counter_(0), - asserter_(asserter) {} + : valid_thread_id_(0), counter_(0), asserter_(asserter) {} - ~ThreadCollisionWarner() { - delete asserter_; - } + ~ThreadCollisionWarner() { delete asserter_; } // This class is meant to be used through the macro // DFAKE_SCOPED_LOCK_THREAD_LOCKED @@ -202,8 +196,7 @@ class ThreadCollisionWarner { // from one thread class Check { public: - explicit Check(ThreadCollisionWarner* warner) - : warner_(warner) { + explicit Check(ThreadCollisionWarner* warner) : warner_(warner) { warner_->EnterSelf(); } @@ -219,14 +212,11 @@ class ThreadCollisionWarner { // DFAKE_SCOPED_LOCK class ScopedCheck { public: - explicit ScopedCheck(ThreadCollisionWarner* warner) - : warner_(warner) { + explicit ScopedCheck(ThreadCollisionWarner* warner) : warner_(warner) { warner_->Enter(); } - ~ScopedCheck() { - warner_->Leave(); - } + ~ScopedCheck() { warner_->Leave(); } private: ThreadCollisionWarner* warner_; @@ -243,9 +233,7 @@ class ThreadCollisionWarner { warner_->EnterSelf(); } - ~ScopedRecursiveCheck() { - warner_->Leave(); - } + ~ScopedRecursiveCheck() { warner_->Leave(); } private: ThreadCollisionWarner* warner_; diff --git a/include/base/cef_trace_event.h b/include/base/cef_trace_event.h index 20723fbb9..1b2cad014 100644 --- a/include/base/cef_trace_event.h +++ b/include/base/cef_trace_event.h @@ -160,32 +160,29 @@ // enabled, then this does nothing. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_EVENT0(category, name) \ +#define TRACE_EVENT0(category, name) \ cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \ CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) -#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ +#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \ CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) -#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val) \ - cef_trace_event_begin(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val, false); \ +#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false); \ CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) // Implementation detail: trace event macros create temporary variable names. // These macros give each temporary variable a unique name based on the line // number to prevent name collisions. -#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \ - cef_trace_event_unique_##a##b -#define CEF_INTERNAL_TRACE_EVENT_UID2(a,b) \ - CEF_INTERNAL_TRACE_EVENT_UID3(a,b) +#define CEF_INTERNAL_TRACE_EVENT_UID3(a, b) cef_trace_event_unique_##a##b +#define CEF_INTERNAL_TRACE_EVENT_UID2(a, b) CEF_INTERNAL_TRACE_EVENT_UID3(a, b) #define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \ CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) // Implementation detail: internal macro to end end event when the scope ends. -#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \ - cef_trace_event::CefTraceEndOnScopeClose \ - CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name) +#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \ + cef_trace_event::CefTraceEndOnScopeClose CEF_INTERNAL_TRACE_EVENT_UID( \ + profileScope)(category, name) // Records a single event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this @@ -196,18 +193,18 @@ cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false) #define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false) -#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, false) +#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) #define TRACE_EVENT_COPY_INSTANT0(category, name) \ cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true) #define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true) -#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ +#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, true) + arg2_val, true) // Records a single BEGIN event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this @@ -218,18 +215,18 @@ cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false) #define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false) -#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, false) +#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) #define TRACE_EVENT_COPY_BEGIN0(category, name) \ cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true) #define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true) -#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ +#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, true) + arg2_val, true) // Records a single END event for "name" immediately. If the category // is not enabled, then this does nothing. @@ -239,18 +236,18 @@ cef_trace_event_end(category, name, NULL, 0, NULL, 0, false) #define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false) -#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, false) +#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) #define TRACE_EVENT_COPY_END0(category, name) \ cef_trace_event_end(category, name, NULL, 0, NULL, 0, true) #define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true) -#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ - arg2_val, true) +#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) // Records the value of a counter called "name" immediately. Value // must be representable as a 32 bit integer. @@ -266,14 +263,14 @@ // values as a stacked-bar chart. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ +#define TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, \ + value2_val) \ + cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ + value2_val, false) +#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ - value2_val, false) -#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ - cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ - value2_val, true) + value2_val, true) // Records the value of a counter called "name" immediately. Value // must be representable as a 32 bit integer. @@ -298,14 +295,13 @@ // bits will be xored with a hash of the process ID so that the same pointer // on two different processes will not collide. #define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - cef_trace_counter_id(category, name, id, value1_name, value1_val, \ - value2_name, value2_val, false) -#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \ - value1_val, value2_name, value2_val) \ - cef_trace_counter_id(category, name, id, value1_name, value1_val, \ - value2_name, value2_val, true) - + value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, false) +#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, true) // Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this @@ -325,23 +321,22 @@ // args. #define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false) -#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ +#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ - 0, false) + 0, false) #define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val, false) + arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) #define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true) -#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, \ - arg1_val) \ - cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ - 0, true) -#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ + 0, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) // Records a single ASYNC_STEP_INTO event for |step| immediately. If the // category is not enabled, then this does nothing. The |name| and |id| must @@ -351,16 +346,16 @@ // ASYNC_STEP_PAST events. #define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \ cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false) -#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \ - arg1_name, arg1_val) \ - cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ - arg1_val, false) +#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \ + arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, false) #define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \ cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true) -#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \ - arg1_name, arg1_val) \ - cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ - arg1_val, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, \ + arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, true) // Records a single ASYNC_STEP_PAST event for |step| immediately. If the // category is not enabled, then this does nothing. The |name| and |id| must @@ -370,38 +365,37 @@ // ASYNC_STEP_INTO events. #define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \ cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false) -#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \ - arg1_name, arg1_val) \ - cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ - arg1_val, false) +#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \ + arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, false) #define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \ cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true) -#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \ - arg1_name, arg1_val) \ - cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ - arg1_val, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, \ + arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, true) // Records a single ASYNC_END event for "name" immediately. If the category // is not enabled, then this does nothing. #define TRACE_EVENT_ASYNC_END0(category, name, id) \ cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false) -#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ +#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ - false) + false) #define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val, false) + arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) #define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true) -#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \ - arg1_val) \ +#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ - true) -#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val, true) + true) +#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) namespace cef_trace_event { @@ -409,8 +403,7 @@ namespace cef_trace_event { class CefTraceEndOnScopeClose { public: CefTraceEndOnScopeClose(const char* category, const char* name) - : category_(category), name_(name) { - } + : category_(category), name_(name) {} ~CefTraceEndOnScopeClose() { cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false); } diff --git a/include/base/cef_tuple.h b/include/base/cef_tuple.h index 2268792dd..aeb6e9cea 100644 --- a/include/base/cef_tuple.h +++ b/include/base/cef_tuple.h @@ -96,7 +96,7 @@ struct TupleTraits { }; template -struct TupleTypes { }; +struct TupleTypes {}; // Tuple ----------------------------------------------------------------------- // @@ -138,8 +138,7 @@ struct Tuple2 { Tuple2() {} Tuple2(typename TupleTraits::ParamType a, typename TupleTraits::ParamType b) - : a(a), b(b) { - } + : a(a), b(b) {} A a; B b; @@ -156,8 +155,7 @@ struct Tuple3 { Tuple3(typename TupleTraits::ParamType a, typename TupleTraits::ParamType b, typename TupleTraits::ParamType c) - : a(a), b(b), c(c){ - } + : a(a), b(b), c(c) {} A a; B b; @@ -177,8 +175,7 @@ struct Tuple4 { typename TupleTraits::ParamType b, typename TupleTraits::ParamType c, typename TupleTraits::ParamType d) - : a(a), b(b), c(c), d(d) { - } + : a(a), b(b), c(c), d(d) {} A a; B b; @@ -197,12 +194,11 @@ struct Tuple5 { Tuple5() {} Tuple5(typename TupleTraits::ParamType a, - typename TupleTraits::ParamType b, - typename TupleTraits::ParamType c, - typename TupleTraits::ParamType d, - typename TupleTraits::ParamType e) - : a(a), b(b), c(c), d(d), e(e) { - } + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e) + : a(a), b(b), c(c), d(d), e(e) {} A a; B b; @@ -223,13 +219,12 @@ struct Tuple6 { Tuple6() {} Tuple6(typename TupleTraits::ParamType a, - typename TupleTraits::ParamType b, - typename TupleTraits::ParamType c, - typename TupleTraits::ParamType d, - typename TupleTraits::ParamType e, - typename TupleTraits::ParamType f) - : a(a), b(b), c(c), d(d), e(e), f(f) { - } + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f) + : a(a), b(b), c(c), d(d), e(e), f(f) {} A a; B b; @@ -252,14 +247,13 @@ struct Tuple7 { Tuple7() {} Tuple7(typename TupleTraits::ParamType a, - typename TupleTraits::ParamType b, - typename TupleTraits::ParamType c, - typename TupleTraits::ParamType d, - typename TupleTraits::ParamType e, - typename TupleTraits::ParamType f, - typename TupleTraits::ParamType g) - : a(a), b(b), c(c), d(d), e(e), f(f), g(g) { - } + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g) {} A a; B b; @@ -270,7 +264,13 @@ struct Tuple7 { G g; }; -template struct Tuple8 { public: @@ -285,15 +285,14 @@ struct Tuple8 { Tuple8() {} Tuple8(typename TupleTraits::ParamType a, - typename TupleTraits::ParamType b, - typename TupleTraits::ParamType c, - typename TupleTraits::ParamType d, - typename TupleTraits::ParamType e, - typename TupleTraits::ParamType f, - typename TupleTraits::ParamType g, - typename TupleTraits::ParamType h) - : a(a), b(b), c(c), d(d), e(e), f(f), g(g), h(h) { - } + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g, + typename TupleTraits::ParamType h) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g), h(h) {} A a; B b; @@ -311,127 +310,151 @@ struct Tuple8 { // definitions of class types the tuple takes as parameters. template <> -struct TupleTypes< Tuple0 > { +struct TupleTypes { typedef Tuple0 ValueTuple; typedef Tuple0 RefTuple; typedef Tuple0 ParamTuple; }; template -struct TupleTypes< Tuple1 > { +struct TupleTypes> { typedef Tuple1::ValueType> ValueTuple; typedef Tuple1::RefType> RefTuple; typedef Tuple1::ParamType> ParamTuple; }; template -struct TupleTypes< Tuple2 > { +struct TupleTypes> { typedef Tuple2::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple2::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple2::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple2::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; template -struct TupleTypes< Tuple3 > { +struct TupleTypes> { typedef Tuple3::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple3::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple3::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple3::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; template -struct TupleTypes< Tuple4 > { +struct TupleTypes> { typedef Tuple4::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple4::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple4::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple4::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; template -struct TupleTypes< Tuple5 > { +struct TupleTypes> { typedef Tuple5::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple5::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple5::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple5::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; template -struct TupleTypes< Tuple6 > { +struct TupleTypes> { typedef Tuple6::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple6::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple6::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple6::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; template -struct TupleTypes< Tuple7 > { +struct TupleTypes> { typedef Tuple7::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple7::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple7::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple7::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; -template -struct TupleTypes< Tuple8 > { +struct TupleTypes> { typedef Tuple8::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, @@ -439,15 +462,17 @@ struct TupleTypes< Tuple8 > { typename TupleTraits::ValueType, typename TupleTraits::ValueType, typename TupleTraits::ValueType, - typename TupleTraits::ValueType> ValueTuple; -typedef Tuple8::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType, - typename TupleTraits::RefType> RefTuple; + typename TupleTraits::ValueType> + ValueTuple; + typedef Tuple8::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> + RefTuple; typedef Tuple8::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, @@ -455,7 +480,8 @@ typedef Tuple8::RefType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, typename TupleTraits::ParamType, - typename TupleTraits::ParamType> ParamTuple; + typename TupleTraits::ParamType> + ParamTuple; }; // Tuple creators ------------------------------------------------------------- @@ -483,36 +509,59 @@ inline Tuple3 MakeTuple(const A& a, const B& b, const C& c) { } template -inline Tuple4 MakeTuple(const A& a, const B& b, const C& c, +inline Tuple4 MakeTuple(const A& a, + const B& b, + const C& c, const D& d) { return Tuple4(a, b, c, d); } template -inline Tuple5 MakeTuple(const A& a, const B& b, const C& c, - const D& d, const E& e) { +inline Tuple5 MakeTuple(const A& a, + const B& b, + const C& c, + const D& d, + const E& e) { return Tuple5(a, b, c, d, e); } template -inline Tuple6 MakeTuple(const A& a, const B& b, const C& c, - const D& d, const E& e, const F& f) { +inline Tuple6 MakeTuple(const A& a, + const B& b, + const C& c, + const D& d, + const E& e, + const F& f) { return Tuple6(a, b, c, d, e, f); } template -inline Tuple7 MakeTuple(const A& a, const B& b, const C& c, - const D& d, const E& e, const F& f, +inline Tuple7 MakeTuple(const A& a, + const B& b, + const C& c, + const D& d, + const E& e, + const F& f, const G& g) { return Tuple7(a, b, c, d, e, f, g); } -template -inline Tuple8 MakeTuple(const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f, - const G& g, const H& h) { +inline Tuple8 MakeTuple(const A& a, + const B& b, + const C& c, + const D& d, + const E& e, + const F& f, + const G& g, + const H& h) { return Tuple8(a, b, c, d, e, f, g, h); } @@ -545,22 +594,31 @@ inline Tuple5 MakeRefTuple(A& a, B& b, C& c, D& d, E& e) { } template -inline Tuple6 MakeRefTuple(A& a, B& b, C& c, D& d, E& e, +inline Tuple6 MakeRefTuple(A& a, + B& b, + C& c, + D& d, + E& e, F& f) { return Tuple6(a, b, c, d, e, f); } template -inline Tuple7 MakeRefTuple(A& a, B& b, C& c, D& d, - E& e, F& f, G& g) { +inline Tuple7 +MakeRefTuple(A& a, B& b, C& c, D& d, E& e, F& f, G& g) { return Tuple7(a, b, c, d, e, f, g); } -template -inline Tuple8 MakeRefTuple(A& a, B& b, C& c, - D& d, E& e, F& f, - G& g, H& h) { +inline Tuple8 +MakeRefTuple(A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h) { return Tuple8(a, b, c, d, e, f, g, h); } @@ -590,7 +648,7 @@ inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); } -template +template inline void DispatchToMethod(ObjT* obj, Method method, const Tuple2& arg) { @@ -598,16 +656,18 @@ inline void DispatchToMethod(ObjT* obj, base::cef_internal::UnwrapTraits::Unwrap(arg.b)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), @@ -615,8 +675,9 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(arg.d)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), @@ -625,9 +686,16 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(arg.e)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), @@ -637,9 +705,17 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(arg.f)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple7& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), @@ -650,9 +726,18 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(arg.g)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple8& arg) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), @@ -681,20 +766,20 @@ inline void DispatchToFunction(Function function, const Tuple1& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); } -template +template inline void DispatchToFunction(Function function, const Tuple2& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b)); } -template +template inline void DispatchToFunction(Function function, const Tuple3& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c)); } -template +template inline void DispatchToFunction(Function function, const Tuple4& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), @@ -703,7 +788,7 @@ inline void DispatchToFunction(Function function, base::cef_internal::UnwrapTraits::Unwrap(arg.d)); } -template +template inline void DispatchToFunction(Function function, const Tuple5& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), @@ -713,7 +798,7 @@ inline void DispatchToFunction(Function function, base::cef_internal::UnwrapTraits::Unwrap(arg.e)); } -template +template inline void DispatchToFunction(Function function, const Tuple6& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), @@ -724,8 +809,14 @@ inline void DispatchToFunction(Function function, base::cef_internal::UnwrapTraits::Unwrap(arg.f)); } -template +template inline void DispatchToFunction(Function function, const Tuple7& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), @@ -737,8 +828,15 @@ inline void DispatchToFunction(Function function, base::cef_internal::UnwrapTraits::Unwrap(arg.g)); } -template +template inline void DispatchToFunction(Function function, const Tuple8& arg) { (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), @@ -756,7 +854,8 @@ inline void DispatchToFunction(Function function, template inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple0& arg, Tuple0*) { + const Tuple0& arg, + Tuple0*) { (obj->*method)(); } @@ -768,38 +867,46 @@ inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) { template inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple1& arg, Tuple0*) { + const Tuple1& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); } -template +template inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple2& arg, Tuple0*) { + const Tuple2& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple3& arg, Tuple0*) { +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple3& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple4& arg, Tuple0*) { +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple4& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c), base::cef_internal::UnwrapTraits::Unwrap(arg.d)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple5& arg, Tuple0*) { +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple5& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c), @@ -807,10 +914,18 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(arg.e)); } -template -inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple6& arg, Tuple0*) { +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple6& arg, + Tuple0*) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), base::cef_internal::UnwrapTraits::Unwrap(arg.b), base::cef_internal::UnwrapTraits::Unwrap(arg.c), @@ -821,80 +936,96 @@ inline void DispatchToMethod(ObjT* obj, Method method, // Dispatchers with 1 out param. -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple0& in, Tuple1* out) { (obj->*method)(&out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const InA& in, Tuple1* out) { (obj->*method)(in, &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple1& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple2& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - base::cef_internal::UnwrapTraits::Unwrap(in.b), - &out->a); + base::cef_internal::UnwrapTraits::Unwrap(in.b), &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), - base::cef_internal::UnwrapTraits::Unwrap(in.c), - &out->a); + base::cef_internal::UnwrapTraits::Unwrap(in.c), &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), - base::cef_internal::UnwrapTraits::Unwrap(in.d), - &out->a); + base::cef_internal::UnwrapTraits::Unwrap(in.d), &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), - base::cef_internal::UnwrapTraits::Unwrap(in.e), - &out->a); + base::cef_internal::UnwrapTraits::Unwrap(in.e), &out->a); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& in, Tuple1* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), @@ -902,92 +1033,120 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), base::cef_internal::UnwrapTraits::Unwrap(in.e), - base::cef_internal::UnwrapTraits::Unwrap(in.f), - &out->a); + base::cef_internal::UnwrapTraits::Unwrap(in.f), &out->a); } // Dispatchers with 2 out params. -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple0& in, Tuple2* out) { (obj->*method)(&out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const InA& in, Tuple2* out) { (obj->*method)(in, &out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple1& in, Tuple2* out) { - (obj->*method)( - base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, &out->b); -} - -template -inline void DispatchToMethod(ObjT* obj, Method method, - const Tuple2& in, - Tuple2* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - base::cef_internal::UnwrapTraits::Unwrap(in.b), - &out->a, + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple2& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& in, Tuple2* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), - base::cef_internal::UnwrapTraits::Unwrap(in.c), - &out->a, + base::cef_internal::UnwrapTraits::Unwrap(in.c), &out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& in, Tuple2* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), - base::cef_internal::UnwrapTraits::Unwrap(in.d), - &out->a, + base::cef_internal::UnwrapTraits::Unwrap(in.d), &out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& in, Tuple2* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), - base::cef_internal::UnwrapTraits::Unwrap(in.e), - &out->a, + base::cef_internal::UnwrapTraits::Unwrap(in.e), &out->a, &out->b); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& in, Tuple2* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), @@ -995,99 +1154,136 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), base::cef_internal::UnwrapTraits::Unwrap(in.e), - base::cef_internal::UnwrapTraits::Unwrap(in.f), - &out->a, + base::cef_internal::UnwrapTraits::Unwrap(in.f), &out->a, &out->b); } // Dispatchers with 3 out params. -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple0& in, Tuple3* out) { (obj->*method)(&out->a, &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const InA& in, Tuple3* out) { (obj->*method)(in, &out->a, &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple1& in, Tuple3* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - &out->a, - &out->b, - &out->c); + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, + &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple2& in, Tuple3* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - base::cef_internal::UnwrapTraits::Unwrap(in.b), - &out->a, - &out->b, - &out->c); + base::cef_internal::UnwrapTraits::Unwrap(in.b), &out->a, + &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& in, Tuple3* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), - base::cef_internal::UnwrapTraits::Unwrap(in.c), - &out->a, - &out->b, - &out->c); + base::cef_internal::UnwrapTraits::Unwrap(in.c), &out->a, + &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& in, Tuple3* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), - base::cef_internal::UnwrapTraits::Unwrap(in.d), - &out->a, - &out->b, - &out->c); + base::cef_internal::UnwrapTraits::Unwrap(in.d), &out->a, + &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& in, Tuple3* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), - base::cef_internal::UnwrapTraits::Unwrap(in.e), - &out->a, - &out->b, - &out->c); + base::cef_internal::UnwrapTraits::Unwrap(in.e), &out->a, + &out->b, &out->c); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& in, Tuple3* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), @@ -1095,109 +1291,149 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), base::cef_internal::UnwrapTraits::Unwrap(in.e), - base::cef_internal::UnwrapTraits::Unwrap(in.f), - &out->a, - &out->b, - &out->c); + base::cef_internal::UnwrapTraits::Unwrap(in.f), &out->a, + &out->b, &out->c); } // Dispatchers with 4 out params. -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple0& in, Tuple4* out) { (obj->*method)(&out->a, &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const InA& in, Tuple4* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), - &out->a, - &out->b, - &out->c, - &out->d); + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple1& in, Tuple4* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - &out->a, - &out->b, - &out->c, - &out->d); + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple2& in, Tuple4* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - base::cef_internal::UnwrapTraits::Unwrap(in.b), - &out->a, - &out->b, - &out->c, - &out->d); + base::cef_internal::UnwrapTraits::Unwrap(in.b), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& in, Tuple4* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), - base::cef_internal::UnwrapTraits::Unwrap(in.c), - &out->a, - &out->b, - &out->c, - &out->d); + base::cef_internal::UnwrapTraits::Unwrap(in.c), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& in, Tuple4* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), - base::cef_internal::UnwrapTraits::Unwrap(in.d), - &out->a, - &out->b, - &out->c, - &out->d); + base::cef_internal::UnwrapTraits::Unwrap(in.d), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& in, Tuple4* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), - base::cef_internal::UnwrapTraits::Unwrap(in.e), - &out->a, - &out->b, - &out->c, - &out->d); + base::cef_internal::UnwrapTraits::Unwrap(in.e), &out->a, + &out->b, &out->c, &out->d); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& in, Tuple4* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), @@ -1205,116 +1441,157 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), base::cef_internal::UnwrapTraits::Unwrap(in.e), - base::cef_internal::UnwrapTraits::Unwrap(in.f), - &out->a, - &out->b, - &out->c, - &out->d); + base::cef_internal::UnwrapTraits::Unwrap(in.f), &out->a, + &out->b, &out->c, &out->d); } // Dispatchers with 5 out params. -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple0& in, Tuple5* out) { (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const InA& in, Tuple5* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple1& in, Tuple5* out) { - (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple2& in, Tuple5* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), - base::cef_internal::UnwrapTraits::Unwrap(in.b), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + base::cef_internal::UnwrapTraits::Unwrap(in.b), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple3& in, Tuple5* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), - base::cef_internal::UnwrapTraits::Unwrap(in.c), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + base::cef_internal::UnwrapTraits::Unwrap(in.c), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple4& in, Tuple5* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), - base::cef_internal::UnwrapTraits::Unwrap(in.d), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + base::cef_internal::UnwrapTraits::Unwrap(in.d), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple5& in, Tuple5* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), base::cef_internal::UnwrapTraits::Unwrap(in.b), base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), - base::cef_internal::UnwrapTraits::Unwrap(in.e), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + base::cef_internal::UnwrapTraits::Unwrap(in.e), &out->a, + &out->b, &out->c, &out->d, &out->e); } -template -inline void DispatchToMethod(ObjT* obj, Method method, +template +inline void DispatchToMethod(ObjT* obj, + Method method, const Tuple6& in, Tuple5* out) { (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), @@ -1322,16 +1599,12 @@ inline void DispatchToMethod(ObjT* obj, Method method, base::cef_internal::UnwrapTraits::Unwrap(in.c), base::cef_internal::UnwrapTraits::Unwrap(in.d), base::cef_internal::UnwrapTraits::Unwrap(in.e), - base::cef_internal::UnwrapTraits::Unwrap(in.f), - &out->a, - &out->b, - &out->c, - &out->d, - &out->e); + base::cef_internal::UnwrapTraits::Unwrap(in.f), &out->a, + &out->b, &out->c, &out->d, &out->e); } } // namespace base -#endif // !USING_CHROMIUM_INCLUDES +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_ diff --git a/include/base/cef_weak_ptr.h b/include/base/cef_weak_ptr.h index 217f12cf5..1ba34b9db 100644 --- a/include/base/cef_weak_ptr.h +++ b/include/base/cef_weak_ptr.h @@ -117,8 +117,10 @@ namespace base { -template class SupportsWeakPtr; -template class WeakPtr; +template +class SupportsWeakPtr; +template +class WeakPtr; namespace cef_internal { // These classes are part of the WeakPtr implementation. @@ -164,9 +166,7 @@ class WeakReferenceOwner { WeakReference GetRef() const; - bool HasRefs() const { - return flag_.get() && !flag_->HasOneRef(); - } + bool HasRefs() const { return flag_.get() && !flag_->HasOneRef(); } void Invalidate(); @@ -198,10 +198,10 @@ class SupportsWeakPtrBase { // conversion will only compile if there is exists a Base which inherits // from SupportsWeakPtr. See base::AsWeakPtr() below for a helper // function that makes calling this easier. - template + template static WeakPtr StaticAsWeakPtr(Derived* t) { - typedef - is_convertible convertible; + typedef is_convertible + convertible; COMPILE_ASSERT(convertible::value, AsWeakPtr_argument_inherits_from_SupportsWeakPtr); return AsWeakPtrImpl(t, *t); @@ -212,8 +212,8 @@ class SupportsWeakPtrBase { // which is an instance of SupportsWeakPtr. We can then safely // static_cast the Base* to a Derived*. template - static WeakPtr AsWeakPtrImpl( - Derived* t, const SupportsWeakPtr&) { + static WeakPtr AsWeakPtrImpl(Derived* t, + const SupportsWeakPtr&) { WeakPtr ptr = t->Base::AsWeakPtr(); return WeakPtr(ptr.ref_, static_cast(ptr.ptr_)); } @@ -221,7 +221,8 @@ class SupportsWeakPtrBase { } // namespace cef_internal -template class WeakPtrFactory; +template +class WeakPtrFactory; // The WeakPtr class holds a weak reference to |T*|. // @@ -239,14 +240,12 @@ template class WeakPtrFactory; template class WeakPtr : public cef_internal::WeakPtrBase { public: - WeakPtr() : ptr_(NULL) { - } + WeakPtr() : ptr_(NULL) {} // Allow conversion from U to T provided U "is a" T. Note that this // is separate from the (implicit) copy constructor. template - WeakPtr(const WeakPtr& other) : WeakPtrBase(other), ptr_(other.ptr_) { - } + WeakPtr(const WeakPtr& other) : WeakPtrBase(other), ptr_(other.ptr_) {} T* get() const { return ref_.is_valid() ? ptr_ : NULL; } @@ -280,18 +279,19 @@ class WeakPtr : public cef_internal::WeakPtrBase { private: // Explicitly declare comparison operators as required by the bool // trick, but keep them private. - template bool operator==(WeakPtr const&) const; - template bool operator!=(WeakPtr const&) const; + template + bool operator==(WeakPtr const&) const; + template + bool operator!=(WeakPtr const&) const; friend class cef_internal::SupportsWeakPtrBase; - template friend class WeakPtr; + template + friend class WeakPtr; friend class SupportsWeakPtr; friend class WeakPtrFactory; WeakPtr(const cef_internal::WeakReference& ref, T* ptr) - : WeakPtrBase(ref), - ptr_(ptr) { - } + : WeakPtrBase(ref), ptr_(ptr) {} // This pointer is only valid when ref_.is_valid() is true. Otherwise, its // value is undefined (as opposed to NULL). @@ -306,12 +306,9 @@ class WeakPtr : public cef_internal::WeakPtrBase { template class WeakPtrFactory { public: - explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { - } + explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {} - ~WeakPtrFactory() { - ptr_ = NULL; - } + ~WeakPtrFactory() { ptr_ = NULL; } WeakPtr GetWeakPtr() { DCHECK(ptr_); diff --git a/include/base/internal/cef_atomicops_arm_gcc.h b/include/base/internal/cef_atomicops_arm_gcc.h index c228b6af0..2e39ce3c2 100644 --- a/include/base/internal/cef_atomicops_arm_gcc.h +++ b/include/base/internal/cef_atomicops_arm_gcc.h @@ -85,9 +85,9 @@ inline void MemoryBarrier() { // variant of the target architecture is being used. This tests against // any known ARMv6 or ARMv7 variant, where it is possible to directly // use ldrex/strex instructions to implement fast atomic operations. -#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \ - defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ + defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \ defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) @@ -103,16 +103,17 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, // reloop = 0 // if (prev_value != old_value) // reloop = STREX(ptr, new_value) - __asm__ __volatile__(" ldrex %0, [%3]\n" - " mov %1, #0\n" - " cmp %0, %4\n" + __asm__ __volatile__( + " ldrex %0, [%3]\n" + " mov %1, #0\n" + " cmp %0, %4\n" #ifdef __thumb2__ - " it eq\n" + " it eq\n" #endif - " strexeq %1, %5, [%3]\n" - : "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr) - : "r"(ptr), "r"(old_value), "r"(new_value) - : "cc", "memory"); + " strexeq %1, %5, [%3]\n" + : "=&r"(prev_value), "=&r"(reloop), "+m"(*ptr) + : "r"(ptr), "r"(old_value), "r"(new_value) + : "cc", "memory"); } while (reloop != 0); return prev_value; } @@ -143,12 +144,13 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, // value += increment // reloop = STREX(ptr, value) // - __asm__ __volatile__(" ldrex %0, [%3]\n" - " add %0, %0, %4\n" - " strex %1, %0, [%3]\n" - : "=&r"(value), "=&r"(reloop), "+m"(*ptr) - : "r"(ptr), "r"(increment) - : "cc", "memory"); + __asm__ __volatile__( + " ldrex %0, [%3]\n" + " add %0, %0, %4\n" + " strex %1, %0, [%3]\n" + : "=&r"(value), "=&r"(reloop), "+m"(*ptr) + : "r"(ptr), "r"(increment) + : "cc", "memory"); } while (reloop); return value; } @@ -171,18 +173,19 @@ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, do { // old_value = LDREX(ptr) // reloop = STREX(ptr, new_value) - __asm__ __volatile__(" ldrex %0, [%3]\n" - " strex %1, %4, [%3]\n" - : "=&r"(old_value), "=&r"(reloop), "+m"(*ptr) - : "r"(ptr), "r"(new_value) - : "cc", "memory"); + __asm__ __volatile__( + " ldrex %0, [%3]\n" + " strex %1, %4, [%3]\n" + : "=&r"(old_value), "=&r"(reloop), "+m"(*ptr) + : "r"(ptr), "r"(new_value) + : "cc", "memory"); } while (reloop != 0); return old_value; } // This tests against any known ARMv5 variant. #elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ - defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) + defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) // The kernel also provides a helper function to perform an atomic // compare-and-swap operation at the hard-wired address 0xffff0fc0. @@ -281,7 +284,7 @@ inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, } #else -# error "Your CPU's ARM architecture is not supported yet" +#error "Your CPU's ARM architecture is not supported yet" #endif // NOTE: Atomicity of the following load and store operations is only @@ -301,7 +304,9 @@ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { *ptr = value; } -inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { return *ptr; } +inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { + return *ptr; +} inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { Atomic32 value = *ptr; diff --git a/include/base/internal/cef_atomicops_atomicword_compat.h b/include/base/internal/cef_atomicops_atomicword_compat.h index 985f0f9b9..f905de85f 100644 --- a/include/base/internal/cef_atomicops_atomicword_compat.h +++ b/include/base/internal/cef_atomicops_atomicword_compat.h @@ -52,26 +52,26 @@ namespace subtle { inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr, AtomicWord old_value, AtomicWord new_value) { - return NoBarrier_CompareAndSwap( - reinterpret_cast(ptr), old_value, new_value); + return NoBarrier_CompareAndSwap(reinterpret_cast(ptr), + old_value, new_value); } inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr, AtomicWord new_value) { - return NoBarrier_AtomicExchange( - reinterpret_cast(ptr), new_value); + return NoBarrier_AtomicExchange(reinterpret_cast(ptr), + new_value); } inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr, AtomicWord increment) { - return NoBarrier_AtomicIncrement( - reinterpret_cast(ptr), increment); + return NoBarrier_AtomicIncrement(reinterpret_cast(ptr), + increment); } inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr, AtomicWord increment) { - return Barrier_AtomicIncrement( - reinterpret_cast(ptr), increment); + return Barrier_AtomicIncrement(reinterpret_cast(ptr), + increment); } inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr, @@ -88,24 +88,22 @@ inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr, reinterpret_cast(ptr), old_value, new_value); } -inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) { - NoBarrier_Store( - reinterpret_cast(ptr), value); +inline void NoBarrier_Store(volatile AtomicWord* ptr, AtomicWord value) { + NoBarrier_Store(reinterpret_cast(ptr), value); } inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) { - return base::subtle::Acquire_Store( - reinterpret_cast(ptr), value); + return base::subtle::Acquire_Store(reinterpret_cast(ptr), + value); } inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) { - return base::subtle::Release_Store( - reinterpret_cast(ptr), value); + return base::subtle::Release_Store(reinterpret_cast(ptr), + value); } -inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) { - return NoBarrier_Load( - reinterpret_cast(ptr)); +inline AtomicWord NoBarrier_Load(volatile const AtomicWord* ptr) { + return NoBarrier_Load(reinterpret_cast(ptr)); } inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) { @@ -118,8 +116,8 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) { reinterpret_cast(ptr)); } -} // namespace base::subtle -} // namespace base +} // namespace base::subtle +} // namespace base #endif // !defined(ARCH_CPU_64_BITS) diff --git a/include/base/internal/cef_atomicops_mac.h b/include/base/internal/cef_atomicops_mac.h index 9f268dd67..374ae35d6 100644 --- a/include/base/internal/cef_atomicops_mac.h +++ b/include/base/internal/cef_atomicops_mac.h @@ -170,7 +170,7 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, Atomic64 prev_value; do { if (OSAtomicCompareAndSwap64Barrier( - old_value, new_value, reinterpret_cast(ptr))) { + old_value, new_value, reinterpret_cast(ptr))) { return old_value; } prev_value = *ptr; @@ -217,7 +217,7 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) { #endif // defined(__LP64__) -} // namespace base::subtle -} // namespace base +} // namespace base::subtle +} // namespace base #endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_ diff --git a/include/base/internal/cef_atomicops_x86_gcc.h b/include/base/internal/cef_atomicops_x86_gcc.h index 0e2139d95..b93df21b0 100644 --- a/include/base/internal/cef_atomicops_x86_gcc.h +++ b/include/base/internal/cef_atomicops_x86_gcc.h @@ -38,11 +38,10 @@ // Features of this x86. Values may not be correct before main() is run, // but are set conservatively. struct AtomicOps_x86CPUFeatureStruct { - bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence - // after acquire compare-and-swap. + bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence + // after acquire compare-and-swap. }; -extern struct AtomicOps_x86CPUFeatureStruct - AtomicOps_Internalx86CPUFeatures; +extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures; #define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory") @@ -56,8 +55,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, Atomic32 new_value) { Atomic32 prev; __asm__ __volatile__("lock; cmpxchgl %1,%2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) + : "=a"(prev) + : "q"(new_value), "m"(*ptr), "0"(old_value) : "memory"); return prev; } @@ -65,8 +64,8 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value) { __asm__ __volatile__("xchgl %1,%0" // The lock prefix is implicit for xchg. - : "=r" (new_value) - : "m" (*ptr), "0" (new_value) + : "=r"(new_value) + : "m"(*ptr), "0"(new_value) : "memory"); return new_value; // Now it's the previous value. } @@ -75,8 +74,9 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment) { Atomic32 temp = increment; __asm__ __volatile__("lock; xaddl %0,%1" - : "+r" (temp), "+m" (*ptr) - : : "memory"); + : "+r"(temp), "+m"(*ptr) + : + : "memory"); // temp now holds the old value of *ptr return temp + increment; } @@ -85,8 +85,9 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment) { Atomic32 temp = increment; __asm__ __volatile__("lock; xaddl %0,%1" - : "+r" (temp), "+m" (*ptr) - : : "memory"); + : "+r"(temp), "+m"(*ptr) + : + : "memory"); // temp now holds the old value of *ptr if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) { __asm__ __volatile__("lfence" : : : "memory"); @@ -125,7 +126,7 @@ inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { ATOMICOPS_COMPILER_BARRIER(); - *ptr = value; // An x86 store acts as a release barrier. + *ptr = value; // An x86 store acts as a release barrier. // See comments in Atomic64 version of Release_Store(), below. } @@ -134,7 +135,7 @@ inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { } inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { - Atomic32 value = *ptr; // An x86 load acts as a acquire barrier. + Atomic32 value = *ptr; // An x86 load acts as a acquire barrier. // See comments in Atomic64 version of Release_Store(), below. ATOMICOPS_COMPILER_BARRIER(); return value; @@ -154,8 +155,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, Atomic64 new_value) { Atomic64 prev; __asm__ __volatile__("lock; cmpxchgq %1,%2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) + : "=a"(prev) + : "q"(new_value), "m"(*ptr), "0"(old_value) : "memory"); return prev; } @@ -163,8 +164,8 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value) { __asm__ __volatile__("xchgq %1,%0" // The lock prefix is implicit for xchg. - : "=r" (new_value) - : "m" (*ptr), "0" (new_value) + : "=r"(new_value) + : "m"(*ptr), "0"(new_value) : "memory"); return new_value; // Now it's the previous value. } @@ -173,8 +174,9 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { Atomic64 temp = increment; __asm__ __volatile__("lock; xaddq %0,%1" - : "+r" (temp), "+m" (*ptr) - : : "memory"); + : "+r"(temp), "+m"(*ptr) + : + : "memory"); // temp now contains the previous value of *ptr return temp + increment; } @@ -183,8 +185,9 @@ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { Atomic64 temp = increment; __asm__ __volatile__("lock; xaddq %0,%1" - : "+r" (temp), "+m" (*ptr) - : : "memory"); + : "+r"(temp), "+m"(*ptr) + : + : "memory"); // temp now contains the previous value of *ptr if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) { __asm__ __volatile__("lfence" : : : "memory"); @@ -204,9 +207,9 @@ inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { ATOMICOPS_COMPILER_BARRIER(); - *ptr = value; // An x86 store acts as a release barrier - // for current AMD/Intel chips as of Jan 2008. - // See also Acquire_Load(), below. + *ptr = value; // An x86 store acts as a release barrier + // for current AMD/Intel chips as of Jan 2008. + // See also Acquire_Load(), below. // When new chips come out, check: // IA-32 Intel Architecture Software Developer's Manual, Volume 3: @@ -227,9 +230,9 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { } inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { - Atomic64 value = *ptr; // An x86 load acts as a acquire barrier, - // for current AMD/Intel chips as of Jan 2008. - // See also Release_Store(), above. + Atomic64 value = *ptr; // An x86 load acts as a acquire barrier, + // for current AMD/Intel chips as of Jan 2008. + // See also Release_Store(), above. ATOMICOPS_COMPILER_BARRIER(); return value; } @@ -257,8 +260,8 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, #endif // defined(__x86_64__) -} // namespace base::subtle -} // namespace base +} // namespace base::subtle +} // namespace base #undef ATOMICOPS_COMPILER_BARRIER diff --git a/include/base/internal/cef_atomicops_x86_msvc.h b/include/base/internal/cef_atomicops_x86_msvc.h index 12bb0f468..a262c81f1 100644 --- a/include/base/internal/cef_atomicops_x86_msvc.h +++ b/include/base/internal/cef_atomicops_x86_msvc.h @@ -55,25 +55,23 @@ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value) { LONG result = _InterlockedCompareExchange( - reinterpret_cast(ptr), - static_cast(new_value), + reinterpret_cast(ptr), static_cast(new_value), static_cast(old_value)); return static_cast(result); } inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value) { - LONG result = _InterlockedExchange( - reinterpret_cast(ptr), - static_cast(new_value)); + LONG result = _InterlockedExchange(reinterpret_cast(ptr), + static_cast(new_value)); return static_cast(result); } inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment) { - return _InterlockedExchangeAdd( - reinterpret_cast(ptr), - static_cast(increment)) + increment; + return _InterlockedExchangeAdd(reinterpret_cast(ptr), + static_cast(increment)) + + increment; } inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, @@ -112,11 +110,11 @@ inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { NoBarrier_AtomicExchange(ptr, value); - // acts as a barrier in this implementation + // acts as a barrier in this implementation } inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { - *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 // See comments in Atomic64 version of Release_Store() below. } @@ -144,24 +142,24 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, Atomic64 old_value, Atomic64 new_value) { PVOID result = InterlockedCompareExchangePointer( - reinterpret_cast(ptr), - reinterpret_cast(new_value), reinterpret_cast(old_value)); + reinterpret_cast(ptr), + reinterpret_cast(new_value), reinterpret_cast(old_value)); return reinterpret_cast(result); } inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value) { - PVOID result = InterlockedExchangePointer( - reinterpret_cast(ptr), - reinterpret_cast(new_value)); + PVOID result = + InterlockedExchangePointer(reinterpret_cast(ptr), + reinterpret_cast(new_value)); return reinterpret_cast(result); } inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) { - return InterlockedExchangeAdd64( - reinterpret_cast(ptr), - static_cast(increment)) + increment; + return InterlockedExchangeAdd64(reinterpret_cast(ptr), + static_cast(increment)) + + increment; } inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, @@ -175,11 +173,11 @@ inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { NoBarrier_AtomicExchange(ptr, value); - // acts as a barrier in this implementation + // acts as a barrier in this implementation } inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { - *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 // When new chips come out, check: // IA-32 Intel Architecture Software Developer's Manual, Volume 3: @@ -215,7 +213,6 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, return NoBarrier_CompareAndSwap(ptr, old_value, new_value); } - #endif // defined(_WIN64) } // namespace base::subtle diff --git a/include/base/internal/cef_bind_internal.h b/include/base/internal/cef_bind_internal.h index a097978be..64eeb3f3b 100644 --- a/include/base/internal/cef_bind_internal.h +++ b/include/base/internal/cef_bind_internal.h @@ -125,17 +125,13 @@ class RunnableAdapter; // Function: Arity 0. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(); + typedef R(RunType)(); - explicit RunnableAdapter(R(*function)()) - : function_(function) { - } + explicit RunnableAdapter(R (*function)()) : function_(function) {} - R Run() { - return function_(); - } + R Run() { return function_(); } private: R (*function_)(); @@ -143,18 +139,14 @@ class RunnableAdapter { // Method: Arity 0. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(T*); + typedef R(RunType)(T*); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)()) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)()) : method_(method) {} - R Run(T* object) { - return (object->*method_)(); - } + R Run(T* object) { return (object->*method_)(); } private: R (T::*method_)(); @@ -162,18 +154,14 @@ class RunnableAdapter { // Const Method: Arity 0. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(const T*); + typedef R(RunType)(const T*); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)() const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)() const) : method_(method) {} - R Run(const T* object) { - return (object->*method_)(); - } + R Run(const T* object) { return (object->*method_)(); } private: R (T::*method_)() const; @@ -181,13 +169,11 @@ class RunnableAdapter { // Function: Arity 1. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1); + typedef R(RunType)(A1); - explicit RunnableAdapter(R(*function)(A1)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1)) : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1) { return function_(CallbackForward(a1)); @@ -199,14 +185,12 @@ class RunnableAdapter { // Method: Arity 1. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(T*, A1); + typedef R(RunType)(T*, A1); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1)) : method_(method) {} R Run(T* object, typename CallbackParamTraits::ForwardType a1) { return (object->*method_)(CallbackForward(a1)); @@ -218,14 +202,12 @@ class RunnableAdapter { // Const Method: Arity 1. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1); + typedef R(RunType)(const T*, A1); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1) const) : method_(method) {} R Run(const T* object, typename CallbackParamTraits::ForwardType a1) { return (object->*method_)(CallbackForward(a1)); @@ -237,16 +219,14 @@ class RunnableAdapter { // Function: Arity 2. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2); + typedef R(RunType)(A1, A2); - explicit RunnableAdapter(R(*function)(A1, A2)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2)) : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2) { + typename CallbackParamTraits::ForwardType a2) { return function_(CallbackForward(a1), CallbackForward(a2)); } @@ -256,17 +236,16 @@ class RunnableAdapter { // Method: Arity 2. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2); + typedef R(RunType)(T*, A1, A2); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2)) : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); } @@ -276,17 +255,16 @@ class RunnableAdapter { // Const Method: Arity 2. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2); + typedef R(RunType)(const T*, A1, A2); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2) const) : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); } @@ -296,19 +274,17 @@ class RunnableAdapter { // Function: Arity 3. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3); + typedef R(RunType)(A1, A2, A3); - explicit RunnableAdapter(R(*function)(A1, A2, A3)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2, A3)) : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { return function_(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3)); + CallbackForward(a3)); } private: @@ -317,20 +293,19 @@ class RunnableAdapter { // Method: Arity 3. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2, A3); + typedef R(RunType)(T*, A1, A2, A3); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3)) : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3)); + CallbackForward(a3)); } private: @@ -339,20 +314,20 @@ class RunnableAdapter { // Const Method: Arity 3. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2, A3); + typedef R(RunType)(const T*, A1, A2, A3); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3) const) + : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3)); + CallbackForward(a3)); } private: @@ -361,20 +336,19 @@ class RunnableAdapter { // Function: Arity 4. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4); + typedef R(RunType)(A1, A2, A3, A4); - explicit RunnableAdapter(R(*function)(A1, A2, A3, A4)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2, A3, A4)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { return function_(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4)); + CallbackForward(a3), CallbackForward(a4)); } private: @@ -382,23 +356,26 @@ class RunnableAdapter { }; // Method: Arity 4. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2, A3, A4); + typedef R(RunType)(T*, A1, A2, A3, A4); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4)) : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4)); + CallbackForward(a3), CallbackForward(a4)); } private: @@ -406,23 +383,27 @@ class RunnableAdapter { }; // Const Method: Arity 4. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2, A3, A4); + typedef R(RunType)(const T*, A1, A2, A3, A4); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4) const) + : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4)); + CallbackForward(a3), CallbackForward(a4)); } private: @@ -430,23 +411,27 @@ class RunnableAdapter { }; // Function: Arity 5. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5); + typedef R(RunType)(A1, A2, A3, A4, A5); - explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2, A3, A4, A5)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { return function_(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5)); } private: @@ -454,24 +439,30 @@ class RunnableAdapter { }; // Method: Arity 5. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2, A3, A4, A5); + typedef R(RunType)(T*, A1, A2, A3, A4, A5); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5)) + : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5)); } private: @@ -479,24 +470,30 @@ class RunnableAdapter { }; // Const Method: Arity 5. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2, A3, A4, A5); + typedef R(RunType)(const T*, A1, A2, A3, A4, A5); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5) const) + : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5)); } private: @@ -504,25 +501,29 @@ class RunnableAdapter { }; // Function: Arity 6. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6); + typedef R(RunType)(A1, A2, A3, A4, A5, A6); - explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2, A3, A4, A5, A6)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { return function_(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6)); } private: @@ -530,26 +531,32 @@ class RunnableAdapter { }; // Method: Arity 6. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6); + typedef R(RunType)(T*, A1, A2, A3, A4, A5, A6); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5, A6)) + : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6)); } private: @@ -557,26 +564,32 @@ class RunnableAdapter { }; // Const Method: Arity 6. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6); + typedef R(RunType)(const T*, A1, A2, A3, A4, A5, A6); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5, A6) const) + : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6)); } private: @@ -584,26 +597,32 @@ class RunnableAdapter { }; // Function: Arity 7. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); - explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) - : function_(function) { - } + explicit RunnableAdapter(R (*function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6, - typename CallbackParamTraits::ForwardType a7) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { return function_(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6), CallbackForward(a7)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } private: @@ -611,27 +630,35 @@ class RunnableAdapter { }; // Method: Arity 7. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); + typedef R(RunType)(T*, A1, A2, A3, A4, A5, A6, A7); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5, A6, A7)) + : method_(method) {} - R Run(T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6, - typename CallbackParamTraits::ForwardType a7) { + R Run(T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6), CallbackForward(a7)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } private: @@ -639,34 +666,41 @@ class RunnableAdapter { }; // Const Method: Arity 7. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); + typedef R(RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); typedef true_type IsMethod; - explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) - : method_(method) { - } + explicit RunnableAdapter(R (T::*method)(A1, A2, A3, A4, A5, A6, A7) const) + : method_(method) {} - R Run(const T* object, typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6, - typename CallbackParamTraits::ForwardType a7) { + R Run(const T* object, + typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { return (object->*method_)(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6), CallbackForward(a7)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } private: R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; }; - // FunctionTraits<> // // Breaks a function signature apart into typedefs for easier introspection. @@ -708,8 +742,12 @@ struct FunctionTraits { typedef A4 A4Type; }; -template +template struct FunctionTraits { typedef R ReturnType; typedef A1 A1Type; @@ -719,8 +757,13 @@ struct FunctionTraits { typedef A5 A5Type; }; -template +template struct FunctionTraits { typedef R ReturnType; typedef A1 A1Type; @@ -731,8 +774,14 @@ struct FunctionTraits { typedef A6 A6Type; }; -template +template struct FunctionTraits { typedef R ReturnType; typedef A1 A1Type; @@ -744,7 +793,6 @@ struct FunctionTraits { typedef A7 A7Type; }; - // ForceVoidReturn<> // // Set of templates that support forcing the function return type to void. @@ -776,25 +824,39 @@ struct ForceVoidReturn { typedef void(RunType)(A1, A2, A3, A4); }; -template +template struct ForceVoidReturn { typedef void(RunType)(A1, A2, A3, A4, A5); }; -template +template struct ForceVoidReturn { typedef void(RunType)(A1, A2, A3, A4, A5, A6); }; -template +template struct ForceVoidReturn { typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7); }; - // FunctorTraits<> // // See description at top of file. @@ -805,19 +867,18 @@ struct FunctorTraits { }; template -struct FunctorTraits > { +struct FunctorTraits> { typedef typename FunctorTraits::RunnableType RunnableType; - typedef typename ForceVoidReturn< - typename RunnableType::RunType>::RunType RunType; + typedef + typename ForceVoidReturn::RunType RunType; }; template -struct FunctorTraits > { +struct FunctorTraits> { typedef Callback RunnableType; typedef typename Callback::RunType RunType; }; - // MakeRunnable<> // // Converts a passed in functor to a RunnableType using type inference. @@ -828,19 +889,18 @@ typename FunctorTraits::RunnableType MakeRunnable(const T& t) { } template -typename FunctorTraits::RunnableType -MakeRunnable(const IgnoreResultHelper& t) { +typename FunctorTraits::RunnableType MakeRunnable( + const IgnoreResultHelper& t) { return MakeRunnable(t.functor_); } template -const typename FunctorTraits >::RunnableType& -MakeRunnable(const Callback& t) { +const typename FunctorTraits>::RunnableType& MakeRunnable( + const Callback& t) { DCHECK(!t.is_null()); return t; } - // InvokeHelper<> // // There are 3 logical InvokeHelper<> specializations: normal, void-return, @@ -858,45 +918,38 @@ MakeRunnable(const Callback& t) { // // WeakCalls similarly need special syntax that is applied to the first // argument to check if they should no-op themselves. -template struct InvokeHelper; template -struct InvokeHelper { - static ReturnType MakeItSo(Runnable runnable) { - return runnable.Run(); - } +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable) { return runnable.Run(); } }; template -struct InvokeHelper { - static void MakeItSo(Runnable runnable) { - runnable.Run(); - } +struct InvokeHelper { + static void MakeItSo(Runnable runnable) { runnable.Run(); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static ReturnType MakeItSo(Runnable runnable, A1 a1) { return runnable.Run(CallbackForward(a1)); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static void MakeItSo(Runnable runnable, A1 a1) { runnable.Run(CallbackForward(a1)); } }; template -struct InvokeHelper { +struct InvokeHelper { static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr) { if (!weak_ptr.get()) { return; @@ -905,25 +958,22 @@ struct InvokeHelper -struct InvokeHelper { +template +struct InvokeHelper { static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) { return runnable.Run(CallbackForward(a1), CallbackForward(a2)); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { runnable.Run(CallbackForward(a1), CallbackForward(a2)); } }; template -struct InvokeHelper { +struct InvokeHelper { static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2) { if (!weak_ptr.get()) { return; @@ -932,27 +982,27 @@ struct InvokeHelper -struct InvokeHelper { +template +struct InvokeHelper { static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { return runnable.Run(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3)); + CallbackForward(a3)); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3)); } }; template -struct InvokeHelper { +struct InvokeHelper { static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3) { if (!weak_ptr.get()) { return; @@ -961,147 +1011,223 @@ struct InvokeHelper -struct InvokeHelper { +template +struct InvokeHelper { static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { return runnable.Run(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4)); + CallbackForward(a3), CallbackForward(a4)); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4)); + CallbackForward(a4)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, - A4 a4) { +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, + BoundWeakPtr weak_ptr, + A2 a2, + A3 a3, + A4 a4) { if (!weak_ptr.get()) { return; } runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4)); + CallbackForward(a4)); } }; -template -struct InvokeHelper { - static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, - A5 a5) { +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, + A1 a1, + A2 a2, + A3 a3, + A4 a4, + A5 a5) { return runnable.Run(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5)); } }; -template -struct InvokeHelper { +template +struct InvokeHelper { static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a4), CallbackForward(a5)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, - A4 a4, A5 a5) { +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, + BoundWeakPtr weak_ptr, + A2 a2, + A3 a3, + A4 a4, + A5 a5) { if (!weak_ptr.get()) { return; } runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5)); + CallbackForward(a4), CallbackForward(a5)); } }; -template -struct InvokeHelper { - static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, - A5 a5, A6 a6) { +template +struct InvokeHelper { + static ReturnType + MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { return runnable.Run(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, - A6 a6) { +template +struct InvokeHelper { + static void + MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, - A4 a4, A5 a5, A6 a6) { +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, + BoundWeakPtr weak_ptr, + A2 a2, + A3 a3, + A4 a4, + A5 a5, + A6 a6) { if (!weak_ptr.get()) { return; } runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); } }; -template -struct InvokeHelper { - static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, - A5 a5, A6 a6, A7 a7) { +template +struct InvokeHelper { + static ReturnType + MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { return runnable.Run(CallbackForward(a1), CallbackForward(a2), - CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), - CallbackForward(a6), CallbackForward(a7)); + CallbackForward(a3), CallbackForward(a4), + CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, - A6 a6, A7 a7) { +template +struct InvokeHelper { + static void + MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), - CallbackForward(a7)); + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } }; -template -struct InvokeHelper { - static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, - A4 a4, A5 a5, A6 a6, A7 a7) { +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, + BoundWeakPtr weak_ptr, + A2 a2, + A3 a3, + A4 a4, + A5 a5, + A6 a6, + A7 a7) { if (!weak_ptr.get()) { return; } runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), - CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), - CallbackForward(a7)); + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); } }; @@ -1139,22 +1265,21 @@ struct Invoker<0, StorageType, R()> { // InvokeHelper<>::MakeItSo() call below. return InvokeHelper - ::MakeItSo(storage->runnable_); + typename StorageType::RunnableType, + void()>::MakeItSo(storage->runnable_); } }; // Arity 1 -> 1. -template +template struct Invoker<0, StorageType, R(X1)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1) { + typename CallbackParamTraits::ForwardType x1) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1162,14 +1287,15 @@ struct Invoker<0, StorageType, R(X1)> { // InvokeHelper<>::MakeItSo() call below. return InvokeHelper::ForwardType x1)> - ::MakeItSo(storage->runnable_, CallbackForward(x1)); + typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType + x1)>::MakeItSo(storage->runnable_, + CallbackForward(x1)); } }; // Arity 1 -> 0. -template +template struct Invoker<1, StorageType, R(X1)> { typedef R(RunType)(BindStateBase*); @@ -1186,24 +1312,24 @@ struct Invoker<1, StorageType, R(X1)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1)); } }; // Arity 2 -> 2. -template +template struct Invoker<0, StorageType, R(X1, X2)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1211,24 +1337,25 @@ struct Invoker<0, StorageType, R(X1, X2)> { // InvokeHelper<>::MakeItSo() call below. return InvokeHelper::ForwardType x1, - typename CallbackParamTraits::ForwardType x2)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2)); + typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType + x2)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2)); } }; // Arity 2 -> 1. -template +template struct Invoker<1, StorageType, R(X1, X2)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X2); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2) { + typename CallbackParamTraits::ForwardType x2) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1239,16 +1366,17 @@ struct Invoker<1, StorageType, R(X1, X2)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); return InvokeHelper::ForwardType x2)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x2)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2)); } }; // Arity 2 -> 0. -template +template struct Invoker<2, StorageType, R(X1, X2)> { typedef R(RunType)(BindStateBase*); @@ -1268,29 +1396,31 @@ struct Invoker<2, StorageType, R(X1, X2)> { typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2)); } }; // Arity 3 -> 3. -template +template struct Invoker<0, StorageType, R(X1, X2, X3)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2, X3); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1298,28 +1428,33 @@ struct Invoker<0, StorageType, R(X1, X2, X3)> { // InvokeHelper<>::MakeItSo() call below. return InvokeHelper::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3)); + typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType + x3)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3)); } }; // Arity 3 -> 2. -template +template struct Invoker<1, StorageType, R(X1, X2, X3)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X2, X3); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3) { + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1330,26 +1465,31 @@ struct Invoker<1, StorageType, R(X1, X2, X3)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); return InvokeHelper::ForwardType x2, - typename CallbackParamTraits::ForwardType x3)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType + x3)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3)); } }; // Arity 3 -> 1. -template +template struct Invoker<2, StorageType, R(X1, X2, X3)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X3); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x3) { + typename CallbackParamTraits::ForwardType x3) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1363,18 +1503,23 @@ struct Invoker<2, StorageType, R(X1, X2, X3)> { typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); return InvokeHelper::ForwardType x3)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x3)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3)); } }; // Arity 3 -> 0. -template +template struct Invoker<3, StorageType, R(X1, X2, X3)> { typedef R(RunType)(BindStateBase*); @@ -1397,32 +1542,36 @@ struct Invoker<3, StorageType, R(X1, X2, X3)> { typename Bound3UnwrapTraits::ForwardType x3 = Bound3UnwrapTraits::Unwrap(storage->p3_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2), + CallbackForward(x3)); } }; // Arity 4 -> 4. -template +template struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2, X3, X4); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1430,32 +1579,38 @@ struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { // InvokeHelper<>::MakeItSo() call below. return InvokeHelper::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4)); + typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType + x4)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3), + CallbackForward(x4)); } }; // Arity 4 -> 3. -template +template struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X2, X3, X4); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4) { + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1466,30 +1621,36 @@ struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); return InvokeHelper::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType + x4)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3), + CallbackForward(x4)); } }; // Arity 4 -> 2. -template +template struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X3, X4); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4) { + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1503,28 +1664,34 @@ struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); return InvokeHelper::ForwardType x3, - typename CallbackParamTraits::ForwardType x4)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType + x4)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3), + CallbackForward(x4)); } }; // Arity 4 -> 1. -template +template struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X4); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x4) { + typename CallbackParamTraits::ForwardType x4) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1541,20 +1708,26 @@ struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { typename Bound3UnwrapTraits::ForwardType x3 = Bound3UnwrapTraits::Unwrap(storage->p3_); return InvokeHelper::ForwardType x4)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x4)>::MakeItSo(storage->runnable_, + CallbackForward(x1), + CallbackForward(x2), + CallbackForward(x3), + CallbackForward(x4)); } }; // Arity 4 -> 0. -template +template struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { typedef R(RunType)(BindStateBase*); @@ -1580,72 +1753,81 @@ struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { typename Bound4UnwrapTraits::ForwardType x4 = Bound4UnwrapTraits::Unwrap(storage->p4_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2), + CallbackForward(x3), CallbackForward(x4)); } }; // Arity 5 -> 5. -template +template struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2, X3, X4, X5); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { StorageType* storage = static_cast(base); // 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. - return InvokeHelper::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType + x5)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); } }; // Arity 5 -> 4. -template +template struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X2, X3, X4, X5); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5) { + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1655,34 +1837,39 @@ struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); - return InvokeHelper::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType + x5)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); } }; // Arity 5 -> 3. -template +template struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X3, X4, X5); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5) { + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1695,32 +1882,37 @@ struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { Bound1UnwrapTraits::Unwrap(storage->p1_); typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); - return InvokeHelper::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType + x5)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); } }; // Arity 5 -> 2. -template +template struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X4, X5); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5) { + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1736,30 +1928,35 @@ struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { Bound2UnwrapTraits::Unwrap(storage->p2_); typename Bound3UnwrapTraits::ForwardType x3 = Bound3UnwrapTraits::Unwrap(storage->p3_); - return InvokeHelper::ForwardType x4, - typename CallbackParamTraits::ForwardType x5)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType + x5)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); } }; // Arity 5 -> 1. -template +template struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X5); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x5) { + typename CallbackParamTraits::ForwardType x5) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1778,22 +1975,27 @@ struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { Bound3UnwrapTraits::Unwrap(storage->p3_); typename Bound4UnwrapTraits::ForwardType x4 = Bound4UnwrapTraits::Unwrap(storage->p4_); - return InvokeHelper::ForwardType x5)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x5)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); } }; // Arity 5 -> 0. -template +template struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { typedef R(RunType)(BindStateBase*); @@ -1822,79 +2024,90 @@ struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { typename Bound5UnwrapTraits::ForwardType x5 = Bound5UnwrapTraits::Unwrap(storage->p5_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2), + CallbackForward(x3), CallbackForward(x4), CallbackForward(x5)); } }; // Arity 6 -> 6. -template +template struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // 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. - return InvokeHelper::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 5. -template +template struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X2, X3, X4, X5, X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1904,38 +2117,44 @@ struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); - return InvokeHelper::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 4. -template +template struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X3, X4, X5, X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1948,36 +2167,42 @@ struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { Bound1UnwrapTraits::Unwrap(storage->p1_); typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); - return InvokeHelper::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 3. -template +template struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X4, X5, X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -1993,34 +2218,40 @@ struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { Bound2UnwrapTraits::Unwrap(storage->p2_); typename Bound3UnwrapTraits::ForwardType x3 = Bound3UnwrapTraits::Unwrap(storage->p3_); - return InvokeHelper::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 2. -template +template struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X5, X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2039,32 +2270,38 @@ struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { Bound3UnwrapTraits::Unwrap(storage->p3_); typename Bound4UnwrapTraits::ForwardType x4 = Bound4UnwrapTraits::Unwrap(storage->p4_); - return InvokeHelper::ForwardType x5, - typename CallbackParamTraits::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 1. -template +template struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X6); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x6) { + typename CallbackParamTraits::ForwardType x6) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2086,24 +2323,30 @@ struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { Bound4UnwrapTraits::Unwrap(storage->p4_); typename Bound5UnwrapTraits::ForwardType x5 = Bound5UnwrapTraits::Unwrap(storage->p5_); - return InvokeHelper::ForwardType x6)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x6)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 6 -> 0. -template +template struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { typedef R(RunType)(BindStateBase*); @@ -2135,86 +2378,99 @@ struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { typename Bound6UnwrapTraits::ForwardType x6 = Bound6UnwrapTraits::Unwrap(storage->p6_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2), + CallbackForward(x3), CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); } }; // Arity 7 -> 7. -template +template struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x1, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // 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. - return InvokeHelper::ForwardType x1, + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 6. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, typename CallbackParamTraits::ForwardType x2, typename CallbackParamTraits::ForwardType x3, typename CallbackParamTraits::ForwardType x4, typename CallbackParamTraits::ForwardType x5, typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); - } -}; - -// Arity 7 -> 6. -template -struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { - typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); - - typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); - - static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2224,41 +2480,48 @@ struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typename Bound1UnwrapTraits::ForwardType x1 = Bound1UnwrapTraits::Unwrap(storage->p1_); - return InvokeHelper::ForwardType x2, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 5. -template +template struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X3, X4, X5, X6, X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2271,39 +2534,46 @@ struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { Bound1UnwrapTraits::Unwrap(storage->p1_); typename Bound2UnwrapTraits::ForwardType x2 = Bound2UnwrapTraits::Unwrap(storage->p2_); - return InvokeHelper::ForwardType x3, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 4. -template +template struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X4, X5, X6, X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2319,37 +2589,44 @@ struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { Bound2UnwrapTraits::Unwrap(storage->p2_); typename Bound3UnwrapTraits::ForwardType x3 = Bound3UnwrapTraits::Unwrap(storage->p3_); - return InvokeHelper::ForwardType x4, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 3. -template +template struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X5, X6, X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2368,35 +2645,42 @@ struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { Bound3UnwrapTraits::Unwrap(storage->p3_); typename Bound4UnwrapTraits::ForwardType x4 = Bound4UnwrapTraits::Unwrap(storage->p4_); - return InvokeHelper::ForwardType x5, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 2. -template +template struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X6, X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x6, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2418,33 +2702,40 @@ struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { Bound4UnwrapTraits::Unwrap(storage->p4_); typename Bound5UnwrapTraits::ForwardType x5 = Bound5UnwrapTraits::Unwrap(storage->p5_); - return InvokeHelper::ForwardType x6, - typename CallbackParamTraits::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 1. -template +template struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*, - typename CallbackParamTraits::ForwardType); + typename CallbackParamTraits::ForwardType); typedef R(UnboundRunType)(X7); static R Run(BindStateBase* base, - typename CallbackParamTraits::ForwardType x7) { + typename CallbackParamTraits::ForwardType x7) { StorageType* storage = static_cast(base); // Local references to make debugger stepping easier. If in a debugger, @@ -2469,25 +2760,32 @@ struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { Bound5UnwrapTraits::Unwrap(storage->p5_); typename Bound6UnwrapTraits::ForwardType x6 = Bound6UnwrapTraits::Unwrap(storage->p6_); - return InvokeHelper::ForwardType x7)> - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + return InvokeHelper< + StorageType::IsWeakCall::value, R, typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits::ForwardType + x7)>::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; // Arity 7 -> 0. -template +template struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typedef R(RunType)(BindStateBase*); @@ -2522,22 +2820,20 @@ struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { typename Bound7UnwrapTraits::ForwardType x7 = Bound7UnwrapTraits::Unwrap(storage->p7_); return InvokeHelper - ::MakeItSo(storage->runnable_, CallbackForward(x1), - CallbackForward(x2), CallbackForward(x3), - CallbackForward(x4), CallbackForward(x5), - CallbackForward(x6), CallbackForward(x7)); + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType)>:: + MakeItSo(storage->runnable_, CallbackForward(x1), CallbackForward(x2), + CallbackForward(x3), CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); } }; - // BindState<> // // This stores all the state passed into Bind() and is also where most @@ -2560,11 +2856,9 @@ struct BindState : public BindStateBase { typedef Invoker<0, BindState, RunType> InvokerType; typedef typename InvokerType::UnboundRunType UnboundRunType; explicit BindState(const Runnable& runnable) - : BindStateBase(&Destroy), - runnable_(runnable) { - } + : BindStateBase(&Destroy), runnable_(runnable) {} - ~BindState() { } + ~BindState() {} static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2584,14 +2878,13 @@ struct BindState : public BindStateBase { typedef UnwrapTraits Bound1UnwrapTraits; BindState(const Runnable& runnable, const P1& p1) - : BindStateBase(&Destroy), - runnable_(runnable), - p1_(p1) { + : BindStateBase(&Destroy), runnable_(runnable), p1_(p1) { MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2613,15 +2906,13 @@ struct BindState : public BindStateBase { typedef UnwrapTraits Bound2UnwrapTraits; BindState(const Runnable& runnable, const P1& p1, const P2& p2) - : BindStateBase(&Destroy), - runnable_(runnable), - p1_(p1), - p2_(p2) { + : BindStateBase(&Destroy), runnable_(runnable), p1_(p1), p2_(p2) { MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2632,10 +2923,12 @@ struct BindState : public BindStateBase { P2 p2_; }; -template -struct BindState - : public BindStateBase { +template +struct BindState : public BindStateBase { typedef Runnable RunnableType; typedef IsWeakMethod::value, P1> IsWeakCall; typedef Invoker<3, BindState, RunType> InvokerType; @@ -2655,8 +2948,9 @@ struct BindState MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2668,8 +2962,12 @@ struct BindState P3 p3_; }; -template +template struct BindState : public BindStateBase { typedef Runnable RunnableType; @@ -2683,8 +2981,11 @@ struct BindState typedef UnwrapTraits Bound3UnwrapTraits; typedef UnwrapTraits Bound4UnwrapTraits; - BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, - const P4& p4) + BindState(const Runnable& runnable, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4) : BindStateBase(&Destroy), runnable_(runnable), p1_(p1), @@ -2694,8 +2995,9 @@ struct BindState MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2708,8 +3010,13 @@ struct BindState P4 p4_; }; -template +template struct BindState : public BindStateBase { typedef Runnable RunnableType; @@ -2724,8 +3031,12 @@ struct BindState typedef UnwrapTraits Bound4UnwrapTraits; typedef UnwrapTraits Bound5UnwrapTraits; - BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, - const P4& p4, const P5& p5) + BindState(const Runnable& runnable, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5) : BindStateBase(&Destroy), runnable_(runnable), p1_(p1), @@ -2736,8 +3047,9 @@ struct BindState MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2751,8 +3063,14 @@ struct BindState P5 p5_; }; -template +template struct BindState : public BindStateBase { typedef Runnable RunnableType; @@ -2768,8 +3086,13 @@ struct BindState typedef UnwrapTraits Bound5UnwrapTraits; typedef UnwrapTraits Bound6UnwrapTraits; - BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, - const P4& p4, const P5& p5, const P6& p6) + BindState(const Runnable& runnable, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6) : BindStateBase(&Destroy), runnable_(runnable), p1_(p1), @@ -2781,8 +3104,9 @@ struct BindState MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); @@ -2797,8 +3121,15 @@ struct BindState P6 p6_; }; -template +template struct BindState : public BindStateBase { typedef Runnable RunnableType; @@ -2815,8 +3146,14 @@ struct BindState typedef UnwrapTraits Bound6UnwrapTraits; typedef UnwrapTraits Bound7UnwrapTraits; - BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, - const P4& p4, const P5& p5, const P6& p6, const P7& p7) + BindState(const Runnable& runnable, + const P1& p1, + const P2& p2, + const P3& p3, + const P4& p4, + const P5& p5, + const P6& p6, + const P7& p7) : BindStateBase(&Destroy), runnable_(runnable), p1_(p1), @@ -2829,8 +3166,9 @@ struct BindState MaybeRefcount::value, P1>::AddRef(p1_); } - ~BindState() { MaybeRefcount::value, - P1>::Release(p1_); } + ~BindState() { + MaybeRefcount::value, P1>::Release(p1_); + } static void Destroy(BindStateBase* self) { delete static_cast(self); diff --git a/include/base/internal/cef_bind_internal_win.h b/include/base/internal/cef_bind_internal_win.h index 1b061ccd0..4a363def8 100644 --- a/include/base/internal/cef_bind_internal_win.h +++ b/include/base/internal/cef_bind_internal_win.h @@ -48,338 +48,344 @@ class RunnableAdapter; // __stdcall Function: Arity 0. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(); + typedef R(RunType)(); - explicit RunnableAdapter(R(__stdcall *function)()) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)()) : function_(function) {} - R Run() { - return function_(); - } + R Run() { return function_(); } private: - R (__stdcall *function_)(); + R(__stdcall* function_)(); }; // __fastcall Function: Arity 0. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(); + typedef R(RunType)(); - explicit RunnableAdapter(R(__fastcall *function)()) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)()) : function_(function) {} - R Run() { - return function_(); - } + R Run() { return function_(); } private: - R (__fastcall *function_)(); + R(__fastcall* function_)(); }; // __stdcall Function: Arity 1. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1); + typedef R(RunType)(A1); - explicit RunnableAdapter(R(__stdcall *function)(A1)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1)) : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1) { return function_(a1); } private: - R (__stdcall *function_)(A1); + R(__stdcall* function_)(A1); }; // __fastcall Function: Arity 1. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1); + typedef R(RunType)(A1); - explicit RunnableAdapter(R(__fastcall *function)(A1)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1)) : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1) { return function_(a1); } private: - R (__fastcall *function_)(A1); + R(__fastcall* function_)(A1); }; // __stdcall Function: Arity 2. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2); + typedef R(RunType)(A1, A2); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2) { + typename CallbackParamTraits::ForwardType a2) { return function_(a1, a2); } private: - R (__stdcall *function_)(A1, A2); + R(__stdcall* function_)(A1, A2); }; // __fastcall Function: Arity 2. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2); + typedef R(RunType)(A1, A2); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2) { + typename CallbackParamTraits::ForwardType a2) { return function_(a1, a2); } private: - R (__fastcall *function_)(A1, A2); + R(__fastcall* function_)(A1, A2); }; // __stdcall Function: Arity 3. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3); + typedef R(RunType)(A1, A2, A3); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { return function_(a1, a2, a3); } private: - R (__stdcall *function_)(A1, A2, A3); + R(__stdcall* function_)(A1, A2, A3); }; // __fastcall Function: Arity 3. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3); + typedef R(RunType)(A1, A2, A3); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { return function_(a1, a2, a3); } private: - R (__fastcall *function_)(A1, A2, A3); + R(__fastcall* function_)(A1, A2, A3); }; // __stdcall Function: Arity 4. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4); + typedef R(RunType)(A1, A2, A3, A4); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { return function_(a1, a2, a3, a4); } private: - R (__stdcall *function_)(A1, A2, A3, A4); + R(__stdcall* function_)(A1, A2, A3, A4); }; // __fastcall Function: Arity 4. template -class RunnableAdapter { +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4); + typedef R(RunType)(A1, A2, A3, A4); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { return function_(a1, a2, a3, a4); } private: - R (__fastcall *function_)(A1, A2, A3, A4); + R(__fastcall* function_)(A1, A2, A3, A4); }; // __stdcall Function: Arity 5. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5); + typedef R(RunType)(A1, A2, A3, A4, A5); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { return function_(a1, a2, a3, a4, a5); } private: - R (__stdcall *function_)(A1, A2, A3, A4, A5); + R(__stdcall* function_)(A1, A2, A3, A4, A5); }; // __fastcall Function: Arity 5. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5); + typedef R(RunType)(A1, A2, A3, A4, A5); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { return function_(a1, a2, a3, a4, a5); } private: - R (__fastcall *function_)(A1, A2, A3, A4, A5); + R(__fastcall* function_)(A1, A2, A3, A4, A5); }; // __stdcall Function: Arity 6. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6); + typedef R(RunType)(A1, A2, A3, A4, A5, A6); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { return function_(a1, a2, a3, a4, a5, a6); } private: - R (__stdcall *function_)(A1, A2, A3, A4, A5, A6); + R(__stdcall* function_)(A1, A2, A3, A4, A5, A6); }; // __fastcall Function: Arity 6. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6); + typedef R(RunType)(A1, A2, A3, A4, A5, A6); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { return function_(a1, a2, a3, a4, a5, a6); } private: - R (__fastcall *function_)(A1, A2, A3, A4, A5, A6); + R(__fastcall* function_)(A1, A2, A3, A4, A5, A6); }; // __stdcall Function: Arity 7. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); - explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7)) - : function_(function) { - } + explicit RunnableAdapter(R(__stdcall* function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6, - typename CallbackParamTraits::ForwardType a7) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { return function_(a1, a2, a3, a4, a5, a6, a7); } private: - R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7); + R(__stdcall* function_)(A1, A2, A3, A4, A5, A6, A7); }; // __fastcall Function: Arity 7. -template -class RunnableAdapter { +template +class RunnableAdapter { public: - typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); - explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7)) - : function_(function) { - } + explicit RunnableAdapter(R(__fastcall* function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) {} R Run(typename CallbackParamTraits::ForwardType a1, - typename CallbackParamTraits::ForwardType a2, - typename CallbackParamTraits::ForwardType a3, - typename CallbackParamTraits::ForwardType a4, - typename CallbackParamTraits::ForwardType a5, - typename CallbackParamTraits::ForwardType a6, - typename CallbackParamTraits::ForwardType a7) { + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { return function_(a1, a2, a3, a4, a5, a6, a7); } private: - R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7); + R(__fastcall* function_)(A1, A2, A3, A4, A5, A6, A7); }; } // namespace cef_internal diff --git a/include/base/internal/cef_callback_internal.h b/include/base/internal/cef_callback_internal.h index 542e84389..1f2e16c97 100644 --- a/include/base/internal/cef_callback_internal.h +++ b/include/base/internal/cef_callback_internal.h @@ -92,7 +92,7 @@ class CallbackBase { // another type. It is not okay to use void*. We create a InvokeFuncStorage // that that can store our function pointer, and then cast it back to // the original type on usage. - typedef void(*InvokeFuncStorage)(void); + typedef void (*InvokeFuncStorage)(void); // Returns true if this callback equals |other|. |other| may be null. bool Equals(const CallbackBase& other) const; @@ -115,15 +115,16 @@ class CallbackBase { // A helper template to determine if given type is non-const move-only-type, // i.e. if a value of the given type should be passed via .Pass() in a // destructive way. -template struct IsMoveOnlyType { +template +struct IsMoveOnlyType { template static YesType Test(const typename U::MoveOnlyTypeForCPP03*); template static NoType Test(...); - static const bool value = sizeof(Test(0)) == sizeof(YesType) && - !is_const::value; + static const bool value = + sizeof(Test(0)) == sizeof(YesType) && !is_const::value; }; // This is a typetraits object that's used to take an argument type, and diff --git a/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h b/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h index 8584fcd70..9f2f932fe 100644 --- a/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h +++ b/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h @@ -51,9 +51,7 @@ namespace cef_internal { template struct NeedsScopedRefptrButGetsRawPtr { #if defined(OS_WIN) - enum { - value = base::false_type::value - }; + enum { value = base::false_type::value }; #else enum { // Human readable translation: you needed to be a scoped_refptr if you are a @@ -77,74 +75,103 @@ struct ParamsUseScopedRefptrCorrectly { }; template -struct ParamsUseScopedRefptrCorrectly > { +struct ParamsUseScopedRefptrCorrectly> { enum { value = !NeedsScopedRefptrButGetsRawPtr::value }; }; template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; -template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; -template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +template +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; -template -struct ParamsUseScopedRefptrCorrectly > { - enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value || - NeedsScopedRefptrButGetsRawPtr::value) }; +template +struct ParamsUseScopedRefptrCorrectly> { + enum { + value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) + }; }; } // namespace cef_internal diff --git a/include/capi/cef_accessibility_handler_capi.h b/include/capi/cef_accessibility_handler_capi.h index 322ef5ebd..af3f35655 100644 --- a/include/capi/cef_accessibility_handler_capi.h +++ b/include/capi/cef_accessibility_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ade29136d75b33f63cf65db4b91de9cd66114562$ +// #ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure to receive accessibility notification when // accessibility events have been registered. The functions of this structure @@ -60,18 +61,19 @@ typedef struct _cef_accessibility_handler_t { // Called after renderer process sends accessibility tree changes to the // browser process. /// - void (CEF_CALLBACK *on_accessibility_tree_change)( - struct _cef_accessibility_handler_t* self, struct _cef_value_t* value); + void(CEF_CALLBACK* on_accessibility_tree_change)( + struct _cef_accessibility_handler_t* self, + struct _cef_value_t* value); /// // Called after renderer process sends accessibility location changes to the // browser process. /// - void (CEF_CALLBACK *on_accessibility_location_change)( - struct _cef_accessibility_handler_t* self, struct _cef_value_t* value); + void(CEF_CALLBACK* on_accessibility_location_change)( + struct _cef_accessibility_handler_t* self, + struct _cef_value_t* value); } cef_accessibility_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_app_capi.h b/include/capi/cef_app_capi.h index 01aeec164..d5221c22e 100644 --- a/include/capi/cef_app_capi.h +++ b/include/capi/cef_app_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=52ce63b881a6e3d2d13a39b81ad2626f366fc130$ +// #ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ @@ -72,8 +74,9 @@ typedef struct _cef_app_t { // modify command-line arguments for non-browser processes as this may result // in undefined behavior including crashes. /// - void (CEF_CALLBACK *on_before_command_line_processing)( - struct _cef_app_t* self, const cef_string_t* process_type, + void(CEF_CALLBACK* on_before_command_line_processing)( + struct _cef_app_t* self, + const cef_string_t* process_type, struct _cef_command_line_t* command_line); /// @@ -82,7 +85,8 @@ typedef struct _cef_app_t { // each process and the registered schemes should be the same across all // processes. /// - void (CEF_CALLBACK *on_register_custom_schemes)(struct _cef_app_t* self, + void(CEF_CALLBACK* on_register_custom_schemes)( + struct _cef_app_t* self, struct _cef_scheme_registrar_t* registrar); /// @@ -91,25 +95,24 @@ typedef struct _cef_app_t { // If no handler is returned resources will be loaded from pack files. This // function is called by the browser and render processes on multiple threads. /// - struct _cef_resource_bundle_handler_t* ( - CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self); + struct _cef_resource_bundle_handler_t*( + CEF_CALLBACK* get_resource_bundle_handler)(struct _cef_app_t* self); /// // Return the handler for functionality specific to the browser process. This // function is called on multiple threads in the browser process. /// - struct _cef_browser_process_handler_t* ( - CEF_CALLBACK *get_browser_process_handler)(struct _cef_app_t* self); + struct _cef_browser_process_handler_t*( + CEF_CALLBACK* get_browser_process_handler)(struct _cef_app_t* self); /// // Return the handler for functionality specific to the render process. This // function is called on the render process main thread. /// - struct _cef_render_process_handler_t* ( - CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self); + struct _cef_render_process_handler_t*( + CEF_CALLBACK* get_render_process_handler)(struct _cef_app_t* self); } cef_app_t; - /// // This function should be called from the application entry point function to // execute a secondary process. It can be used to run secondary processes from @@ -123,7 +126,8 @@ typedef struct _cef_app_t { // cef_sandbox_win.h for details). /// CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, - cef_app_t* application, void* windows_sandbox_info); + cef_app_t* application, + void* windows_sandbox_info); /// // This function should be called on the main application thread to initialize @@ -133,8 +137,9 @@ CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, // be NULL (see cef_sandbox_win.h for details). /// CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args, - const struct _cef_settings_t* settings, cef_app_t* application, - void* windows_sandbox_info); + const struct _cef_settings_t* settings, + cef_app_t* application, + void* windows_sandbox_info); /// // This function should be called on the main application thread to shut down diff --git a/include/capi/cef_auth_callback_capi.h b/include/capi/cef_auth_callback_capi.h index 32e30eaa1..834a6c318 100644 --- a/include/capi/cef_auth_callback_capi.h +++ b/include/capi/cef_auth_callback_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=639d58245ecd39624d39ee8b49e0e4e056d1c4ed$ +// #ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Callback structure used for asynchronous continuation of authentication // requests. @@ -58,16 +59,16 @@ typedef struct _cef_auth_callback_t { /// // Continue the authentication request. /// - void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self, - const cef_string_t* username, const cef_string_t* password); + void(CEF_CALLBACK* cont)(struct _cef_auth_callback_t* self, + const cef_string_t* username, + const cef_string_t* password); /// // Cancel the authentication request. /// - void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_auth_callback_t* self); } cef_auth_callback_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_base_capi.h b/include/capi/cef_base_capi.h index 681ef4daa..9af617d93 100644 --- a/include/capi/cef_base_capi.h +++ b/include/capi/cef_base_capi.h @@ -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_CAPI_CEF_BASE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ @@ -57,22 +56,21 @@ typedef struct _cef_base_ref_counted_t { // Called to increment the reference count for the object. Should be called // for every new copy of a pointer to a given object. /// - void (CEF_CALLBACK *add_ref)(struct _cef_base_ref_counted_t* self); + void(CEF_CALLBACK* add_ref)(struct _cef_base_ref_counted_t* self); /// // Called to decrement the reference count for the object. If the reference // count falls to 0 the object should self-delete. Returns true (1) if the // resulting reference count is 0. /// - int (CEF_CALLBACK *release)(struct _cef_base_ref_counted_t* self); + int(CEF_CALLBACK* release)(struct _cef_base_ref_counted_t* self); /// // Returns true (1) if the current reference count is 1. /// - int (CEF_CALLBACK *has_one_ref)(struct _cef_base_ref_counted_t* self); + int(CEF_CALLBACK* has_one_ref)(struct _cef_base_ref_counted_t* self); } cef_base_ref_counted_t; - /// // All scoped framework structures must include this structure first. /// @@ -85,19 +83,17 @@ typedef struct _cef_base_scoped_t { /// // Called to delete this object. May be NULL if the object is not owned. /// - void (CEF_CALLBACK *del)(struct _cef_base_scoped_t* self); + void(CEF_CALLBACK* del)(struct _cef_base_scoped_t* self); } cef_base_scoped_t; - // Check that the structure |s|, which is defined with a size_t member at the // top, is large enough to contain the specified member |f|. -#define CEF_MEMBER_EXISTS(s, f) \ - ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \ - *reinterpret_cast(s)) - -#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) +#define CEF_MEMBER_EXISTS(s, f) \ + ((intptr_t) & \ + ((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast(s)) +#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) #ifdef __cplusplus } diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h index b92e13338..3c830bc0e 100644 --- a/include/capi/cef_browser_capi.h +++ b/include/capi/cef_browser_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=b6308ab5e97eb9f7af95f1f4c371fd6e7edbf852$ +// #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ @@ -69,122 +71,124 @@ typedef struct _cef_browser_t { // Returns the browser host object. This function can only be called in the // browser process. /// - struct _cef_browser_host_t* (CEF_CALLBACK *get_host)( + struct _cef_browser_host_t*(CEF_CALLBACK* get_host)( struct _cef_browser_t* self); /// // Returns true (1) if the browser can navigate backwards. /// - int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self); + int(CEF_CALLBACK* can_go_back)(struct _cef_browser_t* self); /// // Navigate backwards. /// - void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self); + void(CEF_CALLBACK* go_back)(struct _cef_browser_t* self); /// // Returns true (1) if the browser can navigate forwards. /// - int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self); + int(CEF_CALLBACK* can_go_forward)(struct _cef_browser_t* self); /// // Navigate forwards. /// - void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self); + void(CEF_CALLBACK* go_forward)(struct _cef_browser_t* self); /// // Returns true (1) if the browser is currently loading. /// - int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self); + int(CEF_CALLBACK* is_loading)(struct _cef_browser_t* self); /// // Reload the current page. /// - void (CEF_CALLBACK *reload)(struct _cef_browser_t* self); + void(CEF_CALLBACK* reload)(struct _cef_browser_t* self); /// // Reload the current page ignoring any cached data. /// - void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self); + void(CEF_CALLBACK* reload_ignore_cache)(struct _cef_browser_t* self); /// // Stop loading the page. /// - void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self); + void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self); /// // Returns the globally unique identifier for this browser. /// - int (CEF_CALLBACK *get_identifier)(struct _cef_browser_t* self); + int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self); /// // Returns true (1) if this object is pointing to the same handle as |that| // object. /// - int (CEF_CALLBACK *is_same)(struct _cef_browser_t* self, - struct _cef_browser_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_browser_t* self, + struct _cef_browser_t* that); /// // Returns true (1) if the window is a popup window. /// - int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self); + int(CEF_CALLBACK* is_popup)(struct _cef_browser_t* self); /// // Returns true (1) if a document has been loaded in the browser. /// - int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self); + int(CEF_CALLBACK* has_document)(struct _cef_browser_t* self); /// // Returns the main (top-level) frame for the browser window. /// - struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)( + struct _cef_frame_t*(CEF_CALLBACK* get_main_frame)( struct _cef_browser_t* self); /// // Returns the focused frame for the browser window. /// - struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)( + struct _cef_frame_t*(CEF_CALLBACK* get_focused_frame)( struct _cef_browser_t* self); /// // Returns the frame with the specified identifier, or NULL if not found. /// - struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)( - struct _cef_browser_t* self, int64 identifier); + struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)( + struct _cef_browser_t* self, + int64 identifier); /// // Returns the frame with the specified name, or NULL if not found. /// - struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self, - const cef_string_t* name); + struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self, + const cef_string_t* name); /// // Returns the number of frames that currently exist. /// - size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self); + size_t(CEF_CALLBACK* get_frame_count)(struct _cef_browser_t* self); /// // Returns the identifiers of all existing frames. /// - void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self, - size_t* identifiersCount, int64* identifiers); + void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self, + size_t* identifiersCount, + int64* identifiers); /// // Returns the names of all existing frames. /// - void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self, - cef_string_list_t names); + void(CEF_CALLBACK* get_frame_names)(struct _cef_browser_t* self, + cef_string_list_t names); /// // Send a message to the specified |target_process|. Returns true (1) if the // message was sent successfully. /// - int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self, + int(CEF_CALLBACK* send_process_message)( + struct _cef_browser_t* self, cef_process_id_t target_process, struct _cef_process_message_t* message); } cef_browser_t; - /// // Callback structure for cef_browser_host_t::RunFileDialog. The functions of // this structure will be called on the browser process UI thread. @@ -202,12 +206,12 @@ typedef struct _cef_run_file_dialog_callback_t { // |file_paths| will be a single value or a list of values depending on the // dialog mode. If the selection was cancelled |file_paths| will be NULL. /// - void (CEF_CALLBACK *on_file_dialog_dismissed)( - struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter, + void(CEF_CALLBACK* on_file_dialog_dismissed)( + struct _cef_run_file_dialog_callback_t* self, + int selected_accept_filter, cef_string_list_t file_paths); } cef_run_file_dialog_callback_t; - /// // Callback structure for cef_browser_host_t::GetNavigationEntries. The // functions of this structure will be called on the browser process UI thread. @@ -225,12 +229,13 @@ typedef struct _cef_navigation_entry_visitor_t { // navigation entry. |index| is the 0-based index of this entry and |total| is // the total number of entries. /// - int (CEF_CALLBACK *visit)(struct _cef_navigation_entry_visitor_t* self, - struct _cef_navigation_entry_t* entry, int current, int index, - int total); + int(CEF_CALLBACK* visit)(struct _cef_navigation_entry_visitor_t* self, + struct _cef_navigation_entry_t* entry, + int current, + int index, + int total); } cef_navigation_entry_visitor_t; - /// // Callback structure for cef_browser_host_t::PrintToPDF. The functions of this // structure will be called on the browser process UI thread. @@ -246,12 +251,12 @@ typedef struct _cef_pdf_print_callback_t { // the output path. |ok| will be true (1) if the printing completed // successfully or false (0) otherwise. /// - void (CEF_CALLBACK *on_pdf_print_finished)( - struct _cef_pdf_print_callback_t* self, const cef_string_t* path, + void(CEF_CALLBACK* on_pdf_print_finished)( + struct _cef_pdf_print_callback_t* self, + const cef_string_t* path, int ok); } cef_pdf_print_callback_t; - /// // Callback structure for cef_browser_host_t::DownloadImage. The functions of // this structure will be called on the browser process UI thread. @@ -268,13 +273,13 @@ typedef struct _cef_download_image_callback_t { // resulting HTTP status code. |image| is the resulting image, possibly at // multiple scale factors, or NULL if the download failed. /// - void (CEF_CALLBACK *on_download_image_finished)( + void(CEF_CALLBACK* on_download_image_finished)( struct _cef_download_image_callback_t* self, - const cef_string_t* image_url, int http_status_code, + const cef_string_t* image_url, + int http_status_code, struct _cef_image_t* image); } cef_download_image_callback_t; - /// // Structure used to represent the browser process aspects of a browser window. // The functions of this structure can only be called in the browser process. @@ -290,7 +295,7 @@ typedef struct _cef_browser_host_t { /// // Returns the hosted browser object. /// - struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_browser_t*(CEF_CALLBACK* get_browser)( struct _cef_browser_host_t* self); /// @@ -303,8 +308,8 @@ typedef struct _cef_browser_host_t { // cef_life_span_handler_t::do_close() documentation for additional usage // information. /// - void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self, - int force_close); + void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self, + int force_close); /// // Helper for closing a browser. Call this function from the top-level window @@ -314,19 +319,19 @@ typedef struct _cef_browser_host_t { // and cef_life_span_handler_t::do_close() documentation for additional usage // information. This function must be called on the browser process UI thread. /// - int (CEF_CALLBACK *try_close_browser)(struct _cef_browser_host_t* self); + int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self); /// // Set whether the browser is focused. /// - void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus); + void(CEF_CALLBACK* set_focus)(struct _cef_browser_host_t* self, int focus); /// // Retrieve the window handle for this browser. If this browser is wrapped in // a cef_browser_view_t this function should be called on the browser process // UI thread and it will return the handle for the top-level native window. /// - cef_window_handle_t (CEF_CALLBACK *get_window_handle)( + cef_window_handle_t(CEF_CALLBACK* get_window_handle)( struct _cef_browser_host_t* self); /// @@ -335,39 +340,39 @@ typedef struct _cef_browser_host_t { // cef_browser_view_t. This function can be used in combination with custom // handling of modal windows. /// - cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)( + cef_window_handle_t(CEF_CALLBACK* get_opener_window_handle)( struct _cef_browser_host_t* self); /// // Returns true (1) if this browser is wrapped in a cef_browser_view_t. /// - int (CEF_CALLBACK *has_view)(struct _cef_browser_host_t* self); + int(CEF_CALLBACK* has_view)(struct _cef_browser_host_t* self); /// // Returns the client for this browser. /// - struct _cef_client_t* (CEF_CALLBACK *get_client)( + struct _cef_client_t*(CEF_CALLBACK* get_client)( struct _cef_browser_host_t* self); /// // Returns the request context for this browser. /// - struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)( + struct _cef_request_context_t*(CEF_CALLBACK* get_request_context)( struct _cef_browser_host_t* self); /// // Get the current zoom level. The default zoom level is 0.0. This function // can only be called on the UI thread. /// - double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_host_t* self); + double(CEF_CALLBACK* get_zoom_level)(struct _cef_browser_host_t* self); /// // Change the zoom level to the specified value. Specify 0.0 to reset the zoom // level. If called on the UI thread the change will be applied immediately. // Otherwise, the change will be applied asynchronously on the UI thread. /// - void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_host_t* self, - double zoomLevel); + void(CEF_CALLBACK* set_zoom_level)(struct _cef_browser_host_t* self, + double zoomLevel); /// // Call to run a file chooser dialog. Only a single file chooser dialog may be @@ -385,17 +390,20 @@ typedef struct _cef_browser_host_t { // dismissed or immediately if another dialog is already pending. The dialog // will be initiated asynchronously on the UI thread. /// - void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self, - cef_file_dialog_mode_t mode, const cef_string_t* title, - const cef_string_t* default_file_path, cef_string_list_t accept_filters, + void(CEF_CALLBACK* run_file_dialog)( + struct _cef_browser_host_t* self, + cef_file_dialog_mode_t mode, + const cef_string_t* title, + const cef_string_t* default_file_path, + cef_string_list_t accept_filters, int selected_accept_filter, struct _cef_run_file_dialog_callback_t* callback); /// // Download the file at |url| using cef_download_handler_t. /// - void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self, - const cef_string_t* url); + void(CEF_CALLBACK* start_download)(struct _cef_browser_host_t* self, + const cef_string_t* url); /// // Download |image_url| and execute |callback| on completion with the images @@ -409,14 +417,18 @@ typedef struct _cef_browser_host_t { // unlimited. If |bypass_cache| is true (1) then |image_url| is requested from // the server even if it is present in the browser cache. /// - void (CEF_CALLBACK *download_image)(struct _cef_browser_host_t* self, - const cef_string_t* image_url, int is_favicon, uint32 max_image_size, - int bypass_cache, struct _cef_download_image_callback_t* callback); + void(CEF_CALLBACK* download_image)( + struct _cef_browser_host_t* self, + const cef_string_t* image_url, + int is_favicon, + uint32 max_image_size, + int bypass_cache, + struct _cef_download_image_callback_t* callback); /// // Print the current browser contents. /// - void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self); + void(CEF_CALLBACK* print)(struct _cef_browser_host_t* self); /// // Print the current browser contents to the PDF file specified by |path| and @@ -424,7 +436,8 @@ typedef struct _cef_browser_host_t { // |path| when done. For PDF printing to work on Linux you must implement the // cef_print_handler_t::GetPdfPaperSize function. /// - void (CEF_CALLBACK *print_to_pdf)(struct _cef_browser_host_t* self, + void(CEF_CALLBACK* print_to_pdf)( + struct _cef_browser_host_t* self, const cef_string_t* path, const struct _cef_pdf_print_settings_t* settings, struct _cef_pdf_print_callback_t* callback); @@ -440,15 +453,18 @@ typedef struct _cef_browser_host_t { // instance, if any, returned via cef_client_t::GetFindHandler will be called // to report find results. /// - void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier, - const cef_string_t* searchText, int forward, int matchCase, - int findNext); + void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self, + int identifier, + const cef_string_t* searchText, + int forward, + int matchCase, + int findNext); /// // Cancel all searches that are currently going on. /// - void (CEF_CALLBACK *stop_finding)(struct _cef_browser_host_t* self, - int clearSelection); + void(CEF_CALLBACK* stop_finding)(struct _cef_browser_host_t* self, + int clearSelection); /// // Open developer tools (DevTools) in its own browser. The DevTools browser @@ -459,7 +475,8 @@ typedef struct _cef_browser_host_t { // inspected. The |windowInfo| parameter will be ignored if this browser is // wrapped in a cef_browser_view_t. /// - void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self, + void(CEF_CALLBACK* show_dev_tools)( + struct _cef_browser_host_t* self, const struct _cef_window_info_t* windowInfo, struct _cef_client_t* client, const struct _cef_browser_settings_t* settings, @@ -468,13 +485,13 @@ typedef struct _cef_browser_host_t { /// // Explicitly close the associated DevTools browser, if any. /// - void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self); + void(CEF_CALLBACK* close_dev_tools)(struct _cef_browser_host_t* self); /// // Returns true (1) if this browser currently has an associated DevTools // browser. Must be called on the browser process UI thread. /// - int (CEF_CALLBACK *has_dev_tools)(struct _cef_browser_host_t* self); + int(CEF_CALLBACK* has_dev_tools)(struct _cef_browser_host_t* self); /// // Retrieve a snapshot of current navigation entries as values sent to the @@ -482,38 +499,41 @@ typedef struct _cef_browser_host_t { // navigation entry will be sent, otherwise all navigation entries will be // sent. /// - void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self, - struct _cef_navigation_entry_visitor_t* visitor, int current_only); + void(CEF_CALLBACK* get_navigation_entries)( + struct _cef_browser_host_t* self, + struct _cef_navigation_entry_visitor_t* visitor, + int current_only); /// // Set whether mouse cursor change is disabled. /// - void (CEF_CALLBACK *set_mouse_cursor_change_disabled)( - struct _cef_browser_host_t* self, int disabled); + void(CEF_CALLBACK* set_mouse_cursor_change_disabled)( + struct _cef_browser_host_t* self, + int disabled); /// // Returns true (1) if mouse cursor change is disabled. /// - int (CEF_CALLBACK *is_mouse_cursor_change_disabled)( + int(CEF_CALLBACK* is_mouse_cursor_change_disabled)( struct _cef_browser_host_t* self); /// // If a misspelled word is currently selected in an editable node calling this // function will replace it with the specified |word|. /// - void (CEF_CALLBACK *replace_misspelling)(struct _cef_browser_host_t* self, - const cef_string_t* word); + void(CEF_CALLBACK* replace_misspelling)(struct _cef_browser_host_t* self, + const cef_string_t* word); /// // Add the specified |word| to the spelling dictionary. /// - void (CEF_CALLBACK *add_word_to_dictionary)(struct _cef_browser_host_t* self, - const cef_string_t* word); + void(CEF_CALLBACK* add_word_to_dictionary)(struct _cef_browser_host_t* self, + const cef_string_t* word); /// // Returns true (1) if window rendering is disabled. /// - int (CEF_CALLBACK *is_window_rendering_disabled)( + int(CEF_CALLBACK* is_window_rendering_disabled)( struct _cef_browser_host_t* self); /// @@ -522,14 +542,14 @@ typedef struct _cef_browser_host_t { // cef_render_handler_t::OnPaint asynchronously with the updated regions. This // function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *was_resized)(struct _cef_browser_host_t* self); + void(CEF_CALLBACK* was_resized)(struct _cef_browser_host_t* self); /// // Notify the browser that it has been hidden or shown. Layouting and // cef_render_handler_t::OnPaint notification will stop when the browser is // hidden. This function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *was_hidden)(struct _cef_browser_host_t* self, int hidden); + void(CEF_CALLBACK* was_hidden)(struct _cef_browser_host_t* self, int hidden); /// // Send a notification to the browser that the screen info has changed. The @@ -539,7 +559,7 @@ typedef struct _cef_browser_host_t { // current display. This function is only used when window rendering is // disabled. /// - void (CEF_CALLBACK *notify_screen_info_changed)( + void(CEF_CALLBACK* notify_screen_info_changed)( struct _cef_browser_host_t* self); /// @@ -547,29 +567,34 @@ typedef struct _cef_browser_host_t { // asynchronously. This function is only used when window rendering is // disabled. /// - void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self, - cef_paint_element_type_t type); + void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self, + cef_paint_element_type_t type); /// // Send a key event to the browser. /// - void (CEF_CALLBACK *send_key_event)(struct _cef_browser_host_t* self, - const struct _cef_key_event_t* event); + void(CEF_CALLBACK* send_key_event)(struct _cef_browser_host_t* self, + const struct _cef_key_event_t* event); /// // Send a mouse click event to the browser. The |x| and |y| coordinates are // relative to the upper-left corner of the view. /// - void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self, - const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type, - int mouseUp, int clickCount); + void(CEF_CALLBACK* send_mouse_click_event)( + struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + cef_mouse_button_type_t type, + int mouseUp, + int clickCount); /// // Send a mouse move event to the browser. The |x| and |y| coordinates are // relative to the upper-left corner of the view. /// - void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self, - const struct _cef_mouse_event_t* event, int mouseLeave); + void(CEF_CALLBACK* send_mouse_move_event)( + struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + int mouseLeave); /// // Send a mouse wheel event to the browser. The |x| and |y| coordinates are @@ -578,26 +603,28 @@ typedef struct _cef_browser_host_t { // In order to scroll inside select popups with window rendering disabled // cef_render_handler_t::GetScreenPoint should be implemented properly. /// - void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self, - const struct _cef_mouse_event_t* event, int deltaX, int deltaY); + void(CEF_CALLBACK* send_mouse_wheel_event)( + struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + int deltaX, + int deltaY); /// // Send a focus event to the browser. /// - void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_host_t* self, - int setFocus); + void(CEF_CALLBACK* send_focus_event)(struct _cef_browser_host_t* self, + int setFocus); /// // Send a capture lost event to the browser. /// - void (CEF_CALLBACK *send_capture_lost_event)( - struct _cef_browser_host_t* self); + void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self); /// // Notify the browser that the window hosting it is about to be moved or // resized. This function is only used on Windows and Linux. /// - void (CEF_CALLBACK *notify_move_or_resize_started)( + void(CEF_CALLBACK* notify_move_or_resize_started)( struct _cef_browser_host_t* self); /// @@ -607,7 +634,7 @@ typedef struct _cef_browser_host_t { // requested rate. The minimum value is 1 and the maximum value is 60 (default // 30). This function can only be called on the UI thread. /// - int (CEF_CALLBACK *get_windowless_frame_rate)( + int(CEF_CALLBACK* get_windowless_frame_rate)( struct _cef_browser_host_t* self); /// @@ -617,8 +644,9 @@ typedef struct _cef_browser_host_t { // minimum value is 1 and the maximum value is 60 (default 30). Can also be // set at browser creation via cef_browser_tSettings.windowless_frame_rate. /// - void (CEF_CALLBACK *set_windowless_frame_rate)( - struct _cef_browser_host_t* self, int frame_rate); + void(CEF_CALLBACK* set_windowless_frame_rate)( + struct _cef_browser_host_t* self, + int frame_rate); /// // Begins a new composition or updates the existing composition. Blink has a @@ -643,8 +671,10 @@ typedef struct _cef_browser_host_t { // // This function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *ime_set_composition)(struct _cef_browser_host_t* self, - const cef_string_t* text, size_t underlinesCount, + void(CEF_CALLBACK* ime_set_composition)( + struct _cef_browser_host_t* self, + const cef_string_t* text, + size_t underlinesCount, cef_composition_underline_t const* underlines, const cef_range_t* replacement_range, const cef_range_t* selection_range); @@ -658,9 +688,10 @@ typedef struct _cef_browser_host_t { // |relative_cursor_pos| values are only used on OS X. This function is only // used when window rendering is disabled. /// - void (CEF_CALLBACK *ime_commit_text)(struct _cef_browser_host_t* self, - const cef_string_t* text, const cef_range_t* replacement_range, - int relative_cursor_pos); + void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self, + const cef_string_t* text, + const cef_range_t* replacement_range, + int relative_cursor_pos); /// // Completes the existing composition by applying the current composition node @@ -668,15 +699,16 @@ typedef struct _cef_browser_host_t { // will be discarded. See comments on ImeSetComposition for usage. This // function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *ime_finish_composing_text)( - struct _cef_browser_host_t* self, int keep_selection); + void(CEF_CALLBACK* ime_finish_composing_text)( + struct _cef_browser_host_t* self, + int keep_selection); /// // Cancels the existing composition and discards the composition node contents // without applying them. See comments on ImeSetComposition for usage. This // function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *ime_cancel_composition)(struct _cef_browser_host_t* self); + void(CEF_CALLBACK* ime_cancel_composition)(struct _cef_browser_host_t* self); /// // Call this function when the user drags the mouse into the web view (before @@ -687,7 +719,8 @@ typedef struct _cef_browser_host_t { // cef_render_handler_t::StartDragging). This function is only used when // window rendering is disabled. /// - void (CEF_CALLBACK *drag_target_drag_enter)(struct _cef_browser_host_t* self, + void(CEF_CALLBACK* drag_target_drag_enter)( + struct _cef_browser_host_t* self, struct _cef_drag_data_t* drag_data, const struct _cef_mouse_event_t* event, cef_drag_operations_mask_t allowed_ops); @@ -698,7 +731,8 @@ typedef struct _cef_browser_host_t { // DragTargetDragLeave/DragTargetDrop). This function is only used when window // rendering is disabled. /// - void (CEF_CALLBACK *drag_target_drag_over)(struct _cef_browser_host_t* self, + void(CEF_CALLBACK* drag_target_drag_over)( + struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event, cef_drag_operations_mask_t allowed_ops); @@ -707,7 +741,7 @@ typedef struct _cef_browser_host_t { // calling DragTargetDragEnter). This function is only used when window // rendering is disabled. /// - void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self); + void(CEF_CALLBACK* drag_target_drag_leave)(struct _cef_browser_host_t* self); /// // Call this function when the user completes the drag operation by dropping @@ -716,8 +750,8 @@ typedef struct _cef_browser_host_t { // DragTargetDragEnter call. This function is only used when window rendering // is disabled. /// - void (CEF_CALLBACK *drag_target_drop)(struct _cef_browser_host_t* self, - const struct _cef_mouse_event_t* event); + void(CEF_CALLBACK* drag_target_drop)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event); /// // Call this function when the drag operation started by a @@ -728,8 +762,10 @@ typedef struct _cef_browser_host_t { // DragSource* mthods. This function is only used when window rendering is // disabled. /// - void (CEF_CALLBACK *drag_source_ended_at)(struct _cef_browser_host_t* self, - int x, int y, cef_drag_operations_mask_t op); + void(CEF_CALLBACK* drag_source_ended_at)(struct _cef_browser_host_t* self, + int x, + int y, + cef_drag_operations_mask_t op); /// // Call this function when the drag operation started by a @@ -739,14 +775,14 @@ typedef struct _cef_browser_host_t { // then all DragTarget* functions should be called before DragSource* mthods. // This function is only used when window rendering is disabled. /// - void (CEF_CALLBACK *drag_source_system_drag_ended)( + void(CEF_CALLBACK* drag_source_system_drag_ended)( struct _cef_browser_host_t* self); /// // Returns the current visible navigation entry for this browser. This // function can only be called on the UI thread. /// - struct _cef_navigation_entry_t* (CEF_CALLBACK *get_visible_navigation_entry)( + struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)( struct _cef_browser_host_t* self); /// @@ -774,11 +810,10 @@ typedef struct _cef_browser_host_t { // objects are not created. The client may implement platform accessibility // objects using CefAccessibiltyHandler callbacks if desired. /// - void (CEF_CALLBACK *set_accessibility_state)(struct _cef_browser_host_t* self, - cef_state_t accessibility_state); + void(CEF_CALLBACK* set_accessibility_state)(struct _cef_browser_host_t* self, + cef_state_t accessibility_state); } cef_browser_host_t; - /// // Create a new browser window using the window parameters specified by // |windowInfo|. All values will be copied internally and the actual window will @@ -787,8 +822,10 @@ typedef struct _cef_browser_host_t { // thread and will not block. /// CEF_EXPORT int cef_browser_host_create_browser( - const cef_window_info_t* windowInfo, struct _cef_client_t* client, - const cef_string_t* url, const struct _cef_browser_settings_t* settings, + const cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const cef_string_t* url, + const struct _cef_browser_settings_t* settings, struct _cef_request_context_t* request_context); /// @@ -797,11 +834,12 @@ CEF_EXPORT int cef_browser_host_create_browser( // used. This function can only be called on the browser process UI thread. /// CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( - const cef_window_info_t* windowInfo, struct _cef_client_t* client, - const cef_string_t* url, const struct _cef_browser_settings_t* settings, + const cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const cef_string_t* url, + const struct _cef_browser_settings_t* settings, struct _cef_request_context_t* request_context); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_browser_process_handler_capi.h b/include/capi/cef_browser_process_handler_capi.h index ddb3a35b9..6a9d7129b 100644 --- a/include/capi/cef_browser_process_handler_capi.h +++ b/include/capi/cef_browser_process_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=0868c7d129e35c38b207b1066fd5eba0c1eef45c$ +// #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ @@ -47,7 +49,6 @@ extern "C" { #endif - /// // Structure used to implement browser process callbacks. The functions of this // structure will be called on the browser process main thread unless otherwise @@ -63,7 +64,7 @@ typedef struct _cef_browser_process_handler_t { // Called on the browser process UI thread immediately after the CEF context // has been initialized. /// - void (CEF_CALLBACK *on_context_initialized)( + void(CEF_CALLBACK* on_context_initialized)( struct _cef_browser_process_handler_t* self); /// @@ -73,7 +74,7 @@ typedef struct _cef_browser_process_handler_t { // opportunity to modify the child process command line. Do not keep a // reference to |command_line| outside of this function. /// - void (CEF_CALLBACK *on_before_child_process_launch)( + void(CEF_CALLBACK* on_before_child_process_launch)( struct _cef_browser_process_handler_t* self, struct _cef_command_line_t* command_line); @@ -84,7 +85,7 @@ typedef struct _cef_browser_process_handler_t { // cef_render_process_handler_t::on_render_thread_created() in the render // process. Do not keep a reference to |extra_info| outside of this function. /// - void (CEF_CALLBACK *on_render_process_thread_created)( + void(CEF_CALLBACK* on_render_process_thread_created)( struct _cef_browser_process_handler_t* self, struct _cef_list_value_t* extra_info); @@ -92,7 +93,7 @@ typedef struct _cef_browser_process_handler_t { // Return the handler for printing on Linux. If a print handler is not // provided then printing will not be supported on the Linux platform. /// - struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)( + struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)( struct _cef_browser_process_handler_t* self); /// @@ -108,11 +109,11 @@ typedef struct _cef_browser_process_handler_t { // specified delay and any currently pending scheduled call should be // cancelled. /// - void (CEF_CALLBACK *on_schedule_message_pump_work)( - struct _cef_browser_process_handler_t* self, int64 delay_ms); + void(CEF_CALLBACK* on_schedule_message_pump_work)( + struct _cef_browser_process_handler_t* self, + int64 delay_ms); } cef_browser_process_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_callback_capi.h b/include/capi/cef_callback_capi.h index 8f6e28d3b..14e9c28ac 100644 --- a/include/capi/cef_callback_capi.h +++ b/include/capi/cef_callback_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=68de2255fd429696d62115786fc480f1d5f9882b$ +// #ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Generic callback structure used for asynchronous continuation. /// @@ -57,15 +58,14 @@ typedef struct _cef_callback_t { /// // Continue processing. /// - void (CEF_CALLBACK *cont)(struct _cef_callback_t* self); + void(CEF_CALLBACK* cont)(struct _cef_callback_t* self); /// // Cancel processing. /// - void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_callback_t* self); } cef_callback_t; - /// // Generic callback structure used for asynchronous completion. /// @@ -78,10 +78,9 @@ typedef struct _cef_completion_callback_t { /// // Method that will be called once the task is complete. /// - void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self); + void(CEF_CALLBACK* on_complete)(struct _cef_completion_callback_t* self); } cef_completion_callback_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_client_capi.h b/include/capi/cef_client_capi.h index 9feddf59b..93339d279 100644 --- a/include/capi/cef_client_capi.h +++ b/include/capi/cef_client_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=7f554250e73537ece3f8f67310c23e718f91d41b$ +// #ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ @@ -59,7 +61,6 @@ extern "C" { #endif - /// // Implement this structure to provide handler implementations. /// @@ -73,89 +74,89 @@ typedef struct _cef_client_t { // Return the handler for context menus. If no handler is provided the default // implementation will be used. /// - struct _cef_context_menu_handler_t* (CEF_CALLBACK *get_context_menu_handler)( + struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)( struct _cef_client_t* self); /// // Return the handler for dialogs. If no handler is provided the default // implementation will be used. /// - struct _cef_dialog_handler_t* (CEF_CALLBACK *get_dialog_handler)( + struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)( struct _cef_client_t* self); /// // Return the handler for browser display state events. /// - struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)( + struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)( struct _cef_client_t* self); /// // Return the handler for download events. If no handler is returned downloads // will not be allowed. /// - struct _cef_download_handler_t* (CEF_CALLBACK *get_download_handler)( + struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)( struct _cef_client_t* self); /// // Return the handler for drag events. /// - struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( + struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)( struct _cef_client_t* self); /// // Return the handler for find result events. /// - struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)( + struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)( struct _cef_client_t* self); /// // Return the handler for focus events. /// - struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)( + struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)( struct _cef_client_t* self); /// // Return the handler for geolocation permissions requests. If no handler is // provided geolocation access will be denied by default. /// - struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)( + struct _cef_geolocation_handler_t*(CEF_CALLBACK* get_geolocation_handler)( struct _cef_client_t* self); /// // Return the handler for JavaScript dialogs. If no handler is provided the // default implementation will be used. /// - struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)( + struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)( struct _cef_client_t* self); /// // Return the handler for keyboard events. /// - struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)( + struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)( struct _cef_client_t* self); /// // Return the handler for browser life span events. /// - struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)( + struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)( struct _cef_client_t* self); /// // Return the handler for browser load status events. /// - struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)( struct _cef_client_t* self); /// // Return the handler for off-screen rendering events. /// - struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)( + struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)( struct _cef_client_t* self); /// // Return the handler for browser request events. /// - struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)( + struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)( struct _cef_client_t* self); /// @@ -163,12 +164,13 @@ typedef struct _cef_client_t { // (1) if the message was handled or false (0) otherwise. Do not keep a // reference to or attempt to access the message outside of this callback. /// - int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self, - struct _cef_browser_t* browser, cef_process_id_t source_process, + int(CEF_CALLBACK* on_process_message_received)( + struct _cef_client_t* self, + struct _cef_browser_t* browser, + cef_process_id_t source_process, struct _cef_process_message_t* message); } cef_client_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_command_line_capi.h b/include/capi/cef_command_line_capi.h index f3dc1794d..9a1eed8c2 100644 --- a/include/capi/cef_command_line_capi.h +++ b/include/capi/cef_command_line_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=b917030321dc11ddfc8d8939239dda7952d2f955$ +// #ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure used to create and/or parse command line arguments. Arguments with // '--', '-' and, on Windows, '/' prefixes are considered switches. Switches @@ -65,18 +66,18 @@ typedef struct _cef_command_line_t { // Returns true (1) if this object is valid. Do not call any other functions // if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_command_line_t* self); /// // Returns true (1) if the values of this object are read-only. Some APIs may // expose read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_command_line_t* self); /// // Returns a writable copy of this object. /// - struct _cef_command_line_t* (CEF_CALLBACK *copy)( + struct _cef_command_line_t*(CEF_CALLBACK* copy)( struct _cef_command_line_t* self); /// @@ -84,116 +85,117 @@ typedef struct _cef_command_line_t { // The first argument must be the name of the program. This function is only // supported on non-Windows platforms. /// - void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self, - int argc, const char* const* argv); + void(CEF_CALLBACK* init_from_argv)(struct _cef_command_line_t* self, + int argc, + const char* const* argv); /// // Initialize the command line with the string returned by calling // GetCommandLineW(). This function is only supported on Windows. /// - void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self, - const cef_string_t* command_line); + void(CEF_CALLBACK* init_from_string)(struct _cef_command_line_t* self, + const cef_string_t* command_line); /// // Reset the command-line switches and arguments but leave the program // component unchanged. /// - void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self); + void(CEF_CALLBACK* reset)(struct _cef_command_line_t* self); /// // Retrieve the original command line string as a vector of strings. The argv // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } /// - void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self, - cef_string_list_t argv); + void(CEF_CALLBACK* get_argv)(struct _cef_command_line_t* self, + cef_string_list_t argv); /// // Constructs and returns the represented command line string. Use this // function cautiously because quoting behavior is unclear. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)( + cef_string_userfree_t(CEF_CALLBACK* get_command_line_string)( struct _cef_command_line_t* self); /// // Get the program part of the command line string (the first item). /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_program)( + cef_string_userfree_t(CEF_CALLBACK* get_program)( struct _cef_command_line_t* self); /// // Set the program part of the command line string (the first item). /// - void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self, - const cef_string_t* program); + void(CEF_CALLBACK* set_program)(struct _cef_command_line_t* self, + const cef_string_t* program); /// // Returns true (1) if the command line has switches. /// - int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self); + int(CEF_CALLBACK* has_switches)(struct _cef_command_line_t* self); /// // Returns true (1) if the command line contains the given switch. /// - int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self, - const cef_string_t* name); + int(CEF_CALLBACK* has_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); /// // Returns the value associated with the given switch. If the switch has no // value or isn't present this function returns the NULL string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_switch_value)( - struct _cef_command_line_t* self, const cef_string_t* name); + cef_string_userfree_t(CEF_CALLBACK* get_switch_value)( + struct _cef_command_line_t* self, + const cef_string_t* name); /// // Returns the map of switch names and values. If a switch has no value an // NULL string is returned. /// - void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self, - cef_string_map_t switches); + void(CEF_CALLBACK* get_switches)(struct _cef_command_line_t* self, + cef_string_map_t switches); /// // Add a switch to the end of the command line. If the switch has no value // pass an NULL value string. /// - void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self, - const cef_string_t* name); + void(CEF_CALLBACK* append_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); /// // Add a switch with the specified value to the end of the command line. /// - void (CEF_CALLBACK *append_switch_with_value)( - struct _cef_command_line_t* self, const cef_string_t* name, - const cef_string_t* value); + void(CEF_CALLBACK* append_switch_with_value)(struct _cef_command_line_t* self, + const cef_string_t* name, + const cef_string_t* value); /// // True if there are remaining command line arguments. /// - int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self); + int(CEF_CALLBACK* has_arguments)(struct _cef_command_line_t* self); /// // Get the remaining command line arguments. /// - void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self, - cef_string_list_t arguments); + void(CEF_CALLBACK* get_arguments)(struct _cef_command_line_t* self, + cef_string_list_t arguments); /// // Add an argument to the end of the command line. /// - void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self, - const cef_string_t* argument); + void(CEF_CALLBACK* append_argument)(struct _cef_command_line_t* self, + const cef_string_t* argument); /// // Insert a command before the current command. Common for debuggers, like // "valgrind" or "gdb --args". /// - void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self, - const cef_string_t* wrapper); + void(CEF_CALLBACK* prepend_wrapper)(struct _cef_command_line_t* self, + const cef_string_t* wrapper); } cef_command_line_t; - /// // Create a new cef_command_line_t instance. /// @@ -205,7 +207,6 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create(); /// CEF_EXPORT cef_command_line_t* cef_command_line_get_global(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_context_menu_handler_capi.h b/include/capi/cef_context_menu_handler_capi.h index b063548ed..344dc9dc6 100644 --- a/include/capi/cef_context_menu_handler_capi.h +++ b/include/capi/cef_context_menu_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=2e295ba277083061103147a400bc30f78e6a94f5$ +// #ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ @@ -62,16 +64,16 @@ typedef struct _cef_run_context_menu_callback_t { // Complete context menu display by selecting the specified |command_id| and // |event_flags|. /// - void (CEF_CALLBACK *cont)(struct _cef_run_context_menu_callback_t* self, - int command_id, cef_event_flags_t event_flags); + void(CEF_CALLBACK* cont)(struct _cef_run_context_menu_callback_t* self, + int command_id, + cef_event_flags_t event_flags); /// // Cancel context menu display. /// - void (CEF_CALLBACK *cancel)(struct _cef_run_context_menu_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_run_context_menu_callback_t* self); } cef_run_context_menu_callback_t; - /// // Implement this structure to handle context menu events. The functions of this // structure will be called on the UI thread. @@ -89,9 +91,11 @@ typedef struct _cef_context_menu_handler_t { // modified to show a custom menu. Do not keep references to |params| or // |model| outside of this callback. /// - void (CEF_CALLBACK *on_before_context_menu)( - struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + void(CEF_CALLBACK* on_before_context_menu)( + struct _cef_context_menu_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_context_menu_params_t* params, struct _cef_menu_model_t* model); /// @@ -102,8 +106,10 @@ typedef struct _cef_context_menu_handler_t { // selected command ID. For default display return false (0). Do not keep // references to |params| or |model| outside of this callback. /// - int (CEF_CALLBACK *run_context_menu)(struct _cef_context_menu_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, + int(CEF_CALLBACK* run_context_menu)( + struct _cef_context_menu_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, struct _cef_menu_model_t* model, struct _cef_run_context_menu_callback_t* callback); @@ -117,21 +123,24 @@ typedef struct _cef_context_menu_handler_t { // on_before_context_menu(). Do not keep a reference to |params| outside of // this callback. /// - int (CEF_CALLBACK *on_context_menu_command)( - struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, - int command_id, cef_event_flags_t event_flags); + int(CEF_CALLBACK* on_context_menu_command)( + struct _cef_context_menu_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_context_menu_params_t* params, + int command_id, + cef_event_flags_t event_flags); /// // Called when the context menu is dismissed irregardless of whether the menu // was NULL or a command was selected. /// - void (CEF_CALLBACK *on_context_menu_dismissed)( - struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + void(CEF_CALLBACK* on_context_menu_dismissed)( + struct _cef_context_menu_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame); } cef_context_menu_handler_t; - /// // Provides information about the context menu state. The ethods of this // structure can only be accessed on browser process the UI thread. @@ -146,19 +155,19 @@ typedef struct _cef_context_menu_params_t { // Returns the X coordinate of the mouse where the context menu was invoked. // Coords are relative to the associated RenderView's origin. /// - int (CEF_CALLBACK *get_xcoord)(struct _cef_context_menu_params_t* self); + int(CEF_CALLBACK* get_xcoord)(struct _cef_context_menu_params_t* self); /// // Returns the Y coordinate of the mouse where the context menu was invoked. // Coords are relative to the associated RenderView's origin. /// - int (CEF_CALLBACK *get_ycoord)(struct _cef_context_menu_params_t* self); + int(CEF_CALLBACK* get_ycoord)(struct _cef_context_menu_params_t* self); /// // Returns flags representing the type of node that the context menu was // invoked on. /// - cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)( + cef_context_menu_type_flags_t(CEF_CALLBACK* get_type_flags)( struct _cef_context_menu_params_t* self); /// @@ -166,7 +175,7 @@ typedef struct _cef_context_menu_params_t { // context menu was invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + cef_string_userfree_t(CEF_CALLBACK* get_link_url)( struct _cef_context_menu_params_t* self); /// @@ -174,7 +183,7 @@ typedef struct _cef_context_menu_params_t { // don't validate this field in the frontend process. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_unfiltered_link_url)( + cef_string_userfree_t(CEF_CALLBACK* get_unfiltered_link_url)( struct _cef_context_menu_params_t* self); /// @@ -182,14 +191,14 @@ typedef struct _cef_context_menu_params_t { // invoked on. Example of elements with source URLs are img, audio, and video. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_source_url)( + cef_string_userfree_t(CEF_CALLBACK* get_source_url)( struct _cef_context_menu_params_t* self); /// // Returns true (1) if the context menu was invoked on an image which has non- // NULL contents. /// - int (CEF_CALLBACK *has_image_contents)( + int(CEF_CALLBACK* has_image_contents)( struct _cef_context_menu_params_t* self); /// @@ -197,21 +206,21 @@ typedef struct _cef_context_menu_params_t { // an image. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_title_text)( + cef_string_userfree_t(CEF_CALLBACK* get_title_text)( struct _cef_context_menu_params_t* self); /// // Returns the URL of the top level page that the context menu was invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_page_url)( + cef_string_userfree_t(CEF_CALLBACK* get_page_url)( struct _cef_context_menu_params_t* self); /// // Returns the URL of the subframe that the context menu was invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_frame_url)( + cef_string_userfree_t(CEF_CALLBACK* get_frame_url)( struct _cef_context_menu_params_t* self); /// @@ -219,20 +228,20 @@ typedef struct _cef_context_menu_params_t { // invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_frame_charset)( + cef_string_userfree_t(CEF_CALLBACK* get_frame_charset)( struct _cef_context_menu_params_t* self); /// // Returns the type of context node that the context menu was invoked on. /// - cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)( + cef_context_menu_media_type_t(CEF_CALLBACK* get_media_type)( struct _cef_context_menu_params_t* self); /// // Returns flags representing the actions supported by the media element, if // any, that the context menu was invoked on. /// - cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)( + cef_context_menu_media_state_flags_t(CEF_CALLBACK* get_media_state_flags)( struct _cef_context_menu_params_t* self); /// @@ -240,7 +249,7 @@ typedef struct _cef_context_menu_params_t { // invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selection_text)( + cef_string_userfree_t(CEF_CALLBACK* get_selection_text)( struct _cef_context_menu_params_t* self); /// @@ -248,7 +257,7 @@ typedef struct _cef_context_menu_params_t { // invoked on. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_misspelled_word)( + cef_string_userfree_t(CEF_CALLBACK* get_misspelled_word)( struct _cef_context_menu_params_t* self); /// @@ -256,26 +265,27 @@ typedef struct _cef_context_menu_params_t { // |suggestions| from the spell check service for the misspelled word if there // is one. /// - int (CEF_CALLBACK *get_dictionary_suggestions)( - struct _cef_context_menu_params_t* self, cef_string_list_t suggestions); + int(CEF_CALLBACK* get_dictionary_suggestions)( + struct _cef_context_menu_params_t* self, + cef_string_list_t suggestions); /// // Returns true (1) if the context menu was invoked on an editable node. /// - int (CEF_CALLBACK *is_editable)(struct _cef_context_menu_params_t* self); + int(CEF_CALLBACK* is_editable)(struct _cef_context_menu_params_t* self); /// // Returns true (1) if the context menu was invoked on an editable node where // spell-check is enabled. /// - int (CEF_CALLBACK *is_spell_check_enabled)( + int(CEF_CALLBACK* is_spell_check_enabled)( struct _cef_context_menu_params_t* self); /// // Returns flags representing the actions supported by the editable node, if // any, that the context menu was invoked on. /// - cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)( + cef_context_menu_edit_state_flags_t(CEF_CALLBACK* get_edit_state_flags)( struct _cef_context_menu_params_t* self); /// @@ -283,15 +293,14 @@ typedef struct _cef_context_menu_params_t { // renderer process (for example, plugin placeholder or pepper plugin menu // items). /// - int (CEF_CALLBACK *is_custom_menu)(struct _cef_context_menu_params_t* self); + int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self); /// // Returns true (1) if the context menu was invoked from a pepper plugin. /// - int (CEF_CALLBACK *is_pepper_menu)(struct _cef_context_menu_params_t* self); + int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self); } cef_context_menu_params_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_cookie_capi.h b/include/capi/cef_cookie_capi.h index 6ba8dca57..99cc66e8b 100644 --- a/include/capi/cef_cookie_capi.h +++ b/include/capi/cef_cookie_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c2bf8084385f3c795ae7494da6970a0a61b96ac6$ +// #ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ @@ -65,16 +67,18 @@ typedef struct _cef_cookie_manager_t { // NULL it will be executed asnychronously on the IO thread after the change // has been applied. Must be called before any cookies are accessed. /// - void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self, - cef_string_list_t schemes, struct _cef_completion_callback_t* callback); + void(CEF_CALLBACK* set_supported_schemes)( + struct _cef_cookie_manager_t* self, + cef_string_list_t schemes, + struct _cef_completion_callback_t* callback); /// // Visit all cookies on the IO thread. The returned cookies are ordered by // longest path, then by earliest creation date. Returns false (0) if cookies // cannot be accessed. /// - int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self, - struct _cef_cookie_visitor_t* visitor); + int(CEF_CALLBACK* visit_all_cookies)(struct _cef_cookie_manager_t* self, + struct _cef_cookie_visitor_t* visitor); /// // Visit a subset of cookies on the IO thread. The results are filtered by the @@ -83,9 +87,10 @@ typedef struct _cef_cookie_manager_t { // cookies are ordered by longest path, then by earliest creation date. // Returns false (0) if cookies cannot be accessed. /// - int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self, - const cef_string_t* url, int includeHttpOnly, - struct _cef_cookie_visitor_t* visitor); + int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, + int includeHttpOnly, + struct _cef_cookie_visitor_t* visitor); /// // Sets a cookie given a valid URL and explicit user-provided cookie @@ -96,9 +101,10 @@ typedef struct _cef_cookie_manager_t { // asnychronously on the IO thread after the cookie has been set. Returns // false (0) if an invalid URL is specified or if cookies cannot be accessed. /// - int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self, - const cef_string_t* url, const struct _cef_cookie_t* cookie, - struct _cef_set_cookie_callback_t* callback); + int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, + const struct _cef_cookie_t* cookie, + struct _cef_set_cookie_callback_t* callback); /// // Delete all cookies that match the specified parameters. If both |url| and @@ -111,8 +117,10 @@ typedef struct _cef_cookie_manager_t { // or if cookies cannot be accessed. Cookies can alternately be deleted using // the Visit*Cookies() functions. /// - int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self, - const cef_string_t* url, const cef_string_t* cookie_name, + int(CEF_CALLBACK* delete_cookies)( + struct _cef_cookie_manager_t* self, + const cef_string_t* url, + const cef_string_t* cookie_name, struct _cef_delete_cookies_callback_t* callback); /// @@ -125,8 +133,10 @@ typedef struct _cef_cookie_manager_t { // asnychronously on the IO thread after the manager's storage has been // initialized. Returns false (0) if cookies cannot be accessed. /// - int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self, - const cef_string_t* path, int persist_session_cookies, + int(CEF_CALLBACK* set_storage_path)( + struct _cef_cookie_manager_t* self, + const cef_string_t* path, + int persist_session_cookies, struct _cef_completion_callback_t* callback); /// @@ -134,11 +144,10 @@ typedef struct _cef_cookie_manager_t { // be executed asnychronously on the IO thread after the flush is complete. // Returns false (0) if cookies cannot be accessed. /// - int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self, - struct _cef_completion_callback_t* callback); + int(CEF_CALLBACK* flush_store)(struct _cef_cookie_manager_t* self, + struct _cef_completion_callback_t* callback); } cef_cookie_manager_t; - /// // Returns the global cookie manager. By default data will be stored at // CefSettings.cache_path if specified or in memory otherwise. If |callback| is @@ -160,10 +169,10 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( // manager's storage has been initialized. /// CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( - const cef_string_t* path, int persist_session_cookies, + const cef_string_t* path, + int persist_session_cookies, struct _cef_completion_callback_t* callback); - /// // Structure to implement for visiting cookie values. The functions of this // structure will always be called on the IO thread. @@ -181,12 +190,13 @@ typedef struct _cef_cookie_visitor_t { // Return false (0) to stop visiting cookies. This function may never be // called if no cookies are found. /// - int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self, - const struct _cef_cookie_t* cookie, int count, int total, - int* deleteCookie); + int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self, + const struct _cef_cookie_t* cookie, + int count, + int total, + int* deleteCookie); } cef_cookie_visitor_t; - /// // Structure to implement to be notified of asynchronous completion via // cef_cookie_manager_t::set_cookie(). @@ -201,11 +211,10 @@ typedef struct _cef_set_cookie_callback_t { // Method that will be called upon completion. |success| will be true (1) if // the cookie was set successfully. /// - void (CEF_CALLBACK *on_complete)(struct _cef_set_cookie_callback_t* self, - int success); + void(CEF_CALLBACK* on_complete)(struct _cef_set_cookie_callback_t* self, + int success); } cef_set_cookie_callback_t; - /// // Structure to implement to be notified of asynchronous completion via // cef_cookie_manager_t::delete_cookies(). @@ -220,11 +229,10 @@ typedef struct _cef_delete_cookies_callback_t { // Method that will be called upon completion. |num_deleted| will be the // number of cookies that were deleted or -1 if unknown. /// - void (CEF_CALLBACK *on_complete)(struct _cef_delete_cookies_callback_t* self, - int num_deleted); + void(CEF_CALLBACK* on_complete)(struct _cef_delete_cookies_callback_t* self, + int num_deleted); } cef_delete_cookies_callback_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_crash_util_capi.h b/include/capi/cef_crash_util_capi.h index 1a1eb0e02..d52ecaa69 100644 --- a/include/capi/cef_crash_util_capi.h +++ b/include/capi/cef_crash_util_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=8b7354f5a1ad6b255d77e477c64374b927f4fe28$ +// #ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Crash reporting is configured using an INI-style config file named // "crash_reporter.cfg". On Windows and Linux this file must be placed next to @@ -143,7 +144,7 @@ CEF_EXPORT int cef_crash_reporting_enabled(); // Sets or clears a specific key-value pair from the crash metadata. /// CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key, - const cef_string_t* value); + const cef_string_t* value); #ifdef __cplusplus } diff --git a/include/capi/cef_dialog_handler_capi.h b/include/capi/cef_dialog_handler_capi.h index 76818d3da..35d33ea34 100644 --- a/include/capi/cef_dialog_handler_capi.h +++ b/include/capi/cef_dialog_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=b8a44f4f624ba51107d06ff3d1a7934e83765786$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Callback structure for asynchronous continuation of file dialog requests. /// @@ -62,16 +63,16 @@ typedef struct _cef_file_dialog_callback_t { // or a list of values depending on the dialog mode. An NULL |file_paths| // value is treated the same as calling cancel(). /// - void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self, - int selected_accept_filter, cef_string_list_t file_paths); + void(CEF_CALLBACK* cont)(struct _cef_file_dialog_callback_t* self, + int selected_accept_filter, + cef_string_list_t file_paths); /// // Cancel the file selection. /// - void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self); } cef_file_dialog_callback_t; - /// // Implement this structure to handle dialog events. The functions of this // structure will be called on the browser process UI thread. @@ -97,14 +98,17 @@ typedef struct _cef_dialog_handler_t { // return true (1) and execute |callback| either inline or at a later time. To // display the default dialog return false (0). /// - int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self, - struct _cef_browser_t* browser, cef_file_dialog_mode_t mode, - const cef_string_t* title, const cef_string_t* default_file_path, - cef_string_list_t accept_filters, int selected_accept_filter, + int(CEF_CALLBACK* on_file_dialog)( + struct _cef_dialog_handler_t* self, + struct _cef_browser_t* browser, + cef_file_dialog_mode_t mode, + const cef_string_t* title, + const cef_string_t* default_file_path, + cef_string_list_t accept_filters, + int selected_accept_filter, struct _cef_file_dialog_callback_t* callback); } cef_dialog_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_display_handler_capi.h b/include/capi/cef_display_handler_capi.h index 6dc3fd0fd..4a9907654 100644 --- a/include/capi/cef_display_handler_capi.h +++ b/include/capi/cef_display_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=f0f3fd4cab00c0eb11956e674a111cb30d3af100$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to browser display state. // The functions of this structure will be called on the UI thread. @@ -60,21 +61,24 @@ typedef struct _cef_display_handler_t { /// // Called when a frame's address has changed. /// - void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* url); + void(CEF_CALLBACK* on_address_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + const cef_string_t* url); /// // Called when the page title changes. /// - void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* title); + void(CEF_CALLBACK* on_title_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* title); /// // Called when the page icon changes. /// - void (CEF_CALLBACK *on_favicon_urlchange)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, cef_string_list_t icon_urls); + void(CEF_CALLBACK* on_favicon_urlchange)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + cef_string_list_t icon_urls); /// // Called when web content in the page has toggled fullscreen mode. If @@ -83,8 +87,9 @@ typedef struct _cef_display_handler_t { // automatically return to its original size and position. The client is // responsible for resizing the browser if desired. /// - void (CEF_CALLBACK *on_fullscreen_mode_change)( - struct _cef_display_handler_t* self, struct _cef_browser_t* browser, + void(CEF_CALLBACK* on_fullscreen_mode_change)( + struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, int fullscreen); /// @@ -95,26 +100,29 @@ typedef struct _cef_display_handler_t { // tooltip. When window rendering is disabled the application is responsible // for drawing tooltips and the return value is ignored. /// - int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, cef_string_t* text); + int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + cef_string_t* text); /// // Called when the browser receives a status message. |value| contains the // text that will be displayed in the status message. /// - void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* value); + void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* value); /// // Called to display a console message. Return true (1) to stop the message // from being output to the console. /// - int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* message, - const cef_string_t* source, int line); + int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* message, + const cef_string_t* source, + int line); } cef_display_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_dom_capi.h b/include/capi/cef_dom_capi.h index b3857a806..3ed6f7ed8 100644 --- a/include/capi/cef_dom_capi.h +++ b/include/capi/cef_dom_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=db82ff508cb1b4a03001b8b30bc5126186ee1bd2$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ @@ -64,11 +66,10 @@ typedef struct _cef_domvisitor_t { // keep references to or attempt to access any DOM objects outside the scope // of this function. /// - void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, - struct _cef_domdocument_t* document); + void(CEF_CALLBACK* visit)(struct _cef_domvisitor_t* self, + struct _cef_domdocument_t* document); } cef_domvisitor_t; - /// // Structure used to represent a DOM document. The functions of this structure // should only be called on the render process main thread thread. @@ -82,81 +83,82 @@ typedef struct _cef_domdocument_t { /// // Returns the document type. /// - cef_dom_document_type_t (CEF_CALLBACK *get_type)( + cef_dom_document_type_t(CEF_CALLBACK* get_type)( struct _cef_domdocument_t* self); /// // Returns the root document node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_document)( + struct _cef_domnode_t*(CEF_CALLBACK* get_document)( struct _cef_domdocument_t* self); /// // Returns the BODY node of an HTML document. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_body)( + struct _cef_domnode_t*(CEF_CALLBACK* get_body)( struct _cef_domdocument_t* self); /// // Returns the HEAD node of an HTML document. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_head)( + struct _cef_domnode_t*(CEF_CALLBACK* get_head)( struct _cef_domdocument_t* self); /// // Returns the title of an HTML document. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_title)( + cef_string_userfree_t(CEF_CALLBACK* get_title)( struct _cef_domdocument_t* self); /// // Returns the document element with the specified ID value. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)( - struct _cef_domdocument_t* self, const cef_string_t* id); + struct _cef_domnode_t*(CEF_CALLBACK* get_element_by_id)( + struct _cef_domdocument_t* self, + const cef_string_t* id); /// // Returns the node that currently has keyboard focus. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)( + struct _cef_domnode_t*(CEF_CALLBACK* get_focused_node)( struct _cef_domdocument_t* self); /// // Returns true (1) if a portion of the document is selected. /// - int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self); + int(CEF_CALLBACK* has_selection)(struct _cef_domdocument_t* self); /// // Returns the selection offset within the start node. /// - int (CEF_CALLBACK *get_selection_start_offset)( + int(CEF_CALLBACK* get_selection_start_offset)( struct _cef_domdocument_t* self); /// // Returns the selection offset within the end node. /// - int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self); + int(CEF_CALLBACK* get_selection_end_offset)(struct _cef_domdocument_t* self); /// // Returns the contents of this selection as markup. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)( + cef_string_userfree_t(CEF_CALLBACK* get_selection_as_markup)( struct _cef_domdocument_t* self); /// // Returns the contents of this selection as text. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)( + cef_string_userfree_t(CEF_CALLBACK* get_selection_as_text)( struct _cef_domdocument_t* self); /// // Returns the base URL for the document. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_base_url)( + cef_string_userfree_t(CEF_CALLBACK* get_base_url)( struct _cef_domdocument_t* self); /// @@ -164,11 +166,11 @@ typedef struct _cef_domdocument_t { // partial URL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( - struct _cef_domdocument_t* self, const cef_string_t* partialURL); + cef_string_userfree_t(CEF_CALLBACK* get_complete_url)( + struct _cef_domdocument_t* self, + const cef_string_t* partialURL); } cef_domdocument_t; - /// // Structure used to represent a DOM node. The functions of this structure // should only be called on the render process main thread. @@ -182,163 +184,162 @@ typedef struct _cef_domnode_t { /// // Returns the type for this node. /// - cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self); + cef_dom_node_type_t(CEF_CALLBACK* get_type)(struct _cef_domnode_t* self); /// // Returns true (1) if this is a text node. /// - int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* is_text)(struct _cef_domnode_t* self); /// // Returns true (1) if this is an element node. /// - int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* is_element)(struct _cef_domnode_t* self); /// // Returns true (1) if this is an editable node. /// - int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* is_editable)(struct _cef_domnode_t* self); /// // Returns true (1) if this is a form control element node. /// - int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* is_form_control_element)(struct _cef_domnode_t* self); /// // Returns the type of this form control element node. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)( + cef_string_userfree_t(CEF_CALLBACK* get_form_control_element_type)( struct _cef_domnode_t* self); /// // Returns true (1) if this object is pointing to the same handle as |that| // object. /// - int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self, - struct _cef_domnode_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_domnode_t* self, + struct _cef_domnode_t* that); /// // Returns the name of this node. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_domnode_t* self); /// // Returns the value of this node. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_value)(struct _cef_domnode_t* self); /// // Set the value of this node. Returns true (1) on success. /// - int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self, - const cef_string_t* value); + int(CEF_CALLBACK* set_value)(struct _cef_domnode_t* self, + const cef_string_t* value); /// // Returns the contents of this node as markup. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_as_markup)( + cef_string_userfree_t(CEF_CALLBACK* get_as_markup)( struct _cef_domnode_t* self); /// // Returns the document associated with this node. /// - struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( + struct _cef_domdocument_t*(CEF_CALLBACK* get_document)( struct _cef_domnode_t* self); /// // Returns the parent node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_parent)( - struct _cef_domnode_t* self); + struct _cef_domnode_t*(CEF_CALLBACK* get_parent)(struct _cef_domnode_t* self); /// // Returns the previous sibling node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)( + struct _cef_domnode_t*(CEF_CALLBACK* get_previous_sibling)( struct _cef_domnode_t* self); /// // Returns the next sibling node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)( + struct _cef_domnode_t*(CEF_CALLBACK* get_next_sibling)( struct _cef_domnode_t* self); /// // Returns true (1) if this node has child nodes. /// - int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* has_children)(struct _cef_domnode_t* self); /// // Return the first child node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)( + struct _cef_domnode_t*(CEF_CALLBACK* get_first_child)( struct _cef_domnode_t* self); /// // Returns the last child node. /// - struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)( + struct _cef_domnode_t*(CEF_CALLBACK* get_last_child)( struct _cef_domnode_t* self); - // The following functions are valid only for element nodes. /// // Returns the tag name of this element. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)( + cef_string_userfree_t(CEF_CALLBACK* get_element_tag_name)( struct _cef_domnode_t* self); /// // Returns true (1) if this element has attributes. /// - int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self); + int(CEF_CALLBACK* has_element_attributes)(struct _cef_domnode_t* self); /// // Returns true (1) if this element has an attribute named |attrName|. /// - int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self, - const cef_string_t* attrName); + int(CEF_CALLBACK* has_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName); /// // Returns the element attribute named |attrName|. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)( - struct _cef_domnode_t* self, const cef_string_t* attrName); + cef_string_userfree_t(CEF_CALLBACK* get_element_attribute)( + struct _cef_domnode_t* self, + const cef_string_t* attrName); /// // Returns a map of all element attributes. /// - void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self, - cef_string_map_t attrMap); + void(CEF_CALLBACK* get_element_attributes)(struct _cef_domnode_t* self, + cef_string_map_t attrMap); /// // Set the value for the element attribute named |attrName|. Returns true (1) // on success. /// - int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self, - const cef_string_t* attrName, const cef_string_t* value); + int(CEF_CALLBACK* set_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName, + const cef_string_t* value); /// // Returns the inner text of the element. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( + cef_string_userfree_t(CEF_CALLBACK* get_element_inner_text)( struct _cef_domnode_t* self); /// // Returns the bounds of the element. /// - cef_rect_t (CEF_CALLBACK *get_element_bounds)(struct _cef_domnode_t* self); + cef_rect_t(CEF_CALLBACK* get_element_bounds)(struct _cef_domnode_t* self); } cef_domnode_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_download_handler_capi.h b/include/capi/cef_download_handler_capi.h index 12ff657bf..f247a6c8d 100644 --- a/include/capi/cef_download_handler_capi.h +++ b/include/capi/cef_download_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=4475f7e48898bdef8051c849873fb2528320cd9c$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Callback structure used to asynchronously continue a download. /// @@ -62,11 +63,11 @@ typedef struct _cef_before_download_callback_t { // suggested name and the default temp directory. Set |show_dialog| to true // (1) if you do wish to show the default "Save As" dialog. /// - void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self, - const cef_string_t* download_path, int show_dialog); + void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self, + const cef_string_t* download_path, + int show_dialog); } cef_before_download_callback_t; - /// // Callback structure used to asynchronously cancel a download. /// @@ -79,20 +80,19 @@ typedef struct _cef_download_item_callback_t { /// // Call to cancel the download. /// - void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_download_item_callback_t* self); /// // Call to pause the download. /// - void (CEF_CALLBACK *pause)(struct _cef_download_item_callback_t* self); + void(CEF_CALLBACK* pause)(struct _cef_download_item_callback_t* self); /// // Call to resume the download. /// - void (CEF_CALLBACK *resume)(struct _cef_download_item_callback_t* self); + void(CEF_CALLBACK* resume)(struct _cef_download_item_callback_t* self); } cef_download_item_callback_t; - /// // Structure used to handle file downloads. The functions of this structure will // called on the browser process UI thread. @@ -110,7 +110,8 @@ typedef struct _cef_download_handler_t { // download if desired. Do not keep a reference to |download_item| outside of // this function. /// - void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self, + void(CEF_CALLBACK* on_before_download)( + struct _cef_download_handler_t* self, struct _cef_browser_t* browser, struct _cef_download_item_t* download_item, const cef_string_t* suggested_name, @@ -123,13 +124,13 @@ typedef struct _cef_download_handler_t { // download if desired. Do not keep a reference to |download_item| outside of // this function. /// - void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self, + void(CEF_CALLBACK* on_download_updated)( + struct _cef_download_handler_t* self, struct _cef_browser_t* browser, struct _cef_download_item_t* download_item, struct _cef_download_item_callback_t* callback); } cef_download_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_download_item_capi.h b/include/capi/cef_download_item_capi.h index 9ed53f6ae..afeae3141 100644 --- a/include/capi/cef_download_item_capi.h +++ b/include/capi/cef_download_item_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=cc669703d613f5a6a5bae95030835dc99f55a6fa$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure used to represent a download item. /// @@ -58,103 +59,102 @@ typedef struct _cef_download_item_t { // Returns true (1) if this object is valid. Do not call any other functions // if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_download_item_t* self); /// // Returns true (1) if the download is in progress. /// - int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self); + int(CEF_CALLBACK* is_in_progress)(struct _cef_download_item_t* self); /// // Returns true (1) if the download is complete. /// - int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self); + int(CEF_CALLBACK* is_complete)(struct _cef_download_item_t* self); /// // Returns true (1) if the download has been canceled or interrupted. /// - int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self); + int(CEF_CALLBACK* is_canceled)(struct _cef_download_item_t* self); /// // Returns a simple speed estimate in bytes/s. /// - int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self); + int64(CEF_CALLBACK* get_current_speed)(struct _cef_download_item_t* self); /// // Returns the rough percent complete or -1 if the receive total size is // unknown. /// - int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self); + int(CEF_CALLBACK* get_percent_complete)(struct _cef_download_item_t* self); /// // Returns the total number of bytes. /// - int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self); + int64(CEF_CALLBACK* get_total_bytes)(struct _cef_download_item_t* self); /// // Returns the number of received bytes. /// - int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self); + int64(CEF_CALLBACK* get_received_bytes)(struct _cef_download_item_t* self); /// // Returns the time that the download started. /// - cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self); + cef_time_t(CEF_CALLBACK* get_start_time)(struct _cef_download_item_t* self); /// // Returns the time that the download ended. /// - cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self); + cef_time_t(CEF_CALLBACK* get_end_time)(struct _cef_download_item_t* self); /// // Returns the full path to the downloaded or downloading file. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_full_path)( + cef_string_userfree_t(CEF_CALLBACK* get_full_path)( struct _cef_download_item_t* self); /// // Returns the unique identifier for this download. /// - uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self); + uint32(CEF_CALLBACK* get_id)(struct _cef_download_item_t* self); /// // Returns the URL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_url)( + cef_string_userfree_t(CEF_CALLBACK* get_url)( struct _cef_download_item_t* self); /// // Returns the original URL before any redirections. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_original_url)( + cef_string_userfree_t(CEF_CALLBACK* get_original_url)( struct _cef_download_item_t* self); /// // Returns the suggested file name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)( + cef_string_userfree_t(CEF_CALLBACK* get_suggested_file_name)( struct _cef_download_item_t* self); /// // Returns the content disposition. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)( + cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)( struct _cef_download_item_t* self); /// // Returns the mime type. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + cef_string_userfree_t(CEF_CALLBACK* get_mime_type)( struct _cef_download_item_t* self); } cef_download_item_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_drag_data_capi.h b/include/capi/cef_drag_data_capi.h index 38de241e4..7381acb39 100644 --- a/include/capi/cef_drag_data_capi.h +++ b/include/capi/cef_drag_data_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=a4b5264c1e685cad86203772631460684ee7820d$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Structure used to represent drag data. The functions of this structure may be // called on any thread. @@ -60,61 +61,61 @@ typedef struct _cef_drag_data_t { /// // Returns a copy of the current object. /// - struct _cef_drag_data_t* (CEF_CALLBACK *clone)(struct _cef_drag_data_t* self); + struct _cef_drag_data_t*(CEF_CALLBACK* clone)(struct _cef_drag_data_t* self); /// // Returns true (1) if this object is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_drag_data_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_drag_data_t* self); /// // Returns true (1) if the drag data is a link. /// - int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); + int(CEF_CALLBACK* is_link)(struct _cef_drag_data_t* self); /// // Returns true (1) if the drag data is a text or html fragment. /// - int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); + int(CEF_CALLBACK* is_fragment)(struct _cef_drag_data_t* self); /// // Returns true (1) if the drag data is a file. /// - int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); + int(CEF_CALLBACK* is_file)(struct _cef_drag_data_t* self); /// // Return the link URL that is being dragged. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + cef_string_userfree_t(CEF_CALLBACK* get_link_url)( struct _cef_drag_data_t* self); /// // Return the title associated with the link being dragged. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_title)( + cef_string_userfree_t(CEF_CALLBACK* get_link_title)( struct _cef_drag_data_t* self); /// // Return the metadata, if any, associated with the link being dragged. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( + cef_string_userfree_t(CEF_CALLBACK* get_link_metadata)( struct _cef_drag_data_t* self); /// // Return the plain text fragment that is being dragged. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( + cef_string_userfree_t(CEF_CALLBACK* get_fragment_text)( struct _cef_drag_data_t* self); /// // Return the text/html fragment that is being dragged. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( + cef_string_userfree_t(CEF_CALLBACK* get_fragment_html)( struct _cef_drag_data_t* self); /// @@ -122,14 +123,14 @@ typedef struct _cef_drag_data_t { // resolving relative URLs and may be NULL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( + cef_string_userfree_t(CEF_CALLBACK* get_fragment_base_url)( struct _cef_drag_data_t* self); /// // Return the name of the file being dragged out of the browser window. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + cef_string_userfree_t(CEF_CALLBACK* get_file_name)( struct _cef_drag_data_t* self); /// @@ -138,89 +139,88 @@ typedef struct _cef_drag_data_t { // this function will return the size of the file contents in bytes. Call // get_file_name() to get a suggested name for the file. /// - size_t (CEF_CALLBACK *get_file_contents)(struct _cef_drag_data_t* self, - struct _cef_stream_writer_t* writer); + size_t(CEF_CALLBACK* get_file_contents)(struct _cef_drag_data_t* self, + struct _cef_stream_writer_t* writer); /// // Retrieve the list of file names that are being dragged into the browser // window. /// - int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, - cef_string_list_t names); + int(CEF_CALLBACK* get_file_names)(struct _cef_drag_data_t* self, + cef_string_list_t names); /// // Set the link URL that is being dragged. /// - void (CEF_CALLBACK *set_link_url)(struct _cef_drag_data_t* self, - const cef_string_t* url); + void(CEF_CALLBACK* set_link_url)(struct _cef_drag_data_t* self, + const cef_string_t* url); /// // Set the title associated with the link being dragged. /// - void (CEF_CALLBACK *set_link_title)(struct _cef_drag_data_t* self, - const cef_string_t* title); + void(CEF_CALLBACK* set_link_title)(struct _cef_drag_data_t* self, + const cef_string_t* title); /// // Set the metadata associated with the link being dragged. /// - void (CEF_CALLBACK *set_link_metadata)(struct _cef_drag_data_t* self, - const cef_string_t* data); + void(CEF_CALLBACK* set_link_metadata)(struct _cef_drag_data_t* self, + const cef_string_t* data); /// // Set the plain text fragment that is being dragged. /// - void (CEF_CALLBACK *set_fragment_text)(struct _cef_drag_data_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* set_fragment_text)(struct _cef_drag_data_t* self, + const cef_string_t* text); /// // Set the text/html fragment that is being dragged. /// - void (CEF_CALLBACK *set_fragment_html)(struct _cef_drag_data_t* self, - const cef_string_t* html); + void(CEF_CALLBACK* set_fragment_html)(struct _cef_drag_data_t* self, + const cef_string_t* html); /// // Set the base URL that the fragment came from. /// - void (CEF_CALLBACK *set_fragment_base_url)(struct _cef_drag_data_t* self, - const cef_string_t* base_url); + void(CEF_CALLBACK* set_fragment_base_url)(struct _cef_drag_data_t* self, + const cef_string_t* base_url); /// // Reset the file contents. You should do this before calling // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us // to drag in this kind of data. /// - void (CEF_CALLBACK *reset_file_contents)(struct _cef_drag_data_t* self); + void(CEF_CALLBACK* reset_file_contents)(struct _cef_drag_data_t* self); /// // Add a file that is being dragged into the webview. /// - void (CEF_CALLBACK *add_file)(struct _cef_drag_data_t* self, - const cef_string_t* path, const cef_string_t* display_name); + void(CEF_CALLBACK* add_file)(struct _cef_drag_data_t* self, + const cef_string_t* path, + const cef_string_t* display_name); /// // Get the image representation of drag data. May return NULL if no image // representation is available. /// - struct _cef_image_t* (CEF_CALLBACK *get_image)(struct _cef_drag_data_t* self); + struct _cef_image_t*(CEF_CALLBACK* get_image)(struct _cef_drag_data_t* self); /// // Get the image hotspot (drag start location relative to image dimensions). /// - cef_point_t (CEF_CALLBACK *get_image_hotspot)(struct _cef_drag_data_t* self); + cef_point_t(CEF_CALLBACK* get_image_hotspot)(struct _cef_drag_data_t* self); /// // Returns true (1) if an image representation of drag data is available. /// - int (CEF_CALLBACK *has_image)(struct _cef_drag_data_t* self); + int(CEF_CALLBACK* has_image)(struct _cef_drag_data_t* self); } cef_drag_data_t; - /// // Create a new cef_drag_data_t object. /// CEF_EXPORT cef_drag_data_t* cef_drag_data_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_drag_handler_capi.h b/include/capi/cef_drag_handler_capi.h index 35fbb31a5..3893d0bc4 100644 --- a/include/capi/cef_drag_handler_capi.h +++ b/include/capi/cef_drag_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c557dad9522f4bd4c6b3295d149c6b893fc18d52$ +// #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to dragging. The functions // of this structure will be called on the UI thread. @@ -63,9 +64,10 @@ typedef struct _cef_drag_handler_t { // operation. Return false (0) for default drag handling behavior or true (1) // to cancel the drag event. /// - int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, - struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, - cef_drag_operations_mask_t mask); + int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_drag_data_t* dragData, + cef_drag_operations_mask_t mask); /// // Called whenever draggable regions for the browser window change. These can @@ -74,12 +76,13 @@ typedef struct _cef_drag_handler_t { // never be called. If the last draggable region is removed from a document // this function will be called with an NULL vector. /// - void (CEF_CALLBACK *on_draggable_regions_changed)( - struct _cef_drag_handler_t* self, struct _cef_browser_t* browser, - size_t regionsCount, cef_draggable_region_t const* regions); + void(CEF_CALLBACK* on_draggable_regions_changed)( + struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, + size_t regionsCount, + cef_draggable_region_t const* regions); } cef_drag_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_file_util_capi.h b/include/capi/cef_file_util_capi.h index 02eb631d0..4602492fb 100644 --- a/include/capi/cef_file_util_capi.h +++ b/include/capi/cef_file_util_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=4601edefadfafea031f2c5df498262fc2142252b$ +// #ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Creates a directory and all parent directories if they don't already exist. // Returns true (1) on successful creation or if the directory already exists. @@ -71,7 +72,7 @@ CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir); // browser process UI or IO threads is not allowed. /// CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix, - cef_string_t* new_temp_path); + cef_string_t* new_temp_path); /// // Creates a directory within another directory. Extra characters will be @@ -82,7 +83,8 @@ CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix, // or IO threads is not allowed. /// CEF_EXPORT int cef_create_temp_directory_in_directory( - const cef_string_t* base_dir, const cef_string_t* prefix, + const cef_string_t* base_dir, + const cef_string_t* prefix, cef_string_t* new_dir); /// @@ -109,7 +111,8 @@ CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive); // or IO threads is not allowed. /// CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir, - const cef_string_t* dest_file, int include_hidden_files); + const cef_string_t* dest_file, + int include_hidden_files); #ifdef __cplusplus } diff --git a/include/capi/cef_find_handler_capi.h b/include/capi/cef_find_handler_capi.h index d489353f6..892d5eabd 100644 --- a/include/capi/cef_find_handler_capi.h +++ b/include/capi/cef_find_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=975114b079fa271fecbf31ef160974941faed8a4$ +// #ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to find results. The // functions of this structure will be called on the UI thread. @@ -64,13 +65,15 @@ typedef struct _cef_find_handler_t { // current position in the search results, and |finalUpdate| is true (1) if // this is the last find notification. /// - void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self, - struct _cef_browser_t* browser, int identifier, int count, - const cef_rect_t* selectionRect, int activeMatchOrdinal, - int finalUpdate); + void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self, + struct _cef_browser_t* browser, + int identifier, + int count, + const cef_rect_t* selectionRect, + int activeMatchOrdinal, + int finalUpdate); } cef_find_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_focus_handler_capi.h b/include/capi/cef_focus_handler_capi.h index c559acda8..896e0c62c 100644 --- a/include/capi/cef_focus_handler_capi.h +++ b/include/capi/cef_focus_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=bed1f7b94e060b83e3f22eb84ce1274f2d10b3e6$ +// #ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ @@ -47,7 +49,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to focus. The functions of // this structure will be called on the UI thread. @@ -64,25 +65,26 @@ typedef struct _cef_focus_handler_t { // will be true (1) if the browser is giving focus to the next component and // false (0) if the browser is giving focus to the previous component. /// - void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, - struct _cef_browser_t* browser, int next); + void(CEF_CALLBACK* on_take_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, + int next); /// // Called when the browser component is requesting focus. |source| indicates // where the focus request is originating from. Return false (0) to allow the // focus to be set or true (1) to cancel setting the focus. /// - int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, - struct _cef_browser_t* browser, cef_focus_source_t source); + int(CEF_CALLBACK* on_set_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, + cef_focus_source_t source); /// // Called when the browser component has received focus. /// - void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_got_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser); } cef_focus_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_frame_capi.h b/include/capi/cef_frame_capi.h index ead9ab8ed..4dc49a7f1 100644 --- a/include/capi/cef_frame_capi.h +++ b/include/capi/cef_frame_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c1457ef21c14c40422b19b681121283eae3e9d70$ +// #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ @@ -66,83 +68,84 @@ typedef struct _cef_frame_t { /// // True if this object is currently attached to a valid frame. /// - int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_frame_t* self); /// // Execute undo in this frame. /// - void (CEF_CALLBACK *undo)(struct _cef_frame_t* self); + void(CEF_CALLBACK* undo)(struct _cef_frame_t* self); /// // Execute redo in this frame. /// - void (CEF_CALLBACK *redo)(struct _cef_frame_t* self); + void(CEF_CALLBACK* redo)(struct _cef_frame_t* self); /// // Execute cut in this frame. /// - void (CEF_CALLBACK *cut)(struct _cef_frame_t* self); + void(CEF_CALLBACK* cut)(struct _cef_frame_t* self); /// // Execute copy in this frame. /// - void (CEF_CALLBACK *copy)(struct _cef_frame_t* self); + void(CEF_CALLBACK* copy)(struct _cef_frame_t* self); /// // Execute paste in this frame. /// - void (CEF_CALLBACK *paste)(struct _cef_frame_t* self); + void(CEF_CALLBACK* paste)(struct _cef_frame_t* self); /// // Execute delete in this frame. /// - void (CEF_CALLBACK *del)(struct _cef_frame_t* self); + void(CEF_CALLBACK* del)(struct _cef_frame_t* self); /// // Execute select all in this frame. /// - void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self); + void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self); /// // Save this frame's HTML source to a temporary file and open it in the // default text viewing application. This function can only be called from the // browser process. /// - void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self); + void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self); /// // Retrieve this frame's HTML source as a string sent to the specified // visitor. /// - void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self, - struct _cef_string_visitor_t* visitor); + void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); /// // Retrieve this frame's display text as a string sent to the specified // visitor. /// - void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self, - struct _cef_string_visitor_t* visitor); + void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); /// // Load the request represented by the |request| object. /// - void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self, - struct _cef_request_t* request); + void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self, + struct _cef_request_t* request); /// // Load the specified |url|. /// - void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self, - const cef_string_t* url); + void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self, + const cef_string_t* url); /// // Load the contents of |string_val| with the specified dummy |url|. |url| // should have a standard scheme (for example, http scheme) or behaviors like // link clicks and web security restrictions may not behave as expected. /// - void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, - const cef_string_t* string_val, const cef_string_t* url); + void(CEF_CALLBACK* load_string)(struct _cef_frame_t* self, + const cef_string_t* string_val, + const cef_string_t* url); /// // Execute a string of JavaScript code in this frame. The |script_url| @@ -151,19 +154,20 @@ typedef struct _cef_frame_t { // error. The |start_line| parameter is the base line number to use for error // reporting. /// - void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self, - const cef_string_t* code, const cef_string_t* script_url, - int start_line); + void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self, + const cef_string_t* code, + const cef_string_t* script_url, + int start_line); /// // Returns true (1) if this is the main (top-level) frame. /// - int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self); + int(CEF_CALLBACK* is_main)(struct _cef_frame_t* self); /// // Returns true (1) if this is the focused frame. /// - int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self); + int(CEF_CALLBACK* is_focused)(struct _cef_frame_t* self); /// // Returns the name for this frame. If the frame has an assigned name (for @@ -173,47 +177,46 @@ typedef struct _cef_frame_t { // value. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self); /// // Returns the globally unique identifier for this frame or < 0 if the // underlying frame does not yet exist. /// - int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self); + int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self); /// // Returns the parent of this frame or NULL if this is the main (top-level) // frame. /// - struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self); + struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self); /// // Returns the URL currently loaded in this frame. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_frame_t* self); /// // Returns the browser that this frame belongs to. /// - struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self); + struct _cef_browser_t*(CEF_CALLBACK* get_browser)(struct _cef_frame_t* self); /// // Get the V8 context associated with the frame. This function can only be // called from the render process. /// - struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( + struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)( struct _cef_frame_t* self); /// // Visit the DOM document. This function can only be called from the render // process. /// - void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self, - struct _cef_domvisitor_t* visitor); + void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self, + struct _cef_domvisitor_t* visitor); } cef_frame_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_geolocation_capi.h b/include/capi/cef_geolocation_capi.h index 3325d10cc..bc934e4ad 100644 --- a/include/capi/cef_geolocation_capi.h +++ b/include/capi/cef_geolocation_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=3ae57ba897d73f3fcccc955c827379746b6203af$ +// #ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure to receive geolocation updates. The functions of // this structure will be called on the browser process UI thread. @@ -59,12 +60,11 @@ typedef struct _cef_get_geolocation_callback_t { // Called with the 'best available' location information or, if the location // update failed, with error information. /// - void (CEF_CALLBACK *on_location_update)( + void(CEF_CALLBACK* on_location_update)( struct _cef_get_geolocation_callback_t* self, const struct _cef_geoposition_t* position); } cef_get_geolocation_callback_t; - /// // Request a one-time geolocation update. This function bypasses any user // permission checks so should only be used by code that is allowed to access diff --git a/include/capi/cef_geolocation_handler_capi.h b/include/capi/cef_geolocation_handler_capi.h index ee2651c21..8975169eb 100644 --- a/include/capi/cef_geolocation_handler_capi.h +++ b/include/capi/cef_geolocation_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ec60811fcefbe02348f14ecddbe5778ce836bf53$ +// #ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Callback structure used for asynchronous continuation of geolocation // permission requests. @@ -59,11 +60,9 @@ typedef struct _cef_geolocation_callback_t { /// // Call to allow or deny geolocation access. /// - void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self, - int allow); + void(CEF_CALLBACK* cont)(struct _cef_geolocation_callback_t* self, int allow); } cef_geolocation_callback_t; - /// // Implement this structure to handle events related to geolocation permission // requests. The functions of this structure will be called on the browser @@ -83,21 +82,23 @@ typedef struct _cef_geolocation_handler_t { // time to continue or cancel the request. Return false (0) to cancel the // request immediately. /// - int (CEF_CALLBACK *on_request_geolocation_permission)( - struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, - const cef_string_t* requesting_url, int request_id, + int(CEF_CALLBACK* on_request_geolocation_permission)( + struct _cef_geolocation_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* requesting_url, + int request_id, struct _cef_geolocation_callback_t* callback); /// // Called when a geolocation access request is canceled. |request_id| is the // unique ID for the permission request. /// - void (CEF_CALLBACK *on_cancel_geolocation_permission)( - struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, + void(CEF_CALLBACK* on_cancel_geolocation_permission)( + struct _cef_geolocation_handler_t* self, + struct _cef_browser_t* browser, int request_id); } cef_geolocation_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_image_capi.h b/include/capi/cef_image_capi.h index 5eec9f42c..ed3120082 100644 --- a/include/capi/cef_image_capi.h +++ b/include/capi/cef_image_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=60f904f2f77ce6d89f9fceeeda0050273a3c9e6d$ +// #ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Container for a single image represented at different scale factors. All // image representations should be the same size in density independent pixel @@ -63,14 +64,14 @@ typedef struct _cef_image_t { /// // Returns true (1) if this Image is NULL. /// - int (CEF_CALLBACK *is_empty)(struct _cef_image_t* self); + int(CEF_CALLBACK* is_empty)(struct _cef_image_t* self); /// // Returns true (1) if this Image and |that| Image share the same underlying // storage. Will also return true (1) if both images are NULL. /// - int (CEF_CALLBACK *is_same)(struct _cef_image_t* self, - struct _cef_image_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_image_t* self, + struct _cef_image_t* that); /// // Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA @@ -79,49 +80,57 @@ typedef struct _cef_image_t { // pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size. // |color_type| and |alpha_type| values specify the pixel format. /// - int (CEF_CALLBACK *add_bitmap)(struct _cef_image_t* self, float scale_factor, - int pixel_width, int pixel_height, cef_color_type_t color_type, - cef_alpha_type_t alpha_type, const void* pixel_data, - size_t pixel_data_size); + int(CEF_CALLBACK* add_bitmap)(struct _cef_image_t* self, + float scale_factor, + int pixel_width, + int pixel_height, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + const void* pixel_data, + size_t pixel_data_size); /// // Add a PNG image representation for |scale_factor|. |png_data| is the image // data of size |png_data_size|. Any alpha transparency in the PNG data will // be maintained. /// - int (CEF_CALLBACK *add_png)(struct _cef_image_t* self, float scale_factor, - const void* png_data, size_t png_data_size); + int(CEF_CALLBACK* add_png)(struct _cef_image_t* self, + float scale_factor, + const void* png_data, + size_t png_data_size); /// // Create a JPEG image representation for |scale_factor|. |jpeg_data| is the // image data of size |jpeg_data_size|. The JPEG format does not support // transparency so the alpha byte will be set to 0xFF for all pixels. /// - int (CEF_CALLBACK *add_jpeg)(struct _cef_image_t* self, float scale_factor, - const void* jpeg_data, size_t jpeg_data_size); + int(CEF_CALLBACK* add_jpeg)(struct _cef_image_t* self, + float scale_factor, + const void* jpeg_data, + size_t jpeg_data_size); /// // Returns the image width in density independent pixel (DIP) units. /// - size_t (CEF_CALLBACK *get_width)(struct _cef_image_t* self); + size_t(CEF_CALLBACK* get_width)(struct _cef_image_t* self); /// // Returns the image height in density independent pixel (DIP) units. /// - size_t (CEF_CALLBACK *get_height)(struct _cef_image_t* self); + size_t(CEF_CALLBACK* get_height)(struct _cef_image_t* self); /// // Returns true (1) if this image contains a representation for // |scale_factor|. /// - int (CEF_CALLBACK *has_representation)(struct _cef_image_t* self, - float scale_factor); + int(CEF_CALLBACK* has_representation)(struct _cef_image_t* self, + float scale_factor); /// // Removes the representation for |scale_factor|. Returns true (1) on success. /// - int (CEF_CALLBACK *remove_representation)(struct _cef_image_t* self, - float scale_factor); + int(CEF_CALLBACK* remove_representation)(struct _cef_image_t* self, + float scale_factor); /// // Returns information for the representation that most closely matches @@ -129,9 +138,11 @@ typedef struct _cef_image_t { // representation. |pixel_width| and |pixel_height| are the representation // size in pixel coordinates. Returns true (1) on success. /// - int (CEF_CALLBACK *get_representation_info)(struct _cef_image_t* self, - float scale_factor, float* actual_scale_factor, int* pixel_width, - int* pixel_height); + int(CEF_CALLBACK* get_representation_info)(struct _cef_image_t* self, + float scale_factor, + float* actual_scale_factor, + int* pixel_width, + int* pixel_height); /// // Returns the bitmap representation that most closely matches |scale_factor|. @@ -141,10 +152,13 @@ typedef struct _cef_image_t { // Returns a cef_binary_value_t containing the pixel data on success or NULL // on failure. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_as_bitmap)( - struct _cef_image_t* self, float scale_factor, - cef_color_type_t color_type, cef_alpha_type_t alpha_type, - int* pixel_width, int* pixel_height); + struct _cef_binary_value_t*(CEF_CALLBACK* get_as_bitmap)( + struct _cef_image_t* self, + float scale_factor, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + int* pixel_width, + int* pixel_height); /// // Returns the PNG representation that most closely matches |scale_factor|. If @@ -154,9 +168,12 @@ typedef struct _cef_image_t { // cef_binary_value_t containing the PNG image data on success or NULL on // failure. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_as_png)( - struct _cef_image_t* self, float scale_factor, int with_transparency, - int* pixel_width, int* pixel_height); + struct _cef_binary_value_t*(CEF_CALLBACK* get_as_png)( + struct _cef_image_t* self, + float scale_factor, + int with_transparency, + int* pixel_width, + int* pixel_height); /// // Returns the JPEG representation that most closely matches |scale_factor|. @@ -167,19 +184,20 @@ typedef struct _cef_image_t { // cef_binary_value_t containing the JPEG image data on success or NULL on // failure. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_as_jpeg)( - struct _cef_image_t* self, float scale_factor, int quality, - int* pixel_width, int* pixel_height); + struct _cef_binary_value_t*(CEF_CALLBACK* get_as_jpeg)( + struct _cef_image_t* self, + float scale_factor, + int quality, + int* pixel_width, + int* pixel_height); } cef_image_t; - /// // Create a new cef_image_t. It will initially be NULL. Use the Add*() functions // to add representations at different scale factors. /// CEF_EXPORT cef_image_t* cef_image_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_jsdialog_handler_capi.h b/include/capi/cef_jsdialog_handler_capi.h index 24acb0c9e..267bc4b51 100644 --- a/include/capi/cef_jsdialog_handler_capi.h +++ b/include/capi/cef_jsdialog_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=351cff5a52f29b54d1854d5dfbb1733c8a62797d$ +// #ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Callback structure used for asynchronous continuation of JavaScript dialog // requests. @@ -60,11 +61,11 @@ typedef struct _cef_jsdialog_callback_t { // Continue the JS dialog request. Set |success| to true (1) if the OK button // was pressed. The |user_input| value should be specified for prompt dialogs. /// - void (CEF_CALLBACK *cont)(struct _cef_jsdialog_callback_t* self, int success, - const cef_string_t* user_input); + void(CEF_CALLBACK* cont)(struct _cef_jsdialog_callback_t* self, + int success, + const cef_string_t* user_input); } cef_jsdialog_callback_t; - /// // Implement this structure to handle events related to JavaScript dialogs. The // functions of this structure will be called on the UI thread. @@ -92,11 +93,14 @@ typedef struct _cef_jsdialog_handler_t { // the application must execute |callback| once the custom dialog is // dismissed. /// - int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* origin_url, - cef_jsdialog_type_t dialog_type, const cef_string_t* message_text, - const cef_string_t* default_prompt_text, - struct _cef_jsdialog_callback_t* callback, int* suppress_message); + int(CEF_CALLBACK* on_jsdialog)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* origin_url, + cef_jsdialog_type_t dialog_type, + const cef_string_t* message_text, + const cef_string_t* default_prompt_text, + struct _cef_jsdialog_callback_t* callback, + int* suppress_message); /// // Called to run a dialog asking the user if they want to leave a page. Return @@ -106,9 +110,11 @@ typedef struct _cef_jsdialog_handler_t { // dialog is used the application must execute |callback| once the custom // dialog is dismissed. /// - int (CEF_CALLBACK *on_before_unload_dialog)( - struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser, - const cef_string_t* message_text, int is_reload, + int(CEF_CALLBACK* on_before_unload_dialog)( + struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* message_text, + int is_reload, struct _cef_jsdialog_callback_t* callback); /// @@ -116,17 +122,17 @@ typedef struct _cef_jsdialog_handler_t { // be called due to events like page navigation irregardless of whether any // dialogs are currently pending. /// - void (CEF_CALLBACK *on_reset_dialog_state)( - struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_reset_dialog_state)( + struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser); /// // Called when the default implementation dialog is closed. /// - void (CEF_CALLBACK *on_dialog_closed)(struct _cef_jsdialog_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_dialog_closed)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser); } cef_jsdialog_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_keyboard_handler_capi.h b/include/capi/cef_keyboard_handler_capi.h index 1e1ee7088..31b6d9842 100644 --- a/include/capi/cef_keyboard_handler_capi.h +++ b/include/capi/cef_keyboard_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=07c2a01bb9975fa52fdb287712f8f369557ba755$ +// #ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to keyboard input. The // functions of this structure will be called on the UI thread. @@ -63,9 +64,11 @@ typedef struct _cef_keyboard_handler_t { // (0) otherwise. If the event will be handled in on_key_event() as a keyboard // shortcut set |is_keyboard_shortcut| to true (1) and return false (0). /// - int (CEF_CALLBACK *on_pre_key_event)(struct _cef_keyboard_handler_t* self, - struct _cef_browser_t* browser, const struct _cef_key_event_t* event, - cef_event_handle_t os_event, int* is_keyboard_shortcut); + int(CEF_CALLBACK* on_pre_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, + const struct _cef_key_event_t* event, + cef_event_handle_t os_event, + int* is_keyboard_shortcut); /// // Called after the renderer and JavaScript in the page has had a chance to @@ -73,12 +76,12 @@ typedef struct _cef_keyboard_handler_t { // |os_event| is the operating system event message, if any. Return true (1) // if the keyboard event was handled or false (0) otherwise. /// - int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, - struct _cef_browser_t* browser, const struct _cef_key_event_t* event, - cef_event_handle_t os_event); + int(CEF_CALLBACK* on_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, + const struct _cef_key_event_t* event, + cef_event_handle_t os_event); } cef_keyboard_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_life_span_handler_capi.h b/include/capi/cef_life_span_handler_capi.h index 0db15b839..8f836aa66 100644 --- a/include/capi/cef_life_span_handler_capi.h +++ b/include/capi/cef_life_span_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=7894d507f337ebe5f9296770e10773a4e6458f00$ +// #ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ @@ -80,20 +82,26 @@ typedef struct _cef_life_span_handler_t { // the parent browser is destroyed before the popup browser creation completes // (indicated by a call to OnAfterCreated for the popup browser). /// - int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* target_url, const cef_string_t* target_frame_name, - cef_window_open_disposition_t target_disposition, int user_gesture, + int(CEF_CALLBACK* on_before_popup)( + struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + const cef_string_t* target_url, + const cef_string_t* target_frame_name, + cef_window_open_disposition_t target_disposition, + int user_gesture, const struct _cef_popup_features_t* popupFeatures, - struct _cef_window_info_t* windowInfo, struct _cef_client_t** client, - struct _cef_browser_settings_t* settings, int* no_javascript_access); + struct _cef_window_info_t* windowInfo, + struct _cef_client_t** client, + struct _cef_browser_settings_t* settings, + int* no_javascript_access); /// // Called after a new browser is created. This callback will be the first // notification that references |browser|. /// - void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); /// // Called when a browser has recieved a request to close. This may result @@ -184,8 +192,8 @@ typedef struct _cef_life_span_handler_t { // browsers // exist. /// - int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self, - struct _cef_browser_t* browser); + int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); /// // Called just before a browser is destroyed. Release all references to the @@ -194,11 +202,10 @@ typedef struct _cef_life_span_handler_t { // notification that references |browser|. See do_close() documentation for // additional usage information. /// - void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); } cef_life_span_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_load_handler_capi.h b/include/capi/cef_load_handler_capi.h index f7ddc62a6..c46b2525b 100644 --- a/include/capi/cef_load_handler_capi.h +++ b/include/capi/cef_load_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=d8fa87bb47ec889cab864fe96f94e07bf1deb0f6$ +// #ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Implement this structure to handle events related to browser load status. The // functions of this structure will be called on the browser process UI thread @@ -65,9 +66,11 @@ typedef struct _cef_load_handler_t { // of failure. It will be called before any calls to OnLoadStart and after all // calls to OnLoadError and/or OnLoadEnd. /// - void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self, - struct _cef_browser_t* browser, int isLoading, int canGoBack, - int canGoForward); + void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, + int isLoading, + int canGoBack, + int canGoForward); /// // Called after a navigation has been committed and before the browser begins @@ -81,9 +84,10 @@ typedef struct _cef_load_handler_t { // navigations that fail or are canceled before commit. For notification of // overall browser load status use OnLoadingStateChange instead. /// - void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - cef_transition_type_t transition_type); + void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + cef_transition_type_t transition_type); /// // Called when the browser is done loading a frame. The |frame| value will @@ -95,9 +99,10 @@ typedef struct _cef_load_handler_t { // For notification of overall browser load status use OnLoadingStateChange // instead. /// - void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - int httpStatusCode); + void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + int httpStatusCode); /// // Called when a navigation fails or is canceled. This function may be called @@ -106,13 +111,14 @@ typedef struct _cef_load_handler_t { // error text and |failedUrl| is the URL that failed to load. See // net\base\net_error_list.h for complete descriptions of the error codes. /// - void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - cef_errorcode_t errorCode, const cef_string_t* errorText, - const cef_string_t* failedUrl); + void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + cef_errorcode_t errorCode, + const cef_string_t* errorText, + const cef_string_t* failedUrl); } cef_load_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_menu_model_capi.h b/include/capi/cef_menu_model_capi.h index e578abe71..8c29500d5 100644 --- a/include/capi/cef_menu_model_capi.h +++ b/include/capi/cef_menu_model_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=295f7f55ebe6d548aba1476e67efb2c88ab10ca5$ +// #ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Supports creation and modification of menus. See cef_menu_id_t for the // command ids that have default implementations. All user-defined command ids @@ -61,329 +62,363 @@ typedef struct _cef_menu_model_t { /// // Returns true (1) if this menu is a submenu. /// - int (CEF_CALLBACK *is_sub_menu)(struct _cef_menu_model_t* self); + int(CEF_CALLBACK* is_sub_menu)(struct _cef_menu_model_t* self); /// // Clears the menu. Returns true (1) on success. /// - int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self); + int(CEF_CALLBACK* clear)(struct _cef_menu_model_t* self); /// // Returns the number of items in this menu. /// - int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self); + int(CEF_CALLBACK* get_count)(struct _cef_menu_model_t* self); /// // Add a separator to the menu. Returns true (1) on success. /// - int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self); + int(CEF_CALLBACK* add_separator)(struct _cef_menu_model_t* self); /// // Add an item to the menu. Returns true (1) on success. /// - int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id, - const cef_string_t* label); + int(CEF_CALLBACK* add_item)(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* label); /// // Add a check item to the menu. Returns true (1) on success. /// - int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label); + int(CEF_CALLBACK* add_check_item)(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* label); /// // Add a radio item to the menu. Only a single item with the specified // |group_id| can be checked at a time. Returns true (1) on success. /// - int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label, int group_id); + int(CEF_CALLBACK* add_radio_item)(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* label, + int group_id); /// // Add a sub-menu to the menu. The new sub-menu is returned. /// - struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)( - struct _cef_menu_model_t* self, int command_id, + struct _cef_menu_model_t*(CEF_CALLBACK* add_sub_menu)( + struct _cef_menu_model_t* self, + int command_id, const cef_string_t* label); /// // Insert a separator in the menu at the specified |index|. Returns true (1) // on success. /// - int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self, - int index); + int(CEF_CALLBACK* insert_separator_at)(struct _cef_menu_model_t* self, + int index); /// // Insert an item in the menu at the specified |index|. Returns true (1) on // success. /// - int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index, - int command_id, const cef_string_t* label); + int(CEF_CALLBACK* insert_item_at)(struct _cef_menu_model_t* self, + int index, + int command_id, + const cef_string_t* label); /// // Insert a check item in the menu at the specified |index|. Returns true (1) // on success. /// - int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self, - int index, int command_id, const cef_string_t* label); + int(CEF_CALLBACK* insert_check_item_at)(struct _cef_menu_model_t* self, + int index, + int command_id, + const cef_string_t* label); /// // Insert a radio item in the menu at the specified |index|. Only a single // item with the specified |group_id| can be checked at a time. Returns true // (1) on success. /// - int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self, - int index, int command_id, const cef_string_t* label, int group_id); + int(CEF_CALLBACK* insert_radio_item_at)(struct _cef_menu_model_t* self, + int index, + int command_id, + const cef_string_t* label, + int group_id); /// // Insert a sub-menu in the menu at the specified |index|. The new sub-menu is // returned. /// - struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)( - struct _cef_menu_model_t* self, int index, int command_id, + struct _cef_menu_model_t*(CEF_CALLBACK* insert_sub_menu_at)( + struct _cef_menu_model_t* self, + int index, + int command_id, const cef_string_t* label); /// // Removes the item with the specified |command_id|. Returns true (1) on // success. /// - int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id); + int(CEF_CALLBACK* remove)(struct _cef_menu_model_t* self, int command_id); /// // Removes the item at the specified |index|. Returns true (1) on success. /// - int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index); + int(CEF_CALLBACK* remove_at)(struct _cef_menu_model_t* self, int index); /// // Returns the index associated with the specified |command_id| or -1 if not // found due to the command id not existing in the menu. /// - int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* get_index_of)(struct _cef_menu_model_t* self, + int command_id); /// // Returns the command id at the specified |index| or -1 if not found due to // invalid range or the index being a separator. /// - int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self, - int index); + int(CEF_CALLBACK* get_command_id_at)(struct _cef_menu_model_t* self, + int index); /// // Sets the command id at the specified |index|. Returns true (1) on success. /// - int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self, - int index, int command_id); + int(CEF_CALLBACK* set_command_id_at)(struct _cef_menu_model_t* self, + int index, + int command_id); /// // Returns the label for the specified |command_id| or NULL if not found. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_label)( - struct _cef_menu_model_t* self, int command_id); + cef_string_userfree_t(CEF_CALLBACK* get_label)(struct _cef_menu_model_t* self, + int command_id); /// // Returns the label at the specified |index| or NULL if not found due to // invalid range or the index being a separator. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_label_at)( - struct _cef_menu_model_t* self, int index); + cef_string_userfree_t( + CEF_CALLBACK* get_label_at)(struct _cef_menu_model_t* self, int index); /// // Sets the label for the specified |command_id|. Returns true (1) on success. /// - int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id, - const cef_string_t* label); + int(CEF_CALLBACK* set_label)(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* label); /// // Set the label at the specified |index|. Returns true (1) on success. /// - int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index, - const cef_string_t* label); + int(CEF_CALLBACK* set_label_at)(struct _cef_menu_model_t* self, + int index, + const cef_string_t* label); /// // Returns the item type for the specified |command_id|. /// - cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self, - int command_id); + cef_menu_item_type_t(CEF_CALLBACK* get_type)(struct _cef_menu_model_t* self, + int command_id); /// // Returns the item type at the specified |index|. /// - cef_menu_item_type_t (CEF_CALLBACK *get_type_at)( - struct _cef_menu_model_t* self, int index); + cef_menu_item_type_t( + CEF_CALLBACK* get_type_at)(struct _cef_menu_model_t* self, int index); /// // Returns the group id for the specified |command_id| or -1 if invalid. /// - int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* get_group_id)(struct _cef_menu_model_t* self, + int command_id); /// // Returns the group id at the specified |index| or -1 if invalid. /// - int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self, - int index); + int(CEF_CALLBACK* get_group_id_at)(struct _cef_menu_model_t* self, int index); /// // Sets the group id for the specified |command_id|. Returns true (1) on // success. /// - int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self, - int command_id, int group_id); + int(CEF_CALLBACK* set_group_id)(struct _cef_menu_model_t* self, + int command_id, + int group_id); /// // Sets the group id at the specified |index|. Returns true (1) on success. /// - int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index, - int group_id); + int(CEF_CALLBACK* set_group_id_at)(struct _cef_menu_model_t* self, + int index, + int group_id); /// // Returns the submenu for the specified |command_id| or NULL if invalid. /// - struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)( - struct _cef_menu_model_t* self, int command_id); + struct _cef_menu_model_t*(CEF_CALLBACK* get_sub_menu)( + struct _cef_menu_model_t* self, + int command_id); /// // Returns the submenu at the specified |index| or NULL if invalid. /// - struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)( - struct _cef_menu_model_t* self, int index); + struct _cef_menu_model_t*( + CEF_CALLBACK* get_sub_menu_at)(struct _cef_menu_model_t* self, int index); /// // Returns true (1) if the specified |command_id| is visible. /// - int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* is_visible)(struct _cef_menu_model_t* self, int command_id); /// // Returns true (1) if the specified |index| is visible. /// - int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index); + int(CEF_CALLBACK* is_visible_at)(struct _cef_menu_model_t* self, int index); /// // Change the visibility of the specified |command_id|. Returns true (1) on // success. /// - int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self, - int command_id, int visible); + int(CEF_CALLBACK* set_visible)(struct _cef_menu_model_t* self, + int command_id, + int visible); /// // Change the visibility at the specified |index|. Returns true (1) on // success. /// - int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index, - int visible); + int(CEF_CALLBACK* set_visible_at)(struct _cef_menu_model_t* self, + int index, + int visible); /// // Returns true (1) if the specified |command_id| is enabled. /// - int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* is_enabled)(struct _cef_menu_model_t* self, int command_id); /// // Returns true (1) if the specified |index| is enabled. /// - int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index); + int(CEF_CALLBACK* is_enabled_at)(struct _cef_menu_model_t* self, int index); /// // Change the enabled status of the specified |command_id|. Returns true (1) // on success. /// - int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self, - int command_id, int enabled); + int(CEF_CALLBACK* set_enabled)(struct _cef_menu_model_t* self, + int command_id, + int enabled); /// // Change the enabled status at the specified |index|. Returns true (1) on // success. /// - int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index, - int enabled); + int(CEF_CALLBACK* set_enabled_at)(struct _cef_menu_model_t* self, + int index, + int enabled); /// // Returns true (1) if the specified |command_id| is checked. Only applies to // check and radio items. /// - int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* is_checked)(struct _cef_menu_model_t* self, int command_id); /// // Returns true (1) if the specified |index| is checked. Only applies to check // and radio items. /// - int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index); + int(CEF_CALLBACK* is_checked_at)(struct _cef_menu_model_t* self, int index); /// // Check the specified |command_id|. Only applies to check and radio items. // Returns true (1) on success. /// - int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self, - int command_id, int checked); + int(CEF_CALLBACK* set_checked)(struct _cef_menu_model_t* self, + int command_id, + int checked); /// // Check the specified |index|. Only applies to check and radio items. Returns // true (1) on success. /// - int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index, - int checked); + int(CEF_CALLBACK* set_checked_at)(struct _cef_menu_model_t* self, + int index, + int checked); /// // Returns true (1) if the specified |command_id| has a keyboard accelerator // assigned. /// - int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* has_accelerator)(struct _cef_menu_model_t* self, + int command_id); /// // Returns true (1) if the specified |index| has a keyboard accelerator // assigned. /// - int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self, - int index); + int(CEF_CALLBACK* has_accelerator_at)(struct _cef_menu_model_t* self, + int index); /// // Set the keyboard accelerator for the specified |command_id|. |key_code| can // be any virtual key or character value. Returns true (1) on success. /// - int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self, - int command_id, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed); + int(CEF_CALLBACK* set_accelerator)(struct _cef_menu_model_t* self, + int command_id, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed); /// // Set the keyboard accelerator at the specified |index|. |key_code| can be // any virtual key or character value. Returns true (1) on success. /// - int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self, - int index, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed); + int(CEF_CALLBACK* set_accelerator_at)(struct _cef_menu_model_t* self, + int index, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed); /// // Remove the keyboard accelerator for the specified |command_id|. Returns // true (1) on success. /// - int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self, - int command_id); + int(CEF_CALLBACK* remove_accelerator)(struct _cef_menu_model_t* self, + int command_id); /// // Remove the keyboard accelerator at the specified |index|. Returns true (1) // on success. /// - int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self, - int index); + int(CEF_CALLBACK* remove_accelerator_at)(struct _cef_menu_model_t* self, + int index); /// // Retrieves the keyboard accelerator for the specified |command_id|. Returns // true (1) on success. /// - int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self, - int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, - int* alt_pressed); + int(CEF_CALLBACK* get_accelerator)(struct _cef_menu_model_t* self, + int command_id, + int* key_code, + int* shift_pressed, + int* ctrl_pressed, + int* alt_pressed); /// // Retrieves the keyboard accelerator for the specified |index|. Returns true // (1) on success. /// - int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self, - int index, int* key_code, int* shift_pressed, int* ctrl_pressed, - int* alt_pressed); + int(CEF_CALLBACK* get_accelerator_at)(struct _cef_menu_model_t* self, + int index, + int* key_code, + int* shift_pressed, + int* ctrl_pressed, + int* alt_pressed); /// // Set the explicit color for |command_id| and |color_type| to |color|. @@ -391,8 +426,10 @@ typedef struct _cef_menu_model_t { // color or default color is set for |color_type| then the system color will // be used. Returns true (1) on success. /// - int (CEF_CALLBACK *set_color)(struct _cef_menu_model_t* self, int command_id, - cef_menu_color_type_t color_type, cef_color_t color); + int(CEF_CALLBACK* set_color)(struct _cef_menu_model_t* self, + int command_id, + cef_menu_color_type_t color_type, + cef_color_t color); /// // Set the explicit color for |command_id| and |index| to |color|. Specify a @@ -401,16 +438,20 @@ typedef struct _cef_menu_model_t { // set. If no explicit color or default color is set for |color_type| then the // system color will be used. Returns true (1) on success. /// - int (CEF_CALLBACK *set_color_at)(struct _cef_menu_model_t* self, int index, - cef_menu_color_type_t color_type, cef_color_t color); + int(CEF_CALLBACK* set_color_at)(struct _cef_menu_model_t* self, + int index, + cef_menu_color_type_t color_type, + cef_color_t color); /// // Returns in |color| the color that was explicitly set for |command_id| and // |color_type|. If a color was not set then 0 will be returned in |color|. // Returns true (1) on success. /// - int (CEF_CALLBACK *get_color)(struct _cef_menu_model_t* self, int command_id, - cef_menu_color_type_t color_type, cef_color_t* color); + int(CEF_CALLBACK* get_color)(struct _cef_menu_model_t* self, + int command_id, + cef_menu_color_type_t color_type, + cef_color_t* color); /// // Returns in |color| the color that was explicitly set for |command_id| and @@ -418,8 +459,10 @@ typedef struct _cef_menu_model_t { // |color|. If a color was not set then 0 will be returned in |color|. Returns // true (1) on success. /// - int (CEF_CALLBACK *get_color_at)(struct _cef_menu_model_t* self, int index, - cef_menu_color_type_t color_type, cef_color_t* color); + int(CEF_CALLBACK* get_color_at)(struct _cef_menu_model_t* self, + int index, + cef_menu_color_type_t color_type, + cef_color_t* color); /// // Sets the font list for the specified |command_id|. If |font_list| is NULL @@ -433,8 +476,9 @@ typedef struct _cef_menu_model_t { // Here are examples of valid font description strings: - "Arial, Helvetica, // Bold Italic 14px" - "Arial, 14px" /// - int (CEF_CALLBACK *set_font_list)(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* font_list); + int(CEF_CALLBACK* set_font_list)(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* font_list); /// // Sets the font list for the specified |index|. Specify an |index| value of @@ -449,18 +493,17 @@ typedef struct _cef_menu_model_t { // Here are examples of valid font description strings: - "Arial, Helvetica, // Bold Italic 14px" - "Arial, 14px" /// - int (CEF_CALLBACK *set_font_list_at)(struct _cef_menu_model_t* self, - int index, const cef_string_t* font_list); + int(CEF_CALLBACK* set_font_list_at)(struct _cef_menu_model_t* self, + int index, + const cef_string_t* font_list); } cef_menu_model_t; - /// // Create a new MenuModel with the specified |delegate|. /// CEF_EXPORT cef_menu_model_t* cef_menu_model_create( struct _cef_menu_model_delegate_t* delegate); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_menu_model_delegate_capi.h b/include/capi/cef_menu_model_delegate_capi.h index dc72e7836..e9b8cc31f 100644 --- a/include/capi/cef_menu_model_delegate_capi.h +++ b/include/capi/cef_menu_model_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=74f40f20f94ce3a6e7f3c879a3834a7108099ed4$ +// #ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_ @@ -61,55 +63,59 @@ typedef struct _cef_menu_model_delegate_t { // Perform the action associated with the specified |command_id| and optional // |event_flags|. /// - void (CEF_CALLBACK *execute_command)(struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model, int command_id, - cef_event_flags_t event_flags); + void(CEF_CALLBACK* execute_command)(struct _cef_menu_model_delegate_t* self, + struct _cef_menu_model_t* menu_model, + int command_id, + cef_event_flags_t event_flags); /// // Called when the user moves the mouse outside the menu and over the owning // window. /// - void (CEF_CALLBACK *mouse_outside_menu)( + void(CEF_CALLBACK* mouse_outside_menu)( struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point); + struct _cef_menu_model_t* menu_model, + const cef_point_t* screen_point); /// // Called on unhandled open submenu keyboard commands. |is_rtl| will be true // (1) if the menu is displaying a right-to-left language. /// - void (CEF_CALLBACK *unhandled_open_submenu)( + void(CEF_CALLBACK* unhandled_open_submenu)( struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model, int is_rtl); + struct _cef_menu_model_t* menu_model, + int is_rtl); /// // Called on unhandled close submenu keyboard commands. |is_rtl| will be true // (1) if the menu is displaying a right-to-left language. /// - void (CEF_CALLBACK *unhandled_close_submenu)( + void(CEF_CALLBACK* unhandled_close_submenu)( struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model, int is_rtl); + struct _cef_menu_model_t* menu_model, + int is_rtl); /// // The menu is about to show. /// - void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model); + void(CEF_CALLBACK* menu_will_show)(struct _cef_menu_model_delegate_t* self, + struct _cef_menu_model_t* menu_model); /// // The menu has closed. /// - void (CEF_CALLBACK *menu_closed)(struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model); + void(CEF_CALLBACK* menu_closed)(struct _cef_menu_model_delegate_t* self, + struct _cef_menu_model_t* menu_model); /// // Optionally modify a menu item label. Return true (1) if |label| was // modified. /// - int (CEF_CALLBACK *format_label)(struct _cef_menu_model_delegate_t* self, - struct _cef_menu_model_t* menu_model, cef_string_t* label); + int(CEF_CALLBACK* format_label)(struct _cef_menu_model_delegate_t* self, + struct _cef_menu_model_t* menu_model, + cef_string_t* label); } cef_menu_model_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_navigation_entry_capi.h b/include/capi/cef_navigation_entry_capi.h index 75f064f40..e8892207e 100644 --- a/include/capi/cef_navigation_entry_capi.h +++ b/include/capi/cef_navigation_entry_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=a862d0004de2a1bdf4c214fe87278badd90562a7$ +// #ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Structure used to represent an entry in navigation history. /// @@ -59,55 +60,55 @@ typedef struct _cef_navigation_entry_t { // Returns true (1) if this object is valid. Do not call any other functions // if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_navigation_entry_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_navigation_entry_t* self); /// // Returns the actual URL of the page. For some pages this may be data: URL or // similar. Use get_display_url() to return a display-friendly version. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_url)( + cef_string_userfree_t(CEF_CALLBACK* get_url)( struct _cef_navigation_entry_t* self); /// // Returns a display-friendly version of the URL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_display_url)( + cef_string_userfree_t(CEF_CALLBACK* get_display_url)( struct _cef_navigation_entry_t* self); /// // Returns the original URL that was entered by the user before any redirects. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_original_url)( + cef_string_userfree_t(CEF_CALLBACK* get_original_url)( struct _cef_navigation_entry_t* self); /// // Returns the title set by the page. This value may be NULL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_title)( + cef_string_userfree_t(CEF_CALLBACK* get_title)( struct _cef_navigation_entry_t* self); /// // Returns the transition type which indicates what the user did to move to // this page from the previous page. /// - cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + cef_transition_type_t(CEF_CALLBACK* get_transition_type)( struct _cef_navigation_entry_t* self); /// // Returns true (1) if this navigation includes post data. /// - int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self); + int(CEF_CALLBACK* has_post_data)(struct _cef_navigation_entry_t* self); /// // Returns the time for the last known successful navigation completion. A // navigation may be completed more than once if the page is reloaded. May be // 0 if the navigation has not yet completed. /// - cef_time_t (CEF_CALLBACK *get_completion_time)( + cef_time_t(CEF_CALLBACK* get_completion_time)( struct _cef_navigation_entry_t* self); /// @@ -115,17 +116,15 @@ typedef struct _cef_navigation_entry_t { // response. May be 0 if the response has not yet been received or if the // navigation has not yet completed. /// - int (CEF_CALLBACK *get_http_status_code)( - struct _cef_navigation_entry_t* self); + int(CEF_CALLBACK* get_http_status_code)(struct _cef_navigation_entry_t* self); /// // Returns the SSL information for this navigation entry. /// - struct _cef_sslstatus_t* (CEF_CALLBACK *get_sslstatus)( + struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)( struct _cef_navigation_entry_t* self); } cef_navigation_entry_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_origin_whitelist_capi.h b/include/capi/cef_origin_whitelist_capi.h index 0775151d0..7b252aa3c 100644 --- a/include/capi/cef_origin_whitelist_capi.h +++ b/include/capi/cef_origin_whitelist_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=2e5afff3277384ea9f3f74ef509c018f6d307dc4$ +// #ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Add an entry to the cross-origin access whitelist. // @@ -82,16 +83,20 @@ extern "C" { // |source_origin| is invalid or the whitelist cannot be accessed. /// CEF_EXPORT int cef_add_cross_origin_whitelist_entry( - const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains); + const cef_string_t* source_origin, + const cef_string_t* target_protocol, + const cef_string_t* target_domain, + int allow_target_subdomains); /// // Remove an entry from the cross-origin access whitelist. Returns false (0) if // |source_origin| is invalid or the whitelist cannot be accessed. /// CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( - const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains); + const cef_string_t* source_origin, + const cef_string_t* target_protocol, + const cef_string_t* target_domain, + int allow_target_subdomains); /// // Remove all entries from the cross-origin access whitelist. Returns false (0) diff --git a/include/capi/cef_parser_capi.h b/include/capi/cef_parser_capi.h index ef8a0a84b..0ac640bae 100644 --- a/include/capi/cef_parser_capi.h +++ b/include/capi/cef_parser_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=d2f01fbfc3ae72a86c03399606088054b3a9337f$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ @@ -44,13 +46,12 @@ extern "C" { #endif - /// // Parse the specified |url| into its component parts. Returns false (0) if the // URL is NULL or invalid. /// CEF_EXPORT int cef_parse_url(const cef_string_t* url, - struct _cef_urlparts_t* parts); + struct _cef_urlparts_t* parts); /// // Creates a URL from the specified |parts|, which must contain a non-NULL spec @@ -58,7 +59,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url, // if |parts| isn't initialized as described. /// CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, - cef_string_t* url); + cef_string_t* url); /// // This is a convenience function for formatting a URL in a concise and human- @@ -71,16 +72,16 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, // for URLs which will be parsed or sent to other applications. /// // The resulting string must be freed by calling cef_string_userfree_free(). -CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display( - const cef_string_t* origin_url); +CEF_EXPORT cef_string_userfree_t +cef_format_url_for_security_display(const cef_string_t* origin_url); /// // Returns the mime type for the specified file extension or an NULL string if // unknown. /// // The resulting string must be freed by calling cef_string_userfree_free(). -CEF_EXPORT cef_string_userfree_t cef_get_mime_type( - const cef_string_t* extension); +CEF_EXPORT cef_string_userfree_t +cef_get_mime_type(const cef_string_t* extension); /// // Get the extensions associated with the given mime type. This should be passed @@ -89,14 +90,14 @@ CEF_EXPORT cef_string_userfree_t cef_get_mime_type( // elements in the provided vector will not be erased. /// CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, - cef_string_list_t extensions); + cef_string_list_t extensions); /// // Encodes |data| as a base64 string. /// // The resulting string must be freed by calling cef_string_userfree_free(). CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data, - size_t data_size); + size_t data_size); /// // Decodes the base64 encoded string |data|. The returned value will be NULL if @@ -113,7 +114,7 @@ CEF_EXPORT struct _cef_binary_value_t* cef_base64decode( /// // The resulting string must be freed by calling cef_string_userfree_free(). CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, - int use_plus); + int use_plus); /// // Unescapes |text| and returns the result. Unescaping consists of looking for @@ -126,14 +127,17 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, // supports further customization the decoding process. /// // The resulting string must be freed by calling cef_string_userfree_free(). -CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, - int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule); +CEF_EXPORT cef_string_userfree_t +cef_uridecode(const cef_string_t* text, + int convert_to_utf8, + cef_uri_unescape_rule_t unescape_rule); /// // Parses the specified |json_string| and returns a dictionary or list // representation. If JSON parsing fails this function returns NULL. /// -CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, +CEF_EXPORT struct _cef_value_t* cef_parse_json( + const cef_string_t* json_string, cef_json_parser_options_t options); /// @@ -143,8 +147,10 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, // formatted error message respectively. /// CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( - const cef_string_t* json_string, cef_json_parser_options_t options, - cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out); + const cef_string_t* json_string, + cef_json_parser_options_t options, + cef_json_parser_error_t* error_code_out, + cef_string_t* error_msg_out); /// // Generates a JSON string from the specified root |node| which should be a @@ -152,8 +158,8 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( // requires exclusive access to |node| including any underlying data. /// // The resulting string must be freed by calling cef_string_userfree_free(). -CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node, - cef_json_writer_options_t options); +CEF_EXPORT cef_string_userfree_t +cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options); #ifdef __cplusplus } diff --git a/include/capi/cef_path_util_capi.h b/include/capi/cef_path_util_capi.h index de99ebd8e..849bcb9be 100644 --- a/include/capi/cef_path_util_capi.h +++ b/include/capi/cef_path_util_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=fbb817705137a12b4718950ff696396c30057007$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Retrieve the path associated with the specified |key|. Returns true (1) on // success. Can be called on any thread in the browser process. diff --git a/include/capi/cef_print_handler_capi.h b/include/capi/cef_print_handler_capi.h index 428d76a92..72ce14871 100644 --- a/include/capi/cef_print_handler_capi.h +++ b/include/capi/cef_print_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=e8f6bdc822cf4f5c32b22ba8b5cacb25823d8971$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Callback structure for asynchronous continuation of print dialog requests. /// @@ -59,16 +60,15 @@ typedef struct _cef_print_dialog_callback_t { /// // Continue printing with the specified |settings|. /// - void (CEF_CALLBACK *cont)(struct _cef_print_dialog_callback_t* self, - struct _cef_print_settings_t* settings); + void(CEF_CALLBACK* cont)(struct _cef_print_dialog_callback_t* self, + struct _cef_print_settings_t* settings); /// // Cancel the printing. /// - void (CEF_CALLBACK *cancel)(struct _cef_print_dialog_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_print_dialog_callback_t* self); } cef_print_dialog_callback_t; - /// // Callback structure for asynchronous continuation of print job requests. /// @@ -81,10 +81,9 @@ typedef struct _cef_print_job_callback_t { /// // Indicate completion of the print job. /// - void (CEF_CALLBACK *cont)(struct _cef_print_job_callback_t* self); + void(CEF_CALLBACK* cont)(struct _cef_print_job_callback_t* self); } cef_print_job_callback_t; - /// // Implement this structure to handle printing on Linux. The functions of this // structure will be called on the browser process UI thread. @@ -101,48 +100,52 @@ typedef struct _cef_print_handler_t { // how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript // window.print() or PDF extension print button). /// - void (CEF_CALLBACK *on_print_start)(struct _cef_print_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_print_start)(struct _cef_print_handler_t* self, + struct _cef_browser_t* browser); /// // Synchronize |settings| with client state. If |get_defaults| is true (1) // then populate |settings| with the default print settings. Do not keep a // reference to |settings| outside of this callback. /// - void (CEF_CALLBACK *on_print_settings)(struct _cef_print_handler_t* self, - struct _cef_print_settings_t* settings, int get_defaults); + void(CEF_CALLBACK* on_print_settings)(struct _cef_print_handler_t* self, + struct _cef_print_settings_t* settings, + int get_defaults); /// // Show the print dialog. Execute |callback| once the dialog is dismissed. // Return true (1) if the dialog will be displayed or false (0) to cancel the // printing immediately. /// - int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self, - int has_selection, struct _cef_print_dialog_callback_t* callback); + int(CEF_CALLBACK* on_print_dialog)( + struct _cef_print_handler_t* self, + int has_selection, + struct _cef_print_dialog_callback_t* callback); /// // Send the print job to the printer. Execute |callback| once the job is // completed. Return true (1) if the job will proceed or false (0) to cancel // the job immediately. /// - int (CEF_CALLBACK *on_print_job)(struct _cef_print_handler_t* self, - const cef_string_t* document_name, const cef_string_t* pdf_file_path, - struct _cef_print_job_callback_t* callback); + int(CEF_CALLBACK* on_print_job)(struct _cef_print_handler_t* self, + const cef_string_t* document_name, + const cef_string_t* pdf_file_path, + struct _cef_print_job_callback_t* callback); /// // Reset client state related to printing. /// - void (CEF_CALLBACK *on_print_reset)(struct _cef_print_handler_t* self); + void(CEF_CALLBACK* on_print_reset)(struct _cef_print_handler_t* self); /// // Return the PDF paper size in device units. Used in combination with // cef_browser_host_t::print_to_pdf(). /// - cef_size_t (CEF_CALLBACK *get_pdf_paper_size)( - struct _cef_print_handler_t* self, int device_units_per_inch); + cef_size_t(CEF_CALLBACK* get_pdf_paper_size)( + struct _cef_print_handler_t* self, + int device_units_per_inch); } cef_print_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_print_settings_capi.h b/include/capi/cef_print_settings_capi.h index 0a010be10..580e436af 100644 --- a/include/capi/cef_print_settings_capi.h +++ b/include/capi/cef_print_settings_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=5b26ebd2d8e1e65a25fa0c08317b8994887c0498$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure representing print settings. /// @@ -58,37 +59,37 @@ typedef struct _cef_print_settings_t { // Returns true (1) if this object is valid. Do not call any other functions // if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_print_settings_t* self); /// // Returns true (1) if the values of this object are read-only. Some APIs may // expose read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_print_settings_t* self); /// // Returns a writable copy of this object. /// - struct _cef_print_settings_t* (CEF_CALLBACK *copy)( + struct _cef_print_settings_t*(CEF_CALLBACK* copy)( struct _cef_print_settings_t* self); /// // Set the page orientation. /// - void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self, - int landscape); + void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self, + int landscape); /// // Returns true (1) if the orientation is landscape. /// - int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* is_landscape)(struct _cef_print_settings_t* self); /// // Set the printer printable area in device units. Some platforms already // provide flipped area. Set |landscape_needs_flip| to false (0) on those // platforms to avoid double flipping. /// - void (CEF_CALLBACK *set_printer_printable_area)( + void(CEF_CALLBACK* set_printer_printable_area)( struct _cef_print_settings_t* self, const cef_size_t* physical_size_device_units, const cef_rect_t* printable_area_device_units, @@ -97,109 +98,109 @@ typedef struct _cef_print_settings_t { /// // Set the device name. /// - void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self, - const cef_string_t* name); + void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self, + const cef_string_t* name); /// // Get the device name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_device_name)( + cef_string_userfree_t(CEF_CALLBACK* get_device_name)( struct _cef_print_settings_t* self); /// // Set the DPI (dots per inch). /// - void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi); + void(CEF_CALLBACK* set_dpi)(struct _cef_print_settings_t* self, int dpi); /// // Get the DPI (dots per inch). /// - int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* get_dpi)(struct _cef_print_settings_t* self); /// // Set the page ranges. /// - void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self, - size_t rangesCount, cef_range_t const* ranges); + void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self, + size_t rangesCount, + cef_range_t const* ranges); /// // Returns the number of page ranges that currently exist. /// - size_t (CEF_CALLBACK *get_page_ranges_count)( + size_t(CEF_CALLBACK* get_page_ranges_count)( struct _cef_print_settings_t* self); /// // Retrieve the page ranges. /// - void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self, - size_t* rangesCount, cef_range_t* ranges); + void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self, + size_t* rangesCount, + cef_range_t* ranges); /// // Set whether only the selection will be printed. /// - void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self, - int selection_only); + void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self, + int selection_only); /// // Returns true (1) if only the selection will be printed. /// - int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* is_selection_only)(struct _cef_print_settings_t* self); /// // Set whether pages will be collated. /// - void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self, - int collate); + void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self, + int collate); /// // Returns true (1) if pages will be collated. /// - int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* will_collate)(struct _cef_print_settings_t* self); /// // Set the color model. /// - void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self, - cef_color_model_t model); + void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self, + cef_color_model_t model); /// // Get the color model. /// - cef_color_model_t (CEF_CALLBACK *get_color_model)( + cef_color_model_t(CEF_CALLBACK* get_color_model)( struct _cef_print_settings_t* self); /// // Set the number of copies. /// - void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self, - int copies); + void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self, + int copies); /// // Get the number of copies. /// - int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self); + int(CEF_CALLBACK* get_copies)(struct _cef_print_settings_t* self); /// // Set the duplex mode. /// - void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self, - cef_duplex_mode_t mode); + void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self, + cef_duplex_mode_t mode); /// // Get the duplex mode. /// - cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)( + cef_duplex_mode_t(CEF_CALLBACK* get_duplex_mode)( struct _cef_print_settings_t* self); } cef_print_settings_t; - /// // Create a new cef_print_settings_t object. /// CEF_EXPORT cef_print_settings_t* cef_print_settings_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_process_message_capi.h b/include/capi/cef_process_message_capi.h index fab85b5e8..ff76d33c5 100644 --- a/include/capi/cef_process_message_capi.h +++ b/include/capi/cef_process_message_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c2ee22474637f9aed7673670fb10c960ae621535$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Structure representing a message. Can be used on any process and thread. /// @@ -59,42 +60,40 @@ typedef struct _cef_process_message_t { // Returns true (1) if this object is valid. Do not call any other functions // if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_process_message_t* self); /// // Returns true (1) if the values of this object are read-only. Some APIs may // expose read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_process_message_t* self); /// // Returns a writable copy of this object. /// - struct _cef_process_message_t* (CEF_CALLBACK *copy)( + struct _cef_process_message_t*(CEF_CALLBACK* copy)( struct _cef_process_message_t* self); /// // Returns the message name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_name)( + cef_string_userfree_t(CEF_CALLBACK* get_name)( struct _cef_process_message_t* self); /// // Returns the list of arguments. /// - struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)( + struct _cef_list_value_t*(CEF_CALLBACK* get_argument_list)( struct _cef_process_message_t* self); } cef_process_message_t; - /// // Create a new cef_process_message_t object with the specified name. /// CEF_EXPORT cef_process_message_t* cef_process_message_create( const cef_string_t* name); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_process_util_capi.h b/include/capi/cef_process_util_capi.h index 62a267133..f138eb4b2 100644 --- a/include/capi/cef_process_util_capi.h +++ b/include/capi/cef_process_util_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=aad07da2d500b8d31e02a75331bdb68f16d4c662$ +// #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Launches the process specified via |command_line|. Returns true (1) upon // success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. diff --git a/include/capi/cef_render_handler_capi.h b/include/capi/cef_render_handler_capi.h index 31fc11861..7469585af 100644 --- a/include/capi/cef_render_handler_capi.h +++ b/include/capi/cef_render_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=5d20fc88dea8dad8691f05bfb7e8c1ce5cf2bbc1$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ @@ -47,7 +49,6 @@ extern "C" { #endif - /// // Implement this structure to handle events when window rendering is disabled. // The functions of this structure will be called on the UI thread. @@ -62,31 +63,35 @@ typedef struct _cef_render_handler_t { // Return the handler for accessibility notifications. If no handler is // provided the default implementation will be used. /// - struct _cef_accessibility_handler_t* ( - CEF_CALLBACK *get_accessibility_handler)( + struct _cef_accessibility_handler_t*(CEF_CALLBACK* get_accessibility_handler)( struct _cef_render_handler_t* self); /// // Called to retrieve the root window rectangle in screen coordinates. Return // true (1) if the rectangle was provided. /// - int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_rect_t* rect); + int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_rect_t* rect); /// // Called to retrieve the view rectangle which is relative to screen // coordinates. Return true (1) if the rectangle was provided. /// - int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_rect_t* rect); + int(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_rect_t* rect); /// // Called to retrieve the translation from view coordinates to actual screen // coordinates. Return true (1) if the screen coordinates were provided. /// - int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, int viewX, int viewY, int* screenX, - int* screenY); + int(CEF_CALLBACK* get_screen_point)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + int viewX, + int viewY, + int* screenX, + int* screenY); /// // Called to allow the client to fill in the CefScreenInfo object with @@ -97,22 +102,25 @@ typedef struct _cef_render_handler_t { // will be used. If the rectangle is still NULL or invalid popups may not be // drawn correctly. /// - int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info); + int(CEF_CALLBACK* get_screen_info)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_screen_info_t* screen_info); /// // Called when the browser wants to show or hide the popup widget. The popup // should be shown if |show| is true (1) and hidden if |show| is false (0). /// - void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, int show); + void(CEF_CALLBACK* on_popup_show)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + int show); /// // Called when the browser wants to move or resize the popup widget. |rect| // contains the new location and size in view coordinates. /// - void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, const cef_rect_t* rect); + void(CEF_CALLBACK* on_popup_size)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + const cef_rect_t* rect); /// // Called when an element should be painted. Pixel values passed to this @@ -124,17 +132,23 @@ typedef struct _cef_render_handler_t { // be |width|*|height|*4 bytes in size and represents a BGRA image with an // upper-left origin. /// - void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_paint_element_type_t type, - size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer, - int width, int height); + void(CEF_CALLBACK* on_paint)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_paint_element_type_t type, + size_t dirtyRectsCount, + cef_rect_t const* dirtyRects, + const void* buffer, + int width, + int height); /// // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then // |custom_cursor_info| will be populated with the custom cursor information. /// - void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_cursor_handle_t cursor, + void(CEF_CALLBACK* on_cursor_change)( + struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_cursor_handle_t cursor, cef_cursor_type_t type, const struct _cef_cursor_info_t* custom_cursor_info); @@ -152,37 +166,44 @@ typedef struct _cef_render_handler_t { // synchronously or asynchronously to inform the web view that the drag // operation has ended. /// - int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data, - cef_drag_operations_mask_t allowed_ops, int x, int y); + int(CEF_CALLBACK* start_dragging)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_drag_data_t* drag_data, + cef_drag_operations_mask_t allowed_ops, + int x, + int y); /// // Called when the web view wants to update the mouse cursor during a drag & // drop operation. |operation| describes the allowed operation (none, move, // copy, link). /// - void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, cef_drag_operations_mask_t operation); + void(CEF_CALLBACK* update_drag_cursor)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_drag_operations_mask_t operation); /// // Called when the scroll offset has changed. /// - void (CEF_CALLBACK *on_scroll_offset_changed)( - struct _cef_render_handler_t* self, struct _cef_browser_t* browser, - double x, double y); + void(CEF_CALLBACK* on_scroll_offset_changed)( + struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + double x, + double y); /// // Called when the IME composition range has changed. |selected_range| is the // range of characters that have been selected. |character_bounds| is the // bounds of each character in view coordinates. /// - void (CEF_CALLBACK *on_ime_composition_range_changed)( - struct _cef_render_handler_t* self, struct _cef_browser_t* browser, - const cef_range_t* selected_range, size_t character_boundsCount, + void(CEF_CALLBACK* on_ime_composition_range_changed)( + struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + const cef_range_t* selected_range, + size_t character_boundsCount, cef_rect_t const* character_bounds); } cef_render_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_render_process_handler_capi.h b/include/capi/cef_render_process_handler_capi.h index c235957eb..bb2a88939 100644 --- a/include/capi/cef_render_process_handler_capi.h +++ b/include/capi/cef_render_process_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=04ddf8c8cc5e09610a6cd6dbee96194eb6567b41$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ @@ -51,7 +53,6 @@ extern "C" { #endif - /// // Structure used to implement render process callbacks. The functions of this // structure will be called on the render process main thread (TID_RENDERER) @@ -69,14 +70,14 @@ typedef struct _cef_render_process_handler_t { // cef_browser_process_handler_t::on_render_process_thread_created(). Do not // keep a reference to |extra_info| outside of this function. /// - void (CEF_CALLBACK *on_render_thread_created)( + void(CEF_CALLBACK* on_render_thread_created)( struct _cef_render_process_handler_t* self, struct _cef_list_value_t* extra_info); /// // Called after WebKit has been initialized. /// - void (CEF_CALLBACK *on_web_kit_initialized)( + void(CEF_CALLBACK* on_web_kit_initialized)( struct _cef_render_process_handler_t* self); /// @@ -84,21 +85,21 @@ typedef struct _cef_render_process_handler_t { // browser will be created before the old browser with the same identifier is // destroyed. /// - void (CEF_CALLBACK *on_browser_created)( + void(CEF_CALLBACK* on_browser_created)( struct _cef_render_process_handler_t* self, struct _cef_browser_t* browser); /// // Called before a browser is destroyed. /// - void (CEF_CALLBACK *on_browser_destroyed)( + void(CEF_CALLBACK* on_browser_destroyed)( struct _cef_render_process_handler_t* self, struct _cef_browser_t* browser); /// // Return the handler for browser load status events. /// - struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)( struct _cef_render_process_handler_t* self); /// @@ -106,10 +107,12 @@ typedef struct _cef_render_process_handler_t { // or false (0) to allow the navigation to proceed. The |request| object // cannot be modified in this callback. /// - int (CEF_CALLBACK *on_before_navigation)( + int(CEF_CALLBACK* on_before_navigation)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_request_t* request, cef_navigation_type_t navigation_type, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, + cef_navigation_type_t navigation_type, int is_redirect); /// @@ -120,18 +123,20 @@ typedef struct _cef_render_process_handler_t { // on the associated thread can be retrieved via the // cef_v8context_t::get_task_runner() function. /// - void (CEF_CALLBACK *on_context_created)( + void(CEF_CALLBACK* on_context_created)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_v8context_t* context); /// // Called immediately before the V8 context for a frame is released. No // references to the context should be kept after this function is called. /// - void (CEF_CALLBACK *on_context_released)( + void(CEF_CALLBACK* on_context_released)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_v8context_t* context); /// @@ -139,10 +144,12 @@ typedef struct _cef_render_process_handler_t { // callback is disabled by default. To enable set // CefSettings.uncaught_exception_stack_size > 0. /// - void (CEF_CALLBACK *on_uncaught_exception)( + void(CEF_CALLBACK* on_uncaught_exception)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_v8context_t* context, struct _cef_v8exception_t* exception, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_v8context_t* context, + struct _cef_v8exception_t* exception, struct _cef_v8stack_trace_t* stackTrace); /// @@ -153,9 +160,10 @@ typedef struct _cef_render_process_handler_t { // keep references to or attempt to access any DOM objects outside the scope // of this function. /// - void (CEF_CALLBACK *on_focused_node_changed)( + void(CEF_CALLBACK* on_focused_node_changed)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_domnode_t* node); /// @@ -163,13 +171,13 @@ typedef struct _cef_render_process_handler_t { // (1) if the message was handled or false (0) otherwise. Do not keep a // reference to or attempt to access the message outside of this callback. /// - int (CEF_CALLBACK *on_process_message_received)( + int(CEF_CALLBACK* on_process_message_received)( struct _cef_render_process_handler_t* self, - struct _cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_browser_t* browser, + cef_process_id_t source_process, struct _cef_process_message_t* message); } cef_render_process_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_request_capi.h b/include/capi/cef_request_capi.h index 9732431fe..0d754122b 100644 --- a/include/capi/cef_request_capi.h +++ b/include/capi/cef_request_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=e4d28f171862beea61f00e46d7acb8ee4154b077$ +// #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ @@ -60,118 +62,121 @@ typedef struct _cef_request_t { /// // Returns true (1) if this object is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_request_t* self); /// // Get the fully qualified URL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_request_t* self); /// // Set the fully qualified URL. /// - void (CEF_CALLBACK *set_url)(struct _cef_request_t* self, - const cef_string_t* url); + void(CEF_CALLBACK* set_url)(struct _cef_request_t* self, + const cef_string_t* url); /// // Get the request function type. The value will default to POST if post data // is provided and GET otherwise. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_method)(struct _cef_request_t* self); /// // Set the request function type. /// - void (CEF_CALLBACK *set_method)(struct _cef_request_t* self, - const cef_string_t* method); + void(CEF_CALLBACK* set_method)(struct _cef_request_t* self, + const cef_string_t* method); /// // Set the referrer URL and policy. If non-NULL the referrer URL must be fully // qualified with an HTTP or HTTPS scheme component. Any username, password or // ref component will be removed. /// - void (CEF_CALLBACK *set_referrer)(struct _cef_request_t* self, - const cef_string_t* referrer_url, cef_referrer_policy_t policy); + void(CEF_CALLBACK* set_referrer)(struct _cef_request_t* self, + const cef_string_t* referrer_url, + cef_referrer_policy_t policy); /// // Get the referrer URL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_referrer_url)( + cef_string_userfree_t(CEF_CALLBACK* get_referrer_url)( struct _cef_request_t* self); /// // Get the referrer policy. /// - cef_referrer_policy_t (CEF_CALLBACK *get_referrer_policy)( + cef_referrer_policy_t(CEF_CALLBACK* get_referrer_policy)( struct _cef_request_t* self); /// // Get the post data. /// - struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)( + struct _cef_post_data_t*(CEF_CALLBACK* get_post_data)( struct _cef_request_t* self); /// // Set the post data. /// - void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self, - struct _cef_post_data_t* postData); + void(CEF_CALLBACK* set_post_data)(struct _cef_request_t* self, + struct _cef_post_data_t* postData); /// // Get the header values. Will not include the Referer value if any. /// - void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self, - cef_string_multimap_t headerMap); + void(CEF_CALLBACK* get_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); /// // Set the header values. If a Referer value exists in the header map it will // be removed and ignored. /// - void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self, - cef_string_multimap_t headerMap); + void(CEF_CALLBACK* set_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); /// // Set all values at one time. /// - void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url, - const cef_string_t* method, struct _cef_post_data_t* postData, - cef_string_multimap_t headerMap); + void(CEF_CALLBACK* set)(struct _cef_request_t* self, + const cef_string_t* url, + const cef_string_t* method, + struct _cef_post_data_t* postData, + cef_string_multimap_t headerMap); /// // Get the flags used in combination with cef_urlrequest_t. See // cef_urlrequest_flags_t for supported values. /// - int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self); + int(CEF_CALLBACK* get_flags)(struct _cef_request_t* self); /// // Set the flags used in combination with cef_urlrequest_t. See // cef_urlrequest_flags_t for supported values. /// - void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags); + void(CEF_CALLBACK* set_flags)(struct _cef_request_t* self, int flags); /// // Set the URL to the first party for cookies used in combination with // cef_urlrequest_t. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)( + cef_string_userfree_t(CEF_CALLBACK* get_first_party_for_cookies)( struct _cef_request_t* self); /// // Get the URL to the first party for cookies used in combination with // cef_urlrequest_t. /// - void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self, - const cef_string_t* url); + void(CEF_CALLBACK* set_first_party_for_cookies)(struct _cef_request_t* self, + const cef_string_t* url); /// // Get the resource type for this request. Only available in the browser // process. /// - cef_resource_type_t (CEF_CALLBACK *get_resource_type)( + cef_resource_type_t(CEF_CALLBACK* get_resource_type)( struct _cef_request_t* self); /// @@ -179,7 +184,7 @@ typedef struct _cef_request_t { // process and only applies to requests that represent a main frame or sub- // frame navigation. /// - cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + cef_transition_type_t(CEF_CALLBACK* get_transition_type)( struct _cef_request_t* self); /// @@ -187,16 +192,14 @@ typedef struct _cef_request_t { // specified. Can be used by cef_request_tHandler implementations in the // browser process to track a single request across multiple callbacks. /// - uint64 (CEF_CALLBACK *get_identifier)(struct _cef_request_t* self); + uint64(CEF_CALLBACK* get_identifier)(struct _cef_request_t* self); } cef_request_t; - /// // Create a new cef_request_t object. /// CEF_EXPORT cef_request_t* cef_request_create(); - /// // Structure used to represent post data for a web request. The functions of // this structure may be called on any thread. @@ -210,7 +213,7 @@ typedef struct _cef_post_data_t { /// // Returns true (1) if this object is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_t* self); /// // Returns true (1) if the underlying POST data includes elements that are not @@ -218,45 +221,44 @@ typedef struct _cef_post_data_t { // upload data). Modifying cef_post_data_t objects with excluded elements may // result in the request failing. /// - int (CEF_CALLBACK *has_excluded_elements)(struct _cef_post_data_t* self); + int(CEF_CALLBACK* has_excluded_elements)(struct _cef_post_data_t* self); /// // Returns the number of existing post data elements. /// - size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self); + size_t(CEF_CALLBACK* get_element_count)(struct _cef_post_data_t* self); /// // Retrieve the post data elements. /// - void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self, - size_t* elementsCount, struct _cef_post_data_element_t** elements); + void(CEF_CALLBACK* get_elements)(struct _cef_post_data_t* self, + size_t* elementsCount, + struct _cef_post_data_element_t** elements); /// // Remove the specified post data element. Returns true (1) if the removal // succeeds. /// - int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element); + int(CEF_CALLBACK* remove_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); /// // Add the specified post data element. Returns true (1) if the add succeeds. /// - int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element); + int(CEF_CALLBACK* add_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); /// // Remove all existing post data elements. /// - void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self); + void(CEF_CALLBACK* remove_elements)(struct _cef_post_data_t* self); } cef_post_data_t; - /// // Create a new cef_post_data_t object. /// CEF_EXPORT cef_post_data_t* cef_post_data_create(); - /// // Structure used to represent a single element in the request post data. The // functions of this structure may be called on any thread. @@ -270,59 +272,59 @@ typedef struct _cef_post_data_element_t { /// // Returns true (1) if this object is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_post_data_element_t* self); /// // Remove all contents from the post data element. /// - void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self); + void(CEF_CALLBACK* set_to_empty)(struct _cef_post_data_element_t* self); /// // The post data element will represent a file. /// - void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self, - const cef_string_t* fileName); + void(CEF_CALLBACK* set_to_file)(struct _cef_post_data_element_t* self, + const cef_string_t* fileName); /// // The post data element will represent bytes. The bytes passed in will be // copied. /// - void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self, - size_t size, const void* bytes); + void(CEF_CALLBACK* set_to_bytes)(struct _cef_post_data_element_t* self, + size_t size, + const void* bytes); /// // Return the type of this post data element. /// - cef_postdataelement_type_t (CEF_CALLBACK *get_type)( + cef_postdataelement_type_t(CEF_CALLBACK* get_type)( struct _cef_post_data_element_t* self); /// // Return the file name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_file)( + cef_string_userfree_t(CEF_CALLBACK* get_file)( struct _cef_post_data_element_t* self); /// // Return the number of bytes. /// - size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self); + size_t(CEF_CALLBACK* get_bytes_count)(struct _cef_post_data_element_t* self); /// // Read up to |size| bytes into |bytes| and return the number of bytes // actually read. /// - size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self, - size_t size, void* bytes); + size_t(CEF_CALLBACK* get_bytes)(struct _cef_post_data_element_t* self, + size_t size, + void* bytes); } cef_post_data_element_t; - /// // Create a new cef_post_data_element_t object. /// CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_request_context_capi.h b/include/capi/cef_request_context_capi.h index 97e292fc9..a2ed8cc19 100644 --- a/include/capi/cef_request_context_capi.h +++ b/include/capi/cef_request_context_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=791231acc78a2b601257fb0b86d904eace796d63$ +// #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ @@ -63,12 +65,11 @@ typedef struct _cef_resolve_callback_t { // result code. |resolved_ips| will be the list of resolved IP addresses or // NULL if the resolution failed. /// - void (CEF_CALLBACK *on_resolve_completed)( - struct _cef_resolve_callback_t* self, cef_errorcode_t result, - cef_string_list_t resolved_ips); + void(CEF_CALLBACK* on_resolve_completed)(struct _cef_resolve_callback_t* self, + cef_errorcode_t result, + cef_string_list_t resolved_ips); } cef_resolve_callback_t; - /// // A request context provides request handling for a set of related browser or // URL request objects. A request context can be specified when creating a new @@ -95,27 +96,27 @@ typedef struct _cef_request_context_t { // Returns true (1) if this object is pointing to the same context as |that| // object. /// - int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self, - struct _cef_request_context_t* other); + int(CEF_CALLBACK* is_same)(struct _cef_request_context_t* self, + struct _cef_request_context_t* other); /// // Returns true (1) if this object is sharing the same storage as |that| // object. /// - int (CEF_CALLBACK *is_sharing_with)(struct _cef_request_context_t* self, - struct _cef_request_context_t* other); + int(CEF_CALLBACK* is_sharing_with)(struct _cef_request_context_t* self, + struct _cef_request_context_t* other); /// // Returns true (1) if this object is the global context. The global context // is used by default when creating a browser or URL request with a NULL // context argument. /// - int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self); + int(CEF_CALLBACK* is_global)(struct _cef_request_context_t* self); /// // Returns the handler for this context if any. /// - struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)( + struct _cef_request_context_handler_t*(CEF_CALLBACK* get_handler)( struct _cef_request_context_t* self); /// @@ -123,7 +124,7 @@ typedef struct _cef_request_context_t { // memory cache is being used. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_cache_path)( + cef_string_userfree_t(CEF_CALLBACK* get_cache_path)( struct _cef_request_context_t* self); /// @@ -134,7 +135,7 @@ typedef struct _cef_request_context_t { // If |callback| is non-NULL it will be executed asnychronously on the IO // thread after the manager's storage has been initialized. /// - struct _cef_cookie_manager_t* (CEF_CALLBACK *get_default_cookie_manager)( + struct _cef_cookie_manager_t*(CEF_CALLBACK* get_default_cookie_manager)( struct _cef_request_context_t* self, struct _cef_completion_callback_t* callback); @@ -151,8 +152,9 @@ typedef struct _cef_request_context_t { // optional |domain_name|. Returns false (0) if an error occurs. This function // may be called on any thread in the browser process. /// - int (CEF_CALLBACK *register_scheme_handler_factory)( - struct _cef_request_context_t* self, const cef_string_t* scheme_name, + int(CEF_CALLBACK* register_scheme_handler_factory)( + struct _cef_request_context_t* self, + const cef_string_t* scheme_name, const cef_string_t* domain_name, struct _cef_scheme_handler_factory_t* factory); @@ -160,7 +162,7 @@ typedef struct _cef_request_context_t { // Clear all registered scheme handler factories. Returns false (0) on error. // This function may be called on any thread in the browser process. /// - int (CEF_CALLBACK *clear_scheme_handler_factories)( + int(CEF_CALLBACK* clear_scheme_handler_factories)( struct _cef_request_context_t* self); /// @@ -170,15 +172,16 @@ typedef struct _cef_request_context_t { // cef_request_tContextHandler::OnBeforePluginLoad may be called to rebuild // the plugin list cache. /// - void (CEF_CALLBACK *purge_plugin_list_cache)( - struct _cef_request_context_t* self, int reload_pages); + void(CEF_CALLBACK* purge_plugin_list_cache)( + struct _cef_request_context_t* self, + int reload_pages); /// // Returns true (1) if a preference with the specified |name| exists. This // function must be called on the browser process UI thread. /// - int (CEF_CALLBACK *has_preference)(struct _cef_request_context_t* self, - const cef_string_t* name); + int(CEF_CALLBACK* has_preference)(struct _cef_request_context_t* self, + const cef_string_t* name); /// // Returns the value for the preference with the specified |name|. Returns @@ -187,8 +190,9 @@ typedef struct _cef_request_context_t { // will not modify the underlying preference value. This function must be // called on the browser process UI thread. /// - struct _cef_value_t* (CEF_CALLBACK *get_preference)( - struct _cef_request_context_t* self, const cef_string_t* name); + struct _cef_value_t*(CEF_CALLBACK* get_preference)( + struct _cef_request_context_t* self, + const cef_string_t* name); /// // Returns all preferences as a dictionary. If |include_defaults| is true (1) @@ -198,8 +202,9 @@ typedef struct _cef_request_context_t { // preference values. This function must be called on the browser process UI // thread. /// - struct _cef_dictionary_value_t* (CEF_CALLBACK *get_all_preferences)( - struct _cef_request_context_t* self, int include_defaults); + struct _cef_dictionary_value_t*(CEF_CALLBACK* get_all_preferences)( + struct _cef_request_context_t* self, + int include_defaults); /// // Returns true (1) if the preference with the specified |name| can be @@ -207,8 +212,8 @@ typedef struct _cef_request_context_t { // command-line usually cannot be modified. This function must be called on // the browser process UI thread. /// - int (CEF_CALLBACK *can_set_preference)(struct _cef_request_context_t* self, - const cef_string_t* name); + int(CEF_CALLBACK* can_set_preference)(struct _cef_request_context_t* self, + const cef_string_t* name); /// // Set the |value| associated with preference |name|. Returns true (1) if the @@ -217,9 +222,10 @@ typedef struct _cef_request_context_t { // fails then |error| will be populated with a detailed description of the // problem. This function must be called on the browser process UI thread. /// - int (CEF_CALLBACK *set_preference)(struct _cef_request_context_t* self, - const cef_string_t* name, struct _cef_value_t* value, - cef_string_t* error); + int(CEF_CALLBACK* set_preference)(struct _cef_request_context_t* self, + const cef_string_t* name, + struct _cef_value_t* value, + cef_string_t* error); /// // Clears all certificate exceptions that were added as part of handling @@ -229,7 +235,7 @@ typedef struct _cef_request_context_t { // |callback| is non-NULL it will be executed on the UI thread after // completion. /// - void (CEF_CALLBACK *clear_certificate_exceptions)( + void(CEF_CALLBACK* clear_certificate_exceptions)( struct _cef_request_context_t* self, struct _cef_completion_callback_t* callback); @@ -239,7 +245,7 @@ typedef struct _cef_request_context_t { // want to call cef_shutdown(). If |callback| is non-NULL it will be executed // on the UI thread after completion. /// - void (CEF_CALLBACK *close_all_connections)( + void(CEF_CALLBACK* close_all_connections)( struct _cef_request_context_t* self, struct _cef_completion_callback_t* callback); @@ -247,8 +253,9 @@ typedef struct _cef_request_context_t { // Attempts to resolve |origin| to a list of associated IP addresses. // |callback| will be executed on the UI thread after completion. /// - void (CEF_CALLBACK *resolve_host)(struct _cef_request_context_t* self, - const cef_string_t* origin, struct _cef_resolve_callback_t* callback); + void(CEF_CALLBACK* resolve_host)(struct _cef_request_context_t* self, + const cef_string_t* origin, + struct _cef_resolve_callback_t* callback); /// // Attempts to resolve |origin| to a list of associated IP addresses using @@ -256,12 +263,12 @@ typedef struct _cef_request_context_t { // addresses or NULL if no cached data is available. Returns ERR_NONE on // success. This function must be called on the browser process IO thread. /// - cef_errorcode_t (CEF_CALLBACK *resolve_host_cached)( - struct _cef_request_context_t* self, const cef_string_t* origin, + cef_errorcode_t(CEF_CALLBACK* resolve_host_cached)( + struct _cef_request_context_t* self, + const cef_string_t* origin, cef_string_list_t resolved_ips); } cef_request_context_t; - /// // Returns the global context object. /// @@ -283,7 +290,6 @@ CEF_EXPORT cef_request_context_t* cef_create_context_shared( cef_request_context_t* other, struct _cef_request_context_handler_t* handler); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_request_context_handler_capi.h b/include/capi/cef_request_context_handler_capi.h index 32b9c0052..12937f703 100644 --- a/include/capi/cef_request_context_handler_capi.h +++ b/include/capi/cef_request_context_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=9359e227c9d534c9c612d2ede790136461836501$ +// #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Implement this structure to provide handler implementations. The handler // instance will not be released until all objects related to the context have @@ -63,7 +64,7 @@ typedef struct _cef_request_context_handler_t { // this function returns NULL the default cookie manager retrievable via // cef_request_tContext::get_default_cookie_manager() will be used. /// - struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)( + struct _cef_cookie_manager_t*(CEF_CALLBACK* get_cookie_manager)( struct _cef_request_context_handler_t* self); /// @@ -85,15 +86,16 @@ typedef struct _cef_request_context_handler_t { // trigger new calls to this function call // cef_request_tContext::PurgePluginListCache. /// - int (CEF_CALLBACK *on_before_plugin_load)( + int(CEF_CALLBACK* on_before_plugin_load)( struct _cef_request_context_handler_t* self, - const cef_string_t* mime_type, const cef_string_t* plugin_url, - int is_main_frame, const cef_string_t* top_origin_url, + const cef_string_t* mime_type, + const cef_string_t* plugin_url, + int is_main_frame, + const cef_string_t* top_origin_url, struct _cef_web_plugin_info_t* plugin_info, cef_plugin_policy_t* plugin_policy); } cef_request_context_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_request_handler_capi.h b/include/capi/cef_request_handler_capi.h index 7cc6e9823..5ae1b78c9 100644 --- a/include/capi/cef_request_handler_capi.h +++ b/include/capi/cef_request_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=b6cbe39a8124a961036205864e7e6b2e1eb0bf6b$ +// #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ @@ -53,7 +55,6 @@ extern "C" { #endif - /// // Callback structure used for asynchronous continuation of url requests. /// @@ -67,15 +68,14 @@ typedef struct _cef_request_callback_t { // Continue the url request. If |allow| is true (1) the request will be // continued. Otherwise, the request will be canceled. /// - void (CEF_CALLBACK *cont)(struct _cef_request_callback_t* self, int allow); + void(CEF_CALLBACK* cont)(struct _cef_request_callback_t* self, int allow); /// // Cancel the url request. /// - void (CEF_CALLBACK *cancel)(struct _cef_request_callback_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self); } cef_request_callback_t; - /// // Callback structure used to select a client certificate for authentication. /// @@ -89,12 +89,11 @@ typedef struct _cef_select_client_certificate_callback_t { // Chooses the specified certificate for client certificate authentication. // NULL value means that no client certificate should be used. /// - void (CEF_CALLBACK *select)( + void(CEF_CALLBACK* select)( struct _cef_select_client_certificate_callback_t* self, struct _cef_x509certificate_t* cert); } cef_select_client_certificate_callback_t; - /// // Implement this structure to handle events related to browser requests. The // functions of this structure will be called on the thread indicated. @@ -115,9 +114,11 @@ typedef struct _cef_request_handler_t { // cef_load_handler_t::OnLoadError will be called with an |errorCode| value of // ERR_ABORTED. /// - int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_request_t* request, int is_redirect); + int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, + int is_redirect); /// // Called on the UI thread before OnBeforeBrowse in certain limited cases @@ -135,10 +136,13 @@ typedef struct _cef_request_handler_t { // true (1) to cancel the navigation or false (0) to allow the navigation to // proceed in the source browser's top-level frame. /// - int (CEF_CALLBACK *on_open_urlfrom_tab)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, + int(CEF_CALLBACK* on_open_urlfrom_tab)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, const cef_string_t* target_url, - cef_window_open_disposition_t target_disposition, int user_gesture); + cef_window_open_disposition_t target_disposition, + int user_gesture); /// // Called on the IO thread before a resource request is loaded. The |request| @@ -148,9 +152,11 @@ typedef struct _cef_request_handler_t { // Return RV_CANCEL to cancel the request immediately. // /// - cef_return_value_t (CEF_CALLBACK *on_before_resource_load)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_request_t* request, + cef_return_value_t(CEF_CALLBACK* on_before_resource_load)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, struct _cef_request_callback_t* callback); /// @@ -159,9 +165,11 @@ typedef struct _cef_request_handler_t { // a cef_resource_handler_t object. The |request| object should not be // modified in this callback. /// - struct _cef_resource_handler_t* (CEF_CALLBACK *get_resource_handler)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_request_t* request); + struct _cef_resource_handler_t*(CEF_CALLBACK* get_resource_handler)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request); /// // Called on the IO thread when a resource load is redirected. The |request| @@ -171,10 +179,12 @@ typedef struct _cef_request_handler_t { // changed if desired. The |request| object cannot be modified in this // callback. /// - void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_request_t* request, struct _cef_response_t* response, - cef_string_t* new_url); + void(CEF_CALLBACK* on_resource_redirect)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, + struct _cef_response_t* response, + cef_string_t* new_url); /// // Called on the IO thread when a resource response is received. To allow the @@ -182,18 +192,22 @@ typedef struct _cef_request_handler_t { // resource modify |request| (url, headers or post body) and return true (1). // The |response| object cannot be modified in this callback. /// - int (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - struct _cef_request_t* request, struct _cef_response_t* response); + int(CEF_CALLBACK* on_resource_response)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, + struct _cef_response_t* response); /// // Called on the IO thread to optionally filter resource response content. // |request| and |response| represent the request and response respectively // and cannot be modified in this callback. /// - struct _cef_response_filter_t* (CEF_CALLBACK *get_resource_response_filter)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_request_t* request, + struct _cef_response_filter_t*(CEF_CALLBACK* get_resource_response_filter)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, struct _cef_response_t* response); /// @@ -202,10 +216,13 @@ typedef struct _cef_request_handler_t { // modified in this callback. |status| indicates the load completion status. // |received_content_length| is the number of response bytes actually read. /// - void (CEF_CALLBACK *on_resource_load_complete)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_request_t* request, - struct _cef_response_t* response, cef_urlrequest_status_t status, + void(CEF_CALLBACK* on_resource_load_complete)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_request_t* request, + struct _cef_response_t* response, + cef_urlrequest_status_t status, int64 received_content_length); /// @@ -219,10 +236,16 @@ typedef struct _cef_request_handler_t { // the authentication information is available. Return false (0) to cancel the // request immediately. /// - int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy, - const cef_string_t* host, int port, const cef_string_t* realm, - const cef_string_t* scheme, struct _cef_auth_callback_t* callback); + int(CEF_CALLBACK* get_auth_credentials)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + int isProxy, + const cef_string_t* host, + int port, + const cef_string_t* realm, + const cef_string_t* scheme, + struct _cef_auth_callback_t* callback); /// // Called on the IO thread when JavaScript requests a specific storage quota @@ -233,9 +256,11 @@ typedef struct _cef_request_handler_t { // grant or deny the request. Return false (0) to cancel the request // immediately. /// - int (CEF_CALLBACK *on_quota_request)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* origin_url, - int64 new_size, struct _cef_request_callback_t* callback); + int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* origin_url, + int64 new_size, + struct _cef_request_callback_t* callback); /// // Called on the UI thread to handle requests for URLs with an unknown @@ -244,9 +269,10 @@ typedef struct _cef_request_handler_t { // YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR // OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. /// - void (CEF_CALLBACK *on_protocol_execution)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - const cef_string_t* url, int* allow_os_execution); + void(CEF_CALLBACK* on_protocol_execution)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* url, + int* allow_os_execution); /// // Called on the UI thread to handle requests for URLs with an invalid SSL @@ -256,9 +282,12 @@ typedef struct _cef_request_handler_t { // CefSettings.ignore_certificate_errors is set all invalid certificates will // be accepted without calling this function. /// - int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, cef_errorcode_t cert_error, - const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info, + int(CEF_CALLBACK* on_certificate_error)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + cef_errorcode_t cert_error, + const cef_string_t* request_url, + struct _cef_sslinfo_t* ssl_info, struct _cef_request_callback_t* callback); /// @@ -274,9 +303,12 @@ typedef struct _cef_request_handler_t { // pruned by Chromium so that it only contains certificates from issuers that // the server trusts. /// - int (CEF_CALLBACK *on_select_client_certificate)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, - int isProxy, const cef_string_t* host, int port, + int(CEF_CALLBACK* on_select_client_certificate)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + int isProxy, + const cef_string_t* host, + int port, size_t certificatesCount, struct _cef_x509certificate_t* const* certificates, struct _cef_select_client_certificate_callback_t* callback); @@ -285,27 +317,28 @@ typedef struct _cef_request_handler_t { // Called on the browser process UI thread when a plugin has crashed. // |plugin_path| is the path of the plugin that crashed. /// - void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* plugin_path); + void(CEF_CALLBACK* on_plugin_crashed)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, + const cef_string_t* plugin_path); /// // Called on the browser process UI thread when the render view associated // with |browser| is ready to receive/handle IPC messages in the render // process. /// - void (CEF_CALLBACK *on_render_view_ready)(struct _cef_request_handler_t* self, - struct _cef_browser_t* browser); + void(CEF_CALLBACK* on_render_view_ready)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser); /// // Called on the browser process UI thread when the render process terminates // unexpectedly. |status| indicates how the process terminated. /// - void (CEF_CALLBACK *on_render_process_terminated)( - struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + void(CEF_CALLBACK* on_render_process_terminated)( + struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, cef_termination_status_t status); } cef_request_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_resource_bundle_capi.h b/include/capi/cef_resource_bundle_capi.h index 87b01f04b..7a2d56760 100644 --- a/include/capi/cef_resource_bundle_capi.h +++ b/include/capi/cef_resource_bundle_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=82f2ce6f2ea3a8268ac69e33d304ace1a0e192b2$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure used for retrieving resources from the resource bundle (*.pak) // files loaded by CEF during startup or via the cef_resource_bundle_tHandler @@ -64,8 +65,9 @@ typedef struct _cef_resource_bundle_t { // of valid string ID values. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_localized_string)( - struct _cef_resource_bundle_t* self, int string_id); + cef_string_userfree_t(CEF_CALLBACK* get_localized_string)( + struct _cef_resource_bundle_t* self, + int string_id); /// // Retrieves the contents of the specified scale independent |resource_id|. If @@ -75,8 +77,10 @@ typedef struct _cef_resource_bundle_t { // memory and should not be freed. Include cef_pack_resources.h for a listing // of valid resource ID values. /// - int (CEF_CALLBACK *get_data_resource)(struct _cef_resource_bundle_t* self, - int resource_id, void** data, size_t* data_size); + int(CEF_CALLBACK* get_data_resource)(struct _cef_resource_bundle_t* self, + int resource_id, + void** data, + size_t* data_size); /// // Retrieves the contents of the specified |resource_id| nearest the scale @@ -88,18 +92,19 @@ typedef struct _cef_resource_bundle_t { // memory and should not be freed. Include cef_pack_resources.h for a listing // of valid resource ID values. /// - int (CEF_CALLBACK *get_data_resource_for_scale)( - struct _cef_resource_bundle_t* self, int resource_id, - cef_scale_factor_t scale_factor, void** data, size_t* data_size); + int(CEF_CALLBACK* get_data_resource_for_scale)( + struct _cef_resource_bundle_t* self, + int resource_id, + cef_scale_factor_t scale_factor, + void** data, + size_t* data_size); } cef_resource_bundle_t; - /// // Returns the global resource bundle instance. /// CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_resource_bundle_handler_capi.h b/include/capi/cef_resource_bundle_handler_capi.h index 62d0c4499..bca23708a 100644 --- a/include/capi/cef_resource_bundle_handler_capi.h +++ b/include/capi/cef_resource_bundle_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=cd94d8670c26bf17082629e5297407a716f01503$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure used to implement a custom resource bundle structure. See // CefSettings for additional options related to resource bundle loading. The @@ -62,8 +63,9 @@ typedef struct _cef_resource_bundle_handler_t { // return true (1). To use the default translation return false (0). Include // cef_pack_strings.h for a listing of valid string ID values. /// - int (CEF_CALLBACK *get_localized_string)( - struct _cef_resource_bundle_handler_t* self, int string_id, + int(CEF_CALLBACK* get_localized_string)( + struct _cef_resource_bundle_handler_t* self, + int string_id, cef_string_t* string); /// @@ -74,8 +76,10 @@ typedef struct _cef_resource_bundle_handler_t { // resident in memory. Include cef_pack_resources.h for a listing of valid // resource ID values. /// - int (CEF_CALLBACK *get_data_resource)( - struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, + int(CEF_CALLBACK* get_data_resource)( + struct _cef_resource_bundle_handler_t* self, + int resource_id, + void** data, size_t* data_size); /// @@ -86,12 +90,14 @@ typedef struct _cef_resource_bundle_handler_t { // not be copied and must remain resident in memory. Include // cef_pack_resources.h for a listing of valid resource ID values. /// - int (CEF_CALLBACK *get_data_resource_for_scale)( - struct _cef_resource_bundle_handler_t* self, int resource_id, - cef_scale_factor_t scale_factor, void** data, size_t* data_size); + int(CEF_CALLBACK* get_data_resource_for_scale)( + struct _cef_resource_bundle_handler_t* self, + int resource_id, + cef_scale_factor_t scale_factor, + void** data, + size_t* data_size); } cef_resource_bundle_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_resource_handler_capi.h b/include/capi/cef_resource_handler_capi.h index 3722fb1a6..7997495dd 100644 --- a/include/capi/cef_resource_handler_capi.h +++ b/include/capi/cef_resource_handler_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=cd9c4ed153ad4425ff43d640a81693e3c83817d2$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ @@ -49,7 +51,6 @@ extern "C" { #endif - /// // Structure used to implement a custom request handler structure. The functions // of this structure will always be called on the IO thread. @@ -67,8 +68,9 @@ typedef struct _cef_resource_handler_t { // function if header information is available immediately). To cancel the // request return false (0). /// - int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self, - struct _cef_request_t* request, struct _cef_callback_t* callback); + int(CEF_CALLBACK* process_request)(struct _cef_resource_handler_t* self, + struct _cef_request_t* request, + struct _cef_callback_t* callback); /// // Retrieve response header information. If the response length is not known @@ -81,9 +83,10 @@ typedef struct _cef_resource_handler_t { // URL. If an error occured while setting up the request you can call // set_error() on |response| to indicate the error condition. /// - void (CEF_CALLBACK *get_response_headers)( - struct _cef_resource_handler_t* self, struct _cef_response_t* response, - int64* response_length, cef_string_t* redirectUrl); + void(CEF_CALLBACK* get_response_headers)(struct _cef_resource_handler_t* self, + struct _cef_response_t* response, + int64* response_length, + cef_string_t* redirectUrl); /// // Read response data. If data is available immediately copy up to @@ -92,32 +95,33 @@ typedef struct _cef_resource_handler_t { // |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the // data is available. To indicate response completion return false (0). /// - int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self, - void* data_out, int bytes_to_read, int* bytes_read, - struct _cef_callback_t* callback); + int(CEF_CALLBACK* read_response)(struct _cef_resource_handler_t* self, + void* data_out, + int bytes_to_read, + int* bytes_read, + struct _cef_callback_t* callback); /// // Return true (1) if the specified cookie can be sent with the request or // false (0) otherwise. If false (0) is returned for any cookie then no // cookies will be sent with the request. /// - int (CEF_CALLBACK *can_get_cookie)(struct _cef_resource_handler_t* self, - const struct _cef_cookie_t* cookie); + int(CEF_CALLBACK* can_get_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); /// // Return true (1) if the specified cookie returned with the response can be // set or false (0) otherwise. /// - int (CEF_CALLBACK *can_set_cookie)(struct _cef_resource_handler_t* self, - const struct _cef_cookie_t* cookie); + int(CEF_CALLBACK* can_set_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); /// // Request processing has been canceled. /// - void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_resource_handler_t* self); } cef_resource_handler_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_response_capi.h b/include/capi/cef_response_capi.h index 59395566d..8e68cd5a5 100644 --- a/include/capi/cef_response_capi.h +++ b/include/capi/cef_response_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=3f0ed89d2320677780c2fd526be7fe6312580cd8$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure used to represent a web response. The functions of this structure // may be called on any thread. @@ -58,83 +59,81 @@ typedef struct _cef_response_t { /// // Returns true (1) if this object is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_response_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_response_t* self); /// // Get the response error code. Returns ERR_NONE if there was no error. /// - cef_errorcode_t (CEF_CALLBACK *get_error)(struct _cef_response_t* self); + cef_errorcode_t(CEF_CALLBACK* get_error)(struct _cef_response_t* self); /// // Set the response error code. This can be used by custom scheme handlers to // return errors during initial request processing. /// - void (CEF_CALLBACK *set_error)(struct _cef_response_t* self, - cef_errorcode_t error); + void(CEF_CALLBACK* set_error)(struct _cef_response_t* self, + cef_errorcode_t error); /// // Get the response status code. /// - int (CEF_CALLBACK *get_status)(struct _cef_response_t* self); + int(CEF_CALLBACK* get_status)(struct _cef_response_t* self); /// // Set the response status code. /// - void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status); + void(CEF_CALLBACK* set_status)(struct _cef_response_t* self, int status); /// // Get the response status text. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_status_text)( + cef_string_userfree_t(CEF_CALLBACK* get_status_text)( struct _cef_response_t* self); /// // Set the response status text. /// - void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self, - const cef_string_t* statusText); + void(CEF_CALLBACK* set_status_text)(struct _cef_response_t* self, + const cef_string_t* statusText); /// // Get the response mime type. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + cef_string_userfree_t(CEF_CALLBACK* get_mime_type)( struct _cef_response_t* self); /// // Set the response mime type. /// - void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self, - const cef_string_t* mimeType); + void(CEF_CALLBACK* set_mime_type)(struct _cef_response_t* self, + const cef_string_t* mimeType); /// // Get the value for the specified response header field. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self, - const cef_string_t* name); + cef_string_userfree_t(CEF_CALLBACK* get_header)(struct _cef_response_t* self, + const cef_string_t* name); /// // Get all response header fields. /// - void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self, - cef_string_multimap_t headerMap); + void(CEF_CALLBACK* get_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); /// // Set all response header fields. /// - void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self, - cef_string_multimap_t headerMap); + void(CEF_CALLBACK* set_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); } cef_response_t; - /// // Create a new cef_response_t object. /// CEF_EXPORT cef_response_t* cef_response_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_response_filter_capi.h b/include/capi/cef_response_filter_capi.h index 698598d58..d46ebccfe 100644 --- a/include/capi/cef_response_filter_capi.h +++ b/include/capi/cef_response_filter_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c7126418fc448f9f75e770fda8434613eed0930d$ +// #ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure to filter resource response content. The functions // of this structure will be called on the browser process IO thread. @@ -59,7 +60,7 @@ typedef struct _cef_response_filter_t { // Initialize the response filter. Will only be called a single time. The // filter will not be installed if this function returns false (0). /// - int (CEF_CALLBACK *init_filter)(struct _cef_response_filter_t* self); + int(CEF_CALLBACK* init_filter)(struct _cef_response_filter_t* self); /// // Called to filter a chunk of data. Expected usage is as follows: @@ -92,13 +93,16 @@ typedef struct _cef_response_filter_t { // // Do not keep a reference to the buffers passed to this function. /// - cef_response_filter_status_t (CEF_CALLBACK *filter)( - struct _cef_response_filter_t* self, void* data_in, size_t data_in_size, - size_t* data_in_read, void* data_out, size_t data_out_size, + cef_response_filter_status_t(CEF_CALLBACK* filter)( + struct _cef_response_filter_t* self, + void* data_in, + size_t data_in_size, + size_t* data_in_read, + void* data_out, + size_t data_out_size, size_t* data_out_written); } cef_response_filter_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_scheme_capi.h b/include/capi/cef_scheme_capi.h index de2518bb1..e7463952c 100644 --- a/include/capi/cef_scheme_capi.h +++ b/include/capi/cef_scheme_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=a920e25c5ca348dcc45965d53389c16a8a29b0ed$ +// #ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ @@ -119,13 +121,16 @@ typedef struct _cef_scheme_registrar_t { // per unique |scheme_name| value. If |scheme_name| is already registered or // if an error occurs this function will return false (0). /// - int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self, - const cef_string_t* scheme_name, int is_standard, int is_local, - int is_display_isolated, int is_secure, int is_cors_enabled, - int is_csp_bypassing); + int(CEF_CALLBACK* add_custom_scheme)(struct _cef_scheme_registrar_t* self, + const cef_string_t* scheme_name, + int is_standard, + int is_local, + int is_display_isolated, + int is_secure, + int is_cors_enabled, + int is_csp_bypassing); } cef_scheme_registrar_t; - /// // Structure that creates cef_resource_handler_t instances for handling scheme // requests. The functions of this structure will always be called on the IO @@ -145,13 +150,14 @@ typedef struct _cef_scheme_handler_factory_t { // example, if the request came from cef_urlrequest_t). The |request| object // passed to this function will not contain cookie data. /// - struct _cef_resource_handler_t* (CEF_CALLBACK *create)( + struct _cef_resource_handler_t*(CEF_CALLBACK* create)( struct _cef_scheme_handler_factory_t* self, - struct _cef_browser_t* browser, struct _cef_frame_t* frame, - const cef_string_t* scheme_name, struct _cef_request_t* request); + struct _cef_browser_t* browser, + struct _cef_frame_t* frame, + const cef_string_t* scheme_name, + struct _cef_request_t* request); } cef_scheme_handler_factory_t; - /// // Register a scheme handler factory with the global request context. An NULL // |domain_name| value for a standard scheme will cause the factory to match all @@ -168,7 +174,8 @@ typedef struct _cef_scheme_handler_factory_t { // ory(). /// CEF_EXPORT int cef_register_scheme_handler_factory( - const cef_string_t* scheme_name, const cef_string_t* domain_name, + const cef_string_t* scheme_name, + const cef_string_t* domain_name, cef_scheme_handler_factory_t* factory); /// diff --git a/include/capi/cef_ssl_info_capi.h b/include/capi/cef_ssl_info_capi.h index 899219311..e924a3b80 100644 --- a/include/capi/cef_ssl_info_capi.h +++ b/include/capi/cef_ssl_info_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=7489f3078e15407c3984f0b2393df3b0ddc045b0$ +// #ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Structure representing SSL information. /// @@ -60,17 +61,15 @@ typedef struct _cef_sslinfo_t { // Returns a bitmask containing any and all problems verifying the server // certificate. /// - cef_cert_status_t (CEF_CALLBACK *get_cert_status)( - struct _cef_sslinfo_t* self); + cef_cert_status_t(CEF_CALLBACK* get_cert_status)(struct _cef_sslinfo_t* self); /// // Returns the X.509 certificate. /// - struct _cef_x509certificate_t* (CEF_CALLBACK *get_x509certificate)( + struct _cef_x509certificate_t*(CEF_CALLBACK* get_x509certificate)( struct _cef_sslinfo_t* self); } cef_sslinfo_t; - /// // Returns true (1) if the certificate status has any error, major or minor. /// diff --git a/include/capi/cef_ssl_status_capi.h b/include/capi/cef_ssl_status_capi.h index 04d867143..c82f9ade5 100644 --- a/include/capi/cef_ssl_status_capi.h +++ b/include/capi/cef_ssl_status_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=2aa604a0520a802ae3b10f5922d4a7ca48078785$ +// #ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // Structure representing the SSL information for a navigation entry. /// @@ -59,35 +60,34 @@ typedef struct _cef_sslstatus_t { /// // Returns true (1) if the status is related to a secure SSL/TLS connection. /// - int (CEF_CALLBACK *is_secure_connection)(struct _cef_sslstatus_t* self); + int(CEF_CALLBACK* is_secure_connection)(struct _cef_sslstatus_t* self); /// // Returns a bitmask containing any and all problems verifying the server // certificate. /// - cef_cert_status_t (CEF_CALLBACK *get_cert_status)( + cef_cert_status_t(CEF_CALLBACK* get_cert_status)( struct _cef_sslstatus_t* self); /// // Returns the SSL version used for the SSL connection. /// - cef_ssl_version_t (CEF_CALLBACK *get_sslversion)( + cef_ssl_version_t(CEF_CALLBACK* get_sslversion)( struct _cef_sslstatus_t* self); /// // Returns a bitmask containing the page security content status. /// - cef_ssl_content_status_t (CEF_CALLBACK *get_content_status)( + cef_ssl_content_status_t(CEF_CALLBACK* get_content_status)( struct _cef_sslstatus_t* self); /// // Returns the X.509 certificate. /// - struct _cef_x509certificate_t* (CEF_CALLBACK *get_x509certificate)( + struct _cef_x509certificate_t*(CEF_CALLBACK* get_x509certificate)( struct _cef_sslstatus_t* self); } cef_sslstatus_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_stream_capi.h b/include/capi/cef_stream_capi.h index 54feece20..13fcadd34 100644 --- a/include/capi/cef_stream_capi.h +++ b/include/capi/cef_stream_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=4e127106e9b5fada6bf05ea6e29bc502bb2a1e0d$ +// #ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Structure the client can implement to provide a custom stream reader. The // functions of this structure may be called on any thread. @@ -58,35 +59,37 @@ typedef struct _cef_read_handler_t { /// // Read raw binary data. /// - size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr, - size_t size, size_t n); + size_t(CEF_CALLBACK* read)(struct _cef_read_handler_t* self, + void* ptr, + size_t size, + size_t n); /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset, - int whence); + int(CEF_CALLBACK* seek)(struct _cef_read_handler_t* self, + int64 offset, + int whence); /// // Return the current offset position. /// - int64 (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self); + int64(CEF_CALLBACK* tell)(struct _cef_read_handler_t* self); /// // Return non-zero if at end of file. /// - int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self); + int(CEF_CALLBACK* eof)(struct _cef_read_handler_t* self); /// // Return true (1) if this handler performs work like accessing the file // system which may block. Used as a hint for determining the thread to access // the handler from. /// - int (CEF_CALLBACK *may_block)(struct _cef_read_handler_t* self); + int(CEF_CALLBACK* may_block)(struct _cef_read_handler_t* self); } cef_read_handler_t; - /// // Structure used to read data from a stream. The functions of this structure // may be called on any thread. @@ -100,35 +103,37 @@ typedef struct _cef_stream_reader_t { /// // Read raw binary data. /// - size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr, - size_t size, size_t n); + size_t(CEF_CALLBACK* read)(struct _cef_stream_reader_t* self, + void* ptr, + size_t size, + size_t n); /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset, - int whence); + int(CEF_CALLBACK* seek)(struct _cef_stream_reader_t* self, + int64 offset, + int whence); /// // Return the current offset position. /// - int64 (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self); + int64(CEF_CALLBACK* tell)(struct _cef_stream_reader_t* self); /// // Return non-zero if at end of file. /// - int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self); + int(CEF_CALLBACK* eof)(struct _cef_stream_reader_t* self); /// // Returns true (1) if this reader performs work like accessing the file // system which may block. Used as a hint for determining the thread to access // the reader from. /// - int (CEF_CALLBACK *may_block)(struct _cef_stream_reader_t* self); + int(CEF_CALLBACK* may_block)(struct _cef_stream_reader_t* self); } cef_stream_reader_t; - /// // Create a new cef_stream_reader_t object from a file. /// @@ -139,7 +144,7 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( // Create a new cef_stream_reader_t object from data. /// CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, - size_t size); + size_t size); /// // Create a new cef_stream_reader_t object from a custom handler. @@ -147,7 +152,6 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( cef_read_handler_t* handler); - /// // Structure the client can implement to provide a custom stream writer. The // functions of this structure may be called on any thread. @@ -161,35 +165,37 @@ typedef struct _cef_write_handler_t { /// // Write raw binary data. /// - size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self, - const void* ptr, size_t size, size_t n); + size_t(CEF_CALLBACK* write)(struct _cef_write_handler_t* self, + const void* ptr, + size_t size, + size_t n); /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset, - int whence); + int(CEF_CALLBACK* seek)(struct _cef_write_handler_t* self, + int64 offset, + int whence); /// // Return the current offset position. /// - int64 (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self); + int64(CEF_CALLBACK* tell)(struct _cef_write_handler_t* self); /// // Flush the stream. /// - int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self); + int(CEF_CALLBACK* flush)(struct _cef_write_handler_t* self); /// // Return true (1) if this handler performs work like accessing the file // system which may block. Used as a hint for determining the thread to access // the handler from. /// - int (CEF_CALLBACK *may_block)(struct _cef_write_handler_t* self); + int(CEF_CALLBACK* may_block)(struct _cef_write_handler_t* self); } cef_write_handler_t; - /// // Structure used to write data to a stream. The functions of this structure may // be called on any thread. @@ -203,35 +209,37 @@ typedef struct _cef_stream_writer_t { /// // Write raw binary data. /// - size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self, - const void* ptr, size_t size, size_t n); + size_t(CEF_CALLBACK* write)(struct _cef_stream_writer_t* self, + const void* ptr, + size_t size, + size_t n); /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset, - int whence); + int(CEF_CALLBACK* seek)(struct _cef_stream_writer_t* self, + int64 offset, + int whence); /// // Return the current offset position. /// - int64 (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self); + int64(CEF_CALLBACK* tell)(struct _cef_stream_writer_t* self); /// // Flush the stream. /// - int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self); + int(CEF_CALLBACK* flush)(struct _cef_stream_writer_t* self); /// // Returns true (1) if this writer performs work like accessing the file // system which may block. Used as a hint for determining the thread to access // the writer from. /// - int (CEF_CALLBACK *may_block)(struct _cef_stream_writer_t* self); + int(CEF_CALLBACK* may_block)(struct _cef_stream_writer_t* self); } cef_stream_writer_t; - /// // Create a new cef_stream_writer_t object for a file. /// @@ -244,7 +252,6 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( cef_write_handler_t* handler); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_string_visitor_capi.h b/include/capi/cef_string_visitor_capi.h index 5d19875d7..7d4c3df09 100644 --- a/include/capi/cef_string_visitor_capi.h +++ b/include/capi/cef_string_visitor_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=2e8edddfd49aea615c7adf8d0d092a4865b79229$ +// #ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure to receive string values asynchronously. /// @@ -57,11 +58,10 @@ typedef struct _cef_string_visitor_t { /// // Method that will be executed. /// - void (CEF_CALLBACK *visit)(struct _cef_string_visitor_t* self, - const cef_string_t* string); + void(CEF_CALLBACK* visit)(struct _cef_string_visitor_t* self, + const cef_string_t* string); } cef_string_visitor_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_task_capi.h b/include/capi/cef_task_capi.h index 98656de9e..ad48c70fa 100644 --- a/include/capi/cef_task_capi.h +++ b/include/capi/cef_task_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=344ba415349b4cc305f51cb9e22563b232433e25$ +// #ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure for asynchronous task execution. If the task is // posted successfully and if the associated message loop is still running then @@ -62,10 +63,9 @@ typedef struct _cef_task_t { /// // Method that will be executed on the target thread. /// - void (CEF_CALLBACK *execute)(struct _cef_task_t* self); + void(CEF_CALLBACK* execute)(struct _cef_task_t* self); } cef_task_t; - /// // Structure that asynchronously executes tasks on the associated thread. It is // safe to call the functions of this structure on any thread. @@ -85,27 +85,26 @@ typedef struct _cef_task_runner_t { // Returns true (1) if this object is pointing to the same task runner as // |that| object. /// - int (CEF_CALLBACK *is_same)(struct _cef_task_runner_t* self, - struct _cef_task_runner_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_task_runner_t* self, + struct _cef_task_runner_t* that); /// // Returns true (1) if this task runner belongs to the current thread. /// - int (CEF_CALLBACK *belongs_to_current_thread)( - struct _cef_task_runner_t* self); + int(CEF_CALLBACK* belongs_to_current_thread)(struct _cef_task_runner_t* self); /// // Returns true (1) if this task runner is for the specified CEF thread. /// - int (CEF_CALLBACK *belongs_to_thread)(struct _cef_task_runner_t* self, - cef_thread_id_t threadId); + int(CEF_CALLBACK* belongs_to_thread)(struct _cef_task_runner_t* self, + cef_thread_id_t threadId); /// // Post a task for execution on the thread associated with this task runner. // Execution will occur asynchronously. /// - int (CEF_CALLBACK *post_task)(struct _cef_task_runner_t* self, - struct _cef_task_t* task); + int(CEF_CALLBACK* post_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task); /// // Post a task for delayed execution on the thread associated with this task @@ -113,11 +112,11 @@ typedef struct _cef_task_runner_t { // supported on V8 WebWorker threads and will be executed without the // specified delay. /// - int (CEF_CALLBACK *post_delayed_task)(struct _cef_task_runner_t* self, - struct _cef_task_t* task, int64 delay_ms); + int(CEF_CALLBACK* post_delayed_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task, + int64 delay_ms); } cef_task_runner_t; - /// // Returns the task runner for the current thread. Only CEF threads will have // task runners. An NULL reference will be returned if this function is called @@ -131,7 +130,6 @@ CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread(); CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread( cef_thread_id_t threadId); - /// // Returns true (1) if called on the specified thread. Equivalent to using // cef_task_tRunner::GetForThread(threadId)->belongs_to_current_thread(). @@ -149,8 +147,9 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task); // using cef_task_tRunner::GetForThread(threadId)->PostDelayedTask(task, // delay_ms). /// -CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, cef_task_t* task, - int64 delay_ms); +CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, + cef_task_t* task, + int64 delay_ms); #ifdef __cplusplus } diff --git a/include/capi/cef_thread_capi.h b/include/capi/cef_thread_capi.h index 6a7662688..0932437be 100644 --- a/include/capi/cef_thread_capi.h +++ b/include/capi/cef_thread_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=d844086fc675680bfae12c3fa12a6886cc804816$ +// #ifndef CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // A simple thread abstraction that establishes a message loop on a new thread. // The consumer uses cef_task_tRunner to execute code on the thread's message @@ -67,14 +68,14 @@ typedef struct _cef_thread_t { // Returns the cef_task_tRunner that will execute code on this thread's // message loop. This function is safe to call from any thread. /// - struct _cef_task_runner_t* (CEF_CALLBACK *get_task_runner)( + struct _cef_task_runner_t*(CEF_CALLBACK* get_task_runner)( struct _cef_thread_t* self); /// // Returns the platform thread ID. It will return the same value after stop() // is called. This function is safe to call from any thread. /// - cef_platform_thread_id_t (CEF_CALLBACK *get_platform_thread_id)( + cef_platform_thread_id_t(CEF_CALLBACK* get_platform_thread_id)( struct _cef_thread_t* self); /// @@ -82,16 +83,15 @@ typedef struct _cef_thread_t { // that called cef_thread_create(). Do not call this function if // cef_thread_create() was called with a |stoppable| value of false (0). /// - void (CEF_CALLBACK *stop)(struct _cef_thread_t* self); + void(CEF_CALLBACK* stop)(struct _cef_thread_t* self); /// // Returns true (1) if the thread is currently running. This function must be // called from the same thread that called cef_thread_create(). /// - int (CEF_CALLBACK *is_running)(struct _cef_thread_t* self); + int(CEF_CALLBACK* is_running)(struct _cef_thread_t* self); } cef_thread_t; - /// // Create and start a new thread. This function does not block waiting for the // thread to run initialization. |display_name| is the name that will be used to @@ -103,10 +103,12 @@ typedef struct _cef_thread_t { // specifies how COM will be initialized for the thread. If |com_init_mode| is // set to COM_INIT_MODE_STA then |message_loop_type| must be set to ML_TYPE_UI. /// -CEF_EXPORT cef_thread_t* cef_thread_create(const cef_string_t* display_name, - cef_thread_priority_t priority, cef_message_loop_type_t message_loop_type, - int stoppable, cef_com_init_mode_t com_init_mode); - +CEF_EXPORT cef_thread_t* cef_thread_create( + const cef_string_t* display_name, + cef_thread_priority_t priority, + cef_message_loop_type_t message_loop_type, + int stoppable, + cef_com_init_mode_t com_init_mode); #ifdef __cplusplus } diff --git a/include/capi/cef_trace_capi.h b/include/capi/cef_trace_capi.h index c753eb40d..b3179d456 100644 --- a/include/capi/cef_trace_capi.h +++ b/include/capi/cef_trace_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=2684497985a960a8699e6c24aeb17370cf318e88$ +// #ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Implement this structure to receive notification when tracing has completed. // The functions of this structure will be called on the browser process UI @@ -62,12 +63,11 @@ typedef struct _cef_end_tracing_callback_t { // the path at which tracing data was written. The client is responsible for // deleting |tracing_file|. /// - void (CEF_CALLBACK *on_end_tracing_complete)( + void(CEF_CALLBACK* on_end_tracing_complete)( struct _cef_end_tracing_callback_t* self, const cef_string_t* tracing_file); } cef_end_tracing_callback_t; - /// // Start tracing events on all processes. Tracing is initialized asynchronously // and |callback| will be executed on the UI thread after initialization is @@ -86,7 +86,7 @@ typedef struct _cef_end_tracing_callback_t { // This function must be called on the browser process UI thread. /// CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories, - struct _cef_completion_callback_t* callback); + struct _cef_completion_callback_t* callback); /// // Stop tracing events on all processes. @@ -102,7 +102,7 @@ CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories, // This function must be called on the browser process UI thread. /// CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file, - cef_end_tracing_callback_t* callback); + cef_end_tracing_callback_t* callback); /// // Returns the current system trace time or, if none is defined, the current diff --git a/include/capi/cef_urlrequest_capi.h b/include/capi/cef_urlrequest_capi.h index 02a5063d0..28714d717 100644 --- a/include/capi/cef_urlrequest_capi.h +++ b/include/capi/cef_urlrequest_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=d0ac53d1df275f9ea9cf19a6a07f8dce88f2b151$ +// #ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ @@ -67,26 +69,26 @@ typedef struct _cef_urlrequest_t { // Returns the request object used to create this URL request. The returned // object is read-only and should not be modified. /// - struct _cef_request_t* (CEF_CALLBACK *get_request)( + struct _cef_request_t*(CEF_CALLBACK* get_request)( struct _cef_urlrequest_t* self); /// // Returns the client. /// - struct _cef_urlrequest_client_t* (CEF_CALLBACK *get_client)( + struct _cef_urlrequest_client_t*(CEF_CALLBACK* get_client)( struct _cef_urlrequest_t* self); /// // Returns the request status. /// - cef_urlrequest_status_t (CEF_CALLBACK *get_request_status)( + cef_urlrequest_status_t(CEF_CALLBACK* get_request_status)( struct _cef_urlrequest_t* self); /// // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 // otherwise. /// - cef_errorcode_t (CEF_CALLBACK *get_request_error)( + cef_errorcode_t(CEF_CALLBACK* get_request_error)( struct _cef_urlrequest_t* self); /// @@ -94,16 +96,15 @@ typedef struct _cef_urlrequest_t { // Response information will only be available after the upload has completed. // The returned object is read-only and should not be modified. /// - struct _cef_response_t* (CEF_CALLBACK *get_response)( + struct _cef_response_t*(CEF_CALLBACK* get_response)( struct _cef_urlrequest_t* self); /// // Cancel the request. /// - void (CEF_CALLBACK *cancel)(struct _cef_urlrequest_t* self); + void(CEF_CALLBACK* cancel)(struct _cef_urlrequest_t* self); } cef_urlrequest_t; - /// // Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request // functions are supported. Multiple post data elements are not supported and @@ -120,10 +121,10 @@ typedef struct _cef_urlrequest_t { // renderer process' browser will be used. /// CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create( - struct _cef_request_t* request, struct _cef_urlrequest_client_t* client, + struct _cef_request_t* request, + struct _cef_urlrequest_client_t* client, struct _cef_request_context_t* request_context); - /// // Structure that should be implemented by the cef_urlrequest_t client. The // functions of this structure will be called on the same thread that created @@ -140,9 +141,8 @@ typedef struct _cef_urlrequest_client_t { // cef_urlrequest_t::GetRequestStatus function to determine if the request was // successful or not. /// - void (CEF_CALLBACK *on_request_complete)( - struct _cef_urlrequest_client_t* self, - struct _cef_urlrequest_t* request); + void(CEF_CALLBACK* on_request_complete)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request); /// // Notifies the client of upload progress. |current| denotes the number of @@ -150,26 +150,31 @@ typedef struct _cef_urlrequest_client_t { // chunked upload is enabled). This function will only be called if the // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. /// - void (CEF_CALLBACK *on_upload_progress)(struct _cef_urlrequest_client_t* self, - struct _cef_urlrequest_t* request, int64 current, int64 total); + void(CEF_CALLBACK* on_upload_progress)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, + int64 current, + int64 total); /// // Notifies the client of download progress. |current| denotes the number of // bytes received up to the call and |total| is the expected total size of the // response (or -1 if not determined). /// - void (CEF_CALLBACK *on_download_progress)( - struct _cef_urlrequest_client_t* self, struct _cef_urlrequest_t* request, - int64 current, int64 total); + void(CEF_CALLBACK* on_download_progress)( + struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, + int64 current, + int64 total); /// // Called when some part of the response is read. |data| contains the current // bytes received since the last call. This function will not be called if the // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. /// - void (CEF_CALLBACK *on_download_data)(struct _cef_urlrequest_client_t* self, - struct _cef_urlrequest_t* request, const void* data, - size_t data_length); + void(CEF_CALLBACK* on_download_data)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, + const void* data, + size_t data_length); /// // Called on the IO thread when the browser needs credentials from the user. @@ -180,13 +185,16 @@ typedef struct _cef_urlrequest_client_t { // function will only be called for requests initiated from the browser // process. /// - int (CEF_CALLBACK *get_auth_credentials)( - struct _cef_urlrequest_client_t* self, int isProxy, - const cef_string_t* host, int port, const cef_string_t* realm, - const cef_string_t* scheme, struct _cef_auth_callback_t* callback); + int(CEF_CALLBACK* get_auth_credentials)( + struct _cef_urlrequest_client_t* self, + int isProxy, + const cef_string_t* host, + int port, + const cef_string_t* realm, + const cef_string_t* scheme, + struct _cef_auth_callback_t* callback); } cef_urlrequest_client_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_v8_capi.h b/include/capi/cef_v8_capi.h index a659b8da0..d62a204a4 100644 --- a/include/capi/cef_v8_capi.h +++ b/include/capi/cef_v8_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=aecaacd4f1b5294258f4e78883bcfec0a5c5677f$ +// #ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ @@ -70,7 +72,7 @@ typedef struct _cef_v8context_t { // be accessed from the thread on which they are created. This function can be // called on any render process thread. /// - struct _cef_task_runner_t* (CEF_CALLBACK *get_task_runner)( + struct _cef_task_runner_t*(CEF_CALLBACK* get_task_runner)( struct _cef_v8context_t* self); /// @@ -78,26 +80,26 @@ typedef struct _cef_v8context_t { // on the current thread. Do not call any other functions if this function // returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_v8context_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_v8context_t* self); /// // Returns the browser for this context. This function will return an NULL // reference for WebWorker contexts. /// - struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_browser_t*(CEF_CALLBACK* get_browser)( struct _cef_v8context_t* self); /// // Returns the frame for this context. This function will return an NULL // reference for WebWorker contexts. /// - struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self); + struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_v8context_t* self); /// // Returns the global object for this context. The context must be entered // before calling this function. /// - struct _cef_v8value_t* (CEF_CALLBACK *get_global)( + struct _cef_v8value_t*(CEF_CALLBACK* get_global)( struct _cef_v8context_t* self); /// @@ -107,20 +109,20 @@ typedef struct _cef_v8context_t { // objects belong to the context in which they are created. Returns true (1) // if the scope was entered successfully. /// - int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self); + int(CEF_CALLBACK* enter)(struct _cef_v8context_t* self); /// // Exit this context. Call this function only after calling enter(). Returns // true (1) if the scope was exited successfully. /// - int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self); + int(CEF_CALLBACK* exit)(struct _cef_v8context_t* self); /// // Returns true (1) if this object is pointing to the same handle as |that| // object. /// - int (CEF_CALLBACK *is_same)(struct _cef_v8context_t* self, - struct _cef_v8context_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_v8context_t* self, + struct _cef_v8context_t* that); /// // Execute a string of JavaScript code in this V8 context. The |script_url| @@ -130,12 +132,14 @@ typedef struct _cef_v8context_t { // function will return true (1). On failure |exception| will be set to the // exception, if any, and the function will return false (0). /// - int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self, - const cef_string_t* code, const cef_string_t* script_url, int start_line, - struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception); + int(CEF_CALLBACK* eval)(struct _cef_v8context_t* self, + const cef_string_t* code, + const cef_string_t* script_url, + int start_line, + struct _cef_v8value_t** retval, + struct _cef_v8exception_t** exception); } cef_v8context_t; - /// // Returns the current (top) context object in the V8 context stack. /// @@ -151,7 +155,6 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context(); /// CEF_EXPORT int cef_v8context_in_context(); - /// // Structure that should be implemented to handle V8 function calls. The // functions of this structure will be called on the thread associated with the @@ -170,13 +173,15 @@ typedef struct _cef_v8handler_t { // function return value. If execution fails set |exception| to the exception // that will be thrown. Return true (1) if execution was handled. /// - int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - size_t argumentsCount, struct _cef_v8value_t* const* arguments, - struct _cef_v8value_t** retval, cef_string_t* exception); + int(CEF_CALLBACK* execute)(struct _cef_v8handler_t* self, + const cef_string_t* name, + struct _cef_v8value_t* object, + size_t argumentsCount, + struct _cef_v8value_t* const* arguments, + struct _cef_v8value_t** retval, + cef_string_t* exception); } cef_v8handler_t; - /// // Structure that should be implemented to handle V8 accessor calls. Accessor // identifiers are registered by calling cef_v8value_t::set_value(). The @@ -196,9 +201,11 @@ typedef struct _cef_v8accessor_t { // exception that will be thrown. Return true (1) if accessor retrieval was // handled. /// - int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t** retval, cef_string_t* exception); + int(CEF_CALLBACK* get)(struct _cef_v8accessor_t* self, + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception); /// // Handle assignment of the accessor value identified by |name|. |object| is @@ -207,12 +214,13 @@ typedef struct _cef_v8accessor_t { // exception that will be thrown. Return true (1) if accessor assignment was // handled. /// - int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t* value, cef_string_t* exception); + int(CEF_CALLBACK* set)(struct _cef_v8accessor_t* self, + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception); } cef_v8accessor_t; - /// // Structure that should be implemented to handle V8 interceptor calls. The // functions of this structure will be called on the thread associated with the @@ -236,9 +244,11 @@ typedef struct _cef_v8interceptor_t { // accessor, it will be called only if you don't set |retval|. Return true (1) // if interceptor retrieval was handled, false (0) otherwise. /// - int (CEF_CALLBACK *get_byname)(struct _cef_v8interceptor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t** retval, cef_string_t* exception); + int(CEF_CALLBACK* get_byname)(struct _cef_v8interceptor_t* self, + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception); /// // Handle retrieval of the interceptor value identified by |index|. |object| @@ -248,9 +258,11 @@ typedef struct _cef_v8interceptor_t { // |exception| to the exception that will be thrown. Return true (1) if // interceptor retrieval was handled, false (0) otherwise. /// - int (CEF_CALLBACK *get_byindex)(struct _cef_v8interceptor_t* self, int index, - struct _cef_v8value_t* object, struct _cef_v8value_t** retval, - cef_string_t* exception); + int(CEF_CALLBACK* get_byindex)(struct _cef_v8interceptor_t* self, + int index, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception); /// // Handle assignment of the interceptor value identified by |name|. |object| @@ -260,9 +272,11 @@ typedef struct _cef_v8interceptor_t { // be called, even when the property has an associated accessor. Return true // (1) if interceptor assignment was handled, false (0) otherwise. /// - int (CEF_CALLBACK *set_byname)(struct _cef_v8interceptor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t* value, cef_string_t* exception); + int(CEF_CALLBACK* set_byname)(struct _cef_v8interceptor_t* self, + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception); /// // Handle assignment of the interceptor value identified by |index|. |object| @@ -271,12 +285,13 @@ typedef struct _cef_v8interceptor_t { // |exception| to the exception that will be thrown. Return true (1) if // interceptor assignment was handled, false (0) otherwise. /// - int (CEF_CALLBACK *set_byindex)(struct _cef_v8interceptor_t* self, int index, - struct _cef_v8value_t* object, struct _cef_v8value_t* value, - cef_string_t* exception); + int(CEF_CALLBACK* set_byindex)(struct _cef_v8interceptor_t* self, + int index, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception); } cef_v8interceptor_t; - /// // Structure representing a V8 exception. The functions of this structure may be // called on any render process thread. @@ -291,14 +306,14 @@ typedef struct _cef_v8exception_t { // Returns the exception message. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_message)( + cef_string_userfree_t(CEF_CALLBACK* get_message)( struct _cef_v8exception_t* self); /// // Returns the line of source code that the exception occurred within. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_source_line)( + cef_string_userfree_t(CEF_CALLBACK* get_source_line)( struct _cef_v8exception_t* self); /// @@ -306,41 +321,40 @@ typedef struct _cef_v8exception_t { // the error originates. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_script_resource_name)( + cef_string_userfree_t(CEF_CALLBACK* get_script_resource_name)( struct _cef_v8exception_t* self); /// // Returns the 1-based number of the line where the error occurred or 0 if the // line number is unknown. /// - int (CEF_CALLBACK *get_line_number)(struct _cef_v8exception_t* self); + int(CEF_CALLBACK* get_line_number)(struct _cef_v8exception_t* self); /// // Returns the index within the script of the first character where the error // occurred. /// - int (CEF_CALLBACK *get_start_position)(struct _cef_v8exception_t* self); + int(CEF_CALLBACK* get_start_position)(struct _cef_v8exception_t* self); /// // Returns the index within the script of the last character where the error // occurred. /// - int (CEF_CALLBACK *get_end_position)(struct _cef_v8exception_t* self); + int(CEF_CALLBACK* get_end_position)(struct _cef_v8exception_t* self); /// // Returns the index within the line of the first character where the error // occurred. /// - int (CEF_CALLBACK *get_start_column)(struct _cef_v8exception_t* self); + int(CEF_CALLBACK* get_start_column)(struct _cef_v8exception_t* self); /// // Returns the index within the line of the last character where the error // occurred. /// - int (CEF_CALLBACK *get_end_column)(struct _cef_v8exception_t* self); + int(CEF_CALLBACK* get_end_column)(struct _cef_v8exception_t* self); } cef_v8exception_t; - /// // Structure representing a V8 value handle. V8 handles can only be accessed // from the thread on which they are created. Valid threads for creating a V8 @@ -359,103 +373,102 @@ typedef struct _cef_v8value_t { // on the current thread. Do not call any other functions if this function // returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_v8value_t* self); /// // True if the value type is undefined. /// - int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_undefined)(struct _cef_v8value_t* self); /// // True if the value type is null. /// - int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_null)(struct _cef_v8value_t* self); /// // True if the value type is bool. /// - int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_bool)(struct _cef_v8value_t* self); /// // True if the value type is int. /// - int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_int)(struct _cef_v8value_t* self); /// // True if the value type is unsigned int. /// - int (CEF_CALLBACK *is_uint)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_uint)(struct _cef_v8value_t* self); /// // True if the value type is double. /// - int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_double)(struct _cef_v8value_t* self); /// // True if the value type is Date. /// - int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_date)(struct _cef_v8value_t* self); /// // True if the value type is string. /// - int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_string)(struct _cef_v8value_t* self); /// // True if the value type is object. /// - int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_object)(struct _cef_v8value_t* self); /// // True if the value type is array. /// - int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_array)(struct _cef_v8value_t* self); /// // True if the value type is function. /// - int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_function)(struct _cef_v8value_t* self); /// // Returns true (1) if this object is pointing to the same handle as |that| // object. /// - int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self, - struct _cef_v8value_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_v8value_t* self, + struct _cef_v8value_t* that); /// // Return a bool value. /// - int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* get_bool_value)(struct _cef_v8value_t* self); /// // Return an int value. /// - int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self); + int32(CEF_CALLBACK* get_int_value)(struct _cef_v8value_t* self); /// // Return an unsigned int value. /// - uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self); + uint32(CEF_CALLBACK* get_uint_value)(struct _cef_v8value_t* self); /// // Return a double value. /// - double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self); + double(CEF_CALLBACK* get_double_value)(struct _cef_v8value_t* self); /// // Return a Date value. /// - cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self); + cef_time_t(CEF_CALLBACK* get_date_value)(struct _cef_v8value_t* self); /// // Return a string value. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_string_value)( + cef_string_userfree_t(CEF_CALLBACK* get_string_value)( struct _cef_v8value_t* self); - // OBJECT METHODS - These functions are only available on objects. Arrays and // functions are also objects. String- and integer-based keys can be used // interchangably with the framework converting between them as necessary. @@ -463,31 +476,31 @@ typedef struct _cef_v8value_t { /// // Returns true (1) if this is a user created object. /// - int (CEF_CALLBACK *is_user_created)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* is_user_created)(struct _cef_v8value_t* self); /// // Returns true (1) if the last function call resulted in an exception. This // attribute exists only in the scope of the current CEF value object. /// - int (CEF_CALLBACK *has_exception)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* has_exception)(struct _cef_v8value_t* self); /// // Returns the exception resulting from the last function call. This attribute // exists only in the scope of the current CEF value object. /// - struct _cef_v8exception_t* (CEF_CALLBACK *get_exception)( + struct _cef_v8exception_t*(CEF_CALLBACK* get_exception)( struct _cef_v8value_t* self); /// // Clears the last exception and returns true (1) on success. /// - int (CEF_CALLBACK *clear_exception)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* clear_exception)(struct _cef_v8value_t* self); /// // Returns true (1) if this object will re-throw future exceptions. This // attribute exists only in the scope of the current CEF value object. /// - int (CEF_CALLBACK *will_rethrow_exceptions)(struct _cef_v8value_t* self); + int(CEF_CALLBACK* will_rethrow_exceptions)(struct _cef_v8value_t* self); /// // Set whether this object will re-throw future exceptions. By default @@ -496,19 +509,19 @@ typedef struct _cef_v8value_t { // caught and not re-thrown. Returns true (1) on success. This attribute // exists only in the scope of the current CEF value object. /// - int (CEF_CALLBACK *set_rethrow_exceptions)(struct _cef_v8value_t* self, - int rethrow); + int(CEF_CALLBACK* set_rethrow_exceptions)(struct _cef_v8value_t* self, + int rethrow); /// // Returns true (1) if the object has a value with the specified identifier. /// - int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* has_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); /// // Returns true (1) if the object has a value with the specified identifier. /// - int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index); + int(CEF_CALLBACK* has_value_byindex)(struct _cef_v8value_t* self, int index); /// // Deletes the value with the specified identifier and returns true (1) on @@ -516,8 +529,8 @@ typedef struct _cef_v8value_t { // exception is thrown. For read-only and don't-delete values this function // will return true (1) even though deletion failed. /// - int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* delete_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); /// // Deletes the value with the specified identifier and returns true (1) on @@ -525,22 +538,23 @@ typedef struct _cef_v8value_t { // fails or an exception is thrown. For read-only and don't-delete values this // function will return true (1) even though deletion failed. /// - int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, - int index); + int(CEF_CALLBACK* delete_value_byindex)(struct _cef_v8value_t* self, + int index); /// // Returns the value with the specified identifier on success. Returns NULL if // this function is called incorrectly or an exception is thrown. /// - struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)( - struct _cef_v8value_t* self, const cef_string_t* key); + struct _cef_v8value_t*(CEF_CALLBACK* get_value_bykey)( + struct _cef_v8value_t* self, + const cef_string_t* key); /// // Returns the value with the specified identifier on success. Returns NULL if // this function is called incorrectly or an exception is thrown. /// - struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( - struct _cef_v8value_t* self, int index); + struct _cef_v8value_t*( + CEF_CALLBACK* get_value_byindex)(struct _cef_v8value_t* self, int index); /// // Associates a value with the specified identifier and returns true (1) on @@ -548,9 +562,10 @@ typedef struct _cef_v8value_t { // exception is thrown. For read-only values this function will return true // (1) even though assignment failed. /// - int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self, - const cef_string_t* key, struct _cef_v8value_t* value, - cef_v8_propertyattribute_t attribute); + int(CEF_CALLBACK* set_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key, + struct _cef_v8value_t* value, + cef_v8_propertyattribute_t attribute); /// // Associates a value with the specified identifier and returns true (1) on @@ -558,8 +573,9 @@ typedef struct _cef_v8value_t { // exception is thrown. For read-only values this function will return true // (1) even though assignment failed. /// - int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, - struct _cef_v8value_t* value); + int(CEF_CALLBACK* set_value_byindex)(struct _cef_v8value_t* self, + int index, + struct _cef_v8value_t* value); /// // Registers an identifier and returns true (1) on success. Access to the @@ -568,36 +584,37 @@ typedef struct _cef_v8value_t { // function is called incorrectly or an exception is thrown. For read-only // values this function will return true (1) even though assignment failed. /// - int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self, - const cef_string_t* key, cef_v8_accesscontrol_t settings, - cef_v8_propertyattribute_t attribute); + int(CEF_CALLBACK* set_value_byaccessor)(struct _cef_v8value_t* self, + const cef_string_t* key, + cef_v8_accesscontrol_t settings, + cef_v8_propertyattribute_t attribute); /// // Read the keys for the object's values into the specified vector. Integer- // based keys will also be returned as strings. /// - int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self, - cef_string_list_t keys); + int(CEF_CALLBACK* get_keys)(struct _cef_v8value_t* self, + cef_string_list_t keys); /// // Sets the user data for this object and returns true (1) on success. Returns // false (0) if this function is called incorrectly. This function can only be // called on user created objects. /// - int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self, - struct _cef_base_ref_counted_t* user_data); + int(CEF_CALLBACK* set_user_data)(struct _cef_v8value_t* self, + struct _cef_base_ref_counted_t* user_data); /// // Returns the user data, if any, assigned to this object. /// - struct _cef_base_ref_counted_t* (CEF_CALLBACK *get_user_data)( + struct _cef_base_ref_counted_t*(CEF_CALLBACK* get_user_data)( struct _cef_v8value_t* self); /// // Returns the amount of externally allocated memory registered for the // object. /// - int (CEF_CALLBACK *get_externally_allocated_memory)( + int(CEF_CALLBACK* get_externally_allocated_memory)( struct _cef_v8value_t* self); /// @@ -611,17 +628,16 @@ typedef struct _cef_v8value_t { // returns the number of bytes associated with the object after the // adjustment. This function can only be called on user created objects. /// - int (CEF_CALLBACK *adjust_externally_allocated_memory)( - struct _cef_v8value_t* self, int change_in_bytes); - + int(CEF_CALLBACK* adjust_externally_allocated_memory)( + struct _cef_v8value_t* self, + int change_in_bytes); // ARRAY METHODS - These functions are only available on arrays. /// // Returns the number of elements in the array. /// - int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self); - + int(CEF_CALLBACK* get_array_length)(struct _cef_v8value_t* self); // FUNCTION METHODS - These functions are only available on functions. @@ -629,13 +645,13 @@ typedef struct _cef_v8value_t { // Returns the function name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + cef_string_userfree_t(CEF_CALLBACK* get_function_name)( struct _cef_v8value_t* self); /// // Returns the function handler or NULL if not a CEF-created function. /// - struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)( + struct _cef_v8handler_t*(CEF_CALLBACK* get_function_handler)( struct _cef_v8value_t* self); /// @@ -649,9 +665,11 @@ typedef struct _cef_v8value_t { // Returns NULL if this function is called incorrectly or an exception is // thrown. /// - struct _cef_v8value_t* (CEF_CALLBACK *execute_function)( - struct _cef_v8value_t* self, struct _cef_v8value_t* object, - size_t argumentsCount, struct _cef_v8value_t* const* arguments); + struct _cef_v8value_t*(CEF_CALLBACK* execute_function)( + struct _cef_v8value_t* self, + struct _cef_v8value_t* object, + size_t argumentsCount, + struct _cef_v8value_t* const* arguments); /// // Execute the function using the specified V8 context. |object| is the @@ -661,13 +679,14 @@ typedef struct _cef_v8value_t { // success. Returns NULL if this function is called incorrectly or an // exception is thrown. /// - struct _cef_v8value_t* (CEF_CALLBACK *execute_function_with_context)( - struct _cef_v8value_t* self, struct _cef_v8context_t* context, - struct _cef_v8value_t* object, size_t argumentsCount, + struct _cef_v8value_t*(CEF_CALLBACK* execute_function_with_context)( + struct _cef_v8value_t* self, + struct _cef_v8context_t* context, + struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments); } cef_v8value_t; - /// // Create a new cef_v8value_t object of type undefined. /// @@ -718,7 +737,8 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value); // callback, or in combination with calling enter() and exit() on a stored // cef_v8context_t reference. /// -CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor, +CEF_EXPORT cef_v8value_t* cef_v8value_create_object( + cef_v8accessor_t* accessor, cef_v8interceptor_t* interceptor); /// @@ -738,8 +758,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length); // enter() and exit() on a stored cef_v8context_t reference. /// CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, - cef_v8handler_t* handler); - + cef_v8handler_t* handler); /// // Structure representing a V8 stack trace handle. V8 handles can only be @@ -759,28 +778,26 @@ typedef struct _cef_v8stack_trace_t { // on the current thread. Do not call any other functions if this function // returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_trace_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_v8stack_trace_t* self); /// // Returns the number of stack frames. /// - int (CEF_CALLBACK *get_frame_count)(struct _cef_v8stack_trace_t* self); + int(CEF_CALLBACK* get_frame_count)(struct _cef_v8stack_trace_t* self); /// // Returns the stack frame at the specified 0-based index. /// - struct _cef_v8stack_frame_t* (CEF_CALLBACK *get_frame)( - struct _cef_v8stack_trace_t* self, int index); + struct _cef_v8stack_frame_t*( + CEF_CALLBACK* get_frame)(struct _cef_v8stack_trace_t* self, int index); } cef_v8stack_trace_t; - /// // Returns the stack trace for the currently active context. |frame_limit| is // the maximum number of frames that will be captured. /// CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit); - /// // Structure representing a V8 stack frame handle. V8 handles can only be // accessed from the thread on which they are created. Valid threads for @@ -799,13 +816,13 @@ typedef struct _cef_v8stack_frame_t { // on the current thread. Do not call any other functions if this function // returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_frame_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_v8stack_frame_t* self); /// // Returns the name of the resource script that contains the function. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_script_name)( + cef_string_userfree_t(CEF_CALLBACK* get_script_name)( struct _cef_v8stack_frame_t* self); /// @@ -814,39 +831,38 @@ typedef struct _cef_v8stack_frame_t { // "//@ sourceURL=..." string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_script_name_or_source_url)( + cef_string_userfree_t(CEF_CALLBACK* get_script_name_or_source_url)( struct _cef_v8stack_frame_t* self); /// // Returns the name of the function. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + cef_string_userfree_t(CEF_CALLBACK* get_function_name)( struct _cef_v8stack_frame_t* self); /// // Returns the 1-based line number for the function call or 0 if unknown. /// - int (CEF_CALLBACK *get_line_number)(struct _cef_v8stack_frame_t* self); + int(CEF_CALLBACK* get_line_number)(struct _cef_v8stack_frame_t* self); /// // Returns the 1-based column offset on the line for the function call or 0 if // unknown. /// - int (CEF_CALLBACK *get_column)(struct _cef_v8stack_frame_t* self); + int(CEF_CALLBACK* get_column)(struct _cef_v8stack_frame_t* self); /// // Returns true (1) if the function was compiled using eval(). /// - int (CEF_CALLBACK *is_eval)(struct _cef_v8stack_frame_t* self); + int(CEF_CALLBACK* is_eval)(struct _cef_v8stack_frame_t* self); /// // Returns true (1) if the function was called as a constructor via "new". /// - int (CEF_CALLBACK *is_constructor)(struct _cef_v8stack_frame_t* self); + int(CEF_CALLBACK* is_constructor)(struct _cef_v8stack_frame_t* self); } cef_v8stack_frame_t; - /// // Register a new V8 extension with the specified JavaScript extension code and // handler. Functions implemented by the handler are prototyped using the @@ -904,7 +920,8 @@ typedef struct _cef_v8stack_frame_t { // /// CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, cef_v8handler_t* handler); + const cef_string_t* javascript_code, + cef_v8handler_t* handler); #ifdef __cplusplus } diff --git a/include/capi/cef_values_capi.h b/include/capi/cef_values_capi.h index cd3c7b44b..8a22d09bb 100644 --- a/include/capi/cef_values_capi.h +++ b/include/capi/cef_values_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=4119ecd62e8c308a5876e6a7ac92cf3ff7df6425$ +// #ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ @@ -67,64 +69,64 @@ typedef struct _cef_value_t { // object can be re-used by calling Set*() even if the underlying data is // invalid. /// - int (CEF_CALLBACK *is_valid)(struct _cef_value_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_value_t* self); /// // Returns true (1) if the underlying data is owned by another object. /// - int (CEF_CALLBACK *is_owned)(struct _cef_value_t* self); + int(CEF_CALLBACK* is_owned)(struct _cef_value_t* self); /// // Returns true (1) if the underlying data is read-only. Some APIs may expose // read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_value_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_value_t* self); /// // Returns true (1) if this object and |that| object have the same underlying // data. If true (1) modifications to this object will also affect |that| // object and vice-versa. /// - int (CEF_CALLBACK *is_same)(struct _cef_value_t* self, - struct _cef_value_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_value_t* self, + struct _cef_value_t* that); /// // Returns true (1) if this object and |that| object have an equivalent // underlying value but are not necessarily the same object. /// - int (CEF_CALLBACK *is_equal)(struct _cef_value_t* self, - struct _cef_value_t* that); + int(CEF_CALLBACK* is_equal)(struct _cef_value_t* self, + struct _cef_value_t* that); /// // Returns a copy of this object. The underlying data will also be copied. /// - struct _cef_value_t* (CEF_CALLBACK *copy)(struct _cef_value_t* self); + struct _cef_value_t*(CEF_CALLBACK* copy)(struct _cef_value_t* self); /// // Returns the underlying value type. /// - cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_value_t* self); + cef_value_type_t(CEF_CALLBACK* get_type)(struct _cef_value_t* self); /// // Returns the underlying value as type bool. /// - int (CEF_CALLBACK *get_bool)(struct _cef_value_t* self); + int(CEF_CALLBACK* get_bool)(struct _cef_value_t* self); /// // Returns the underlying value as type int. /// - int (CEF_CALLBACK *get_int)(struct _cef_value_t* self); + int(CEF_CALLBACK* get_int)(struct _cef_value_t* self); /// // Returns the underlying value as type double. /// - double (CEF_CALLBACK *get_double)(struct _cef_value_t* self); + double(CEF_CALLBACK* get_double)(struct _cef_value_t* self); /// // Returns the underlying value as type string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_string)(struct _cef_value_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_string)(struct _cef_value_t* self); /// // Returns the underlying value as type binary. The returned reference may @@ -134,7 +136,7 @@ typedef struct _cef_value_t { // the set_value() function instead of passing the returned reference to // set_binary(). /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_binary_value_t*(CEF_CALLBACK* get_binary)( struct _cef_value_t* self); /// @@ -145,7 +147,7 @@ typedef struct _cef_value_t { // the set_value() function instead of passing the returned reference to // set_dictionary(). /// - struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_dictionary_value_t*(CEF_CALLBACK* get_dictionary)( struct _cef_value_t* self); /// @@ -156,71 +158,69 @@ typedef struct _cef_value_t { // the set_value() function instead of passing the returned reference to // set_list(). /// - struct _cef_list_value_t* (CEF_CALLBACK *get_list)(struct _cef_value_t* self); + struct _cef_list_value_t*(CEF_CALLBACK* get_list)(struct _cef_value_t* self); /// // Sets the underlying value as type null. Returns true (1) if the value was // set successfully. /// - int (CEF_CALLBACK *set_null)(struct _cef_value_t* self); + int(CEF_CALLBACK* set_null)(struct _cef_value_t* self); /// // Sets the underlying value as type bool. Returns true (1) if the value was // set successfully. /// - int (CEF_CALLBACK *set_bool)(struct _cef_value_t* self, int value); + int(CEF_CALLBACK* set_bool)(struct _cef_value_t* self, int value); /// // Sets the underlying value as type int. Returns true (1) if the value was // set successfully. /// - int (CEF_CALLBACK *set_int)(struct _cef_value_t* self, int value); + int(CEF_CALLBACK* set_int)(struct _cef_value_t* self, int value); /// // Sets the underlying value as type double. Returns true (1) if the value was // set successfully. /// - int (CEF_CALLBACK *set_double)(struct _cef_value_t* self, double value); + int(CEF_CALLBACK* set_double)(struct _cef_value_t* self, double value); /// // Sets the underlying value as type string. Returns true (1) if the value was // set successfully. /// - int (CEF_CALLBACK *set_string)(struct _cef_value_t* self, - const cef_string_t* value); + int(CEF_CALLBACK* set_string)(struct _cef_value_t* self, + const cef_string_t* value); /// // Sets the underlying value as type binary. Returns true (1) if the value was // set successfully. This object keeps a reference to |value| and ownership of // the underlying data remains unchanged. /// - int (CEF_CALLBACK *set_binary)(struct _cef_value_t* self, - struct _cef_binary_value_t* value); + int(CEF_CALLBACK* set_binary)(struct _cef_value_t* self, + struct _cef_binary_value_t* value); /// // Sets the underlying value as type dict. Returns true (1) if the value was // set successfully. This object keeps a reference to |value| and ownership of // the underlying data remains unchanged. /// - int (CEF_CALLBACK *set_dictionary)(struct _cef_value_t* self, - struct _cef_dictionary_value_t* value); + int(CEF_CALLBACK* set_dictionary)(struct _cef_value_t* self, + struct _cef_dictionary_value_t* value); /// // Sets the underlying value as type list. Returns true (1) if the value was // set successfully. This object keeps a reference to |value| and ownership of // the underlying data remains unchanged. /// - int (CEF_CALLBACK *set_list)(struct _cef_value_t* self, - struct _cef_list_value_t* value); + int(CEF_CALLBACK* set_list)(struct _cef_value_t* self, + struct _cef_list_value_t* value); } cef_value_t; - /// // Creates a new object. /// CEF_EXPORT cef_value_t* cef_value_create(); - /// // Structure representing a binary value. Can be used on any process and thread. /// @@ -236,54 +236,54 @@ typedef struct _cef_binary_value_t { // and that other object is then modified or destroyed. Do not call any other // functions if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_binary_value_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_binary_value_t* self); /// // Returns true (1) if this object is currently owned by another object. /// - int (CEF_CALLBACK *is_owned)(struct _cef_binary_value_t* self); + int(CEF_CALLBACK* is_owned)(struct _cef_binary_value_t* self); /// // Returns true (1) if this object and |that| object have the same underlying // data. /// - int (CEF_CALLBACK *is_same)(struct _cef_binary_value_t* self, - struct _cef_binary_value_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_binary_value_t* self, + struct _cef_binary_value_t* that); /// // Returns true (1) if this object and |that| object have an equivalent // underlying value but are not necessarily the same object. /// - int (CEF_CALLBACK *is_equal)(struct _cef_binary_value_t* self, - struct _cef_binary_value_t* that); + int(CEF_CALLBACK* is_equal)(struct _cef_binary_value_t* self, + struct _cef_binary_value_t* that); /// // Returns a copy of this object. The data in this object will also be copied. /// - struct _cef_binary_value_t* (CEF_CALLBACK *copy)( + struct _cef_binary_value_t*(CEF_CALLBACK* copy)( struct _cef_binary_value_t* self); /// // Returns the data size. /// - size_t (CEF_CALLBACK *get_size)(struct _cef_binary_value_t* self); + size_t(CEF_CALLBACK* get_size)(struct _cef_binary_value_t* self); /// // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at // the specified byte |data_offset|. Returns the number of bytes read. /// - size_t (CEF_CALLBACK *get_data)(struct _cef_binary_value_t* self, - void* buffer, size_t buffer_size, size_t data_offset); + size_t(CEF_CALLBACK* get_data)(struct _cef_binary_value_t* self, + void* buffer, + size_t buffer_size, + size_t data_offset); } cef_binary_value_t; - /// // Creates a new object that is not owned by any other object. The specified // |data| will be copied. /// CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, - size_t data_size); - + size_t data_size); /// // Structure representing a dictionary value. Can be used on any process and @@ -301,75 +301,76 @@ typedef struct _cef_dictionary_value_t { // and that other object is then modified or destroyed. Do not call any other // functions if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_dictionary_value_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_dictionary_value_t* self); /// // Returns true (1) if this object is currently owned by another object. /// - int (CEF_CALLBACK *is_owned)(struct _cef_dictionary_value_t* self); + int(CEF_CALLBACK* is_owned)(struct _cef_dictionary_value_t* self); /// // Returns true (1) if the values of this object are read-only. Some APIs may // expose read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_dictionary_value_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_dictionary_value_t* self); /// // Returns true (1) if this object and |that| object have the same underlying // data. If true (1) modifications to this object will also affect |that| // object and vice-versa. /// - int (CEF_CALLBACK *is_same)(struct _cef_dictionary_value_t* self, - struct _cef_dictionary_value_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that); /// // Returns true (1) if this object and |that| object have an equivalent // underlying value but are not necessarily the same object. /// - int (CEF_CALLBACK *is_equal)(struct _cef_dictionary_value_t* self, - struct _cef_dictionary_value_t* that); + int(CEF_CALLBACK* is_equal)(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that); /// // Returns a writable copy of this object. If |exclude_NULL_children| is true // (1) any NULL dictionaries or lists will be excluded from the copy. /// - struct _cef_dictionary_value_t* (CEF_CALLBACK *copy)( - struct _cef_dictionary_value_t* self, int exclude_empty_children); + struct _cef_dictionary_value_t*(CEF_CALLBACK* copy)( + struct _cef_dictionary_value_t* self, + int exclude_empty_children); /// // Returns the number of values. /// - size_t (CEF_CALLBACK *get_size)(struct _cef_dictionary_value_t* self); + size_t(CEF_CALLBACK* get_size)(struct _cef_dictionary_value_t* self); /// // Removes all values. Returns true (1) on success. /// - int (CEF_CALLBACK *clear)(struct _cef_dictionary_value_t* self); + int(CEF_CALLBACK* clear)(struct _cef_dictionary_value_t* self); /// // Returns true (1) if the current dictionary has a value for the given key. /// - int (CEF_CALLBACK *has_key)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* has_key)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Reads all keys for this dictionary into the specified vector. /// - int (CEF_CALLBACK *get_keys)(struct _cef_dictionary_value_t* self, - cef_string_list_t keys); + int(CEF_CALLBACK* get_keys)(struct _cef_dictionary_value_t* self, + cef_string_list_t keys); /// // Removes the value at the specified key. Returns true (1) is the value was // removed successfully. /// - int (CEF_CALLBACK *remove)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* remove)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value type for the specified key. /// - cef_value_type_t (CEF_CALLBACK *get_type)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + cef_value_type_t(CEF_CALLBACK* get_type)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key. For simple types the returned value @@ -378,56 +379,61 @@ typedef struct _cef_dictionary_value_t { // will reference existing data and modifications to the value will modify // this object. /// - struct _cef_value_t* (CEF_CALLBACK *get_value)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + struct _cef_value_t*(CEF_CALLBACK* get_value)( + struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type bool. /// - int (CEF_CALLBACK *get_bool)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* get_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type int. /// - int (CEF_CALLBACK *get_int)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* get_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type double. /// - double (CEF_CALLBACK *get_double)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + double(CEF_CALLBACK* get_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_string)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + cef_string_userfree_t(CEF_CALLBACK* get_string)( + struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type binary. The returned value // will reference existing data. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + struct _cef_binary_value_t*(CEF_CALLBACK* get_binary)( + struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type dictionary. The returned // value will reference existing data and modifications to the value will // modify this object. /// - struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + struct _cef_dictionary_value_t*(CEF_CALLBACK* get_dictionary)( + struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Returns the value at the specified key as type list. The returned value // will reference existing data and modifications to the value will modify // this object. /// - struct _cef_list_value_t* (CEF_CALLBACK *get_list)( - struct _cef_dictionary_value_t* self, const cef_string_t* key); + struct _cef_list_value_t*(CEF_CALLBACK* get_list)( + struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Sets the value at the specified key. Returns true (1) if the value was set @@ -437,43 +443,48 @@ typedef struct _cef_dictionary_value_t { // underlying data will be referenced and modifications to |value| will modify // this object. /// - int (CEF_CALLBACK *set_value)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, struct _cef_value_t* value); + int(CEF_CALLBACK* set_value)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + struct _cef_value_t* value); /// // Sets the value at the specified key as type null. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_null)(struct _cef_dictionary_value_t* self, - const cef_string_t* key); + int(CEF_CALLBACK* set_null)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); /// // Sets the value at the specified key as type bool. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_bool)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, int value); + int(CEF_CALLBACK* set_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + int value); /// // Sets the value at the specified key as type int. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_int)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, int value); + int(CEF_CALLBACK* set_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + int value); /// // Sets the value at the specified key as type double. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_double)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, double value); + int(CEF_CALLBACK* set_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + double value); /// // Sets the value at the specified key as type string. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_string)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, const cef_string_t* value); + int(CEF_CALLBACK* set_string)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + const cef_string_t* value); /// // Sets the value at the specified key as type binary. Returns true (1) if the @@ -482,8 +493,9 @@ typedef struct _cef_dictionary_value_t { // Otherwise, ownership will be transferred to this object and the |value| // reference will be invalidated. /// - int (CEF_CALLBACK *set_binary)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, struct _cef_binary_value_t* value); + int(CEF_CALLBACK* set_binary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + struct _cef_binary_value_t* value); /// // Sets the value at the specified key as type dict. Returns true (1) if the @@ -492,8 +504,9 @@ typedef struct _cef_dictionary_value_t { // Otherwise, ownership will be transferred to this object and the |value| // reference will be invalidated. /// - int (CEF_CALLBACK *set_dictionary)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, struct _cef_dictionary_value_t* value); + int(CEF_CALLBACK* set_dictionary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + struct _cef_dictionary_value_t* value); /// // Sets the value at the specified key as type list. Returns true (1) if the @@ -502,17 +515,16 @@ typedef struct _cef_dictionary_value_t { // Otherwise, ownership will be transferred to this object and the |value| // reference will be invalidated. /// - int (CEF_CALLBACK *set_list)(struct _cef_dictionary_value_t* self, - const cef_string_t* key, struct _cef_list_value_t* value); + int(CEF_CALLBACK* set_list)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + struct _cef_list_value_t* value); } cef_dictionary_value_t; - /// // Creates a new object that is not owned by any other object. /// CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(); - /// // Structure representing a list value. Can be used on any process and thread. /// @@ -528,66 +540,65 @@ typedef struct _cef_list_value_t { // and that other object is then modified or destroyed. Do not call any other // functions if this function returns false (0). /// - int (CEF_CALLBACK *is_valid)(struct _cef_list_value_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_list_value_t* self); /// // Returns true (1) if this object is currently owned by another object. /// - int (CEF_CALLBACK *is_owned)(struct _cef_list_value_t* self); + int(CEF_CALLBACK* is_owned)(struct _cef_list_value_t* self); /// // Returns true (1) if the values of this object are read-only. Some APIs may // expose read-only objects. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_list_value_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_list_value_t* self); /// // Returns true (1) if this object and |that| object have the same underlying // data. If true (1) modifications to this object will also affect |that| // object and vice-versa. /// - int (CEF_CALLBACK *is_same)(struct _cef_list_value_t* self, - struct _cef_list_value_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_list_value_t* self, + struct _cef_list_value_t* that); /// // Returns true (1) if this object and |that| object have an equivalent // underlying value but are not necessarily the same object. /// - int (CEF_CALLBACK *is_equal)(struct _cef_list_value_t* self, - struct _cef_list_value_t* that); + int(CEF_CALLBACK* is_equal)(struct _cef_list_value_t* self, + struct _cef_list_value_t* that); /// // Returns a writable copy of this object. /// - struct _cef_list_value_t* (CEF_CALLBACK *copy)( - struct _cef_list_value_t* self); + struct _cef_list_value_t*(CEF_CALLBACK* copy)(struct _cef_list_value_t* self); /// // Sets the number of values. If the number of values is expanded all new // value slots will default to type null. Returns true (1) on success. /// - int (CEF_CALLBACK *set_size)(struct _cef_list_value_t* self, size_t size); + int(CEF_CALLBACK* set_size)(struct _cef_list_value_t* self, size_t size); /// // Returns the number of values. /// - size_t (CEF_CALLBACK *get_size)(struct _cef_list_value_t* self); + size_t(CEF_CALLBACK* get_size)(struct _cef_list_value_t* self); /// // Removes all values. Returns true (1) on success. /// - int (CEF_CALLBACK *clear)(struct _cef_list_value_t* self); + int(CEF_CALLBACK* clear)(struct _cef_list_value_t* self); /// // Removes the value at the specified index. /// - int (CEF_CALLBACK *remove)(struct _cef_list_value_t* self, size_t index); + int(CEF_CALLBACK* remove)(struct _cef_list_value_t* self, size_t index); /// // Returns the value type at the specified index. /// - cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self, - size_t index); + cef_value_type_t(CEF_CALLBACK* get_type)(struct _cef_list_value_t* self, + size_t index); /// // Returns the value at the specified index. For simple types the returned @@ -596,54 +607,55 @@ typedef struct _cef_list_value_t { // returned value will reference existing data and modifications to the value // will modify this object. /// - struct _cef_value_t* (CEF_CALLBACK *get_value)(struct _cef_list_value_t* self, - size_t index); + struct _cef_value_t*(CEF_CALLBACK* get_value)(struct _cef_list_value_t* self, + size_t index); /// // Returns the value at the specified index as type bool. /// - int (CEF_CALLBACK *get_bool)(struct _cef_list_value_t* self, size_t index); + int(CEF_CALLBACK* get_bool)(struct _cef_list_value_t* self, size_t index); /// // Returns the value at the specified index as type int. /// - int (CEF_CALLBACK *get_int)(struct _cef_list_value_t* self, size_t index); + int(CEF_CALLBACK* get_int)(struct _cef_list_value_t* self, size_t index); /// // Returns the value at the specified index as type double. /// - double (CEF_CALLBACK *get_double)(struct _cef_list_value_t* self, - size_t index); + double(CEF_CALLBACK* get_double)(struct _cef_list_value_t* self, + size_t index); /// // Returns the value at the specified index as type string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_string)( - struct _cef_list_value_t* self, size_t index); + cef_string_userfree_t( + CEF_CALLBACK* get_string)(struct _cef_list_value_t* self, size_t index); /// // Returns the value at the specified index as type binary. The returned value // will reference existing data. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( - struct _cef_list_value_t* self, size_t index); + struct _cef_binary_value_t*( + CEF_CALLBACK* get_binary)(struct _cef_list_value_t* self, size_t index); /// // Returns the value at the specified index as type dictionary. The returned // value will reference existing data and modifications to the value will // modify this object. /// - struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( - struct _cef_list_value_t* self, size_t index); + struct _cef_dictionary_value_t*(CEF_CALLBACK* get_dictionary)( + struct _cef_list_value_t* self, + size_t index); /// // Returns the value at the specified index as type list. The returned value // will reference existing data and modifications to the value will modify // this object. /// - struct _cef_list_value_t* (CEF_CALLBACK *get_list)( - struct _cef_list_value_t* self, size_t index); + struct _cef_list_value_t*( + CEF_CALLBACK* get_list)(struct _cef_list_value_t* self, size_t index); /// // Sets the value at the specified index. Returns true (1) if the value was @@ -653,42 +665,47 @@ typedef struct _cef_list_value_t { // then the underlying data will be referenced and modifications to |value| // will modify this object. /// - int (CEF_CALLBACK *set_value)(struct _cef_list_value_t* self, size_t index, - struct _cef_value_t* value); + int(CEF_CALLBACK* set_value)(struct _cef_list_value_t* self, + size_t index, + struct _cef_value_t* value); /// // Sets the value at the specified index as type null. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_null)(struct _cef_list_value_t* self, size_t index); + int(CEF_CALLBACK* set_null)(struct _cef_list_value_t* self, size_t index); /// // Sets the value at the specified index as type bool. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_bool)(struct _cef_list_value_t* self, size_t index, - int value); + int(CEF_CALLBACK* set_bool)(struct _cef_list_value_t* self, + size_t index, + int value); /// // Sets the value at the specified index as type int. Returns true (1) if the // value was set successfully. /// - int (CEF_CALLBACK *set_int)(struct _cef_list_value_t* self, size_t index, - int value); + int(CEF_CALLBACK* set_int)(struct _cef_list_value_t* self, + size_t index, + int value); /// // Sets the value at the specified index as type double. Returns true (1) if // the value was set successfully. /// - int (CEF_CALLBACK *set_double)(struct _cef_list_value_t* self, size_t index, - double value); + int(CEF_CALLBACK* set_double)(struct _cef_list_value_t* self, + size_t index, + double value); /// // Sets the value at the specified index as type string. Returns true (1) if // the value was set successfully. /// - int (CEF_CALLBACK *set_string)(struct _cef_list_value_t* self, size_t index, - const cef_string_t* value); + int(CEF_CALLBACK* set_string)(struct _cef_list_value_t* self, + size_t index, + const cef_string_t* value); /// // Sets the value at the specified index as type binary. Returns true (1) if @@ -697,8 +714,9 @@ typedef struct _cef_list_value_t { // change. Otherwise, ownership will be transferred to this object and the // |value| reference will be invalidated. /// - int (CEF_CALLBACK *set_binary)(struct _cef_list_value_t* self, size_t index, - struct _cef_binary_value_t* value); + int(CEF_CALLBACK* set_binary)(struct _cef_list_value_t* self, + size_t index, + struct _cef_binary_value_t* value); /// // Sets the value at the specified index as type dict. Returns true (1) if the @@ -707,8 +725,9 @@ typedef struct _cef_list_value_t { // Otherwise, ownership will be transferred to this object and the |value| // reference will be invalidated. /// - int (CEF_CALLBACK *set_dictionary)(struct _cef_list_value_t* self, - size_t index, struct _cef_dictionary_value_t* value); + int(CEF_CALLBACK* set_dictionary)(struct _cef_list_value_t* self, + size_t index, + struct _cef_dictionary_value_t* value); /// // Sets the value at the specified index as type list. Returns true (1) if the @@ -717,17 +736,16 @@ typedef struct _cef_list_value_t { // Otherwise, ownership will be transferred to this object and the |value| // reference will be invalidated. /// - int (CEF_CALLBACK *set_list)(struct _cef_list_value_t* self, size_t index, - struct _cef_list_value_t* value); + int(CEF_CALLBACK* set_list)(struct _cef_list_value_t* self, + size_t index, + struct _cef_list_value_t* value); } cef_list_value_t; - /// // Creates a new object that is not owned by any other object. /// CEF_EXPORT cef_list_value_t* cef_list_value_create(); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_waitable_event_capi.h b/include/capi/cef_waitable_event_capi.h index 077a43235..d02733aef 100644 --- a/include/capi/cef_waitable_event_capi.h +++ b/include/capi/cef_waitable_event_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=a8fdbd327fff7769353b0aba47c74cba61333144$ +// #ifndef CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // WaitableEvent is a thread synchronization tool that allows one thread to wait // for another thread to finish some work. This is equivalent to using a @@ -65,27 +66,27 @@ typedef struct _cef_waitable_event_t { /// // Put the event in the un-signaled state. /// - void (CEF_CALLBACK *reset)(struct _cef_waitable_event_t* self); + void(CEF_CALLBACK* reset)(struct _cef_waitable_event_t* self); /// // Put the event in the signaled state. This causes any thread blocked on Wait // to be woken up. /// - void (CEF_CALLBACK *signal)(struct _cef_waitable_event_t* self); + void(CEF_CALLBACK* signal)(struct _cef_waitable_event_t* self); /// // Returns true (1) if the event is in the signaled state, else false (0). If // the event was created with |automatic_reset| set to true (1) then calling // this function will also cause a reset. /// - int (CEF_CALLBACK *is_signaled)(struct _cef_waitable_event_t* self); + int(CEF_CALLBACK* is_signaled)(struct _cef_waitable_event_t* self); /// // Wait indefinitely for the event to be signaled. This function will not // return until after the call to signal() has completed. This function cannot // be called on the browser process UI or IO threads. /// - void (CEF_CALLBACK *wait)(struct _cef_waitable_event_t* self); + void(CEF_CALLBACK* wait)(struct _cef_waitable_event_t* self); /// // Wait up to |max_ms| milliseconds for the event to be signaled. Returns true @@ -94,11 +95,10 @@ typedef struct _cef_waitable_event_t { // until after the call to signal() has completed. This function cannot be // called on the browser process UI or IO threads. /// - int (CEF_CALLBACK *timed_wait)(struct _cef_waitable_event_t* self, - int64 max_ms); + int(CEF_CALLBACK* timed_wait)(struct _cef_waitable_event_t* self, + int64 max_ms); } cef_waitable_event_t; - /// // Create a new waitable event. If |automatic_reset| is true (1) then the event // state is automatically reset to un-signaled after a single waiting thread has @@ -106,10 +106,10 @@ typedef struct _cef_waitable_event_t { // manually. If |initially_signaled| is true (1) then the event will start in // the signaled state. /// -CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create(int automatic_reset, +CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create( + int automatic_reset, int initially_signaled); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_web_plugin_capi.h b/include/capi/cef_web_plugin_capi.h index c3dc6d999..12461e6e4 100644 --- a/include/capi/cef_web_plugin_capi.h +++ b/include/capi/cef_web_plugin_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=95dbecaa1c2b67c99e32d29e7bcd3aff4d126baf$ +// #ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ @@ -59,32 +61,31 @@ typedef struct _cef_web_plugin_info_t { // Returns the plugin name (i.e. Flash). /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_name)( + cef_string_userfree_t(CEF_CALLBACK* get_name)( struct _cef_web_plugin_info_t* self); /// // Returns the plugin file path (DLL/bundle/library). /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_path)( + cef_string_userfree_t(CEF_CALLBACK* get_path)( struct _cef_web_plugin_info_t* self); /// // Returns the version of the plugin (may be OS-specific). /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_version)( + cef_string_userfree_t(CEF_CALLBACK* get_version)( struct _cef_web_plugin_info_t* self); /// // Returns a description of the plugin from the version information. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_description)( + cef_string_userfree_t(CEF_CALLBACK* get_description)( struct _cef_web_plugin_info_t* self); } cef_web_plugin_info_t; - /// // Structure to implement for visiting web plugin information. The functions of // this structure will be called on the browser process UI thread. @@ -101,11 +102,12 @@ typedef struct _cef_web_plugin_info_visitor_t { // Return false (0) to stop visiting plugins. This function may never be // called if no plugins are found. /// - int (CEF_CALLBACK *visit)(struct _cef_web_plugin_info_visitor_t* self, - struct _cef_web_plugin_info_t* info, int count, int total); + int(CEF_CALLBACK* visit)(struct _cef_web_plugin_info_visitor_t* self, + struct _cef_web_plugin_info_t* info, + int count, + int total); } cef_web_plugin_info_visitor_t; - /// // Structure to implement for receiving unstable plugin information. The // functions of this structure will be called on the browser process IO thread. @@ -121,12 +123,12 @@ typedef struct _cef_web_plugin_unstable_callback_t { // true (1) if the plugin has reached the crash count threshold of 3 times in // 120 seconds. /// - void (CEF_CALLBACK *is_unstable)( + void(CEF_CALLBACK* is_unstable)( struct _cef_web_plugin_unstable_callback_t* self, - const cef_string_t* path, int unstable); + const cef_string_t* path, + int unstable); } cef_web_plugin_unstable_callback_t; - /// // Implement this structure to receive notification when CDM registration is // complete. The functions of this structure will be called on the browser @@ -144,12 +146,12 @@ typedef struct _cef_register_cdm_callback_t { // Otherwise, |result| and |error_message| will contain additional information // about why registration failed. /// - void (CEF_CALLBACK *on_cdm_registration_complete)( + void(CEF_CALLBACK* on_cdm_registration_complete)( struct _cef_register_cdm_callback_t* self, - cef_cdm_registration_error_t result, const cef_string_t* error_message); + cef_cdm_registration_error_t result, + const cef_string_t* error_message); } cef_register_cdm_callback_t; - /// // Visit web plugin information. Can be called on any thread in the browser // process. @@ -181,7 +183,8 @@ CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path); // Query if a plugin is unstable. Can be called on any thread in the browser // process. /// -CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, +CEF_EXPORT void cef_is_web_plugin_unstable( + const cef_string_t* path, cef_web_plugin_unstable_callback_t* callback); /// @@ -229,7 +232,8 @@ CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, // |callback| will receive a |result| value of // CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED. /// -CEF_EXPORT void cef_register_widevine_cdm(const cef_string_t* path, +CEF_EXPORT void cef_register_widevine_cdm( + const cef_string_t* path, cef_register_cdm_callback_t* callback); #ifdef __cplusplus diff --git a/include/capi/cef_x509_certificate_capi.h b/include/capi/cef_x509_certificate_capi.h index f0afb3fa2..4ea148ff6 100644 --- a/include/capi/cef_x509_certificate_capi.h +++ b/include/capi/cef_x509_certificate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=9eccfa7e4ebd9ccd0d3d7e0424a9595053e6febe$ +// #ifndef CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Structure representing the issuer or subject field of an X.509 certificate. /// @@ -61,63 +62,66 @@ typedef struct _cef_x509cert_principal_t { // (OU) and returns the first non-NULL one found. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_display_name)( + cef_string_userfree_t(CEF_CALLBACK* get_display_name)( struct _cef_x509cert_principal_t* self); /// // Returns the common name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_common_name)( + cef_string_userfree_t(CEF_CALLBACK* get_common_name)( struct _cef_x509cert_principal_t* self); /// // Returns the locality name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_locality_name)( + cef_string_userfree_t(CEF_CALLBACK* get_locality_name)( struct _cef_x509cert_principal_t* self); /// // Returns the state or province name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_state_or_province_name)( + cef_string_userfree_t(CEF_CALLBACK* get_state_or_province_name)( struct _cef_x509cert_principal_t* self); /// // Returns the country name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_country_name)( + cef_string_userfree_t(CEF_CALLBACK* get_country_name)( struct _cef_x509cert_principal_t* self); /// // Retrieve the list of street addresses. /// - void (CEF_CALLBACK *get_street_addresses)( - struct _cef_x509cert_principal_t* self, cef_string_list_t addresses); + void(CEF_CALLBACK* get_street_addresses)( + struct _cef_x509cert_principal_t* self, + cef_string_list_t addresses); /// // Retrieve the list of organization names. /// - void (CEF_CALLBACK *get_organization_names)( - struct _cef_x509cert_principal_t* self, cef_string_list_t names); + void(CEF_CALLBACK* get_organization_names)( + struct _cef_x509cert_principal_t* self, + cef_string_list_t names); /// // Retrieve the list of organization unit names. /// - void (CEF_CALLBACK *get_organization_unit_names)( - struct _cef_x509cert_principal_t* self, cef_string_list_t names); + void(CEF_CALLBACK* get_organization_unit_names)( + struct _cef_x509cert_principal_t* self, + cef_string_list_t names); /// // Retrieve the list of domain components. /// - void (CEF_CALLBACK *get_domain_components)( - struct _cef_x509cert_principal_t* self, cef_string_list_t components); + void(CEF_CALLBACK* get_domain_components)( + struct _cef_x509cert_principal_t* self, + cef_string_list_t components); } cef_x509cert_principal_t; - /// // Structure representing a X.509 certificate. /// @@ -132,53 +136,53 @@ typedef struct _cef_x509certificate_t { // this represents the web server. The common name of the subject should // match the host name of the web server. /// - struct _cef_x509cert_principal_t* (CEF_CALLBACK *get_subject)( + struct _cef_x509cert_principal_t*(CEF_CALLBACK* get_subject)( struct _cef_x509certificate_t* self); /// // Returns the issuer of the X.509 certificate. /// - struct _cef_x509cert_principal_t* (CEF_CALLBACK *get_issuer)( + struct _cef_x509cert_principal_t*(CEF_CALLBACK* get_issuer)( struct _cef_x509certificate_t* self); /// // Returns the DER encoded serial number for the X.509 certificate. The value // possibly includes a leading 00 byte. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_serial_number)( + struct _cef_binary_value_t*(CEF_CALLBACK* get_serial_number)( struct _cef_x509certificate_t* self); /// // Returns the date before which the X.509 certificate is invalid. // CefTime.GetTimeT() will return 0 if no date was specified. /// - cef_time_t (CEF_CALLBACK *get_valid_start)( + cef_time_t(CEF_CALLBACK* get_valid_start)( struct _cef_x509certificate_t* self); /// // Returns the date after which the X.509 certificate is invalid. // CefTime.GetTimeT() will return 0 if no date was specified. /// - cef_time_t (CEF_CALLBACK *get_valid_expiry)( + cef_time_t(CEF_CALLBACK* get_valid_expiry)( struct _cef_x509certificate_t* self); /// // Returns the DER encoded data for the X.509 certificate. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_derencoded)( + struct _cef_binary_value_t*(CEF_CALLBACK* get_derencoded)( struct _cef_x509certificate_t* self); /// // Returns the PEM encoded data for the X.509 certificate. /// - struct _cef_binary_value_t* (CEF_CALLBACK *get_pemencoded)( + struct _cef_binary_value_t*(CEF_CALLBACK* get_pemencoded)( struct _cef_x509certificate_t* self); /// // Returns the number of certificates in the issuer chain. If 0, the // certificate is self-signed. /// - size_t (CEF_CALLBACK *get_issuer_chain_size)( + size_t(CEF_CALLBACK* get_issuer_chain_size)( struct _cef_x509certificate_t* self); /// @@ -186,8 +190,9 @@ typedef struct _cef_x509certificate_t { // to encode a certificate in the chain it is still present in the array but // is an NULL string. /// - void (CEF_CALLBACK *get_derencoded_issuer_chain)( - struct _cef_x509certificate_t* self, size_t* chainCount, + void(CEF_CALLBACK* get_derencoded_issuer_chain)( + struct _cef_x509certificate_t* self, + size_t* chainCount, struct _cef_binary_value_t** chain); /// @@ -195,12 +200,12 @@ typedef struct _cef_x509certificate_t { // to encode a certificate in the chain it is still present in the array but // is an NULL string. /// - void (CEF_CALLBACK *get_pemencoded_issuer_chain)( - struct _cef_x509certificate_t* self, size_t* chainCount, + void(CEF_CALLBACK* get_pemencoded_issuer_chain)( + struct _cef_x509certificate_t* self, + size_t* chainCount, struct _cef_binary_value_t** chain); } cef_x509certificate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_xml_reader_capi.h b/include/capi/cef_xml_reader_capi.h index 981895073..84071a845 100644 --- a/include/capi/cef_xml_reader_capi.h +++ b/include/capi/cef_xml_reader_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=8356c87c40363434391cc18f509b580860db4404$ +// #ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Structure that supports the reading of XML data via the libxml streaming API. // The functions of this structure should only be called on the thread that @@ -62,46 +63,45 @@ typedef struct _cef_xml_reader_t { // called at least once to set the current cursor position. Returns true (1) // if the cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* move_to_next_node)(struct _cef_xml_reader_t* self); /// // Close the document. This should be called directly to ensure that cleanup // occurs on the correct thread. /// - int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* close)(struct _cef_xml_reader_t* self); /// // Returns true (1) if an error has been reported by the XML parser. /// - int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* has_error)(struct _cef_xml_reader_t* self); /// // Returns the error string. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_error)( + cef_string_userfree_t(CEF_CALLBACK* get_error)( struct _cef_xml_reader_t* self); - // The below functions retrieve data for the node at the current cursor // position. /// // Returns the node type. /// - cef_xml_node_type_t (CEF_CALLBACK *get_type)(struct _cef_xml_reader_t* self); + cef_xml_node_type_t(CEF_CALLBACK* get_type)(struct _cef_xml_reader_t* self); /// // Returns the node depth. Depth starts at 0 for the root node. /// - int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* get_depth)(struct _cef_xml_reader_t* self); /// // Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- // LocalPart for additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_local_name)( + cef_string_userfree_t(CEF_CALLBACK* get_local_name)( struct _cef_xml_reader_t* self); /// @@ -109,7 +109,7 @@ typedef struct _cef_xml_reader_t { // additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_prefix)( + cef_string_userfree_t(CEF_CALLBACK* get_prefix)( struct _cef_xml_reader_t* self); /// @@ -117,7 +117,7 @@ typedef struct _cef_xml_reader_t { // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)( + cef_string_userfree_t(CEF_CALLBACK* get_qualified_name)( struct _cef_xml_reader_t* self); /// @@ -125,7 +125,7 @@ typedef struct _cef_xml_reader_t { // http://www.w3.org/TR/REC-xml-names/ for additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)( + cef_string_userfree_t(CEF_CALLBACK* get_namespace_uri)( struct _cef_xml_reader_t* self); /// @@ -133,7 +133,7 @@ typedef struct _cef_xml_reader_t { // additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_base_uri)( + cef_string_userfree_t(CEF_CALLBACK* get_base_uri)( struct _cef_xml_reader_t* self); /// @@ -141,79 +141,81 @@ typedef struct _cef_xml_reader_t { // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)( + cef_string_userfree_t(CEF_CALLBACK* get_xml_lang)( struct _cef_xml_reader_t* self); /// // Returns true (1) if the node represents an NULL element. is considered // NULL but is not. /// - int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* is_empty_element)(struct _cef_xml_reader_t* self); /// // Returns true (1) if the node has a text value. /// - int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* has_value)(struct _cef_xml_reader_t* self); /// // Returns the text value. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_value)( + cef_string_userfree_t(CEF_CALLBACK* get_value)( struct _cef_xml_reader_t* self); /// // Returns true (1) if the node has attributes. /// - int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* has_attributes)(struct _cef_xml_reader_t* self); /// // Returns the number of attributes. /// - size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self); + size_t(CEF_CALLBACK* get_attribute_count)(struct _cef_xml_reader_t* self); /// // Returns the value of the attribute at the specified 0-based index. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)( - struct _cef_xml_reader_t* self, int index); + cef_string_userfree_t(CEF_CALLBACK* get_attribute_byindex)( + struct _cef_xml_reader_t* self, + int index); /// // Returns the value of the attribute with the specified qualified name. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)( - struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName); + cef_string_userfree_t(CEF_CALLBACK* get_attribute_byqname)( + struct _cef_xml_reader_t* self, + const cef_string_t* qualifiedName); /// // Returns the value of the attribute with the specified local name and // namespace URI. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)( - struct _cef_xml_reader_t* self, const cef_string_t* localName, + cef_string_userfree_t(CEF_CALLBACK* get_attribute_bylname)( + struct _cef_xml_reader_t* self, + const cef_string_t* localName, const cef_string_t* namespaceURI); /// // Returns an XML representation of the current node's children. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)( + cef_string_userfree_t(CEF_CALLBACK* get_inner_xml)( struct _cef_xml_reader_t* self); /// // Returns an XML representation of the current node including its children. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)( + cef_string_userfree_t(CEF_CALLBACK* get_outer_xml)( struct _cef_xml_reader_t* self); /// // Returns the line number for the current node. /// - int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self); - + int(CEF_CALLBACK* get_line_number)(struct _cef_xml_reader_t* self); // Attribute nodes are not traversed by default. The below functions can be // used to move the cursor to an attribute node. move_to_carrying_element() @@ -224,14 +226,15 @@ typedef struct _cef_xml_reader_t { // Moves the cursor to the attribute at the specified 0-based index. Returns // true (1) if the cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self, - int index); + int(CEF_CALLBACK* move_to_attribute_byindex)(struct _cef_xml_reader_t* self, + int index); /// // Moves the cursor to the attribute with the specified qualified name. // Returns true (1) if the cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self, + int(CEF_CALLBACK* move_to_attribute_byqname)( + struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName); /// @@ -239,38 +242,39 @@ typedef struct _cef_xml_reader_t { // namespace URI. Returns true (1) if the cursor position was set // successfully. /// - int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self, - const cef_string_t* localName, const cef_string_t* namespaceURI); + int(CEF_CALLBACK* move_to_attribute_bylname)( + struct _cef_xml_reader_t* self, + const cef_string_t* localName, + const cef_string_t* namespaceURI); /// // Moves the cursor to the first attribute in the current element. Returns // true (1) if the cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* move_to_first_attribute)(struct _cef_xml_reader_t* self); /// // Moves the cursor to the next attribute in the current element. Returns true // (1) if the cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* move_to_next_attribute)(struct _cef_xml_reader_t* self); /// // Moves the cursor back to the carrying element. Returns true (1) if the // cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self); + int(CEF_CALLBACK* move_to_carrying_element)(struct _cef_xml_reader_t* self); } cef_xml_reader_t; - /// // Create a new cef_xml_reader_t object. The returned object's functions can // only be called from the thread that created the object. /// CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create( - struct _cef_stream_reader_t* stream, cef_xml_encoding_type_t encodingType, + struct _cef_stream_reader_t* stream, + cef_xml_encoding_type_t encodingType, const cef_string_t* URI); - #ifdef __cplusplus } #endif diff --git a/include/capi/cef_zip_reader_capi.h b/include/capi/cef_zip_reader_capi.h index bb398e898..743cc59f7 100644 --- a/include/capi/cef_zip_reader_capi.h +++ b/include/capi/cef_zip_reader_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=fec66a36497e467f3da1d2b86d0ae66b8cf709b7$ +// #ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // Structure that supports the reading of zip archives via the zlib unzip API. // The functions of this structure should only be called on the thread that @@ -61,28 +62,28 @@ typedef struct _cef_zip_reader_t { // Moves the cursor to the first file in the archive. Returns true (1) if the // cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self); + int(CEF_CALLBACK* move_to_first_file)(struct _cef_zip_reader_t* self); /// // Moves the cursor to the next file in the archive. Returns true (1) if the // cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self); + int(CEF_CALLBACK* move_to_next_file)(struct _cef_zip_reader_t* self); /// // Moves the cursor to the specified file in the archive. If |caseSensitive| // is true (1) then the search will be case sensitive. Returns true (1) if the // cursor position was set successfully. /// - int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self, - const cef_string_t* fileName, int caseSensitive); + int(CEF_CALLBACK* move_to_file)(struct _cef_zip_reader_t* self, + const cef_string_t* fileName, + int caseSensitive); /// // Closes the archive. This should be called directly to ensure that cleanup // occurs on the correct thread. /// - int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self); - + int(CEF_CALLBACK* close)(struct _cef_zip_reader_t* self); // The below functions act on the file at the current cursor position. @@ -90,51 +91,51 @@ typedef struct _cef_zip_reader_t { // Returns the name of the file. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + cef_string_userfree_t(CEF_CALLBACK* get_file_name)( struct _cef_zip_reader_t* self); /// // Returns the uncompressed size of the file. /// - int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); + int64(CEF_CALLBACK* get_file_size)(struct _cef_zip_reader_t* self); /// // Returns the last modified timestamp for the file. /// - cef_time_t (CEF_CALLBACK *get_file_last_modified)( + cef_time_t(CEF_CALLBACK* get_file_last_modified)( struct _cef_zip_reader_t* self); /// // Opens the file for reading of uncompressed data. A read password may // optionally be specified. /// - int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self, - const cef_string_t* password); + int(CEF_CALLBACK* open_file)(struct _cef_zip_reader_t* self, + const cef_string_t* password); /// // Closes the file. /// - int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self); + int(CEF_CALLBACK* close_file)(struct _cef_zip_reader_t* self); /// // Read uncompressed file contents into the specified buffer. Returns < 0 if // an error occurred, 0 if at the end of file, or the number of bytes read. /// - int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer, - size_t bufferSize); + int(CEF_CALLBACK* read_file)(struct _cef_zip_reader_t* self, + void* buffer, + size_t bufferSize); /// // Returns the current offset in the uncompressed file contents. /// - int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); + int64(CEF_CALLBACK* tell)(struct _cef_zip_reader_t* self); /// // Returns true (1) if at end of the file contents. /// - int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self); + int(CEF_CALLBACK* eof)(struct _cef_zip_reader_t* self); } cef_zip_reader_t; - /// // Create a new cef_zip_reader_t object. The returned object's functions can // only be called from the thread that created the object. @@ -142,7 +143,6 @@ typedef struct _cef_zip_reader_t { CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( struct _cef_stream_reader_t* stream); - #ifdef __cplusplus } #endif diff --git a/include/capi/test/cef_translator_test_capi.h b/include/capi/test/cef_translator_test_capi.h index 14d3fd51e..194245b8c 100644 --- a/include/capi/test/cef_translator_test_capi.h +++ b/include/capi/test/cef_translator_test_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ec043910c391a84dda3b85cf01ea11cd44f37c1f$ +// #ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ #define CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ @@ -67,88 +69,87 @@ typedef struct _cef_translator_test_t { /// cef_base_ref_counted_t base; - // PRIMITIVE VALUES /// // Return a void value. /// - void (CEF_CALLBACK *get_void)(struct _cef_translator_test_t* self); + void(CEF_CALLBACK* get_void)(struct _cef_translator_test_t* self); /// // Return a bool value. /// - int (CEF_CALLBACK *get_bool)(struct _cef_translator_test_t* self); + int(CEF_CALLBACK* get_bool)(struct _cef_translator_test_t* self); /// // Return an int value. /// - int (CEF_CALLBACK *get_int)(struct _cef_translator_test_t* self); + int(CEF_CALLBACK* get_int)(struct _cef_translator_test_t* self); /// // Return a double value. /// - double (CEF_CALLBACK *get_double)(struct _cef_translator_test_t* self); + double(CEF_CALLBACK* get_double)(struct _cef_translator_test_t* self); /// // Return a long value. /// - long (CEF_CALLBACK *get_long)(struct _cef_translator_test_t* self); + long(CEF_CALLBACK* get_long)(struct _cef_translator_test_t* self); /// // Return a size_t value. /// - size_t (CEF_CALLBACK *get_sizet)(struct _cef_translator_test_t* self); + size_t(CEF_CALLBACK* get_sizet)(struct _cef_translator_test_t* self); /// // Set a void value. /// - int (CEF_CALLBACK *set_void)(struct _cef_translator_test_t* self); + int(CEF_CALLBACK* set_void)(struct _cef_translator_test_t* self); /// // Set a bool value. /// - int (CEF_CALLBACK *set_bool)(struct _cef_translator_test_t* self, int val); + int(CEF_CALLBACK* set_bool)(struct _cef_translator_test_t* self, int val); /// // Set an int value. /// - int (CEF_CALLBACK *set_int)(struct _cef_translator_test_t* self, int val); + int(CEF_CALLBACK* set_int)(struct _cef_translator_test_t* self, int val); /// // Set a double value. /// - int (CEF_CALLBACK *set_double)(struct _cef_translator_test_t* self, - double val); + int(CEF_CALLBACK* set_double)(struct _cef_translator_test_t* self, + double val); /// // Set a long value. /// - int (CEF_CALLBACK *set_long)(struct _cef_translator_test_t* self, long val); + int(CEF_CALLBACK* set_long)(struct _cef_translator_test_t* self, long val); /// // Set a size_t value. /// - int (CEF_CALLBACK *set_sizet)(struct _cef_translator_test_t* self, - size_t val); + int(CEF_CALLBACK* set_sizet)(struct _cef_translator_test_t* self, size_t val); /// // Set a int list value. /// - int (CEF_CALLBACK *set_int_list)(struct _cef_translator_test_t* self, - size_t valCount, int const* val); + int(CEF_CALLBACK* set_int_list)(struct _cef_translator_test_t* self, + size_t valCount, + int const* val); /// // Return an int list value by out-param. /// - int (CEF_CALLBACK *get_int_list_by_ref)(struct _cef_translator_test_t* self, - size_t* valCount, int* val); + int(CEF_CALLBACK* get_int_list_by_ref)(struct _cef_translator_test_t* self, + size_t* valCount, + int* val); /// // Return the number of points that will be output above. /// - size_t (CEF_CALLBACK *get_int_list_size)(struct _cef_translator_test_t* self); - + size_t(CEF_CALLBACK* get_int_list_size)(struct _cef_translator_test_t* self); // STRING VALUES @@ -156,119 +157,121 @@ typedef struct _cef_translator_test_t { // Return a string value. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_string)( + cef_string_userfree_t(CEF_CALLBACK* get_string)( struct _cef_translator_test_t* self); /// // Set a string value. /// - int (CEF_CALLBACK *set_string)(struct _cef_translator_test_t* self, - const cef_string_t* val); + int(CEF_CALLBACK* set_string)(struct _cef_translator_test_t* self, + const cef_string_t* val); /// // Return a string value by out-param. /// - void (CEF_CALLBACK *get_string_by_ref)(struct _cef_translator_test_t* self, - cef_string_t* val); + void(CEF_CALLBACK* get_string_by_ref)(struct _cef_translator_test_t* self, + cef_string_t* val); /// // Set a string list value. /// - int (CEF_CALLBACK *set_string_list)(struct _cef_translator_test_t* self, - cef_string_list_t val); + int(CEF_CALLBACK* set_string_list)(struct _cef_translator_test_t* self, + cef_string_list_t val); /// // Return a string list value by out-param. /// - int (CEF_CALLBACK *get_string_list_by_ref)( - struct _cef_translator_test_t* self, cef_string_list_t val); + int(CEF_CALLBACK* get_string_list_by_ref)(struct _cef_translator_test_t* self, + cef_string_list_t val); /// // Set a string map value. /// - int (CEF_CALLBACK *set_string_map)(struct _cef_translator_test_t* self, - cef_string_map_t val); + int(CEF_CALLBACK* set_string_map)(struct _cef_translator_test_t* self, + cef_string_map_t val); /// // Return a string map value by out-param. /// - int (CEF_CALLBACK *get_string_map_by_ref)(struct _cef_translator_test_t* self, - cef_string_map_t val); + int(CEF_CALLBACK* get_string_map_by_ref)(struct _cef_translator_test_t* self, + cef_string_map_t val); /// // Set a string multimap value. /// - int (CEF_CALLBACK *set_string_multimap)(struct _cef_translator_test_t* self, - cef_string_multimap_t val); + int(CEF_CALLBACK* set_string_multimap)(struct _cef_translator_test_t* self, + cef_string_multimap_t val); /// // Return a string multimap value by out-param. /// - int (CEF_CALLBACK *get_string_multimap_by_ref)( - struct _cef_translator_test_t* self, cef_string_multimap_t val); - + int(CEF_CALLBACK* get_string_multimap_by_ref)( + struct _cef_translator_test_t* self, + cef_string_multimap_t val); // STRUCT VALUES /// // Return a point value. /// - cef_point_t (CEF_CALLBACK *get_point)(struct _cef_translator_test_t* self); + cef_point_t(CEF_CALLBACK* get_point)(struct _cef_translator_test_t* self); /// // Set a point value. /// - int (CEF_CALLBACK *set_point)(struct _cef_translator_test_t* self, - const cef_point_t* val); + int(CEF_CALLBACK* set_point)(struct _cef_translator_test_t* self, + const cef_point_t* val); /// // Return a point value by out-param. /// - void (CEF_CALLBACK *get_point_by_ref)(struct _cef_translator_test_t* self, - cef_point_t* val); + void(CEF_CALLBACK* get_point_by_ref)(struct _cef_translator_test_t* self, + cef_point_t* val); /// // Set a point list vlaue. /// - int (CEF_CALLBACK *set_point_list)(struct _cef_translator_test_t* self, - size_t valCount, cef_point_t const* val); + int(CEF_CALLBACK* set_point_list)(struct _cef_translator_test_t* self, + size_t valCount, + cef_point_t const* val); /// // Return a point list value by out-param. /// - int (CEF_CALLBACK *get_point_list_by_ref)(struct _cef_translator_test_t* self, - size_t* valCount, cef_point_t* val); + int(CEF_CALLBACK* get_point_list_by_ref)(struct _cef_translator_test_t* self, + size_t* valCount, + cef_point_t* val); /// // Return the number of points that will be output above. /// - size_t (CEF_CALLBACK *get_point_list_size)( + size_t(CEF_CALLBACK* get_point_list_size)( struct _cef_translator_test_t* self); - // LIBRARY-SIDE REFPTR VALUES /// // Return an new library-side object. /// - struct _cef_translator_test_ref_ptr_library_t* ( - CEF_CALLBACK *get_ref_ptr_library)(struct _cef_translator_test_t* self, - int val); + struct _cef_translator_test_ref_ptr_library_t*( + CEF_CALLBACK* get_ref_ptr_library)(struct _cef_translator_test_t* self, + int val); /// // Set an object. Returns the value from // cef_translator_test_ref_ptr_library_t::get_value(). This tests input and // execution of a library-side object type. /// - int (CEF_CALLBACK *set_ref_ptr_library)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_ref_ptr_library)( + struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_t* val); /// // Set an object. Returns the object passed in. This tests input and output of // a library-side object type. /// - struct _cef_translator_test_ref_ptr_library_t* ( - CEF_CALLBACK *set_ref_ptr_library_and_return)( + struct _cef_translator_test_ref_ptr_library_t*( + CEF_CALLBACK* set_ref_ptr_library_and_return)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_t* val); @@ -277,7 +280,7 @@ typedef struct _cef_translator_test_t { // cef_translator_test_ref_ptr_library_t::get_value(). This tests input of a // library- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_ref_ptr_library)( + int(CEF_CALLBACK* set_child_ref_ptr_library)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_child_t* val); @@ -285,34 +288,37 @@ typedef struct _cef_translator_test_t { // Set a child object. Returns the object as the parent type. This tests input // of a library-side child object type and return as the parent type. /// - struct _cef_translator_test_ref_ptr_library_t* ( - CEF_CALLBACK *set_child_ref_ptr_library_and_return_parent)( + struct _cef_translator_test_ref_ptr_library_t*( + CEF_CALLBACK* set_child_ref_ptr_library_and_return_parent)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_child_t* val); /// // Set an object list vlaue. /// - int (CEF_CALLBACK *set_ref_ptr_library_list)( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_ref_ptr_library_t* const* val, int val1, + int(CEF_CALLBACK* set_ref_ptr_library_list)( + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_ref_ptr_library_t* const* val, + int val1, int val2); /// // Return an object list value by out-param. /// - int (CEF_CALLBACK *get_ref_ptr_library_list_by_ref)( - struct _cef_translator_test_t* self, size_t* valCount, - struct _cef_translator_test_ref_ptr_library_t** val, int val1, + int(CEF_CALLBACK* get_ref_ptr_library_list_by_ref)( + struct _cef_translator_test_t* self, + size_t* valCount, + struct _cef_translator_test_ref_ptr_library_t** val, + int val1, int val2); /// // Return the number of object that will be output above. /// - size_t (CEF_CALLBACK *get_ref_ptr_library_list_size)( + size_t(CEF_CALLBACK* get_ref_ptr_library_list_size)( struct _cef_translator_test_t* self); - // CLIENT-SIDE REFPTR VALUES /// @@ -320,15 +326,16 @@ typedef struct _cef_translator_test_t { // cef_translator_test_ref_ptr_client_t::get_value(). This tests input and // execution of a client-side object type. /// - int (CEF_CALLBACK *set_ref_ptr_client)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_ref_ptr_client)( + struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_t* val); /// // Set an object. Returns the handler passed in. This tests input and output // of a client-side object type. /// - struct _cef_translator_test_ref_ptr_client_t* ( - CEF_CALLBACK *set_ref_ptr_client_and_return)( + struct _cef_translator_test_ref_ptr_client_t*( + CEF_CALLBACK* set_ref_ptr_client_and_return)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_t* val); @@ -337,7 +344,7 @@ typedef struct _cef_translator_test_t { // cef_translator_test_ref_ptr_client_t::get_value(). This tests input of a // client- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_ref_ptr_client)( + int(CEF_CALLBACK* set_child_ref_ptr_client)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_child_t* val); @@ -345,24 +352,27 @@ typedef struct _cef_translator_test_t { // Set a child object. Returns the object as the parent type. This tests input // of a client-side child object type and return as the parent type. /// - struct _cef_translator_test_ref_ptr_client_t* ( - CEF_CALLBACK *set_child_ref_ptr_client_and_return_parent)( + struct _cef_translator_test_ref_ptr_client_t*( + CEF_CALLBACK* set_child_ref_ptr_client_and_return_parent)( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_child_t* val); /// // Set an object list vlaue. /// - int (CEF_CALLBACK *set_ref_ptr_client_list)( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_ref_ptr_client_t* const* val, int val1, + int(CEF_CALLBACK* set_ref_ptr_client_list)( + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_ref_ptr_client_t* const* val, + int val1, int val2); /// // Return an object list value by out-param. /// - int (CEF_CALLBACK *get_ref_ptr_client_list_by_ref)( - struct _cef_translator_test_t* self, size_t* valCount, + int(CEF_CALLBACK* get_ref_ptr_client_list_by_ref)( + struct _cef_translator_test_t* self, + size_t* valCount, struct _cef_translator_test_ref_ptr_client_t** val, struct _cef_translator_test_ref_ptr_client_t* val1, struct _cef_translator_test_ref_ptr_client_t* val2); @@ -370,33 +380,33 @@ typedef struct _cef_translator_test_t { /// // Return the number of object that will be output above. /// - size_t (CEF_CALLBACK *get_ref_ptr_client_list_size)( + size_t(CEF_CALLBACK* get_ref_ptr_client_list_size)( struct _cef_translator_test_t* self); - // LIBRARY-SIDE OWNPTR VALUES /// // Return an new library-side object. /// - struct _cef_translator_test_scoped_library_t* ( - CEF_CALLBACK *get_own_ptr_library)(struct _cef_translator_test_t* self, - int val); + struct _cef_translator_test_scoped_library_t*( + CEF_CALLBACK* get_own_ptr_library)(struct _cef_translator_test_t* self, + int val); /// // Set an object. Returns the value from // cef_translator_test_scoped_library_t::get_value(). This tests input and // execution of a library-side object type. /// - int (CEF_CALLBACK *set_own_ptr_library)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_own_ptr_library)( + struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_t* val); /// // Set an object. Returns the object passed in. This tests input and output of // a library-side object type. /// - struct _cef_translator_test_scoped_library_t* ( - CEF_CALLBACK *set_own_ptr_library_and_return)( + struct _cef_translator_test_scoped_library_t*( + CEF_CALLBACK* set_own_ptr_library_and_return)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_t* val); @@ -405,7 +415,7 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_library_t::get_value(). This tests input of a // library- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_own_ptr_library)( + int(CEF_CALLBACK* set_child_own_ptr_library)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_child_t* val); @@ -413,12 +423,11 @@ typedef struct _cef_translator_test_t { // Set a child object. Returns the object as the parent type. This tests input // of a library-side child object type and return as the parent type. /// - struct _cef_translator_test_scoped_library_t* ( - CEF_CALLBACK *set_child_own_ptr_library_and_return_parent)( + struct _cef_translator_test_scoped_library_t*( + CEF_CALLBACK* set_child_own_ptr_library_and_return_parent)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_child_t* val); - // CLIENT-SIDE OWNPTR VALUES /// @@ -426,15 +435,16 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_client_t::get_value(). This tests input and // execution of a client-side object type. /// - int (CEF_CALLBACK *set_own_ptr_client)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_own_ptr_client)( + struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_t* val); /// // Set an object. Returns the handler passed in. This tests input and output // of a client-side object type. /// - struct _cef_translator_test_scoped_client_t* ( - CEF_CALLBACK *set_own_ptr_client_and_return)( + struct _cef_translator_test_scoped_client_t*( + CEF_CALLBACK* set_own_ptr_client_and_return)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_t* val); @@ -443,7 +453,7 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_client_t::get_value(). This tests input of a // client- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_own_ptr_client)( + int(CEF_CALLBACK* set_child_own_ptr_client)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_child_t* val); @@ -451,12 +461,11 @@ typedef struct _cef_translator_test_t { // Set a child object. Returns the object as the parent type. This tests input // of a client-side child object type and return as the parent type. /// - struct _cef_translator_test_scoped_client_t* ( - CEF_CALLBACK *set_child_own_ptr_client_and_return_parent)( + struct _cef_translator_test_scoped_client_t*( + CEF_CALLBACK* set_child_own_ptr_client_and_return_parent)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_child_t* val); - // LIBRARY-SIDE RAWPTR VALUES /// @@ -464,7 +473,8 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_library_t::get_value(). This tests input and // execution of a library-side object type. /// - int (CEF_CALLBACK *set_raw_ptr_library)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_raw_ptr_library)( + struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_t* val); /// @@ -472,19 +482,20 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_library_t::get_value(). This tests input of a // library- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_raw_ptr_library)( + int(CEF_CALLBACK* set_child_raw_ptr_library)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_child_t* val); /// // Set an object list vlaue. /// - int (CEF_CALLBACK *set_raw_ptr_library_list)( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_scoped_library_t* const* val, int val1, + int(CEF_CALLBACK* set_raw_ptr_library_list)( + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_scoped_library_t* const* val, + int val1, int val2); - // CLIENT-SIDE RAWPTR VALUES /// @@ -492,7 +503,8 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_client_t::get_value(). This tests input and // execution of a client-side object type. /// - int (CEF_CALLBACK *set_raw_ptr_client)(struct _cef_translator_test_t* self, + int(CEF_CALLBACK* set_raw_ptr_client)( + struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_t* val); /// @@ -500,26 +512,26 @@ typedef struct _cef_translator_test_t { // cef_translator_test_scoped_client_t::get_value(). This tests input of a // client- side child object type and execution as the parent type. /// - int (CEF_CALLBACK *set_child_raw_ptr_client)( + int(CEF_CALLBACK* set_child_raw_ptr_client)( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_child_t* val); /// // Set an object list vlaue. /// - int (CEF_CALLBACK *set_raw_ptr_client_list)( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_scoped_client_t* const* val, int val1, + int(CEF_CALLBACK* set_raw_ptr_client_list)( + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_scoped_client_t* const* val, + int val1, int val2); } cef_translator_test_t; - /// // Create the test object. /// CEF_EXPORT cef_translator_test_t* cef_translator_test_create(); - /// // Library-side test object for RefPtr. /// @@ -532,23 +544,22 @@ typedef struct _cef_translator_test_ref_ptr_library_t { /// // Return a value. /// - int (CEF_CALLBACK *get_value)( + int(CEF_CALLBACK* get_value)( struct _cef_translator_test_ref_ptr_library_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_value)( - struct _cef_translator_test_ref_ptr_library_t* self, int value); + void(CEF_CALLBACK* set_value)( + struct _cef_translator_test_ref_ptr_library_t* self, + int value); } cef_translator_test_ref_ptr_library_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create( - int value); - +CEF_EXPORT cef_translator_test_ref_ptr_library_t* +cef_translator_test_ref_ptr_library_create(int value); /// // Library-side child test object for RefPtr. @@ -562,23 +573,22 @@ typedef struct _cef_translator_test_ref_ptr_library_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_value)( + int(CEF_CALLBACK* get_other_value)( struct _cef_translator_test_ref_ptr_library_child_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_other_value)( - struct _cef_translator_test_ref_ptr_library_child_t* self, int value); + void(CEF_CALLBACK* set_other_value)( + struct _cef_translator_test_ref_ptr_library_child_t* self, + int value); } cef_translator_test_ref_ptr_library_child_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create( - int value, int other_value); - +CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* +cef_translator_test_ref_ptr_library_child_create(int value, int other_value); /// // Another library-side child test object for RefPtr. @@ -592,24 +602,24 @@ typedef struct _cef_translator_test_ref_ptr_library_child_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_other_value)( + int(CEF_CALLBACK* get_other_other_value)( struct _cef_translator_test_ref_ptr_library_child_child_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_other_other_value)( + void(CEF_CALLBACK* set_other_other_value)( struct _cef_translator_test_ref_ptr_library_child_child_t* self, int value); } cef_translator_test_ref_ptr_library_child_child_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create( - int value, int other_value, int other_other_value); - +CEF_EXPORT cef_translator_test_ref_ptr_library_child_child_t* +cef_translator_test_ref_ptr_library_child_child_create(int value, + int other_value, + int other_other_value); /// // Client-side test object for RefPtr. @@ -623,11 +633,10 @@ typedef struct _cef_translator_test_ref_ptr_client_t { /// // Return a value. /// - int (CEF_CALLBACK *get_value)( + int(CEF_CALLBACK* get_value)( struct _cef_translator_test_ref_ptr_client_t* self); } cef_translator_test_ref_ptr_client_t; - /// // Client-side child test object for RefPtr. /// @@ -640,11 +649,10 @@ typedef struct _cef_translator_test_ref_ptr_client_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_value)( + int(CEF_CALLBACK* get_other_value)( struct _cef_translator_test_ref_ptr_client_child_t* self); } cef_translator_test_ref_ptr_client_child_t; - /// // Library-side test object for OwnPtr/RawPtr. /// @@ -657,23 +665,22 @@ typedef struct _cef_translator_test_scoped_library_t { /// // Return a value. /// - int (CEF_CALLBACK *get_value)( + int(CEF_CALLBACK* get_value)( struct _cef_translator_test_scoped_library_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_value)( - struct _cef_translator_test_scoped_library_t* self, int value); + void(CEF_CALLBACK* set_value)( + struct _cef_translator_test_scoped_library_t* self, + int value); } cef_translator_test_scoped_library_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create( - int value); - +CEF_EXPORT cef_translator_test_scoped_library_t* +cef_translator_test_scoped_library_create(int value); /// // Library-side child test object for OwnPtr/RawPtr. @@ -687,23 +694,22 @@ typedef struct _cef_translator_test_scoped_library_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_value)( + int(CEF_CALLBACK* get_other_value)( struct _cef_translator_test_scoped_library_child_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_other_value)( - struct _cef_translator_test_scoped_library_child_t* self, int value); + void(CEF_CALLBACK* set_other_value)( + struct _cef_translator_test_scoped_library_child_t* self, + int value); } cef_translator_test_scoped_library_child_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create( - int value, int other_value); - +CEF_EXPORT cef_translator_test_scoped_library_child_t* +cef_translator_test_scoped_library_child_create(int value, int other_value); /// // Another library-side child test object for OwnPtr/RawPtr. @@ -717,24 +723,24 @@ typedef struct _cef_translator_test_scoped_library_child_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_other_value)( + int(CEF_CALLBACK* get_other_other_value)( struct _cef_translator_test_scoped_library_child_child_t* self); /// // Set a value. /// - void (CEF_CALLBACK *set_other_other_value)( + void(CEF_CALLBACK* set_other_other_value)( struct _cef_translator_test_scoped_library_child_child_t* self, int value); } cef_translator_test_scoped_library_child_child_t; - /// // Create the test object. /// -CEF_EXPORT cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create( - int value, int other_value, int other_other_value); - +CEF_EXPORT cef_translator_test_scoped_library_child_child_t* +cef_translator_test_scoped_library_child_child_create(int value, + int other_value, + int other_other_value); /// // Client-side test object for OwnPtr/RawPtr. @@ -748,11 +754,10 @@ typedef struct _cef_translator_test_scoped_client_t { /// // Return a value. /// - int (CEF_CALLBACK *get_value)( + int(CEF_CALLBACK* get_value)( struct _cef_translator_test_scoped_client_t* self); } cef_translator_test_scoped_client_t; - /// // Client-side child test object for OwnPtr/RawPtr. /// @@ -765,11 +770,10 @@ typedef struct _cef_translator_test_scoped_client_child_t { /// // Return a value. /// - int (CEF_CALLBACK *get_other_value)( + int(CEF_CALLBACK* get_other_value)( struct _cef_translator_test_scoped_client_child_t* self); } cef_translator_test_scoped_client_child_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_box_layout_capi.h b/include/capi/views/cef_box_layout_capi.h index c8330feec..e887764f3 100644 --- a/include/capi/views/cef_box_layout_capi.h +++ b/include/capi/views/cef_box_layout_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=acbfe00533fba6a55e9a0d0d0c6a317f54dbf887$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_ @@ -67,18 +69,18 @@ typedef struct _cef_box_layout_t { // space is subtracted in these ratios. A flex of 0 means this view is not // resized. Flex values must not be negative. /// - void (CEF_CALLBACK *set_flex_for_view)(struct _cef_box_layout_t* self, - struct _cef_view_t* view, int flex); + void(CEF_CALLBACK* set_flex_for_view)(struct _cef_box_layout_t* self, + struct _cef_view_t* view, + int flex); /// // Clears the flex for the given |view|, causing it to use the default flex // specified via cef_box_layout_tSettings.default_flex. /// - void (CEF_CALLBACK *clear_flex_for_view)(struct _cef_box_layout_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* clear_flex_for_view)(struct _cef_box_layout_t* self, + struct _cef_view_t* view); } cef_box_layout_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_browser_view_capi.h b/include/capi/views/cef_browser_view_capi.h index b7723b106..f34fbd931 100644 --- a/include/capi/views/cef_browser_view_capi.h +++ b/include/capi/views/cef_browser_view_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=0ba6628b63ed6641097a1714d4facf5343cf2252$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // A View hosting a cef_browser_t instance. Methods must be called on the // browser process UI thread unless otherwise indicated. @@ -61,7 +62,7 @@ typedef struct _cef_browser_view_t { // Returns the cef_browser_t hosted by this BrowserView. Will return NULL if // the browser has not yet been created or has already been destroyed. /// - struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_browser_t*(CEF_CALLBACK* get_browser)( struct _cef_browser_view_t* self); /// @@ -73,17 +74,17 @@ typedef struct _cef_browser_view_t { // only be triggered if the event is not handled by web content or by // cef_keyboard_handler_t. The default value is false (0). /// - void (CEF_CALLBACK *set_prefer_accelerators)(struct _cef_browser_view_t* self, - int prefer_accelerators); + void(CEF_CALLBACK* set_prefer_accelerators)(struct _cef_browser_view_t* self, + int prefer_accelerators); } cef_browser_view_t; - /// // Create a new BrowserView. The underlying cef_browser_t will not be created // until this view is added to the views hierarchy. /// CEF_EXPORT cef_browser_view_t* cef_browser_view_create( - struct _cef_client_t* client, const cef_string_t* url, + struct _cef_client_t* client, + const cef_string_t* url, const struct _cef_browser_settings_t* settings, struct _cef_request_context_t* request_context, struct _cef_browser_view_delegate_t* delegate); @@ -94,7 +95,6 @@ CEF_EXPORT cef_browser_view_t* cef_browser_view_create( CEF_EXPORT cef_browser_view_t* cef_browser_view_get_for_browser( struct _cef_browser_t* browser); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_browser_view_delegate_capi.h b/include/capi/views/cef_browser_view_delegate_capi.h index ea8565e76..a6115c257 100644 --- a/include/capi/views/cef_browser_view_delegate_capi.h +++ b/include/capi/views/cef_browser_view_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=08193b1ef781224bf7664c5bf407af8674ad2362$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_ @@ -65,7 +67,7 @@ typedef struct _cef_browser_view_delegate_t { // is called for |browser| and before on_popup_browser_view_created() is // called for |browser|'s parent delegate if |browser| is a popup. /// - void (CEF_CALLBACK *on_browser_created)( + void(CEF_CALLBACK* on_browser_created)( struct _cef_browser_view_delegate_t* self, struct _cef_browser_view_t* browser_view, struct _cef_browser_t* browser); @@ -76,7 +78,7 @@ typedef struct _cef_browser_view_delegate_t { // |browser| after this callback returns. This function will be called before // cef_life_span_handler_t::on_before_close() is called for |browser|. /// - void (CEF_CALLBACK *on_browser_destroyed)( + void(CEF_CALLBACK* on_browser_destroyed)( struct _cef_browser_view_delegate_t* self, struct _cef_browser_view_t* browser_view, struct _cef_browser_t* browser); @@ -88,12 +90,13 @@ typedef struct _cef_browser_view_delegate_t { // if the popup will be a DevTools browser. Return the delegate that will be // used for the new popup BrowserView. /// - struct _cef_browser_view_delegate_t* ( - CEF_CALLBACK *get_delegate_for_popup_browser_view)( + struct _cef_browser_view_delegate_t*( + CEF_CALLBACK* get_delegate_for_popup_browser_view)( struct _cef_browser_view_delegate_t* self, struct _cef_browser_view_t* browser_view, const struct _cef_browser_settings_t* settings, - struct _cef_client_t* client, int is_devtools); + struct _cef_client_t* client, + int is_devtools); /// // Called after |popup_browser_view| is created. This function will be called @@ -104,13 +107,13 @@ typedef struct _cef_browser_view_delegate_t { // yourself and return true (1). Otherwise return false (0) and a default // cef_window_t will be created for the popup. /// - int (CEF_CALLBACK *on_popup_browser_view_created)( + int(CEF_CALLBACK* on_popup_browser_view_created)( struct _cef_browser_view_delegate_t* self, struct _cef_browser_view_t* browser_view, - struct _cef_browser_view_t* popup_browser_view, int is_devtools); + struct _cef_browser_view_t* popup_browser_view, + int is_devtools); } cef_browser_view_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_button_capi.h b/include/capi/views/cef_button_capi.h index 36a0dedf1..17220860e 100644 --- a/include/capi/views/cef_button_capi.h +++ b/include/capi/views/cef_button_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=f785be05a42d3490ac2e625470befa7d4f77befb$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_ @@ -60,41 +62,40 @@ typedef struct _cef_button_t { /// // Returns this Button as a LabelButton or NULL if this is not a LabelButton. /// - struct _cef_label_button_t* (CEF_CALLBACK *as_label_button)( + struct _cef_label_button_t*(CEF_CALLBACK* as_label_button)( struct _cef_button_t* self); /// // Sets the current display state of the Button. /// - void (CEF_CALLBACK *set_state)(struct _cef_button_t* self, - cef_button_state_t state); + void(CEF_CALLBACK* set_state)(struct _cef_button_t* self, + cef_button_state_t state); /// // Returns the current display state of the Button. /// - cef_button_state_t (CEF_CALLBACK *get_state)(struct _cef_button_t* self); + cef_button_state_t(CEF_CALLBACK* get_state)(struct _cef_button_t* self); /// // Sets the Button will use an ink drop effect for displaying state changes. /// - void (CEF_CALLBACK *set_ink_drop_enabled)(struct _cef_button_t* self, - int enabled); + void(CEF_CALLBACK* set_ink_drop_enabled)(struct _cef_button_t* self, + int enabled); /// // Sets the tooltip text that will be displayed when the user hovers the mouse // cursor over the Button. /// - void (CEF_CALLBACK *set_tooltip_text)(struct _cef_button_t* self, - const cef_string_t* tooltip_text); + void(CEF_CALLBACK* set_tooltip_text)(struct _cef_button_t* self, + const cef_string_t* tooltip_text); /// // Sets the accessible name that will be exposed to assistive technology (AT). /// - void (CEF_CALLBACK *set_accessible_name)(struct _cef_button_t* self, - const cef_string_t* name); + void(CEF_CALLBACK* set_accessible_name)(struct _cef_button_t* self, + const cef_string_t* name); } cef_button_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_button_delegate_capi.h b/include/capi/views/cef_button_delegate_capi.h index ecd653e88..4ebbeb2be 100644 --- a/include/capi/views/cef_button_delegate_capi.h +++ b/include/capi/views/cef_button_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=eb5e428e07fbad33c7da94735969b0ff4dd6fb9f$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_ @@ -60,17 +62,17 @@ typedef struct _cef_button_delegate_t { /// // Called when |button| is pressed. /// - void (CEF_CALLBACK *on_button_pressed)(struct _cef_button_delegate_t* self, - struct _cef_button_t* button); + void(CEF_CALLBACK* on_button_pressed)(struct _cef_button_delegate_t* self, + struct _cef_button_t* button); /// // Called when the state of |button| changes. /// - void (CEF_CALLBACK *on_button_state_changed)( - struct _cef_button_delegate_t* self, struct _cef_button_t* button); + void(CEF_CALLBACK* on_button_state_changed)( + struct _cef_button_delegate_t* self, + struct _cef_button_t* button); } cef_button_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_display_capi.h b/include/capi/views/cef_display_capi.h index 44c4b47bb..be7a05f0e 100644 --- a/include/capi/views/cef_display_capi.h +++ b/include/capi/views/cef_display_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=20e9f8cdab0325b3d860128a946f3120563fa08e$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // This structure typically, but not always, corresponds to a physical display // connected to the system. A fake Display may exist on a headless system, or a @@ -62,7 +63,7 @@ typedef struct _cef_display_t { /// // Returns the unique identifier for this Display. /// - int64 (CEF_CALLBACK *get_id)(struct _cef_display_t* self); + int64(CEF_CALLBACK* get_id)(struct _cef_display_t* self); /// // Returns this Display's device pixel scale factor. This specifies how much @@ -70,40 +71,39 @@ typedef struct _cef_display_t { // standard displays (which is around 100~120dpi). The potential return values // differ by platform. /// - float (CEF_CALLBACK *get_device_scale_factor)(struct _cef_display_t* self); + float(CEF_CALLBACK* get_device_scale_factor)(struct _cef_display_t* self); /// // Convert |point| from density independent pixels (DIP) to pixel coordinates // using this Display's device scale factor. /// - void (CEF_CALLBACK *convert_point_to_pixels)(struct _cef_display_t* self, - cef_point_t* point); + void(CEF_CALLBACK* convert_point_to_pixels)(struct _cef_display_t* self, + cef_point_t* point); /// // Convert |point| from pixel coordinates to density independent pixels (DIP) // using this Display's device scale factor. /// - void (CEF_CALLBACK *convert_point_from_pixels)(struct _cef_display_t* self, - cef_point_t* point); + void(CEF_CALLBACK* convert_point_from_pixels)(struct _cef_display_t* self, + cef_point_t* point); /// // Returns this Display's bounds. This is the full size of the display. /// - cef_rect_t (CEF_CALLBACK *get_bounds)(struct _cef_display_t* self); + cef_rect_t(CEF_CALLBACK* get_bounds)(struct _cef_display_t* self); /// // Returns this Display's work area. This excludes areas of the display that // are occupied for window manager toolbars, etc. /// - cef_rect_t (CEF_CALLBACK *get_work_area)(struct _cef_display_t* self); + cef_rect_t(CEF_CALLBACK* get_work_area)(struct _cef_display_t* self); /// // Returns this Display's rotation in degrees. /// - int (CEF_CALLBACK *get_rotation)(struct _cef_display_t* self); + int(CEF_CALLBACK* get_rotation)(struct _cef_display_t* self); } cef_display_t; - /// // Returns the primary Display. /// @@ -114,7 +114,8 @@ CEF_EXPORT cef_display_t* cef_display_get_primary(); // |point| is in pixel coordinates instead of density independent pixels (DIP). /// CEF_EXPORT cef_display_t* cef_display_get_nearest_point( - const cef_point_t* point, int input_pixel_coords); + const cef_point_t* point, + int input_pixel_coords); /// // Returns the Display that most closely intersects |bounds|. Set @@ -122,7 +123,8 @@ CEF_EXPORT cef_display_t* cef_display_get_nearest_point( // of density independent pixels (DIP). /// CEF_EXPORT cef_display_t* cef_display_get_matching_bounds( - const cef_rect_t* bounds, int input_pixel_coords); + const cef_rect_t* bounds, + int input_pixel_coords); /// // Returns the total number of Displays. Mirrored displays are excluded; this @@ -135,8 +137,7 @@ CEF_EXPORT size_t cef_display_get_count(); // intended to return distinct, usable displays. /// CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, - cef_display_t** displays); - + cef_display_t** displays); #ifdef __cplusplus } diff --git a/include/capi/views/cef_fill_layout_capi.h b/include/capi/views/cef_fill_layout_capi.h index 2d5ef7aa3..3a29b08c9 100644 --- a/include/capi/views/cef_fill_layout_capi.h +++ b/include/capi/views/cef_fill_layout_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=32d7f76955b00935902e954344c76efe864eabf4$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // A simple Layout that causes the associated Panel's one child to be sized to // match the bounds of its parent. Methods must be called on the browser process @@ -57,7 +58,6 @@ typedef struct _cef_fill_layout_t { cef_layout_t base; } cef_fill_layout_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_label_button_capi.h b/include/capi/views/cef_label_button_capi.h index 17548865a..64310d289 100644 --- a/include/capi/views/cef_label_button_capi.h +++ b/include/capi/views/cef_label_button_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ff20922a0e73fdb84b0cb1864f35911a1a725f8a$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_ @@ -62,21 +64,21 @@ typedef struct _cef_label_button_t { // Returns this LabelButton as a MenuButton or NULL if this is not a // MenuButton. /// - struct _cef_menu_button_t* (CEF_CALLBACK *as_menu_button)( + struct _cef_menu_button_t*(CEF_CALLBACK* as_menu_button)( struct _cef_label_button_t* self); /// // Sets the text shown on the LabelButton. By default |text| will also be used // as the accessible name. /// - void (CEF_CALLBACK *set_text)(struct _cef_label_button_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* set_text)(struct _cef_label_button_t* self, + const cef_string_t* text); /// // Returns the text shown on the LabelButton. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_text)( + cef_string_userfree_t(CEF_CALLBACK* get_text)( struct _cef_label_button_t* self); /// @@ -84,27 +86,30 @@ typedef struct _cef_label_button_t { // image exists for the current state then the image for // CEF_BUTTON_STATE_NORMAL, if any, will be shown. /// - void (CEF_CALLBACK *set_image)(struct _cef_label_button_t* self, - cef_button_state_t button_state, struct _cef_image_t* image); + void(CEF_CALLBACK* set_image)(struct _cef_label_button_t* self, + cef_button_state_t button_state, + struct _cef_image_t* image); /// // Returns the image shown for |button_state|. If no image exists for that // state then the image for CEF_BUTTON_STATE_NORMAL will be returned. /// - struct _cef_image_t* (CEF_CALLBACK *get_image)( - struct _cef_label_button_t* self, cef_button_state_t button_state); + struct _cef_image_t*(CEF_CALLBACK* get_image)( + struct _cef_label_button_t* self, + cef_button_state_t button_state); /// // Sets the text color shown for the specified button |for_state| to |color|. /// - void (CEF_CALLBACK *set_text_color)(struct _cef_label_button_t* self, - cef_button_state_t for_state, cef_color_t color); + void(CEF_CALLBACK* set_text_color)(struct _cef_label_button_t* self, + cef_button_state_t for_state, + cef_color_t color); /// // Sets the text colors shown for the non-disabled states to |color|. /// - void (CEF_CALLBACK *set_enabled_text_colors)(struct _cef_label_button_t* self, - cef_color_t color); + void(CEF_CALLBACK* set_enabled_text_colors)(struct _cef_label_button_t* self, + cef_color_t color); /// // Sets the font list. The format is ",[STYLES] ", @@ -116,30 +121,30 @@ typedef struct _cef_label_button_t { // Here are examples of valid font description strings: - "Arial, Helvetica, // Bold Italic 14px" - "Arial, 14px" /// - void (CEF_CALLBACK *set_font_list)(struct _cef_label_button_t* self, - const cef_string_t* font_list); + void(CEF_CALLBACK* set_font_list)(struct _cef_label_button_t* self, + const cef_string_t* font_list); /// // Sets the horizontal alignment; reversed in RTL. Default is // CEF_HORIZONTAL_ALIGNMENT_CENTER. /// - void (CEF_CALLBACK *set_horizontal_alignment)( - struct _cef_label_button_t* self, cef_horizontal_alignment_t alignment); + void(CEF_CALLBACK* set_horizontal_alignment)( + struct _cef_label_button_t* self, + cef_horizontal_alignment_t alignment); /// // Reset the minimum size of this LabelButton to |size|. /// - void (CEF_CALLBACK *set_minimum_size)(struct _cef_label_button_t* self, - const cef_size_t* size); + void(CEF_CALLBACK* set_minimum_size)(struct _cef_label_button_t* self, + const cef_size_t* size); /// // Reset the maximum size of this LabelButton to |size|. /// - void (CEF_CALLBACK *set_maximum_size)(struct _cef_label_button_t* self, - const cef_size_t* size); + void(CEF_CALLBACK* set_maximum_size)(struct _cef_label_button_t* self, + const cef_size_t* size); } cef_label_button_t; - /// // Create a new LabelButton. A |delegate| must be provided to handle the button // click. |text| will be shown on the LabelButton and used as the default @@ -150,10 +155,10 @@ typedef struct _cef_label_button_t { // default minimum size. /// CEF_EXPORT cef_label_button_t* cef_label_button_create( - struct _cef_button_delegate_t* delegate, const cef_string_t* text, + struct _cef_button_delegate_t* delegate, + const cef_string_t* text, int with_frame); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_layout_capi.h b/include/capi/views/cef_layout_capi.h index 1c6b0585e..be870aa93 100644 --- a/include/capi/views/cef_layout_capi.h +++ b/include/capi/views/cef_layout_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=0fd9d445840558956dbe281f1d5d20ec003684d1$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_ @@ -61,22 +63,21 @@ typedef struct _cef_layout_t { /// // Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout. /// - struct _cef_box_layout_t* (CEF_CALLBACK *as_box_layout)( + struct _cef_box_layout_t*(CEF_CALLBACK* as_box_layout)( struct _cef_layout_t* self); /// // Returns this Layout as a FillLayout or NULL if this is not a FillLayout. /// - struct _cef_fill_layout_t* (CEF_CALLBACK *as_fill_layout)( + struct _cef_fill_layout_t*(CEF_CALLBACK* as_fill_layout)( struct _cef_layout_t* self); /// // Returns true (1) if this Layout is valid. /// - int (CEF_CALLBACK *is_valid)(struct _cef_layout_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_layout_t* self); } cef_layout_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_menu_button_capi.h b/include/capi/views/cef_menu_button_capi.h index 493842e57..c540bc26c 100644 --- a/include/capi/views/cef_menu_button_capi.h +++ b/include/capi/views/cef_menu_button_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=cf3b867dfc26e13b96f2e20fe8b974a38d28119e$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_ @@ -46,7 +48,6 @@ extern "C" { #endif - /// // MenuButton is a button with optional text, icon and/or menu marker that shows // a menu when clicked with the left mouse button. All size and position values @@ -65,18 +66,18 @@ typedef struct _cef_menu_button_t { // will be anchored relative to |screen_point|. This function should be called // from cef_menu_button_delegate_t::on_menu_button_pressed(). /// - void (CEF_CALLBACK *show_menu)(struct _cef_menu_button_t* self, - struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point, - cef_menu_anchor_position_t anchor_position); + void(CEF_CALLBACK* show_menu)(struct _cef_menu_button_t* self, + struct _cef_menu_model_t* menu_model, + const cef_point_t* screen_point, + cef_menu_anchor_position_t anchor_position); /// // Show the menu for this button. Results in a call to // cef_menu_button_delegate_t::on_menu_button_pressed(). /// - void (CEF_CALLBACK *trigger_menu)(struct _cef_menu_button_t* self); + void(CEF_CALLBACK* trigger_menu)(struct _cef_menu_button_t* self); } cef_menu_button_t; - /// // Create a new MenuButton. A |delegate| must be provided to call show_menu() // when the button is clicked. |text| will be shown on the MenuButton and used @@ -88,9 +89,10 @@ typedef struct _cef_menu_button_t { // will be added to the button. /// CEF_EXPORT cef_menu_button_t* cef_menu_button_create( - struct _cef_menu_button_delegate_t* delegate, const cef_string_t* text, - int with_frame, int with_menu_marker); - + struct _cef_menu_button_delegate_t* delegate, + const cef_string_t* text, + int with_frame, + int with_menu_marker); #ifdef __cplusplus } diff --git a/include/capi/views/cef_menu_button_delegate_capi.h b/include/capi/views/cef_menu_button_delegate_capi.h index e08580543..9ed823270 100644 --- a/include/capi/views/cef_menu_button_delegate_capi.h +++ b/include/capi/views/cef_menu_button_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=a2b3912f8188f19f3d5109aec1b1d03227e31429$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_ @@ -61,13 +63,12 @@ typedef struct _cef_menu_button_delegate_t { // Called when |button| is pressed. Call cef_menu_button_t::show_menu() to // show the resulting menu at |screen_point|. /// - void (CEF_CALLBACK *on_menu_button_pressed)( + void(CEF_CALLBACK* on_menu_button_pressed)( struct _cef_menu_button_delegate_t* self, struct _cef_menu_button_t* menu_button, const cef_point_t* screen_point); } cef_menu_button_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_panel_capi.h b/include/capi/views/cef_panel_capi.h index 342282318..e792a59d2 100644 --- a/include/capi/views/cef_panel_capi.h +++ b/include/capi/views/cef_panel_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=dd5ea19f73dcec3e4f229920f44c9de6599e4f36$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_ @@ -64,84 +66,84 @@ typedef struct _cef_panel_t { /// // Returns this Panel as a Window or NULL if this is not a Window. /// - struct _cef_window_t* (CEF_CALLBACK *as_window)(struct _cef_panel_t* self); + struct _cef_window_t*(CEF_CALLBACK* as_window)(struct _cef_panel_t* self); /// // Set this Panel's Layout to FillLayout and return the FillLayout object. /// - struct _cef_fill_layout_t* (CEF_CALLBACK *set_to_fill_layout)( + struct _cef_fill_layout_t*(CEF_CALLBACK* set_to_fill_layout)( struct _cef_panel_t* self); /// // Set this Panel's Layout to BoxLayout and return the BoxLayout object. /// - struct _cef_box_layout_t* (CEF_CALLBACK *set_to_box_layout)( + struct _cef_box_layout_t*(CEF_CALLBACK* set_to_box_layout)( struct _cef_panel_t* self, const struct _cef_box_layout_settings_t* settings); /// // Get the Layout. /// - struct _cef_layout_t* (CEF_CALLBACK *get_layout)(struct _cef_panel_t* self); + struct _cef_layout_t*(CEF_CALLBACK* get_layout)(struct _cef_panel_t* self); /// // Lay out the child Views (set their bounds based on sizing heuristics // specific to the current Layout). /// - void (CEF_CALLBACK *layout)(struct _cef_panel_t* self); + void(CEF_CALLBACK* layout)(struct _cef_panel_t* self); /// // Add a child View. /// - void (CEF_CALLBACK *add_child_view)(struct _cef_panel_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* add_child_view)(struct _cef_panel_t* self, + struct _cef_view_t* view); /// // Add a child View at the specified |index|. If |index| matches the result of // GetChildCount() then the View will be added at the end. /// - void (CEF_CALLBACK *add_child_view_at)(struct _cef_panel_t* self, - struct _cef_view_t* view, int index); + void(CEF_CALLBACK* add_child_view_at)(struct _cef_panel_t* self, + struct _cef_view_t* view, + int index); /// // Move the child View to the specified |index|. A negative value for |index| // will move the View to the end. /// - void (CEF_CALLBACK *reorder_child_view)(struct _cef_panel_t* self, - struct _cef_view_t* view, int index); + void(CEF_CALLBACK* reorder_child_view)(struct _cef_panel_t* self, + struct _cef_view_t* view, + int index); /// // Remove a child View. The View can then be added to another Panel. /// - void (CEF_CALLBACK *remove_child_view)(struct _cef_panel_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* remove_child_view)(struct _cef_panel_t* self, + struct _cef_view_t* view); /// // Remove all child Views. The removed Views will be deleted if the client // holds no references to them. /// - void (CEF_CALLBACK *remove_all_child_views)(struct _cef_panel_t* self); + void(CEF_CALLBACK* remove_all_child_views)(struct _cef_panel_t* self); /// // Returns the number of child Views. /// - size_t (CEF_CALLBACK *get_child_view_count)(struct _cef_panel_t* self); + size_t(CEF_CALLBACK* get_child_view_count)(struct _cef_panel_t* self); /// // Returns the child View at the specified |index|. /// - struct _cef_view_t* (CEF_CALLBACK *get_child_view_at)( - struct _cef_panel_t* self, int index); + struct _cef_view_t*( + CEF_CALLBACK* get_child_view_at)(struct _cef_panel_t* self, int index); } cef_panel_t; - /// // Create a new Panel. /// CEF_EXPORT cef_panel_t* cef_panel_create( struct _cef_panel_delegate_t* delegate); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_panel_delegate_capi.h b/include/capi/views/cef_panel_delegate_capi.h index e5065c98d..7e68907c2 100644 --- a/include/capi/views/cef_panel_delegate_capi.h +++ b/include/capi/views/cef_panel_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=c3aac051e19d368c3c7e415fcb160abb83060011$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // Implement this structure to handle Panel events. The functions of this // structure will be called on the browser process UI thread unless otherwise @@ -57,7 +58,6 @@ typedef struct _cef_panel_delegate_t { cef_view_delegate_t base; } cef_panel_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_scroll_view_capi.h b/include/capi/views/cef_scroll_view_capi.h index ba21cf038..7e23b09dc 100644 --- a/include/capi/views/cef_scroll_view_capi.h +++ b/include/capi/views/cef_scroll_view_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ec6ad7d358194b055c2c2b5bda3d6b9c6429185a$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_ @@ -44,7 +46,6 @@ extern "C" { #endif - /// // A ScrollView will show horizontal and/or vertical scrollbars when necessary // based on the size of the attached content view. Methods must be called on the @@ -60,52 +61,50 @@ typedef struct _cef_scroll_view_t { // Set the content View. The content View must have a specified size (e.g. via // cef_view_t::SetBounds or cef_view_tDelegate::GetPreferredSize). /// - void (CEF_CALLBACK *set_content_view)(struct _cef_scroll_view_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* set_content_view)(struct _cef_scroll_view_t* self, + struct _cef_view_t* view); /// // Returns the content View. /// - struct _cef_view_t* (CEF_CALLBACK *get_content_view)( + struct _cef_view_t*(CEF_CALLBACK* get_content_view)( struct _cef_scroll_view_t* self); /// // Returns the visible region of the content View. /// - cef_rect_t (CEF_CALLBACK *get_visible_content_rect)( + cef_rect_t(CEF_CALLBACK* get_visible_content_rect)( struct _cef_scroll_view_t* self); /// // Returns true (1) if the horizontal scrollbar is currently showing. /// - int (CEF_CALLBACK *has_horizontal_scrollbar)(struct _cef_scroll_view_t* self); + int(CEF_CALLBACK* has_horizontal_scrollbar)(struct _cef_scroll_view_t* self); /// // Returns the height of the horizontal scrollbar. /// - int (CEF_CALLBACK *get_horizontal_scrollbar_height)( + int(CEF_CALLBACK* get_horizontal_scrollbar_height)( struct _cef_scroll_view_t* self); /// // Returns true (1) if the vertical scrollbar is currently showing. /// - int (CEF_CALLBACK *has_vertical_scrollbar)(struct _cef_scroll_view_t* self); + int(CEF_CALLBACK* has_vertical_scrollbar)(struct _cef_scroll_view_t* self); /// // Returns the width of the vertical scrollbar. /// - int (CEF_CALLBACK *get_vertical_scrollbar_width)( + int(CEF_CALLBACK* get_vertical_scrollbar_width)( struct _cef_scroll_view_t* self); } cef_scroll_view_t; - /// // Create a new ScrollView. /// CEF_EXPORT cef_scroll_view_t* cef_scroll_view_create( struct _cef_view_delegate_t* delegate); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_textfield_capi.h b/include/capi/views/cef_textfield_capi.h index 1b6b0b6e8..e99dd4bf2 100644 --- a/include/capi/views/cef_textfield_capi.h +++ b/include/capi/views/cef_textfield_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=0dbd10f061bf4d63be22d050b93f5231fd7fb677$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_ @@ -45,7 +47,6 @@ extern "C" { #endif - /// // A Textfield supports editing of text. This control is custom rendered with no // platform-specific code. Methods must be called on the browser process UI @@ -60,60 +61,60 @@ typedef struct _cef_textfield_t { /// // Sets whether the text will be displayed as asterisks. /// - void (CEF_CALLBACK *set_password_input)(struct _cef_textfield_t* self, - int password_input); + void(CEF_CALLBACK* set_password_input)(struct _cef_textfield_t* self, + int password_input); /// // Returns true (1) if the text will be displayed as asterisks. /// - int (CEF_CALLBACK *is_password_input)(struct _cef_textfield_t* self); + int(CEF_CALLBACK* is_password_input)(struct _cef_textfield_t* self); /// // Sets whether the text will read-only. /// - void (CEF_CALLBACK *set_read_only)(struct _cef_textfield_t* self, - int read_only); + void(CEF_CALLBACK* set_read_only)(struct _cef_textfield_t* self, + int read_only); /// // Returns true (1) if the text is read-only. /// - int (CEF_CALLBACK *is_read_only)(struct _cef_textfield_t* self); + int(CEF_CALLBACK* is_read_only)(struct _cef_textfield_t* self); /// // Returns the currently displayed text. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_textfield_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_text)(struct _cef_textfield_t* self); /// // Sets the contents to |text|. The cursor will be moved to end of the text if // the current position is outside of the text range. /// - void (CEF_CALLBACK *set_text)(struct _cef_textfield_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* set_text)(struct _cef_textfield_t* self, + const cef_string_t* text); /// // Appends |text| to the previously-existing text. /// - void (CEF_CALLBACK *append_text)(struct _cef_textfield_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* append_text)(struct _cef_textfield_t* self, + const cef_string_t* text); /// // Inserts |text| at the current cursor position replacing any selected text. /// - void (CEF_CALLBACK *insert_or_replace_text)(struct _cef_textfield_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* insert_or_replace_text)(struct _cef_textfield_t* self, + const cef_string_t* text); /// // Returns true (1) if there is any selected text. /// - int (CEF_CALLBACK *has_selection)(struct _cef_textfield_t* self); + int(CEF_CALLBACK* has_selection)(struct _cef_textfield_t* self); /// // Returns the currently selected text. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_selected_text)( + cef_string_userfree_t(CEF_CALLBACK* get_selected_text)( struct _cef_textfield_t* self); /// @@ -121,62 +122,63 @@ typedef struct _cef_textfield_t { // logical beginning of the text; this generally shows the leading portion of // text that overflows its display area. /// - void (CEF_CALLBACK *select_all)(struct _cef_textfield_t* self, int reversed); + void(CEF_CALLBACK* select_all)(struct _cef_textfield_t* self, int reversed); /// // Clears the text selection and sets the caret to the end. /// - void (CEF_CALLBACK *clear_selection)(struct _cef_textfield_t* self); + void(CEF_CALLBACK* clear_selection)(struct _cef_textfield_t* self); /// // Returns the selected logical text range. /// - cef_range_t (CEF_CALLBACK *get_selected_range)(struct _cef_textfield_t* self); + cef_range_t(CEF_CALLBACK* get_selected_range)(struct _cef_textfield_t* self); /// // Selects the specified logical text range. /// - void (CEF_CALLBACK *select_range)(struct _cef_textfield_t* self, - const cef_range_t* range); + void(CEF_CALLBACK* select_range)(struct _cef_textfield_t* self, + const cef_range_t* range); /// // Returns the current cursor position. /// - size_t (CEF_CALLBACK *get_cursor_position)(struct _cef_textfield_t* self); + size_t(CEF_CALLBACK* get_cursor_position)(struct _cef_textfield_t* self); /// // Sets the text color. /// - void (CEF_CALLBACK *set_text_color)(struct _cef_textfield_t* self, - cef_color_t color); + void(CEF_CALLBACK* set_text_color)(struct _cef_textfield_t* self, + cef_color_t color); /// // Returns the text color. /// - cef_color_t (CEF_CALLBACK *get_text_color)(struct _cef_textfield_t* self); + cef_color_t(CEF_CALLBACK* get_text_color)(struct _cef_textfield_t* self); /// // Sets the selection text color. /// - void (CEF_CALLBACK *set_selection_text_color)(struct _cef_textfield_t* self, - cef_color_t color); + void(CEF_CALLBACK* set_selection_text_color)(struct _cef_textfield_t* self, + cef_color_t color); /// // Returns the selection text color. /// - cef_color_t (CEF_CALLBACK *get_selection_text_color)( + cef_color_t(CEF_CALLBACK* get_selection_text_color)( struct _cef_textfield_t* self); /// // Sets the selection background color. /// - void (CEF_CALLBACK *set_selection_background_color)( - struct _cef_textfield_t* self, cef_color_t color); + void(CEF_CALLBACK* set_selection_background_color)( + struct _cef_textfield_t* self, + cef_color_t color); /// // Returns the selection background color. /// - cef_color_t (CEF_CALLBACK *get_selection_background_color)( + cef_color_t(CEF_CALLBACK* get_selection_background_color)( struct _cef_textfield_t* self); /// @@ -189,16 +191,17 @@ typedef struct _cef_textfield_t { // Here are examples of valid font description strings: - "Arial, Helvetica, // Bold Italic 14px" - "Arial, 14px" /// - void (CEF_CALLBACK *set_font_list)(struct _cef_textfield_t* self, - const cef_string_t* font_list); + void(CEF_CALLBACK* set_font_list)(struct _cef_textfield_t* self, + const cef_string_t* font_list); /// // Applies |color| to the specified |range| without changing the default // color. If |range| is NULL the color will be set on the complete text // contents. /// - void (CEF_CALLBACK *apply_text_color)(struct _cef_textfield_t* self, - cef_color_t color, const cef_range_t* range); + void(CEF_CALLBACK* apply_text_color)(struct _cef_textfield_t* self, + cef_color_t color, + const cef_range_t* range); /// // Applies |style| to the specified |range| without changing the default @@ -206,15 +209,17 @@ typedef struct _cef_textfield_t { // will be removed. If |range| is NULL the style will be set on the complete // text contents. /// - void (CEF_CALLBACK *apply_text_style)(struct _cef_textfield_t* self, - cef_text_style_t style, int add, const cef_range_t* range); + void(CEF_CALLBACK* apply_text_style)(struct _cef_textfield_t* self, + cef_text_style_t style, + int add, + const cef_range_t* range); /// // Returns true (1) if the action associated with the specified command id is // enabled. See additional comments on execute_command(). /// - int (CEF_CALLBACK *is_command_enabled)(struct _cef_textfield_t* self, - int command_id); + int(CEF_CALLBACK* is_command_enabled)(struct _cef_textfield_t* self, + int command_id); /// // Performs the action associated with the specified command id. Valid values @@ -222,50 +227,48 @@ typedef struct _cef_textfield_t { // IDS_APP_PASTE, IDS_APP_DELETE, IDS_APP_SELECT_ALL, IDS_DELETE_* and // IDS_MOVE_*. See include/cef_pack_strings.h for definitions. /// - void (CEF_CALLBACK *execute_command)(struct _cef_textfield_t* self, - int command_id); + void(CEF_CALLBACK* execute_command)(struct _cef_textfield_t* self, + int command_id); /// // Clears Edit history. /// - void (CEF_CALLBACK *clear_edit_history)(struct _cef_textfield_t* self); + void(CEF_CALLBACK* clear_edit_history)(struct _cef_textfield_t* self); /// // Sets the placeholder text that will be displayed when the Textfield is // NULL. /// - void (CEF_CALLBACK *set_placeholder_text)(struct _cef_textfield_t* self, - const cef_string_t* text); + void(CEF_CALLBACK* set_placeholder_text)(struct _cef_textfield_t* self, + const cef_string_t* text); /// // Returns the placeholder text that will be displayed when the Textfield is // NULL. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_placeholder_text)( + cef_string_userfree_t(CEF_CALLBACK* get_placeholder_text)( struct _cef_textfield_t* self); /// // Sets the placeholder text color. /// - void (CEF_CALLBACK *set_placeholder_text_color)(struct _cef_textfield_t* self, - cef_color_t color); + void(CEF_CALLBACK* set_placeholder_text_color)(struct _cef_textfield_t* self, + cef_color_t color); /// // Set the accessible name that will be exposed to assistive technology (AT). /// - void (CEF_CALLBACK *set_accessible_name)(struct _cef_textfield_t* self, - const cef_string_t* name); + void(CEF_CALLBACK* set_accessible_name)(struct _cef_textfield_t* self, + const cef_string_t* name); } cef_textfield_t; - /// // Create a new Textfield. /// CEF_EXPORT cef_textfield_t* cef_textfield_create( struct _cef_textfield_delegate_t* delegate); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_textfield_delegate_capi.h b/include/capi/views/cef_textfield_delegate_capi.h index 60e0f3b37..17ce9fee3 100644 --- a/include/capi/views/cef_textfield_delegate_capi.h +++ b/include/capi/views/cef_textfield_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=542381be4ca1f8b31da984b8ba9a13696da3917c$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_ @@ -62,19 +64,18 @@ typedef struct _cef_textfield_delegate_t { // information about the keyboard event. Return true (1) if the keyboard event // was handled or false (0) otherwise for default handling. /// - int (CEF_CALLBACK *on_key_event)(struct _cef_textfield_delegate_t* self, - struct _cef_textfield_t* textfield, - const struct _cef_key_event_t* event); + int(CEF_CALLBACK* on_key_event)(struct _cef_textfield_delegate_t* self, + struct _cef_textfield_t* textfield, + const struct _cef_key_event_t* event); /// // Called after performing a user action that may change |textfield|. /// - void (CEF_CALLBACK *on_after_user_action)( + void(CEF_CALLBACK* on_after_user_action)( struct _cef_textfield_delegate_t* self, struct _cef_textfield_t* textfield); } cef_textfield_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_view_capi.h b/include/capi/views/cef_view_capi.h index e60b97533..c6496aeb4 100644 --- a/include/capi/views/cef_view_capi.h +++ b/include/capi/views/cef_view_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=de8c557cc87233b9d9caeccfaf426f14ee4b499a$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_ @@ -66,29 +68,29 @@ typedef struct _cef_view_t { /// // Returns this View as a BrowserView or NULL if this is not a BrowserView. /// - struct _cef_browser_view_t* (CEF_CALLBACK *as_browser_view)( + struct _cef_browser_view_t*(CEF_CALLBACK* as_browser_view)( struct _cef_view_t* self); /// // Returns this View as a Button or NULL if this is not a Button. /// - struct _cef_button_t* (CEF_CALLBACK *as_button)(struct _cef_view_t* self); + struct _cef_button_t*(CEF_CALLBACK* as_button)(struct _cef_view_t* self); /// // Returns this View as a Panel or NULL if this is not a Panel. /// - struct _cef_panel_t* (CEF_CALLBACK *as_panel)(struct _cef_view_t* self); + struct _cef_panel_t*(CEF_CALLBACK* as_panel)(struct _cef_view_t* self); /// // Returns this View as a ScrollView or NULL if this is not a ScrollView. /// - struct _cef_scroll_view_t* (CEF_CALLBACK *as_scroll_view)( + struct _cef_scroll_view_t*(CEF_CALLBACK* as_scroll_view)( struct _cef_view_t* self); /// // Returns this View as a Textfield or NULL if this is not a Textfield. /// - struct _cef_textfield_t* (CEF_CALLBACK *as_textfield)( + struct _cef_textfield_t*(CEF_CALLBACK* as_textfield)( struct _cef_view_t* self); /// @@ -96,7 +98,7 @@ typedef struct _cef_view_t { // purposes. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_type_string)( + cef_string_userfree_t(CEF_CALLBACK* get_type_string)( struct _cef_view_t* self); /// @@ -106,146 +108,146 @@ typedef struct _cef_view_t { // purposes. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *to_string)(struct _cef_view_t* self, - int include_children); + cef_string_userfree_t(CEF_CALLBACK* to_string)(struct _cef_view_t* self, + int include_children); /// // Returns true (1) if this View is valid. /// - int (CEF_CALLBACK *is_valid)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_valid)(struct _cef_view_t* self); /// // Returns true (1) if this View is currently attached to another View. A View // can only be attached to one View at a time. /// - int (CEF_CALLBACK *is_attached)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_attached)(struct _cef_view_t* self); /// // Returns true (1) if this View is the same as |that| View. /// - int (CEF_CALLBACK *is_same)(struct _cef_view_t* self, - struct _cef_view_t* that); + int(CEF_CALLBACK* is_same)(struct _cef_view_t* self, + struct _cef_view_t* that); /// // Returns the delegate associated with this View, if any. /// - struct _cef_view_delegate_t* (CEF_CALLBACK *get_delegate)( + struct _cef_view_delegate_t*(CEF_CALLBACK* get_delegate)( struct _cef_view_t* self); /// // Returns the top-level Window hosting this View, if any. /// - struct _cef_window_t* (CEF_CALLBACK *get_window)(struct _cef_view_t* self); + struct _cef_window_t*(CEF_CALLBACK* get_window)(struct _cef_view_t* self); /// // Returns the ID for this View. /// - int (CEF_CALLBACK *get_id)(struct _cef_view_t* self); + int(CEF_CALLBACK* get_id)(struct _cef_view_t* self); /// // Sets the ID for this View. ID should be unique within the subtree that you // intend to search for it. 0 is the default ID for views. /// - void (CEF_CALLBACK *set_id)(struct _cef_view_t* self, int id); + void(CEF_CALLBACK* set_id)(struct _cef_view_t* self, int id); /// // Returns the group id of this View, or -1 if not set. /// - int (CEF_CALLBACK *get_group_id)(struct _cef_view_t* self); + int(CEF_CALLBACK* get_group_id)(struct _cef_view_t* self); /// // A group id is used to tag Views which are part of the same logical group. // Focus can be moved between views with the same group using the arrow keys. // The group id is immutable once it's set. /// - void (CEF_CALLBACK *set_group_id)(struct _cef_view_t* self, int group_id); + void(CEF_CALLBACK* set_group_id)(struct _cef_view_t* self, int group_id); /// // Returns the View that contains this View, if any. /// - struct _cef_view_t* (CEF_CALLBACK *get_parent_view)(struct _cef_view_t* self); + struct _cef_view_t*(CEF_CALLBACK* get_parent_view)(struct _cef_view_t* self); /// // Recursively descends the view tree starting at this View, and returns the // first child that it encounters with the given ID. Returns NULL if no // matching child view is found. /// - struct _cef_view_t* (CEF_CALLBACK *get_view_for_id)(struct _cef_view_t* self, - int id); + struct _cef_view_t*(CEF_CALLBACK* get_view_for_id)(struct _cef_view_t* self, + int id); /// // Sets the bounds (size and position) of this View. Position is in parent // coordinates. /// - void (CEF_CALLBACK *set_bounds)(struct _cef_view_t* self, - const cef_rect_t* bounds); + void(CEF_CALLBACK* set_bounds)(struct _cef_view_t* self, + const cef_rect_t* bounds); /// // Returns the bounds (size and position) of this View. Position is in parent // coordinates. /// - cef_rect_t (CEF_CALLBACK *get_bounds)(struct _cef_view_t* self); + cef_rect_t(CEF_CALLBACK* get_bounds)(struct _cef_view_t* self); /// // Returns the bounds (size and position) of this View. Position is in screen // coordinates. /// - cef_rect_t (CEF_CALLBACK *get_bounds_in_screen)(struct _cef_view_t* self); + cef_rect_t(CEF_CALLBACK* get_bounds_in_screen)(struct _cef_view_t* self); /// // Sets the size of this View without changing the position. /// - void (CEF_CALLBACK *set_size)(struct _cef_view_t* self, - const cef_size_t* size); + void(CEF_CALLBACK* set_size)(struct _cef_view_t* self, + const cef_size_t* size); /// // Returns the size of this View. /// - cef_size_t (CEF_CALLBACK *get_size)(struct _cef_view_t* self); + cef_size_t(CEF_CALLBACK* get_size)(struct _cef_view_t* self); /// // Sets the position of this View without changing the size. |position| is in // parent coordinates. /// - void (CEF_CALLBACK *set_position)(struct _cef_view_t* self, - const cef_point_t* position); + void(CEF_CALLBACK* set_position)(struct _cef_view_t* self, + const cef_point_t* position); /// // Returns the position of this View. Position is in parent coordinates. /// - cef_point_t (CEF_CALLBACK *get_position)(struct _cef_view_t* self); + cef_point_t(CEF_CALLBACK* get_position)(struct _cef_view_t* self); /// // Returns the size this View would like to be if enough space is available. /// - cef_size_t (CEF_CALLBACK *get_preferred_size)(struct _cef_view_t* self); + cef_size_t(CEF_CALLBACK* get_preferred_size)(struct _cef_view_t* self); /// // Size this View to its preferred size. /// - void (CEF_CALLBACK *size_to_preferred_size)(struct _cef_view_t* self); + void(CEF_CALLBACK* size_to_preferred_size)(struct _cef_view_t* self); /// // Returns the minimum size for this View. /// - cef_size_t (CEF_CALLBACK *get_minimum_size)(struct _cef_view_t* self); + cef_size_t(CEF_CALLBACK* get_minimum_size)(struct _cef_view_t* self); /// // Returns the maximum size for this View. /// - cef_size_t (CEF_CALLBACK *get_maximum_size)(struct _cef_view_t* self); + cef_size_t(CEF_CALLBACK* get_maximum_size)(struct _cef_view_t* self); /// // Returns the height necessary to display this View with the provided width. /// - int (CEF_CALLBACK *get_height_for_width)(struct _cef_view_t* self, int width); + int(CEF_CALLBACK* get_height_for_width)(struct _cef_view_t* self, int width); /// // Indicate that this View and all parent Views require a re-layout. This // ensures the next call to layout() will propagate to this View even if the // bounds of parent Views do not change. /// - void (CEF_CALLBACK *invalidate_layout)(struct _cef_view_t* self); + void(CEF_CALLBACK* invalidate_layout)(struct _cef_view_t* self); /// // Sets whether this View is visible. Windows are hidden by default and other @@ -256,7 +258,7 @@ typedef struct _cef_view_t { // scheduled as needed. If this View is a Window then calling this function is // equivalent to calling the Window show() and hide() functions. /// - void (CEF_CALLBACK *set_visible)(struct _cef_view_t* self, int visible); + void(CEF_CALLBACK* set_visible)(struct _cef_view_t* self, int visible); /// // Returns whether this View is visible. A view may be visible but still not @@ -266,7 +268,7 @@ typedef struct _cef_view_t { // is_drawn() to determine whether this View and all parent views are visible // and will be drawn. /// - int (CEF_CALLBACK *is_visible)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_visible)(struct _cef_view_t* self); /// // Returns whether this View is visible and drawn in a Window. A view is drawn @@ -275,54 +277,54 @@ typedef struct _cef_view_t { // determine if the containing Window is visible to the user on-screen call // is_visible() on the Window. /// - int (CEF_CALLBACK *is_drawn)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_drawn)(struct _cef_view_t* self); /// // Set whether this View is enabled. A disabled View does not receive keyboard // or mouse inputs. If |enabled| differs from the current value the View will // be repainted. Also, clears focus if the focused View is disabled. /// - void (CEF_CALLBACK *set_enabled)(struct _cef_view_t* self, int enabled); + void(CEF_CALLBACK* set_enabled)(struct _cef_view_t* self, int enabled); /// // Returns whether this View is enabled. /// - int (CEF_CALLBACK *is_enabled)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_enabled)(struct _cef_view_t* self); /// // Sets whether this View is capable of taking focus. It will clear focus if // the focused View is set to be non-focusable. This is false (0) by default // so that a View used as a container does not get the focus. /// - void (CEF_CALLBACK *set_focusable)(struct _cef_view_t* self, int focusable); + void(CEF_CALLBACK* set_focusable)(struct _cef_view_t* self, int focusable); /// // Returns true (1) if this View is focusable, enabled and drawn. /// - int (CEF_CALLBACK *is_focusable)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_focusable)(struct _cef_view_t* self); /// // Return whether this View is focusable when the user requires full keyboard // access, even though it may not be normally focusable. /// - int (CEF_CALLBACK *is_accessibility_focusable)(struct _cef_view_t* self); + int(CEF_CALLBACK* is_accessibility_focusable)(struct _cef_view_t* self); /// // Request keyboard focus. If this View is focusable it will become the // focused View. /// - void (CEF_CALLBACK *request_focus)(struct _cef_view_t* self); + void(CEF_CALLBACK* request_focus)(struct _cef_view_t* self); /// // Sets the background color for this View. /// - void (CEF_CALLBACK *set_background_color)(struct _cef_view_t* self, - cef_color_t color); + void(CEF_CALLBACK* set_background_color)(struct _cef_view_t* self, + cef_color_t color); /// // Returns the background color for this View. /// - cef_color_t (CEF_CALLBACK *get_background_color)(struct _cef_view_t* self); + cef_color_t(CEF_CALLBACK* get_background_color)(struct _cef_view_t* self); /// // Convert |point| from this View's coordinate system to that of the screen. @@ -331,8 +333,8 @@ typedef struct _cef_view_t { // cef_display_t::convert_point_to_pixels() after calling this function if // further conversion to display-specific pixel coordinates is desired. /// - int (CEF_CALLBACK *convert_point_to_screen)(struct _cef_view_t* self, - cef_point_t* point); + int(CEF_CALLBACK* convert_point_to_screen)(struct _cef_view_t* self, + cef_point_t* point); /// // Convert |point| to this View's coordinate system from that of the screen. @@ -341,24 +343,24 @@ typedef struct _cef_view_t { // cef_display_t::convert_point_from_pixels() before calling this function if // conversion from display-specific pixel coordinates is necessary. /// - int (CEF_CALLBACK *convert_point_from_screen)(struct _cef_view_t* self, - cef_point_t* point); + int(CEF_CALLBACK* convert_point_from_screen)(struct _cef_view_t* self, + cef_point_t* point); /// // Convert |point| from this View's coordinate system to that of the Window. // This View must belong to a Window when calling this function. Returns true // (1) if the conversion is successful or false (0) otherwise. /// - int (CEF_CALLBACK *convert_point_to_window)(struct _cef_view_t* self, - cef_point_t* point); + int(CEF_CALLBACK* convert_point_to_window)(struct _cef_view_t* self, + cef_point_t* point); /// // Convert |point| to this View's coordinate system from that of the Window. // This View must belong to a Window when calling this function. Returns true // (1) if the conversion is successful or false (0) otherwise. /// - int (CEF_CALLBACK *convert_point_from_window)(struct _cef_view_t* self, - cef_point_t* point); + int(CEF_CALLBACK* convert_point_from_window)(struct _cef_view_t* self, + cef_point_t* point); /// // Convert |point| from this View's coordinate system to that of |view|. @@ -366,19 +368,20 @@ typedef struct _cef_view_t { // hierarchy. Returns true (1) if the conversion is successful or false (0) // otherwise. /// - int (CEF_CALLBACK *convert_point_to_view)(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point); + int(CEF_CALLBACK* convert_point_to_view)(struct _cef_view_t* self, + struct _cef_view_t* view, + cef_point_t* point); /// // Convert |point| to this View's coordinate system from that |view|. |view| // needs to be in the same Window but not necessarily the same view hierarchy. // Returns true (1) if the conversion is successful or false (0) otherwise. /// - int (CEF_CALLBACK *convert_point_from_view)(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point); + int(CEF_CALLBACK* convert_point_from_view)(struct _cef_view_t* self, + struct _cef_view_t* view, + cef_point_t* point); } cef_view_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_view_delegate_capi.h b/include/capi/views/cef_view_delegate_capi.h index 67725d545..4bcfdbbff 100644 --- a/include/capi/views/cef_view_delegate_capi.h +++ b/include/capi/views/cef_view_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=982ad223be14ddf50a61b3cf803330397349b661$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_ @@ -61,20 +63,21 @@ typedef struct _cef_view_delegate_t { // Return the preferred size for |view|. The Layout will use this information // to determine the display size. /// - cef_size_t (CEF_CALLBACK *get_preferred_size)( - struct _cef_view_delegate_t* self, struct _cef_view_t* view); + cef_size_t(CEF_CALLBACK* get_preferred_size)( + struct _cef_view_delegate_t* self, + struct _cef_view_t* view); /// // Return the minimum size for |view|. /// - cef_size_t (CEF_CALLBACK *get_minimum_size)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view); + cef_size_t(CEF_CALLBACK* get_minimum_size)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view); /// // Return the maximum size for |view|. /// - cef_size_t (CEF_CALLBACK *get_maximum_size)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view); + cef_size_t(CEF_CALLBACK* get_maximum_size)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view); /// // Return the height necessary to display |view| with the provided |width|. If @@ -82,8 +85,9 @@ typedef struct _cef_view_delegate_t { // default. Override if |view|'s preferred height depends upon the width (for // example, with Labels). /// - int (CEF_CALLBACK *get_height_for_width)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view, int width); + int(CEF_CALLBACK* get_height_for_width)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view, + int width); /// // Called when the parent of |view| has changed. If |view| is being added to @@ -92,8 +96,10 @@ typedef struct _cef_view_delegate_t { // remove notification will be sent before the add notification. Do not modify // the view hierarchy in this callback. /// - void (CEF_CALLBACK *on_parent_view_changed)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view, int added, struct _cef_view_t* parent); + void(CEF_CALLBACK* on_parent_view_changed)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view, + int added, + struct _cef_view_t* parent); /// // Called when a child of |view| has changed. If |child| is being added to @@ -103,23 +109,24 @@ typedef struct _cef_view_delegate_t { // notification is sent to the new parent. Do not modify the view hierarchy in // this callback. /// - void (CEF_CALLBACK *on_child_view_changed)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view, int added, struct _cef_view_t* child); + void(CEF_CALLBACK* on_child_view_changed)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view, + int added, + struct _cef_view_t* child); /// // Called when |view| gains focus. /// - void (CEF_CALLBACK *on_focus)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* on_focus)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view); /// // Called when |view| loses focus. /// - void (CEF_CALLBACK *on_blur)(struct _cef_view_delegate_t* self, - struct _cef_view_t* view); + void(CEF_CALLBACK* on_blur)(struct _cef_view_delegate_t* self, + struct _cef_view_t* view); } cef_view_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_window_capi.h b/include/capi/views/cef_window_capi.h index 80a2bab22..f025e02b8 100644 --- a/include/capi/views/cef_window_capi.h +++ b/include/capi/views/cef_window_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=ef258af57aea577693ce52d61b630ca29bdd5ea0$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_ @@ -48,7 +50,6 @@ extern "C" { #endif - /// // A Window is a top-level Window/widget in the Views hierarchy. By default it // will have a non-client area with title bar, icon and buttons that supports @@ -65,121 +66,120 @@ typedef struct _cef_window_t { /// // Show the Window. /// - void (CEF_CALLBACK *show)(struct _cef_window_t* self); + void(CEF_CALLBACK* show)(struct _cef_window_t* self); /// // Hide the Window. /// - void (CEF_CALLBACK *hide)(struct _cef_window_t* self); + void(CEF_CALLBACK* hide)(struct _cef_window_t* self); /// // Sizes the Window to |size| and centers it in the current display. /// - void (CEF_CALLBACK *center_window)(struct _cef_window_t* self, - const cef_size_t* size); + void(CEF_CALLBACK* center_window)(struct _cef_window_t* self, + const cef_size_t* size); /// // Close the Window. /// - void (CEF_CALLBACK *close)(struct _cef_window_t* self); + void(CEF_CALLBACK* close)(struct _cef_window_t* self); /// // Returns true (1) if the Window has been closed. /// - int (CEF_CALLBACK *is_closed)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_closed)(struct _cef_window_t* self); /// // Activate the Window, assuming it already exists and is visible. /// - void (CEF_CALLBACK *activate)(struct _cef_window_t* self); + void(CEF_CALLBACK* activate)(struct _cef_window_t* self); /// // Deactivate the Window, making the next Window in the Z order the active // Window. /// - void (CEF_CALLBACK *deactivate)(struct _cef_window_t* self); + void(CEF_CALLBACK* deactivate)(struct _cef_window_t* self); /// // Returns whether the Window is the currently active Window. /// - int (CEF_CALLBACK *is_active)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_active)(struct _cef_window_t* self); /// // Bring this Window to the top of other Windows in the Windowing system. /// - void (CEF_CALLBACK *bring_to_top)(struct _cef_window_t* self); + void(CEF_CALLBACK* bring_to_top)(struct _cef_window_t* self); /// // Set the Window to be on top of other Windows in the Windowing system. /// - void (CEF_CALLBACK *set_always_on_top)(struct _cef_window_t* self, - int on_top); + void(CEF_CALLBACK* set_always_on_top)(struct _cef_window_t* self, int on_top); /// // Returns whether the Window has been set to be on top of other Windows in // the Windowing system. /// - int (CEF_CALLBACK *is_always_on_top)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_always_on_top)(struct _cef_window_t* self); /// // Maximize the Window. /// - void (CEF_CALLBACK *maximize)(struct _cef_window_t* self); + void(CEF_CALLBACK* maximize)(struct _cef_window_t* self); /// // Minimize the Window. /// - void (CEF_CALLBACK *minimize)(struct _cef_window_t* self); + void(CEF_CALLBACK* minimize)(struct _cef_window_t* self); /// // Restore the Window. /// - void (CEF_CALLBACK *restore)(struct _cef_window_t* self); + void(CEF_CALLBACK* restore)(struct _cef_window_t* self); /// // Set fullscreen Window state. /// - void (CEF_CALLBACK *set_fullscreen)(struct _cef_window_t* self, - int fullscreen); + void(CEF_CALLBACK* set_fullscreen)(struct _cef_window_t* self, + int fullscreen); /// // Returns true (1) if the Window is maximized. /// - int (CEF_CALLBACK *is_maximized)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_maximized)(struct _cef_window_t* self); /// // Returns true (1) if the Window is minimized. /// - int (CEF_CALLBACK *is_minimized)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_minimized)(struct _cef_window_t* self); /// // Returns true (1) if the Window is fullscreen. /// - int (CEF_CALLBACK *is_fullscreen)(struct _cef_window_t* self); + int(CEF_CALLBACK* is_fullscreen)(struct _cef_window_t* self); /// // Set the Window title. /// - void (CEF_CALLBACK *set_title)(struct _cef_window_t* self, - const cef_string_t* title); + void(CEF_CALLBACK* set_title)(struct _cef_window_t* self, + const cef_string_t* title); /// // Get the Window title. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t (CEF_CALLBACK *get_title)(struct _cef_window_t* self); + cef_string_userfree_t(CEF_CALLBACK* get_title)(struct _cef_window_t* self); /// // Set the Window icon. This should be a 16x16 icon suitable for use in the // Windows's title bar. /// - void (CEF_CALLBACK *set_window_icon)(struct _cef_window_t* self, - struct _cef_image_t* image); + void(CEF_CALLBACK* set_window_icon)(struct _cef_window_t* self, + struct _cef_image_t* image); /// // Get the Window icon. /// - struct _cef_image_t* (CEF_CALLBACK *get_window_icon)( + struct _cef_image_t*(CEF_CALLBACK* get_window_icon)( struct _cef_window_t* self); /// @@ -188,13 +188,13 @@ typedef struct _cef_window_t { // Tab list and Windows taskbar. The Window icon will be used by default if no // Window App icon is specified. /// - void (CEF_CALLBACK *set_window_app_icon)(struct _cef_window_t* self, - struct _cef_image_t* image); + void(CEF_CALLBACK* set_window_app_icon)(struct _cef_window_t* self, + struct _cef_image_t* image); /// // Get the Window App icon. /// - struct _cef_image_t* (CEF_CALLBACK *get_window_app_icon)( + struct _cef_image_t*(CEF_CALLBACK* get_window_app_icon)( struct _cef_window_t* self); /// @@ -202,27 +202,27 @@ typedef struct _cef_window_t { // position in screen coordinates. |anchor_position| specifies how the menu // will be anchored relative to |screen_point|. /// - void (CEF_CALLBACK *show_menu)(struct _cef_window_t* self, - struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point, - cef_menu_anchor_position_t anchor_position); + void(CEF_CALLBACK* show_menu)(struct _cef_window_t* self, + struct _cef_menu_model_t* menu_model, + const cef_point_t* screen_point, + cef_menu_anchor_position_t anchor_position); /// // Cancel the menu that is currently showing, if any. /// - void (CEF_CALLBACK *cancel_menu)(struct _cef_window_t* self); + void(CEF_CALLBACK* cancel_menu)(struct _cef_window_t* self); /// // Returns the Display that most closely intersects the bounds of this Window. // May return NULL if this Window is not currently displayed. /// - struct _cef_display_t* (CEF_CALLBACK *get_display)( - struct _cef_window_t* self); + struct _cef_display_t*(CEF_CALLBACK* get_display)(struct _cef_window_t* self); /// // Returns the bounds (size and position) of this Window's client area. // Position is in screen coordinates. /// - cef_rect_t (CEF_CALLBACK *get_client_area_bounds_in_screen)( + cef_rect_t(CEF_CALLBACK* get_client_area_bounds_in_screen)( struct _cef_window_t* self); /// @@ -231,13 +231,15 @@ typedef struct _cef_window_t { // the draggable regions. The draggable region bounds should be in window // coordinates. /// - void (CEF_CALLBACK *set_draggable_regions)(struct _cef_window_t* self, - size_t regionsCount, cef_draggable_region_t const* regions); + void(CEF_CALLBACK* set_draggable_regions)( + struct _cef_window_t* self, + size_t regionsCount, + cef_draggable_region_t const* regions); /// // Retrieve the platform window handle for this Window. /// - cef_window_handle_t (CEF_CALLBACK *get_window_handle)( + cef_window_handle_t(CEF_CALLBACK* get_window_handle)( struct _cef_window_t* self); /// @@ -247,16 +249,18 @@ typedef struct _cef_window_t { // EVENTFLAG_CONTROL_DOWN and/or EVENTFLAG_ALT_DOWN. This function is exposed // primarily for testing purposes. /// - void (CEF_CALLBACK *send_key_press)(struct _cef_window_t* self, int key_code, - uint32 event_flags); + void(CEF_CALLBACK* send_key_press)(struct _cef_window_t* self, + int key_code, + uint32 event_flags); /// // Simulate a mouse move. The mouse cursor will be moved to the specified // (screen_x, screen_y) position. This function is exposed primarily for // testing purposes. /// - void (CEF_CALLBACK *send_mouse_move)(struct _cef_window_t* self, int screen_x, - int screen_y); + void(CEF_CALLBACK* send_mouse_move)(struct _cef_window_t* self, + int screen_x, + int screen_y); /// // Simulate mouse down and/or mouse up events. |button| is the mouse button @@ -267,8 +271,10 @@ typedef struct _cef_window_t { // cursor position so make sure to call send_mouse_move() first to position // the mouse. This function is exposed primarily for testing purposes. /// - void (CEF_CALLBACK *send_mouse_events)(struct _cef_window_t* self, - cef_mouse_button_type_t button, int mouse_down, int mouse_up); + void(CEF_CALLBACK* send_mouse_events)(struct _cef_window_t* self, + cef_mouse_button_type_t button, + int mouse_down, + int mouse_up); /// // Set the keyboard accelerator for the specified |command_id|. |key_code| can @@ -276,30 +282,31 @@ typedef struct _cef_window_t { // will be called if the keyboard combination is triggered while this window // has focus. /// - void (CEF_CALLBACK *set_accelerator)(struct _cef_window_t* self, - int command_id, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed); + void(CEF_CALLBACK* set_accelerator)(struct _cef_window_t* self, + int command_id, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed); /// // Remove the keyboard accelerator for the specified |command_id|. /// - void (CEF_CALLBACK *remove_accelerator)(struct _cef_window_t* self, - int command_id); + void(CEF_CALLBACK* remove_accelerator)(struct _cef_window_t* self, + int command_id); /// // Remove all keyboard accelerators. /// - void (CEF_CALLBACK *remove_all_accelerators)(struct _cef_window_t* self); + void(CEF_CALLBACK* remove_all_accelerators)(struct _cef_window_t* self); } cef_window_t; - /// // Create a new Window. /// CEF_EXPORT cef_window_t* cef_window_create_top_level( struct _cef_window_delegate_t* delegate); - #ifdef __cplusplus } #endif diff --git a/include/capi/views/cef_window_delegate_capi.h b/include/capi/views/cef_window_delegate_capi.h index 85489b875..a669d381f 100644 --- a/include/capi/views/cef_window_delegate_capi.h +++ b/include/capi/views/cef_window_delegate_capi.h @@ -33,6 +33,8 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // +// $hash=e4957abc4c3b80b9f324d74d2c8c6aa2632c52d9$ +// #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ #define CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ @@ -60,68 +62,69 @@ typedef struct _cef_window_delegate_t { /// // Called when |window| is created. /// - void (CEF_CALLBACK *on_window_created)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + void(CEF_CALLBACK* on_window_created)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Called when |window| is destroyed. Release all references to |window| and // do not attempt to execute any functions on |window| after this callback // returns. /// - void (CEF_CALLBACK *on_window_destroyed)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + void(CEF_CALLBACK* on_window_destroyed)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Return true (1) if |window| should be created without a frame or title bar. // The window will be resizable if can_resize() returns true (1). Use // cef_window_t::set_draggable_regions() to specify draggable regions. /// - int (CEF_CALLBACK *is_frameless)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + int(CEF_CALLBACK* is_frameless)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Return true (1) if |window| can be resized. /// - int (CEF_CALLBACK *can_resize)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + int(CEF_CALLBACK* can_resize)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Return true (1) if |window| can be maximized. /// - int (CEF_CALLBACK *can_maximize)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + int(CEF_CALLBACK* can_maximize)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Return true (1) if |window| can be minimized. /// - int (CEF_CALLBACK *can_minimize)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + int(CEF_CALLBACK* can_minimize)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Return true (1) if |window| can be closed. This will be called for user- // initiated window close actions and when cef_window_t::close() is called. /// - int (CEF_CALLBACK *can_close)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window); + int(CEF_CALLBACK* can_close)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window); /// // Called when a keyboard accelerator registered with // cef_window_t::SetAccelerator is triggered. Return true (1) if the // accelerator was handled or false (0) otherwise. /// - int (CEF_CALLBACK *on_accelerator)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window, int command_id); + int(CEF_CALLBACK* on_accelerator)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window, + int command_id); /// // Called after all other controls in the window have had a chance to handle // the event. |event| contains information about the keyboard event. Return // true (1) if the keyboard event was handled or false (0) otherwise. /// - int (CEF_CALLBACK *on_key_event)(struct _cef_window_delegate_t* self, - struct _cef_window_t* window, const struct _cef_key_event_t* event); + int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self, + struct _cef_window_t* window, + const struct _cef_key_event_t* event); } cef_window_delegate_t; - #ifdef __cplusplus } #endif diff --git a/include/cef_accessibility_handler.h b/include/cef_accessibility_handler.h index ecd336cac..c34e0c577 100644 --- a/include/cef_accessibility_handler.h +++ b/include/cef_accessibility_handler.h @@ -53,14 +53,14 @@ class CefAccessibilityHandler : public virtual CefBaseRefCounted { // browser process. /// /*--cef()--*/ - virtual void OnAccessibilityTreeChange(CefRefPtr value) =0; + virtual void OnAccessibilityTreeChange(CefRefPtr value) = 0; /// // Called after renderer process sends accessibility location changes to the // browser process. /// /*--cef()--*/ - virtual void OnAccessibilityLocationChange(CefRefPtr value) =0; + virtual void OnAccessibilityLocationChange(CefRefPtr value) = 0; }; #endif // CEF_INCLUDE_CEF_ACCESSIBILITY_HANDLER_H_ diff --git a/include/cef_app.h b/include/cef_app.h index 5aca29b30..3962a09c0 100644 --- a/include/cef_app.h +++ b/include/cef_app.h @@ -34,7 +34,6 @@ // tools directory for more information. // - #ifndef CEF_INCLUDE_CEF_APP_H_ #define CEF_INCLUDE_CEF_APP_H_ #pragma once @@ -159,8 +158,7 @@ class CefApp : public virtual CefBaseRefCounted { /*--cef(optional_param=process_type)--*/ virtual void OnBeforeCommandLineProcessing( const CefString& process_type, - CefRefPtr command_line) { - } + CefRefPtr command_line) {} /// // Provides an opportunity to register custom schemes. Do not keep a reference @@ -170,8 +168,7 @@ class CefApp : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void OnRegisterCustomSchemes( - CefRawPtr registrar) { - } + CefRawPtr registrar) {} /// // Return the handler for resource bundle events. If diff --git a/include/cef_application_mac.h b/include/cef_application_mac.h index 473e99727..503c536f2 100644 --- a/include/cef_application_mac.h +++ b/include/cef_application_mac.h @@ -87,14 +87,12 @@ class CefScopedSendingEvent { public: CefScopedSendingEvent() - : app_(static_cast*>( - [NSApplication sharedApplication])), - handling_([app_ isHandlingSendEvent]) { + : app_(static_cast*>( + [NSApplication sharedApplication])), + handling_([app_ isHandlingSendEvent]) { [app_ setHandlingSendEvent:YES]; } - ~CefScopedSendingEvent() { - [app_ setHandlingSendEvent:handling_]; - } + ~CefScopedSendingEvent() { [app_ setHandlingSendEvent:handling_]; } private: NSApplication* app_; diff --git a/include/cef_auth_callback.h b/include/cef_auth_callback.h index 09b04d4c4..1d88fda7b 100644 --- a/include/cef_auth_callback.h +++ b/include/cef_auth_callback.h @@ -52,13 +52,13 @@ class CefAuthCallback : public virtual CefBaseRefCounted { /// /*--cef(capi_name=cont,optional_param=password)--*/ virtual void Continue(const CefString& username, - const CefString& password) =0; + const CefString& password) = 0; /// // Cancel the authentication request. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; #endif // CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ diff --git a/include/cef_base.h b/include/cef_base.h index c152cf06d..816108e2a 100644 --- a/include/cef_base.h +++ b/include/cef_base.h @@ -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_CEF_BASE_H_ #define CEF_INCLUDE_CEF_BASE_H_ #pragma once @@ -56,18 +55,18 @@ class CefBaseRefCounted { // Called to increment the reference count for the object. Should be called // for every new copy of a pointer to a given object. /// - virtual void AddRef() const =0; + virtual void AddRef() const = 0; /// // Called to decrement the reference count for the object. Returns true if // the reference count is 0, in which case the object should self-delete. /// - virtual bool Release() const =0; + virtual bool Release() const = 0; /// // Returns true if the reference count is 1. /// - virtual bool HasOneRef() const =0; + virtual bool HasOneRef() const = 0; protected: virtual ~CefBaseRefCounted() {} @@ -91,23 +90,17 @@ class CefRefCount { /// // Increment the reference count. /// - void AddRef() const { - base::AtomicRefCountInc(&ref_count_); - } + void AddRef() const { base::AtomicRefCountInc(&ref_count_); } /// // Decrement the reference count. Returns true if the reference count is 0. /// - bool Release() const { - return !base::AtomicRefCountDec(&ref_count_); - } + bool Release() const { return !base::AtomicRefCountDec(&ref_count_); } /// // Returns true if the reference count is 1. /// - bool HasOneRef() const { - return base::AtomicRefCountIsOne(&ref_count_); - } + bool HasOneRef() const { return base::AtomicRefCountIsOne(&ref_count_); } private: mutable base::AtomicRefCount ref_count_; @@ -118,23 +111,20 @@ class CefRefCount { // Macro that provides a reference counting implementation for classes extending // CefBase. /// -#define IMPLEMENT_REFCOUNTING(ClassName) \ - public: \ - void AddRef() const OVERRIDE { \ - ref_count_.AddRef(); \ - } \ - bool Release() const OVERRIDE { \ - if (ref_count_.Release()) { \ - delete static_cast(this); \ - return true; \ - } \ - return false; \ - } \ - bool HasOneRef() const OVERRIDE { \ - return ref_count_.HasOneRef(); \ - } \ - private: \ - CefRefCount ref_count_; +#define IMPLEMENT_REFCOUNTING(ClassName) \ + public: \ + void AddRef() const OVERRIDE { ref_count_.AddRef(); } \ + bool Release() const OVERRIDE { \ + if (ref_count_.Release()) { \ + delete static_cast(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const OVERRIDE { return ref_count_.HasOneRef(); } \ + \ + private: \ + CefRefCount ref_count_; /// // Macro that provides a locking implementation. Use the Lock() and Unlock() @@ -169,19 +159,21 @@ class CefRefCount { // value_++; // } /// -#define IMPLEMENT_LOCKING(ClassName) \ - public: \ - class AutoLock { \ - public: \ - explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ - ~AutoLock() { base_->Unlock(); } \ - private: \ - ClassName* base_; \ - DISALLOW_COPY_AND_ASSIGN(AutoLock); \ - }; \ - void Lock() { lock_.Acquire(); } \ - void Unlock() { lock_.Release(); } \ - private: \ - base::Lock lock_; +#define IMPLEMENT_LOCKING(ClassName) \ + public: \ + class AutoLock { \ + public: \ + explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ + ~AutoLock() { base_->Unlock(); } \ + \ + private: \ + ClassName* base_; \ + DISALLOW_COPY_AND_ASSIGN(AutoLock); \ + }; \ + void Lock() { lock_.Acquire(); } \ + void Unlock() { lock_.Release(); } \ + \ + private: \ + base::Lock lock_; #endif // CEF_INCLUDE_CEF_BASE_H_ diff --git a/include/cef_browser.h b/include/cef_browser.h index 88f7b541d..3dbf97eb6 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -38,6 +38,7 @@ #define CEF_INCLUDE_CEF_BROWSER_H_ #pragma once +#include #include "include/cef_base.h" #include "include/cef_drag_data.h" #include "include/cef_frame.h" @@ -45,12 +46,10 @@ #include "include/cef_navigation_entry.h" #include "include/cef_process_message.h" #include "include/cef_request_context.h" -#include class CefBrowserHost; class CefClient; - /// // Class used to represent a browser window. When used in the browser process // the methods of this class may be called on any thread unless otherwise @@ -65,122 +64,122 @@ class CefBrowser : public virtual CefBaseRefCounted { // browser process. /// /*--cef()--*/ - virtual CefRefPtr GetHost() =0; + virtual CefRefPtr GetHost() = 0; /// // Returns true if the browser can navigate backwards. /// /*--cef()--*/ - virtual bool CanGoBack() =0; + virtual bool CanGoBack() = 0; /// // Navigate backwards. /// /*--cef()--*/ - virtual void GoBack() =0; + virtual void GoBack() = 0; /// // Returns true if the browser can navigate forwards. /// /*--cef()--*/ - virtual bool CanGoForward() =0; + virtual bool CanGoForward() = 0; /// // Navigate forwards. /// /*--cef()--*/ - virtual void GoForward() =0; + virtual void GoForward() = 0; /// // Returns true if the browser is currently loading. /// /*--cef()--*/ - virtual bool IsLoading() =0; + virtual bool IsLoading() = 0; /// // Reload the current page. /// /*--cef()--*/ - virtual void Reload() =0; + virtual void Reload() = 0; /// // Reload the current page ignoring any cached data. /// /*--cef()--*/ - virtual void ReloadIgnoreCache() =0; + virtual void ReloadIgnoreCache() = 0; /// // Stop loading the page. /// /*--cef()--*/ - virtual void StopLoad() =0; + virtual void StopLoad() = 0; /// // Returns the globally unique identifier for this browser. /// /*--cef()--*/ - virtual int GetIdentifier() =0; + virtual int GetIdentifier() = 0; /// // Returns true if this object is pointing to the same handle as |that| // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if the window is a popup window. /// /*--cef()--*/ - virtual bool IsPopup() =0; + virtual bool IsPopup() = 0; /// // Returns true if a document has been loaded in the browser. /// /*--cef()--*/ - virtual bool HasDocument() =0; + virtual bool HasDocument() = 0; /// // Returns the main (top-level) frame for the browser window. /// /*--cef()--*/ - virtual CefRefPtr GetMainFrame() =0; + virtual CefRefPtr GetMainFrame() = 0; /// // Returns the focused frame for the browser window. /// /*--cef()--*/ - virtual CefRefPtr GetFocusedFrame() =0; + virtual CefRefPtr GetFocusedFrame() = 0; /// // Returns the frame with the specified identifier, or NULL if not found. /// /*--cef(capi_name=get_frame_byident)--*/ - virtual CefRefPtr GetFrame(int64 identifier) =0; + virtual CefRefPtr GetFrame(int64 identifier) = 0; /// // Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ - virtual CefRefPtr GetFrame(const CefString& name) =0; + virtual CefRefPtr GetFrame(const CefString& name) = 0; /// // Returns the number of frames that currently exist. /// /*--cef()--*/ - virtual size_t GetFrameCount() =0; + virtual size_t GetFrameCount() = 0; /// // Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ - virtual void GetFrameIdentifiers(std::vector& identifiers) =0; + virtual void GetFrameIdentifiers(std::vector& identifiers) = 0; /// // Returns the names of all existing frames. /// /*--cef()--*/ - virtual void GetFrameNames(std::vector& names) =0; + virtual void GetFrameNames(std::vector& names) = 0; /// // Send a message to the specified |target_process|. Returns true if the @@ -188,10 +187,9 @@ class CefBrowser : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool SendProcessMessage(CefProcessId target_process, - CefRefPtr message) =0; + CefRefPtr message) = 0; }; - /// // Callback interface for CefBrowserHost::RunFileDialog. The methods of this // class will be called on the browser process UI thread. @@ -209,10 +207,9 @@ class CefRunFileDialogCallback : public virtual CefBaseRefCounted { /*--cef(index_param=selected_accept_filter,optional_param=file_paths)--*/ virtual void OnFileDialogDismissed( int selected_accept_filter, - const std::vector& file_paths) =0; + const std::vector& file_paths) = 0; }; - /// // Callback interface for CefBrowserHost::GetNavigationEntries. The methods of // this class will be called on the browser process UI thread. @@ -231,10 +228,9 @@ class CefNavigationEntryVisitor : public virtual CefBaseRefCounted { virtual bool Visit(CefRefPtr entry, bool current, int index, - int total) =0; + int total) = 0; }; - /// // Callback interface for CefBrowserHost::PrintToPDF. The methods of this class // will be called on the browser process UI thread. @@ -248,10 +244,9 @@ class CefPdfPrintCallback : public virtual CefBaseRefCounted { // successfully or false otherwise. /// /*--cef()--*/ - virtual void OnPdfPrintFinished(const CefString& path, bool ok) =0; + virtual void OnPdfPrintFinished(const CefString& path, bool ok) = 0; }; - /// // Callback interface for CefBrowserHost::DownloadImage. The methods of this // class will be called on the browser process UI thread. @@ -266,13 +261,11 @@ class CefDownloadImageCallback : public virtual CefBaseRefCounted { // multiple scale factors, or empty if the download failed. /// /*--cef(optional_param=image)--*/ - virtual void OnDownloadImageFinished( - const CefString& image_url, - int http_status_code, - CefRefPtr image) =0; + virtual void OnDownloadImageFinished(const CefString& image_url, + int http_status_code, + CefRefPtr image) = 0; }; - /// // Class used to represent the browser process aspects of a browser window. The // methods of this class can only be called in the browser process. They may be @@ -321,7 +314,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // Returns the hosted browser object. /// /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; + virtual CefRefPtr GetBrowser() = 0; /// // Request that the browser close. The JavaScript 'onbeforeunload' event will @@ -334,7 +327,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // information. /// /*--cef()--*/ - virtual void CloseBrowser(bool force_close) =0; + virtual void CloseBrowser(bool force_close) = 0; /// // Helper for closing a browser. Call this method from the top-level window @@ -345,13 +338,13 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // information. This method must be called on the browser process UI thread. /// /*--cef()--*/ - virtual bool TryCloseBrowser() =0; + virtual bool TryCloseBrowser() = 0; /// // Set whether the browser is focused. /// /*--cef()--*/ - virtual void SetFocus(bool focus) =0; + virtual void SetFocus(bool focus) = 0; /// // Retrieve the window handle for this browser. If this browser is wrapped in @@ -359,7 +352,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // thread and it will return the handle for the top-level native window. /// /*--cef()--*/ - virtual CefWindowHandle GetWindowHandle() =0; + virtual CefWindowHandle GetWindowHandle() = 0; /// // Retrieve the window handle of the browser that opened this browser. Will @@ -368,32 +361,32 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // of modal windows. /// /*--cef()--*/ - virtual CefWindowHandle GetOpenerWindowHandle() =0; + virtual CefWindowHandle GetOpenerWindowHandle() = 0; /// // Returns true if this browser is wrapped in a CefBrowserView. /// /*--cef()--*/ - virtual bool HasView() =0; + virtual bool HasView() = 0; /// // Returns the client for this browser. /// /*--cef()--*/ - virtual CefRefPtr GetClient() =0; + virtual CefRefPtr GetClient() = 0; /// // Returns the request context for this browser. /// /*--cef()--*/ - virtual CefRefPtr GetRequestContext() =0; + virtual CefRefPtr GetRequestContext() = 0; /// // Get the current zoom level. The default zoom level is 0.0. This method can // only be called on the UI thread. /// /*--cef()--*/ - virtual double GetZoomLevel() =0; + virtual double GetZoomLevel() = 0; /// // Change the zoom level to the specified value. Specify 0.0 to reset the @@ -402,7 +395,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // UI thread. /// /*--cef()--*/ - virtual void SetZoomLevel(double zoomLevel) =0; + virtual void SetZoomLevel(double zoomLevel) = 0; /// // Call to run a file chooser dialog. Only a single file chooser dialog may be @@ -427,13 +420,13 @@ class CefBrowserHost : public virtual CefBaseRefCounted { const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Download the file at |url| using CefDownloadHandler. /// /*--cef()--*/ - virtual void StartDownload(const CefString& url) =0; + virtual void StartDownload(const CefString& url) = 0; /// // Download |image_url| and execute |callback| on completion with the images @@ -452,13 +445,13 @@ class CefBrowserHost : public virtual CefBaseRefCounted { bool is_favicon, uint32 max_image_size, bool bypass_cache, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Print the current browser contents. /// /*--cef()--*/ - virtual void Print() =0; + virtual void Print() = 0; /// // Print the current browser contents to the PDF file specified by |path| and @@ -469,7 +462,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /*--cef(optional_param=callback)--*/ virtual void PrintToPDF(const CefString& path, const CefPdfPrintSettings& settings, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Search for |searchText|. |identifier| must be a unique ID and these IDs @@ -483,14 +476,17 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // report find results. /// /*--cef()--*/ - virtual void Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) =0; + virtual void Find(int identifier, + const CefString& searchText, + bool forward, + bool matchCase, + bool findNext) = 0; /// // Cancel all searches that are currently going on. /// /*--cef()--*/ - virtual void StopFinding(bool clearSelection) =0; + virtual void StopFinding(bool clearSelection) = 0; /// // Open developer tools (DevTools) in its own browser. The DevTools browser @@ -506,20 +502,20 @@ class CefBrowserHost : public virtual CefBaseRefCounted { virtual void ShowDevTools(const CefWindowInfo& windowInfo, CefRefPtr client, const CefBrowserSettings& settings, - const CefPoint& inspect_element_at) =0; + const CefPoint& inspect_element_at) = 0; /// // Explicitly close the associated DevTools browser, if any. /// /*--cef()--*/ - virtual void CloseDevTools() =0; + virtual void CloseDevTools() = 0; /// // Returns true if this browser currently has an associated DevTools browser. // Must be called on the browser process UI thread. /// /*--cef()--*/ - virtual bool HasDevTools() =0; + virtual bool HasDevTools() = 0; /// // Retrieve a snapshot of current navigation entries as values sent to the @@ -529,38 +525,38 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void GetNavigationEntries( CefRefPtr visitor, - bool current_only) =0; + bool current_only) = 0; /// // Set whether mouse cursor change is disabled. /// /*--cef()--*/ - virtual void SetMouseCursorChangeDisabled(bool disabled) =0; + virtual void SetMouseCursorChangeDisabled(bool disabled) = 0; /// // Returns true if mouse cursor change is disabled. /// /*--cef()--*/ - virtual bool IsMouseCursorChangeDisabled() =0; + virtual bool IsMouseCursorChangeDisabled() = 0; /// // If a misspelled word is currently selected in an editable node calling // this method will replace it with the specified |word|. /// /*--cef()--*/ - virtual void ReplaceMisspelling(const CefString& word) =0; + virtual void ReplaceMisspelling(const CefString& word) = 0; /// // Add the specified |word| to the spelling dictionary. /// /*--cef()--*/ - virtual void AddWordToDictionary(const CefString& word) =0; + virtual void AddWordToDictionary(const CefString& word) = 0; /// // Returns true if window rendering is disabled. /// /*--cef()--*/ - virtual bool IsWindowRenderingDisabled() =0; + virtual bool IsWindowRenderingDisabled() = 0; /// // Notify the browser that the widget has been resized. The browser will first @@ -569,7 +565,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void WasResized() =0; + virtual void WasResized() = 0; /// // Notify the browser that it has been hidden or shown. Layouting and @@ -577,7 +573,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // hidden. This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void WasHidden(bool hidden) =0; + virtual void WasHidden(bool hidden) = 0; /// // Send a notification to the browser that the screen info has changed. The @@ -588,7 +584,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // disabled. /// /*--cef()--*/ - virtual void NotifyScreenInfoChanged() =0; + virtual void NotifyScreenInfoChanged() = 0; /// // Invalidate the view. The browser will call CefRenderHandler::OnPaint @@ -596,13 +592,13 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // disabled. /// /*--cef()--*/ - virtual void Invalidate(PaintElementType type) =0; + virtual void Invalidate(PaintElementType type) = 0; /// // Send a key event to the browser. /// /*--cef()--*/ - virtual void SendKeyEvent(const CefKeyEvent& event) =0; + virtual void SendKeyEvent(const CefKeyEvent& event) = 0; /// // Send a mouse click event to the browser. The |x| and |y| coordinates are @@ -611,7 +607,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void SendMouseClickEvent(const CefMouseEvent& event, MouseButtonType type, - bool mouseUp, int clickCount) =0; + bool mouseUp, + int clickCount) = 0; /// // Send a mouse move event to the browser. The |x| and |y| coordinates are @@ -619,7 +616,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void SendMouseMoveEvent(const CefMouseEvent& event, - bool mouseLeave) =0; + bool mouseLeave) = 0; /// // Send a mouse wheel event to the browser. The |x| and |y| coordinates are @@ -630,26 +627,27 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void SendMouseWheelEvent(const CefMouseEvent& event, - int deltaX, int deltaY) =0; + int deltaX, + int deltaY) = 0; /// // Send a focus event to the browser. /// /*--cef()--*/ - virtual void SendFocusEvent(bool setFocus) =0; + virtual void SendFocusEvent(bool setFocus) = 0; /// // Send a capture lost event to the browser. /// /*--cef()--*/ - virtual void SendCaptureLostEvent() =0; + virtual void SendCaptureLostEvent() = 0; /// // Notify the browser that the window hosting it is about to be moved or // resized. This method is only used on Windows and Linux. /// /*--cef()--*/ - virtual void NotifyMoveOrResizeStarted() =0; + virtual void NotifyMoveOrResizeStarted() = 0; /// // Returns the maximum rate in frames per second (fps) that CefRenderHandler:: @@ -659,7 +657,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // can only be called on the UI thread. /// /*--cef()--*/ - virtual int GetWindowlessFrameRate() =0; + virtual int GetWindowlessFrameRate() = 0; /// // Set the maximum rate in frames per second (fps) that CefRenderHandler:: @@ -669,7 +667,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // set at browser creation via CefBrowserSettings.windowless_frame_rate. /// /*--cef()--*/ - virtual void SetWindowlessFrameRate(int frame_rate) =0; + virtual void SetWindowlessFrameRate(int frame_rate) = 0; /// // Begins a new composition or updates the existing composition. Blink has a @@ -699,7 +697,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { const CefString& text, const std::vector& underlines, const CefRange& replacement_range, - const CefRange& selection_range) =0; + const CefRange& selection_range) = 0; /// // Completes the existing composition by optionally inserting the specified @@ -713,7 +711,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /*--cef(optional_param=text)--*/ virtual void ImeCommitText(const CefString& text, const CefRange& replacement_range, - int relative_cursor_pos) =0; + int relative_cursor_pos) = 0; /// // Completes the existing composition by applying the current composition node @@ -722,7 +720,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void ImeFinishComposingText(bool keep_selection) =0; + virtual void ImeFinishComposingText(bool keep_selection) = 0; /// // Cancels the existing composition and discards the composition node @@ -731,7 +729,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void ImeCancelComposition() =0; + virtual void ImeCancelComposition() = 0; /// // Call this method when the user drags the mouse into the web view (before @@ -744,8 +742,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void DragTargetDragEnter(CefRefPtr drag_data, - const CefMouseEvent& event, - DragOperationsMask allowed_ops) =0; + const CefMouseEvent& event, + DragOperationsMask allowed_ops) = 0; /// // Call this method each time the mouse is moved across the web view during @@ -755,7 +753,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void DragTargetDragOver(const CefMouseEvent& event, - DragOperationsMask allowed_ops) =0; + DragOperationsMask allowed_ops) = 0; /// // Call this method when the user drags the mouse out of the web view (after @@ -763,7 +761,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void DragTargetDragLeave() =0; + virtual void DragTargetDragLeave() = 0; /// // Call this method when the user completes the drag operation by dropping @@ -773,7 +771,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void DragTargetDrop(const CefMouseEvent& event) =0; + virtual void DragTargetDrop(const CefMouseEvent& event) = 0; /// // Call this method when the drag operation started by a @@ -785,7 +783,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) =0; + virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) = 0; /// // Call this method when the drag operation started by a @@ -797,14 +795,14 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // This method is only used when window rendering is disabled. /// /*--cef()--*/ - virtual void DragSourceSystemDragEnded() =0; + virtual void DragSourceSystemDragEnded() = 0; /// // Returns the current visible navigation entry for this browser. This method // can only be called on the UI thread. /// /*--cef()--*/ - virtual CefRefPtr GetVisibleNavigationEntry() =0; + virtual CefRefPtr GetVisibleNavigationEntry() = 0; /// // Set accessibility state for all frames. |accessibility_state| may be @@ -833,7 +831,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { // objects using CefAccessibiltyHandler callbacks if desired. /// /*--cef()--*/ - virtual void SetAccessibilityState(cef_state_t accessibility_state) =0; + virtual void SetAccessibilityState(cef_state_t accessibility_state) = 0; }; #endif // CEF_INCLUDE_CEF_BROWSER_H_ diff --git a/include/cef_browser_process_handler.h b/include/cef_browser_process_handler.h index e65503fbd..fb770997b 100644 --- a/include/cef_browser_process_handler.h +++ b/include/cef_browser_process_handler.h @@ -84,9 +84,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted { // provided then printing will not be supported on the Linux platform. /// /*--cef()--*/ - virtual CefRefPtr GetPrintHandler() { - return NULL; - } + virtual CefRefPtr GetPrintHandler() { return NULL; } /// // Called from any thread when work has been scheduled for the browser process diff --git a/include/cef_callback.h b/include/cef_callback.h index 5be51e941..e206cb976 100644 --- a/include/cef_callback.h +++ b/include/cef_callback.h @@ -50,13 +50,13 @@ class CefCallback : public virtual CefBaseRefCounted { // Continue processing. /// /*--cef(capi_name=cont)--*/ - virtual void Continue() =0; + virtual void Continue() = 0; /// // Cancel processing. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; /// @@ -69,7 +69,7 @@ class CefCompletionCallback : public virtual CefBaseRefCounted { // Method that will be called once the task is complete. /// /*--cef()--*/ - virtual void OnComplete() =0; + virtual void OnComplete() = 0; }; #endif // CEF_INCLUDE_CEF_CALLBACK_H_ diff --git a/include/cef_client.h b/include/cef_client.h index 9421c7c08..a365491c5 100644 --- a/include/cef_client.h +++ b/include/cef_client.h @@ -75,50 +75,38 @@ class CefClient : public virtual CefBaseRefCounted { // implementation will be used. /// /*--cef()--*/ - virtual CefRefPtr GetDialogHandler() { - return NULL; - } + virtual CefRefPtr GetDialogHandler() { return NULL; } /// // Return the handler for browser display state events. /// /*--cef()--*/ - virtual CefRefPtr GetDisplayHandler() { - return NULL; - } + virtual CefRefPtr GetDisplayHandler() { return NULL; } /// // Return the handler for download events. If no handler is returned downloads // will not be allowed. /// /*--cef()--*/ - virtual CefRefPtr GetDownloadHandler() { - return NULL; - } + virtual CefRefPtr GetDownloadHandler() { return NULL; } /// // Return the handler for drag events. /// /*--cef()--*/ - virtual CefRefPtr GetDragHandler() { - return NULL; - } + virtual CefRefPtr GetDragHandler() { return NULL; } /// // Return the handler for find result events. /// /*--cef()--*/ - virtual CefRefPtr GetFindHandler() { - return NULL; - } + virtual CefRefPtr GetFindHandler() { return NULL; } /// // Return the handler for focus events. /// /*--cef()--*/ - virtual CefRefPtr GetFocusHandler() { - return NULL; - } + virtual CefRefPtr GetFocusHandler() { return NULL; } /// // Return the handler for geolocation permissions requests. If no handler is @@ -134,49 +122,37 @@ class CefClient : public virtual CefBaseRefCounted { // default implementation will be used. /// /*--cef()--*/ - virtual CefRefPtr GetJSDialogHandler() { - return NULL; - } + virtual CefRefPtr GetJSDialogHandler() { return NULL; } /// // Return the handler for keyboard events. /// /*--cef()--*/ - virtual CefRefPtr GetKeyboardHandler() { - return NULL; - } + virtual CefRefPtr GetKeyboardHandler() { return NULL; } /// // Return the handler for browser life span events. /// /*--cef()--*/ - virtual CefRefPtr GetLifeSpanHandler() { - return NULL; - } + virtual CefRefPtr GetLifeSpanHandler() { return NULL; } /// // Return the handler for browser load status events. /// /*--cef()--*/ - virtual CefRefPtr GetLoadHandler() { - return NULL; - } + virtual CefRefPtr GetLoadHandler() { return NULL; } /// // Return the handler for off-screen rendering events. /// /*--cef()--*/ - virtual CefRefPtr GetRenderHandler() { - return NULL; - } + virtual CefRefPtr GetRenderHandler() { return NULL; } /// // Return the handler for browser request events. /// /*--cef()--*/ - virtual CefRefPtr GetRequestHandler() { - return NULL; - } + virtual CefRefPtr GetRequestHandler() { return NULL; } /// // Called when a new message is received from a different process. Return true diff --git a/include/cef_command_line.h b/include/cef_command_line.h index 5e581b6e0..dd5491cd2 100644 --- a/include/cef_command_line.h +++ b/include/cef_command_line.h @@ -38,9 +38,9 @@ #define CEF_INCLUDE_CEF_COMMAND_LINE_H_ #pragma once -#include "include/cef_base.h" #include #include +#include "include/cef_base.h" /// // Class used to create and/or parse command line arguments. Arguments with @@ -76,20 +76,20 @@ class CefCommandLine : public virtual CefBaseRefCounted { // function returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if the values of this object are read-only. Some APIs may // expose read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns a writable copy of this object. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Initialize the command line with the specified |argc| and |argv| values. @@ -97,112 +97,112 @@ class CefCommandLine : public virtual CefBaseRefCounted { // supported on non-Windows platforms. /// /*--cef()--*/ - virtual void InitFromArgv(int argc, const char* const* argv) =0; + virtual void InitFromArgv(int argc, const char* const* argv) = 0; /// // Initialize the command line with the string returned by calling // GetCommandLineW(). This method is only supported on Windows. /// /*--cef()--*/ - virtual void InitFromString(const CefString& command_line) =0; + virtual void InitFromString(const CefString& command_line) = 0; /// // Reset the command-line switches and arguments but leave the program // component unchanged. /// /*--cef()--*/ - virtual void Reset() =0; + virtual void Reset() = 0; /// // Retrieve the original command line string as a vector of strings. // The argv array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } /// /*--cef()--*/ - virtual void GetArgv(std::vector& argv) =0; + virtual void GetArgv(std::vector& argv) = 0; /// // Constructs and returns the represented command line string. Use this method // cautiously because quoting behavior is unclear. /// /*--cef()--*/ - virtual CefString GetCommandLineString() =0; + virtual CefString GetCommandLineString() = 0; /// // Get the program part of the command line string (the first item). /// /*--cef()--*/ - virtual CefString GetProgram() =0; + virtual CefString GetProgram() = 0; /// // Set the program part of the command line string (the first item). /// /*--cef()--*/ - virtual void SetProgram(const CefString& program) =0; + virtual void SetProgram(const CefString& program) = 0; /// // Returns true if the command line has switches. /// /*--cef()--*/ - virtual bool HasSwitches() =0; + virtual bool HasSwitches() = 0; /// // Returns true if the command line contains the given switch. /// /*--cef()--*/ - virtual bool HasSwitch(const CefString& name) =0; + virtual bool HasSwitch(const CefString& name) = 0; /// // Returns the value associated with the given switch. If the switch has no // value or isn't present this method returns the empty string. /// /*--cef()--*/ - virtual CefString GetSwitchValue(const CefString& name) =0; + virtual CefString GetSwitchValue(const CefString& name) = 0; /// // Returns the map of switch names and values. If a switch has no value an // empty string is returned. /// /*--cef()--*/ - virtual void GetSwitches(SwitchMap& switches) =0; + virtual void GetSwitches(SwitchMap& switches) = 0; /// // Add a switch to the end of the command line. If the switch has no value // pass an empty value string. /// /*--cef()--*/ - virtual void AppendSwitch(const CefString& name) =0; + virtual void AppendSwitch(const CefString& name) = 0; /// // Add a switch with the specified value to the end of the command line. /// /*--cef()--*/ virtual void AppendSwitchWithValue(const CefString& name, - const CefString& value) =0; + const CefString& value) = 0; /// // True if there are remaining command line arguments. /// /*--cef()--*/ - virtual bool HasArguments() =0; + virtual bool HasArguments() = 0; /// // Get the remaining command line arguments. /// /*--cef()--*/ - virtual void GetArguments(ArgumentList& arguments) =0; + virtual void GetArguments(ArgumentList& arguments) = 0; /// // Add an argument to the end of the command line. /// /*--cef()--*/ - virtual void AppendArgument(const CefString& argument) =0; + virtual void AppendArgument(const CefString& argument) = 0; /// // Insert a command before the current command. // Common for debuggers, like "valgrind" or "gdb --args". /// /*--cef()--*/ - virtual void PrependWrapper(const CefString& wrapper) =0; + virtual void PrependWrapper(const CefString& wrapper) = 0; }; #endif // CEF_INCLUDE_CEF_COMMAND_LINE_H_ diff --git a/include/cef_context_menu_handler.h b/include/cef_context_menu_handler.h index 7619b8ed0..2a2a73e61 100644 --- a/include/cef_context_menu_handler.h +++ b/include/cef_context_menu_handler.h @@ -45,7 +45,6 @@ class CefContextMenuParams; - /// // Callback interface used for continuation of custom context menu display. /// @@ -59,16 +58,15 @@ class CefRunContextMenuCallback : public virtual CefBaseRefCounted { // |event_flags|. /// /*--cef(capi_name=cont)--*/ - virtual void Continue(int command_id, EventFlags event_flags) =0; + virtual void Continue(int command_id, EventFlags event_flags) = 0; /// // Cancel context menu display. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; - /// // Implement this interface to handle context menu events. The methods of this // class will be called on the UI thread. @@ -122,7 +120,9 @@ class CefContextMenuHandler : public virtual CefBaseRefCounted { CefRefPtr frame, CefRefPtr params, int command_id, - EventFlags event_flags) { return false; } + EventFlags event_flags) { + return false; + } /// // Called when the context menu is dismissed irregardless of whether the menu @@ -133,7 +133,6 @@ class CefContextMenuHandler : public virtual CefBaseRefCounted { CefRefPtr frame) {} }; - /// // Provides information about the context menu state. The ethods of this class // can only be accessed on browser process the UI thread. @@ -151,49 +150,49 @@ class CefContextMenuParams : public virtual CefBaseRefCounted { // Coords are relative to the associated RenderView's origin. /// /*--cef()--*/ - virtual int GetXCoord() =0; + virtual int GetXCoord() = 0; /// // Returns the Y coordinate of the mouse where the context menu was invoked. // Coords are relative to the associated RenderView's origin. /// /*--cef()--*/ - virtual int GetYCoord() =0; + virtual int GetYCoord() = 0; /// // Returns flags representing the type of node that the context menu was // invoked on. /// /*--cef(default_retval=CM_TYPEFLAG_NONE)--*/ - virtual TypeFlags GetTypeFlags() =0; + virtual TypeFlags GetTypeFlags() = 0; /// // Returns the URL of the link, if any, that encloses the node that the // context menu was invoked on. /// /*--cef()--*/ - virtual CefString GetLinkUrl() =0; + virtual CefString GetLinkUrl() = 0; /// // Returns the link URL, if any, to be used ONLY for "copy link address". We // don't validate this field in the frontend process. /// /*--cef()--*/ - virtual CefString GetUnfilteredLinkUrl() =0; + virtual CefString GetUnfilteredLinkUrl() = 0; /// // Returns the source URL, if any, for the element that the context menu was // invoked on. Example of elements with source URLs are img, audio, and video. /// /*--cef()--*/ - virtual CefString GetSourceUrl() =0; + virtual CefString GetSourceUrl() = 0; /// // Returns true if the context menu was invoked on an image which has // non-empty contents. /// /*--cef()--*/ - virtual bool HasImageContents() =0; + virtual bool HasImageContents() = 0; /// // Returns the title text or the alt text if the context menu was invoked on @@ -206,87 +205,88 @@ class CefContextMenuParams : public virtual CefBaseRefCounted { // Returns the URL of the top level page that the context menu was invoked on. /// /*--cef()--*/ - virtual CefString GetPageUrl() =0; + virtual CefString GetPageUrl() = 0; /// // Returns the URL of the subframe that the context menu was invoked on. /// /*--cef()--*/ - virtual CefString GetFrameUrl() =0; + virtual CefString GetFrameUrl() = 0; /// // Returns the character encoding of the subframe that the context menu was // invoked on. /// /*--cef()--*/ - virtual CefString GetFrameCharset() =0; + virtual CefString GetFrameCharset() = 0; /// // Returns the type of context node that the context menu was invoked on. /// /*--cef(default_retval=CM_MEDIATYPE_NONE)--*/ - virtual MediaType GetMediaType() =0; + virtual MediaType GetMediaType() = 0; /// // Returns flags representing the actions supported by the media element, if // any, that the context menu was invoked on. /// /*--cef(default_retval=CM_MEDIAFLAG_NONE)--*/ - virtual MediaStateFlags GetMediaStateFlags() =0; + virtual MediaStateFlags GetMediaStateFlags() = 0; /// // Returns the text of the selection, if any, that the context menu was // invoked on. /// /*--cef()--*/ - virtual CefString GetSelectionText() =0; + virtual CefString GetSelectionText() = 0; /// // Returns the text of the misspelled word, if any, that the context menu was // invoked on. /// /*--cef()--*/ - virtual CefString GetMisspelledWord() =0; + virtual CefString GetMisspelledWord() = 0; /// // Returns true if suggestions exist, false otherwise. Fills in |suggestions| // from the spell check service for the misspelled word if there is one. /// /*--cef()--*/ - virtual bool GetDictionarySuggestions(std::vector& suggestions) =0; + virtual bool GetDictionarySuggestions( + std::vector& suggestions) = 0; /// // Returns true if the context menu was invoked on an editable node. /// /*--cef()--*/ - virtual bool IsEditable() =0; + virtual bool IsEditable() = 0; /// // Returns true if the context menu was invoked on an editable node where // spell-check is enabled. /// /*--cef()--*/ - virtual bool IsSpellCheckEnabled() =0; + virtual bool IsSpellCheckEnabled() = 0; /// // Returns flags representing the actions supported by the editable node, if // any, that the context menu was invoked on. /// /*--cef(default_retval=CM_EDITFLAG_NONE)--*/ - virtual EditStateFlags GetEditStateFlags() =0; + virtual EditStateFlags GetEditStateFlags() = 0; /// // Returns true if the context menu contains items specified by the renderer // process (for example, plugin placeholder or pepper plugin menu items). /// /*--cef()--*/ - virtual bool IsCustomMenu() =0; + virtual bool IsCustomMenu() = 0; /// // Returns true if the context menu was invoked from a pepper plugin. /// /*--cef()--*/ - virtual bool IsPepperMenu() =0; + virtual bool IsPepperMenu() = 0; }; #endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ diff --git a/include/cef_cookie.h b/include/cef_cookie.h index 28f056d8a..111c15de5 100644 --- a/include/cef_cookie.h +++ b/include/cef_cookie.h @@ -38,9 +38,9 @@ #define CEF_INCLUDE_CEF_COOKIE_H_ #pragma once +#include #include "include/cef_base.h" #include "include/cef_callback.h" -#include class CefCookieVisitor; class CefSetCookieCallback; @@ -88,7 +88,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { /*--cef(optional_param=callback)--*/ virtual void SetSupportedSchemes( const std::vector& schemes, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Visit all cookies on the IO thread. The returned cookies are ordered by @@ -96,7 +96,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { // cannot be accessed. /// /*--cef()--*/ - virtual bool VisitAllCookies(CefRefPtr visitor) =0; + virtual bool VisitAllCookies(CefRefPtr visitor) = 0; /// // Visit a subset of cookies on the IO thread. The results are filtered by the @@ -108,7 +108,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) =0; + CefRefPtr visitor) = 0; /// // Sets a cookie given a valid URL and explicit user-provided cookie @@ -122,7 +122,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { /*--cef(optional_param=callback)--*/ virtual bool SetCookie(const CefString& url, const CefCookie& cookie, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Delete all cookies that match the specified parameters. If both |url| and @@ -139,7 +139,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { optional_param=callback)--*/ virtual bool DeleteCookies(const CefString& url, const CefString& cookie_name, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Sets the directory path that will be used for storing cookie data. If @@ -154,7 +154,7 @@ class CefCookieManager : public virtual CefBaseRefCounted { /*--cef(optional_param=path,optional_param=callback)--*/ virtual bool SetStoragePath(const CefString& path, bool persist_session_cookies, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Flush the backing store (if any) to disk. If |callback| is non-NULL it will @@ -162,10 +162,9 @@ class CefCookieManager : public virtual CefBaseRefCounted { // Returns false if cookies cannot be accessed. /// /*--cef(optional_param=callback)--*/ - virtual bool FlushStore(CefRefPtr callback) =0; + virtual bool FlushStore(CefRefPtr callback) = 0; }; - /// // Interface to implement for visiting cookie values. The methods of this class // will always be called on the IO thread. @@ -181,11 +180,12 @@ class CefCookieVisitor : public virtual CefBaseRefCounted { // no cookies are found. /// /*--cef()--*/ - virtual bool Visit(const CefCookie& cookie, int count, int total, - bool& deleteCookie) =0; + virtual bool Visit(const CefCookie& cookie, + int count, + int total, + bool& deleteCookie) = 0; }; - /// // Interface to implement to be notified of asynchronous completion via // CefCookieManager::SetCookie(). @@ -198,10 +198,9 @@ class CefSetCookieCallback : public virtual CefBaseRefCounted { // cookie was set successfully. /// /*--cef()--*/ - virtual void OnComplete(bool success) =0; + virtual void OnComplete(bool success) = 0; }; - /// // Interface to implement to be notified of asynchronous completion via // CefCookieManager::DeleteCookies(). @@ -214,7 +213,7 @@ class CefDeleteCookiesCallback : public virtual CefBaseRefCounted { // number of cookies that were deleted or -1 if unknown. /// /*--cef()--*/ - virtual void OnComplete(int num_deleted) =0; + virtual void OnComplete(int num_deleted) = 0; }; #endif // CEF_INCLUDE_CEF_COOKIE_H_ diff --git a/include/cef_dialog_handler.h b/include/cef_dialog_handler.h index 3ca98fb51..3ce02e6c1 100644 --- a/include/cef_dialog_handler.h +++ b/include/cef_dialog_handler.h @@ -57,16 +57,15 @@ class CefFileDialogCallback : public virtual CefBaseRefCounted { /*--cef(capi_name=cont,index_param=selected_accept_filter, optional_param=file_paths)--*/ virtual void Continue(int selected_accept_filter, - const std::vector& file_paths) =0; + const std::vector& file_paths) = 0; /// // Cancel the file selection. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; - /// // Implement this interface to handle dialog events. The methods of this class // will be called on the browser process UI thread. diff --git a/include/cef_display_handler.h b/include/cef_display_handler.h index 6147cc799..1e96b95b4 100644 --- a/include/cef_display_handler.h +++ b/include/cef_display_handler.h @@ -91,8 +91,9 @@ class CefDisplayHandler : public virtual CefBaseRefCounted { // drawing tooltips and the return value is ignored. /// /*--cef(optional_param=text)--*/ - virtual bool OnTooltip(CefRefPtr browser, - CefString& text) { return false; } + virtual bool OnTooltip(CefRefPtr browser, CefString& text) { + return false; + } /// // Called when the browser receives a status message. |value| contains the @@ -110,7 +111,9 @@ class CefDisplayHandler : public virtual CefBaseRefCounted { virtual bool OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, - int line) { return false; } + int line) { + return false; + } }; #endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ diff --git a/include/cef_dom.h b/include/cef_dom.h index f653a074f..382b19305 100644 --- a/include/cef_dom.h +++ b/include/cef_dom.h @@ -38,8 +38,8 @@ #define CEF_INCLUDE_CEF_DOM_H_ #pragma once -#include "include/cef_base.h" #include +#include "include/cef_base.h" class CefDOMDocument; class CefDOMNode; @@ -59,10 +59,9 @@ class CefDOMVisitor : public virtual CefBaseRefCounted { // of this method. /// /*--cef()--*/ - virtual void Visit(CefRefPtr document) =0; + virtual void Visit(CefRefPtr document) = 0; }; - /// // Class used to represent a DOM document. The methods of this class should only // be called on the render process main thread thread. @@ -76,89 +75,88 @@ class CefDOMDocument : public virtual CefBaseRefCounted { // Returns the document type. /// /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ - virtual Type GetType() =0; + virtual Type GetType() = 0; /// // Returns the root document node. /// /*--cef()--*/ - virtual CefRefPtr GetDocument() =0; + virtual CefRefPtr GetDocument() = 0; /// // Returns the BODY node of an HTML document. /// /*--cef()--*/ - virtual CefRefPtr GetBody() =0; + virtual CefRefPtr GetBody() = 0; /// // Returns the HEAD node of an HTML document. /// /*--cef()--*/ - virtual CefRefPtr GetHead() =0; + virtual CefRefPtr GetHead() = 0; /// // Returns the title of an HTML document. /// /*--cef()--*/ - virtual CefString GetTitle() =0; + virtual CefString GetTitle() = 0; /// // Returns the document element with the specified ID value. /// /*--cef()--*/ - virtual CefRefPtr GetElementById(const CefString& id) =0; + virtual CefRefPtr GetElementById(const CefString& id) = 0; /// // Returns the node that currently has keyboard focus. /// /*--cef()--*/ - virtual CefRefPtr GetFocusedNode() =0; + virtual CefRefPtr GetFocusedNode() = 0; /// // Returns true if a portion of the document is selected. /// /*--cef()--*/ - virtual bool HasSelection() =0; + virtual bool HasSelection() = 0; /// // Returns the selection offset within the start node. /// /*--cef()--*/ - virtual int GetSelectionStartOffset() =0; + virtual int GetSelectionStartOffset() = 0; /// // Returns the selection offset within the end node. /// /*--cef()--*/ - virtual int GetSelectionEndOffset() =0; + virtual int GetSelectionEndOffset() = 0; /// // Returns the contents of this selection as markup. /// /*--cef()--*/ - virtual CefString GetSelectionAsMarkup() =0; + virtual CefString GetSelectionAsMarkup() = 0; /// // Returns the contents of this selection as text. /// /*--cef()--*/ - virtual CefString GetSelectionAsText() =0; + virtual CefString GetSelectionAsText() = 0; /// // Returns the base URL for the document. /// /*--cef()--*/ - virtual CefString GetBaseURL() =0; + virtual CefString GetBaseURL() = 0; /// // Returns a complete URL based on the document base URL and the specified // partial URL. /// /*--cef()--*/ - virtual CefString GetCompleteURL(const CefString& partialURL) =0; + virtual CefString GetCompleteURL(const CefString& partialURL) = 0; }; - /// // Class used to represent a DOM node. The methods of this class should only be // called on the render process main thread. @@ -173,110 +171,110 @@ class CefDOMNode : public virtual CefBaseRefCounted { // Returns the type for this node. /// /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ - virtual Type GetType() =0; + virtual Type GetType() = 0; /// // Returns true if this is a text node. /// /*--cef()--*/ - virtual bool IsText() =0; + virtual bool IsText() = 0; /// // Returns true if this is an element node. /// /*--cef()--*/ - virtual bool IsElement() =0; + virtual bool IsElement() = 0; /// // Returns true if this is an editable node. /// /*--cef()--*/ - virtual bool IsEditable() =0; + virtual bool IsEditable() = 0; /// // Returns true if this is a form control element node. /// /*--cef()--*/ - virtual bool IsFormControlElement() =0; + virtual bool IsFormControlElement() = 0; /// // Returns the type of this form control element node. /// /*--cef()--*/ - virtual CefString GetFormControlElementType() =0; + virtual CefString GetFormControlElementType() = 0; /// // Returns true if this object is pointing to the same handle as |that| // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns the name of this node. /// /*--cef()--*/ - virtual CefString GetName() =0; + virtual CefString GetName() = 0; /// // Returns the value of this node. /// /*--cef()--*/ - virtual CefString GetValue() =0; + virtual CefString GetValue() = 0; /// // Set the value of this node. Returns true on success. /// /*--cef()--*/ - virtual bool SetValue(const CefString& value) =0; + virtual bool SetValue(const CefString& value) = 0; /// // Returns the contents of this node as markup. /// /*--cef()--*/ - virtual CefString GetAsMarkup() =0; + virtual CefString GetAsMarkup() = 0; /// // Returns the document associated with this node. /// /*--cef()--*/ - virtual CefRefPtr GetDocument() =0; + virtual CefRefPtr GetDocument() = 0; /// // Returns the parent node. /// /*--cef()--*/ - virtual CefRefPtr GetParent() =0; + virtual CefRefPtr GetParent() = 0; /// // Returns the previous sibling node. /// /*--cef()--*/ - virtual CefRefPtr GetPreviousSibling() =0; + virtual CefRefPtr GetPreviousSibling() = 0; /// // Returns the next sibling node. /// /*--cef()--*/ - virtual CefRefPtr GetNextSibling() =0; + virtual CefRefPtr GetNextSibling() = 0; /// // Returns true if this node has child nodes. /// /*--cef()--*/ - virtual bool HasChildren() =0; + virtual bool HasChildren() = 0; /// // Return the first child node. /// /*--cef()--*/ - virtual CefRefPtr GetFirstChild() =0; + virtual CefRefPtr GetFirstChild() = 0; /// // Returns the last child node. /// /*--cef()--*/ - virtual CefRefPtr GetLastChild() =0; + virtual CefRefPtr GetLastChild() = 0; // The following methods are valid only for element nodes. @@ -284,31 +282,31 @@ class CefDOMNode : public virtual CefBaseRefCounted { // Returns the tag name of this element. /// /*--cef()--*/ - virtual CefString GetElementTagName() =0; + virtual CefString GetElementTagName() = 0; /// // Returns true if this element has attributes. /// /*--cef()--*/ - virtual bool HasElementAttributes() =0; + virtual bool HasElementAttributes() = 0; /// // Returns true if this element has an attribute named |attrName|. /// /*--cef()--*/ - virtual bool HasElementAttribute(const CefString& attrName) =0; + virtual bool HasElementAttribute(const CefString& attrName) = 0; /// // Returns the element attribute named |attrName|. /// /*--cef()--*/ - virtual CefString GetElementAttribute(const CefString& attrName) =0; + virtual CefString GetElementAttribute(const CefString& attrName) = 0; /// // Returns a map of all element attributes. /// /*--cef()--*/ - virtual void GetElementAttributes(AttributeMap& attrMap) =0; + virtual void GetElementAttributes(AttributeMap& attrMap) = 0; /// // Set the value for the element attribute named |attrName|. Returns true on @@ -316,19 +314,19 @@ class CefDOMNode : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetElementAttribute(const CefString& attrName, - const CefString& value) =0; + const CefString& value) = 0; /// // Returns the inner text of the element. /// /*--cef()--*/ - virtual CefString GetElementInnerText() =0; + virtual CefString GetElementInnerText() = 0; /// // Returns the bounds of the element. /// /*--cef()--*/ - virtual CefRect GetElementBounds() =0; + virtual CefRect GetElementBounds() = 0; }; #endif // CEF_INCLUDE_CEF_DOM_H_ diff --git a/include/cef_download_handler.h b/include/cef_download_handler.h index b32c248e5..dfaeba500 100644 --- a/include/cef_download_handler.h +++ b/include/cef_download_handler.h @@ -42,7 +42,6 @@ #include "include/cef_browser.h" #include "include/cef_download_item.h" - /// // Callback interface used to asynchronously continue a download. /// @@ -56,10 +55,9 @@ class CefBeforeDownloadCallback : public virtual CefBaseRefCounted { // if you do wish to show the default "Save As" dialog. /// /*--cef(capi_name=cont,optional_param=download_path)--*/ - virtual void Continue(const CefString& download_path, bool show_dialog) =0; + virtual void Continue(const CefString& download_path, bool show_dialog) = 0; }; - /// // Callback interface used to asynchronously cancel a download. /// @@ -70,22 +68,21 @@ class CefDownloadItemCallback : public virtual CefBaseRefCounted { // Call to cancel the download. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; /// // Call to pause the download. /// /*--cef()--*/ - virtual void Pause() =0; + virtual void Pause() = 0; /// // Call to resume the download. /// /*--cef()--*/ - virtual void Resume() =0; + virtual void Resume() = 0; }; - /// // Class used to handle file downloads. The methods of this class will called // on the browser process UI thread. @@ -105,7 +102,7 @@ class CefDownloadHandler : public virtual CefBaseRefCounted { CefRefPtr browser, CefRefPtr download_item, const CefString& suggested_name, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Called when a download's status or progress information has been updated. @@ -115,10 +112,9 @@ class CefDownloadHandler : public virtual CefBaseRefCounted { // this method. /// /*--cef()--*/ - virtual void OnDownloadUpdated( - CefRefPtr browser, - CefRefPtr download_item, - CefRefPtr callback) {} + virtual void OnDownloadUpdated(CefRefPtr browser, + CefRefPtr download_item, + CefRefPtr callback) {} }; #endif // CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ diff --git a/include/cef_download_item.h b/include/cef_download_item.h index b0ea797ff..930f53bb4 100644 --- a/include/cef_download_item.h +++ b/include/cef_download_item.h @@ -51,104 +51,104 @@ class CefDownloadItem : public virtual CefBaseRefCounted { // function returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if the download is in progress. /// /*--cef()--*/ - virtual bool IsInProgress() =0; + virtual bool IsInProgress() = 0; /// // Returns true if the download is complete. /// /*--cef()--*/ - virtual bool IsComplete() =0; + virtual bool IsComplete() = 0; /// // Returns true if the download has been canceled or interrupted. /// /*--cef()--*/ - virtual bool IsCanceled() =0; + virtual bool IsCanceled() = 0; /// // Returns a simple speed estimate in bytes/s. /// /*--cef()--*/ - virtual int64 GetCurrentSpeed() =0; + virtual int64 GetCurrentSpeed() = 0; /// // Returns the rough percent complete or -1 if the receive total size is // unknown. /// /*--cef()--*/ - virtual int GetPercentComplete() =0; + virtual int GetPercentComplete() = 0; /// // Returns the total number of bytes. /// /*--cef()--*/ - virtual int64 GetTotalBytes() =0; + virtual int64 GetTotalBytes() = 0; /// // Returns the number of received bytes. /// /*--cef()--*/ - virtual int64 GetReceivedBytes() =0; + virtual int64 GetReceivedBytes() = 0; /// // Returns the time that the download started. /// /*--cef()--*/ - virtual CefTime GetStartTime() =0; + virtual CefTime GetStartTime() = 0; /// // Returns the time that the download ended. /// /*--cef()--*/ - virtual CefTime GetEndTime() =0; + virtual CefTime GetEndTime() = 0; /// // Returns the full path to the downloaded or downloading file. /// /*--cef()--*/ - virtual CefString GetFullPath() =0; + virtual CefString GetFullPath() = 0; /// // Returns the unique identifier for this download. /// /*--cef()--*/ - virtual uint32 GetId() =0; + virtual uint32 GetId() = 0; /// // Returns the URL. /// /*--cef()--*/ - virtual CefString GetURL() =0; + virtual CefString GetURL() = 0; /// // Returns the original URL before any redirections. /// /*--cef()--*/ - virtual CefString GetOriginalUrl() =0; + virtual CefString GetOriginalUrl() = 0; /// // Returns the suggested file name. /// /*--cef()--*/ - virtual CefString GetSuggestedFileName() =0; + virtual CefString GetSuggestedFileName() = 0; /// // Returns the content disposition. /// /*--cef()--*/ - virtual CefString GetContentDisposition() =0; + virtual CefString GetContentDisposition() = 0; /// // Returns the mime type. /// /*--cef()--*/ - virtual CefString GetMimeType() =0; + virtual CefString GetMimeType() = 0; }; #endif // CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ diff --git a/include/cef_drag_data.h b/include/cef_drag_data.h index 23644dad9..35661f870 100644 --- a/include/cef_drag_data.h +++ b/include/cef_drag_data.h @@ -38,10 +38,10 @@ #define CEF_INCLUDE_CEF_DRAG_DATA_H_ #pragma once +#include #include "include/cef_base.h" #include "include/cef_image.h" #include "include/cef_stream.h" -#include /// // Class used to represent drag data. The methods of this class may be called @@ -60,74 +60,74 @@ class CefDragData : public virtual CefBaseRefCounted { // Returns a copy of the current object. /// /*--cef()--*/ - virtual CefRefPtr Clone() =0; + virtual CefRefPtr Clone() = 0; /// // Returns true if this object is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns true if the drag data is a link. /// /*--cef()--*/ - virtual bool IsLink() =0; + virtual bool IsLink() = 0; /// // Returns true if the drag data is a text or html fragment. /// /*--cef()--*/ - virtual bool IsFragment() =0; + virtual bool IsFragment() = 0; /// // Returns true if the drag data is a file. /// /*--cef()--*/ - virtual bool IsFile() =0; + virtual bool IsFile() = 0; /// // Return the link URL that is being dragged. /// /*--cef()--*/ - virtual CefString GetLinkURL() =0; + virtual CefString GetLinkURL() = 0; /// // Return the title associated with the link being dragged. /// /*--cef()--*/ - virtual CefString GetLinkTitle() =0; + virtual CefString GetLinkTitle() = 0; /// // Return the metadata, if any, associated with the link being dragged. /// /*--cef()--*/ - virtual CefString GetLinkMetadata() =0; + virtual CefString GetLinkMetadata() = 0; /// // Return the plain text fragment that is being dragged. /// /*--cef()--*/ - virtual CefString GetFragmentText() =0; + virtual CefString GetFragmentText() = 0; /// // Return the text/html fragment that is being dragged. /// /*--cef()--*/ - virtual CefString GetFragmentHtml() =0; + virtual CefString GetFragmentHtml() = 0; /// // Return the base URL that the fragment came from. This value is used for // resolving relative URLs and may be empty. /// /*--cef()--*/ - virtual CefString GetFragmentBaseURL() =0; + virtual CefString GetFragmentBaseURL() = 0; /// // Return the name of the file being dragged out of the browser window. /// /*--cef()--*/ - virtual CefString GetFileName() =0; + virtual CefString GetFileName() = 0; /// // Write the contents of the file being dragged out of the web view into @@ -136,50 +136,50 @@ class CefDragData : public virtual CefBaseRefCounted { // Call GetFileName() to get a suggested name for the file. /// /*--cef(optional_param=writer)--*/ - virtual size_t GetFileContents(CefRefPtr writer) =0; + virtual size_t GetFileContents(CefRefPtr writer) = 0; /// // Retrieve the list of file names that are being dragged into the browser // window. /// /*--cef()--*/ - virtual bool GetFileNames(std::vector& names) =0; + virtual bool GetFileNames(std::vector& names) = 0; /// // Set the link URL that is being dragged. /// /*--cef(optional_param=url)--*/ - virtual void SetLinkURL(const CefString& url) =0; + virtual void SetLinkURL(const CefString& url) = 0; /// // Set the title associated with the link being dragged. /// /*--cef(optional_param=title)--*/ - virtual void SetLinkTitle(const CefString& title) =0; + virtual void SetLinkTitle(const CefString& title) = 0; /// // Set the metadata associated with the link being dragged. /// /*--cef(optional_param=data)--*/ - virtual void SetLinkMetadata(const CefString& data) =0; + virtual void SetLinkMetadata(const CefString& data) = 0; /// // Set the plain text fragment that is being dragged. /// /*--cef(optional_param=text)--*/ - virtual void SetFragmentText(const CefString& text) =0; + virtual void SetFragmentText(const CefString& text) = 0; /// // Set the text/html fragment that is being dragged. /// /*--cef(optional_param=html)--*/ - virtual void SetFragmentHtml(const CefString& html) =0; + virtual void SetFragmentHtml(const CefString& html) = 0; /// // Set the base URL that the fragment came from. /// /*--cef(optional_param=base_url)--*/ - virtual void SetFragmentBaseURL(const CefString& base_url) =0; + virtual void SetFragmentBaseURL(const CefString& base_url) = 0; /// // Reset the file contents. You should do this before calling @@ -187,32 +187,33 @@ class CefDragData : public virtual CefBaseRefCounted { // drag in this kind of data. /// /*--cef()--*/ - virtual void ResetFileContents() =0; + virtual void ResetFileContents() = 0; /// // Add a file that is being dragged into the webview. /// /*--cef(optional_param=display_name)--*/ - virtual void AddFile(const CefString& path, const CefString& display_name) =0; + virtual void AddFile(const CefString& path, + const CefString& display_name) = 0; /// // Get the image representation of drag data. May return NULL if no image // representation is available. /// /*--cef()--*/ - virtual CefRefPtr GetImage() =0; + virtual CefRefPtr GetImage() = 0; /// // Get the image hotspot (drag start location relative to image dimensions). /// /*--cef()--*/ - virtual CefPoint GetImageHotspot() =0; + virtual CefPoint GetImageHotspot() = 0; /// // Returns true if an image representation of drag data is available. /// /*--cef()--*/ - virtual bool HasImage() =0; + virtual bool HasImage() = 0; }; #endif // CEF_INCLUDE_CEF_DRAG_DATA_H_ diff --git a/include/cef_drag_handler.h b/include/cef_drag_handler.h index aee013668..0410c0d8d 100644 --- a/include/cef_drag_handler.h +++ b/include/cef_drag_handler.h @@ -39,8 +39,8 @@ #pragma once #include "include/cef_base.h" -#include "include/cef_drag_data.h" #include "include/cef_browser.h" +#include "include/cef_drag_data.h" /// // Implement this interface to handle events related to dragging. The methods of @@ -60,7 +60,9 @@ class CefDragHandler : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool OnDragEnter(CefRefPtr browser, CefRefPtr dragData, - DragOperationsMask mask) { return false; } + DragOperationsMask mask) { + return false; + } /// // Called whenever draggable regions for the browser window change. These can diff --git a/include/cef_focus_handler.h b/include/cef_focus_handler.h index 27352fa2b..6fd44f5d1 100644 --- a/include/cef_focus_handler.h +++ b/include/cef_focus_handler.h @@ -59,8 +59,7 @@ class CefFocusHandler : public virtual CefBaseRefCounted { // if the browser is giving focus to the previous component. /// /*--cef()--*/ - virtual void OnTakeFocus(CefRefPtr browser, - bool next) {} + virtual void OnTakeFocus(CefRefPtr browser, bool next) {} /// // Called when the browser component is requesting focus. |source| indicates @@ -68,8 +67,9 @@ class CefFocusHandler : public virtual CefBaseRefCounted { // focus to be set or true to cancel setting the focus. /// /*--cef()--*/ - virtual bool OnSetFocus(CefRefPtr browser, - FocusSource source) { return false; } + virtual bool OnSetFocus(CefRefPtr browser, FocusSource source) { + return false; + } /// // Called when the browser component has received focus. diff --git a/include/cef_frame.h b/include/cef_frame.h index bcf680d63..47f5888b8 100644 --- a/include/cef_frame.h +++ b/include/cef_frame.h @@ -60,49 +60,49 @@ class CefFrame : public virtual CefBaseRefCounted { // True if this object is currently attached to a valid frame. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Execute undo in this frame. /// /*--cef()--*/ - virtual void Undo() =0; + virtual void Undo() = 0; /// // Execute redo in this frame. /// /*--cef()--*/ - virtual void Redo() =0; + virtual void Redo() = 0; /// // Execute cut in this frame. /// /*--cef()--*/ - virtual void Cut() =0; + virtual void Cut() = 0; /// // Execute copy in this frame. /// /*--cef()--*/ - virtual void Copy() =0; + virtual void Copy() = 0; /// // Execute paste in this frame. /// /*--cef()--*/ - virtual void Paste() =0; + virtual void Paste() = 0; /// // Execute delete in this frame. /// /*--cef(capi_name=del)--*/ - virtual void Delete() =0; + virtual void Delete() = 0; /// // Execute select all in this frame. /// /*--cef()--*/ - virtual void SelectAll() =0; + virtual void SelectAll() = 0; /// // Save this frame's HTML source to a temporary file and open it in the @@ -110,33 +110,33 @@ class CefFrame : public virtual CefBaseRefCounted { // browser process. /// /*--cef()--*/ - virtual void ViewSource() =0; + virtual void ViewSource() = 0; /// // Retrieve this frame's HTML source as a string sent to the specified // visitor. /// /*--cef()--*/ - virtual void GetSource(CefRefPtr visitor) =0; + virtual void GetSource(CefRefPtr visitor) = 0; /// // Retrieve this frame's display text as a string sent to the specified // visitor. /// /*--cef()--*/ - virtual void GetText(CefRefPtr visitor) =0; + virtual void GetText(CefRefPtr visitor) = 0; /// // Load the request represented by the |request| object. /// /*--cef()--*/ - virtual void LoadRequest(CefRefPtr request) =0; + virtual void LoadRequest(CefRefPtr request) = 0; /// // Load the specified |url|. /// /*--cef()--*/ - virtual void LoadURL(const CefString& url) =0; + virtual void LoadURL(const CefString& url) = 0; /// // Load the contents of |string_val| with the specified dummy |url|. |url| @@ -145,7 +145,7 @@ class CefFrame : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void LoadString(const CefString& string_val, - const CefString& url) =0; + const CefString& url) = 0; /// // Execute a string of JavaScript code in this frame. The |script_url| @@ -157,19 +157,19 @@ class CefFrame : public virtual CefBaseRefCounted { /*--cef(optional_param=script_url)--*/ virtual void ExecuteJavaScript(const CefString& code, const CefString& script_url, - int start_line) =0; + int start_line) = 0; /// // Returns true if this is the main (top-level) frame. /// /*--cef()--*/ - virtual bool IsMain() =0; + virtual bool IsMain() = 0; /// // Returns true if this is the focused frame. /// /*--cef()--*/ - virtual bool IsFocused() =0; + virtual bool IsFocused() = 0; /// // Returns the name for this frame. If the frame has an assigned name (for @@ -179,47 +179,47 @@ class CefFrame : public virtual CefBaseRefCounted { // value. /// /*--cef()--*/ - virtual CefString GetName() =0; + virtual CefString GetName() = 0; /// // Returns the globally unique identifier for this frame or < 0 if the // underlying frame does not yet exist. /// /*--cef()--*/ - virtual int64 GetIdentifier() =0; + virtual int64 GetIdentifier() = 0; /// // Returns the parent of this frame or NULL if this is the main (top-level) // frame. /// /*--cef()--*/ - virtual CefRefPtr GetParent() =0; + virtual CefRefPtr GetParent() = 0; /// // Returns the URL currently loaded in this frame. /// /*--cef()--*/ - virtual CefString GetURL() =0; + virtual CefString GetURL() = 0; /// // Returns the browser that this frame belongs to. /// /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; + virtual CefRefPtr GetBrowser() = 0; /// // Get the V8 context associated with the frame. This method can only be // called from the render process. /// /*--cef()--*/ - virtual CefRefPtr GetV8Context() =0; - + virtual CefRefPtr GetV8Context() = 0; + /// // Visit the DOM document. This method can only be called from the render // process. /// /*--cef()--*/ - virtual void VisitDOM(CefRefPtr visitor) =0; + virtual void VisitDOM(CefRefPtr visitor) = 0; }; #endif // CEF_INCLUDE_CEF_FRAME_H_ diff --git a/include/cef_geolocation.h b/include/cef_geolocation.h index 32005a430..5ad7777eb 100644 --- a/include/cef_geolocation.h +++ b/include/cef_geolocation.h @@ -52,7 +52,7 @@ class CefGetGeolocationCallback : public virtual CefBaseRefCounted { // update failed, with error information. /// /*--cef()--*/ - virtual void OnLocationUpdate(const CefGeoposition& position) =0; + virtual void OnLocationUpdate(const CefGeoposition& position) = 0; }; /// diff --git a/include/cef_geolocation_handler.h b/include/cef_geolocation_handler.h index b2a722cea..d43c9c891 100644 --- a/include/cef_geolocation_handler.h +++ b/include/cef_geolocation_handler.h @@ -52,10 +52,9 @@ class CefGeolocationCallback : public virtual CefBaseRefCounted { // Call to allow or deny geolocation access. /// /*--cef(capi_name=cont)--*/ - virtual void Continue(bool allow) =0; + virtual void Continue(bool allow) = 0; }; - /// // Implement this interface to handle events related to geolocation permission // requests. The methods of this class will be called on the browser process UI @@ -86,10 +85,8 @@ class CefGeolocationHandler : public virtual CefBaseRefCounted { // unique ID for the permission request. /// /*--cef()--*/ - virtual void OnCancelGeolocationPermission( - CefRefPtr browser, - int request_id) { - } + virtual void OnCancelGeolocationPermission(CefRefPtr browser, + int request_id) {} }; #endif // CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ diff --git a/include/cef_image.h b/include/cef_image.h index 71f69ab61..3507393ab 100644 --- a/include/cef_image.h +++ b/include/cef_image.h @@ -63,14 +63,14 @@ class CefImage : public virtual CefBaseRefCounted { // Returns true if this Image is empty. /// /*--cef()--*/ - virtual bool IsEmpty() =0; + virtual bool IsEmpty() = 0; /// // Returns true if this Image and |that| Image share the same underlying // storage. Will also return true if both images are empty. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA @@ -86,7 +86,7 @@ class CefImage : public virtual CefBaseRefCounted { cef_color_type_t color_type, cef_alpha_type_t alpha_type, const void* pixel_data, - size_t pixel_data_size) =0; + size_t pixel_data_size) = 0; /// // Add a PNG image representation for |scale_factor|. |png_data| is the image @@ -96,7 +96,7 @@ class CefImage : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool AddPNG(float scale_factor, const void* png_data, - size_t png_data_size) =0; + size_t png_data_size) = 0; /// // Create a JPEG image representation for |scale_factor|. |jpeg_data| is the @@ -106,31 +106,31 @@ class CefImage : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool AddJPEG(float scale_factor, const void* jpeg_data, - size_t jpeg_data_size) =0; + size_t jpeg_data_size) = 0; /// // Returns the image width in density independent pixel (DIP) units. /// /*--cef()--*/ - virtual size_t GetWidth() =0; + virtual size_t GetWidth() = 0; /// // Returns the image height in density independent pixel (DIP) units. /// /*--cef()--*/ - virtual size_t GetHeight() =0; + virtual size_t GetHeight() = 0; /// // Returns true if this image contains a representation for |scale_factor|. /// /*--cef()--*/ - virtual bool HasRepresentation(float scale_factor) =0; + virtual bool HasRepresentation(float scale_factor) = 0; /// // Removes the representation for |scale_factor|. Returns true on success. /// /*--cef()--*/ - virtual bool RemoveRepresentation(float scale_factor) =0; + virtual bool RemoveRepresentation(float scale_factor) = 0; /// // Returns information for the representation that most closely matches @@ -142,7 +142,7 @@ class CefImage : public virtual CefBaseRefCounted { virtual bool GetRepresentationInfo(float scale_factor, float& actual_scale_factor, int& pixel_width, - int& pixel_height) =0; + int& pixel_height) = 0; /// // Returns the bitmap representation that most closely matches |scale_factor|. @@ -157,7 +157,7 @@ class CefImage : public virtual CefBaseRefCounted { cef_color_type_t color_type, cef_alpha_type_t alpha_type, int& pixel_width, - int& pixel_height) =0; + int& pixel_height) = 0; /// // Returns the PNG representation that most closely matches |scale_factor|. If @@ -170,7 +170,7 @@ class CefImage : public virtual CefBaseRefCounted { virtual CefRefPtr GetAsPNG(float scale_factor, bool with_transparency, int& pixel_width, - int& pixel_height) =0; + int& pixel_height) = 0; /// // Returns the JPEG representation that most closely matches |scale_factor|. @@ -185,7 +185,7 @@ class CefImage : public virtual CefBaseRefCounted { virtual CefRefPtr GetAsJPEG(float scale_factor, int quality, int& pixel_width, - int& pixel_height) =0; + int& pixel_height) = 0; }; #endif // CEF_INCLUDE_CEF_IMAGE_H_ diff --git a/include/cef_jsdialog_handler.h b/include/cef_jsdialog_handler.h index 4596430cc..b7e094505 100644 --- a/include/cef_jsdialog_handler.h +++ b/include/cef_jsdialog_handler.h @@ -53,11 +53,9 @@ class CefJSDialogCallback : public virtual CefBaseRefCounted { // pressed. The |user_input| value should be specified for prompt dialogs. /// /*--cef(capi_name=cont,optional_param=user_input)--*/ - virtual void Continue(bool success, - const CefString& user_input) =0; + virtual void Continue(bool success, const CefString& user_input) = 0; }; - /// // Implement this interface to handle events related to JavaScript dialogs. The // methods of this class will be called on the UI thread. @@ -118,7 +116,7 @@ class CefJSDialogHandler : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void OnResetDialogState(CefRefPtr browser) {} - + /// // Called when the default implementation dialog is closed. /// diff --git a/include/cef_keyboard_handler.h b/include/cef_keyboard_handler.h index cd4c4d0ef..386491ed9 100644 --- a/include/cef_keyboard_handler.h +++ b/include/cef_keyboard_handler.h @@ -59,7 +59,9 @@ class CefKeyboardHandler : public virtual CefBaseRefCounted { virtual bool OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, - bool* is_keyboard_shortcut) { return false; } + bool* is_keyboard_shortcut) { + return false; + } /// // Called after the renderer and JavaScript in the page has had a chance to @@ -70,7 +72,9 @@ class CefKeyboardHandler : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, - CefEventHandle os_event) { return false; } + CefEventHandle os_event) { + return false; + } }; #endif // CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ diff --git a/include/cef_menu_model.h b/include/cef_menu_model.h index b039119ac..1c9a7c090 100644 --- a/include/cef_menu_model.h +++ b/include/cef_menu_model.h @@ -63,39 +63,37 @@ class CefMenuModel : public virtual CefBaseRefCounted { // Returns true if this menu is a submenu. /// /*--cef()--*/ - virtual bool IsSubMenu() =0; + virtual bool IsSubMenu() = 0; /// // Clears the menu. Returns true on success. /// /*--cef()--*/ - virtual bool Clear() =0; + virtual bool Clear() = 0; /// // Returns the number of items in this menu. /// /*--cef()--*/ - virtual int GetCount() =0; + virtual int GetCount() = 0; /// // Add a separator to the menu. Returns true on success. /// /*--cef()--*/ - virtual bool AddSeparator() =0; + virtual bool AddSeparator() = 0; /// // Add an item to the menu. Returns true on success. /// /*--cef()--*/ - virtual bool AddItem(int command_id, - const CefString& label) =0; + virtual bool AddItem(int command_id, const CefString& label) = 0; /// // Add a check item to the menu. Returns true on success. /// /*--cef()--*/ - virtual bool AddCheckItem(int command_id, - const CefString& label) =0; + virtual bool AddCheckItem(int command_id, const CefString& label) = 0; /// // Add a radio item to the menu. Only a single item with the specified // |group_id| can be checked at a time. Returns true on success. @@ -103,21 +101,21 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool AddRadioItem(int command_id, const CefString& label, - int group_id) =0; + int group_id) = 0; /// // Add a sub-menu to the menu. The new sub-menu is returned. /// /*--cef()--*/ virtual CefRefPtr AddSubMenu(int command_id, - const CefString& label) =0; + const CefString& label) = 0; /// // Insert a separator in the menu at the specified |index|. Returns true on // success. /// /*--cef()--*/ - virtual bool InsertSeparatorAt(int index) =0; + virtual bool InsertSeparatorAt(int index) = 0; /// // Insert an item in the menu at the specified |index|. Returns true on @@ -126,7 +124,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool InsertItemAt(int index, int command_id, - const CefString& label) =0; + const CefString& label) = 0; /// // Insert a check item in the menu at the specified |index|. Returns true on @@ -135,7 +133,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool InsertCheckItemAt(int index, int command_id, - const CefString& label) =0; + const CefString& label) = 0; /// // Insert a radio item in the menu at the specified |index|. Only a single @@ -146,7 +144,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { virtual bool InsertRadioItemAt(int index, int command_id, const CefString& label, - int group_id) =0; + int group_id) = 0; /// // Insert a sub-menu in the menu at the specified |index|. The new sub-menu @@ -155,204 +153,204 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual CefRefPtr InsertSubMenuAt(int index, int command_id, - const CefString& label) =0; + const CefString& label) = 0; /// // Removes the item with the specified |command_id|. Returns true on success. /// /*--cef()--*/ - virtual bool Remove(int command_id) =0; + virtual bool Remove(int command_id) = 0; /// // Removes the item at the specified |index|. Returns true on success. /// /*--cef()--*/ - virtual bool RemoveAt(int index) =0; + virtual bool RemoveAt(int index) = 0; /// // Returns the index associated with the specified |command_id| or -1 if not // found due to the command id not existing in the menu. /// /*--cef()--*/ - virtual int GetIndexOf(int command_id) =0; + virtual int GetIndexOf(int command_id) = 0; /// // Returns the command id at the specified |index| or -1 if not found due to // invalid range or the index being a separator. /// /*--cef()--*/ - virtual int GetCommandIdAt(int index) =0; + virtual int GetCommandIdAt(int index) = 0; /// // Sets the command id at the specified |index|. Returns true on success. /// /*--cef()--*/ - virtual bool SetCommandIdAt(int index, int command_id) =0; + virtual bool SetCommandIdAt(int index, int command_id) = 0; /// // Returns the label for the specified |command_id| or empty if not found. /// /*--cef()--*/ - virtual CefString GetLabel(int command_id) =0; + virtual CefString GetLabel(int command_id) = 0; /// // Returns the label at the specified |index| or empty if not found due to // invalid range or the index being a separator. /// /*--cef()--*/ - virtual CefString GetLabelAt(int index) =0; + virtual CefString GetLabelAt(int index) = 0; /// // Sets the label for the specified |command_id|. Returns true on success. /// /*--cef()--*/ - virtual bool SetLabel(int command_id, const CefString& label) =0; + virtual bool SetLabel(int command_id, const CefString& label) = 0; /// // Set the label at the specified |index|. Returns true on success. /// /*--cef()--*/ - virtual bool SetLabelAt(int index, const CefString& label) =0; + virtual bool SetLabelAt(int index, const CefString& label) = 0; /// // Returns the item type for the specified |command_id|. /// /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ - virtual MenuItemType GetType(int command_id) =0; + virtual MenuItemType GetType(int command_id) = 0; /// // Returns the item type at the specified |index|. /// /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ - virtual MenuItemType GetTypeAt(int index) =0; + virtual MenuItemType GetTypeAt(int index) = 0; /// // Returns the group id for the specified |command_id| or -1 if invalid. /// /*--cef()--*/ - virtual int GetGroupId(int command_id) =0; + virtual int GetGroupId(int command_id) = 0; /// // Returns the group id at the specified |index| or -1 if invalid. /// /*--cef()--*/ - virtual int GetGroupIdAt(int index) =0; + virtual int GetGroupIdAt(int index) = 0; /// // Sets the group id for the specified |command_id|. Returns true on success. /// /*--cef()--*/ - virtual bool SetGroupId(int command_id, int group_id) =0; + virtual bool SetGroupId(int command_id, int group_id) = 0; /// // Sets the group id at the specified |index|. Returns true on success. /// /*--cef()--*/ - virtual bool SetGroupIdAt(int index, int group_id) =0; + virtual bool SetGroupIdAt(int index, int group_id) = 0; /// // Returns the submenu for the specified |command_id| or empty if invalid. /// /*--cef()--*/ - virtual CefRefPtr GetSubMenu(int command_id) =0; + virtual CefRefPtr GetSubMenu(int command_id) = 0; /// // Returns the submenu at the specified |index| or empty if invalid. /// /*--cef()--*/ - virtual CefRefPtr GetSubMenuAt(int index) =0; + virtual CefRefPtr GetSubMenuAt(int index) = 0; /// // Returns true if the specified |command_id| is visible. /// /*--cef()--*/ - virtual bool IsVisible(int command_id) =0; + virtual bool IsVisible(int command_id) = 0; /// // Returns true if the specified |index| is visible. /// /*--cef()--*/ - virtual bool IsVisibleAt(int index) =0; + virtual bool IsVisibleAt(int index) = 0; /// // Change the visibility of the specified |command_id|. Returns true on // success. /// /*--cef()--*/ - virtual bool SetVisible(int command_id, bool visible) =0; + virtual bool SetVisible(int command_id, bool visible) = 0; /// // Change the visibility at the specified |index|. Returns true on success. /// /*--cef()--*/ - virtual bool SetVisibleAt(int index, bool visible) =0; + virtual bool SetVisibleAt(int index, bool visible) = 0; /// // Returns true if the specified |command_id| is enabled. /// /*--cef()--*/ - virtual bool IsEnabled(int command_id) =0; + virtual bool IsEnabled(int command_id) = 0; /// // Returns true if the specified |index| is enabled. /// /*--cef()--*/ - virtual bool IsEnabledAt(int index) =0; + virtual bool IsEnabledAt(int index) = 0; /// // Change the enabled status of the specified |command_id|. Returns true on // success. /// /*--cef()--*/ - virtual bool SetEnabled(int command_id, bool enabled) =0; + virtual bool SetEnabled(int command_id, bool enabled) = 0; /// // Change the enabled status at the specified |index|. Returns true on // success. /// /*--cef()--*/ - virtual bool SetEnabledAt(int index, bool enabled) =0; + virtual bool SetEnabledAt(int index, bool enabled) = 0; /// // Returns true if the specified |command_id| is checked. Only applies to // check and radio items. /// /*--cef()--*/ - virtual bool IsChecked(int command_id) =0; + virtual bool IsChecked(int command_id) = 0; /// // Returns true if the specified |index| is checked. Only applies to check // and radio items. /// /*--cef()--*/ - virtual bool IsCheckedAt(int index) =0; + virtual bool IsCheckedAt(int index) = 0; /// // Check the specified |command_id|. Only applies to check and radio items. // Returns true on success. /// /*--cef()--*/ - virtual bool SetChecked(int command_id, bool checked) =0; + virtual bool SetChecked(int command_id, bool checked) = 0; /// // Check the specified |index|. Only applies to check and radio items. Returns // true on success. /// /*--cef()--*/ - virtual bool SetCheckedAt(int index, bool checked) =0; + virtual bool SetCheckedAt(int index, bool checked) = 0; /// // Returns true if the specified |command_id| has a keyboard accelerator // assigned. /// /*--cef()--*/ - virtual bool HasAccelerator(int command_id) =0; + virtual bool HasAccelerator(int command_id) = 0; /// // Returns true if the specified |index| has a keyboard accelerator assigned. /// /*--cef()--*/ - virtual bool HasAcceleratorAt(int index) =0; + virtual bool HasAcceleratorAt(int index) = 0; /// // Set the keyboard accelerator for the specified |command_id|. |key_code| can @@ -363,7 +361,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { int key_code, bool shift_pressed, bool ctrl_pressed, - bool alt_pressed) =0; + bool alt_pressed) = 0; /// // Set the keyboard accelerator at the specified |index|. |key_code| can be @@ -374,21 +372,21 @@ class CefMenuModel : public virtual CefBaseRefCounted { int key_code, bool shift_pressed, bool ctrl_pressed, - bool alt_pressed) =0; + bool alt_pressed) = 0; /// // Remove the keyboard accelerator for the specified |command_id|. Returns // true on success. /// /*--cef()--*/ - virtual bool RemoveAccelerator(int command_id) =0; + virtual bool RemoveAccelerator(int command_id) = 0; /// // Remove the keyboard accelerator at the specified |index|. Returns true on // success. /// /*--cef()--*/ - virtual bool RemoveAcceleratorAt(int index) =0; + virtual bool RemoveAcceleratorAt(int index) = 0; /// // Retrieves the keyboard accelerator for the specified |command_id|. Returns @@ -399,7 +397,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { int& key_code, bool& shift_pressed, bool& ctrl_pressed, - bool& alt_pressed) =0; + bool& alt_pressed) = 0; /// // Retrieves the keyboard accelerator for the specified |index|. Returns true @@ -410,7 +408,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { int& key_code, bool& shift_pressed, bool& ctrl_pressed, - bool& alt_pressed) =0; + bool& alt_pressed) = 0; /// // Set the explicit color for |command_id| and |color_type| to |color|. @@ -421,7 +419,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool SetColor(int command_id, cef_menu_color_type_t color_type, - cef_color_t color) =0; + cef_color_t color) = 0; /// // Set the explicit color for |command_id| and |index| to |color|. Specify a @@ -433,7 +431,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool SetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t color) =0; + cef_color_t color) = 0; /// // Returns in |color| the color that was explicitly set for |command_id| and @@ -443,7 +441,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool GetColor(int command_id, cef_menu_color_type_t color_type, - cef_color_t& color) =0; + cef_color_t& color) = 0; /// // Returns in |color| the color that was explicitly set for |command_id| and @@ -454,7 +452,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool GetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t& color) =0; + cef_color_t& color) = 0; /// // Sets the font list for the specified |command_id|. If |font_list| is empty @@ -470,8 +468,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { // - "Arial, 14px" /// /*--cef(optional_param=font_list)--*/ - virtual bool SetFontList(int command_id, - const CefString& font_list) =0; + virtual bool SetFontList(int command_id, const CefString& font_list) = 0; /// // Sets the font list for the specified |index|. Specify an |index| value of @@ -488,8 +485,7 @@ class CefMenuModel : public virtual CefBaseRefCounted { // - "Arial, 14px" /// /*--cef(optional_param=font_list)--*/ - virtual bool SetFontListAt(int index, - const CefString& font_list) =0; + virtual bool SetFontListAt(int index, const CefString& font_list) = 0; }; #endif // CEF_INCLUDE_CEF_MENU_MODEL_H_ diff --git a/include/cef_menu_model_delegate.h b/include/cef_menu_model_delegate.h index d05b580a6..e3ddfbdac 100644 --- a/include/cef_menu_model_delegate.h +++ b/include/cef_menu_model_delegate.h @@ -57,7 +57,7 @@ class CefMenuModelDelegate : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void ExecuteCommand(CefRefPtr menu_model, int command_id, - cef_event_flags_t event_flags) =0; + cef_event_flags_t event_flags) = 0; /// // Called when the user moves the mouse outside the menu and over the owning @@ -66,7 +66,7 @@ class CefMenuModelDelegate : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void MouseOutsideMenu(CefRefPtr menu_model, const CefPoint& screen_point) {} - + /// // Called on unhandled open submenu keyboard commands. |is_rtl| will be true // if the menu is displaying a right-to-left language. @@ -100,7 +100,9 @@ class CefMenuModelDelegate : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool FormatLabel(CefRefPtr menu_model, - CefString& label) { return false; } + CefString& label) { + return false; + } }; #endif // CEF_INCLUDE_VIEWS_CEF_MENU_MODEL_DELEGATE_H_ diff --git a/include/cef_navigation_entry.h b/include/cef_navigation_entry.h index 9c86a338a..292f5b6c3 100644 --- a/include/cef_navigation_entry.h +++ b/include/cef_navigation_entry.h @@ -54,45 +54,45 @@ class CefNavigationEntry : public virtual CefBaseRefCounted { // function returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns the actual URL of the page. For some pages this may be data: URL or // similar. Use GetDisplayURL() to return a display-friendly version. /// /*--cef()--*/ - virtual CefString GetURL() =0; + virtual CefString GetURL() = 0; /// // Returns a display-friendly version of the URL. /// /*--cef()--*/ - virtual CefString GetDisplayURL() =0; + virtual CefString GetDisplayURL() = 0; /// // Returns the original URL that was entered by the user before any redirects. /// /*--cef()--*/ - virtual CefString GetOriginalURL() =0; + virtual CefString GetOriginalURL() = 0; /// // Returns the title set by the page. This value may be empty. /// /*--cef()--*/ - virtual CefString GetTitle() =0; + virtual CefString GetTitle() = 0; /// // Returns the transition type which indicates what the user did to move to // this page from the previous page. /// /*--cef(default_retval=TT_EXPLICIT)--*/ - virtual TransitionType GetTransitionType() =0; + virtual TransitionType GetTransitionType() = 0; /// // Returns true if this navigation includes post data. /// /*--cef()--*/ - virtual bool HasPostData() =0; + virtual bool HasPostData() = 0; /// // Returns the time for the last known successful navigation completion. A @@ -100,7 +100,7 @@ class CefNavigationEntry : public virtual CefBaseRefCounted { // 0 if the navigation has not yet completed. /// /*--cef()--*/ - virtual CefTime GetCompletionTime() =0; + virtual CefTime GetCompletionTime() = 0; /// // Returns the HTTP status code for the last known successful navigation @@ -108,13 +108,13 @@ class CefNavigationEntry : public virtual CefBaseRefCounted { // navigation has not yet completed. /// /*--cef()--*/ - virtual int GetHttpStatusCode() =0; + virtual int GetHttpStatusCode() = 0; /// // Returns the SSL information for this navigation entry. /// /*--cef()--*/ - virtual CefRefPtr GetSSLStatus() =0; + virtual CefRefPtr GetSSLStatus() = 0; }; #endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ diff --git a/include/cef_origin_whitelist.h b/include/cef_origin_whitelist.h index 7fed3453a..ad173181f 100644 --- a/include/cef_origin_whitelist.h +++ b/include/cef_origin_whitelist.h @@ -40,7 +40,6 @@ #include "include/cef_base.h" - /// // Add an entry to the cross-origin access whitelist. // diff --git a/include/cef_parser.h b/include/cef_parser.h index 44c362993..ebe75103e 100644 --- a/include/cef_parser.h +++ b/include/cef_parser.h @@ -48,8 +48,7 @@ // Returns false if the URL is empty or invalid. /// /*--cef()--*/ -bool CefParseURL(const CefString& url, - CefURLParts& parts); +bool CefParseURL(const CefString& url, CefURLParts& parts); /// // Creates a URL from the specified |parts|, which must contain a non-empty @@ -57,8 +56,7 @@ bool CefParseURL(const CefString& url, // Returns false if |parts| isn't initialized as described. /// /*--cef()--*/ -bool CefCreateURL(const CefURLParts& parts, - CefString& url); +bool CefCreateURL(const CefURLParts& parts, CefString& url); /// // This is a convenience function for formatting a URL in a concise and human- diff --git a/include/cef_print_handler.h b/include/cef_print_handler.h index 50519c4fe..4e8b2fa39 100644 --- a/include/cef_print_handler.h +++ b/include/cef_print_handler.h @@ -52,13 +52,13 @@ class CefPrintDialogCallback : public virtual CefBaseRefCounted { // Continue printing with the specified |settings|. /// /*--cef(capi_name=cont)--*/ - virtual void Continue(CefRefPtr settings) =0; + virtual void Continue(CefRefPtr settings) = 0; /// // Cancel the printing. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; /// @@ -71,10 +71,9 @@ class CefPrintJobCallback : public virtual CefBaseRefCounted { // Indicate completion of the print job. /// /*--cef(capi_name=cont)--*/ - virtual void Continue() =0; + virtual void Continue() = 0; }; - /// // Implement this interface to handle printing on Linux. The methods of this // class will be called on the browser process UI thread. @@ -89,7 +88,7 @@ class CefPrintHandler : public virtual CefBaseRefCounted { // window.print() or PDF extension print button). /// /*--cef()--*/ - virtual void OnPrintStart(CefRefPtr browser) =0; + virtual void OnPrintStart(CefRefPtr browser) = 0; /// // Synchronize |settings| with client state. If |get_defaults| is true then @@ -98,7 +97,7 @@ class CefPrintHandler : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void OnPrintSettings(CefRefPtr settings, - bool get_defaults) =0; + bool get_defaults) = 0; /// // Show the print dialog. Execute |callback| once the dialog is dismissed. @@ -107,7 +106,7 @@ class CefPrintHandler : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool OnPrintDialog(bool has_selection, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Send the print job to the printer. Execute |callback| once the job is @@ -117,13 +116,13 @@ class CefPrintHandler : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool OnPrintJob(const CefString& document_name, const CefString& pdf_file_path, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Reset client state related to printing. /// /*--cef()--*/ - virtual void OnPrintReset() =0; + virtual void OnPrintReset() = 0; /// // Return the PDF paper size in device units. Used in combination with diff --git a/include/cef_print_settings.h b/include/cef_print_settings.h index 0fe2a0ba0..576ac4e52 100644 --- a/include/cef_print_settings.h +++ b/include/cef_print_settings.h @@ -63,32 +63,32 @@ class CefPrintSettings : public virtual CefBaseRefCounted { // function returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if the values of this object are read-only. Some APIs may // expose read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns a writable copy of this object. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Set the page orientation. /// /*--cef()--*/ - virtual void SetOrientation(bool landscape) =0; + virtual void SetOrientation(bool landscape) = 0; /// // Returns true if the orientation is landscape. /// /*--cef()--*/ - virtual bool IsLandscape() =0; + virtual bool IsLandscape() = 0; /// // Set the printer printable area in device units. @@ -99,110 +99,109 @@ class CefPrintSettings : public virtual CefBaseRefCounted { virtual void SetPrinterPrintableArea( const CefSize& physical_size_device_units, const CefRect& printable_area_device_units, - bool landscape_needs_flip) =0; + bool landscape_needs_flip) = 0; /// // Set the device name. /// /*--cef(optional_param=name)--*/ - virtual void SetDeviceName(const CefString& name) =0; + virtual void SetDeviceName(const CefString& name) = 0; /// // Get the device name. /// /*--cef()--*/ - virtual CefString GetDeviceName() =0; + virtual CefString GetDeviceName() = 0; /// // Set the DPI (dots per inch). /// /*--cef()--*/ - virtual void SetDPI(int dpi) =0; + virtual void SetDPI(int dpi) = 0; /// // Get the DPI (dots per inch). /// /*--cef()--*/ - virtual int GetDPI() =0; + virtual int GetDPI() = 0; /// // Set the page ranges. /// /*--cef()--*/ - virtual void SetPageRanges(const PageRangeList& ranges) =0; + virtual void SetPageRanges(const PageRangeList& ranges) = 0; /// // Returns the number of page ranges that currently exist. /// /*--cef()--*/ - virtual size_t GetPageRangesCount() =0; + virtual size_t GetPageRangesCount() = 0; /// // Retrieve the page ranges. /// /*--cef(count_func=ranges:GetPageRangesCount)--*/ - virtual void GetPageRanges(PageRangeList& ranges) =0; + virtual void GetPageRanges(PageRangeList& ranges) = 0; /// // Set whether only the selection will be printed. /// /*--cef()--*/ - virtual void SetSelectionOnly(bool selection_only) =0; + virtual void SetSelectionOnly(bool selection_only) = 0; /// // Returns true if only the selection will be printed. /// /*--cef()--*/ - virtual bool IsSelectionOnly() =0; + virtual bool IsSelectionOnly() = 0; /// // Set whether pages will be collated. /// /*--cef()--*/ - virtual void SetCollate(bool collate) =0; + virtual void SetCollate(bool collate) = 0; /// // Returns true if pages will be collated. /// /*--cef()--*/ - virtual bool WillCollate() =0; + virtual bool WillCollate() = 0; /// // Set the color model. /// /*--cef()--*/ - virtual void SetColorModel(ColorModel model) =0; + virtual void SetColorModel(ColorModel model) = 0; /// // Get the color model. /// /*--cef(default_retval=COLOR_MODEL_UNKNOWN)--*/ - virtual ColorModel GetColorModel() =0; + virtual ColorModel GetColorModel() = 0; /// // Set the number of copies. /// /*--cef()--*/ - virtual void SetCopies(int copies) =0; + virtual void SetCopies(int copies) = 0; /// // Get the number of copies. /// /*--cef()--*/ - virtual int GetCopies() =0; + virtual int GetCopies() = 0; /// // Set the duplex mode. /// /*--cef()--*/ - virtual void SetDuplexMode(DuplexMode mode) =0; + virtual void SetDuplexMode(DuplexMode mode) = 0; /// // Get the duplex mode. /// /*--cef(default_retval=DUPLEX_MODE_UNKNOWN)--*/ - virtual DuplexMode GetDuplexMode() =0; + virtual DuplexMode GetDuplexMode() = 0; }; #endif // CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ - diff --git a/include/cef_process_message.h b/include/cef_process_message.h index a6b6a18aa..c4daeb822 100644 --- a/include/cef_process_message.h +++ b/include/cef_process_message.h @@ -60,32 +60,32 @@ class CefProcessMessage : public virtual CefBaseRefCounted { // function returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if the values of this object are read-only. Some APIs may // expose read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns a writable copy of this object. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Returns the message name. /// /*--cef()--*/ - virtual CefString GetName() =0; + virtual CefString GetName() = 0; /// // Returns the list of arguments. /// /*--cef()--*/ - virtual CefRefPtr GetArgumentList() =0; + virtual CefRefPtr GetArgumentList() = 0; }; #endif // CEF_INCLUDE_CEF_MESSAGE_H_ diff --git a/include/cef_render_handler.h b/include/cef_render_handler.h index 057046b43..a9ea8cc1f 100644 --- a/include/cef_render_handler.h +++ b/include/cef_render_handler.h @@ -72,15 +72,16 @@ class CefRenderHandler : public virtual CefBaseRefCounted { // true if the rectangle was provided. /// /*--cef()--*/ - virtual bool GetRootScreenRect(CefRefPtr browser, - CefRect& rect) { return false; } + virtual bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) { + return false; + } /// // Called to retrieve the view rectangle which is relative to screen // coordinates. Return true if the rectangle was provided. /// /*--cef()--*/ - virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) =0; + virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) = 0; /// // Called to retrieve the translation from view coordinates to actual screen @@ -91,7 +92,9 @@ class CefRenderHandler : public virtual CefBaseRefCounted { int viewX, int viewY, int& screenX, - int& screenY) { return false; } + int& screenY) { + return false; + } /// // Called to allow the client to fill in the CefScreenInfo object with @@ -104,23 +107,24 @@ class CefRenderHandler : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool GetScreenInfo(CefRefPtr browser, - CefScreenInfo& screen_info) { return false; } + CefScreenInfo& screen_info) { + return false; + } /// // Called when the browser wants to show or hide the popup widget. The popup // should be shown if |show| is true and hidden if |show| is false. /// /*--cef()--*/ - virtual void OnPopupShow(CefRefPtr browser, - bool show) {} + virtual void OnPopupShow(CefRefPtr browser, bool show) {} /// // Called when the browser wants to move or resize the popup widget. |rect| // contains the new location and size in view coordinates. /// /*--cef()--*/ - virtual void OnPopupSize(CefRefPtr browser, - const CefRect& rect) {} + virtual void OnPopupSize(CefRefPtr browser, const CefRect& rect) { + } /// // Called when an element should be painted. Pixel values passed to this @@ -137,7 +141,8 @@ class CefRenderHandler : public virtual CefBaseRefCounted { PaintElementType type, const RectList& dirtyRects, const void* buffer, - int width, int height) =0; + int width, + int height) = 0; /// // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then @@ -168,7 +173,10 @@ class CefRenderHandler : public virtual CefBaseRefCounted { virtual bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, DragOperationsMask allowed_ops, - int x, int y) { return false; } + int x, + int y) { + return false; + } /// // Called when the web view wants to update the mouse cursor during a diff --git a/include/cef_render_process_handler.h b/include/cef_render_process_handler.h index ecf6fc59e..e387e7a8e 100644 --- a/include/cef_render_process_handler.h +++ b/include/cef_render_process_handler.h @@ -90,9 +90,7 @@ class CefRenderProcessHandler : public virtual CefBaseRefCounted { // Return the handler for browser load status events. /// /*--cef()--*/ - virtual CefRefPtr GetLoadHandler() { - return NULL; - } + virtual CefRefPtr GetLoadHandler() { return NULL; } /// // Called before browser navigation. Return true to cancel the navigation or @@ -104,7 +102,9 @@ class CefRenderProcessHandler : public virtual CefBaseRefCounted { CefRefPtr frame, CefRefPtr request, NavigationType navigation_type, - bool is_redirect) { return false; } + bool is_redirect) { + return false; + } /// // Called immediately after the V8 context for a frame has been created. To diff --git a/include/cef_request.h b/include/cef_request.h index 8d48f41d9..2a7ffd037 100644 --- a/include/cef_request.h +++ b/include/cef_request.h @@ -38,9 +38,9 @@ #define CEF_INCLUDE_CEF_REQUEST_H_ #pragma once -#include "include/cef_base.h" #include #include +#include "include/cef_base.h" class CefPostData; class CefPostDataElement; @@ -67,32 +67,32 @@ class CefRequest : public virtual CefBaseRefCounted { // Returns true if this object is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Get the fully qualified URL. /// /*--cef()--*/ - virtual CefString GetURL() =0; + virtual CefString GetURL() = 0; /// // Set the fully qualified URL. /// /*--cef()--*/ - virtual void SetURL(const CefString& url) =0; + virtual void SetURL(const CefString& url) = 0; /// // Get the request method type. The value will default to POST if post data // is provided and GET otherwise. /// /*--cef()--*/ - virtual CefString GetMethod() =0; + virtual CefString GetMethod() = 0; /// // Set the request method type. /// /*--cef()--*/ - virtual void SetMethod(const CefString& method) =0; + virtual void SetMethod(const CefString& method) = 0; /// // Set the referrer URL and policy. If non-empty the referrer URL must be @@ -101,44 +101,44 @@ class CefRequest : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual void SetReferrer(const CefString& referrer_url, - ReferrerPolicy policy) =0; + ReferrerPolicy policy) = 0; /// // Get the referrer URL. /// /*--cef()--*/ - virtual CefString GetReferrerURL() =0; + virtual CefString GetReferrerURL() = 0; /// // Get the referrer policy. /// /*--cef(default_retval=REFERRER_POLICY_DEFAULT)--*/ - virtual ReferrerPolicy GetReferrerPolicy() =0; + virtual ReferrerPolicy GetReferrerPolicy() = 0; /// // Get the post data. /// /*--cef()--*/ - virtual CefRefPtr GetPostData() =0; + virtual CefRefPtr GetPostData() = 0; /// // Set the post data. /// /*--cef()--*/ - virtual void SetPostData(CefRefPtr postData) =0; + virtual void SetPostData(CefRefPtr postData) = 0; /// // Get the header values. Will not include the Referer value if any. /// /*--cef()--*/ - virtual void GetHeaderMap(HeaderMap& headerMap) =0; + virtual void GetHeaderMap(HeaderMap& headerMap) = 0; /// // Set the header values. If a Referer value exists in the header map it will // be removed and ignored. /// /*--cef()--*/ - virtual void SetHeaderMap(const HeaderMap& headerMap) =0; + virtual void SetHeaderMap(const HeaderMap& headerMap) = 0; /// // Set all values at one time. @@ -147,42 +147,42 @@ class CefRequest : public virtual CefBaseRefCounted { virtual void Set(const CefString& url, const CefString& method, CefRefPtr postData, - const HeaderMap& headerMap) =0; + const HeaderMap& headerMap) = 0; /// // Get the flags used in combination with CefURLRequest. See // cef_urlrequest_flags_t for supported values. /// /*--cef(default_retval=UR_FLAG_NONE)--*/ - virtual int GetFlags() =0; + virtual int GetFlags() = 0; /// // Set the flags used in combination with CefURLRequest. See // cef_urlrequest_flags_t for supported values. /// /*--cef()--*/ - virtual void SetFlags(int flags) =0; + virtual void SetFlags(int flags) = 0; /// // Set the URL to the first party for cookies used in combination with // CefURLRequest. /// /*--cef()--*/ - virtual CefString GetFirstPartyForCookies() =0; + virtual CefString GetFirstPartyForCookies() = 0; /// // Get the URL to the first party for cookies used in combination with // CefURLRequest. /// /*--cef()--*/ - virtual void SetFirstPartyForCookies(const CefString& url) =0; + virtual void SetFirstPartyForCookies(const CefString& url) = 0; /// // Get the resource type for this request. Only available in the browser // process. /// /*--cef(default_retval=RT_SUB_RESOURCE)--*/ - virtual ResourceType GetResourceType() =0; + virtual ResourceType GetResourceType() = 0; /// // Get the transition type for this request. Only available in the browser @@ -190,7 +190,7 @@ class CefRequest : public virtual CefBaseRefCounted { // sub-frame navigation. /// /*--cef(default_retval=TT_EXPLICIT)--*/ - virtual TransitionType GetTransitionType() =0; + virtual TransitionType GetTransitionType() = 0; /// // Returns the globally unique identifier for this request or 0 if not @@ -198,10 +198,9 @@ class CefRequest : public virtual CefBaseRefCounted { // process to track a single request across multiple callbacks. /// /*--cef()--*/ - virtual uint64 GetIdentifier() =0; + virtual uint64 GetIdentifier() = 0; }; - /// // Class used to represent post data for a web request. The methods of this // class may be called on any thread. @@ -209,7 +208,7 @@ class CefRequest : public virtual CefBaseRefCounted { /*--cef(source=library,no_debugct_check)--*/ class CefPostData : public virtual CefBaseRefCounted { public: - typedef std::vector > ElementVector; + typedef std::vector> ElementVector; /// // Create a new CefPostData object. @@ -221,7 +220,7 @@ class CefPostData : public virtual CefBaseRefCounted { // Returns true if this object is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns true if the underlying POST data includes elements that are not @@ -236,35 +235,34 @@ class CefPostData : public virtual CefBaseRefCounted { // Returns the number of existing post data elements. /// /*--cef()--*/ - virtual size_t GetElementCount() =0; + virtual size_t GetElementCount() = 0; /// // Retrieve the post data elements. /// /*--cef(count_func=elements:GetElementCount)--*/ - virtual void GetElements(ElementVector& elements) =0; + virtual void GetElements(ElementVector& elements) = 0; /// // Remove the specified post data element. Returns true if the removal // succeeds. /// /*--cef()--*/ - virtual bool RemoveElement(CefRefPtr element) =0; + virtual bool RemoveElement(CefRefPtr element) = 0; /// // Add the specified post data element. Returns true if the add succeeds. /// /*--cef()--*/ - virtual bool AddElement(CefRefPtr element) =0; + virtual bool AddElement(CefRefPtr element) = 0; /// // Remove all existing post data elements. /// /*--cef()--*/ - virtual void RemoveElements() =0; + virtual void RemoveElements() = 0; }; - /// // Class used to represent a single element in the request post data. The // methods of this class may be called on any thread. @@ -287,51 +285,51 @@ class CefPostDataElement : public virtual CefBaseRefCounted { // Returns true if this object is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Remove all contents from the post data element. /// /*--cef()--*/ - virtual void SetToEmpty() =0; + virtual void SetToEmpty() = 0; /// // The post data element will represent a file. /// /*--cef()--*/ - virtual void SetToFile(const CefString& fileName) =0; + virtual void SetToFile(const CefString& fileName) = 0; /// // The post data element will represent bytes. The bytes passed // in will be copied. /// /*--cef()--*/ - virtual void SetToBytes(size_t size, const void* bytes) =0; + virtual void SetToBytes(size_t size, const void* bytes) = 0; /// // Return the type of this post data element. /// /*--cef(default_retval=PDE_TYPE_EMPTY)--*/ - virtual Type GetType() =0; + virtual Type GetType() = 0; /// // Return the file name. /// /*--cef()--*/ - virtual CefString GetFile() =0; + virtual CefString GetFile() = 0; /// // Return the number of bytes. /// /*--cef()--*/ - virtual size_t GetBytesCount() =0; + virtual size_t GetBytesCount() = 0; /// // Read up to |size| bytes into |bytes| and return the number of bytes // actually read. /// /*--cef()--*/ - virtual size_t GetBytes(size_t size, void* bytes) =0; + virtual size_t GetBytes(size_t size, void* bytes) = 0; }; #endif // CEF_INCLUDE_CEF_REQUEST_H_ diff --git a/include/cef_request_context.h b/include/cef_request_context.h index 3f6d8fd4c..a365a27b4 100644 --- a/include/cef_request_context.h +++ b/include/cef_request_context.h @@ -47,7 +47,6 @@ class CefSchemeHandlerFactory; - /// // Callback interface for CefRequestContext::ResolveHost. /// @@ -62,10 +61,9 @@ class CefResolveCallback : public virtual CefBaseRefCounted { /*--cef(optional_param=resolved_ips)--*/ virtual void OnResolveCompleted( cef_errorcode_t result, - const std::vector& resolved_ips) =0; + const std::vector& resolved_ips) = 0; }; - /// // A request context provides request handling for a set of related browser // or URL request objects. A request context can be specified when creating a @@ -114,13 +112,13 @@ class CefRequestContext : public virtual CefBaseRefCounted { // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr other) =0; + virtual bool IsSame(CefRefPtr other) = 0; /// // Returns true if this object is sharing the same storage as |that| object. /// /*--cef()--*/ - virtual bool IsSharingWith(CefRefPtr other) =0; + virtual bool IsSharingWith(CefRefPtr other) = 0; /// // Returns true if this object is the global context. The global context is @@ -128,20 +126,20 @@ class CefRequestContext : public virtual CefBaseRefCounted { // argument. /// /*--cef()--*/ - virtual bool IsGlobal() =0; + virtual bool IsGlobal() = 0; /// // Returns the handler for this context if any. /// /*--cef()--*/ - virtual CefRefPtr GetHandler() =0; + virtual CefRefPtr GetHandler() = 0; /// // Returns the cache path for this object. If empty an "incognito mode" // in-memory cache is being used. /// /*--cef()--*/ - virtual CefString GetCachePath() =0; + virtual CefString GetCachePath() = 0; /// // Returns the default cookie manager for this object. This will be the global @@ -153,7 +151,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { /// /*--cef(optional_param=callback)--*/ virtual CefRefPtr GetDefaultCookieManager( - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Register a scheme handler factory for the specified |scheme_name| and @@ -172,14 +170,14 @@ class CefRequestContext : public virtual CefBaseRefCounted { virtual bool RegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, - CefRefPtr factory) =0; + CefRefPtr factory) = 0; /// // Clear all registered scheme handler factories. Returns false on error. This // function may be called on any thread in the browser process. /// /*--cef()--*/ - virtual bool ClearSchemeHandlerFactories() =0; + virtual bool ClearSchemeHandlerFactories() = 0; /// // Tells all renderer processes associated with this context to throw away @@ -188,14 +186,14 @@ class CefRequestContext : public virtual CefBaseRefCounted { // be called to rebuild the plugin list cache. /// /*--cef()--*/ - virtual void PurgePluginListCache(bool reload_pages) =0; + virtual void PurgePluginListCache(bool reload_pages) = 0; /// // Returns true if a preference with the specified |name| exists. This method // must be called on the browser process UI thread. /// /*--cef()--*/ - virtual bool HasPreference(const CefString& name) =0; + virtual bool HasPreference(const CefString& name) = 0; /// // Returns the value for the preference with the specified |name|. Returns @@ -205,7 +203,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { // on the browser process UI thread. /// /*--cef()--*/ - virtual CefRefPtr GetPreference(const CefString& name) =0; + virtual CefRefPtr GetPreference(const CefString& name) = 0; /// // Returns all preferences as a dictionary. If |include_defaults| is true then @@ -217,7 +215,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual CefRefPtr GetAllPreferences( - bool include_defaults) =0; + bool include_defaults) = 0; /// // Returns true if the preference with the specified |name| can be modified @@ -226,7 +224,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { // process UI thread. /// /*--cef()--*/ - virtual bool CanSetPreference(const CefString& name) =0; + virtual bool CanSetPreference(const CefString& name) = 0; /// // Set the |value| associated with preference |name|. Returns true if the @@ -238,7 +236,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { /*--cef(optional_param=value)--*/ virtual bool SetPreference(const CefString& name, CefRefPtr value, - CefString& error) =0; + CefString& error) = 0; /// // Clears all certificate exceptions that were added as part of handling @@ -250,7 +248,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { /// /*--cef(optional_param=callback)--*/ virtual void ClearCertificateExceptions( - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Clears all active and idle connections that Chromium currently has. @@ -260,16 +258,15 @@ class CefRequestContext : public virtual CefBaseRefCounted { /// /*--cef(optional_param=callback)--*/ virtual void CloseAllConnections( - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Attempts to resolve |origin| to a list of associated IP addresses. // |callback| will be executed on the UI thread after completion. /// /*--cef()--*/ - virtual void ResolveHost( - const CefString& origin, - CefRefPtr callback) =0; + virtual void ResolveHost(const CefString& origin, + CefRefPtr callback) = 0; /// // Attempts to resolve |origin| to a list of associated IP addresses using @@ -280,7 +277,7 @@ class CefRequestContext : public virtual CefBaseRefCounted { /*--cef(default_retval=ERR_FAILED)--*/ virtual cef_errorcode_t ResolveHostCached( const CefString& origin, - std::vector& resolved_ips) =0; + std::vector& resolved_ips) = 0; }; #endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ diff --git a/include/cef_request_handler.h b/include/cef_request_handler.h index c44a3dfaa..f25eb2630 100644 --- a/include/cef_request_handler.h +++ b/include/cef_request_handler.h @@ -44,10 +44,10 @@ #include "include/cef_base.h" #include "include/cef_browser.h" #include "include/cef_frame.h" +#include "include/cef_request.h" #include "include/cef_resource_handler.h" #include "include/cef_response.h" #include "include/cef_response_filter.h" -#include "include/cef_request.h" #include "include/cef_ssl_info.h" #include "include/cef_x509_certificate.h" @@ -62,16 +62,15 @@ class CefRequestCallback : public virtual CefBaseRefCounted { // Otherwise, the request will be canceled. /// /*--cef(capi_name=cont)--*/ - virtual void Continue(bool allow) =0; + virtual void Continue(bool allow) = 0; /// // Cancel the url request. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; - /// // Callback interface used to select a client certificate for authentication. /// @@ -83,10 +82,9 @@ class CefSelectClientCertificateCallback : public virtual CefBaseRefCounted { // NULL value means that no client certificate should be used. /// /*--cef(optional_param=cert)--*/ - virtual void Select(CefRefPtr cert) =0; + virtual void Select(CefRefPtr cert) = 0; }; - /// // Implement this interface to handle events related to browser requests. The // methods of this class will be called on the thread indicated. @@ -98,7 +96,7 @@ class CefRequestHandler : public virtual CefBaseRefCounted { typedef cef_termination_status_t TerminationStatus; typedef cef_urlrequest_status_t URLRequestStatus; typedef cef_window_open_disposition_t WindowOpenDisposition; - typedef std::vector > X509CertificateList; + typedef std::vector> X509CertificateList; /// // Called on the UI thread before browser navigation. Return true to cancel @@ -149,7 +147,7 @@ class CefRequestHandler : public virtual CefBaseRefCounted { // immediately. Return RV_CONTINUE_ASYNC and call CefRequestCallback:: // Continue() at a later time to continue or cancel the request // asynchronously. Return RV_CANCEL to cancel the request immediately. - // + // /// /*--cef(default_retval=RV_CONTINUE)--*/ virtual ReturnValue OnBeforeResourceLoad( @@ -291,12 +289,11 @@ class CefRequestHandler : public virtual CefBaseRefCounted { // be accepted without calling this method. /// /*--cef()--*/ - virtual bool OnCertificateError( - CefRefPtr browser, - cef_errorcode_t cert_error, - const CefString& request_url, - CefRefPtr ssl_info, - CefRefPtr callback) { + virtual bool OnCertificateError(CefRefPtr browser, + cef_errorcode_t cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) { return false; } diff --git a/include/cef_resource_bundle.h b/include/cef_resource_bundle.h index 3fda8998e..c08f5b089 100644 --- a/include/cef_resource_bundle.h +++ b/include/cef_resource_bundle.h @@ -64,7 +64,7 @@ class CefResourceBundle : public virtual CefBaseRefCounted { // of valid string ID values. /// /*--cef()--*/ - virtual CefString GetLocalizedString(int string_id) =0; + virtual CefString GetLocalizedString(int string_id) = 0; /// // Retrieves the contents of the specified scale independent |resource_id|. @@ -77,7 +77,7 @@ class CefResourceBundle : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool GetDataResource(int resource_id, void*& data, - size_t& data_size) =0; + size_t& data_size) = 0; /// // Retrieves the contents of the specified |resource_id| nearest the scale @@ -93,7 +93,7 @@ class CefResourceBundle : public virtual CefBaseRefCounted { virtual bool GetDataResourceForScale(int resource_id, ScaleFactor scale_factor, void*& data, - size_t& data_size) =0; + size_t& data_size) = 0; }; #endif // CEF_INCLUDE_CEF_RESOURCE_BUNDLE_H_ diff --git a/include/cef_resource_bundle_handler.h b/include/cef_resource_bundle_handler.h index 932ef9f5b..6cd6c9afe 100644 --- a/include/cef_resource_bundle_handler.h +++ b/include/cef_resource_bundle_handler.h @@ -57,8 +57,7 @@ class CefResourceBundleHandler : public virtual CefBaseRefCounted { // cef_pack_strings.h for a listing of valid string ID values. /// /*--cef()--*/ - virtual bool GetLocalizedString(int string_id, - CefString& string) =0; + virtual bool GetLocalizedString(int string_id, CefString& string) = 0; /// // Called to retrieve data for the specified scale independent |resource_id|. @@ -71,7 +70,7 @@ class CefResourceBundleHandler : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool GetDataResource(int resource_id, void*& data, - size_t& data_size) =0; + size_t& data_size) = 0; /// // Called to retrieve data for the specified |resource_id| nearest the scale @@ -85,7 +84,7 @@ class CefResourceBundleHandler : public virtual CefBaseRefCounted { virtual bool GetDataResourceForScale(int resource_id, ScaleFactor scale_factor, void*& data, - size_t& data_size) =0; + size_t& data_size) = 0; }; #endif // CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ diff --git a/include/cef_resource_handler.h b/include/cef_resource_handler.h index abe7196dc..02ccea91f 100644 --- a/include/cef_resource_handler.h +++ b/include/cef_resource_handler.h @@ -61,7 +61,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool ProcessRequest(CefRefPtr request, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Retrieve response header information. If the response length is not known @@ -77,7 +77,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void GetResponseHeaders(CefRefPtr response, int64& response_length, - CefString& redirectUrl) =0; + CefString& redirectUrl) = 0; /// // Read response data. If data is available immediately copy up to @@ -90,7 +90,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted { virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; /// // Return true if the specified cookie can be sent with the request or false @@ -111,7 +111,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted { // Request processing has been canceled. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; #endif // CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ diff --git a/include/cef_response.h b/include/cef_response.h index cd7356efd..551464d76 100644 --- a/include/cef_response.h +++ b/include/cef_response.h @@ -38,8 +38,8 @@ #define CEF_INCLUDE_CEF_RESPONSE_H_ #pragma once -#include "include/cef_base.h" #include +#include "include/cef_base.h" /// // Class used to represent a web response. The methods of this class may be @@ -60,7 +60,7 @@ class CefResponse : public virtual CefBaseRefCounted { // Returns true if this object is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Get the response error code. Returns ERR_NONE if there was no error. @@ -79,7 +79,7 @@ class CefResponse : public virtual CefBaseRefCounted { // Get the response status code. /// /*--cef()--*/ - virtual int GetStatus() =0; + virtual int GetStatus() = 0; /// // Set the response status code. @@ -91,7 +91,7 @@ class CefResponse : public virtual CefBaseRefCounted { // Get the response status text. /// /*--cef()--*/ - virtual CefString GetStatusText() =0; + virtual CefString GetStatusText() = 0; /// // Set the response status text. @@ -115,19 +115,19 @@ class CefResponse : public virtual CefBaseRefCounted { // Get the value for the specified response header field. /// /*--cef()--*/ - virtual CefString GetHeader(const CefString& name) =0; + virtual CefString GetHeader(const CefString& name) = 0; /// // Get all response header fields. /// /*--cef()--*/ - virtual void GetHeaderMap(HeaderMap& headerMap) =0; + virtual void GetHeaderMap(HeaderMap& headerMap) = 0; /// // Set all response header fields. /// /*--cef()--*/ - virtual void SetHeaderMap(const HeaderMap& headerMap) =0; + virtual void SetHeaderMap(const HeaderMap& headerMap) = 0; }; #endif // CEF_INCLUDE_CEF_RESPONSE_H_ diff --git a/include/cef_response_filter.h b/include/cef_response_filter.h index 58c978ea1..2eb446fa0 100644 --- a/include/cef_response_filter.h +++ b/include/cef_response_filter.h @@ -54,7 +54,7 @@ class CefResponseFilter : public virtual CefBaseRefCounted { // filter will not be installed if this method returns false. /// /*--cef()--*/ - virtual bool InitFilter() =0; + virtual bool InitFilter() = 0; /// // Called to filter a chunk of data. Expected usage is as follows: @@ -92,7 +92,7 @@ class CefResponseFilter : public virtual CefBaseRefCounted { size_t& data_in_read, void* data_out, size_t data_out_size, - size_t& data_out_written) =0; + size_t& data_out_written) = 0; }; #endif // CEF_INCLUDE_CEF_RESPONSE_FILTER_H_ diff --git a/include/cef_sandbox_win.h b/include/cef_sandbox_win.h index 04444b49f..3b7c4e0b6 100644 --- a/include/cef_sandbox_win.h +++ b/include/cef_sandbox_win.h @@ -73,12 +73,8 @@ void cef_sandbox_info_destroy(void* sandbox_info); /// class CefScopedSandboxInfo { public: - CefScopedSandboxInfo() { - sandbox_info_ = cef_sandbox_info_create(); - } - ~CefScopedSandboxInfo() { - cef_sandbox_info_destroy(sandbox_info_); - } + CefScopedSandboxInfo() { sandbox_info_ = cef_sandbox_info_create(); } + ~CefScopedSandboxInfo() { cef_sandbox_info_destroy(sandbox_info_); } void* sandbox_info() const { return sandbox_info_; } diff --git a/include/cef_scheme.h b/include/cef_scheme.h index 24b0c55bc..d1b960825 100644 --- a/include/cef_scheme.h +++ b/include/cef_scheme.h @@ -42,12 +42,11 @@ #include "include/cef_browser.h" #include "include/cef_frame.h" #include "include/cef_request.h" -#include "include/cef_response.h" #include "include/cef_resource_handler.h" +#include "include/cef_response.h" class CefSchemeHandlerFactory; - /// // Register a scheme handler factory with the global request context. An empty // |domain_name| value for a standard scheme will cause the factory to match all @@ -77,7 +76,6 @@ bool CefRegisterSchemeHandlerFactory( /*--cef()--*/ bool CefClearSchemeHandlerFactories(); - /// // Class that manages custom scheme registrations. /// @@ -150,10 +148,9 @@ class CefSchemeRegistrar : public CefBaseScoped { bool is_display_isolated, bool is_secure, bool is_cors_enabled, - bool is_csp_bypassing) =0; + bool is_csp_bypassing) = 0; }; - /// // Class that creates CefResourceHandler instances for handling scheme requests. // The methods of this class will always be called on the IO thread. @@ -174,7 +171,7 @@ class CefSchemeHandlerFactory : public virtual CefBaseRefCounted { CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, - CefRefPtr request) =0; + CefRefPtr request) = 0; }; #endif // CEF_INCLUDE_CEF_SCHEME_H_ diff --git a/include/cef_ssl_info.h b/include/cef_ssl_info.h index db075cabc..1ede59084 100644 --- a/include/cef_ssl_info.h +++ b/include/cef_ssl_info.h @@ -54,16 +54,15 @@ class CefSSLInfo : public virtual CefBaseRefCounted { // certificate. /// /*--cef(default_retval=CERT_STATUS_NONE)--*/ - virtual cef_cert_status_t GetCertStatus() =0; + virtual cef_cert_status_t GetCertStatus() = 0; /// // Returns the X.509 certificate. /// /*--cef()--*/ - virtual CefRefPtr GetX509Certificate() =0; + virtual CefRefPtr GetX509Certificate() = 0; }; - /// // Returns true if the certificate status has any error, major or minor. /// diff --git a/include/cef_ssl_status.h b/include/cef_ssl_status.h index 3a5f39501..002ac4912 100644 --- a/include/cef_ssl_status.h +++ b/include/cef_ssl_status.h @@ -52,32 +52,32 @@ class CefSSLStatus : public virtual CefBaseRefCounted { // Returns true if the status is related to a secure SSL/TLS connection. /// /*--cef()--*/ - virtual bool IsSecureConnection() =0; + virtual bool IsSecureConnection() = 0; /// // Returns a bitmask containing any and all problems verifying the server // certificate. /// /*--cef(default_retval=CERT_STATUS_NONE)--*/ - virtual cef_cert_status_t GetCertStatus() =0; + virtual cef_cert_status_t GetCertStatus() = 0; /// // Returns the SSL version used for the SSL connection. /// /*--cef(default_retval=SSL_CONNECTION_VERSION_UNKNOWN)--*/ - virtual cef_ssl_version_t GetSSLVersion() =0; + virtual cef_ssl_version_t GetSSLVersion() = 0; /// // Returns a bitmask containing the page security content status. /// /*--cef(default_retval=SSL_CONTENT_NORMAL_CONTENT)--*/ - virtual cef_ssl_content_status_t GetContentStatus() =0; + virtual cef_ssl_content_status_t GetContentStatus() = 0; /// // Returns the X.509 certificate. /// /*--cef()--*/ - virtual CefRefPtr GetX509Certificate() =0; + virtual CefRefPtr GetX509Certificate() = 0; }; #endif // CEF_INCLUDE_CEF_SSL_STATUS_H_ diff --git a/include/cef_stream.h b/include/cef_stream.h index 81b0b9164..c40392e02 100644 --- a/include/cef_stream.h +++ b/include/cef_stream.h @@ -50,7 +50,7 @@ class CefReadHandler : public virtual CefBaseRefCounted { // Read raw binary data. /// /*--cef()--*/ - virtual size_t Read(void* ptr, size_t size, size_t n) =0; + virtual size_t Read(void* ptr, size_t size, size_t n) = 0; /// // Seek to the specified offset position. |whence| may be any one of @@ -58,19 +58,19 @@ class CefReadHandler : public virtual CefBaseRefCounted { // failure. /// /*--cef()--*/ - virtual int Seek(int64 offset, int whence) =0; + virtual int Seek(int64 offset, int whence) = 0; /// // Return the current offset position. /// /*--cef()--*/ - virtual int64 Tell() =0; + virtual int64 Tell() = 0; /// // Return non-zero if at end of file. /// /*--cef()--*/ - virtual int Eof() =0; + virtual int Eof() = 0; /// // Return true if this handler performs work like accessing the file system @@ -78,10 +78,9 @@ class CefReadHandler : public virtual CefBaseRefCounted { // handler from. /// /*--cef()--*/ - virtual bool MayBlock() =0; + virtual bool MayBlock() = 0; }; - /// // Class used to read data from a stream. The methods of this class may be // called on any thread. @@ -110,7 +109,7 @@ class CefStreamReader : public virtual CefBaseRefCounted { // Read raw binary data. /// /*--cef()--*/ - virtual size_t Read(void* ptr, size_t size, size_t n) =0; + virtual size_t Read(void* ptr, size_t size, size_t n) = 0; /// // Seek to the specified offset position. |whence| may be any one of @@ -118,19 +117,19 @@ class CefStreamReader : public virtual CefBaseRefCounted { // failure. /// /*--cef()--*/ - virtual int Seek(int64 offset, int whence) =0; + virtual int Seek(int64 offset, int whence) = 0; /// // Return the current offset position. /// /*--cef()--*/ - virtual int64 Tell() =0; + virtual int64 Tell() = 0; /// // Return non-zero if at end of file. /// /*--cef()--*/ - virtual int Eof() =0; + virtual int Eof() = 0; /// // Returns true if this reader performs work like accessing the file system @@ -138,10 +137,9 @@ class CefStreamReader : public virtual CefBaseRefCounted { // reader from. /// /*--cef()--*/ - virtual bool MayBlock() =0; + virtual bool MayBlock() = 0; }; - /// // Interface the client can implement to provide a custom stream writer. The // methods of this class may be called on any thread. @@ -153,7 +151,7 @@ class CefWriteHandler : public virtual CefBaseRefCounted { // Write raw binary data. /// /*--cef()--*/ - virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + virtual size_t Write(const void* ptr, size_t size, size_t n) = 0; /// // Seek to the specified offset position. |whence| may be any one of @@ -161,19 +159,19 @@ class CefWriteHandler : public virtual CefBaseRefCounted { // failure. /// /*--cef()--*/ - virtual int Seek(int64 offset, int whence) =0; + virtual int Seek(int64 offset, int whence) = 0; /// // Return the current offset position. /// /*--cef()--*/ - virtual int64 Tell() =0; + virtual int64 Tell() = 0; /// // Flush the stream. /// /*--cef()--*/ - virtual int Flush() =0; + virtual int Flush() = 0; /// // Return true if this handler performs work like accessing the file system @@ -181,10 +179,9 @@ class CefWriteHandler : public virtual CefBaseRefCounted { // handler from. /// /*--cef()--*/ - virtual bool MayBlock() =0; + virtual bool MayBlock() = 0; }; - /// // Class used to write data to a stream. The methods of this class may be called // on any thread. @@ -208,7 +205,7 @@ class CefStreamWriter : public virtual CefBaseRefCounted { // Write raw binary data. /// /*--cef()--*/ - virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + virtual size_t Write(const void* ptr, size_t size, size_t n) = 0; /// // Seek to the specified offset position. |whence| may be any one of @@ -216,19 +213,19 @@ class CefStreamWriter : public virtual CefBaseRefCounted { // failure. /// /*--cef()--*/ - virtual int Seek(int64 offset, int whence) =0; + virtual int Seek(int64 offset, int whence) = 0; /// // Return the current offset position. /// /*--cef()--*/ - virtual int64 Tell() =0; + virtual int64 Tell() = 0; /// // Flush the stream. /// /*--cef()--*/ - virtual int Flush() =0; + virtual int Flush() = 0; /// // Returns true if this writer performs work like accessing the file system @@ -236,7 +233,7 @@ class CefStreamWriter : public virtual CefBaseRefCounted { // writer from. /// /*--cef()--*/ - virtual bool MayBlock() =0; + virtual bool MayBlock() = 0; }; #endif // CEF_INCLUDE_CEF_STREAM_H_ diff --git a/include/cef_string_visitor.h b/include/cef_string_visitor.h index 36a97ba35..f23dfb6a0 100644 --- a/include/cef_string_visitor.h +++ b/include/cef_string_visitor.h @@ -49,7 +49,7 @@ class CefStringVisitor : public virtual CefBaseRefCounted { // Method that will be executed. /// /*--cef(optional_param=string)--*/ - virtual void Visit(const CefString& string) =0; + virtual void Visit(const CefString& string) = 0; }; #endif // CEF_INCLUDE_CEF_STRING_VISITOR_H_ diff --git a/include/cef_task.h b/include/cef_task.h index ea3b2d96b..a892d3953 100644 --- a/include/cef_task.h +++ b/include/cef_task.h @@ -56,7 +56,7 @@ class CefTask : public virtual CefBaseRefCounted { // Method that will be executed on the target thread. /// /*--cef()--*/ - virtual void Execute() =0; + virtual void Execute() = 0; }; /// @@ -90,26 +90,26 @@ class CefTaskRunner : public virtual CefBaseRefCounted { // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if this task runner belongs to the current thread. /// /*--cef()--*/ - virtual bool BelongsToCurrentThread() =0; + virtual bool BelongsToCurrentThread() = 0; /// // Returns true if this task runner is for the specified CEF thread. /// /*--cef()--*/ - virtual bool BelongsToThread(CefThreadId threadId) =0; + virtual bool BelongsToThread(CefThreadId threadId) = 0; /// // Post a task for execution on the thread associated with this task runner. // Execution will occur asynchronously. /// /*--cef()--*/ - virtual bool PostTask(CefRefPtr task) =0; + virtual bool PostTask(CefRefPtr task) = 0; /// // Post a task for delayed execution on the thread associated with this task @@ -118,10 +118,9 @@ class CefTaskRunner : public virtual CefBaseRefCounted { // specified delay. /// /*--cef()--*/ - virtual bool PostDelayedTask(CefRefPtr task, int64 delay_ms) =0; + virtual bool PostDelayedTask(CefRefPtr task, int64 delay_ms) = 0; }; - /// // Returns true if called on the specified thread. Equivalent to using // CefTaskRunner::GetForThread(threadId)->BelongsToCurrentThread(). @@ -141,8 +140,8 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr task); // using CefTaskRunner::GetForThread(threadId)->PostDelayedTask(task, delay_ms). /// /*--cef()--*/ -bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, +bool CefPostDelayedTask(CefThreadId threadId, + CefRefPtr task, int64 delay_ms); - #endif // CEF_INCLUDE_CEF_TASK_H_ diff --git a/include/cef_thread.h b/include/cef_thread.h index dfe652d2e..1d0bd4cc8 100644 --- a/include/cef_thread.h +++ b/include/cef_thread.h @@ -89,14 +89,14 @@ class CefThread : public CefBaseRefCounted { // loop. This method is safe to call from any thread. /// /*--cef()--*/ - virtual CefRefPtr GetTaskRunner() =0; + virtual CefRefPtr GetTaskRunner() = 0; /// // Returns the platform thread ID. It will return the same value after Stop() // is called. This method is safe to call from any thread. /// /*--cef(default_retval=kInvalidPlatformThreadId)--*/ - virtual cef_platform_thread_id_t GetPlatformThreadId() =0; + virtual cef_platform_thread_id_t GetPlatformThreadId() = 0; /// // Stop and join the thread. This method must be called from the same thread @@ -104,14 +104,14 @@ class CefThread : public CefBaseRefCounted { // called with a |stoppable| value of false. /// /*--cef()--*/ - virtual void Stop() =0; + virtual void Stop() = 0; /// // Returns true if the thread is currently running. This method must be called // from the same thread that called CreateThread(). /// /*--cef()--*/ - virtual bool IsRunning() =0; + virtual bool IsRunning() = 0; }; #endif // CEF_INCLUDE_CEF_THREAD_H_ diff --git a/include/cef_trace.h b/include/cef_trace.h index fa7f62781..bc92d3890 100644 --- a/include/cef_trace.h +++ b/include/cef_trace.h @@ -57,10 +57,9 @@ class CefEndTracingCallback : public virtual CefBaseRefCounted { // deleting |tracing_file|. /// /*--cef()--*/ - virtual void OnEndTracingComplete(const CefString& tracing_file) =0; + virtual void OnEndTracingComplete(const CefString& tracing_file) = 0; }; - /// // Start tracing events on all processes. Tracing is initialized asynchronously // and |callback| will be executed on the UI thread after initialization is diff --git a/include/cef_urlrequest.h b/include/cef_urlrequest.h index 23bc821ec..a8e15ed96 100644 --- a/include/cef_urlrequest.h +++ b/include/cef_urlrequest.h @@ -85,26 +85,26 @@ class CefURLRequest : public virtual CefBaseRefCounted { // object is read-only and should not be modified. /// /*--cef()--*/ - virtual CefRefPtr GetRequest() =0; + virtual CefRefPtr GetRequest() = 0; /// // Returns the client. /// /*--cef()--*/ - virtual CefRefPtr GetClient() =0; + virtual CefRefPtr GetClient() = 0; /// // Returns the request status. /// /*--cef(default_retval=UR_UNKNOWN)--*/ - virtual Status GetRequestStatus() =0; + virtual Status GetRequestStatus() = 0; /// // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 // otherwise. /// /*--cef(default_retval=ERR_NONE)--*/ - virtual ErrorCode GetRequestError() =0; + virtual ErrorCode GetRequestError() = 0; /// // Returns the response, or NULL if no response information is available. @@ -112,13 +112,13 @@ class CefURLRequest : public virtual CefBaseRefCounted { // The returned object is read-only and should not be modified. /// /*--cef()--*/ - virtual CefRefPtr GetResponse() =0; + virtual CefRefPtr GetResponse() = 0; /// // Cancel the request. /// /*--cef()--*/ - virtual void Cancel() =0; + virtual void Cancel() = 0; }; /// @@ -135,7 +135,7 @@ class CefURLRequestClient : public virtual CefBaseRefCounted { // successful or not. /// /*--cef()--*/ - virtual void OnRequestComplete(CefRefPtr request) =0; + virtual void OnRequestComplete(CefRefPtr request) = 0; /// // Notifies the client of upload progress. |current| denotes the number of @@ -146,7 +146,7 @@ class CefURLRequestClient : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void OnUploadProgress(CefRefPtr request, int64 current, - int64 total) =0; + int64 total) = 0; /// // Notifies the client of download progress. |current| denotes the number of @@ -156,7 +156,7 @@ class CefURLRequestClient : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void OnDownloadProgress(CefRefPtr request, int64 current, - int64 total) =0; + int64 total) = 0; /// // Called when some part of the response is read. |data| contains the current @@ -166,7 +166,7 @@ class CefURLRequestClient : public virtual CefBaseRefCounted { /*--cef()--*/ virtual void OnDownloadData(CefRefPtr request, const void* data, - size_t data_length) =0; + size_t data_length) = 0; /// // Called on the IO thread when the browser needs credentials from the user. @@ -182,7 +182,7 @@ class CefURLRequestClient : public virtual CefBaseRefCounted { int port, const CefString& realm, const CefString& scheme, - CefRefPtr callback) =0; + CefRefPtr callback) = 0; }; #endif // CEF_INCLUDE_CEF_URLREQUEST_H_ diff --git a/include/cef_v8.h b/include/cef_v8.h index 2ec4feb8e..819912561 100644 --- a/include/cef_v8.h +++ b/include/cef_v8.h @@ -34,23 +34,21 @@ // tools directory for more information. // - #ifndef CEF_INCLUDE_CEF_V8_H_ #define CEF_INCLUDE_CEF_V8_H_ #pragma once +#include #include "include/cef_base.h" #include "include/cef_browser.h" #include "include/cef_frame.h" #include "include/cef_task.h" -#include class CefV8Exception; class CefV8Handler; class CefV8StackFrame; class CefV8Value; - /// // Register a new V8 extension with the specified JavaScript extension code and // handler. Functions implemented by the handler are prototyped using the @@ -115,7 +113,6 @@ bool CefRegisterExtension(const CefString& extension_name, const CefString& javascript_code, CefRefPtr handler); - /// // Class representing a V8 context handle. V8 handles can only be accessed from // the thread on which they are created. Valid threads for creating a V8 handle @@ -150,7 +147,7 @@ class CefV8Context : public virtual CefBaseRefCounted { // called on any render process thread. /// /*--cef()--*/ - virtual CefRefPtr GetTaskRunner() =0; + virtual CefRefPtr GetTaskRunner() = 0; /// // Returns true if the underlying handle is valid and it can be accessed on @@ -158,28 +155,28 @@ class CefV8Context : public virtual CefBaseRefCounted { // false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns the browser for this context. This method will return an empty // reference for WebWorker contexts. /// /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; + virtual CefRefPtr GetBrowser() = 0; /// // Returns the frame for this context. This method will return an empty // reference for WebWorker contexts. /// /*--cef()--*/ - virtual CefRefPtr GetFrame() =0; + virtual CefRefPtr GetFrame() = 0; /// // Returns the global object for this context. The context must be entered // before calling this method. /// /*--cef()--*/ - virtual CefRefPtr GetGlobal() =0; + virtual CefRefPtr GetGlobal() = 0; /// // Enter this context. A context must be explicitly entered before creating a @@ -189,21 +186,21 @@ class CefV8Context : public virtual CefBaseRefCounted { // the scope was entered successfully. /// /*--cef()--*/ - virtual bool Enter() =0; + virtual bool Enter() = 0; /// // Exit this context. Call this method only after calling Enter(). Returns // true if the scope was exited successfully. /// /*--cef()--*/ - virtual bool Exit() =0; + virtual bool Exit() = 0; /// // Returns true if this object is pointing to the same handle as |that| // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Execute a string of JavaScript code in this V8 context. The |script_url| @@ -218,11 +215,10 @@ class CefV8Context : public virtual CefBaseRefCounted { const CefString& script_url, int start_line, CefRefPtr& retval, - CefRefPtr& exception) =0; + CefRefPtr& exception) = 0; }; - -typedef std::vector > CefV8ValueList; +typedef std::vector> CefV8ValueList; /// // Interface that should be implemented to handle V8 function calls. The methods @@ -243,7 +239,7 @@ class CefV8Handler : public virtual CefBaseRefCounted { CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) =0; + CefString& exception) = 0; }; /// @@ -265,7 +261,7 @@ class CefV8Accessor : public virtual CefBaseRefCounted { virtual bool Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, - CefString& exception) =0; + CefString& exception) = 0; /// // Handle assignment of the accessor value identified by |name|. |object| is @@ -278,7 +274,7 @@ class CefV8Accessor : public virtual CefBaseRefCounted { virtual bool Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, - CefString& exception) =0; + CefString& exception) = 0; }; /// @@ -291,7 +287,7 @@ class CefV8Accessor : public virtual CefBaseRefCounted { /// /*--cef(source=client)--*/ class CefV8Interceptor : public virtual CefBaseRefCounted { -public: + public: /// // Handle retrieval of the interceptor value identified by |name|. |object| is // the receiver ('this' object) of the interceptor. If retrieval succeeds, set @@ -305,7 +301,7 @@ public: virtual bool Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, - CefString& exception) =0; + CefString& exception) = 0; /// // Handle retrieval of the interceptor value identified by |index|. |object| @@ -319,7 +315,7 @@ public: virtual bool Get(int index, const CefRefPtr object, CefRefPtr& retval, - CefString& exception) =0; + CefString& exception) = 0; /// // Handle assignment of the interceptor value identified by |name|. |object| @@ -333,7 +329,7 @@ public: virtual bool Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, - CefString& exception) =0; + CefString& exception) = 0; /// // Handle assignment of the interceptor value identified by |index|. |object| @@ -346,7 +342,7 @@ public: virtual bool Set(int index, const CefRefPtr object, const CefRefPtr value, - CefString& exception) =0; + CefString& exception) = 0; }; /// @@ -360,55 +356,55 @@ class CefV8Exception : public virtual CefBaseRefCounted { // Returns the exception message. /// /*--cef()--*/ - virtual CefString GetMessage() =0; + virtual CefString GetMessage() = 0; /// // Returns the line of source code that the exception occurred within. /// /*--cef()--*/ - virtual CefString GetSourceLine() =0; + virtual CefString GetSourceLine() = 0; /// // Returns the resource name for the script from where the function causing // the error originates. /// /*--cef()--*/ - virtual CefString GetScriptResourceName() =0; + virtual CefString GetScriptResourceName() = 0; /// // Returns the 1-based number of the line where the error occurred or 0 if the // line number is unknown. /// /*--cef()--*/ - virtual int GetLineNumber() =0; + virtual int GetLineNumber() = 0; /// // Returns the index within the script of the first character where the error // occurred. /// /*--cef()--*/ - virtual int GetStartPosition() =0; + virtual int GetStartPosition() = 0; /// // Returns the index within the script of the last character where the error // occurred. /// /*--cef()--*/ - virtual int GetEndPosition() =0; + virtual int GetEndPosition() = 0; /// // Returns the index within the line of the first character where the error // occurred. /// /*--cef()--*/ - virtual int GetStartColumn() =0; + virtual int GetStartColumn() = 0; /// // Returns the index within the line of the last character where the error // occurred. /// /*--cef()--*/ - virtual int GetEndColumn() =0; + virtual int GetEndColumn() = 0; }; /// @@ -513,117 +509,116 @@ class CefV8Value : public virtual CefBaseRefCounted { // false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // True if the value type is undefined. /// /*--cef()--*/ - virtual bool IsUndefined() =0; + virtual bool IsUndefined() = 0; /// // True if the value type is null. /// /*--cef()--*/ - virtual bool IsNull() =0; + virtual bool IsNull() = 0; /// // True if the value type is bool. /// /*--cef()--*/ - virtual bool IsBool() =0; + virtual bool IsBool() = 0; /// // True if the value type is int. /// /*--cef()--*/ - virtual bool IsInt() =0; + virtual bool IsInt() = 0; /// // True if the value type is unsigned int. /// /*--cef()--*/ - virtual bool IsUInt() =0; + virtual bool IsUInt() = 0; /// // True if the value type is double. /// /*--cef()--*/ - virtual bool IsDouble() =0; + virtual bool IsDouble() = 0; /// // True if the value type is Date. /// /*--cef()--*/ - virtual bool IsDate() =0; + virtual bool IsDate() = 0; /// // True if the value type is string. /// /*--cef()--*/ - virtual bool IsString() =0; + virtual bool IsString() = 0; /// // True if the value type is object. /// /*--cef()--*/ - virtual bool IsObject() =0; + virtual bool IsObject() = 0; /// // True if the value type is array. /// /*--cef()--*/ - virtual bool IsArray() =0; + virtual bool IsArray() = 0; /// // True if the value type is function. /// /*--cef()--*/ - virtual bool IsFunction() =0; + virtual bool IsFunction() = 0; /// // Returns true if this object is pointing to the same handle as |that| // object. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Return a bool value. /// /*--cef()--*/ - virtual bool GetBoolValue() =0; + virtual bool GetBoolValue() = 0; /// // Return an int value. /// /*--cef()--*/ - virtual int32 GetIntValue() =0; + virtual int32 GetIntValue() = 0; /// // Return an unsigned int value. /// /*--cef()--*/ - virtual uint32 GetUIntValue() =0; + virtual uint32 GetUIntValue() = 0; /// // Return a double value. /// /*--cef()--*/ - virtual double GetDoubleValue() =0; + virtual double GetDoubleValue() = 0; /// // Return a Date value. /// /*--cef()--*/ - virtual CefTime GetDateValue() =0; + virtual CefTime GetDateValue() = 0; /// // Return a string value. /// /*--cef()--*/ - virtual CefString GetStringValue() =0; - + virtual CefString GetStringValue() = 0; // OBJECT METHODS - These methods are only available on objects. Arrays and // functions are also objects. String- and integer-based keys can be used @@ -633,34 +628,34 @@ class CefV8Value : public virtual CefBaseRefCounted { // Returns true if this is a user created object. /// /*--cef()--*/ - virtual bool IsUserCreated() =0; + virtual bool IsUserCreated() = 0; /// // Returns true if the last method call resulted in an exception. This // attribute exists only in the scope of the current CEF value object. /// /*--cef()--*/ - virtual bool HasException() =0; + virtual bool HasException() = 0; /// // Returns the exception resulting from the last method call. This attribute // exists only in the scope of the current CEF value object. /// /*--cef()--*/ - virtual CefRefPtr GetException() =0; + virtual CefRefPtr GetException() = 0; /// // Clears the last exception and returns true on success. /// /*--cef()--*/ - virtual bool ClearException() =0; + virtual bool ClearException() = 0; /// // Returns true if this object will re-throw future exceptions. This attribute // exists only in the scope of the current CEF value object. /// /*--cef()--*/ - virtual bool WillRethrowExceptions() =0; + virtual bool WillRethrowExceptions() = 0; /// // Set whether this object will re-throw future exceptions. By default @@ -670,19 +665,19 @@ class CefV8Value : public virtual CefBaseRefCounted { // only in the scope of the current CEF value object. /// /*--cef()--*/ - virtual bool SetRethrowExceptions(bool rethrow) =0; + virtual bool SetRethrowExceptions(bool rethrow) = 0; /// // Returns true if the object has a value with the specified identifier. /// /*--cef(capi_name=has_value_bykey,optional_param=key)--*/ - virtual bool HasValue(const CefString& key) =0; + virtual bool HasValue(const CefString& key) = 0; /// // Returns true if the object has a value with the specified identifier. /// /*--cef(capi_name=has_value_byindex,index_param=index)--*/ - virtual bool HasValue(int index) =0; + virtual bool HasValue(int index) = 0; /// // Deletes the value with the specified identifier and returns true on @@ -691,7 +686,7 @@ class CefV8Value : public virtual CefBaseRefCounted { // true even though deletion failed. /// /*--cef(capi_name=delete_value_bykey,optional_param=key)--*/ - virtual bool DeleteValue(const CefString& key) =0; + virtual bool DeleteValue(const CefString& key) = 0; /// // Deletes the value with the specified identifier and returns true on @@ -700,21 +695,21 @@ class CefV8Value : public virtual CefBaseRefCounted { // method will return true even though deletion failed. /// /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ - virtual bool DeleteValue(int index) =0; + virtual bool DeleteValue(int index) = 0; /// // Returns the value with the specified identifier on success. Returns NULL // if this method is called incorrectly or an exception is thrown. /// /*--cef(capi_name=get_value_bykey,optional_param=key)--*/ - virtual CefRefPtr GetValue(const CefString& key) =0; + virtual CefRefPtr GetValue(const CefString& key) = 0; /// // Returns the value with the specified identifier on success. Returns NULL // if this method is called incorrectly or an exception is thrown. /// /*--cef(capi_name=get_value_byindex,index_param=index)--*/ - virtual CefRefPtr GetValue(int index) =0; + virtual CefRefPtr GetValue(int index) = 0; /// // Associates a value with the specified identifier and returns true on @@ -723,8 +718,9 @@ class CefV8Value : public virtual CefBaseRefCounted { // assignment failed. /// /*--cef(capi_name=set_value_bykey,optional_param=key)--*/ - virtual bool SetValue(const CefString& key, CefRefPtr value, - PropertyAttribute attribute) =0; + virtual bool SetValue(const CefString& key, + CefRefPtr value, + PropertyAttribute attribute) = 0; /// // Associates a value with the specified identifier and returns true on @@ -733,7 +729,7 @@ class CefV8Value : public virtual CefBaseRefCounted { // assignment failed. /// /*--cef(capi_name=set_value_byindex,index_param=index)--*/ - virtual bool SetValue(int index, CefRefPtr value) =0; + virtual bool SetValue(int index, CefRefPtr value) = 0; /// // Registers an identifier and returns true on success. Access to the @@ -743,15 +739,16 @@ class CefV8Value : public virtual CefBaseRefCounted { // will return true even though assignment failed. /// /*--cef(capi_name=set_value_byaccessor,optional_param=key)--*/ - virtual bool SetValue(const CefString& key, AccessControl settings, - PropertyAttribute attribute) =0; + virtual bool SetValue(const CefString& key, + AccessControl settings, + PropertyAttribute attribute) = 0; /// // Read the keys for the object's values into the specified vector. Integer- // based keys will also be returned as strings. /// /*--cef()--*/ - virtual bool GetKeys(std::vector& keys) =0; + virtual bool GetKeys(std::vector& keys) = 0; /// // Sets the user data for this object and returns true on success. Returns @@ -759,20 +756,20 @@ class CefV8Value : public virtual CefBaseRefCounted { // on user created objects. /// /*--cef(optional_param=user_data)--*/ - virtual bool SetUserData(CefRefPtr user_data) =0; + virtual bool SetUserData(CefRefPtr user_data) = 0; /// // Returns the user data, if any, assigned to this object. /// /*--cef()--*/ - virtual CefRefPtr GetUserData() =0; + virtual CefRefPtr GetUserData() = 0; /// // Returns the amount of externally allocated memory registered for the // object. /// /*--cef()--*/ - virtual int GetExternallyAllocatedMemory() =0; + virtual int GetExternallyAllocatedMemory() = 0; /// // Adjusts the amount of registered external memory for the object. Used to @@ -786,8 +783,7 @@ class CefV8Value : public virtual CefBaseRefCounted { // only be called on user created objects. /// /*--cef()--*/ - virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0; - + virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) = 0; // ARRAY METHODS - These methods are only available on arrays. @@ -795,8 +791,7 @@ class CefV8Value : public virtual CefBaseRefCounted { // Returns the number of elements in the array. /// /*--cef()--*/ - virtual int GetArrayLength() =0; - + virtual int GetArrayLength() = 0; // FUNCTION METHODS - These methods are only available on functions. @@ -804,13 +799,13 @@ class CefV8Value : public virtual CefBaseRefCounted { // Returns the function name. /// /*--cef()--*/ - virtual CefString GetFunctionName() =0; + virtual CefString GetFunctionName() = 0; /// // Returns the function handler or NULL if not a CEF-created function. /// /*--cef()--*/ - virtual CefRefPtr GetFunctionHandler() =0; + virtual CefRefPtr GetFunctionHandler() = 0; /// // Execute the function using the current V8 context. This method should only @@ -825,7 +820,7 @@ class CefV8Value : public virtual CefBaseRefCounted { /*--cef(optional_param=object)--*/ virtual CefRefPtr ExecuteFunction( CefRefPtr object, - const CefV8ValueList& arguments) =0; + const CefV8ValueList& arguments) = 0; /// // Execute the function using the specified V8 context. |object| is the @@ -839,7 +834,7 @@ class CefV8Value : public virtual CefBaseRefCounted { virtual CefRefPtr ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, - const CefV8ValueList& arguments) =0; + const CefV8ValueList& arguments) = 0; }; /// @@ -865,19 +860,19 @@ class CefV8StackTrace : public virtual CefBaseRefCounted { // false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns the number of stack frames. /// /*--cef()--*/ - virtual int GetFrameCount() =0; + virtual int GetFrameCount() = 0; /// // Returns the stack frame at the specified 0-based index. /// /*--cef()--*/ - virtual CefRefPtr GetFrame(int index) =0; + virtual CefRefPtr GetFrame(int index) = 0; }; /// @@ -896,13 +891,13 @@ class CefV8StackFrame : public virtual CefBaseRefCounted { // false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns the name of the resource script that contains the function. /// /*--cef()--*/ - virtual CefString GetScriptName() =0; + virtual CefString GetScriptName() = 0; /// // Returns the name of the resource script that contains the function or the @@ -910,38 +905,38 @@ class CefV8StackFrame : public virtual CefBaseRefCounted { // a "//@ sourceURL=..." string. /// /*--cef()--*/ - virtual CefString GetScriptNameOrSourceURL() =0; + virtual CefString GetScriptNameOrSourceURL() = 0; /// // Returns the name of the function. /// /*--cef()--*/ - virtual CefString GetFunctionName() =0; + virtual CefString GetFunctionName() = 0; /// // Returns the 1-based line number for the function call or 0 if unknown. /// /*--cef()--*/ - virtual int GetLineNumber() =0; + virtual int GetLineNumber() = 0; /// // Returns the 1-based column offset on the line for the function call or 0 if // unknown. /// /*--cef()--*/ - virtual int GetColumn() =0; + virtual int GetColumn() = 0; /// // Returns true if the function was compiled using eval(). /// /*--cef()--*/ - virtual bool IsEval() =0; + virtual bool IsEval() = 0; /// // Returns true if the function was called as a constructor via "new". /// /*--cef()--*/ - virtual bool IsConstructor() =0; + virtual bool IsConstructor() = 0; }; #endif // CEF_INCLUDE_CEF_V8_H_ diff --git a/include/cef_values.h b/include/cef_values.h index 6bbd1e27d..be88794e8 100644 --- a/include/cef_values.h +++ b/include/cef_values.h @@ -70,20 +70,20 @@ class CefValue : public virtual CefBaseRefCounted { // invalid. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if the underlying data is owned by another object. /// /*--cef()--*/ - virtual bool IsOwned() =0; + virtual bool IsOwned() = 0; /// // Returns true if the underlying data is read-only. Some APIs may expose // read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns true if this object and |that| object have the same underlying @@ -91,50 +91,50 @@ class CefValue : public virtual CefBaseRefCounted { // and vice-versa. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if this object and |that| object have an equivalent underlying // value but are not necessarily the same object. /// /*--cef()--*/ - virtual bool IsEqual(CefRefPtr that) =0; + virtual bool IsEqual(CefRefPtr that) = 0; /// // Returns a copy of this object. The underlying data will also be copied. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Returns the underlying value type. /// /*--cef(default_retval=VTYPE_INVALID)--*/ - virtual CefValueType GetType() =0; + virtual CefValueType GetType() = 0; /// // Returns the underlying value as type bool. /// /*--cef()--*/ - virtual bool GetBool() =0; + virtual bool GetBool() = 0; /// // Returns the underlying value as type int. /// /*--cef()--*/ - virtual int GetInt() =0; + virtual int GetInt() = 0; /// // Returns the underlying value as type double. /// /*--cef()--*/ - virtual double GetDouble() =0; + virtual double GetDouble() = 0; /// // Returns the underlying value as type string. /// /*--cef()--*/ - virtual CefString GetString() =0; + virtual CefString GetString() = 0; /// // Returns the underlying value as type binary. The returned reference may @@ -145,7 +145,7 @@ class CefValue : public virtual CefBaseRefCounted { // to SetBinary(). /// /*--cef()--*/ - virtual CefRefPtr GetBinary() =0; + virtual CefRefPtr GetBinary() = 0; /// // Returns the underlying value as type dictionary. The returned reference may @@ -156,7 +156,7 @@ class CefValue : public virtual CefBaseRefCounted { // to SetDictionary(). /// /*--cef()--*/ - virtual CefRefPtr GetDictionary() =0; + virtual CefRefPtr GetDictionary() = 0; /// // Returns the underlying value as type list. The returned reference may @@ -167,42 +167,42 @@ class CefValue : public virtual CefBaseRefCounted { // to SetList(). /// /*--cef()--*/ - virtual CefRefPtr GetList() =0; + virtual CefRefPtr GetList() = 0; /// // Sets the underlying value as type null. Returns true if the value was set // successfully. /// /*--cef()--*/ - virtual bool SetNull() =0; + virtual bool SetNull() = 0; /// // Sets the underlying value as type bool. Returns true if the value was set // successfully. /// /*--cef()--*/ - virtual bool SetBool(bool value) =0; + virtual bool SetBool(bool value) = 0; /// // Sets the underlying value as type int. Returns true if the value was set // successfully. /// /*--cef()--*/ - virtual bool SetInt(int value) =0; + virtual bool SetInt(int value) = 0; /// // Sets the underlying value as type double. Returns true if the value was set // successfully. /// /*--cef()--*/ - virtual bool SetDouble(double value) =0; + virtual bool SetDouble(double value) = 0; /// // Sets the underlying value as type string. Returns true if the value was set // successfully. /// /*--cef(optional_param=value)--*/ - virtual bool SetString(const CefString& value) =0; + virtual bool SetString(const CefString& value) = 0; /// // Sets the underlying value as type binary. Returns true if the value was set @@ -210,7 +210,7 @@ class CefValue : public virtual CefBaseRefCounted { // underlying data remains unchanged. /// /*--cef()--*/ - virtual bool SetBinary(CefRefPtr value) =0; + virtual bool SetBinary(CefRefPtr value) = 0; /// // Sets the underlying value as type dict. Returns true if the value was set @@ -218,7 +218,7 @@ class CefValue : public virtual CefBaseRefCounted { // underlying data remains unchanged. /// /*--cef()--*/ - virtual bool SetDictionary(CefRefPtr value) =0; + virtual bool SetDictionary(CefRefPtr value) = 0; /// // Sets the underlying value as type list. Returns true if the value was set @@ -226,10 +226,9 @@ class CefValue : public virtual CefBaseRefCounted { // underlying data remains unchanged. /// /*--cef()--*/ - virtual bool SetList(CefRefPtr value) =0; + virtual bool SetList(CefRefPtr value) = 0; }; - /// // Class representing a binary value. Can be used on any process and thread. /// @@ -241,8 +240,7 @@ class CefBinaryValue : public virtual CefBaseRefCounted { // |data| will be copied. /// /*--cef()--*/ - static CefRefPtr Create(const void* data, - size_t data_size); + static CefRefPtr Create(const void* data, size_t data_size); /// // Returns true if this object is valid. This object may become invalid if @@ -251,39 +249,39 @@ class CefBinaryValue : public virtual CefBaseRefCounted { // methods if this method returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if this object is currently owned by another object. /// /*--cef()--*/ - virtual bool IsOwned() =0; + virtual bool IsOwned() = 0; /// // Returns true if this object and |that| object have the same underlying // data. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if this object and |that| object have an equivalent underlying // value but are not necessarily the same object. /// /*--cef()--*/ - virtual bool IsEqual(CefRefPtr that) =0; + virtual bool IsEqual(CefRefPtr that) = 0; /// // Returns a copy of this object. The data in this object will also be copied. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Returns the data size. /// /*--cef()--*/ - virtual size_t GetSize() =0; + virtual size_t GetSize() = 0; /// // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at @@ -292,10 +290,9 @@ class CefBinaryValue : public virtual CefBaseRefCounted { /*--cef()--*/ virtual size_t GetData(void* buffer, size_t buffer_size, - size_t data_offset) =0; + size_t data_offset) = 0; }; - /// // Class representing a dictionary value. Can be used on any process and thread. /// @@ -317,20 +314,20 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // methods if this method returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if this object is currently owned by another object. /// /*--cef()--*/ - virtual bool IsOwned() =0; + virtual bool IsOwned() = 0; /// // Returns true if the values of this object are read-only. Some APIs may // expose read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns true if this object and |that| object have the same underlying @@ -338,58 +335,58 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // and vice-versa. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if this object and |that| object have an equivalent underlying // value but are not necessarily the same object. /// /*--cef()--*/ - virtual bool IsEqual(CefRefPtr that) =0; + virtual bool IsEqual(CefRefPtr that) = 0; /// // Returns a writable copy of this object. If |exclude_empty_children| is true // any empty dictionaries or lists will be excluded from the copy. /// /*--cef()--*/ - virtual CefRefPtr Copy(bool exclude_empty_children) =0; + virtual CefRefPtr Copy(bool exclude_empty_children) = 0; /// // Returns the number of values. /// /*--cef()--*/ - virtual size_t GetSize() =0; + virtual size_t GetSize() = 0; /// // Removes all values. Returns true on success. /// /*--cef()--*/ - virtual bool Clear() =0; + virtual bool Clear() = 0; /// // Returns true if the current dictionary has a value for the given key. /// /*--cef()--*/ - virtual bool HasKey(const CefString& key) =0; + virtual bool HasKey(const CefString& key) = 0; /// // Reads all keys for this dictionary into the specified vector. /// /*--cef()--*/ - virtual bool GetKeys(KeyList& keys) =0; + virtual bool GetKeys(KeyList& keys) = 0; /// // Removes the value at the specified key. Returns true is the value was // removed successfully. /// /*--cef()--*/ - virtual bool Remove(const CefString& key) =0; + virtual bool Remove(const CefString& key) = 0; /// // Returns the value type for the specified key. /// /*--cef(default_retval=VTYPE_INVALID)--*/ - virtual CefValueType GetType(const CefString& key) =0; + virtual CefValueType GetType(const CefString& key) = 0; /// // Returns the value at the specified key. For simple types the returned @@ -399,38 +396,38 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // will modify this object. /// /*--cef()--*/ - virtual CefRefPtr GetValue(const CefString& key) =0; + virtual CefRefPtr GetValue(const CefString& key) = 0; /// // Returns the value at the specified key as type bool. /// /*--cef()--*/ - virtual bool GetBool(const CefString& key) =0; + virtual bool GetBool(const CefString& key) = 0; /// // Returns the value at the specified key as type int. /// /*--cef()--*/ - virtual int GetInt(const CefString& key) =0; + virtual int GetInt(const CefString& key) = 0; /// // Returns the value at the specified key as type double. /// /*--cef()--*/ - virtual double GetDouble(const CefString& key) =0; + virtual double GetDouble(const CefString& key) = 0; /// // Returns the value at the specified key as type string. /// /*--cef()--*/ - virtual CefString GetString(const CefString& key) =0; + virtual CefString GetString(const CefString& key) = 0; /// // Returns the value at the specified key as type binary. The returned // value will reference existing data. /// /*--cef()--*/ - virtual CefRefPtr GetBinary(const CefString& key) =0; + virtual CefRefPtr GetBinary(const CefString& key) = 0; /// // Returns the value at the specified key as type dictionary. The returned @@ -438,7 +435,7 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // modify this object. /// /*--cef()--*/ - virtual CefRefPtr GetDictionary(const CefString& key) =0; + virtual CefRefPtr GetDictionary(const CefString& key) = 0; /// // Returns the value at the specified key as type list. The returned value @@ -446,7 +443,7 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // this object. /// /*--cef()--*/ - virtual CefRefPtr GetList(const CefString& key) =0; + virtual CefRefPtr GetList(const CefString& key) = 0; /// // Sets the value at the specified key. Returns true if the value was set @@ -457,42 +454,42 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // this object. /// /*--cef()--*/ - virtual bool SetValue(const CefString& key, CefRefPtr value) =0; + virtual bool SetValue(const CefString& key, CefRefPtr value) = 0; /// // Sets the value at the specified key as type null. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetNull(const CefString& key) =0; + virtual bool SetNull(const CefString& key) = 0; /// // Sets the value at the specified key as type bool. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetBool(const CefString& key, bool value) =0; + virtual bool SetBool(const CefString& key, bool value) = 0; /// // Sets the value at the specified key as type int. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetInt(const CefString& key, int value) =0; + virtual bool SetInt(const CefString& key, int value) = 0; /// // Sets the value at the specified key as type double. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetDouble(const CefString& key, double value) =0; + virtual bool SetDouble(const CefString& key, double value) = 0; /// // Sets the value at the specified key as type string. Returns true if the // value was set successfully. /// /*--cef(optional_param=value)--*/ - virtual bool SetString(const CefString& key, const CefString& value) =0; + virtual bool SetString(const CefString& key, const CefString& value) = 0; /// // Sets the value at the specified key as type binary. Returns true if the @@ -503,7 +500,7 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetBinary(const CefString& key, - CefRefPtr value) =0; + CefRefPtr value) = 0; /// // Sets the value at the specified key as type dict. Returns true if the @@ -514,7 +511,7 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetDictionary(const CefString& key, - CefRefPtr value) =0; + CefRefPtr value) = 0; /// // Sets the value at the specified key as type list. Returns true if the @@ -524,11 +521,9 @@ class CefDictionaryValue : public virtual CefBaseRefCounted { // reference will be invalidated. /// /*--cef()--*/ - virtual bool SetList(const CefString& key, - CefRefPtr value) =0; + virtual bool SetList(const CefString& key, CefRefPtr value) = 0; }; - /// // Class representing a list value. Can be used on any process and thread. /// @@ -548,20 +543,20 @@ class CefListValue : public virtual CefBaseRefCounted { // methods if this method returns false. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if this object is currently owned by another object. /// /*--cef()--*/ - virtual bool IsOwned() =0; + virtual bool IsOwned() = 0; /// // Returns true if the values of this object are read-only. Some APIs may // expose read-only objects. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns true if this object and |that| object have the same underlying @@ -569,51 +564,51 @@ class CefListValue : public virtual CefBaseRefCounted { // and vice-versa. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns true if this object and |that| object have an equivalent underlying // value but are not necessarily the same object. /// /*--cef()--*/ - virtual bool IsEqual(CefRefPtr that) =0; + virtual bool IsEqual(CefRefPtr that) = 0; /// // Returns a writable copy of this object. /// /*--cef()--*/ - virtual CefRefPtr Copy() =0; + virtual CefRefPtr Copy() = 0; /// // Sets the number of values. If the number of values is expanded all // new value slots will default to type null. Returns true on success. /// /*--cef()--*/ - virtual bool SetSize(size_t size) =0; + virtual bool SetSize(size_t size) = 0; /// // Returns the number of values. /// /*--cef()--*/ - virtual size_t GetSize() =0; + virtual size_t GetSize() = 0; /// // Removes all values. Returns true on success. /// /*--cef()--*/ - virtual bool Clear() =0; + virtual bool Clear() = 0; /// // Removes the value at the specified index. /// /*--cef()--*/ - virtual bool Remove(size_t index) =0; + virtual bool Remove(size_t index) = 0; /// // Returns the value type at the specified index. /// /*--cef(default_retval=VTYPE_INVALID)--*/ - virtual CefValueType GetType(size_t index) =0; + virtual CefValueType GetType(size_t index) = 0; /// // Returns the value at the specified index. For simple types the returned @@ -623,38 +618,38 @@ class CefListValue : public virtual CefBaseRefCounted { // will modify this object. /// /*--cef()--*/ - virtual CefRefPtr GetValue(size_t index) =0; + virtual CefRefPtr GetValue(size_t index) = 0; /// // Returns the value at the specified index as type bool. /// /*--cef()--*/ - virtual bool GetBool(size_t index) =0; + virtual bool GetBool(size_t index) = 0; /// // Returns the value at the specified index as type int. /// /*--cef()--*/ - virtual int GetInt(size_t index) =0; + virtual int GetInt(size_t index) = 0; /// // Returns the value at the specified index as type double. /// /*--cef()--*/ - virtual double GetDouble(size_t index) =0; + virtual double GetDouble(size_t index) = 0; /// // Returns the value at the specified index as type string. /// /*--cef()--*/ - virtual CefString GetString(size_t index) =0; + virtual CefString GetString(size_t index) = 0; /// // Returns the value at the specified index as type binary. The returned // value will reference existing data. /// /*--cef()--*/ - virtual CefRefPtr GetBinary(size_t index) =0; + virtual CefRefPtr GetBinary(size_t index) = 0; /// // Returns the value at the specified index as type dictionary. The returned @@ -662,7 +657,7 @@ class CefListValue : public virtual CefBaseRefCounted { // modify this object. /// /*--cef()--*/ - virtual CefRefPtr GetDictionary(size_t index) =0; + virtual CefRefPtr GetDictionary(size_t index) = 0; /// // Returns the value at the specified index as type list. The returned @@ -670,7 +665,7 @@ class CefListValue : public virtual CefBaseRefCounted { // modify this object. /// /*--cef()--*/ - virtual CefRefPtr GetList(size_t index) =0; + virtual CefRefPtr GetList(size_t index) = 0; /// // Sets the value at the specified index. Returns true if the value was set @@ -681,42 +676,42 @@ class CefListValue : public virtual CefBaseRefCounted { // this object. /// /*--cef()--*/ - virtual bool SetValue(size_t index, CefRefPtr value) =0; + virtual bool SetValue(size_t index, CefRefPtr value) = 0; /// // Sets the value at the specified index as type null. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetNull(size_t index) =0; + virtual bool SetNull(size_t index) = 0; /// // Sets the value at the specified index as type bool. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetBool(size_t index, bool value) =0; + virtual bool SetBool(size_t index, bool value) = 0; /// // Sets the value at the specified index as type int. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetInt(size_t index, int value) =0; + virtual bool SetInt(size_t index, int value) = 0; /// // Sets the value at the specified index as type double. Returns true if the // value was set successfully. /// /*--cef()--*/ - virtual bool SetDouble(size_t index, double value) =0; + virtual bool SetDouble(size_t index, double value) = 0; /// // Sets the value at the specified index as type string. Returns true if the // value was set successfully. /// /*--cef(optional_param=value)--*/ - virtual bool SetString(size_t index, const CefString& value) =0; + virtual bool SetString(size_t index, const CefString& value) = 0; /// // Sets the value at the specified index as type binary. Returns true if the @@ -726,7 +721,7 @@ class CefListValue : public virtual CefBaseRefCounted { // reference will be invalidated. /// /*--cef()--*/ - virtual bool SetBinary(size_t index, CefRefPtr value) =0; + virtual bool SetBinary(size_t index, CefRefPtr value) = 0; /// // Sets the value at the specified index as type dict. Returns true if the @@ -736,7 +731,8 @@ class CefListValue : public virtual CefBaseRefCounted { // reference will be invalidated. /// /*--cef()--*/ - virtual bool SetDictionary(size_t index, CefRefPtr value) =0; + virtual bool SetDictionary(size_t index, + CefRefPtr value) = 0; /// // Sets the value at the specified index as type list. Returns true if the @@ -746,7 +742,7 @@ class CefListValue : public virtual CefBaseRefCounted { // reference will be invalidated. /// /*--cef()--*/ - virtual bool SetList(size_t index, CefRefPtr value) =0; + virtual bool SetList(size_t index, CefRefPtr value) = 0; }; #endif // CEF_INCLUDE_CEF_VALUES_H_ diff --git a/include/cef_waitable_event.h b/include/cef_waitable_event.h index 070ca6813..d89371eb9 100644 --- a/include/cef_waitable_event.h +++ b/include/cef_waitable_event.h @@ -70,14 +70,14 @@ class CefWaitableEvent : public CefBaseRefCounted { // Put the event in the un-signaled state. /// /*--cef()--*/ - virtual void Reset() =0; + virtual void Reset() = 0; /// // Put the event in the signaled state. This causes any thread blocked on Wait // to be woken up. /// /*--cef()--*/ - virtual void Signal() =0; + virtual void Signal() = 0; /// // Returns true if the event is in the signaled state, else false. If the @@ -85,7 +85,7 @@ class CefWaitableEvent : public CefBaseRefCounted { // method will also cause a reset. /// /*--cef()--*/ - virtual bool IsSignaled() =0; + virtual bool IsSignaled() = 0; /// // Wait indefinitely for the event to be signaled. This method will not return @@ -93,7 +93,7 @@ class CefWaitableEvent : public CefBaseRefCounted { // called on the browser process UI or IO threads. /// /*--cef()--*/ - virtual void Wait() =0; + virtual void Wait() = 0; /// // Wait up to |max_ms| milliseconds for the event to be signaled. Returns true @@ -103,7 +103,7 @@ class CefWaitableEvent : public CefBaseRefCounted { // browser process UI or IO threads. /// /*--cef()--*/ - virtual bool TimedWait(int64 max_ms) =0; + virtual bool TimedWait(int64 max_ms) = 0; }; #endif // CEF_INCLUDE_CEF_WAITABLE_EVENT_H_ diff --git a/include/cef_web_plugin.h b/include/cef_web_plugin.h index 3eea54130..d5de16aba 100644 --- a/include/cef_web_plugin.h +++ b/include/cef_web_plugin.h @@ -51,25 +51,25 @@ class CefWebPluginInfo : public virtual CefBaseRefCounted { // Returns the plugin name (i.e. Flash). /// /*--cef()--*/ - virtual CefString GetName() =0; + virtual CefString GetName() = 0; /// // Returns the plugin file path (DLL/bundle/library). /// /*--cef()--*/ - virtual CefString GetPath() =0; + virtual CefString GetPath() = 0; /// // Returns the version of the plugin (may be OS-specific). /// /*--cef()--*/ - virtual CefString GetVersion() =0; + virtual CefString GetVersion() = 0; /// // Returns a description of the plugin from the version information. /// /*--cef()--*/ - virtual CefString GetDescription() =0; + virtual CefString GetDescription() = 0; }; /// @@ -86,7 +86,9 @@ class CefWebPluginInfoVisitor : public virtual CefBaseRefCounted { // no plugins are found. /// /*--cef()--*/ - virtual bool Visit(CefRefPtr info, int count, int total) =0; + virtual bool Visit(CefRefPtr info, + int count, + int total) = 0; }; /// @@ -132,8 +134,7 @@ class CefWebPluginUnstableCallback : public virtual CefBaseRefCounted { // seconds. /// /*--cef()--*/ - virtual void IsUnstable(const CefString& path, - bool unstable) =0; + virtual void IsUnstable(const CefString& path, bool unstable) = 0; }; /// @@ -160,7 +161,7 @@ class CefRegisterCdmCallback : public virtual CefBaseRefCounted { /// /*--cef(optional_param=error_message)--*/ virtual void OnCdmRegistrationComplete(cef_cdm_registration_error_t result, - const CefString& error_message) =0; + const CefString& error_message) = 0; }; /// diff --git a/include/cef_x509_certificate.h b/include/cef_x509_certificate.h index c784ce1b0..b466a6adc 100644 --- a/include/cef_x509_certificate.h +++ b/include/cef_x509_certificate.h @@ -55,55 +55,55 @@ class CefX509CertPrincipal : public virtual CefBaseRefCounted { // Name (OU) and returns the first non-empty one found. /// /*--cef()--*/ - virtual CefString GetDisplayName() =0; + virtual CefString GetDisplayName() = 0; /// // Returns the common name. /// /*--cef()--*/ - virtual CefString GetCommonName() =0; + virtual CefString GetCommonName() = 0; /// // Returns the locality name. /// /*--cef()--*/ - virtual CefString GetLocalityName() =0; + virtual CefString GetLocalityName() = 0; /// // Returns the state or province name. /// /*--cef()--*/ - virtual CefString GetStateOrProvinceName() =0; + virtual CefString GetStateOrProvinceName() = 0; /// // Returns the country name. /// /*--cef()--*/ - virtual CefString GetCountryName() =0; + virtual CefString GetCountryName() = 0; /// // Retrieve the list of street addresses. /// /*--cef()--*/ - virtual void GetStreetAddresses(std::vector& addresses) =0; + virtual void GetStreetAddresses(std::vector& addresses) = 0; /// // Retrieve the list of organization names. /// /*--cef()--*/ - virtual void GetOrganizationNames(std::vector& names) =0; + virtual void GetOrganizationNames(std::vector& names) = 0; /// // Retrieve the list of organization unit names. /// /*--cef()--*/ - virtual void GetOrganizationUnitNames(std::vector& names) =0; + virtual void GetOrganizationUnitNames(std::vector& names) = 0; /// // Retrieve the list of domain components. /// /*--cef()--*/ - virtual void GetDomainComponents(std::vector& components) =0; + virtual void GetDomainComponents(std::vector& components) = 0; }; /// @@ -112,7 +112,7 @@ class CefX509CertPrincipal : public virtual CefBaseRefCounted { /*--cef(source=library)--*/ class CefX509Certificate : public virtual CefBaseRefCounted { public: - typedef std::vector > IssuerChainBinaryList; + typedef std::vector> IssuerChainBinaryList; /// // Returns the subject of the X.509 certificate. For HTTPS server @@ -120,53 +120,53 @@ class CefX509Certificate : public virtual CefBaseRefCounted { // subject should match the host name of the web server. /// /*--cef()--*/ - virtual CefRefPtr GetSubject() =0; + virtual CefRefPtr GetSubject() = 0; /// // Returns the issuer of the X.509 certificate. /// /*--cef()--*/ - virtual CefRefPtr GetIssuer() =0; + virtual CefRefPtr GetIssuer() = 0; /// // Returns the DER encoded serial number for the X.509 certificate. The value // possibly includes a leading 00 byte. /// /*--cef()--*/ - virtual CefRefPtr GetSerialNumber() =0; - + virtual CefRefPtr GetSerialNumber() = 0; + /// // Returns the date before which the X.509 certificate is invalid. // CefTime.GetTimeT() will return 0 if no date was specified. /// /*--cef()--*/ - virtual CefTime GetValidStart() =0; + virtual CefTime GetValidStart() = 0; /// // Returns the date after which the X.509 certificate is invalid. // CefTime.GetTimeT() will return 0 if no date was specified. /// /*--cef()--*/ - virtual CefTime GetValidExpiry() =0; + virtual CefTime GetValidExpiry() = 0; /// // Returns the DER encoded data for the X.509 certificate. /// /*--cef()--*/ - virtual CefRefPtr GetDEREncoded() =0; + virtual CefRefPtr GetDEREncoded() = 0; /// // Returns the PEM encoded data for the X.509 certificate. /// /*--cef()--*/ - virtual CefRefPtr GetPEMEncoded() =0; + virtual CefRefPtr GetPEMEncoded() = 0; /// // Returns the number of certificates in the issuer chain. // If 0, the certificate is self-signed. /// /*--cef()--*/ - virtual size_t GetIssuerChainSize() =0; + virtual size_t GetIssuerChainSize() = 0; /// // Returns the DER encoded data for the certificate issuer chain. @@ -174,7 +174,7 @@ class CefX509Certificate : public virtual CefBaseRefCounted { // present in the array but is an empty string. /// /*--cef(count_func=chain:GetIssuerChainSize)--*/ - virtual void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) =0; + virtual void GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) = 0; /// // Returns the PEM encoded data for the certificate issuer chain. @@ -182,7 +182,7 @@ class CefX509Certificate : public virtual CefBaseRefCounted { // present in the array but is an empty string. /// /*--cef(count_func=chain:GetIssuerChainSize)--*/ - virtual void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) =0; + virtual void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) = 0; }; #endif // CEF_INCLUDE_CEF_X509_CERTIFICATE_H_ diff --git a/include/cef_xml_reader.h b/include/cef_xml_reader.h index ab5244e34..5269ef5ee 100644 --- a/include/cef_xml_reader.h +++ b/include/cef_xml_reader.h @@ -67,27 +67,26 @@ class CefXmlReader : public virtual CefBaseRefCounted { // the cursor position was set successfully. /// /*--cef()--*/ - virtual bool MoveToNextNode() =0; + virtual bool MoveToNextNode() = 0; /// // Close the document. This should be called directly to ensure that cleanup // occurs on the correct thread. /// /*--cef()--*/ - virtual bool Close() =0; + virtual bool Close() = 0; /// // Returns true if an error has been reported by the XML parser. /// /*--cef()--*/ - virtual bool HasError() =0; + virtual bool HasError() = 0; /// // Returns the error string. /// /*--cef()--*/ - virtual CefString GetError() =0; - + virtual CefString GetError() = 0; // The below methods retrieve data for the node at the current cursor // position. @@ -96,98 +95,98 @@ class CefXmlReader : public virtual CefBaseRefCounted { // Returns the node type. /// /*--cef(default_retval=XML_NODE_UNSUPPORTED)--*/ - virtual NodeType GetType() =0; + virtual NodeType GetType() = 0; /// // Returns the node depth. Depth starts at 0 for the root node. /// /*--cef()--*/ - virtual int GetDepth() =0; + virtual int GetDepth() = 0; /// // Returns the local name. See // http://www.w3.org/TR/REC-xml-names/#NT-LocalPart for additional details. /// /*--cef()--*/ - virtual CefString GetLocalName() =0; + virtual CefString GetLocalName() = 0; /// // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for // additional details. /// /*--cef()--*/ - virtual CefString GetPrefix() =0; + virtual CefString GetPrefix() = 0; /// // Returns the qualified name, equal to (Prefix:)LocalName. See // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. /// /*--cef()--*/ - virtual CefString GetQualifiedName() =0; + virtual CefString GetQualifiedName() = 0; /// // Returns the URI defining the namespace associated with the node. See // http://www.w3.org/TR/REC-xml-names/ for additional details. /// /*--cef()--*/ - virtual CefString GetNamespaceURI() =0; + virtual CefString GetNamespaceURI() = 0; /// // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for // additional details. /// /*--cef()--*/ - virtual CefString GetBaseURI() =0; + virtual CefString GetBaseURI() = 0; /// // Returns the xml:lang scope within which the node resides. See // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. /// /*--cef()--*/ - virtual CefString GetXmlLang() =0; + virtual CefString GetXmlLang() = 0; /// // Returns true if the node represents an empty element. is considered // empty but is not. /// /*--cef()--*/ - virtual bool IsEmptyElement() =0; + virtual bool IsEmptyElement() = 0; /// // Returns true if the node has a text value. /// /*--cef()--*/ - virtual bool HasValue() =0; + virtual bool HasValue() = 0; /// // Returns the text value. /// /*--cef()--*/ - virtual CefString GetValue() =0; + virtual CefString GetValue() = 0; /// // Returns true if the node has attributes. /// /*--cef()--*/ - virtual bool HasAttributes() =0; + virtual bool HasAttributes() = 0; /// // Returns the number of attributes. /// /*--cef()--*/ - virtual size_t GetAttributeCount() =0; + virtual size_t GetAttributeCount() = 0; /// // Returns the value of the attribute at the specified 0-based index. /// /*--cef(capi_name=get_attribute_byindex,index_param=index)--*/ - virtual CefString GetAttribute(int index) =0; + virtual CefString GetAttribute(int index) = 0; /// // Returns the value of the attribute with the specified qualified name. /// /*--cef(capi_name=get_attribute_byqname)--*/ - virtual CefString GetAttribute(const CefString& qualifiedName) =0; + virtual CefString GetAttribute(const CefString& qualifiedName) = 0; /// // Returns the value of the attribute with the specified local name and @@ -195,26 +194,25 @@ class CefXmlReader : public virtual CefBaseRefCounted { /// /*--cef(capi_name=get_attribute_bylname)--*/ virtual CefString GetAttribute(const CefString& localName, - const CefString& namespaceURI) =0; + const CefString& namespaceURI) = 0; /// // Returns an XML representation of the current node's children. /// /*--cef()--*/ - virtual CefString GetInnerXml() =0; + virtual CefString GetInnerXml() = 0; /// // Returns an XML representation of the current node including its children. /// /*--cef()--*/ - virtual CefString GetOuterXml() =0; + virtual CefString GetOuterXml() = 0; /// // Returns the line number for the current node. /// /*--cef()--*/ - virtual int GetLineNumber() =0; - + virtual int GetLineNumber() = 0; // Attribute nodes are not traversed by default. The below methods can be // used to move the cursor to an attribute node. MoveToCarryingElement() can @@ -226,14 +224,14 @@ class CefXmlReader : public virtual CefBaseRefCounted { // true if the cursor position was set successfully. /// /*--cef(capi_name=move_to_attribute_byindex,index_param=index)--*/ - virtual bool MoveToAttribute(int index) =0; + virtual bool MoveToAttribute(int index) = 0; /// // Moves the cursor to the attribute with the specified qualified name. // Returns true if the cursor position was set successfully. /// /*--cef(capi_name=move_to_attribute_byqname)--*/ - virtual bool MoveToAttribute(const CefString& qualifiedName) =0; + virtual bool MoveToAttribute(const CefString& qualifiedName) = 0; /// // Moves the cursor to the attribute with the specified local name and @@ -241,28 +239,28 @@ class CefXmlReader : public virtual CefBaseRefCounted { /// /*--cef(capi_name=move_to_attribute_bylname)--*/ virtual bool MoveToAttribute(const CefString& localName, - const CefString& namespaceURI) =0; + const CefString& namespaceURI) = 0; /// // Moves the cursor to the first attribute in the current element. Returns // true if the cursor position was set successfully. /// /*--cef()--*/ - virtual bool MoveToFirstAttribute() =0; + virtual bool MoveToFirstAttribute() = 0; /// // Moves the cursor to the next attribute in the current element. Returns // true if the cursor position was set successfully. /// /*--cef()--*/ - virtual bool MoveToNextAttribute() =0; + virtual bool MoveToNextAttribute() = 0; /// // Moves the cursor back to the carrying element. Returns true if the cursor // position was set successfully. /// /*--cef()--*/ - virtual bool MoveToCarryingElement() =0; + virtual bool MoveToCarryingElement() = 0; }; #endif // CEF_INCLUDE_CEF_XML_READER_H_ diff --git a/include/cef_zip_reader.h b/include/cef_zip_reader.h index 80640087f..5dc2efd60 100644 --- a/include/cef_zip_reader.h +++ b/include/cef_zip_reader.h @@ -60,14 +60,14 @@ class CefZipReader : public virtual CefBaseRefCounted { // cursor position was set successfully. /// /*--cef()--*/ - virtual bool MoveToFirstFile() =0; + virtual bool MoveToFirstFile() = 0; /// // Moves the cursor to the next file in the archive. Returns true if the // cursor position was set successfully. /// /*--cef()--*/ - virtual bool MoveToNextFile() =0; + virtual bool MoveToNextFile() = 0; /// // Moves the cursor to the specified file in the archive. If |caseSensitive| @@ -75,15 +75,14 @@ class CefZipReader : public virtual CefBaseRefCounted { // position was set successfully. /// /*--cef()--*/ - virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0; + virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) = 0; /// // Closes the archive. This should be called directly to ensure that cleanup // occurs on the correct thread. /// /*--cef()--*/ - virtual bool Close() =0; - + virtual bool Close() = 0; // The below methods act on the file at the current cursor position. @@ -91,51 +90,51 @@ class CefZipReader : public virtual CefBaseRefCounted { // Returns the name of the file. /// /*--cef()--*/ - virtual CefString GetFileName() =0; + virtual CefString GetFileName() = 0; /// // Returns the uncompressed size of the file. /// /*--cef()--*/ - virtual int64 GetFileSize() =0; + virtual int64 GetFileSize() = 0; /// // Returns the last modified timestamp for the file. /// /*--cef()--*/ - virtual CefTime GetFileLastModified() =0; + virtual CefTime GetFileLastModified() = 0; /// // Opens the file for reading of uncompressed data. A read password may // optionally be specified. /// /*--cef(optional_param=password)--*/ - virtual bool OpenFile(const CefString& password) =0; + virtual bool OpenFile(const CefString& password) = 0; /// // Closes the file. /// /*--cef()--*/ - virtual bool CloseFile() =0; + virtual bool CloseFile() = 0; /// // Read uncompressed file contents into the specified buffer. Returns < 0 if // an error occurred, 0 if at the end of file, or the number of bytes read. /// /*--cef()--*/ - virtual int ReadFile(void* buffer, size_t bufferSize) =0; + virtual int ReadFile(void* buffer, size_t bufferSize) = 0; /// // Returns the current offset in the uncompressed file contents. /// /*--cef()--*/ - virtual int64 Tell() =0; + virtual int64 Tell() = 0; /// // Returns true if at end of the file contents. /// /*--cef()--*/ - virtual bool Eof() =0; + virtual bool Eof() = 0; }; #endif // CEF_INCLUDE_CEF_ZIP_READER_H_ diff --git a/include/internal/cef_export.h b/include/internal/cef_export.h index 3484293ae..1915f5e5e 100644 --- a/include/internal/cef_export.h +++ b/include/internal/cef_export.h @@ -46,7 +46,7 @@ #elif defined(COMPILER_GCC) -#define CEF_EXPORT __attribute__ ((visibility("default"))) +#define CEF_EXPORT __attribute__((visibility("default"))) #endif // COMPILER_GCC diff --git a/include/internal/cef_linux.h b/include/internal/cef_linux.h index d4586768a..ecf74e0f5 100644 --- a/include/internal/cef_linux.h +++ b/include/internal/cef_linux.h @@ -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_INTERNAL_CEF_LINUX_H_ #define CEF_INCLUDE_INTERNAL_CEF_LINUX_H_ #pragma once @@ -46,8 +45,9 @@ struct CefMainArgsTraits { static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->argc = src->argc; target->argv = src->argv; } @@ -73,8 +73,9 @@ struct CefWindowInfoTraits { static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->x = src->x; target->y = src->y; target->width = src->width; @@ -97,8 +98,7 @@ class CefWindowInfo : public CefStructBase { /// // Create the browser as a child window. /// - void SetAsChild(CefWindowHandle parent, - const CefRect& windowRect) { + void SetAsChild(CefWindowHandle parent, const CefRect& windowRect) { parent_window = parent; x = windowRect.x; y = windowRect.y; diff --git a/include/internal/cef_mac.h b/include/internal/cef_mac.h index 2448c9efd..689d88cd8 100644 --- a/include/internal/cef_mac.h +++ b/include/internal/cef_mac.h @@ -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_INTERNAL_CEF_MAC_H_ #define CEF_INCLUDE_INTERNAL_CEF_MAC_H_ #pragma once @@ -46,8 +45,9 @@ struct CefMainArgsTraits { static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->argc = src->argc; target->argv = src->argv; } @@ -76,10 +76,11 @@ struct CefWindowInfoTraits { cef_string_clear(&s->window_name); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { cef_string_set(src->window_name.str, src->window_name.length, - &target->window_name, copy); + &target->window_name, copy); target->x = src->x; target->y = src->y; target->width = src->width; @@ -103,8 +104,7 @@ class CefWindowInfo : public CefStructBase { /// // Create the browser as a child view. /// - void SetAsChild(CefWindowHandle parent, int x, int y, int width, - int height) { + void SetAsChild(CefWindowHandle parent, int x, int y, int width, int height) { parent_view = parent; this->x = x; this->y = y; diff --git a/include/internal/cef_ptr.h b/include/internal/cef_ptr.h index 7883c98cb..044c73310 100644 --- a/include/internal/cef_ptr.h +++ b/include/internal/cef_ptr.h @@ -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_INTERNAL_CEF_PTR_H_ #define CEF_INCLUDE_INTERNAL_CEF_PTR_H_ #pragma once @@ -159,7 +158,6 @@ using CefRefPtr = scoped_refptr; #define CefRefPtr scoped_refptr #endif - /// // A CefOwnPtr is like a T*, except that the destructor of CefOwnPtr // automatically deletes the pointer it holds (if any). That is, CefOwnPtr @@ -181,7 +179,6 @@ using CefOwnPtr = scoped_ptr; #define CefOwnPtr scoped_ptr #endif - /// // A CefRawPtr is the same as T* /// @@ -218,9 +215,7 @@ class CefRawPtr { return *this; } - CefRawPtr& operator=(const CefRawPtr& r) { - return *this = r.ptr_; - } + CefRawPtr& operator=(const CefRawPtr& r) { return *this = r.ptr_; } template CefRawPtr& operator=(const CefRawPtr& r) { diff --git a/include/internal/cef_string.h b/include/internal/cef_string.h index a7876fe56..77c8ca3db 100644 --- a/include/internal/cef_string.h +++ b/include/internal/cef_string.h @@ -44,7 +44,6 @@ // Build with the wide string type as default. // #define CEF_STRING_TYPE_WIDE 1 - #include "include/internal/cef_string_types.h" #ifdef __cplusplus diff --git a/include/internal/cef_string_list.h b/include/internal/cef_string_list.h index 79c0509f0..b44bac719 100644 --- a/include/internal/cef_string_list.h +++ b/include/internal/cef_string_list.h @@ -58,7 +58,8 @@ CEF_EXPORT size_t cef_string_list_size(cef_string_list_t list); // true (1) if the value was successfully retrieved. /// CEF_EXPORT int cef_string_list_value(cef_string_list_t list, - size_t index, cef_string_t* value); + size_t index, + cef_string_t* value); /// // Append a new value at the end of the string list. diff --git a/include/internal/cef_string_map.h b/include/internal/cef_string_map.h index a22f33a78..0f3342575 100644 --- a/include/internal/cef_string_map.h +++ b/include/internal/cef_string_map.h @@ -63,13 +63,15 @@ CEF_EXPORT int cef_string_map_find(cef_string_map_t map, /// // Return the key at the specified zero-based string map index. /// -CEF_EXPORT int cef_string_map_key(cef_string_map_t map, size_t index, +CEF_EXPORT int cef_string_map_key(cef_string_map_t map, + size_t index, cef_string_t* key); /// // Return the value at the specified zero-based string map index. /// -CEF_EXPORT int cef_string_map_value(cef_string_map_t map, size_t index, +CEF_EXPORT int cef_string_map_value(cef_string_map_t map, + size_t index, cef_string_t* value); /// @@ -89,7 +91,6 @@ CEF_EXPORT void cef_string_map_clear(cef_string_map_t map); /// CEF_EXPORT void cef_string_map_free(cef_string_map_t map); - #ifdef __cplusplus } #endif diff --git a/include/internal/cef_string_multimap.h b/include/internal/cef_string_multimap.h index ee9325b37..cd077460b 100644 --- a/include/internal/cef_string_multimap.h +++ b/include/internal/cef_string_multimap.h @@ -58,7 +58,7 @@ CEF_EXPORT size_t cef_string_multimap_size(cef_string_multimap_t map); // Return the number of values with the specified key. /// CEF_EXPORT size_t cef_string_multimap_find_count(cef_string_multimap_t map, - const cef_string_t* key); + const cef_string_t* key); /// // Return the value_index-th value with the specified key. @@ -71,13 +71,15 @@ CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, /// // Return the key at the specified zero-based string multimap index. /// -CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, size_t index, +CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, + size_t index, cef_string_t* key); /// // Return the value at the specified zero-based string multimap index. /// -CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, size_t index, +CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, + size_t index, cef_string_t* value); /// @@ -97,7 +99,6 @@ CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map); /// CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map); - #ifdef __cplusplus } #endif diff --git a/include/internal/cef_string_types.h b/include/internal/cef_string_types.h index 062065709..ea9196082 100644 --- a/include/internal/cef_string_types.h +++ b/include/internal/cef_string_types.h @@ -70,32 +70,35 @@ typedef struct _cef_string_utf16_t { void (*dtor)(char16* str); } cef_string_utf16_t; - /// // These functions set string values. If |copy| is true (1) the value will be // copied instead of referenced. It is up to the user to properly manage // the lifespan of references. /// -CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, - cef_string_wide_t* output, int copy); -CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, - cef_string_utf8_t* output, int copy); -CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, - cef_string_utf16_t* output, int copy); - +CEF_EXPORT int cef_string_wide_set(const wchar_t* src, + size_t src_len, + cef_string_wide_t* output, + int copy); +CEF_EXPORT int cef_string_utf8_set(const char* src, + size_t src_len, + cef_string_utf8_t* output, + int copy); +CEF_EXPORT int cef_string_utf16_set(const char16* src, + size_t src_len, + cef_string_utf16_t* output, + int copy); /// // Convenience macros for copying values. /// -#define cef_string_wide_copy(src, src_len, output) \ - cef_string_wide_set(src, src_len, output, true) -#define cef_string_utf8_copy(src, src_len, output) \ - cef_string_utf8_set(src, src_len, output, true) -#define cef_string_utf16_copy(src, src_len, output) \ - cef_string_utf16_set(src, src_len, output, true) - +#define cef_string_wide_copy(src, src_len, output) \ + cef_string_wide_set(src, src_len, output, true) +#define cef_string_utf8_copy(src, src_len, output) \ + cef_string_utf8_set(src, src_len, output, true) +#define cef_string_utf16_copy(src, src_len, output) \ + cef_string_utf16_set(src, src_len, output, true) /// // These functions clear string values. The structure itself is not freed. @@ -105,7 +108,6 @@ CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str); CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str); CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str); - /// // These functions compare two string values with the same results as strcmp(). /// @@ -117,7 +119,6 @@ CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1, CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, const cef_string_utf16_t* str2); - /// // These functions convert between UTF-8, -16, and -32 strings. They are // potentially slow so unnecessary conversions should be avoided. The best @@ -125,35 +126,40 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, // value indicating whether the conversion is 100% valid. /// -CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, +CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, + size_t src_len, cef_string_utf8_t* output); -CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, +CEF_EXPORT int cef_string_utf8_to_wide(const char* src, + size_t src_len, cef_string_wide_t* output); -CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, +CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, + size_t src_len, cef_string_utf16_t* output); -CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, + size_t src_len, cef_string_wide_t* output); -CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, +CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, + size_t src_len, cef_string_utf16_t* output); -CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, + size_t src_len, cef_string_utf8_t* output); - /// // These functions convert an ASCII string, typically a hardcoded constant, to a // Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know // the string is ASCII. /// -CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, +CEF_EXPORT int cef_string_ascii_to_wide(const char* src, + size_t src_len, cef_string_wide_t* output); -CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, +CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, + size_t src_len, cef_string_utf16_t* output); - - /// // It is sometimes necessary for the system to allocate string structures with // the expectation that the user will free them. The userfree types act as a @@ -164,7 +170,6 @@ typedef cef_string_wide_t* cef_string_userfree_wide_t; typedef cef_string_utf8_t* cef_string_userfree_utf8_t; typedef cef_string_utf16_t* cef_string_userfree_utf16_t; - /// // These functions allocate a new string structure. They must be freed by // calling the associated free function. @@ -174,7 +179,6 @@ CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(); CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(); CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(); - /// // These functions free the string structure allocated by the associated // alloc function. Any string contents will first be cleared. @@ -184,18 +188,18 @@ CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str); CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str); CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str); - /// // These functions convert utf16 string case using the current ICU locale. This // may change the length of the string in some cases. /// -CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, + size_t src_len, cef_string_utf16_t* output); -CEF_EXPORT int cef_string_utf16_to_upper(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_upper(const char16* src, + size_t src_len, cef_string_utf16_t* output); - #ifdef __cplusplus } #endif diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index f5d6ab9ec..f965e9c00 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -49,9 +49,11 @@ struct CefStringTraitsWide { typedef cef_string_wide_t struct_type; typedef cef_string_userfree_wide_t userfree_struct_type; - static inline void clear(struct_type *s) { cef_string_wide_clear(s); } - static inline int set(const char_type* src, size_t src_size, - struct_type* output, int copy) { + static inline void clear(struct_type* s) { cef_string_wide_clear(s); } + static inline int set(const char_type* src, + size_t src_size, + struct_type* output, + int copy) { return cef_string_wide_set(src, src_size, output, copy); } static inline int compare(const struct_type* s1, const struct_type* s2) { @@ -65,10 +67,10 @@ struct CefStringTraitsWide { } // Conversion methods. - static inline bool from_ascii(const char* str, size_t len, struct_type *s) { + static inline bool from_ascii(const char* str, size_t len, struct_type* s) { return cef_string_ascii_to_wide(str, len, s) ? true : false; } - static inline std::string to_string(const struct_type *s) { + static inline std::string to_string(const struct_type* s) { cef_string_utf8_t cstr; memset(&cstr, 0, sizeof(cstr)); cef_string_wide_to_utf8(s->str, s->length, &cstr); @@ -78,18 +80,18 @@ struct CefStringTraitsWide { cef_string_utf8_clear(&cstr); return str; } - static inline bool from_string(const std::string& str, struct_type *s) { + static inline bool from_string(const std::string& str, struct_type* s) { return cef_string_utf8_to_wide(str.c_str(), str.length(), s) ? true : false; } - static inline std::wstring to_wstring(const struct_type *s) { + static inline std::wstring to_wstring(const struct_type* s) { return std::wstring(s->str, s->length); } - static inline bool from_wstring(const std::wstring& str, struct_type *s) { - return cef_string_wide_set(str.c_str(), str.length(), s, true) ? - true : false; + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? true + : false; } #if defined(WCHAR_T_IS_UTF32) - static inline base::string16 to_string16(const struct_type *s) { + static inline base::string16 to_string16(const struct_type* s) { cef_string_utf16_t cstr; memset(&cstr, 0, sizeof(cstr)); cef_string_wide_to_utf16(s->str, s->length, &cstr); @@ -99,18 +101,17 @@ struct CefStringTraitsWide { cef_string_utf16_clear(&cstr); return str; } - static inline bool from_string16(const base::string16& str, - struct_type *s) { - return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ? - true : false; + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ? true + : false; } -#else // WCHAR_T_IS_UTF32 - static inline base::string16 to_string16(const struct_type *s) { +#else // WCHAR_T_IS_UTF32 + static inline base::string16 to_string16(const struct_type* s) { return base::string16(s->str, s->length); } - static inline bool from_string16(const base::string16& str, struct_type *s) { - return cef_string_wide_set(str.c_str(), str.length(), s, true) ? - true : false; + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? true + : false; } #endif // WCHAR_T_IS_UTF32 }; @@ -123,9 +124,11 @@ struct CefStringTraitsUTF8 { typedef cef_string_utf8_t struct_type; typedef cef_string_userfree_utf8_t userfree_struct_type; - static inline void clear(struct_type *s) { cef_string_utf8_clear(s); } - static inline int set(const char_type* src, size_t src_size, - struct_type* output, int copy) { + static inline void clear(struct_type* s) { cef_string_utf8_clear(s); } + static inline int set(const char_type* src, + size_t src_size, + struct_type* output, + int copy) { return cef_string_utf8_set(src, src_size, output, copy); } static inline int compare(const struct_type* s1, const struct_type* s2) { @@ -172,8 +175,8 @@ struct CefStringTraitsUTF8 { return str; } static inline bool from_string16(const base::string16& str, struct_type* s) { - return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ? - true : false; + return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ? true + : false; } }; @@ -185,9 +188,11 @@ struct CefStringTraitsUTF16 { typedef cef_string_utf16_t struct_type; typedef cef_string_userfree_utf16_t userfree_struct_type; - static inline void clear(struct_type *s) { cef_string_utf16_clear(s); } - static inline int set(const char_type* src, size_t src_size, - struct_type* output, int copy) { + static inline void clear(struct_type* s) { cef_string_utf16_clear(s); } + static inline int set(const char_type* src, + size_t src_size, + struct_type* output, + int copy) { return cef_string_utf16_set(src, src_size, output, copy); } static inline int compare(const struct_type* s1, const struct_type* s2) { @@ -215,8 +220,8 @@ struct CefStringTraitsUTF16 { return str; } static inline bool from_string(const std::string& str, struct_type* s) { - return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ? - true : false; + return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ? true + : false; } #if defined(WCHAR_T_IS_UTF32) static inline std::wstring to_wstring(const struct_type* s) { @@ -230,24 +235,24 @@ struct CefStringTraitsUTF16 { return str; } static inline bool from_wstring(const std::wstring& str, struct_type* s) { - return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ? - true : false; + return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ? true + : false; } -#else // WCHAR_T_IS_UTF32 +#else // WCHAR_T_IS_UTF32 static inline std::wstring to_wstring(const struct_type* s) { return std::wstring(s->str, s->length); } static inline bool from_wstring(const std::wstring& str, struct_type* s) { - return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? - true : false; + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? true + : false; } #endif // WCHAR_T_IS_UTF32 static inline base::string16 to_string16(const struct_type* s) { return base::string16(s->str, s->length); } static inline bool from_string16(const base::string16& str, struct_type* s) { - return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? - true : false; + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? true + : false; } }; @@ -294,8 +299,7 @@ class CefStringBase { /// // Create a new string from an existing string. Data will always be copied. /// - CefStringBase(const CefStringBase& str) - : string_(NULL), owner_(false) { + CefStringBase(const CefStringBase& str) : string_(NULL), owner_(false) { FromString(str.c_str(), str.length(), true); } @@ -304,12 +308,10 @@ class CefStringBase { // copied. Translation will occur if necessary based on the underlying string // type. /// - CefStringBase(const std::string& src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const std::string& src) : string_(NULL), owner_(false) { FromString(src); } - CefStringBase(const char* src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const char* src) : string_(NULL), owner_(false) { if (src) FromString(std::string(src)); } @@ -319,12 +321,10 @@ class CefStringBase { // copied. Translation will occur if necessary based on the underlying string // type. /// - CefStringBase(const std::wstring& src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const std::wstring& src) : string_(NULL), owner_(false) { FromWString(src); } - CefStringBase(const wchar_t* src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const wchar_t* src) : string_(NULL), owner_(false) { if (src) FromWString(std::wstring(src)); } @@ -335,12 +335,10 @@ class CefStringBase { // copied. Translation will occur if necessary based on the underlying string // type. /// - CefStringBase(const base::string16& src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const base::string16& src) : string_(NULL), owner_(false) { FromString16(src); } - CefStringBase(const char16* src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const char16* src) : string_(NULL), owner_(false) { if (src) FromString16(base::string16(src)); } @@ -353,7 +351,7 @@ class CefStringBase { // and will not be freed by this class. /// CefStringBase(const char_type* src, size_t src_len, bool copy) - : string_(NULL), owner_(false) { + : string_(NULL), owner_(false) { if (src && src_len > 0) FromString(src, src_len, copy); } @@ -363,8 +361,7 @@ class CefStringBase { // ownership. Referenced structures must exist for the lifetime of this class // and will not be freed by this class. /// - CefStringBase(const struct_type* src) // NOLINT(runtime/explicit) - : string_(NULL), owner_(false) { + CefStringBase(const struct_type* src) : string_(NULL), owner_(false) { if (!src) return; // Reference the existing structure without taking ownership. @@ -373,7 +370,6 @@ class CefStringBase { virtual ~CefStringBase() { ClearAndFree(); } - // The following methods are named for compatibility with the standard library // string template types. @@ -430,7 +426,6 @@ class CefStringBase { str.owner_ = tmp_owner; } - // The following methods are unique to CEF string template types. /// @@ -635,15 +630,11 @@ class CefStringBase { /// // Comparison operator overloads. /// - bool operator<(const CefStringBase& str) const { - return (compare(str) < 0); - } + bool operator<(const CefStringBase& str) const { return (compare(str) < 0); } bool operator<=(const CefStringBase& str) const { return (compare(str) <= 0); } - bool operator>(const CefStringBase& str) const { - return (compare(str) > 0); - } + bool operator>(const CefStringBase& str) const { return (compare(str) > 0); } bool operator>=(const CefStringBase& str) const { return (compare(str) >= 0); } @@ -661,9 +652,7 @@ class CefStringBase { FromString(str.c_str(), str.length(), true); return *this; } - operator std::string() const { - return ToString(); - } + operator std::string() const { return ToString(); } CefStringBase& operator=(const std::string& str) { FromString(str); return *this; @@ -672,9 +661,7 @@ class CefStringBase { FromString(std::string(str)); return *this; } - operator std::wstring() const { - return ToWString(); - } + operator std::wstring() const { return ToWString(); } CefStringBase& operator=(const std::wstring& str) { FromWString(str); return *this; @@ -684,9 +671,7 @@ class CefStringBase { return *this; } #if defined(WCHAR_T_IS_UTF32) - operator base::string16() const { - return ToString16(); - } + operator base::string16() const { return ToString16(); } CefStringBase& operator=(const base::string16& str) { FromString16(str); return *this; @@ -722,7 +707,6 @@ class CefStringBase { bool owner_; }; - typedef CefStringBase CefStringWide; typedef CefStringBase CefStringUTF8; typedef CefStringBase CefStringUTF16; diff --git a/include/internal/cef_thread_internal.h b/include/internal/cef_thread_internal.h index 006ff15d3..f326bcd14 100644 --- a/include/internal/cef_thread_internal.h +++ b/include/internal/cef_thread_internal.h @@ -69,7 +69,7 @@ typedef pthread_t cef_platform_thread_handle_t; // Returns the current platform thread handle. /// CEF_EXPORT cef_platform_thread_handle_t - cef_get_current_platform_thread_handle(); +cef_get_current_platform_thread_handle(); #ifdef __cplusplus } diff --git a/include/internal/cef_time.h b/include/internal/cef_time.h index f7e397f04..5435e5996 100644 --- a/include/internal/cef_time.h +++ b/include/internal/cef_time.h @@ -35,8 +35,8 @@ extern "C" { #endif -#include "include/internal/cef_export.h" #include +#include "include/internal/cef_export.h" /// // Time information. Values should always be in UTC. diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index a1801aeee..cb0400065 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -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_INTERNAL_CEF_TYPES_H_ #define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ #pragma once @@ -48,36 +47,34 @@ // 32-bit ARGB color value, not premultiplied. The color components are always // in a known order. Equivalent to the SkColor type. -typedef uint32 cef_color_t; +typedef uint32 cef_color_t; // Return the alpha byte from a cef_color_t value. -#define CefColorGetA(color) (((color) >> 24) & 0xFF) +#define CefColorGetA(color) (((color) >> 24) & 0xFF) // Return the red byte from a cef_color_t value. -#define CefColorGetR(color) (((color) >> 16) & 0xFF) +#define CefColorGetR(color) (((color) >> 16) & 0xFF) // Return the green byte from a cef_color_t value. -#define CefColorGetG(color) (((color) >> 8) & 0xFF) +#define CefColorGetG(color) (((color) >> 8) & 0xFF) // Return the blue byte from a cef_color_t value. -#define CefColorGetB(color) (((color) >> 0) & 0xFF) +#define CefColorGetB(color) (((color) >> 0) & 0xFF) // Return an cef_color_t value with the specified byte component values. -#define CefColorSetARGB(a, r, g, b) \ - static_cast( \ - (static_cast(a) << 24) | \ - (static_cast(r) << 16) | \ - (static_cast(g) << 8) | \ - (static_cast(b) << 0)) +#define CefColorSetARGB(a, r, g, b) \ + static_cast( \ + (static_cast(a) << 24) | (static_cast(r) << 16) | \ + (static_cast(g) << 8) | (static_cast(b) << 0)) // Return an int64 value with the specified low and high int32 component values. -#define CefInt64Set(int32_low, int32_high) \ - static_cast((static_cast(int32_low)) | \ - (static_cast(static_cast(int32_high))) << 32) +#define CefInt64Set(int32_low, int32_high) \ + static_cast((static_cast(int32_low)) | \ + (static_cast(static_cast(int32_high))) \ + << 32) // Return the low int32 value from an int64 value. #define CefInt64GetLow(int64_val) static_cast(int64_val) // Return the high int32 value from an int64 value. #define CefInt64GetHigh(int64_val) \ - static_cast((static_cast(int64_val) >> 32) & 0xFFFFFFFFL) - + static_cast((static_cast(int64_val) >> 32) & 0xFFFFFFFFL) #ifdef __cplusplus extern "C" { @@ -979,23 +976,23 @@ typedef enum { // DragActions.h and should not be renumbered. /// typedef enum { - DRAG_OPERATION_NONE = 0, - DRAG_OPERATION_COPY = 1, - DRAG_OPERATION_LINK = 2, - DRAG_OPERATION_GENERIC = 4, - DRAG_OPERATION_PRIVATE = 8, - DRAG_OPERATION_MOVE = 16, - DRAG_OPERATION_DELETE = 32, - DRAG_OPERATION_EVERY = UINT_MAX + DRAG_OPERATION_NONE = 0, + DRAG_OPERATION_COPY = 1, + DRAG_OPERATION_LINK = 2, + DRAG_OPERATION_GENERIC = 4, + DRAG_OPERATION_PRIVATE = 8, + DRAG_OPERATION_MOVE = 16, + DRAG_OPERATION_DELETE = 32, + DRAG_OPERATION_EVERY = UINT_MAX } cef_drag_operations_mask_t; /// // V8 access control values. /// typedef enum { - V8_ACCESS_CONTROL_DEFAULT = 0, - V8_ACCESS_CONTROL_ALL_CAN_READ = 1, - V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, + V8_ACCESS_CONTROL_DEFAULT = 0, + V8_ACCESS_CONTROL_ALL_CAN_READ = 1, + V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 } cef_v8_accesscontrol_t; @@ -1003,18 +1000,18 @@ typedef enum { // V8 property attribute values. /// typedef enum { - V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable, - // Configurable - V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable - V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable - V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable + V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable, + // Configurable + V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable + V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable + V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable } cef_v8_propertyattribute_t; /// // Post data elements may represent either bytes or files. /// typedef enum { - PDE_TYPE_EMPTY = 0, + PDE_TYPE_EMPTY = 0, PDE_TYPE_BYTES, PDE_TYPE_FILE, } cef_postdataelement_type_t; @@ -1223,35 +1220,35 @@ typedef enum { /// // Default behavior. /// - UR_FLAG_NONE = 0, + UR_FLAG_NONE = 0, /// // If set the cache will be skipped when handling the request. /// - UR_FLAG_SKIP_CACHE = 1 << 0, + UR_FLAG_SKIP_CACHE = 1 << 0, /// // If set user name, password, and cookies may be sent with the request, and // cookies may be saved from the response. /// - UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 << 1, + UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 << 1, /// // If set upload progress events will be generated when a request has a body. /// - UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3, + UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3, /// // If set the CefURLRequestClient::OnDownloadData method will not be called. /// - UR_FLAG_NO_DOWNLOAD_DATA = 1 << 6, + UR_FLAG_NO_DOWNLOAD_DATA = 1 << 6, /// // If set 5XX redirect errors will be propagated to the observer instead of // automatically re-tried. This currently only applies for requests // originated in the browser process. /// - UR_FLAG_NO_RETRY_ON_5XX = 1 << 7, + UR_FLAG_NO_RETRY_ON_5XX = 1 << 7, } cef_urlrequest_flags_t; /// @@ -1362,7 +1359,7 @@ typedef enum { // Existing thread IDs. /// typedef enum { -// BROWSER PROCESS THREADS -- Only available in the browser process. + // BROWSER PROCESS THREADS -- Only available in the browser process. /// // The main thread in the browser. This will be the same as the main @@ -1402,7 +1399,7 @@ typedef enum { /// TID_IO, -// RENDER PROCESS THREADS -- Only available in the render process. + // RENDER PROCESS THREADS -- Only available in the render process. /// // The main thread in the renderer. Used for all WebKit and V8 interaction. @@ -1563,53 +1560,53 @@ typedef struct _cef_screen_info_t { /// typedef enum { // Navigation. - MENU_ID_BACK = 100, - MENU_ID_FORWARD = 101, - MENU_ID_RELOAD = 102, - MENU_ID_RELOAD_NOCACHE = 103, - MENU_ID_STOPLOAD = 104, + MENU_ID_BACK = 100, + MENU_ID_FORWARD = 101, + MENU_ID_RELOAD = 102, + MENU_ID_RELOAD_NOCACHE = 103, + MENU_ID_STOPLOAD = 104, // Editing. - MENU_ID_UNDO = 110, - MENU_ID_REDO = 111, - MENU_ID_CUT = 112, - MENU_ID_COPY = 113, - MENU_ID_PASTE = 114, - MENU_ID_DELETE = 115, - MENU_ID_SELECT_ALL = 116, + MENU_ID_UNDO = 110, + MENU_ID_REDO = 111, + MENU_ID_CUT = 112, + MENU_ID_COPY = 113, + MENU_ID_PASTE = 114, + MENU_ID_DELETE = 115, + MENU_ID_SELECT_ALL = 116, // Miscellaneous. - MENU_ID_FIND = 130, - MENU_ID_PRINT = 131, - MENU_ID_VIEW_SOURCE = 132, + MENU_ID_FIND = 130, + MENU_ID_PRINT = 131, + MENU_ID_VIEW_SOURCE = 132, // Spell checking word correction suggestions. - MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, - MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, - MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, - MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, - MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, - MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, - MENU_ID_NO_SPELLING_SUGGESTIONS = 205, - MENU_ID_ADD_TO_DICTIONARY = 206, + MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, + MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, + MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, + MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, + MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, + MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, + MENU_ID_NO_SPELLING_SUGGESTIONS = 205, + MENU_ID_ADD_TO_DICTIONARY = 206, // Custom menu items originating from the renderer process. For example, // plugin placeholder menu items or Flash menu items. - MENU_ID_CUSTOM_FIRST = 220, - MENU_ID_CUSTOM_LAST = 250, + MENU_ID_CUSTOM_FIRST = 220, + MENU_ID_CUSTOM_LAST = 250, // All user-defined menu IDs should come between MENU_ID_USER_FIRST and // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges // defined in the tools/gritsettings/resource_ids file. - MENU_ID_USER_FIRST = 26500, - MENU_ID_USER_LAST = 28500, + MENU_ID_USER_FIRST = 26500, + MENU_ID_USER_LAST = 28500, } cef_menu_id_t; /// // Mouse button types. /// typedef enum { - MBT_LEFT = 0, + MBT_LEFT = 0, MBT_MIDDLE, MBT_RIGHT, } cef_mouse_button_type_t; @@ -1639,7 +1636,7 @@ typedef struct _cef_mouse_event_t { // Paint element types. /// typedef enum { - PET_VIEW = 0, + PET_VIEW = 0, PET_POPUP, } cef_paint_element_type_t; @@ -1647,20 +1644,20 @@ typedef enum { // Supported event bit flags. /// typedef enum { - EVENTFLAG_NONE = 0, - EVENTFLAG_CAPS_LOCK_ON = 1 << 0, - EVENTFLAG_SHIFT_DOWN = 1 << 1, - EVENTFLAG_CONTROL_DOWN = 1 << 2, - EVENTFLAG_ALT_DOWN = 1 << 3, - EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, + EVENTFLAG_NONE = 0, + EVENTFLAG_CAPS_LOCK_ON = 1 << 0, + EVENTFLAG_SHIFT_DOWN = 1 << 1, + EVENTFLAG_CONTROL_DOWN = 1 << 2, + EVENTFLAG_ALT_DOWN = 1 << 3, + EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, - EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, + EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, // Mac OS-X command key. - EVENTFLAG_COMMAND_DOWN = 1 << 7, - EVENTFLAG_NUM_LOCK_ON = 1 << 8, - EVENTFLAG_IS_KEY_PAD = 1 << 9, - EVENTFLAG_IS_LEFT = 1 << 10, - EVENTFLAG_IS_RIGHT = 1 << 11, + EVENTFLAG_COMMAND_DOWN = 1 << 7, + EVENTFLAG_NUM_LOCK_ON = 1 << 8, + EVENTFLAG_IS_KEY_PAD = 1 << 9, + EVENTFLAG_IS_LEFT = 1 << 10, + EVENTFLAG_IS_RIGHT = 1 << 11, } cef_event_flags_t; /// @@ -1682,31 +1679,31 @@ typedef enum { /// // No node is selected. /// - CM_TYPEFLAG_NONE = 0, + CM_TYPEFLAG_NONE = 0, /// // The top page is selected. /// - CM_TYPEFLAG_PAGE = 1 << 0, + CM_TYPEFLAG_PAGE = 1 << 0, /// // A subframe page is selected. /// - CM_TYPEFLAG_FRAME = 1 << 1, + CM_TYPEFLAG_FRAME = 1 << 1, /// // A link is selected. /// - CM_TYPEFLAG_LINK = 1 << 2, + CM_TYPEFLAG_LINK = 1 << 2, /// // A media node is selected. /// - CM_TYPEFLAG_MEDIA = 1 << 3, + CM_TYPEFLAG_MEDIA = 1 << 3, /// // There is a textual or mixed selection that is selected. /// - CM_TYPEFLAG_SELECTION = 1 << 4, + CM_TYPEFLAG_SELECTION = 1 << 4, /// // An editable element is selected. /// - CM_TYPEFLAG_EDITABLE = 1 << 5, + CM_TYPEFLAG_EDITABLE = 1 << 5, } cef_context_menu_type_flags_t; /// @@ -1743,32 +1740,32 @@ typedef enum { // Supported context menu media state bit flags. /// typedef enum { - CM_MEDIAFLAG_NONE = 0, - CM_MEDIAFLAG_ERROR = 1 << 0, - CM_MEDIAFLAG_PAUSED = 1 << 1, - CM_MEDIAFLAG_MUTED = 1 << 2, - CM_MEDIAFLAG_LOOP = 1 << 3, - CM_MEDIAFLAG_CAN_SAVE = 1 << 4, - CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, - CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, - CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, - CM_MEDIAFLAG_CAN_PRINT = 1 << 8, - CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, + CM_MEDIAFLAG_NONE = 0, + CM_MEDIAFLAG_ERROR = 1 << 0, + CM_MEDIAFLAG_PAUSED = 1 << 1, + CM_MEDIAFLAG_MUTED = 1 << 2, + CM_MEDIAFLAG_LOOP = 1 << 3, + CM_MEDIAFLAG_CAN_SAVE = 1 << 4, + CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, + CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, + CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, + CM_MEDIAFLAG_CAN_PRINT = 1 << 8, + CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, } cef_context_menu_media_state_flags_t; /// // Supported context menu edit state bit flags. /// typedef enum { - CM_EDITFLAG_NONE = 0, - CM_EDITFLAG_CAN_UNDO = 1 << 0, - CM_EDITFLAG_CAN_REDO = 1 << 1, - CM_EDITFLAG_CAN_CUT = 1 << 2, - CM_EDITFLAG_CAN_COPY = 1 << 3, - CM_EDITFLAG_CAN_PASTE = 1 << 4, - CM_EDITFLAG_CAN_DELETE = 1 << 5, - CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, - CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, + CM_EDITFLAG_NONE = 0, + CM_EDITFLAG_CAN_UNDO = 1 << 0, + CM_EDITFLAG_CAN_REDO = 1 << 1, + CM_EDITFLAG_CAN_CUT = 1 << 2, + CM_EDITFLAG_CAN_COPY = 1 << 3, + CM_EDITFLAG_CAN_PASTE = 1 << 4, + CM_EDITFLAG_CAN_DELETE = 1 << 5, + CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, + CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, } cef_context_menu_edit_state_flags_t; /// @@ -2123,15 +2120,15 @@ typedef enum { COLOR_MODEL_RGB, COLOR_MODEL_RGB16, COLOR_MODEL_RGBA, - COLOR_MODEL_COLORMODE_COLOR, // Used in samsung printer ppds. - COLOR_MODEL_COLORMODE_MONOCHROME, // Used in samsung printer ppds. - COLOR_MODEL_HP_COLOR_COLOR, // Used in HP color printer ppds. - COLOR_MODEL_HP_COLOR_BLACK, // Used in HP color printer ppds. - COLOR_MODEL_PRINTOUTMODE_NORMAL, // Used in foomatic ppds. - COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds. - COLOR_MODEL_PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds. + COLOR_MODEL_COLORMODE_COLOR, // Used in samsung printer ppds. + COLOR_MODEL_COLORMODE_MONOCHROME, // Used in samsung printer ppds. + COLOR_MODEL_HP_COLOR_COLOR, // Used in HP color printer ppds. + COLOR_MODEL_HP_COLOR_BLACK, // Used in HP color printer ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL, // Used in foomatic ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds. + COLOR_MODEL_PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds. COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE, // Used in canon printer ppds. - COLOR_MODEL_PROCESSCOLORMODEL_RGB, // Used in canon printer ppds + COLOR_MODEL_PROCESSCOLORMODEL_RGB, // Used in canon printer ppds } cef_color_model_t; /// @@ -2561,7 +2558,7 @@ typedef enum { // Transparency with pre-multiplied alpha component. /// CEF_ALPHA_TYPE_PREMULTIPLIED, - + /// // Transparency with post-multiplied alpha component. /// diff --git a/include/internal/cef_types_linux.h b/include/internal/cef_types_linux.h index 4a31f087e..f5e1747eb 100644 --- a/include/internal/cef_types_linux.h +++ b/include/internal/cef_types_linux.h @@ -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_INTERNAL_CEF_TYPES_LINUX_H_ #define CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ #pragma once diff --git a/include/internal/cef_types_mac.h b/include/internal/cef_types_mac.h index 459507fe3..3bd62d0ea 100644 --- a/include/internal/cef_types_mac.h +++ b/include/internal/cef_types_mac.h @@ -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_INTERNAL_CEF_TYPES_MAC_H_ #define CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_ #pragma once diff --git a/include/internal/cef_types_win.h b/include/internal/cef_types_win.h index 58c638bba..50a2ebfad 100644 --- a/include/internal/cef_types_win.h +++ b/include/internal/cef_types_win.h @@ -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_INTERNAL_CEF_TYPES_WIN_H_ #define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ #pragma once @@ -54,9 +53,7 @@ extern "C" { /// // Structure representing CefExecuteProcess arguments. /// -typedef struct _cef_main_args_t { - HINSTANCE instance; -} cef_main_args_t; +typedef struct _cef_main_args_t { HINSTANCE instance; } cef_main_args_t; /// // Structure representing window information. diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h index 5f6a42d9d..13ebcfb4b 100644 --- a/include/internal/cef_types_wrappers.h +++ b/include/internal/cef_types_wrappers.h @@ -43,9 +43,7 @@ class CefStructBase : public traits::struct_type { public: typedef typename traits::struct_type struct_type; - CefStructBase() : attached_to_(NULL) { - Init(); - } + CefStructBase() : attached_to_(NULL) { Init(); } virtual ~CefStructBase() { // Only clear this object's data if it isn't currently attached to a // structure. @@ -57,7 +55,7 @@ class CefStructBase : public traits::struct_type { Init(); *this = r; } - CefStructBase(const struct_type& r) { // NOLINT(runtime/explicit) + CefStructBase(const struct_type& r) { Init(); *this = r; } @@ -133,15 +131,15 @@ class CefStructBase : public traits::struct_type { struct_type* attached_to_; }; - struct CefPointTraits { typedef cef_point_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -154,16 +152,12 @@ class CefPoint : public CefStructBase { typedef CefStructBase parent; CefPoint() : parent() {} - CefPoint(const cef_point_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefPoint(const CefPoint& r) : parent(r) {} // NOLINT(runtime/explicit) - CefPoint(int x, int y) : parent() { - Set(x, y); - } + CefPoint(const cef_point_t& r) : parent(r) {} + CefPoint(const CefPoint& r) : parent(r) {} + CefPoint(int x, int y) : parent() { Set(x, y); } bool IsEmpty() const { return x <= 0 && y <= 0; } - void Set(int x_val, int y_val) { - x = x_val, y = y_val; - } + void Set(int x_val, int y_val) { x = x_val, y = y_val; } }; inline bool operator==(const CefPoint& a, const CefPoint& b) { @@ -174,15 +168,15 @@ inline bool operator!=(const CefPoint& a, const CefPoint& b) { return !(a == b); } - struct CefRectTraits { typedef cef_rect_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -195,8 +189,8 @@ class CefRect : public CefStructBase { typedef CefStructBase parent; CefRect() : parent() {} - CefRect(const cef_rect_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefRect(const CefRect& r) : parent(r) {} // NOLINT(runtime/explicit) + CefRect(const cef_rect_t& r) : parent(r) {} + CefRect(const CefRect& r) : parent(r) {} CefRect(int x, int y, int width, int height) : parent() { Set(x, y, width, height); } @@ -226,15 +220,15 @@ inline bool operator!=(const CefRect& a, const CefRect& b) { return !(a == b); } - struct CefSizeTraits { typedef cef_size_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -247,11 +241,9 @@ class CefSize : public CefStructBase { typedef CefStructBase parent; CefSize() : parent() {} - CefSize(const cef_size_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefSize(const CefSize& r) : parent(r) {} // NOLINT(runtime/explicit) - CefSize(int width, int height) : parent() { - Set(width, height); - } + CefSize(const cef_size_t& r) : parent(r) {} + CefSize(const CefSize& r) : parent(r) {} + CefSize(int width, int height) : parent() { Set(width, height); } bool IsEmpty() const { return width <= 0 || height <= 0; } void Set(int width_val, int height_val) { @@ -267,15 +259,15 @@ inline bool operator!=(const CefSize& a, const CefSize& b) { return !(a == b); } - struct CefRangeTraits { typedef cef_range_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -288,17 +280,11 @@ class CefRange : public CefStructBase { typedef CefStructBase parent; CefRange() : parent() {} - CefRange(const cef_range_t& r) // NOLINT(runtime/explicit) - : parent(r) {} - CefRange(const CefRange& r) // NOLINT(runtime/explicit) - : parent(r) {} - CefRange(int from, int to) : parent() { - Set(from, to); - } + CefRange(const cef_range_t& r) : parent(r) {} + CefRange(const CefRange& r) : parent(r) {} + CefRange(int from, int to) : parent() { Set(from, to); } - void Set(int from_val, int to_val) { - from = from_val, to = to_val; - } + void Set(int from_val, int to_val) { from = from_val, to = to_val; } }; inline bool operator==(const CefRange& a, const CefRange& b) { @@ -309,15 +295,15 @@ inline bool operator!=(const CefRange& a, const CefRange& b) { return !(a == b); } - struct CefInsetsTraits { typedef cef_insets_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -330,8 +316,8 @@ class CefInsets : public CefStructBase { typedef CefStructBase parent; CefInsets() : parent() {} - CefInsets(const cef_insets_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefInsets(const CefInsets& r) : parent(r) {} // NOLINT(runtime/explicit) + CefInsets(const cef_insets_t& r) : parent(r) {} + CefInsets(const CefInsets& r) : parent(r) {} CefInsets(int top, int left, int bottom, int right) : parent() { Set(top, left, bottom, right); } @@ -350,15 +336,15 @@ inline bool operator!=(const CefInsets& a, const CefInsets& b) { return !(a == b); } - struct CefDraggableRegionTraits { typedef cef_draggable_region_t struct_type; static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -371,10 +357,8 @@ class CefDraggableRegion : public CefStructBase { typedef CefStructBase parent; CefDraggableRegion() : parent() {} - CefDraggableRegion(const cef_draggable_region_t& r) // NOLINT(runtime/explicit) - : parent(r) {} - CefDraggableRegion(const CefDraggableRegion& r) // NOLINT(runtime/explicit) - : parent(r) {} + CefDraggableRegion(const cef_draggable_region_t& r) : parent(r) {} + CefDraggableRegion(const CefDraggableRegion& r) : parent(r) {} CefDraggableRegion(const CefRect& bounds, bool draggable) : parent() { Set(bounds, draggable); } @@ -385,16 +369,15 @@ class CefDraggableRegion : public CefStructBase { }; inline bool operator==(const CefDraggableRegion& a, - const CefDraggableRegion& b) { + const CefDraggableRegion& b) { return a.bounds == b.bounds && a.draggable == b.draggable; } inline bool operator!=(const CefDraggableRegion& a, - const CefDraggableRegion& b) { + const CefDraggableRegion& b) { return !(a == b); } - struct CefScreenInfoTraits { typedef cef_screen_info_t struct_type; @@ -402,8 +385,9 @@ struct CefScreenInfoTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->device_scale_factor = src->device_scale_factor; target->depth = src->depth; target->depth_per_component = src->depth_per_component; @@ -422,16 +406,17 @@ class CefScreenInfo : public CefStructBase { typedef CefStructBase parent; CefScreenInfo() : parent() {} - CefScreenInfo(const cef_screen_info_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefScreenInfo(const CefScreenInfo& r) : parent(r) {} // NOLINT(runtime/explicit) + CefScreenInfo(const cef_screen_info_t& r) : parent(r) {} + CefScreenInfo(const CefScreenInfo& r) : parent(r) {} CefScreenInfo(float device_scale_factor, int depth, int depth_per_component, bool is_monochrome, const CefRect& rect, - const CefRect& available_rect) : parent() { - Set(device_scale_factor, depth, depth_per_component, - is_monochrome, rect, available_rect); + const CefRect& available_rect) + : parent() { + Set(device_scale_factor, depth, depth_per_component, is_monochrome, rect, + available_rect); } void Set(float device_scale_factor_val, @@ -449,7 +434,6 @@ class CefScreenInfo : public CefStructBase { } }; - struct CefKeyEventTraits { typedef cef_key_event_t struct_type; @@ -457,8 +441,9 @@ struct CefKeyEventTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->type = src->type; target->modifiers = src->modifiers; target->windows_key_code = src->windows_key_code; @@ -475,7 +460,6 @@ struct CefKeyEventTraits { /// typedef CefStructBase CefKeyEvent; - struct CefMouseEventTraits { typedef cef_mouse_event_t struct_type; @@ -483,8 +467,9 @@ struct CefMouseEventTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->x = src->x; target->y = src->y; target->modifiers = src->modifiers; @@ -496,7 +481,6 @@ struct CefMouseEventTraits { /// typedef CefStructBase CefMouseEvent; - struct CefPopupFeaturesTraits { typedef cef_popup_features_t struct_type; @@ -511,8 +495,9 @@ struct CefPopupFeaturesTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->x = src->x; target->xSet = src->xSet; target->y = src->y; @@ -537,13 +522,10 @@ struct CefPopupFeaturesTraits { /// typedef CefStructBase CefPopupFeatures; - struct CefSettingsTraits { typedef cef_settings_t struct_type; - static inline void init(struct_type* s) { - s->size = sizeof(struct_type); - } + static inline void init(struct_type* s) { s->size = sizeof(struct_type); } static inline void clear(struct_type* s) { cef_string_clear(&s->browser_subprocess_path); @@ -560,44 +542,44 @@ struct CefSettingsTraits { cef_string_clear(&s->accept_language_list); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->single_process = src->single_process; target->no_sandbox = src->no_sandbox; cef_string_set(src->browser_subprocess_path.str, - src->browser_subprocess_path.length, - &target->browser_subprocess_path, copy); - cef_string_set(src->framework_dir_path.str, - src->framework_dir_path.length, - &target->framework_dir_path, copy); + src->browser_subprocess_path.length, + &target->browser_subprocess_path, copy); + cef_string_set(src->framework_dir_path.str, src->framework_dir_path.length, + &target->framework_dir_path, copy); target->multi_threaded_message_loop = src->multi_threaded_message_loop; target->external_message_pump = src->external_message_pump; target->windowless_rendering_enabled = src->windowless_rendering_enabled; target->command_line_args_disabled = src->command_line_args_disabled; cef_string_set(src->cache_path.str, src->cache_path.length, - &target->cache_path, copy); + &target->cache_path, copy); cef_string_set(src->user_data_path.str, src->user_data_path.length, - &target->user_data_path, copy); + &target->user_data_path, copy); target->persist_session_cookies = src->persist_session_cookies; target->persist_user_preferences = src->persist_user_preferences; cef_string_set(src->user_agent.str, src->user_agent.length, - &target->user_agent, copy); + &target->user_agent, copy); cef_string_set(src->product_version.str, src->product_version.length, - &target->product_version, copy); + &target->product_version, copy); cef_string_set(src->locale.str, src->locale.length, &target->locale, copy); cef_string_set(src->log_file.str, src->log_file.length, &target->log_file, - copy); + copy); target->log_severity = src->log_severity; cef_string_set(src->javascript_flags.str, src->javascript_flags.length, - &target->javascript_flags, copy); + &target->javascript_flags, copy); cef_string_set(src->resources_dir_path.str, src->resources_dir_path.length, - &target->resources_dir_path, copy); + &target->resources_dir_path, copy); cef_string_set(src->locales_dir_path.str, src->locales_dir_path.length, - &target->locales_dir_path, copy); + &target->locales_dir_path, copy); target->pack_loading_disabled = src->pack_loading_disabled; target->remote_debugging_port = src->remote_debugging_port; target->uncaught_exception_stack_size = src->uncaught_exception_stack_size; @@ -607,7 +589,8 @@ struct CefSettingsTraits { target->background_color = src->background_color; cef_string_set(src->accept_language_list.str, - src->accept_language_list.length, &target->accept_language_list, copy); + src->accept_language_list.length, + &target->accept_language_list, copy); } }; @@ -616,30 +599,29 @@ struct CefSettingsTraits { /// typedef CefStructBase CefSettings; - struct CefRequestContextSettingsTraits { typedef cef_request_context_settings_t struct_type; - static inline void init(struct_type* s) { - s->size = sizeof(struct_type); - } + static inline void init(struct_type* s) { s->size = sizeof(struct_type); } static inline void clear(struct_type* s) { cef_string_clear(&s->cache_path); cef_string_clear(&s->accept_language_list); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { cef_string_set(src->cache_path.str, src->cache_path.length, - &target->cache_path, copy); + &target->cache_path, copy); target->persist_session_cookies = src->persist_session_cookies; target->persist_user_preferences = src->persist_user_preferences; target->ignore_certificate_errors = src->ignore_certificate_errors; target->enable_net_security_expiration = src->enable_net_security_expiration; cef_string_set(src->accept_language_list.str, - src->accept_language_list.length, &target->accept_language_list, copy); + src->accept_language_list.length, + &target->accept_language_list, copy); } }; @@ -649,13 +631,10 @@ struct CefRequestContextSettingsTraits { typedef CefStructBase CefRequestContextSettings; - struct CefBrowserSettingsTraits { typedef cef_browser_settings_t struct_type; - static inline void init(struct_type* s) { - s->size = sizeof(struct_type); - } + static inline void init(struct_type* s) { s->size = sizeof(struct_type); } static inline void clear(struct_type* s) { cef_string_clear(&s->standard_font_family); @@ -668,23 +647,27 @@ struct CefBrowserSettingsTraits { cef_string_clear(&s->accept_language_list); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->windowless_frame_rate = src->windowless_frame_rate; cef_string_set(src->standard_font_family.str, - src->standard_font_family.length, &target->standard_font_family, copy); + src->standard_font_family.length, + &target->standard_font_family, copy); cef_string_set(src->fixed_font_family.str, src->fixed_font_family.length, - &target->fixed_font_family, copy); + &target->fixed_font_family, copy); cef_string_set(src->serif_font_family.str, src->serif_font_family.length, - &target->serif_font_family, copy); + &target->serif_font_family, copy); cef_string_set(src->sans_serif_font_family.str, - src->sans_serif_font_family.length, &target->sans_serif_font_family, - copy); + src->sans_serif_font_family.length, + &target->sans_serif_font_family, copy); cef_string_set(src->cursive_font_family.str, - src->cursive_font_family.length, &target->cursive_font_family, copy); + src->cursive_font_family.length, + &target->cursive_font_family, copy); cef_string_set(src->fantasy_font_family.str, - src->fantasy_font_family.length, &target->fantasy_font_family, copy); + src->fantasy_font_family.length, + &target->fantasy_font_family, copy); target->default_font_size = src->default_font_size; target->default_fixed_font_size = src->default_fixed_font_size; @@ -692,7 +675,7 @@ struct CefBrowserSettingsTraits { target->minimum_logical_font_size = src->minimum_logical_font_size; cef_string_set(src->default_encoding.str, src->default_encoding.length, - &target->default_encoding, copy); + &target->default_encoding, copy); target->remote_fonts = src->remote_fonts; target->javascript = src->javascript; @@ -711,14 +694,15 @@ struct CefBrowserSettingsTraits { target->text_area_resize = src->text_area_resize; target->tab_to_links = src->tab_to_links; target->local_storage = src->local_storage; - target->databases= src->databases; + target->databases = src->databases; target->application_cache = src->application_cache; target->webgl = src->webgl; target->background_color = src->background_color; cef_string_set(src->accept_language_list.str, - src->accept_language_list.length, &target->accept_language_list, copy); + src->accept_language_list.length, + &target->accept_language_list, copy); } }; @@ -727,7 +711,6 @@ struct CefBrowserSettingsTraits { /// typedef CefStructBase CefBrowserSettings; - struct CefURLPartsTraits { typedef cef_urlparts_t struct_type; @@ -745,14 +728,15 @@ struct CefURLPartsTraits { cef_string_clear(&s->query); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { cef_string_set(src->spec.str, src->spec.length, &target->spec, copy); cef_string_set(src->scheme.str, src->scheme.length, &target->scheme, copy); cef_string_set(src->username.str, src->username.length, &target->username, - copy); + copy); cef_string_set(src->password.str, src->password.length, &target->password, - copy); + copy); cef_string_set(src->host.str, src->host.length, &target->host, copy); cef_string_set(src->port.str, src->port.length, &target->port, copy); cef_string_set(src->origin.str, src->origin.length, &target->origin, copy); @@ -766,7 +750,6 @@ struct CefURLPartsTraits { /// typedef CefStructBase CefURLParts; - struct CefTimeTraits { typedef cef_time_t struct_type; @@ -774,8 +757,9 @@ struct CefTimeTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -788,15 +772,13 @@ class CefTime : public CefStructBase { typedef CefStructBase parent; CefTime() : parent() {} - CefTime(const cef_time_t& r) : parent(r) {} // NOLINT(runtime/explicit) - CefTime(const CefTime& r) : parent(r) {} // NOLINT(runtime/explicit) + CefTime(const cef_time_t& r) : parent(r) {} + CefTime(const CefTime& r) : parent(r) {} explicit CefTime(time_t r) : parent() { SetTimeT(r); } explicit CefTime(double r) : parent() { SetDoubleT(r); } // Converts to/from time_t. - void SetTimeT(time_t r) { - cef_time_from_timet(r, this); - } + void SetTimeT(time_t r) { cef_time_from_timet(r, this); } time_t GetTimeT() const { time_t time = 0; cef_time_to_timet(this, &time); @@ -806,9 +788,7 @@ class CefTime : public CefStructBase { // Converts to/from a double which is the number of seconds since epoch // (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 // means "not initialized". - void SetDoubleT(double r) { - cef_time_from_doublet(r, this); - } + void SetDoubleT(double r) { cef_time_from_doublet(r, this); } double GetDoubleT() const { double time = 0; cef_time_to_doublet(this, &time); @@ -816,9 +796,7 @@ class CefTime : public CefStructBase { } // Set this object to now. - void Now() { - cef_time_now(this); - } + void Now() { cef_time_now(this); } // Return the delta between this object and |other| in milliseconds. long long Delta(const CefTime& other) { @@ -828,7 +806,6 @@ class CefTime : public CefStructBase { } }; - struct CefCookieTraits { typedef cef_cookie_t struct_type; @@ -841,8 +818,9 @@ struct CefCookieTraits { cef_string_clear(&s->path); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { cef_string_set(src->name.str, src->name.length, &target->name, copy); cef_string_set(src->value.str, src->value.length, &target->value, copy); cef_string_set(src->domain.str, src->domain.length, &target->domain, copy); @@ -861,7 +839,6 @@ struct CefCookieTraits { /// typedef CefStructBase CefCookie; - struct CefGeopositionTraits { typedef cef_geoposition_t struct_type; @@ -871,8 +848,9 @@ struct CefGeopositionTraits { cef_string_clear(&s->error_message); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->latitude = src->latitude; target->longitude = src->longitude; target->altitude = src->altitude; @@ -883,7 +861,7 @@ struct CefGeopositionTraits { target->timestamp = src->timestamp; target->error_code = src->error_code; cef_string_set(src->error_message.str, src->error_message.length, - &target->error_message, copy); + &target->error_message, copy); } }; @@ -892,7 +870,6 @@ struct CefGeopositionTraits { /// typedef CefStructBase CefGeoposition; - struct CefCursorInfoTraits { typedef cef_cursor_info_t struct_type; @@ -900,8 +877,9 @@ struct CefCursorInfoTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->hotspot = src->hotspot; target->image_scale_factor = src->image_scale_factor; target->buffer = src->buffer; @@ -914,7 +892,6 @@ struct CefCursorInfoTraits { /// typedef CefStructBase CefCursorInfo; - struct CefPdfPrintSettingsTraits { typedef cef_pdf_print_settings_t struct_type; @@ -925,13 +902,14 @@ struct CefPdfPrintSettingsTraits { cef_string_clear(&s->header_footer_url); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { - + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { cef_string_set(src->header_footer_title.str, - src->header_footer_title.length, &target->header_footer_title, copy); + src->header_footer_title.length, + &target->header_footer_title, copy); cef_string_set(src->header_footer_url.str, src->header_footer_url.length, - &target->header_footer_url, copy); + &target->header_footer_url, copy); target->page_width = src->page_width; target->page_height = src->page_height; @@ -956,7 +934,6 @@ struct CefPdfPrintSettingsTraits { /// typedef CefStructBase CefPdfPrintSettings; - struct CefBoxLayoutSettingsTraits { typedef cef_box_layout_settings_t struct_type; @@ -964,8 +941,9 @@ struct CefBoxLayoutSettingsTraits { static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { *target = *src; } }; @@ -986,10 +964,10 @@ struct CefCompositionUnderlineTraits { s->thick = 0; } - static inline void clear(struct_type* s) { - } + static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, + static inline void set(const struct_type* src, + struct_type* target, bool copy) { target->range = src->range; target->color = src->color; diff --git a/include/internal/cef_win.h b/include/internal/cef_win.h index f4028778b..8b30a4fec 100644 --- a/include/internal/cef_win.h +++ b/include/internal/cef_win.h @@ -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_INTERNAL_CEF_WIN_H_ #define CEF_INCLUDE_INTERNAL_CEF_WIN_H_ #pragma once @@ -48,8 +47,9 @@ struct CefMainArgsTraits { static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->instance = src->instance; } }; @@ -62,9 +62,7 @@ class CefMainArgs : public CefStructBase { CefMainArgs() : parent() {} explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {} explicit CefMainArgs(const CefMainArgs& r) : parent(r) {} - explicit CefMainArgs(HINSTANCE hInstance) : parent() { - instance = hInstance; - } + explicit CefMainArgs(HINSTANCE hInstance) : parent() { instance = hInstance; } }; struct CefWindowInfoTraits { @@ -76,11 +74,12 @@ struct CefWindowInfoTraits { cef_string_clear(&s->window_name); } - static inline void set(const struct_type* src, struct_type* target, - bool copy) { + static inline void set(const struct_type* src, + struct_type* target, + bool copy) { target->ex_style = src->ex_style; cef_string_set(src->window_name.str, src->window_name.length, - &target->window_name, copy); + &target->window_name, copy); target->style = src->style; target->x = src->x; target->y = src->y; @@ -108,8 +107,8 @@ class CefWindowInfo : public CefStructBase { // Create the browser as a child window. /// void SetAsChild(CefWindowHandle parent, RECT windowRect) { - style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP | - WS_VISIBLE; + style = + WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP | WS_VISIBLE; parent_window = parent; x = windowRect.left; y = windowRect.top; @@ -121,8 +120,8 @@ class CefWindowInfo : public CefStructBase { // Create the browser as a popup window. /// void SetAsPopup(CefWindowHandle parent, const CefString& windowName) { - style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | - WS_VISIBLE; + style = + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE; parent_window = parent; x = CW_USEDEFAULT; y = CW_USEDEFAULT; diff --git a/include/test/cef_translator_test.h b/include/test/cef_translator_test.h index 29d1da262..590b5a27d 100644 --- a/include/test/cef_translator_test.h +++ b/include/test/cef_translator_test.h @@ -63,22 +63,22 @@ class CefTranslatorTestScopedLibrary; class CefTranslatorTestScopedLibraryChild; // Test values. -#define TEST_INT_VAL 5 -#define TEST_INT_VAL2 60 -#define TEST_BOOL_VAL true -#define TEST_DOUBLE_VAL 4.543 -#define TEST_LONG_VAL -65 -#define TEST_SIZET_VAL 3U -#define TEST_STRING_VAL "My test string" -#define TEST_STRING_VAL2 "My 2nd test string" -#define TEST_STRING_VAL3 "My 3rd test string" -#define TEST_STRING_KEY "key0" -#define TEST_STRING_KEY2 "key1" -#define TEST_STRING_KEY3 "key2" -#define TEST_X_VAL 44 -#define TEST_Y_VAL 754 -#define TEST_X_VAL2 900 -#define TEST_Y_VAL2 300 +#define TEST_INT_VAL 5 +#define TEST_INT_VAL2 60 +#define TEST_BOOL_VAL true +#define TEST_DOUBLE_VAL 4.543 +#define TEST_LONG_VAL -65 +#define TEST_SIZET_VAL 3U +#define TEST_STRING_VAL "My test string" +#define TEST_STRING_VAL2 "My 2nd test string" +#define TEST_STRING_VAL3 "My 3rd test string" +#define TEST_STRING_KEY "key0" +#define TEST_STRING_KEY2 "key1" +#define TEST_STRING_KEY3 "key2" +#define TEST_X_VAL 44 +#define TEST_Y_VAL 754 +#define TEST_X_VAL2 900 +#define TEST_Y_VAL2 300 /// // Class for testing all of the possible data transfer types. @@ -92,81 +92,79 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ static CefRefPtr Create(); - // PRIMITIVE VALUES /// // Return a void value. /// /*--cef()--*/ - virtual void GetVoid() =0; + virtual void GetVoid() = 0; /// // Return a bool value. /// /*--cef()--*/ - virtual bool GetBool() =0; + virtual bool GetBool() = 0; /// // Return an int value. /// /*--cef()--*/ - virtual int GetInt() =0; + virtual int GetInt() = 0; /// // Return a double value. /// /*--cef()--*/ - virtual double GetDouble() =0; + virtual double GetDouble() = 0; /// // Return a long value. /// /*--cef()--*/ - virtual long GetLong() =0; + virtual long GetLong() = 0; /// // Return a size_t value. /// /*--cef()--*/ - virtual size_t GetSizet() =0; + virtual size_t GetSizet() = 0; /// // Set a void value. /// /*--cef()--*/ - virtual bool SetVoid() =0; + virtual bool SetVoid() = 0; /// // Set a bool value. /// /*--cef()--*/ - virtual bool SetBool(bool val) =0; + virtual bool SetBool(bool val) = 0; /// // Set an int value. /// /*--cef()--*/ - virtual bool SetInt(int val) =0; + virtual bool SetInt(int val) = 0; /// // Set a double value. /// /*--cef()--*/ - virtual bool SetDouble(double val) =0; + virtual bool SetDouble(double val) = 0; /// // Set a long value. /// /*--cef()--*/ - virtual bool SetLong(long val) =0; + virtual bool SetLong(long val) = 0; /// // Set a size_t value. /// /*--cef()--*/ - virtual bool SetSizet(size_t val) =0; - + virtual bool SetSizet(size_t val) = 0; // PRIMITIVE LIST VALUES @@ -177,13 +175,13 @@ class CefTranslatorTest : public CefBaseRefCounted { // Set a int list value. /// /*--cef()--*/ - virtual bool SetIntList(const std::vector& val) =0; + virtual bool SetIntList(const std::vector& val) = 0; /// // Return an int list value by out-param. /// /*--cef(count_func=val:GetIntListSize)--*/ - virtual bool GetIntListByRef(IntList& val) =0; + virtual bool GetIntListByRef(IntList& val) = 0; /// // Return the number of points that will be output above. @@ -191,27 +189,25 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual size_t GetIntListSize() = 0; - // STRING VALUES /// // Return a string value. /// /*--cef()--*/ - virtual CefString GetString() =0; + virtual CefString GetString() = 0; /// // Set a string value. /// /*--cef()--*/ - virtual bool SetString(const CefString& val) =0; + virtual bool SetString(const CefString& val) = 0; /// // Return a string value by out-param. /// /*--cef()--*/ - virtual void GetStringByRef(CefString& val) =0; - + virtual void GetStringByRef(CefString& val) = 0; // STRING LIST VALUES @@ -222,14 +218,13 @@ class CefTranslatorTest : public CefBaseRefCounted { // Set a string list value. /// /*--cef()--*/ - virtual bool SetStringList(const std::vector& val) =0; + virtual bool SetStringList(const std::vector& val) = 0; /// // Return a string list value by out-param. /// /*--cef()--*/ - virtual bool GetStringListByRef(StringList& val) =0; - + virtual bool GetStringListByRef(StringList& val) = 0; // STRING MAP VALUES @@ -240,14 +235,13 @@ class CefTranslatorTest : public CefBaseRefCounted { // Set a string map value. /// /*--cef()--*/ - virtual bool SetStringMap(const StringMap& val) =0; + virtual bool SetStringMap(const StringMap& val) = 0; /// // Return a string map value by out-param. /// /*--cef()--*/ - virtual bool GetStringMapByRef(std::map& val) =0; - + virtual bool GetStringMapByRef(std::map& val) = 0; // STRING MULTIMAP VALUES @@ -259,14 +253,13 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetStringMultimap( - const std::multimap& val) =0; + const std::multimap& val) = 0; /// // Return a string multimap value by out-param. /// /*--cef()--*/ - virtual bool GetStringMultimapByRef(StringMultimap& val) =0; - + virtual bool GetStringMultimapByRef(StringMultimap& val) = 0; // STRUCT VALUES @@ -274,20 +267,19 @@ class CefTranslatorTest : public CefBaseRefCounted { // Return a point value. /// /*--cef()--*/ - virtual CefPoint GetPoint() =0; + virtual CefPoint GetPoint() = 0; /// // Set a point value. /// /*--cef()--*/ - virtual bool SetPoint(const CefPoint& val) =0; + virtual bool SetPoint(const CefPoint& val) = 0; /// // Return a point value by out-param. /// /*--cef()--*/ - virtual void GetPointByRef(CefPoint& val) =0; - + virtual void GetPointByRef(CefPoint& val) = 0; // STRUCT LIST VALUES @@ -298,13 +290,13 @@ class CefTranslatorTest : public CefBaseRefCounted { // Set a point list vlaue. /// /*--cef()--*/ - virtual bool SetPointList(const std::vector& val) =0; + virtual bool SetPointList(const std::vector& val) = 0; /// // Return a point list value by out-param. /// /*--cef(count_func=val:GetPointListSize)--*/ - virtual bool GetPointListByRef(PointList& val) =0; + virtual bool GetPointListByRef(PointList& val) = 0; /// // Return the number of points that will be output above. @@ -312,7 +304,6 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual size_t GetPointListSize() = 0; - // LIBRARY-SIDE REFPTR VALUES /// @@ -320,7 +311,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefRefPtr GetRefPtrLibrary( - int val) =0; + int val) = 0; /// // Set an object. Returns the value from @@ -329,7 +320,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetRefPtrLibrary( - CefRefPtr val) =0; + CefRefPtr val) = 0; /// // Set an object. Returns the object passed in. This tests input and output @@ -337,7 +328,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefRefPtr SetRefPtrLibraryAndReturn( - CefRefPtr val) =0; + CefRefPtr val) = 0; /// // Set a child object. Returns the value from @@ -346,7 +337,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildRefPtrLibrary( - CefRefPtr val) =0; + CefRefPtr val) = 0; /// // Set a child object. Returns the object as the parent type. This tests input @@ -355,13 +346,12 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual CefRefPtr SetChildRefPtrLibraryAndReturnParent( - CefRefPtr val) =0; - + CefRefPtr val) = 0; // LIBRARY-SIDE REFPTR LIST VALUES // Test both with and without a typedef. - typedef std::vector > + typedef std::vector> RefPtrLibraryList; /// @@ -369,15 +359,17 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetRefPtrLibraryList( - const std::vector >& val, - int val1, int val2) =0; + const std::vector>& val, + int val1, + int val2) = 0; /// // Return an object list value by out-param. /// /*--cef(count_func=val:GetRefPtrLibraryListSize)--*/ - virtual bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1, - int val2) =0; + virtual bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, + int val1, + int val2) = 0; /// // Return the number of object that will be output above. @@ -385,7 +377,6 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual size_t GetRefPtrLibraryListSize() = 0; - // CLIENT-SIDE REFPTR VALUES /// @@ -394,7 +385,7 @@ class CefTranslatorTest : public CefBaseRefCounted { // This tests input and execution of a client-side object type. /// /*--cef()--*/ - virtual int SetRefPtrClient(CefRefPtr val) =0; + virtual int SetRefPtrClient(CefRefPtr val) = 0; /// // Set an object. Returns the handler passed in. This tests input and output @@ -402,7 +393,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefRefPtr SetRefPtrClientAndReturn( - CefRefPtr val) =0; + CefRefPtr val) = 0; /// // Set a child object. Returns the value from @@ -411,7 +402,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildRefPtrClient( - CefRefPtr val) =0; + CefRefPtr val) = 0; /// // Set a child object. Returns the object as the parent type. This tests @@ -420,13 +411,12 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual CefRefPtr SetChildRefPtrClientAndReturnParent( - CefRefPtr val) =0; - + CefRefPtr val) = 0; // CLIENT-SIDE REFPTR LIST VALUES // Test both with and without a typedef. - typedef std::vector > + typedef std::vector> RefPtrClientList; /// @@ -434,8 +424,9 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetRefPtrClientList( - const std::vector >& val, - int val1, int val2) =0; + const std::vector>& val, + int val1, + int val2) = 0; /// // Return an object list value by out-param. @@ -444,7 +435,7 @@ class CefTranslatorTest : public CefBaseRefCounted { virtual bool GetRefPtrClientListByRef( RefPtrClientList& val, CefRefPtr val1, - CefRefPtr val2) =0; + CefRefPtr val2) = 0; /// // Return the number of object that will be output above. @@ -452,7 +443,6 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual size_t GetRefPtrClientListSize() = 0; - // LIBRARY-SIDE OWNPTR VALUES /// @@ -460,7 +450,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefOwnPtr GetOwnPtrLibrary( - int val) =0; + int val) = 0; /// // Set an object. Returns the value from @@ -469,7 +459,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetOwnPtrLibrary( - CefOwnPtr val) =0; + CefOwnPtr val) = 0; /// // Set an object. Returns the object passed in. This tests input and output @@ -477,7 +467,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefOwnPtr SetOwnPtrLibraryAndReturn( - CefOwnPtr val) =0; + CefOwnPtr val) = 0; /// // Set a child object. Returns the value from @@ -486,7 +476,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildOwnPtrLibrary( - CefOwnPtr val) =0; + CefOwnPtr val) = 0; /// // Set a child object. Returns the object as the parent type. This tests input @@ -495,8 +485,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual CefOwnPtr SetChildOwnPtrLibraryAndReturnParent( - CefOwnPtr val) =0; - + CefOwnPtr val) = 0; // CLIENT-SIDE OWNPTR VALUES @@ -506,7 +495,7 @@ class CefTranslatorTest : public CefBaseRefCounted { // This tests input and execution of a client-side object type. /// /*--cef()--*/ - virtual int SetOwnPtrClient(CefOwnPtr val) =0; + virtual int SetOwnPtrClient(CefOwnPtr val) = 0; /// // Set an object. Returns the handler passed in. This tests input and output @@ -514,7 +503,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual CefOwnPtr SetOwnPtrClientAndReturn( - CefOwnPtr val) =0; + CefOwnPtr val) = 0; /// // Set a child object. Returns the value from @@ -523,7 +512,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildOwnPtrClient( - CefOwnPtr val) =0; + CefOwnPtr val) = 0; /// // Set a child object. Returns the object as the parent type. This tests @@ -532,8 +521,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /*--cef()--*/ virtual CefOwnPtr SetChildOwnPtrClientAndReturnParent( - CefOwnPtr val) =0; - + CefOwnPtr val) = 0; // LIBRARY-SIDE RAWPTR VALUES @@ -544,7 +532,7 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetRawPtrLibrary( - CefRawPtr val) =0; + CefRawPtr val) = 0; /// // Set a child object. Returns the value from @@ -553,13 +541,12 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildRawPtrLibrary( - CefRawPtr val) =0; - + CefRawPtr val) = 0; // LIBRARY-SIDE RAWPTR LIST VALUES // Test both with and without a typedef. - typedef std::vector > + typedef std::vector> RawPtrLibraryList; /// @@ -567,9 +554,9 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetRawPtrLibraryList( - const std::vector >& val, - int val1, int val2) =0; - + const std::vector>& val, + int val1, + int val2) = 0; // CLIENT-SIDE RAWPTR VALUES @@ -579,7 +566,7 @@ class CefTranslatorTest : public CefBaseRefCounted { // This tests input and execution of a client-side object type. /// /*--cef()--*/ - virtual int SetRawPtrClient(CefRawPtr val) =0; + virtual int SetRawPtrClient(CefRawPtr val) = 0; /// // Set a child object. Returns the value from @@ -588,13 +575,12 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual int SetChildRawPtrClient( - CefRawPtr val) =0; - + CefRawPtr val) = 0; // CLIENT-SIDE RAWPTR LIST VALUES // Test both with and without a typedef. - typedef std::vector > + typedef std::vector> RawPtrClientList; /// @@ -602,11 +588,11 @@ class CefTranslatorTest : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool SetRawPtrClientList( - const std::vector >& val, - int val1, int val2) =0; + const std::vector>& val, + int val1, + int val2) = 0; }; - /// // Library-side test object for RefPtr. /// @@ -623,70 +609,67 @@ class CefTranslatorTestRefPtrLibrary : public CefBaseRefCounted { // Return a value. /// /*--cef()--*/ - virtual int GetValue() =0; + virtual int GetValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetValue(int value) =0; + virtual void SetValue(int value) = 0; }; /// // Library-side child test object for RefPtr. /// /*--cef(source=library)--*/ -class CefTranslatorTestRefPtrLibraryChild : - public CefTranslatorTestRefPtrLibrary { +class CefTranslatorTestRefPtrLibraryChild + : public CefTranslatorTestRefPtrLibrary { public: /// // Create the test object. /// /*--cef()--*/ - static CefRefPtr Create( - int value, - int other_value); + static CefRefPtr Create(int value, + int other_value); /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherValue() =0; + virtual int GetOtherValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetOtherValue(int value) =0; + virtual void SetOtherValue(int value) = 0; }; /// // Another library-side child test object for RefPtr. /// /*--cef(source=library)--*/ -class CefTranslatorTestRefPtrLibraryChildChild : - public CefTranslatorTestRefPtrLibraryChild { +class CefTranslatorTestRefPtrLibraryChildChild + : public CefTranslatorTestRefPtrLibraryChild { public: /// // Create the test object. /// /*--cef()--*/ - static CefRefPtr Create( - int value, - int other_value, - int other_other_value); + static CefRefPtr + Create(int value, int other_value, int other_other_value); /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherOtherValue() =0; + virtual int GetOtherOtherValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetOtherOtherValue(int value) =0; + virtual void SetOtherOtherValue(int value) = 0; }; /// @@ -699,24 +682,23 @@ class CefTranslatorTestRefPtrClient : public virtual CefBaseRefCounted { // Return a value. /// /*--cef()--*/ - virtual int GetValue() =0; + virtual int GetValue() = 0; }; /// // Client-side child test object for RefPtr. /// /*--cef(source=client)--*/ -class CefTranslatorTestRefPtrClientChild : - public CefTranslatorTestRefPtrClient { +class CefTranslatorTestRefPtrClientChild + : public CefTranslatorTestRefPtrClient { public: /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherValue() =0; + virtual int GetOtherValue() = 0; }; - /// // Library-side test object for OwnPtr/RawPtr. /// @@ -733,70 +715,67 @@ class CefTranslatorTestScopedLibrary : public CefBaseScoped { // Return a value. /// /*--cef()--*/ - virtual int GetValue() =0; + virtual int GetValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetValue(int value) =0; + virtual void SetValue(int value) = 0; }; /// // Library-side child test object for OwnPtr/RawPtr. /// /*--cef(source=library)--*/ -class CefTranslatorTestScopedLibraryChild : - public CefTranslatorTestScopedLibrary { +class CefTranslatorTestScopedLibraryChild + : public CefTranslatorTestScopedLibrary { public: /// // Create the test object. /// /*--cef()--*/ - static CefOwnPtr Create( - int value, - int other_value); + static CefOwnPtr Create(int value, + int other_value); /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherValue() =0; + virtual int GetOtherValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetOtherValue(int value) =0; + virtual void SetOtherValue(int value) = 0; }; /// // Another library-side child test object for OwnPtr/RawPtr. /// /*--cef(source=library)--*/ -class CefTranslatorTestScopedLibraryChildChild : - public CefTranslatorTestScopedLibraryChild { +class CefTranslatorTestScopedLibraryChildChild + : public CefTranslatorTestScopedLibraryChild { public: /// // Create the test object. /// /*--cef()--*/ - static CefOwnPtr Create( - int value, - int other_value, - int other_other_value); + static CefOwnPtr + Create(int value, int other_value, int other_other_value); /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherOtherValue() =0; + virtual int GetOtherOtherValue() = 0; /// // Set a value. /// /*--cef()--*/ - virtual void SetOtherOtherValue(int value) =0; + virtual void SetOtherOtherValue(int value) = 0; }; /// @@ -809,21 +788,21 @@ class CefTranslatorTestScopedClient : public virtual CefBaseScoped { // Return a value. /// /*--cef()--*/ - virtual int GetValue() =0; + virtual int GetValue() = 0; }; /// // Client-side child test object for OwnPtr/RawPtr. /// /*--cef(source=client)--*/ -class CefTranslatorTestScopedClientChild : - public CefTranslatorTestScopedClient { +class CefTranslatorTestScopedClientChild + : public CefTranslatorTestScopedClient { public: /// // Return a value. /// /*--cef()--*/ - virtual int GetOtherValue() =0; + virtual int GetOtherValue() = 0; }; #endif // CEF_INCLUDE_TEST_CEF_TEST_H_ diff --git a/include/views/cef_box_layout.h b/include/views/cef_box_layout.h index 3cf7a5540..74989190e 100644 --- a/include/views/cef_box_layout.h +++ b/include/views/cef_box_layout.h @@ -61,14 +61,14 @@ class CefBoxLayout : public CefLayout { // not resized. Flex values must not be negative. /// /*--cef()--*/ - virtual void SetFlexForView(CefRefPtr view, int flex) =0; + virtual void SetFlexForView(CefRefPtr view, int flex) = 0; /// // Clears the flex for the given |view|, causing it to use the default flex // specified via CefBoxLayoutSettings.default_flex. /// /*--cef()--*/ - virtual void ClearFlexForView(CefRefPtr view) =0; + virtual void ClearFlexForView(CefRefPtr view) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_BOX_LAYOUT_H_ diff --git a/include/views/cef_browser_view.h b/include/views/cef_browser_view.h index db622d4d1..5d6cb5681 100644 --- a/include/views/cef_browser_view.h +++ b/include/views/cef_browser_view.h @@ -73,7 +73,7 @@ class CefBrowserView : public CefView { // browser has not yet been created or has already been destroyed. /// /*--cef()--*/ - virtual CefRefPtr GetBrowser() =0; + virtual CefRefPtr GetBrowser() = 0; /// // Sets whether accelerators registered with CefWindow::SetAccelerator are @@ -85,7 +85,7 @@ class CefBrowserView : public CefView { // CefKeyboardHandler. The default value is false. /// /*--cef()--*/ - virtual void SetPreferAccelerators(bool prefer_accelerators) =0; + virtual void SetPreferAccelerators(bool prefer_accelerators) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_BROWSER_VIEW_H_ diff --git a/include/views/cef_button.h b/include/views/cef_button.h index db3db7d62..039446ba0 100644 --- a/include/views/cef_button.h +++ b/include/views/cef_button.h @@ -54,38 +54,38 @@ class CefButton : public CefView { // Returns this Button as a LabelButton or NULL if this is not a LabelButton. /// /*--cef()--*/ - virtual CefRefPtr AsLabelButton() =0; + virtual CefRefPtr AsLabelButton() = 0; /// // Sets the current display state of the Button. /// /*--cef()--*/ - virtual void SetState(cef_button_state_t state) =0; + virtual void SetState(cef_button_state_t state) = 0; /// // Returns the current display state of the Button. /// /*--cef(default_retval=CEF_BUTTON_STATE_NORMAL)--*/ - virtual cef_button_state_t GetState() =0; + virtual cef_button_state_t GetState() = 0; /// // Sets the Button will use an ink drop effect for displaying state changes. /// /*--cef()--*/ - virtual void SetInkDropEnabled(bool enabled) =0; + virtual void SetInkDropEnabled(bool enabled) = 0; /// // Sets the tooltip text that will be displayed when the user hovers the mouse // cursor over the Button. /// /*--cef()--*/ - virtual void SetTooltipText(const CefString& tooltip_text) =0; + virtual void SetTooltipText(const CefString& tooltip_text) = 0; /// // Sets the accessible name that will be exposed to assistive technology (AT). /// /*--cef()--*/ - virtual void SetAccessibleName(const CefString& name) =0; + virtual void SetAccessibleName(const CefString& name) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_BUTTON_H_ diff --git a/include/views/cef_button_delegate.h b/include/views/cef_button_delegate.h index ec33d9be7..77e77393f 100644 --- a/include/views/cef_button_delegate.h +++ b/include/views/cef_button_delegate.h @@ -53,13 +53,13 @@ class CefButtonDelegate : public CefViewDelegate { // Called when |button| is pressed. /// /*--cef()--*/ - virtual void OnButtonPressed(CefRefPtr button) =0; + virtual void OnButtonPressed(CefRefPtr button) = 0; /// // Called when the state of |button| changes. /// /*--cef()--*/ - virtual void OnButtonStateChanged(CefRefPtr button) {}; + virtual void OnButtonStateChanged(CefRefPtr button){}; }; #endif // CEF_INCLUDE_VIEWS_CEF_BUTTON_DELEGATE_H_ diff --git a/include/views/cef_display.h b/include/views/cef_display.h index e3a84561d..de3e7ab82 100644 --- a/include/views/cef_display.h +++ b/include/views/cef_display.h @@ -90,13 +90,13 @@ class CefDisplay : public CefBaseRefCounted { // intended to return distinct, usable displays. /// /*--cef(count_func=displays:GetDisplayCount)--*/ - static void GetAllDisplays(std::vector >& displays); + static void GetAllDisplays(std::vector>& displays); /// // Returns the unique identifier for this Display. /// /*--cef()--*/ - virtual int64 GetID() =0; + virtual int64 GetID() = 0; /// // Returns this Display's device pixel scale factor. This specifies how much @@ -105,40 +105,40 @@ class CefDisplay : public CefBaseRefCounted { // differ by platform. /// /*--cef()--*/ - virtual float GetDeviceScaleFactor() =0; + virtual float GetDeviceScaleFactor() = 0; /// // Convert |point| from density independent pixels (DIP) to pixel coordinates // using this Display's device scale factor. /// /*--cef()--*/ - virtual void ConvertPointToPixels(CefPoint& point) =0; + virtual void ConvertPointToPixels(CefPoint& point) = 0; /// // Convert |point| from pixel coordinates to density independent pixels (DIP) // using this Display's device scale factor. /// /*--cef()--*/ - virtual void ConvertPointFromPixels(CefPoint& point) =0; + virtual void ConvertPointFromPixels(CefPoint& point) = 0; /// // Returns this Display's bounds. This is the full size of the display. /// /*--cef()--*/ - virtual CefRect GetBounds() =0; + virtual CefRect GetBounds() = 0; /// // Returns this Display's work area. This excludes areas of the display that // are occupied for window manager toolbars, etc. /// /*--cef()--*/ - virtual CefRect GetWorkArea() =0; + virtual CefRect GetWorkArea() = 0; /// // Returns this Display's rotation in degrees. /// /*--cef()--*/ - virtual int GetRotation() =0; + virtual int GetRotation() = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_DISPLAY_H_ diff --git a/include/views/cef_fill_layout.h b/include/views/cef_fill_layout.h index 470fefc66..a412f6310 100644 --- a/include/views/cef_fill_layout.h +++ b/include/views/cef_fill_layout.h @@ -46,7 +46,6 @@ // UI thread unless otherwise indicated. /// /*--cef(source=library)--*/ -class CefFillLayout : public CefLayout { -}; +class CefFillLayout : public CefLayout {}; #endif // CEF_INCLUDE_VIEWS_CEF_FILL_LAYOUT_H_ diff --git a/include/views/cef_label_button.h b/include/views/cef_label_button.h index 1447b98a2..da840025d 100644 --- a/include/views/cef_label_button.h +++ b/include/views/cef_label_button.h @@ -71,20 +71,20 @@ class CefLabelButton : public CefButton { // MenuButton. /// /*--cef()--*/ - virtual CefRefPtr AsMenuButton() =0; + virtual CefRefPtr AsMenuButton() = 0; /// // Sets the text shown on the LabelButton. By default |text| will also be used // as the accessible name. /// /*--cef()--*/ - virtual void SetText(const CefString& text) =0; + virtual void SetText(const CefString& text) = 0; /// // Returns the text shown on the LabelButton. /// /*--cef()--*/ - virtual CefString GetText() =0; + virtual CefString GetText() = 0; /// // Sets the image shown for |button_state|. When this Button is drawn if no @@ -93,26 +93,27 @@ class CefLabelButton : public CefButton { /// /*--cef(optional_param=image)--*/ virtual void SetImage(cef_button_state_t button_state, - CefRefPtr image) =0; + CefRefPtr image) = 0; /// // Returns the image shown for |button_state|. If no image exists for that // state then the image for CEF_BUTTON_STATE_NORMAL will be returned. /// /*--cef()--*/ - virtual CefRefPtr GetImage(cef_button_state_t button_state) =0; + virtual CefRefPtr GetImage(cef_button_state_t button_state) = 0; /// // Sets the text color shown for the specified button |for_state| to |color|. /// /*--cef()--*/ - virtual void SetTextColor(cef_button_state_t for_state, cef_color_t color) =0; + virtual void SetTextColor(cef_button_state_t for_state, + cef_color_t color) = 0; /// // Sets the text colors shown for the non-disabled states to |color|. /// /*--cef()--*/ - virtual void SetEnabledTextColors(cef_color_t color) =0; + virtual void SetEnabledTextColors(cef_color_t color) = 0; /// // Sets the font list. The format is ",[STYLES] ", @@ -127,26 +128,26 @@ class CefLabelButton : public CefButton { // - "Arial, 14px" /// /*--cef()--*/ - virtual void SetFontList(const CefString& font_list) =0; + virtual void SetFontList(const CefString& font_list) = 0; /// // Sets the horizontal alignment; reversed in RTL. Default is // CEF_HORIZONTAL_ALIGNMENT_CENTER. /// /*--cef()--*/ - virtual void SetHorizontalAlignment(cef_horizontal_alignment_t alignment) =0; + virtual void SetHorizontalAlignment(cef_horizontal_alignment_t alignment) = 0; /// // Reset the minimum size of this LabelButton to |size|. /// /*--cef()--*/ - virtual void SetMinimumSize(const CefSize& size) =0; + virtual void SetMinimumSize(const CefSize& size) = 0; /// // Reset the maximum size of this LabelButton to |size|. /// /*--cef()--*/ - virtual void SetMaximumSize(const CefSize& size) =0; + virtual void SetMaximumSize(const CefSize& size) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_LABEL_BUTTON_H_ diff --git a/include/views/cef_layout.h b/include/views/cef_layout.h index 5f1fcf4ef..454ff01b1 100644 --- a/include/views/cef_layout.h +++ b/include/views/cef_layout.h @@ -55,19 +55,19 @@ class CefLayout : public CefBaseRefCounted { // Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout. /// /*--cef()--*/ - virtual CefRefPtr AsBoxLayout() =0; + virtual CefRefPtr AsBoxLayout() = 0; /// // Returns this Layout as a FillLayout or NULL if this is not a FillLayout. /// /*--cef()--*/ - virtual CefRefPtr AsFillLayout() =0; + virtual CefRefPtr AsFillLayout() = 0; /// // Returns true if this Layout is valid. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_LAYOUT_H_ diff --git a/include/views/cef_menu_button.h b/include/views/cef_menu_button.h index 60f803c47..965c49b4d 100644 --- a/include/views/cef_menu_button.h +++ b/include/views/cef_menu_button.h @@ -77,14 +77,14 @@ class CefMenuButton : public CefLabelButton { /*--cef()--*/ virtual void ShowMenu(CefRefPtr menu_model, const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) =0; + cef_menu_anchor_position_t anchor_position) = 0; /// // Show the menu for this button. Results in a call to // CefMenuButtonDelegate::OnMenuButtonPressed(). /// /*--cef()--*/ - virtual void TriggerMenu() =0; + virtual void TriggerMenu() = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_MENU_BUTTON_H_ diff --git a/include/views/cef_menu_button_delegate.h b/include/views/cef_menu_button_delegate.h index 43bce7ed4..13aab6d7d 100644 --- a/include/views/cef_menu_button_delegate.h +++ b/include/views/cef_menu_button_delegate.h @@ -56,7 +56,7 @@ class CefMenuButtonDelegate : public CefButtonDelegate { /// /*--cef()--*/ virtual void OnMenuButtonPressed(CefRefPtr menu_button, - const CefPoint& screen_point) =0; + const CefPoint& screen_point) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_MENU_BUTTON_DELEGATE_H_ diff --git a/include/views/cef_panel.h b/include/views/cef_panel.h index 2c5a2b11b..4a4fb9093 100644 --- a/include/views/cef_panel.h +++ b/include/views/cef_panel.h @@ -38,8 +38,8 @@ #define CEF_INCLUDE_VIEWS_CEF_PANEL_H_ #pragma once -#include "include/views/cef_view.h" #include "include/views/cef_panel_delegate.h" +#include "include/views/cef_view.h" class CefBoxLayout; class CefFillLayout; @@ -64,80 +64,78 @@ class CefPanel : public CefView { // Returns this Panel as a Window or NULL if this is not a Window. /// /*--cef()--*/ - virtual CefRefPtr AsWindow() =0; + virtual CefRefPtr AsWindow() = 0; /// // Set this Panel's Layout to FillLayout and return the FillLayout object. /// /*--cef()--*/ - virtual CefRefPtr SetToFillLayout() =0; + virtual CefRefPtr SetToFillLayout() = 0; /// // Set this Panel's Layout to BoxLayout and return the BoxLayout object. /// /*--cef()--*/ virtual CefRefPtr SetToBoxLayout( - const CefBoxLayoutSettings& settings) =0; + const CefBoxLayoutSettings& settings) = 0; /// // Get the Layout. /// /*--cef()--*/ - virtual CefRefPtr GetLayout() =0; + virtual CefRefPtr GetLayout() = 0; /// // Lay out the child Views (set their bounds based on sizing heuristics // specific to the current Layout). /// /*--cef()--*/ - virtual void Layout() =0; + virtual void Layout() = 0; /// // Add a child View. /// /*--cef()--*/ - virtual void AddChildView(CefRefPtr view) =0; + virtual void AddChildView(CefRefPtr view) = 0; /// // Add a child View at the specified |index|. If |index| matches the result of // GetChildCount() then the View will be added at the end. /// /*--cef(index_param=index)--*/ - virtual void AddChildViewAt(CefRefPtr view, - int index) =0; + virtual void AddChildViewAt(CefRefPtr view, int index) = 0; /// // Move the child View to the specified |index|. A negative value for |index| // will move the View to the end. /// /*--cef()--*/ - virtual void ReorderChildView(CefRefPtr view, - int index) =0; + virtual void ReorderChildView(CefRefPtr view, int index) = 0; /// // Remove a child View. The View can then be added to another Panel. /// /*--cef()--*/ - virtual void RemoveChildView(CefRefPtr view) =0; + virtual void RemoveChildView(CefRefPtr view) = 0; /// // Remove all child Views. The removed Views will be deleted if the client // holds no references to them. /// /*--cef()--*/ - virtual void RemoveAllChildViews() =0; + virtual void RemoveAllChildViews() = 0; /// // Returns the number of child Views. /// /*--cef()--*/ - virtual size_t GetChildViewCount() =0; + virtual size_t GetChildViewCount() = 0; /// // Returns the child View at the specified |index|. /// /*--cef(index_param=index)--*/ - virtual CefRefPtr GetChildViewAt(int index) =0; + virtual CefRefPtr GetChildViewAt(int index) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_PANEL_H_ diff --git a/include/views/cef_panel_delegate.h b/include/views/cef_panel_delegate.h index 099a5e6df..cd496119d 100644 --- a/include/views/cef_panel_delegate.h +++ b/include/views/cef_panel_delegate.h @@ -45,7 +45,6 @@ // will be called on the browser process UI thread unless otherwise indicated. /// /*--cef(source=client)--*/ -class CefPanelDelegate : public CefViewDelegate { -}; +class CefPanelDelegate : public CefViewDelegate {}; #endif // CEF_INCLUDE_VIEWS_CEF_PANEL_DELEGATE_H_ diff --git a/include/views/cef_scroll_view.h b/include/views/cef_scroll_view.h index 65378d817..da472bd4a 100644 --- a/include/views/cef_scroll_view.h +++ b/include/views/cef_scroll_view.h @@ -60,43 +60,43 @@ class CefScrollView : public CefView { // via CefView::SetBounds or CefViewDelegate::GetPreferredSize). /// /*--cef()--*/ - virtual void SetContentView(CefRefPtr view) =0; + virtual void SetContentView(CefRefPtr view) = 0; /// // Returns the content View. /// /*--cef()--*/ - virtual CefRefPtr GetContentView() =0; + virtual CefRefPtr GetContentView() = 0; /// // Returns the visible region of the content View. /// /*--cef()--*/ - virtual CefRect GetVisibleContentRect() =0; + virtual CefRect GetVisibleContentRect() = 0; /// // Returns true if the horizontal scrollbar is currently showing. /// /*--cef()--*/ - virtual bool HasHorizontalScrollbar() =0; + virtual bool HasHorizontalScrollbar() = 0; /// // Returns the height of the horizontal scrollbar. /// /*--cef()--*/ - virtual int GetHorizontalScrollbarHeight() =0; + virtual int GetHorizontalScrollbarHeight() = 0; /// // Returns true if the vertical scrollbar is currently showing. /// /*--cef()--*/ - virtual bool HasVerticalScrollbar() =0; + virtual bool HasVerticalScrollbar() = 0; /// // Returns the width of the vertical scrollbar. /// /*--cef()--*/ - virtual int GetVerticalScrollbarWidth() =0; + virtual int GetVerticalScrollbarWidth() = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_SCROLL_VIEW_H_ diff --git a/include/views/cef_textfield.h b/include/views/cef_textfield.h index 8f562f095..9b53f722a 100644 --- a/include/views/cef_textfield.h +++ b/include/views/cef_textfield.h @@ -38,8 +38,8 @@ #define CEF_INCLUDE_VIEWS_CEF_TEXTFIELD_H_ #pragma once -#include "include/views/cef_view.h" #include "include/views/cef_textfield_delegate.h" +#include "include/views/cef_view.h" /// // A Textfield supports editing of text. This control is custom rendered with no @@ -60,62 +60,62 @@ class CefTextfield : public CefView { // Sets whether the text will be displayed as asterisks. /// /*--cef()--*/ - virtual void SetPasswordInput(bool password_input) =0; + virtual void SetPasswordInput(bool password_input) = 0; /// // Returns true if the text will be displayed as asterisks. /// /*--cef()--*/ - virtual bool IsPasswordInput() =0; + virtual bool IsPasswordInput() = 0; /// // Sets whether the text will read-only. /// /*--cef()--*/ - virtual void SetReadOnly(bool read_only) =0; + virtual void SetReadOnly(bool read_only) = 0; /// // Returns true if the text is read-only. /// /*--cef()--*/ - virtual bool IsReadOnly() =0; + virtual bool IsReadOnly() = 0; /// // Returns the currently displayed text. /// /*--cef()--*/ - virtual CefString GetText() =0; + virtual CefString GetText() = 0; /// // Sets the contents to |text|. The cursor will be moved to end of the text if // the current position is outside of the text range. /// /*--cef()--*/ - virtual void SetText(const CefString& text) =0; + virtual void SetText(const CefString& text) = 0; /// // Appends |text| to the previously-existing text. /// /*--cef()--*/ - virtual void AppendText(const CefString& text) =0; + virtual void AppendText(const CefString& text) = 0; /// // Inserts |text| at the current cursor position replacing any selected text. /// /*--cef()--*/ - virtual void InsertOrReplaceText(const CefString& text) =0; + virtual void InsertOrReplaceText(const CefString& text) = 0; /// // Returns true if there is any selected text. /// /*--cef()--*/ - virtual bool HasSelection() =0; + virtual bool HasSelection() = 0; /// // Returns the currently selected text. /// /*--cef()--*/ - virtual CefString GetSelectedText() =0; + virtual CefString GetSelectedText() = 0; /// // Selects all text. If |reversed| is true the range will end at the logical @@ -123,67 +123,67 @@ class CefTextfield : public CefView { // that overflows its display area. /// /*--cef()--*/ - virtual void SelectAll(bool reversed) =0; - + virtual void SelectAll(bool reversed) = 0; + /// // Clears the text selection and sets the caret to the end. /// /*--cef()--*/ - virtual void ClearSelection() =0; + virtual void ClearSelection() = 0; /// // Returns the selected logical text range. /// /*--cef()--*/ - virtual CefRange GetSelectedRange() =0; - + virtual CefRange GetSelectedRange() = 0; + /// // Selects the specified logical text range. /// /*--cef()--*/ - virtual void SelectRange(const CefRange& range) =0; - + virtual void SelectRange(const CefRange& range) = 0; + /// // Returns the current cursor position. /// /*--cef()--*/ - virtual size_t GetCursorPosition() =0; + virtual size_t GetCursorPosition() = 0; /// // Sets the text color. /// /*--cef()--*/ - virtual void SetTextColor(cef_color_t color) =0; + virtual void SetTextColor(cef_color_t color) = 0; /// // Returns the text color. /// /*--cef()--*/ - virtual cef_color_t GetTextColor() =0; + virtual cef_color_t GetTextColor() = 0; /// // Sets the selection text color. /// /*--cef()--*/ - virtual void SetSelectionTextColor(cef_color_t color) =0; + virtual void SetSelectionTextColor(cef_color_t color) = 0; /// // Returns the selection text color. /// /*--cef()--*/ - virtual cef_color_t GetSelectionTextColor() =0; + virtual cef_color_t GetSelectionTextColor() = 0; /// // Sets the selection background color. /// /*--cef()--*/ - virtual void SetSelectionBackgroundColor(cef_color_t color) =0; + virtual void SetSelectionBackgroundColor(cef_color_t color) = 0; /// // Returns the selection background color. /// /*--cef()--*/ - virtual cef_color_t GetSelectionBackgroundColor() =0; + virtual cef_color_t GetSelectionBackgroundColor() = 0; /// // Sets the font list. The format is ",[STYLES] ", @@ -198,7 +198,7 @@ class CefTextfield : public CefView { // - "Arial, 14px" /// /*--cef()--*/ - virtual void SetFontList(const CefString& font_list) =0; + virtual void SetFontList(const CefString& font_list) = 0; /// // Applies |color| to the specified |range| without changing the default @@ -206,8 +206,7 @@ class CefTextfield : public CefView { // contents. /// /*--cef()--*/ - virtual void ApplyTextColor(cef_color_t color, - const CefRange& range) =0; + virtual void ApplyTextColor(cef_color_t color, const CefRange& range) = 0; /// // Applies |style| to the specified |range| without changing the default @@ -218,14 +217,14 @@ class CefTextfield : public CefView { /*--cef()--*/ virtual void ApplyTextStyle(cef_text_style_t style, bool add, - const CefRange& range) =0; + const CefRange& range) = 0; /// // Returns true if the action associated with the specified command id is // enabled. See additional comments on ExecuteCommand(). /// /*--cef()--*/ - virtual bool IsCommandEnabled(int command_id) =0; + virtual bool IsCommandEnabled(int command_id) = 0; /// // Performs the action associated with the specified command id. Valid values @@ -234,39 +233,39 @@ class CefTextfield : public CefView { // IDS_MOVE_*. See include/cef_pack_strings.h for definitions. /// /*--cef()--*/ - virtual void ExecuteCommand(int command_id) =0; - + virtual void ExecuteCommand(int command_id) = 0; + /// // Clears Edit history. /// /*--cef()--*/ - virtual void ClearEditHistory() =0; + virtual void ClearEditHistory() = 0; /// // Sets the placeholder text that will be displayed when the Textfield is // empty. /// /*--cef()--*/ - virtual void SetPlaceholderText(const CefString& text) =0; + virtual void SetPlaceholderText(const CefString& text) = 0; /// // Returns the placeholder text that will be displayed when the Textfield is // empty. /// /*--cef()--*/ - virtual CefString GetPlaceholderText() =0; + virtual CefString GetPlaceholderText() = 0; /// // Sets the placeholder text color. /// /*--cef()--*/ - virtual void SetPlaceholderTextColor(cef_color_t color) =0; + virtual void SetPlaceholderTextColor(cef_color_t color) = 0; /// // Set the accessible name that will be exposed to assistive technology (AT). /// /*--cef()--*/ - virtual void SetAccessibleName(const CefString& name) =0; + virtual void SetAccessibleName(const CefString& name) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_TEXTFIELD_H_ diff --git a/include/views/cef_textfield_delegate.h b/include/views/cef_textfield_delegate.h index ed3f607a3..c3fddafd3 100644 --- a/include/views/cef_textfield_delegate.h +++ b/include/views/cef_textfield_delegate.h @@ -57,7 +57,9 @@ class CefTextfieldDelegate : public CefViewDelegate { /// /*--cef()--*/ virtual bool OnKeyEvent(CefRefPtr textfield, - const CefKeyEvent& event) { return false; } + const CefKeyEvent& event) { + return false; + } /// // Called after performing a user action that may change |textfield|. diff --git a/include/views/cef_view.h b/include/views/cef_view.h index 78422fecd..eed14f317 100644 --- a/include/views/cef_view.h +++ b/include/views/cef_view.h @@ -60,38 +60,38 @@ class CefView : public CefBaseRefCounted { // Returns this View as a BrowserView or NULL if this is not a BrowserView. /// /*--cef()--*/ - virtual CefRefPtr AsBrowserView() =0; + virtual CefRefPtr AsBrowserView() = 0; /// // Returns this View as a Button or NULL if this is not a Button. /// /*--cef()--*/ - virtual CefRefPtr AsButton() =0; + virtual CefRefPtr AsButton() = 0; /// // Returns this View as a Panel or NULL if this is not a Panel. /// /*--cef()--*/ - virtual CefRefPtr AsPanel() =0; + virtual CefRefPtr AsPanel() = 0; /// // Returns this View as a ScrollView or NULL if this is not a ScrollView. /// /*--cef()--*/ - virtual CefRefPtr AsScrollView() =0; + virtual CefRefPtr AsScrollView() = 0; /// // Returns this View as a Textfield or NULL if this is not a Textfield. /// /*--cef()--*/ - virtual CefRefPtr AsTextfield() =0; + virtual CefRefPtr AsTextfield() = 0; /// // Returns the type of this View as a string. Used primarily for testing // purposes. /// /*--cef()--*/ - virtual CefString GetTypeString() =0; + virtual CefString GetTypeString() = 0; /// // Returns a string representation of this View which includes the type and @@ -99,57 +99,57 @@ class CefView : public CefBaseRefCounted { // any child Views will also be included. Used primarily for testing purposes. /// /*--cef()--*/ - virtual CefString ToString(bool include_children) =0; + virtual CefString ToString(bool include_children) = 0; /// // Returns true if this View is valid. /// /*--cef()--*/ - virtual bool IsValid() =0; + virtual bool IsValid() = 0; /// // Returns true if this View is currently attached to another View. A View can // only be attached to one View at a time. /// /*--cef()--*/ - virtual bool IsAttached() =0; + virtual bool IsAttached() = 0; /// // Returns true if this View is the same as |that| View. /// /*--cef()--*/ - virtual bool IsSame(CefRefPtr that) =0; + virtual bool IsSame(CefRefPtr that) = 0; /// // Returns the delegate associated with this View, if any. /// /*--cef()--*/ - virtual CefRefPtr GetDelegate() =0; + virtual CefRefPtr GetDelegate() = 0; /// // Returns the top-level Window hosting this View, if any. /// /*--cef()--*/ - virtual CefRefPtr GetWindow() =0; + virtual CefRefPtr GetWindow() = 0; /// // Returns the ID for this View. /// /*--cef()--*/ - virtual int GetID() =0; + virtual int GetID() = 0; /// // Sets the ID for this View. ID should be unique within the subtree that you // intend to search for it. 0 is the default ID for views. /// /*--cef()--*/ - virtual void SetID(int id) =0; + virtual void SetID(int id) = 0; /// // Returns the group id of this View, or -1 if not set. /// /*--cef()--*/ - virtual int GetGroupID() =0; + virtual int GetGroupID() = 0; /// // A group id is used to tag Views which are part of the same logical group. @@ -157,13 +157,13 @@ class CefView : public CefBaseRefCounted { // The group id is immutable once it's set. /// /*--cef()--*/ - virtual void SetGroupID(int group_id) =0; + virtual void SetGroupID(int group_id) = 0; /// // Returns the View that contains this View, if any. /// /*--cef()--*/ - virtual CefRefPtr GetParentView() =0; + virtual CefRefPtr GetParentView() = 0; /// // Recursively descends the view tree starting at this View, and returns the @@ -171,83 +171,83 @@ class CefView : public CefBaseRefCounted { // matching child view is found. /// /*--cef()--*/ - virtual CefRefPtr GetViewForID(int id) =0; + virtual CefRefPtr GetViewForID(int id) = 0; /// // Sets the bounds (size and position) of this View. Position is in parent // coordinates. /// /*--cef()--*/ - virtual void SetBounds(const CefRect& bounds) =0; + virtual void SetBounds(const CefRect& bounds) = 0; /// // Returns the bounds (size and position) of this View. Position is in parent // coordinates. /// /*--cef()--*/ - virtual CefRect GetBounds() =0; + virtual CefRect GetBounds() = 0; /// // Returns the bounds (size and position) of this View. Position is in screen // coordinates. /// /*--cef()--*/ - virtual CefRect GetBoundsInScreen() =0; + virtual CefRect GetBoundsInScreen() = 0; /// // Sets the size of this View without changing the position. /// /*--cef()--*/ - virtual void SetSize(const CefSize& size) =0; + virtual void SetSize(const CefSize& size) = 0; /// // Returns the size of this View. /// /*--cef()--*/ - virtual CefSize GetSize() =0; + virtual CefSize GetSize() = 0; /// // Sets the position of this View without changing the size. |position| is in // parent coordinates. /// /*--cef()--*/ - virtual void SetPosition(const CefPoint& position) =0; + virtual void SetPosition(const CefPoint& position) = 0; /// // Returns the position of this View. Position is in parent coordinates. /// /*--cef()--*/ - virtual CefPoint GetPosition() =0; + virtual CefPoint GetPosition() = 0; /// // Returns the size this View would like to be if enough space is available. /// /*--cef()--*/ - virtual CefSize GetPreferredSize() =0; + virtual CefSize GetPreferredSize() = 0; /// // Size this View to its preferred size. /// /*--cef()--*/ - virtual void SizeToPreferredSize() =0; + virtual void SizeToPreferredSize() = 0; /// // Returns the minimum size for this View. /// /*--cef()--*/ - virtual CefSize GetMinimumSize() =0; + virtual CefSize GetMinimumSize() = 0; /// // Returns the maximum size for this View. /// /*--cef()--*/ - virtual CefSize GetMaximumSize() =0; + virtual CefSize GetMaximumSize() = 0; /// // Returns the height necessary to display this View with the provided width. /// /*--cef()--*/ - virtual int GetHeightForWidth(int width) =0; + virtual int GetHeightForWidth(int width) = 0; /// // Indicate that this View and all parent Views require a re-layout. This @@ -255,7 +255,7 @@ class CefView : public CefBaseRefCounted { // bounds of parent Views do not change. /// /*--cef()--*/ - virtual void InvalidateLayout() =0; + virtual void InvalidateLayout() = 0; /// // Sets whether this View is visible. Windows are hidden by default and other @@ -267,7 +267,7 @@ class CefView : public CefBaseRefCounted { // equivalent to calling the Window Show() and Hide() methods. /// /*--cef()--*/ - virtual void SetVisible(bool visible) =0; + virtual void SetVisible(bool visible) = 0; /// // Returns whether this View is visible. A view may be visible but still not @@ -278,7 +278,7 @@ class CefView : public CefBaseRefCounted { // drawn. /// /*--cef()--*/ - virtual bool IsVisible() =0; + virtual bool IsVisible() = 0; /// // Returns whether this View is visible and drawn in a Window. A view is drawn @@ -288,7 +288,7 @@ class CefView : public CefBaseRefCounted { // IsVisible() on the Window. /// /*--cef()--*/ - virtual bool IsDrawn() =0; + virtual bool IsDrawn() = 0; /// // Set whether this View is enabled. A disabled View does not receive keyboard @@ -296,13 +296,13 @@ class CefView : public CefBaseRefCounted { // be repainted. Also, clears focus if the focused View is disabled. /// /*--cef()--*/ - virtual void SetEnabled(bool enabled) =0; + virtual void SetEnabled(bool enabled) = 0; /// // Returns whether this View is enabled. /// /*--cef()--*/ - virtual bool IsEnabled() =0; + virtual bool IsEnabled() = 0; /// // Sets whether this View is capable of taking focus. It will clear focus if @@ -310,39 +310,39 @@ class CefView : public CefBaseRefCounted { // that a View used as a container does not get the focus. /// /*--cef()--*/ - virtual void SetFocusable(bool focusable) =0; + virtual void SetFocusable(bool focusable) = 0; /// // Returns true if this View is focusable, enabled and drawn. /// /*--cef()--*/ - virtual bool IsFocusable() =0; + virtual bool IsFocusable() = 0; /// // Return whether this View is focusable when the user requires full keyboard // access, even though it may not be normally focusable. /// /*--cef()--*/ - virtual bool IsAccessibilityFocusable() =0; + virtual bool IsAccessibilityFocusable() = 0; /// // Request keyboard focus. If this View is focusable it will become the // focused View. /// /*--cef()--*/ - virtual void RequestFocus() =0; + virtual void RequestFocus() = 0; /// // Sets the background color for this View. /// /*--cef()--*/ - virtual void SetBackgroundColor(cef_color_t color) =0; + virtual void SetBackgroundColor(cef_color_t color) = 0; /// // Returns the background color for this View. /// /*--cef()--*/ - virtual cef_color_t GetBackgroundColor() =0; + virtual cef_color_t GetBackgroundColor() = 0; /// // Convert |point| from this View's coordinate system to that of the screen. @@ -352,7 +352,7 @@ class CefView : public CefBaseRefCounted { // conversion to display-specific pixel coordinates is desired. /// /*--cef()--*/ - virtual bool ConvertPointToScreen(CefPoint& point) =0; + virtual bool ConvertPointToScreen(CefPoint& point) = 0; /// // Convert |point| to this View's coordinate system from that of the screen. @@ -362,7 +362,7 @@ class CefView : public CefBaseRefCounted { // conversion from display-specific pixel coordinates is necessary. /// /*--cef()--*/ - virtual bool ConvertPointFromScreen(CefPoint& point) =0; + virtual bool ConvertPointFromScreen(CefPoint& point) = 0; /// // Convert |point| from this View's coordinate system to that of the Window. @@ -370,7 +370,7 @@ class CefView : public CefBaseRefCounted { // the conversion is successful or false otherwise. /// /*--cef()--*/ - virtual bool ConvertPointToWindow(CefPoint& point) =0; + virtual bool ConvertPointToWindow(CefPoint& point) = 0; /// // Convert |point| to this View's coordinate system from that of the Window. @@ -378,7 +378,7 @@ class CefView : public CefBaseRefCounted { // the conversion is successful or false otherwise. /// /*--cef()--*/ - virtual bool ConvertPointFromWindow(CefPoint& point) =0; + virtual bool ConvertPointFromWindow(CefPoint& point) = 0; /// // Convert |point| from this View's coordinate system to that of |view|. @@ -386,8 +386,7 @@ class CefView : public CefBaseRefCounted { // hierarchy. Returns true if the conversion is successful or false otherwise. /// /*--cef()--*/ - virtual bool ConvertPointToView(CefRefPtr view, - CefPoint& point) =0; + virtual bool ConvertPointToView(CefRefPtr view, CefPoint& point) = 0; /// // Convert |point| to this View's coordinate system from that |view|. |view| @@ -396,7 +395,7 @@ class CefView : public CefBaseRefCounted { /// /*--cef()--*/ virtual bool ConvertPointFromView(CefRefPtr view, - CefPoint& point) =0; + CefPoint& point) = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_VIEW_H_ diff --git a/include/views/cef_view_delegate.h b/include/views/cef_view_delegate.h index 523b05282..438896c28 100644 --- a/include/views/cef_view_delegate.h +++ b/include/views/cef_view_delegate.h @@ -62,17 +62,13 @@ class CefViewDelegate : public virtual CefBaseRefCounted { // Return the minimum size for |view|. /// /*--cef()--*/ - virtual CefSize GetMinimumSize(CefRefPtr view) { - return CefSize(); - } + virtual CefSize GetMinimumSize(CefRefPtr view) { return CefSize(); } /// // Return the maximum size for |view|. /// /*--cef()--*/ - virtual CefSize GetMaximumSize(CefRefPtr view) { - return CefSize(); - } + virtual CefSize GetMaximumSize(CefRefPtr view) { return CefSize(); } /// // Return the height necessary to display |view| with the provided |width|. diff --git a/include/views/cef_window.h b/include/views/cef_window.h index a89ab63a4..2dce0685c 100644 --- a/include/views/cef_window.h +++ b/include/views/cef_window.h @@ -65,136 +65,136 @@ class CefWindow : public CefPanel { // Show the Window. /// /*--cef()--*/ - virtual void Show() =0; + virtual void Show() = 0; /// // Hide the Window. /// /*--cef()--*/ - virtual void Hide() =0; + virtual void Hide() = 0; /// // Sizes the Window to |size| and centers it in the current display. /// /*--cef()--*/ - virtual void CenterWindow(const CefSize& size) =0; + virtual void CenterWindow(const CefSize& size) = 0; /// // Close the Window. /// /*--cef()--*/ - virtual void Close() =0; + virtual void Close() = 0; /// // Returns true if the Window has been closed. /// /*--cef()--*/ - virtual bool IsClosed() =0; + virtual bool IsClosed() = 0; /// // Activate the Window, assuming it already exists and is visible. /// /*--cef()--*/ - virtual void Activate() =0; + virtual void Activate() = 0; /// // Deactivate the Window, making the next Window in the Z order the active // Window. /// /*--cef()--*/ - virtual void Deactivate() =0; + virtual void Deactivate() = 0; /// // Returns whether the Window is the currently active Window. /// /*--cef()--*/ - virtual bool IsActive() =0; + virtual bool IsActive() = 0; /// // Bring this Window to the top of other Windows in the Windowing system. /// /*--cef()--*/ - virtual void BringToTop() =0; + virtual void BringToTop() = 0; /// // Set the Window to be on top of other Windows in the Windowing system. /// /*--cef()--*/ - virtual void SetAlwaysOnTop(bool on_top) =0; + virtual void SetAlwaysOnTop(bool on_top) = 0; /// // Returns whether the Window has been set to be on top of other Windows in // the Windowing system. /// /*--cef()--*/ - virtual bool IsAlwaysOnTop() =0; + virtual bool IsAlwaysOnTop() = 0; /// // Maximize the Window. /// /*--cef()--*/ - virtual void Maximize() =0; + virtual void Maximize() = 0; /// // Minimize the Window. /// /*--cef()--*/ - virtual void Minimize() =0; + virtual void Minimize() = 0; /// // Restore the Window. /// /*--cef()--*/ - virtual void Restore() =0; + virtual void Restore() = 0; /// // Set fullscreen Window state. /// /*--cef()--*/ - virtual void SetFullscreen(bool fullscreen) =0; - + virtual void SetFullscreen(bool fullscreen) = 0; + /// // Returns true if the Window is maximized. /// /*--cef()--*/ - virtual bool IsMaximized() =0; + virtual bool IsMaximized() = 0; /// // Returns true if the Window is minimized. /// /*--cef()--*/ - virtual bool IsMinimized() =0; + virtual bool IsMinimized() = 0; /// // Returns true if the Window is fullscreen. /// /*--cef()--*/ - virtual bool IsFullscreen() =0; + virtual bool IsFullscreen() = 0; /// // Set the Window title. /// /*--cef(optional_param=title)--*/ - virtual void SetTitle(const CefString& title) =0; + virtual void SetTitle(const CefString& title) = 0; /// // Get the Window title. /// /*--cef()--*/ - virtual CefString GetTitle() =0; + virtual CefString GetTitle() = 0; /// // Set the Window icon. This should be a 16x16 icon suitable for use in the // Windows's title bar. /// /*--cef()--*/ - virtual void SetWindowIcon(CefRefPtr image) =0; + virtual void SetWindowIcon(CefRefPtr image) = 0; /// // Get the Window icon. /// /*--cef()--*/ - virtual CefRefPtr GetWindowIcon() =0; + virtual CefRefPtr GetWindowIcon() = 0; /// // Set the Window App icon. This should be a larger icon for use in the host @@ -203,13 +203,13 @@ class CefWindow : public CefPanel { // if no Window App icon is specified. /// /*--cef()--*/ - virtual void SetWindowAppIcon(CefRefPtr image) =0; + virtual void SetWindowAppIcon(CefRefPtr image) = 0; /// // Get the Window App icon. /// /*--cef()--*/ - virtual CefRefPtr GetWindowAppIcon() =0; + virtual CefRefPtr GetWindowAppIcon() = 0; /// // Show a menu with contents |menu_model|. |screen_point| specifies the menu @@ -219,27 +219,27 @@ class CefWindow : public CefPanel { /*--cef()--*/ virtual void ShowMenu(CefRefPtr menu_model, const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) =0; + cef_menu_anchor_position_t anchor_position) = 0; /// // Cancel the menu that is currently showing, if any. /// /*--cef()--*/ - virtual void CancelMenu() =0; + virtual void CancelMenu() = 0; /// // Returns the Display that most closely intersects the bounds of this Window. // May return NULL if this Window is not currently displayed. /// /*--cef()--*/ - virtual CefRefPtr GetDisplay() =0; + virtual CefRefPtr GetDisplay() = 0; /// // Returns the bounds (size and position) of this Window's client area. // Position is in screen coordinates. /// /*--cef()--*/ - virtual CefRect GetClientAreaBoundsInScreen() =0; + virtual CefRect GetClientAreaBoundsInScreen() = 0; /// // Set the regions where mouse events will be intercepted by this Window to @@ -249,13 +249,13 @@ class CefWindow : public CefPanel { /// /*--cef(optional_param=regions)--*/ virtual void SetDraggableRegions( - const std::vector& regions) =0; + const std::vector& regions) = 0; /// // Retrieve the platform window handle for this Window. /// /*--cef()--*/ - virtual CefWindowHandle GetWindowHandle() =0; + virtual CefWindowHandle GetWindowHandle() = 0; /// // Simulate a key press. |key_code| is the VKEY_* value from Chromium's @@ -265,8 +265,7 @@ class CefWindow : public CefPanel { // primarily for testing purposes. /// /*--cef()--*/ - virtual void SendKeyPress(int key_code, - uint32 event_flags) =0; + virtual void SendKeyPress(int key_code, uint32 event_flags) = 0; /// // Simulate a mouse move. The mouse cursor will be moved to the specified @@ -274,7 +273,7 @@ class CefWindow : public CefPanel { // purposes. /// /*--cef()--*/ - virtual void SendMouseMove(int screen_x, int screen_y) =0; + virtual void SendMouseMove(int screen_x, int screen_y) = 0; /// // Simulate mouse down and/or mouse up events. |button| is the mouse button @@ -288,7 +287,7 @@ class CefWindow : public CefPanel { /*--cef()--*/ virtual void SendMouseEvents(cef_mouse_button_type_t button, bool mouse_down, - bool mouse_up) =0; + bool mouse_up) = 0; /// // Set the keyboard accelerator for the specified |command_id|. |key_code| can // be any virtual key or character value. CefWindowDelegate::OnAccelerator @@ -300,19 +299,19 @@ class CefWindow : public CefPanel { int key_code, bool shift_pressed, bool ctrl_pressed, - bool alt_pressed) =0; + bool alt_pressed) = 0; /// // Remove the keyboard accelerator for the specified |command_id|. /// /*--cef()--*/ - virtual void RemoveAccelerator(int command_id) =0; + virtual void RemoveAccelerator(int command_id) = 0; /// // Remove all keyboard accelerators. /// /*--cef()--*/ - virtual void RemoveAllAccelerators() =0; + virtual void RemoveAllAccelerators() = 0; }; #endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_H_ diff --git a/include/views/cef_window_delegate.h b/include/views/cef_window_delegate.h index a50e1fc41..e753b8d30 100644 --- a/include/views/cef_window_delegate.h +++ b/include/views/cef_window_delegate.h @@ -102,8 +102,9 @@ class CefWindowDelegate : public CefPanelDelegate { // handled or false otherwise. /// /*--cef()--*/ - virtual bool OnAccelerator(CefRefPtr window, - int command_id) { return false; } + virtual bool OnAccelerator(CefRefPtr window, int command_id) { + return false; + } /// // Called after all other controls in the window have had a chance to @@ -112,8 +113,9 @@ class CefWindowDelegate : public CefPanelDelegate { /// /*--cef()--*/ virtual bool OnKeyEvent(CefRefPtr window, - const CefKeyEvent& event) { return false; } - + const CefKeyEvent& event) { + return false; + } }; #endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_ diff --git a/include/wrapper/cef_closure_task.h b/include/wrapper/cef_closure_task.h index d9b559b6f..71f54b5cc 100644 --- a/include/wrapper/cef_closure_task.h +++ b/include/wrapper/cef_closure_task.h @@ -95,7 +95,8 @@ bool CefPostTask(CefThreadId threadId, const base::Closure& closure); /// // Post a Closure for delayed execution on the specified thread. /// -bool CefPostDelayedTask(CefThreadId threadId, const base::Closure& closure, +bool CefPostDelayedTask(CefThreadId threadId, + const base::Closure& closure, int64 delay_ms); #endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ diff --git a/include/wrapper/cef_helpers.h b/include/wrapper/cef_helpers.h index 639cde8cb..0c5820dbb 100644 --- a/include/wrapper/cef_helpers.h +++ b/include/wrapper/cef_helpers.h @@ -46,12 +46,11 @@ #include "include/base/cef_macros.h" #include "include/cef_task.h" -#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI)); -#define CEF_REQUIRE_IO_THREAD() DCHECK(CefCurrentlyOn(TID_IO)); -#define CEF_REQUIRE_FILE_THREAD() DCHECK(CefCurrentlyOn(TID_FILE)); +#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI)); +#define CEF_REQUIRE_IO_THREAD() DCHECK(CefCurrentlyOn(TID_IO)); +#define CEF_REQUIRE_FILE_THREAD() DCHECK(CefCurrentlyOn(TID_FILE)); #define CEF_REQUIRE_RENDERER_THREAD() DCHECK(CefCurrentlyOn(TID_RENDERER)); - // Use this struct in conjuction with refcounted types to ensure that an // object is deleted on the specified thread. For example: // @@ -72,9 +71,9 @@ // foo->DoSomething(); // foo = NULL; // Deletion of |foo| will occur on the UI thread. // -template +template struct CefDeleteOnThread { - template + template static void Destruct(const T* x) { if (CefCurrentlyOn(thread)) { delete x; @@ -85,11 +84,10 @@ struct CefDeleteOnThread { } }; -struct CefDeleteOnUIThread : public CefDeleteOnThread { }; -struct CefDeleteOnIOThread : public CefDeleteOnThread { }; -struct CefDeleteOnFileThread : public CefDeleteOnThread { }; -struct CefDeleteOnRendererThread : public CefDeleteOnThread { }; - +struct CefDeleteOnUIThread : public CefDeleteOnThread {}; +struct CefDeleteOnIOThread : public CefDeleteOnThread {}; +struct CefDeleteOnFileThread : public CefDeleteOnThread {}; +struct CefDeleteOnRendererThread : public CefDeleteOnThread {}; /// // Helper class to manage a scoped copy of |argv|. @@ -105,9 +103,7 @@ class CefScopedArgArray { } array_[argc] = NULL; } - ~CefScopedArgArray() { - delete [] array_; - } + ~CefScopedArgArray() { delete[] array_; } char** array() const { return array_; } @@ -117,7 +113,7 @@ class CefScopedArgArray { // Keep values in a vector separate from |array_| because various users may // modify |array_| and we still want to clean up memory properly. std::vector values_; - + DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray); }; diff --git a/include/wrapper/cef_message_router.h b/include/wrapper/cef_message_router.h index 23510ddcb..9765be76a 100644 --- a/include/wrapper/cef_message_router.h +++ b/include/wrapper/cef_message_router.h @@ -155,7 +155,8 @@ // CefMessageRouterBrowserSide class documentation for the complete list of // methods. // -// 5. Create an instance of CefMessageRouterRendererSide in the renderer process. +// 5. Create an instance of CefMessageRouterRendererSide in the renderer +// process. // You might choose to make it a member of your CefApp implementation, for // example. // @@ -193,8 +194,8 @@ /// // Used to configure the query router. The same values must be passed to both -// CefMessageRouterBrowserSide and CefMessageRouterRendererSide. If using multiple -// router pairs make sure to choose values that do not conflict. +// CefMessageRouterBrowserSide and CefMessageRouterRendererSide. If using +// multiple router pairs make sure to choose values that do not conflict. /// struct CefMessageRouterConfig { CefMessageRouterConfig(); @@ -212,8 +213,8 @@ struct CefMessageRouterConfig { // Implements the browser side of query routing. The methods of this class may // be called on any browser process thread unless otherwise indicated. /// -class CefMessageRouterBrowserSide : - public base::RefCountedThreadSafe { +class CefMessageRouterBrowserSide + : public base::RefCountedThreadSafe { public: /// // Callback associated with a single pending asynchronous query. Execute the @@ -229,13 +230,13 @@ class CefMessageRouterBrowserSide : // Notify the associated JavaScript onSuccess callback that the query has // completed successfully with the specified |response|. /// - virtual void Success(const CefString& response) =0; + virtual void Success(const CefString& response) = 0; /// // Notify the associated JavaScript onFailure callback that the query has // failed with the specified |error_code| and |error_message|. /// - virtual void Failure(int error_code, const CefString& error_message) =0; + virtual void Failure(int error_code, const CefString& error_message) = 0; }; /// @@ -294,7 +295,7 @@ class CefMessageRouterBrowserSide : // added. Must be called on the browser process UI thread. The Handler object // must either outlive the router or be removed before deletion. /// - virtual bool AddHandler(Handler* handler, bool first) =0; + virtual bool AddHandler(Handler* handler, bool first) = 0; /// // Remove an existing query handler. Any pending queries associated with the @@ -304,7 +305,7 @@ class CefMessageRouterBrowserSide : // if the handler is not found. Must be called on the browser process UI // thread. /// - virtual bool RemoveHandler(Handler* handler) =0; + virtual bool RemoveHandler(Handler* handler) = 0; /// // Cancel all pending queries associated with either |browser| or |handler|. @@ -314,7 +315,7 @@ class CefMessageRouterBrowserSide : // code of -1. /// virtual void CancelPending(CefRefPtr browser, - Handler* handler) =0; + Handler* handler) = 0; /// // Returns the number of queries currently pending for the specified |browser| @@ -322,19 +323,18 @@ class CefMessageRouterBrowserSide : // browser process UI thread. /// virtual int GetPendingCount(CefRefPtr browser, - Handler* handler) =0; - + Handler* handler) = 0; // The below methods should be called from other CEF handlers. They must be // called exactly as documented for the router to function correctly. /// // Call from CefLifeSpanHandler::OnBeforeClose. Any pending queries associated - // with |browser| will be canceled and Handler::OnQueryCanceled will be called. - // No JavaScript callbacks will be executed since this indicates destruction - // of the browser. + // with |browser| will be canceled and Handler::OnQueryCanceled will be + // called. No JavaScript callbacks will be executed since this indicates + // destruction of the browser. /// - virtual void OnBeforeClose(CefRefPtr browser) =0; + virtual void OnBeforeClose(CefRefPtr browser) = 0; /// // Call from CefRequestHandler::OnRenderProcessTerminated. Any pending queries @@ -342,7 +342,7 @@ class CefMessageRouterBrowserSide : // will be called. No JavaScript callbacks will be executed since this // indicates destruction of the context. /// - virtual void OnRenderProcessTerminated(CefRefPtr browser) =0; + virtual void OnRenderProcessTerminated(CefRefPtr browser) = 0; /// // Call from CefRequestHandler::OnBeforeBrowse only if the navigation is @@ -352,7 +352,7 @@ class CefMessageRouterBrowserSide : // indicates destruction of the context. /// virtual void OnBeforeBrowse(CefRefPtr browser, - CefRefPtr frame) =0; + CefRefPtr frame) = 0; /// // Call from CefClient::OnProcessMessageReceived. Returns true if the message @@ -361,7 +361,7 @@ class CefMessageRouterBrowserSide : virtual bool OnProcessMessageReceived( CefRefPtr browser, CefProcessId source_process, - CefRefPtr message) =0; + CefRefPtr message) = 0; protected: // Protect against accidental deletion of this object. @@ -373,8 +373,8 @@ class CefMessageRouterBrowserSide : // Implements the renderer side of query routing. The methods of this class must // be called on the render process main thread. /// -class CefMessageRouterRendererSide : - public base::RefCountedThreadSafe { +class CefMessageRouterRendererSide + : public base::RefCountedThreadSafe { public: /// // Create a new router with the specified configuration. @@ -387,8 +387,7 @@ class CefMessageRouterRendererSide : // and/or |context|. Either or both values may be empty. /// virtual int GetPendingCount(CefRefPtr browser, - CefRefPtr context) =0; - + CefRefPtr context) = 0; // The below methods should be called from other CEF handlers. They must be // called exactly as documented for the router to function correctly. @@ -399,7 +398,7 @@ class CefMessageRouterRendererSide : /// virtual void OnContextCreated(CefRefPtr browser, CefRefPtr frame, - CefRefPtr context) =0; + CefRefPtr context) = 0; /// // Call from CefRenderProcessHandler::OnContextReleased. Any pending queries @@ -408,8 +407,8 @@ class CefMessageRouterRendererSide : /// virtual void OnContextReleased(CefRefPtr browser, CefRefPtr frame, - CefRefPtr context) =0; - + CefRefPtr context) = 0; + /// // Call from CefRenderProcessHandler::OnProcessMessageReceived. Returns true // if the message is handled by this router or false otherwise. @@ -417,7 +416,7 @@ class CefMessageRouterRendererSide : virtual bool OnProcessMessageReceived( CefRefPtr browser, CefProcessId source_process, - CefRefPtr message) =0; + CefRefPtr message) = 0; protected: // Protect against accidental deletion of this object. diff --git a/include/wrapper/cef_resource_manager.h b/include/wrapper/cef_resource_manager.h index 9ab8afad0..91190b778 100644 --- a/include/wrapper/cef_resource_manager.h +++ b/include/wrapper/cef_resource_manager.h @@ -55,8 +55,9 @@ // Request object for additional usage information. The methods of this class // may be called on any browser process thread unless otherwise indicated. /// -class CefResourceManager : - public base::RefCountedThreadSafe { +class CefResourceManager + : public base::RefCountedThreadSafe { public: /// // Provides an opportunity to modify |url| before it is passed to a provider. @@ -64,15 +65,14 @@ class CefResourceManager : // file extension. |url| will be fully qualified and may contain query or // fragment components. /// - typedef base::Callback UrlFilter; + typedef base::Callback UrlFilter; /// // Used to resolve mime types for URLs, usually based on the file extension. // |url| will be fully qualified and may contain query or fragment components. /// - typedef base::Callback MimeTypeResolver; + typedef base::Callback + MimeTypeResolver; private: // Values that stay with a request as it moves between providers. @@ -95,7 +95,7 @@ class CefResourceManager : // will no longer trigger) after Request::Continue or Request::Stop is called. // A request passed to Provider::OnRequestCanceled will already have been // detached. The methods of this class may be called on any browser process - // thread. + // thread. /// class Request : public base::RefCountedThreadSafe { public: @@ -110,7 +110,7 @@ class CefResourceManager : // Returns the CefBrowser associated with this request. /// CefRefPtr browser() const { return params_.browser_; } - + /// // Returns the CefFrame associated with this request. /// @@ -141,7 +141,7 @@ class CefResourceManager : // returned via CefResourceManager::GetResourceHandler. If |handler| is NULL // then the next provider in order, if any, will be called. If there are no // additional providers then NULL will be returned via CefResourceManager:: - // GetResourceHandler. + // GetResourceHandler. /// void Continue(CefRefPtr handler); @@ -151,7 +151,7 @@ class CefResourceManager : /// void Stop(); - private: + private: // Only allow deletion via scoped_refptr. friend class base::RefCountedThreadSafe; @@ -178,8 +178,7 @@ class CefResourceManager : DISALLOW_COPY_AND_ASSIGN(Request); }; - typedef std::list > RequestList; - + typedef std::list> RequestList; /// // Interface implemented by resource providers. A provider may be created on @@ -195,7 +194,7 @@ class CefResourceManager : // asynchronously to indicate completion. See comments on Request for // additional usage information. /// - virtual bool OnRequest(scoped_refptr request) =0; + virtual bool OnRequest(scoped_refptr request) = 0; /// // Called when a request has been canceled. It is still safe to dereference @@ -232,7 +231,7 @@ class CefResourceManager : const std::string& directory_path, int order, const std::string& identifier); - + /// // Add a provider that maps requests that start with |url_path| to files // stored in the archive file at |archive_path|. |url_path| should include an @@ -284,7 +283,6 @@ class CefResourceManager : /// void SetMimeTypeResolver(const MimeTypeResolver& resolver); - // The below methods should be called from other CEF handlers. They must be // called exactly as documented for the manager to function correctly. @@ -314,7 +312,7 @@ class CefResourceManager : CefDeleteOnIOThread>; ~CefResourceManager(); - + // Provider and associated information. struct ProviderEntry; typedef std::list ProviderEntryList; @@ -358,14 +356,14 @@ class CefResourceManager : ProviderEntryList providers_; // Map of response ID to pending CefResourceHandler object. - typedef std::map > PendingHandlersMap; + typedef std::map> PendingHandlersMap; PendingHandlersMap pending_handlers_; UrlFilter url_filter_; MimeTypeResolver mime_type_resolver_; // Must be the last member. Created and accessed on the IO thread. - scoped_ptr > weak_ptr_factory_; + scoped_ptr> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(CefResourceManager); }; diff --git a/include/wrapper/cef_stream_resource_handler.h b/include/wrapper/cef_stream_resource_handler.h index af7fe4af8..8e549ddf2 100644 --- a/include/wrapper/cef_stream_resource_handler.h +++ b/include/wrapper/cef_stream_resource_handler.h @@ -80,8 +80,7 @@ class CefStreamResourceHandler : public CefResourceHandler { virtual void Cancel() OVERRIDE; private: - void ReadOnFileThread(int bytes_to_read, - CefRefPtr callback); + void ReadOnFileThread(int bytes_to_read, CefRefPtr callback); const int status_code_; const CefString status_text_; diff --git a/include/wrapper/cef_xml_object.h b/include/wrapper/cef_xml_object.h index bf1755432..9315adcba 100644 --- a/include/wrapper/cef_xml_object.h +++ b/include/wrapper/cef_xml_object.h @@ -73,8 +73,8 @@ class CefStreamReader; /// class CefXmlObject : public base::RefCountedThreadSafe { public: - typedef std::vector > ObjectVector; - typedef std::map AttributeMap; + typedef std::vector> ObjectVector; + typedef std::map AttributeMap; /// // Create a new object with the specified name. An object name must always be @@ -88,7 +88,8 @@ class CefXmlObject : public base::RefCountedThreadSafe { /// bool Load(CefRefPtr stream, CefXmlReader::EncodingType encodingType, - const CefString& URI, CefString* loadError); + const CefString& URI, + CefString* loadError); /// // Set the name, children and attributes of this object to a duplicate of the diff --git a/include/wrapper/cef_zip_archive.h b/include/wrapper/cef_zip_archive.h index 5de0960fc..9eb28125f 100644 --- a/include/wrapper/cef_zip_archive.h +++ b/include/wrapper/cef_zip_archive.h @@ -67,20 +67,20 @@ class CefZipArchive : public base::RefCountedThreadSafe { /// // Returns the read-only data contained in the file. /// - virtual const unsigned char* GetData() const =0; + virtual const unsigned char* GetData() const = 0; /// // Returns the size of the data in the file. /// - virtual size_t GetDataSize() const =0; + virtual size_t GetDataSize() const = 0; /// // Returns a CefStreamReader object for streaming the contents of the file. /// - virtual CefRefPtr GetStreamReader() const =0; + virtual CefRefPtr GetStreamReader() const = 0; }; - typedef std::map > FileMap; + typedef std::map> FileMap; /// // Create a new object. diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 30ab6e824..eba3524b2 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -16,9 +16,7 @@ #include "content/public/browser/storage_partition.h" CefBrowserContext::CefBrowserContext(bool is_proxy) - : is_proxy_(is_proxy), - extension_system_(NULL) { -} + : is_proxy_(is_proxy), extension_system_(NULL) {} CefBrowserContext::~CefBrowserContext() { // Should be cleared in Shutdown(). @@ -89,8 +87,8 @@ void CefBrowserContext::Shutdown() { if (resource_context_.get()) { // Destruction of the ResourceContext will trigger destruction of all // associated URLRequests. - content::BrowserThread::DeleteSoon( - content::BrowserThread::IO, FROM_HERE, resource_context_.release()); + content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, + resource_context_.release()); } } @@ -108,7 +106,7 @@ net::URLRequestContextGetter* CefBrowserContext::CreateMediaRequestContext() { } net::URLRequestContextGetter* - CefBrowserContext::CreateMediaRequestContextForStoragePartition( +CefBrowserContext::CreateMediaRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory) { return nullptr; @@ -130,9 +128,9 @@ void CefBrowserContext::OnRenderFrameDeleted(int render_process_id, // deletion of |resource_context_| will execute on the IO thread, and this // callback will be executed first. CEF_POST_TASK(CEF_IOT, - base::Bind(&CefResourceContext::ClearPluginLoadDecision, - base::Unretained(resource_context_.get()), - render_process_id)); + base::Bind(&CefResourceContext::ClearPluginLoadDecision, + base::Unretained(resource_context_.get()), + render_process_id)); } } @@ -143,7 +141,7 @@ void CefBrowserContext::OnPurgePluginListCache() { // deletion of |resource_context_| will execute on the IO thread, and this // callback will be executed first. CEF_POST_TASK(CEF_IOT, - base::Bind(&CefResourceContext::ClearPluginLoadDecision, - base::Unretained(resource_context_.get()), -1)); + base::Bind(&CefResourceContext::ClearPluginLoadDecision, + base::Unretained(resource_context_.get()), -1)); } } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 4302fc734..c1a442dbe 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -115,7 +115,7 @@ // CefBrowserMainParts::PostMainMessageLoopRun() (*Impl). This may be delayed // if other network-related objects still have a reference to it. // 6. CefURLRequestContext* is destroyed on the IO thread due to -// CefURLRequestContextGetter* destruction. +// CefURLRequestContextGetter* destruction. */ class CefRequestContextImpl; @@ -187,9 +187,7 @@ class CefBrowserContext : public ChromeProfileStub { return extension_system_; } - bool is_proxy() const { - return is_proxy_; - } + bool is_proxy() const { return is_proxy_; } protected: ~CefBrowserContext() override; diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 56b0855a2..8ffa03294 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -35,8 +35,8 @@ #include "components/visitedlink/browser/visitedlink_event_listener.h" #include "components/visitedlink/browser/visitedlink_master.h" #include "components/zoom/zoom_event_manager.h" -#include "content/public/browser/download_manager.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/download_manager.h" #include "content/public/browser/storage_partition.h" #include "extensions/browser/extension_protocols.h" #include "extensions/common/constants.h" @@ -149,8 +149,7 @@ class ImplManager { base::LazyInstance::DestructorAtExit g_manager = LAZY_INSTANCE_INITIALIZER; #else -base::LazyInstance::Leaky g_manager = - LAZY_INSTANCE_INITIALIZER; +base::LazyInstance::Leaky g_manager = LAZY_INSTANCE_INITIALIZER; #endif } // namespace @@ -159,9 +158,7 @@ base::LazyInstance::Leaky g_manager = // CefBrowserContext sharing the same VisitedLinkMaster. class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener { public: - CefVisitedLinkListener() { - DCHECK(listener_map_.empty()); - } + CefVisitedLinkListener() { DCHECK(listener_map_.empty()); } void CreateListenerForContext(const CefBrowserContext* context) { CEF_REQUIRE_UIT(); @@ -203,7 +200,7 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener { private: // Map of CefBrowserContext to the associated VisitedLinkEventListener. typedef std::map > + std::unique_ptr> ListenerMap; ListenerMap listener_map_; @@ -212,8 +209,7 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener { CefBrowserContextImpl::CefBrowserContextImpl( const CefRequestContextSettings& settings) - : CefBrowserContext(false), - settings_(settings) { + : CefBrowserContext(false), settings_(settings) { g_manager.Get().AddImpl(this); } @@ -253,8 +249,8 @@ void CefBrowserContextImpl::Initialize() { base::ThreadRestrictions::ScopedAllowIO allow_io; if (!base::DirectoryExists(cache_path_) && !base::CreateDirectory(cache_path_)) { - LOG(ERROR) << "The cache_path directory could not be created: " << - cache_path_.value(); + LOG(ERROR) << "The cache_path directory could not be created: " + << cache_path_.value(); cache_path_ = base::FilePath(); CefString(&settings_.cache_path).clear(); } @@ -271,8 +267,8 @@ void CefBrowserContextImpl::Initialize() { // Initialize a temporary PrefService object that may be referenced during // BrowserContextServices initialization. - pref_service_ = browser_prefs::CreatePrefService( - this, base::FilePath(), false, true); + pref_service_ = + browser_prefs::CreatePrefService(this, base::FilePath(), false, true); CefBrowserContext::Initialize(); @@ -283,12 +279,11 @@ void CefBrowserContextImpl::Initialize() { // Initialize visited links management. base::FilePath visited_link_path; if (!cache_path_.empty()) - visited_link_path = cache_path_.Append(FILE_PATH_LITERAL("Visited Links")); + visited_link_path = cache_path_.Append(FILE_PATH_LITERAL("Visited Links")); visitedlink_listener_ = new CefVisitedLinkListener; - visitedlink_master_.reset( - new visitedlink::VisitedLinkMaster(visitedlink_listener_, this, - !visited_link_path.empty(), false, - visited_link_path, 0)); + visitedlink_master_.reset(new visitedlink::VisitedLinkMaster( + visitedlink_listener_, this, !visited_link_path.empty(), false, + visited_link_path, 0)); visitedlink_listener_->CreateListenerForContext(this); visitedlink_master_->Init(); @@ -376,8 +371,8 @@ base::FilePath CefBrowserContextImpl::GetPath() const { } std::unique_ptr - CefBrowserContextImpl::CreateZoomLevelDelegate( - const base::FilePath& partition_path) { +CefBrowserContextImpl::CreateZoomLevelDelegate( + const base::FilePath& partition_path) { if (cache_path_.empty()) return std::unique_ptr(); @@ -391,7 +386,7 @@ bool CefBrowserContextImpl::IsOffTheRecord() const { } content::DownloadManagerDelegate* - CefBrowserContextImpl::GetDownloadManagerDelegate() { +CefBrowserContextImpl::GetDownloadManagerDelegate() { DCHECK(!download_manager_delegate_.get()); content::DownloadManager* manager = BrowserContext::GetDownloadManager(this); @@ -405,17 +400,17 @@ content::BrowserPluginGuestManager* CefBrowserContextImpl::GetGuestManager() { } storage::SpecialStoragePolicy* - CefBrowserContextImpl::GetSpecialStoragePolicy() { +CefBrowserContextImpl::GetSpecialStoragePolicy() { return NULL; } content::PushMessagingService* - CefBrowserContextImpl::GetPushMessagingService() { +CefBrowserContextImpl::GetPushMessagingService() { return NULL; } content::SSLHostStateDelegate* - CefBrowserContextImpl::GetSSLHostStateDelegate() { +CefBrowserContextImpl::GetSSLHostStateDelegate() { if (!ssl_host_state_delegate_.get()) ssl_host_state_delegate_.reset(new CefSSLHostStateDelegate()); return ssl_host_state_delegate_.get(); @@ -428,7 +423,7 @@ content::PermissionManager* CefBrowserContextImpl::GetPermissionManager() { } content::BackgroundSyncController* - CefBrowserContextImpl::GetBackgroundSyncController() { +CefBrowserContextImpl::GetBackgroundSyncController() { return nullptr; } @@ -447,32 +442,30 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext( // Handle only chrome-extension:// requests. CEF does not support // chrome-extension-resource:// requests (it does not store shared extension // data in its installation directory). - extensions::InfoMap* extension_info_map = - extension_system()->info_map(); + extensions::InfoMap* extension_info_map = extension_system()->info_map(); (*protocol_handlers)[extensions::kExtensionScheme] = linked_ptr( - extensions::CreateExtensionProtocolHandler( - IsOffTheRecord(), extension_info_map).release()); + extensions::CreateExtensionProtocolHandler(IsOffTheRecord(), + extension_info_map) + .release()); } url_request_getter_ = new CefURLRequestContextGetterImpl( - settings_, - GetPrefs(), + settings_, GetPrefs(), BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), - protocol_handlers, - std::move(proxy_config_service), + protocol_handlers, std::move(proxy_config_service), std::move(request_interceptors)); resource_context()->set_url_request_context_getter(url_request_getter_.get()); return url_request_getter_.get(); } net::URLRequestContextGetter* - CefBrowserContextImpl::CreateRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory, - content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) { +CefBrowserContextImpl::CreateRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory, + content::ProtocolHandlerMap* protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) { return nullptr; } @@ -518,7 +511,7 @@ HostContentSettingsMap* CefBrowserContextImpl::GetHostContentSettingsMap() { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); const std::string& plugin_policy_str = - command_line->GetSwitchValueASCII(switches::kPluginPolicy); + command_line->GetSwitchValueASCII(switches::kPluginPolicy); if (!plugin_policy_str.empty()) { ContentSetting plugin_policy = CONTENT_SETTING_ALLOW; if (base::LowerCaseEqualsASCII(plugin_policy_str, diff --git a/libcef/browser/browser_context_impl.h b/libcef/browser/browser_context_impl.h index cd438264d..06f47624e 100644 --- a/libcef/browser/browser_context_impl.h +++ b/libcef/browser/browser_context_impl.h @@ -39,8 +39,7 @@ class CefBrowserContextImpl : public CefBrowserContext, const base::FilePath& cache_path); // Returns the underlying CefBrowserContextImpl if any. - static CefBrowserContextImpl* GetForContext( - content::BrowserContext* context); + static CefBrowserContextImpl* GetForContext(content::BrowserContext* context); // Returns all existing CefBrowserContextImpl. static std::vector GetAll(); @@ -72,14 +71,12 @@ class CefBrowserContextImpl : public CefBrowserContext, content::BackgroundSyncController* GetBackgroundSyncController() override; net::URLRequestContextGetter* CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) - override; + content::URLRequestInterceptorScopedVector request_interceptors) override; net::URLRequestContextGetter* CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) - override; + content::URLRequestInterceptorScopedVector request_interceptors) override; content::StoragePartition* GetStoragePartitionProxy( content::BrowserContext* browser_context, content::StoragePartition* partition_impl) override; diff --git a/libcef/browser/browser_context_proxy.cc b/libcef/browser/browser_context_proxy.cc index c930a169b..a07108dc3 100644 --- a/libcef/browser/browser_context_proxy.cc +++ b/libcef/browser/browser_context_proxy.cc @@ -88,8 +88,8 @@ void CefBrowserContextProxy::Initialize() { CefBrowserContext::PostInitialize(); } -base::SupportsUserData::Data* - CefBrowserContextProxy::GetUserData(const void* key) const { +base::SupportsUserData::Data* CefBrowserContextProxy::GetUserData( + const void* key) const { if (ShouldProxyUserData(key)) return parent_->GetUserData(key); return BrowserContext::GetUserData(key); @@ -122,8 +122,8 @@ base::FilePath CefBrowserContextProxy::GetPath() const { } std::unique_ptr - CefBrowserContextProxy::CreateZoomLevelDelegate( - const base::FilePath& partition_path) { +CefBrowserContextProxy::CreateZoomLevelDelegate( + const base::FilePath& partition_path) { return parent_->CreateZoomLevelDelegate(partition_path); } @@ -132,7 +132,7 @@ bool CefBrowserContextProxy::IsOffTheRecord() const { } content::DownloadManagerDelegate* - CefBrowserContextProxy::GetDownloadManagerDelegate() { +CefBrowserContextProxy::GetDownloadManagerDelegate() { DCHECK(!download_manager_delegate_.get()); content::DownloadManager* manager = BrowserContext::GetDownloadManager(this); @@ -145,17 +145,17 @@ content::BrowserPluginGuestManager* CefBrowserContextProxy::GetGuestManager() { } storage::SpecialStoragePolicy* - CefBrowserContextProxy::GetSpecialStoragePolicy() { +CefBrowserContextProxy::GetSpecialStoragePolicy() { return parent_->GetSpecialStoragePolicy(); } content::PushMessagingService* - CefBrowserContextProxy::GetPushMessagingService() { +CefBrowserContextProxy::GetPushMessagingService() { return parent_->GetPushMessagingService(); } content::SSLHostStateDelegate* - CefBrowserContextProxy::GetSSLHostStateDelegate() { +CefBrowserContextProxy::GetSSLHostStateDelegate() { return parent_->GetSSLHostStateDelegate(); } @@ -164,7 +164,7 @@ content::PermissionManager* CefBrowserContextProxy::GetPermissionManager() { } content::BackgroundSyncController* - CefBrowserContextProxy::GetBackgroundSyncController() { +CefBrowserContextProxy::GetBackgroundSyncController() { return parent_->GetBackgroundSyncController(); } @@ -178,11 +178,11 @@ net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext( } net::URLRequestContextGetter* - CefBrowserContextProxy::CreateRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory, - content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) { +CefBrowserContextProxy::CreateRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory, + content::ProtocolHandlerMap* protocol_handlers, + content::URLRequestInterceptorScopedVector request_interceptors) { return nullptr; } @@ -231,8 +231,7 @@ CefBrowserContextProxy::GetOrCreateStoragePartitionProxy( resource_context()->set_url_request_context_getter( url_request_getter.get()); storage_partition_proxy_.reset( - new CefStoragePartitionProxy(partition_impl, - url_request_getter.get())); + new CefStoragePartitionProxy(partition_impl, url_request_getter.get())); // Associates UserData keys with the ResourceContext. // Called from StoragePartitionImplMap::Get() for CefBrowserContextImpl. diff --git a/libcef/browser/browser_context_proxy.h b/libcef/browser/browser_context_proxy.h index ad8b1af2e..186a2b3bc 100644 --- a/libcef/browser/browser_context_proxy.h +++ b/libcef/browser/browser_context_proxy.h @@ -47,14 +47,12 @@ class CefBrowserContextProxy : public CefBrowserContext { content::BackgroundSyncController* GetBackgroundSyncController() override; net::URLRequestContextGetter* CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) - override; + content::URLRequestInterceptorScopedVector request_interceptors) override; net::URLRequestContextGetter* CreateRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory, content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) - override; + content::URLRequestInterceptorScopedVector request_interceptors) override; void RegisterInProcessServices(StaticServiceMap* services) override; // Profile methods. @@ -69,11 +67,9 @@ class CefBrowserContextProxy : public CefBrowserContext { void AddVisitedURLs(const std::vector& urls) override; content::StoragePartition* GetOrCreateStoragePartitionProxy( - content::StoragePartition* partition_impl); + content::StoragePartition* partition_impl); - CefBrowserContextImpl* parent() const { - return parent_; - } + CefBrowserContextImpl* parent() const { return parent_; } private: // Allow deletion via std::unique_ptr() only. diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 0b923a007..187e16146 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -44,8 +44,8 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/browser/ui/prefs/prefs_tab_helper.h" #include "components/zoom/zoom_controller.h" -#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/gpu/compositor_util.h" +#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/view_messages.h" #include "content/public/browser/desktop_media_id.h" @@ -95,8 +95,7 @@ class WebContentsUserDataAdapter : public base::SupportsUserData::Data { } private: - WebContentsUserDataAdapter(CefBrowserHostImpl* browser) - : browser_(browser) { + WebContentsUserDataAdapter(CefBrowserHostImpl* browser) : browser_(browser) { browser->web_contents()->SetUserData(UserDataKey(), this); } @@ -117,11 +116,11 @@ class CreateBrowserHelper { const CefString& url, const CefBrowserSettings& settings, CefRefPtr request_context) - : window_info_(windowInfo), - client_(client), - url_(url), - settings_(settings), - request_context_(request_context) {} + : window_info_(windowInfo), + client_(client), + url_(url), + settings_(settings), + request_context_(request_context) {} CefWindowInfo window_info_; CefRefPtr client_; @@ -132,7 +131,8 @@ class CreateBrowserHelper { void CreateBrowserWithHelper(CreateBrowserHelper* helper) { CefBrowserHost::CreateBrowserSync(helper->window_info_, helper->client_, - helper->url_, helper->settings_, helper->request_context_); + helper->url_, helper->settings_, + helper->request_context_); delete helper; } @@ -143,11 +143,11 @@ class ShowDevToolsHelper { CefRefPtr client, const CefBrowserSettings& settings, const CefPoint& inspect_element_at) - : browser_(browser), - window_info_(windowInfo), - client_(client), - settings_(settings), - inspect_element_at_(inspect_element_at) {} + : browser_(browser), + window_info_(windowInfo), + client_(client), + settings_(settings), + inspect_element_at_(inspect_element_at) {} CefRefPtr browser_; CefWindowInfo window_info_; @@ -158,7 +158,8 @@ class ShowDevToolsHelper { void ShowDevToolsWithHelper(ShowDevToolsHelper* helper) { helper->browser_->ShowDevTools(helper->window_info_, helper->client_, - helper->settings_, helper->inspect_element_at_); + helper->settings_, + helper->inspect_element_at_); delete helper; } @@ -185,7 +186,6 @@ void OnDownloadImage(uint32 max_image_size, } // namespace - // CefBrowserHost static methods. // ----------------------------------------------------------------------------- @@ -216,9 +216,8 @@ bool CefBrowserHost::CreateBrowser( } // Create the browser on the UI thread. - CreateBrowserHelper* helper = - new CreateBrowserHelper(windowInfo, client, url, settings, - request_context); + CreateBrowserHelper* helper = new CreateBrowserHelper( + windowInfo, client, url, settings, request_context); CEF_POST_TASK(CEF_UIT, base::Bind(CreateBrowserWithHelper, helper)); return true; @@ -268,7 +267,6 @@ CefRefPtr CefBrowserHost::CreateBrowserSync( return browser.get(); } - // CefBrowserHostImpl static methods. // ----------------------------------------------------------------------------- @@ -283,8 +281,7 @@ CefRefPtr CefBrowserHostImpl::Create( scoped_refptr info = CefBrowserInfoManager::GetInstance()->CreateBrowserInfo( - is_devtools_popup, - platform_delegate->IsWindowless()); + is_devtools_popup, platform_delegate->IsWindowless()); // Get or create the request context and browser context. CefRefPtr request_context_impl = @@ -310,24 +307,17 @@ CefRefPtr CefBrowserHostImpl::Create( if (platform_delegate->IsWindowless()) { // Create the OSR view for the WebContents. platform_delegate->CreateViewForWebContents( - &wc_create_params.view, - &wc_create_params.delegate_view); + &wc_create_params.view, &wc_create_params.delegate_view); } content::WebContents* web_contents = content::WebContents::Create(wc_create_params); DCHECK(web_contents); - CefRefPtr browser = - CefBrowserHostImpl::CreateInternal( - create_params.settings, - create_params.client, - web_contents, - info, - create_params.devtools_opener, - is_devtools_popup, - create_params.request_context, - std::move(platform_delegate)); + CefRefPtr browser = CefBrowserHostImpl::CreateInternal( + create_params.settings, create_params.client, web_contents, info, + create_params.devtools_opener, is_devtools_popup, + create_params.request_context, std::move(platform_delegate)); if (browser.get() && !create_params.url.empty()) { browser->LoadURL(CefFrameHostImpl::kMainFrameId, create_params.url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, @@ -370,10 +360,9 @@ CefRefPtr CefBrowserHostImpl::CreateInternal( platform_delegate->WebContentsCreated(web_contents); - CefRefPtr browser = - new CefBrowserHostImpl(settings, client, web_contents, browser_info, - opener, request_context, - std::move(platform_delegate)); + CefRefPtr browser = new CefBrowserHostImpl( + settings, client, web_contents, browser_info, opener, request_context, + std::move(platform_delegate)); if (!browser->CreateHostWindow()) return nullptr; @@ -407,9 +396,8 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForHost( const content::RenderViewHost* host) { DCHECK(host); CEF_REQUIRE_UIT(); - content::WebContents* web_contents = - content::WebContents::FromRenderViewHost( - const_cast(host)); + content::WebContents* web_contents = content::WebContents::FromRenderViewHost( + const_cast(host)); if (web_contents) return GetBrowserForContents(web_contents); return nullptr; @@ -446,8 +434,7 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForRequest( if (!content::ResourceRequestInfo::GetRenderFrameForRequest( request, &render_process_id, &render_frame_id) || - render_process_id == -1 || - render_frame_id == MSG_ROUTING_NONE) { + render_process_id == -1 || render_frame_id == MSG_ROUTING_NONE) { return nullptr; } @@ -456,7 +443,8 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForRequest( // static CefRefPtr CefBrowserHostImpl::GetBrowserForView( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { if (render_process_id == -1 || render_routing_id == MSG_ROUTING_NONE) return nullptr; @@ -476,10 +464,10 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForView( if (info.get() && !is_guest_view) { CefRefPtr browser = info->browser(); if (!browser.get()) { - LOG(WARNING) << "Found browser id " << info->browser_id() << - " but no browser object matching view process id " << - render_process_id << " and routing id " << - render_routing_id; + LOG(WARNING) << "Found browser id " << info->browser_id() + << " but no browser object matching view process id " + << render_process_id << " and routing id " + << render_routing_id; } return browser; } @@ -489,7 +477,8 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForView( // static CefRefPtr CefBrowserHostImpl::GetBrowserForFrame( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { if (render_process_id == -1 || render_routing_id == MSG_ROUTING_NONE) return nullptr; @@ -509,10 +498,10 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForFrame( if (info.get() && !is_guest_view) { CefRefPtr browser = info->browser(); if (!browser.get()) { - LOG(WARNING) << "Found browser id " << info->browser_id() << - " but no browser object matching frame process id " << - render_process_id << " and routing id " << - render_routing_id; + LOG(WARNING) << "Found browser id " << info->browser_id() + << " but no browser object matching frame process id " + << render_process_id << " and routing id " + << render_routing_id; } return browser; } @@ -520,20 +509,17 @@ CefRefPtr CefBrowserHostImpl::GetBrowserForFrame( } } - // CefBrowserHostImpl methods. // ----------------------------------------------------------------------------- // WebContentsObserver that will be notified when the frontend WebContents is // destroyed so that the inspected browser can clear its DevTools references. -class CefBrowserHostImpl::DevToolsWebContentsObserver : - public content::WebContentsObserver { +class CefBrowserHostImpl::DevToolsWebContentsObserver + : public content::WebContentsObserver { public: DevToolsWebContentsObserver(CefBrowserHostImpl* browser, content::WebContents* frontend_web_contents) - : WebContentsObserver(frontend_web_contents), - browser_(browser) { - } + : WebContentsObserver(frontend_web_contents), browser_(browser) {} // WebContentsObserver methods: void WebContentsDestroyed() override { @@ -546,8 +532,7 @@ class CefBrowserHostImpl::DevToolsWebContentsObserver : DISALLOW_COPY_AND_ASSIGN(DevToolsWebContentsObserver); }; -CefBrowserHostImpl::~CefBrowserHostImpl() { -} +CefBrowserHostImpl::~CefBrowserHostImpl() {} CefRefPtr CefBrowserHostImpl::GetBrowser() { return this; @@ -567,8 +552,8 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) { } if (destruction_state_ < DESTRUCTION_STATE_ACCEPTED) { - destruction_state_ = (force_close ? DESTRUCTION_STATE_ACCEPTED : - DESTRUCTION_STATE_PENDING); + destruction_state_ = (force_close ? DESTRUCTION_STATE_ACCEPTED + : DESTRUCTION_STATE_PENDING); } content::WebContents* contents = web_contents(); @@ -580,8 +565,8 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) { CloseContents(contents); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::CloseBrowser, this, force_close)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::CloseBrowser, this, + force_close)); } } @@ -609,7 +594,7 @@ bool CefBrowserHostImpl::TryCloseBrowser() { void CefBrowserHostImpl::SetFocus(bool focus) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SetFocus, this, focus)); + base::Bind(&CefBrowserHostImpl::SetFocus, this, focus)); return; } @@ -663,23 +648,23 @@ void CefBrowserHostImpl::SetZoomLevel(double zoomLevel) { if (web_contents()) content::HostZoomMap::SetZoomLevel(web_contents(), zoomLevel); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SetZoomLevel, this, zoomLevel)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SetZoomLevel, this, + zoomLevel)); } } void CefBrowserHostImpl::RunFileDialog( - FileDialogMode mode, - const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, - int selected_accept_filter, - CefRefPtr callback) { + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::RunFileDialog, this, mode, title, - default_file_path, accept_filters, selected_accept_filter, - callback)); + base::Bind(&CefBrowserHostImpl::RunFileDialog, this, mode, + title, default_file_path, accept_filters, + selected_accept_filter, callback)); return; } @@ -692,7 +677,7 @@ void CefBrowserHostImpl::RunFileDialog( void CefBrowserHostImpl::StartDownload(const CefString& url) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::StartDownload, this, url)); + base::Bind(&CefBrowserHostImpl::StartDownload, this, url)); return; } @@ -726,9 +711,9 @@ void CefBrowserHostImpl::DownloadImage( bool bypass_cache, CefRefPtr callback) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DownloadImage, this, image_url, - is_favicon, max_image_size, bypass_cache, callback)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::DownloadImage, this, + image_url, is_favicon, max_image_size, + bypass_cache, callback)); return; } @@ -752,12 +737,10 @@ void CefBrowserHostImpl::Print() { content::WebContents* actionable_contents = GetActionableWebContents(); if (!actionable_contents) return; - printing::CefPrintViewManager::FromWebContents( - actionable_contents)->PrintNow( - actionable_contents->GetRenderViewHost()->GetMainFrame()); + printing::CefPrintViewManager::FromWebContents(actionable_contents) + ->PrintNow(actionable_contents->GetRenderViewHost()->GetMainFrame()); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::Print, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::Print, this)); } } @@ -774,18 +757,20 @@ void CefBrowserHostImpl::PrintToPDF(const CefString& path, pdf_callback = base::Bind(&CefPdfPrintCallback::OnPdfPrintFinished, callback.get(), path); } - printing::CefPrintViewManager::FromWebContents(actionable_contents)-> - PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path), - settings, pdf_callback); + printing::CefPrintViewManager::FromWebContents(actionable_contents) + ->PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path), + settings, pdf_callback); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::PrintToPDF, this, path, settings, - callback)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::PrintToPDF, this, + path, settings, callback)); } } -void CefBrowserHostImpl::Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) { +void CefBrowserHostImpl::Find(int identifier, + const CefString& searchText, + bool forward, + bool matchCase, + bool findNext) { if (CEF_CURRENTLY_ON_UIT()) { if (!web_contents_) return; @@ -805,8 +790,8 @@ void CefBrowserHostImpl::Find(int identifier, const CefString& searchText, web_contents()->Find(identifier, searchText, options); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::Find, this, identifier, searchText, - forward, matchCase, findNext)); + base::Bind(&CefBrowserHostImpl::Find, this, identifier, + searchText, forward, matchCase, findNext)); } } @@ -815,21 +800,20 @@ void CefBrowserHostImpl::StopFinding(bool clearSelection) { if (!web_contents_) return; - content::StopFindAction action = clearSelection ? - content::STOP_FIND_ACTION_CLEAR_SELECTION : - content::STOP_FIND_ACTION_KEEP_SELECTION; + content::StopFindAction action = + clearSelection ? content::STOP_FIND_ACTION_CLEAR_SELECTION + : content::STOP_FIND_ACTION_KEEP_SELECTION; web_contents()->StopFinding(action); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::StopFinding, this, clearSelection)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::StopFinding, this, + clearSelection)); } } -void CefBrowserHostImpl::ShowDevTools( - const CefWindowInfo& windowInfo, - CefRefPtr client, - const CefBrowserSettings& settings, - const CefPoint& inspect_element_at) { +void CefBrowserHostImpl::ShowDevTools(const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) { if (CEF_CURRENTLY_ON_UIT()) { if (!web_contents_) return; @@ -848,9 +832,8 @@ void CefBrowserHostImpl::ShowDevTools( devtools_observer_.reset(new DevToolsWebContentsObserver( this, devtools_frontend_->frontend_browser()->web_contents())); } else { - ShowDevToolsHelper* helper = - new ShowDevToolsHelper(this, windowInfo, client, settings, - inspect_element_at); + ShowDevToolsHelper* helper = new ShowDevToolsHelper( + this, windowInfo, client, settings, inspect_element_at); CEF_POST_TASK(CEF_UIT, base::Bind(ShowDevToolsWithHelper, helper)); } } @@ -862,7 +845,7 @@ void CefBrowserHostImpl::CloseDevTools() { devtools_frontend_->Close(); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::CloseDevTools, this)); + base::Bind(&CefBrowserHostImpl::CloseDevTools, this)); } } @@ -883,9 +866,8 @@ void CefBrowserHostImpl::GetNavigationEntries( return; if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::GetNavigationEntries, this, visitor, - current_only)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GetNavigationEntries, + this, visitor, current_only)); return; } @@ -923,7 +905,7 @@ CefRefPtr CefBrowserHostImpl::GetVisibleNavigationEntry() { content::NavigationEntry* entry = nullptr; if (web_contents()) - entry = web_contents()->GetController().GetVisibleEntry(); + entry = web_contents()->GetController().GetVisibleEntry(); if (!entry) return nullptr; @@ -941,13 +923,13 @@ void CefBrowserHostImpl::SetAccessibilityState( if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SetAccessibilityState, - this, accessibility_state)); + base::Bind(&CefBrowserHostImpl::SetAccessibilityState, this, + accessibility_state)); return; } content::WebContentsImpl* web_contents_impl = - static_cast(web_contents()); + static_cast(web_contents()); if (!web_contents_impl) return; @@ -980,19 +962,19 @@ bool CefBrowserHostImpl::IsWindowRenderingDisabled() { void CefBrowserHostImpl::ReplaceMisspelling(const CefString& word) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ReplaceMisspelling, this, word)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::ReplaceMisspelling, + this, word)); return; } - if(web_contents()) + if (web_contents()) web_contents()->ReplaceMisspelling(word); } void CefBrowserHostImpl::AddWordToDictionary(const CefString& word) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::AddWordToDictionary, this, word)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::AddWordToDictionary, + this, word)); return; } @@ -1018,7 +1000,7 @@ void CefBrowserHostImpl::WasResized() { return; } -if (!web_contents() || !platform_delegate_) + if (!web_contents() || !platform_delegate_) return; platform_delegate_->WasResized(); @@ -1032,7 +1014,7 @@ void CefBrowserHostImpl::WasHidden(bool hidden) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHost::WasHidden, this, hidden)); + base::Bind(&CefBrowserHost::WasHidden, this, hidden)); return; } @@ -1049,7 +1031,8 @@ void CefBrowserHostImpl::NotifyScreenInfoChanged() { } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserHostImpl::NotifyScreenInfoChanged, this)); return; } @@ -1068,7 +1051,7 @@ void CefBrowserHostImpl::Invalidate(PaintElementType type) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::Invalidate, this, type)); + base::Bind(&CefBrowserHostImpl::Invalidate, this, type)); return; } @@ -1081,7 +1064,7 @@ void CefBrowserHostImpl::Invalidate(PaintElementType type) { void CefBrowserHostImpl::SendKeyEvent(const CefKeyEvent& event) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendKeyEvent, this, event)); + base::Bind(&CefBrowserHostImpl::SendKeyEvent, this, event)); return; } @@ -1089,19 +1072,19 @@ void CefBrowserHostImpl::SendKeyEvent(const CefKeyEvent& event) { return; content::NativeWebKeyboardEvent web_event( - blink::WebInputEvent::kUndefined, - blink::WebInputEvent::kNoModifiers, + blink::WebInputEvent::kUndefined, blink::WebInputEvent::kNoModifiers, ui::EventTimeStampToSeconds(ui::EventTimeForNow())); platform_delegate_->TranslateKeyEvent(web_event, event); platform_delegate_->SendKeyEvent(web_event); } void CefBrowserHostImpl::SendMouseClickEvent(const CefMouseEvent& event, - MouseButtonType type, bool mouseUp, int clickCount) { + MouseButtonType type, + bool mouseUp, + int clickCount) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendMouseClickEvent, this, event, type, - mouseUp, clickCount)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SendMouseClickEvent, + this, event, type, mouseUp, clickCount)); return; } @@ -1117,9 +1100,8 @@ void CefBrowserHostImpl::SendMouseClickEvent(const CefMouseEvent& event, void CefBrowserHostImpl::SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendMouseMoveEvent, this, event, - mouseLeave)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SendMouseMoveEvent, + this, event, mouseLeave)); return; } @@ -1132,11 +1114,11 @@ void CefBrowserHostImpl::SendMouseMoveEvent(const CefMouseEvent& event, } void CefBrowserHostImpl::SendMouseWheelEvent(const CefMouseEvent& event, - int deltaX, int deltaY) { + int deltaX, + int deltaY) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendMouseWheelEvent, this, event, - deltaX, deltaY)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SendMouseWheelEvent, + this, event, deltaX, deltaY)); return; } @@ -1155,7 +1137,7 @@ void CefBrowserHostImpl::SendFocusEvent(bool setFocus) { void CefBrowserHostImpl::SendCaptureLostEvent() { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendCaptureLostEvent, this)); + base::Bind(&CefBrowserHostImpl::SendCaptureLostEvent, this)); return; } @@ -1168,7 +1150,8 @@ void CefBrowserHostImpl::SendCaptureLostEvent() { void CefBrowserHostImpl::NotifyMoveOrResizeStarted() { #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserHostImpl::NotifyMoveOrResizeStarted, this)); return; } @@ -1193,8 +1176,8 @@ int CefBrowserHostImpl::GetWindowlessFrameRate() { void CefBrowserHostImpl::SetWindowlessFrameRate(int frame_rate) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SetWindowlessFrameRate, this, - frame_rate)); + base::Bind(&CefBrowserHostImpl::SetWindowlessFrameRate, this, + frame_rate)); return; } @@ -1220,16 +1203,14 @@ void CefBrowserHostImpl::GoBack() { if (CEF_CURRENTLY_ON_UIT()) { if (frame_destruction_pending_) { // Try again after frame destruction has completed. - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::GoBack, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoBack, this)); return; } if (web_contents_.get() && web_contents_->GetController().CanGoBack()) web_contents_->GetController().GoBack(); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::GoBack, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoBack, this)); } } @@ -1242,16 +1223,14 @@ void CefBrowserHostImpl::GoForward() { if (CEF_CURRENTLY_ON_UIT()) { if (frame_destruction_pending_) { // Try again after frame destruction has completed. - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::GoForward, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoForward, this)); return; } if (web_contents_.get() && web_contents_->GetController().CanGoForward()) web_contents_->GetController().GoForward(); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::GoForward, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoForward, this)); } } @@ -1264,16 +1243,14 @@ void CefBrowserHostImpl::Reload() { if (CEF_CURRENTLY_ON_UIT()) { if (frame_destruction_pending_) { // Try again after frame destruction has completed. - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::Reload, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::Reload, this)); return; } if (web_contents_.get()) web_contents_->GetController().Reload(content::ReloadType::NORMAL, true); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::Reload, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::Reload, this)); } } @@ -1282,7 +1259,7 @@ void CefBrowserHostImpl::ReloadIgnoreCache() { if (frame_destruction_pending_) { // Try again after frame destruction has completed. CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); + base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); return; } @@ -1292,7 +1269,7 @@ void CefBrowserHostImpl::ReloadIgnoreCache() { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); + base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); } } @@ -1300,16 +1277,14 @@ void CefBrowserHostImpl::StopLoad() { if (CEF_CURRENTLY_ON_UIT()) { if (frame_destruction_pending_) { // Try again after frame destruction has completed. - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::StopLoad, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::StopLoad, this)); return; } if (web_contents_.get()) web_contents_->Stop(); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::StopLoad, this)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::StopLoad, this)); } } @@ -1423,7 +1398,6 @@ bool CefBrowserHostImpl::SendProcessMessage( return false; } - // CefBrowserHostImpl public methods. // ----------------------------------------------------------------------------- @@ -1535,9 +1509,7 @@ CefRefPtr CefBrowserHostImpl::GetFrameForRequest( return nullptr; return GetOrCreateFrame(info->GetRenderFrameID(), CefFrameHostImpl::kUnspecifiedFrameId, - info->IsMainFrame(), - base::string16(), - GURL()); + info->IsMainFrame(), base::string16(), GURL()); } void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) { @@ -1547,8 +1519,8 @@ void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) { CefMsg_LoadRequest_Params request; request.url = params.url; if (!request.url.is_valid()) { - LOG(ERROR) << "Invalid URL passed to CefBrowserHostImpl::Navigate: " << - params.url; + LOG(ERROR) << "Invalid URL passed to CefBrowserHostImpl::Navigate: " + << params.url; return; } @@ -1576,20 +1548,19 @@ void CefBrowserHostImpl::LoadRequest(int64 frame_id, Navigate(params); } -void CefBrowserHostImpl::LoadURL( - int64 frame_id, - const std::string& url, - const content::Referrer& referrer, - ui::PageTransition transition, - const std::string& extra_headers) { +void CefBrowserHostImpl::LoadURL(int64 frame_id, + const std::string& url, + const content::Referrer& referrer, + ui::PageTransition transition, + const std::string& extra_headers) { if (frame_id == CefFrameHostImpl::kMainFrameId) { // Go through the navigation controller. if (CEF_CURRENTLY_ON_UIT()) { if (frame_destruction_pending_) { // Try again after frame destruction has completed. CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::LoadURL, this, frame_id, url, - referrer, transition, extra_headers)); + base::Bind(&CefBrowserHostImpl::LoadURL, this, frame_id, + url, referrer, transition, extra_headers)); return; } @@ -1603,22 +1574,19 @@ void CefBrowserHostImpl::LoadURL( } if (!gurl.is_valid()) { - LOG(ERROR) << - "Invalid URL passed to CefBrowserHostImpl::LoadURL: " << url; + LOG(ERROR) << "Invalid URL passed to CefBrowserHostImpl::LoadURL: " + << url; return; } - web_contents_->GetController().LoadURL( - gurl, - referrer, - transition, - extra_headers); + web_contents_->GetController().LoadURL(gurl, referrer, transition, + extra_headers); OnSetFocus(FOCUS_SOURCE_NAVIGATION); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::LoadURL, this, frame_id, url, - referrer, transition, extra_headers)); + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserHostImpl::LoadURL, this, frame_id, url, + referrer, transition, extra_headers)); } } else { CefNavigateParams params(GURL(url), transition); @@ -1629,7 +1597,8 @@ void CefBrowserHostImpl::LoadURL( } } -void CefBrowserHostImpl::LoadString(int64 frame_id, const std::string& string, +void CefBrowserHostImpl::LoadString(int64 frame_id, + const std::string& string, const std::string& url) { // Only known frame ids or kMainFrameId are supported. DCHECK(frame_id >= CefFrameHostImpl::kMainFrameId); @@ -1657,9 +1626,8 @@ void CefBrowserHostImpl::SendCommand( // Execute on the UI thread because CefResponseManager is not thread safe. if (CEF_CURRENTLY_ON_UIT()) { - TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", - "frame_id", frame_id, - "needsResponse", responseHandler.get() ? 1 : 0); + TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id", + frame_id, "needsResponse", responseHandler.get() ? 1 : 0); Cef_Request_Params params; params.name = "execute-command"; params.frame_id = frame_id; @@ -1677,9 +1645,8 @@ void CefBrowserHostImpl::SendCommand( Send(new CefMsg_Request(routing_id(), params)); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendCommand, this, frame_id, command, - responseHandler)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SendCommand, this, + frame_id, command, responseHandler)); } } @@ -1697,9 +1664,8 @@ void CefBrowserHostImpl::SendCode( // Execute on the UI thread because CefResponseManager is not thread safe. if (CEF_CURRENTLY_ON_UIT()) { - TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", - "frame_id", frame_id, - "needsResponse", responseHandler.get() ? 1 : 0); + TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id", + frame_id, "needsResponse", responseHandler.get() ? 1 : 0); Cef_Request_Params params; params.name = "execute-code"; params.frame_id = frame_id; @@ -1720,9 +1686,9 @@ void CefBrowserHostImpl::SendCode( Send(new CefMsg_Request(routing_id(), params)); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::SendCode, this, frame_id, is_javascript, - code, script_url, script_start_line, responseHandler)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SendCode, this, + frame_id, is_javascript, code, script_url, + script_start_line, responseHandler)); } } @@ -1748,8 +1714,7 @@ bool CefBrowserHostImpl::SendProcessMessage(CefProcessId target_process, void CefBrowserHostImpl::ViewText(const std::string& text) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ViewText, - this, text)); + base::Bind(&CefBrowserHostImpl::ViewText, this, text)); return; } @@ -1770,15 +1735,16 @@ void CefBrowserHostImpl::HandleExternalProtocol(const GURL& url) { if (allow_os_execution && platform_delegate_) platform_delegate_->HandleExternalProtocol(url); } else { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserHostImpl::HandleExternalProtocol, this, url)); } } SkColor CefBrowserHostImpl::GetBackgroundColor() const { // Don't use |platform_delegate_| because it's not thread-safe. - return CefContext::Get()->GetBackgroundColor(&settings_, - is_windowless_ ? STATE_ENABLED : STATE_DISABLED); + return CefContext::Get()->GetBackgroundColor( + &settings_, is_windowless_ ? STATE_ENABLED : STATE_DISABLED); } int CefBrowserHostImpl::browser_id() const { @@ -1807,7 +1773,7 @@ void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) { platform_delegate_->SendFocusEvent(true); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::OnSetFocus, this, source)); + base::Bind(&CefBrowserHostImpl::OnSetFocus, this, source)); } } @@ -1842,24 +1808,23 @@ bool CefBrowserHostImpl::IsFullscreenForTabOrPending( blink::WebDisplayMode CefBrowserHostImpl::GetDisplayMode( const content::WebContents* web_contents) const { - return is_fullscreen_ ? blink::kWebDisplayModeFullscreen : - blink::kWebDisplayModeBrowser; + return is_fullscreen_ ? blink::kWebDisplayModeFullscreen + : blink::kWebDisplayModeBrowser; } -void CefBrowserHostImpl::FindReply( - content::WebContents* web_contents, - int request_id, - int number_of_matches, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) { +void CefBrowserHostImpl::FindReply(content::WebContents* web_contents, + int request_id, + int number_of_matches, + const gfx::Rect& selection_rect, + int active_match_ordinal, + bool final_update) { if (client_.get()) { CefRefPtr handler = client_->GetFindHandler(); if (handler.get()) { CefRect rect(selection_rect.x(), selection_rect.y(), - selection_rect.width(), selection_rect.height()); - handler->OnFindResult(this, request_id, number_of_matches, - rect, active_match_ordinal, final_update); + selection_rect.width(), selection_rect.height()); + handler->OnFindResult(this, request_id, number_of_matches, rect, + active_match_ordinal, final_update); } } } @@ -1876,8 +1841,8 @@ void CefBrowserHostImpl::ImeSetComposition( if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ImeSetComposition, this, text, - underlines, replacement_range, selection_range)); + base::Bind(&CefBrowserHostImpl::ImeSetComposition, this, text, + underlines, replacement_range, selection_range)); return; } @@ -1898,8 +1863,8 @@ void CefBrowserHostImpl::ImeCommitText(const CefString& text, if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ImeCommitText, this, text, - replacement_range, relative_cursor_pos)); + base::Bind(&CefBrowserHostImpl::ImeCommitText, this, text, + replacement_range, relative_cursor_pos)); return; } @@ -1918,8 +1883,8 @@ void CefBrowserHostImpl::ImeFinishComposingText(bool keep_selection) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ImeFinishComposingText, this, - keep_selection)); + base::Bind(&CefBrowserHostImpl::ImeFinishComposingText, this, + keep_selection)); return; } @@ -1937,7 +1902,7 @@ void CefBrowserHostImpl::ImeCancelComposition() { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::ImeCancelComposition, this)); + base::Bind(&CefBrowserHostImpl::ImeCancelComposition, this)); return; } @@ -1947,7 +1912,8 @@ void CefBrowserHostImpl::ImeCancelComposition() { platform_delegate_->ImeCancelComposition(); } -void CefBrowserHostImpl::DragTargetDragEnter(CefRefPtr drag_data, +void CefBrowserHostImpl::DragTargetDragEnter( + CefRefPtr drag_data, const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops) { if (!IsWindowless()) { @@ -1956,9 +1922,8 @@ void CefBrowserHostImpl::DragTargetDragEnter(CefRefPtr drag_data, } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DragTargetDragEnter, this, drag_data, - event, allowed_ops)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::DragTargetDragEnter, + this, drag_data, event, allowed_ops)); return; } @@ -1973,7 +1938,8 @@ void CefBrowserHostImpl::DragTargetDragEnter(CefRefPtr drag_data, platform_delegate_->DragTargetDragEnter(drag_data, event, allowed_ops); } -void CefBrowserHostImpl::DragTargetDragOver(const CefMouseEvent& event, +void CefBrowserHostImpl::DragTargetDragOver( + const CefMouseEvent& event, CefBrowserHost::DragOperationsMask allowed_ops) { if (!IsWindowless()) { NOTREACHED() << "Window rendering is not disabled"; @@ -1981,9 +1947,8 @@ void CefBrowserHostImpl::DragTargetDragOver(const CefMouseEvent& event, } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DragTargetDragOver, this, event, - allowed_ops)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::DragTargetDragOver, + this, event, allowed_ops)); return; } @@ -2001,7 +1966,7 @@ void CefBrowserHostImpl::DragTargetDragLeave() { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DragTargetDragLeave, this)); + base::Bind(&CefBrowserHostImpl::DragTargetDragLeave, this)); return; } @@ -2019,7 +1984,7 @@ void CefBrowserHostImpl::DragTargetDrop(const CefMouseEvent& event) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DragTargetDrop, this, event)); + base::Bind(&CefBrowserHostImpl::DragTargetDrop, this, event)); return; } @@ -2036,7 +2001,8 @@ void CefBrowserHostImpl::DragSourceSystemDragEnded() { } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserHostImpl::DragSourceSystemDragEnded, this)); return; } @@ -2048,15 +2014,17 @@ void CefBrowserHostImpl::DragSourceSystemDragEnded() { } void CefBrowserHostImpl::DragSourceEndedAt( - int x, int y, CefBrowserHost::DragOperationsMask op) { + int x, + int y, + CefBrowserHost::DragOperationsMask op) { if (!IsWindowless()) { NOTREACHED() << "Window rendering is not disabled"; return; } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserHostImpl::DragSourceEndedAt, this, x, y, op)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::DragSourceEndedAt, + this, x, y, op)); return; } @@ -2066,7 +2034,6 @@ void CefBrowserHostImpl::DragSourceEndedAt( platform_delegate_->DragSourceEndedAt(x, y, op); } - // content::WebContentsDelegate methods. // ----------------------------------------------------------------------------- @@ -2081,9 +2048,7 @@ content::WebContents* CefBrowserHostImpl::OpenURLFromTab( CefRefPtr handler = client_->GetRequestHandler(); if (handler.get()) { cancel = handler->OnOpenURLFromTab( - this, - GetFrame(params.frame_tree_node_id), - params.url.spec(), + this, GetFrame(params.frame_tree_node_id), params.url.spec(), static_cast(params.disposition), params.user_gesture); } @@ -2136,8 +2101,7 @@ void CefBrowserHostImpl::CloseContents(content::WebContents* source) { // If this method is called in response to something other than // WindowDestroyed() ask the user if the browser should close. if (client_.get() && (IsWindowless() || !window_destroyed_)) { - CefRefPtr handler = - client_->GetLifeSpanHandler(); + CefRefPtr handler = client_->GetLifeSpanHandler(); if (handler.get()) { close_browser = !handler->DoClose(this); } @@ -2201,8 +2165,7 @@ void CefBrowserHostImpl::BeforeUnloadFired(content::WebContents* source, } } -bool CefBrowserHostImpl::TakeFocus(content::WebContents* source, - bool reverse) { +bool CefBrowserHostImpl::TakeFocus(content::WebContents* source, bool reverse) { if (client_.get()) { CefRefPtr handler = client_->GetFocusHandler(); if (handler.get()) @@ -2279,18 +2242,16 @@ void CefBrowserHostImpl::HandleKeyboardEvent( platform_delegate_->HandleKeyboardEvent(event); } -bool CefBrowserHostImpl::CanDragEnter( - content::WebContents* source, - const content::DropData& data, - blink::WebDragOperationsMask mask) { +bool CefBrowserHostImpl::CanDragEnter(content::WebContents* source, + const content::DropData& data, + blink::WebDragOperationsMask mask) { CefRefPtr handler = client_->GetDragHandler(); if (handler.get()) { CefRefPtr drag_data(new CefDragDataImpl(data)); drag_data->SetReadOnly(true); if (handler->OnDragEnter( - this, - drag_data.get(), - static_cast(mask))) { + this, drag_data.get(), + static_cast(mask))) { return false; } } @@ -2351,12 +2312,10 @@ void CefBrowserHostImpl::DidNavigateMainFramePostCommit( } content::JavaScriptDialogManager* - CefBrowserHostImpl::GetJavaScriptDialogManager( - content::WebContents* source) { +CefBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) { if (!javascript_dialog_manager_.get() && platform_delegate_) { - javascript_dialog_manager_.reset( - new CefJavaScriptDialogManager(this, - platform_delegate_->CreateJavaScriptDialogRunner())); + javascript_dialog_manager_.reset(new CefJavaScriptDialogManager( + this, platform_delegate_->CreateJavaScriptDialogRunner())); } return javascript_dialog_manager_.get(); } @@ -2374,8 +2333,7 @@ bool CefBrowserHostImpl::HandleContextMenu( CEF_REQUIRE_UIT(); if (!menu_manager_.get() && platform_delegate_) { menu_manager_.reset( - new CefMenuManager(this, - platform_delegate_->CreateMenuRunner())); + new CefMenuManager(this, platform_delegate_->CreateMenuRunner())); } return menu_manager_->CreateContextMenu(params); } @@ -2418,24 +2376,18 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( // given type. if (microphone_requested) { CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( - request.requested_audio_device_id, - true, - false, - &devices); + request.requested_audio_device_id, true, false, &devices); } if (webcam_requested) { CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( - request.requested_video_device_id, - false, - true, - &devices); + request.requested_video_device_id, false, true, &devices); } if (screen_requested) { content::DesktopMediaID media_id; if (request.requested_video_device_id.empty()) { - media_id = content::DesktopMediaID( - content::DesktopMediaID::TYPE_SCREEN, - -1 /* webrtc::kFullDesktopScreenId */); + media_id = + content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, + -1 /* webrtc::kFullDesktopScreenId */); } else { media_id = content::DesktopMediaID::Parse(request.requested_video_device_id); @@ -2450,9 +2402,9 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( } bool CefBrowserHostImpl::CheckMediaAccessPermission( - content::WebContents* web_contents, - const GURL& security_origin, - content::MediaStreamType type) { + content::WebContents* web_contents, + const GURL& security_origin, + content::MediaStreamType type) { // Check media access permission without prompting the user. This is called // when loading the Pepper Flash plugin. const base::CommandLine* command_line = @@ -2460,7 +2412,6 @@ bool CefBrowserHostImpl::CheckMediaAccessPermission( return command_line->HasSwitch(switches::kEnableMediaStream); } - // content::WebContentsObserver methods. // ----------------------------------------------------------------------------- @@ -2468,16 +2419,16 @@ void CefBrowserHostImpl::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { const int render_process_id = render_frame_host->GetProcess()->GetID(); const int render_routing_id = render_frame_host->GetRoutingID(); - browser_info_->render_id_manager()->add_render_frame_id( - render_process_id, render_routing_id); + browser_info_->render_id_manager()->add_render_frame_id(render_process_id, + render_routing_id); } void CefBrowserHostImpl::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { const int render_process_id = render_frame_host->GetProcess()->GetID(); const int render_routing_id = render_frame_host->GetRoutingID(); - browser_info_->render_id_manager()->remove_render_frame_id( - render_process_id, render_routing_id); + browser_info_->render_id_manager()->remove_render_frame_id(render_process_id, + render_routing_id); if (web_contents()) { const bool is_main_frame = (render_frame_host->GetParent() == nullptr); @@ -2501,13 +2452,13 @@ void CefBrowserHostImpl::RenderViewCreated( const int render_process_id = render_view_host->GetProcess()->GetID(); const int render_routing_id = render_view_host->GetRoutingID(); - browser_info_->render_id_manager()->add_render_view_id( - render_process_id, render_routing_id); + browser_info_->render_id_manager()->add_render_view_id(render_process_id, + render_routing_id); // May be already registered if the renderer crashed previously. if (!registrar_->IsRegistered( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host))) { + this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, + content::Source(render_view_host))) { registrar_->Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, content::Source(render_view_host)); } @@ -2528,13 +2479,14 @@ void CefBrowserHostImpl::RenderViewDeleted( const int render_process_id = render_view_host->GetProcess()->GetID(); const int render_routing_id = render_view_host->GetRoutingID(); - browser_info_->render_id_manager()->remove_render_view_id( - render_process_id, render_routing_id); + browser_info_->render_id_manager()->remove_render_view_id(render_process_id, + render_routing_id); if (registrar_->IsRegistered( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host))) { - registrar_->Remove(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, + this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, + content::Source(render_view_host))) { + registrar_->Remove( + this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, content::Source(render_view_host)); } } @@ -2593,8 +2545,8 @@ void CefBrowserHostImpl::DidFinishNavigation( // This also updates the URL associated with the frame. CefRefPtr frame = GetOrCreateFrame( navigation_handle->GetRenderFrameHost()->GetRoutingID(), - CefFrameHostImpl::kUnspecifiedFrameId, - is_main_frame, base::string16(), url); + CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, base::string16(), + url); // Don't call OnLoadStart for same page navigations (fragments, // history state). @@ -2641,11 +2593,8 @@ void CefBrowserHostImpl::DidFailLoad( // OnLoadEnd. const bool is_main_frame = !render_frame_host->GetParent(); CefRefPtr frame = GetOrCreateFrame( - render_frame_host->GetRoutingID(), - CefFrameHostImpl::kUnspecifiedFrameId, - is_main_frame, - base::string16(), - validated_url); + render_frame_host->GetRoutingID(), CefFrameHostImpl::kUnspecifiedFrameId, + is_main_frame, base::string16(), validated_url); OnLoadError(frame, validated_url, error_code); OnLoadEnd(frame, validated_url, error_code); } @@ -2663,7 +2612,7 @@ void CefBrowserHostImpl::FrameDeleted( if (main_frame_id_ == frame_id) main_frame_id_ = CefFrameHostImpl::kInvalidFrameId; - if (focused_frame_id_ == frame_id) + if (focused_frame_id_ == frame_id) focused_frame_id_ = CefFrameHostImpl::kInvalidFrameId; } @@ -2692,8 +2641,7 @@ void CefBrowserHostImpl::DidUpdateFaviconURL( CefRefPtr handler = client_->GetDisplayHandler(); if (handler.get()) { std::vector icon_urls; - std::vector::const_iterator it = - candidates.begin(); + std::vector::const_iterator it = candidates.begin(); for (; it != candidates.end(); ++it) { if (it->icon_type == content::FaviconURL::FAVICON) icon_urls.push_back(it->icon_url.spec()); @@ -2763,9 +2711,9 @@ bool CefBrowserHostImpl::Send(IPC::Message* message) { return content::WebContentsObserver::Send(message); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(base::IgnoreResult(&CefBrowserHostImpl::Send), this, - message)); + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefBrowserHostImpl::Send), this, + message)); return true; } } @@ -2785,7 +2733,6 @@ bool CefBrowserHostImpl::HasObserver(Observer* observer) const { return observers_.HasObserver(observer); } - // content::WebContentsObserver::OnMessageReceived() message handlers. // ----------------------------------------------------------------------------- @@ -2800,9 +2747,9 @@ void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id, const GURL& validated_url, bool is_main_frame, int http_status_code) { - CefRefPtr frame = GetOrCreateFrame(frame_id, - CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, base::string16(), - validated_url); + CefRefPtr frame = + GetOrCreateFrame(frame_id, CefFrameHostImpl::kUnspecifiedFrameId, + is_main_frame, base::string16(), validated_url); // Give internal scheme handlers an opportunity to update content. scheme::DidFinishLoad(frame, validated_url); @@ -2838,11 +2785,10 @@ void CefBrowserHostImpl::OnRequest(const Cef_Request_Params& params) { if (params.user_initiated) { // Give the user a chance to handle the request. if (client_.get()) { - CefRefPtr message( - new CefProcessMessageImpl(const_cast(¶ms), - false, true)); - success = client_->OnProcessMessageReceived(this, PID_RENDERER, - message.get()); + CefRefPtr message(new CefProcessMessageImpl( + const_cast(¶ms), false, true)); + success = + client_->OnProcessMessageReceived(this, PID_RENDERER, message.get()); message->Detach(NULL); } } else { @@ -2873,7 +2819,6 @@ void CefBrowserHostImpl::OnResponseAck(int request_id) { response_manager_->RunAckHandler(request_id); } - // content::NotificationObserver methods. // ----------------------------------------------------------------------------- @@ -2883,7 +2828,7 @@ void CefBrowserHostImpl::Observe(int type, DCHECK(type == content::NOTIFICATION_LOAD_STOP || type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE); - if (type == content::NOTIFICATION_LOAD_STOP) { + if (type == content::NOTIFICATION_LOAD_STOP) { content::NavigationController* controller = content::Source(source).ptr(); OnTitleChange(controller->GetWebContents()->GetTitle()); @@ -2892,7 +2837,6 @@ void CefBrowserHostImpl::Observe(int type, } } - // CefBrowserHostImpl private methods. // ----------------------------------------------------------------------------- @@ -2957,10 +2901,9 @@ CefBrowserHostImpl::CefBrowserHostImpl( response_manager_.reset(new CefResponseManager); - placeholder_frame_ = - new CefFrameHostImpl(this, CefFrameHostImpl::kInvalidFrameId, true, - CefString(), CefString(), - CefFrameHostImpl::kInvalidFrameId); + placeholder_frame_ = new CefFrameHostImpl( + this, CefFrameHostImpl::kInvalidFrameId, true, CefString(), CefString(), + CefFrameHostImpl::kInvalidFrameId); PrefsTabHelper::CreateForWebContents(web_contents_.get()); printing::CefPrintViewManager::CreateForWebContents(web_contents_.get()); @@ -2990,8 +2933,11 @@ bool CefBrowserHostImpl::CreateHostWindow() { } CefRefPtr CefBrowserHostImpl::GetOrCreateFrame( - int64 frame_id, int64 parent_frame_id, bool is_main_frame, - base::string16 frame_name, const GURL& frame_url) { + int64 frame_id, + int64 parent_frame_id, + bool is_main_frame, + base::string16 frame_name, + const GURL& frame_url) { DCHECK(frame_id > CefFrameHostImpl::kInvalidFrameId); if (frame_id <= CefFrameHostImpl::kInvalidFrameId) return nullptr; @@ -3025,7 +2971,7 @@ CefRefPtr CefBrowserHostImpl::GetOrCreateFrame( frames_.erase(it); } - if (focused_frame_id_ == main_frame_id_) + if (focused_frame_id_ == main_frame_id_) focused_frame_id_ = frame_id; } main_frame_id_ = frame_id; @@ -3158,9 +3104,8 @@ void CefBrowserHostImpl::OnLoadError(CefRefPtr frame, frame_destruction_pending_ = true; // Notify the handler that loading has failed. handler->OnLoadError(this, frame, - static_cast(error_code), - net::ErrorToShortString(error_code), - url.spec()); + static_cast(error_code), + net::ErrorToShortString(error_code), url.spec()); frame_destruction_pending_ = false; } } @@ -3206,8 +3151,7 @@ void CefBrowserHostImpl::OnDevToolsWebContentsDestroyed() { void CefBrowserHostImpl::EnsureFileDialogManager() { CEF_REQUIRE_UIT(); if (!file_dialog_manager_.get() && platform_delegate_) { - file_dialog_manager_.reset( - new CefFileDialogManager(this, - platform_delegate_->CreateFileDialogRunner())); + file_dialog_manager_.reset(new CefFileDialogManager( + this, platform_delegate_->CreateFileDialogRunner())); } } diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 27ae9a1b6..b2a4d8805 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -80,7 +80,7 @@ class CefBrowserHostImpl : public CefBrowserHost, // Used for handling the response to command messages. class CommandResponseHandler : public virtual CefBaseRefCounted { public: - virtual void OnResponse(const std::string& response) =0; + virtual void OnResponse(const std::string& response) = 0; }; // Interface to implement for observers that wish to be informed of changes @@ -89,7 +89,7 @@ class CefBrowserHostImpl : public CefBrowserHost, public: // Called before |browser| is destroyed. Any references to |browser| should // be cleared when this method is called. - virtual void OnBrowserDestroyed(CefBrowserHostImpl* browser) =0; + virtual void OnBrowserDestroyed(CefBrowserHostImpl* browser) = 0; protected: virtual ~Observer() {} @@ -142,11 +142,12 @@ class CefBrowserHostImpl : public CefBrowserHost, static CefRefPtr GetBrowserForRequest( const net::URLRequest* request); // Returns the browser associated with the specified view routing IDs. - static CefRefPtr GetBrowserForView( - int render_process_id, int render_routing_id); + static CefRefPtr GetBrowserForView(int render_process_id, + int render_routing_id); // Returns the browser associated with the specified frame routing IDs. static CefRefPtr GetBrowserForFrame( - int render_process_id, int render_routing_id); + int render_process_id, + int render_routing_id); // CefBrowserHost methods. CefRefPtr GetBrowser() override; @@ -160,13 +161,12 @@ class CefBrowserHostImpl : public CefBrowserHost, CefRefPtr GetRequestContext() override; double GetZoomLevel() override; void SetZoomLevel(double zoomLevel) override; - void RunFileDialog( - FileDialogMode mode, - const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, - int selected_accept_filter, - CefRefPtr callback) override; + void RunFileDialog(FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) override; void StartDownload(const CefString& url) override; void DownloadImage(const CefString& image_url, bool is_favicon, @@ -177,8 +177,11 @@ class CefBrowserHostImpl : public CefBrowserHost, void PrintToPDF(const CefString& path, const CefPdfPrintSettings& settings, CefRefPtr callback) override; - void Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) override; + void Find(int identifier, + const CefString& searchText, + bool forward, + bool matchCase, + bool findNext) override; void StopFinding(bool clearSelection) override; void ShowDevTools(const CefWindowInfo& windowInfo, CefRefPtr client, @@ -186,9 +189,8 @@ class CefBrowserHostImpl : public CefBrowserHost, const CefPoint& inspect_element_at) override; void CloseDevTools() override; bool HasDevTools() override; - void GetNavigationEntries( - CefRefPtr visitor, - bool current_only) override; + void GetNavigationEntries(CefRefPtr visitor, + bool current_only) override; void SetMouseCursorChangeDisabled(bool disabled) override; bool IsMouseCursorChangeDisabled() override; bool IsWindowRenderingDisabled() override; @@ -201,11 +203,12 @@ class CefBrowserHostImpl : public CefBrowserHost, void SendKeyEvent(const CefKeyEvent& event) override; void SendMouseClickEvent(const CefMouseEvent& event, MouseButtonType type, - bool mouseUp, int clickCount) override; - void SendMouseMoveEvent(const CefMouseEvent& event, - bool mouseLeave) override; + bool mouseUp, + int clickCount) override; + void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) override; void SendMouseWheelEvent(const CefMouseEvent& event, - int deltaX, int deltaY) override; + int deltaX, + int deltaY) override; void SendFocusEvent(bool setFocus) override; void SendCaptureLostEvent() override; void NotifyMoveOrResizeStarted() override; @@ -215,7 +218,8 @@ class CefBrowserHostImpl : public CefBrowserHost, const std::vector& underlines, const CefRange& replacement_range, const CefRange& selection_range) override; - void ImeCommitText(const CefString& text, const CefRange& replacement_range, + void ImeCommitText(const CefString& text, + const CefRange& replacement_range, int relative_cursor_pos) override; void ImeFinishComposingText(bool keep_selection) override; void ImeCancelComposition() override; @@ -252,9 +256,8 @@ class CefBrowserHostImpl : public CefBrowserHost, size_t GetFrameCount() override; void GetFrameIdentifiers(std::vector& identifiers) override; void GetFrameNames(std::vector& names) override; - bool SendProcessMessage( - CefProcessId target_process, - CefRefPtr message) override; + bool SendProcessMessage(CefProcessId target_process, + CefRefPtr message) override; // Returns true if windowless rendering is enabled. bool IsWindowless() const; @@ -299,16 +302,21 @@ class CefBrowserHostImpl : public CefBrowserHost, const std::string& extra_headers); // Load the specified string. - void LoadString(int64 frame_id, const std::string& string, + void LoadString(int64 frame_id, + const std::string& string, const std::string& url); // Send a command to the renderer for execution. - void SendCommand(int64 frame_id, const std::string& command, + void SendCommand(int64 frame_id, + const std::string& command, CefRefPtr responseHandler); // Send code to the renderer for execution. - void SendCode(int64 frame_id, bool is_javascript, const std::string& code, - const std::string& script_url, int script_start_line, + void SendCode(int64 frame_id, + bool is_javascript, + const std::string& code, + const std::string& script_url, + int script_start_line, CefRefPtr responseHandler); bool SendProcessMessage(CefProcessId target_process, @@ -329,13 +337,12 @@ class CefBrowserHostImpl : public CefBrowserHost, // scaling will be applied to the result. gfx::Point GetScreenPoint(const gfx::Point& view) const; - void StartDragging( - const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, - content::RenderWidgetHostImpl* source_rwh); + void StartDragging(const content::DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const content::DragEventSourceInfo& event_info, + content::RenderWidgetHostImpl* source_rwh); void UpdateDragCursor(blink::WebDragOperation operation); // Thread safe accessors. @@ -354,9 +361,8 @@ class CefBrowserHostImpl : public CefBrowserHost, const CefFileDialogRunner::FileChooserParams& params, const CefFileDialogRunner::RunFileChooserCallback& callback); - bool HandleContextMenu( - content::WebContents* web_contents, - const content::ContextMenuParams& params); + bool HandleContextMenu(content::WebContents* web_contents, + const content::ContextMenuParams& params); // Returns the WebContents most likely to handle an action. If extensions are // enabled and this browser has a full-page guest (for example, a full-page @@ -379,8 +385,7 @@ class CefBrowserHostImpl : public CefBrowserHost, void LoadingStateChanged(content::WebContents* source, bool to_different_document) override; void CloseContents(content::WebContents* source) override; - void UpdateTargetURL(content::WebContents* source, - const GURL& url) override; + void UpdateTargetURL(content::WebContents* source, const GURL& url) override; bool DidAddMessageToConsole(content::WebContents* source, int32_t level, const base::string16& message, @@ -389,20 +394,17 @@ class CefBrowserHostImpl : public CefBrowserHost, void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; - bool TakeFocus(content::WebContents* source, - bool reverse) override; - bool HandleContextMenu( - const content::ContextMenuParams& params) override; + bool TakeFocus(content::WebContents* source, bool reverse) override; + bool HandleContextMenu(const content::ContextMenuParams& params) override; content::KeyboardEventProcessingResult PreHandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; - bool CanDragEnter( - content::WebContents* source, - const content::DropData& data, - blink::WebDragOperationsMask operations_allowed) override; + bool CanDragEnter(content::WebContents* source, + const content::DropData& data, + blink::WebDragOperationsMask operations_allowed) override; void GetCustomWebContentsView( content::WebContents* web_contents, const GURL& target_url, @@ -420,9 +422,8 @@ class CefBrowserHostImpl : public CefBrowserHost, content::WebContents* web_contents) override; content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; - void RunFileChooser( - content::RenderFrameHost* render_frame_host, - const content::FileChooserParams& params) override; + void RunFileChooser(content::RenderFrameHost* render_frame_host, + const content::FileChooserParams& params) override; bool EmbedsFullscreenWidget() const override; void EnterFullscreenModeForTab(content::WebContents* web_contents, const GURL& origin) override; @@ -431,13 +432,12 @@ class CefBrowserHostImpl : public CefBrowserHost, const content::WebContents* web_contents) const override; blink::WebDisplayMode GetDisplayMode( const content::WebContents* web_contents) const override; - void FindReply( - content::WebContents* web_contents, - int request_id, - int number_of_matches, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) override; + void FindReply(content::WebContents* web_contents, + int request_id, + int number_of_matches, + const gfx::Rect& selection_rect, + int active_match_ordinal, + bool final_update) override; void UpdatePreferredSize(content::WebContents* source, const gfx::Size& pref_size) override; void RequestMediaAccessPermission( @@ -507,11 +507,10 @@ class CefBrowserHostImpl : public CefBrowserHost, void OnFrameIdentified(int64 frame_id, int64 parent_frame_id, base::string16 name); - void OnDidFinishLoad( - int64 frame_id, - const GURL& validated_url, - bool is_main_frame, - int http_status_code); + void OnDidFinishLoad(int64 frame_id, + const GURL& validated_url, + bool is_main_frame, + int http_status_code); void OnUpdateDraggableRegions( const std::vector& regions); void OnRequest(const Cef_Request_Params& params); @@ -520,16 +519,17 @@ class CefBrowserHostImpl : public CefBrowserHost, // content::NotificationObserver methods. void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override; + const content::NotificationSource& source, + const content::NotificationDetails& details) override; - CefBrowserHostImpl(const CefBrowserSettings& settings, - CefRefPtr client, - content::WebContents* web_contents, - scoped_refptr browser_info, - CefRefPtr opener, - CefRefPtr request_context, - std::unique_ptr platform_delegate); + CefBrowserHostImpl( + const CefBrowserSettings& settings, + CefRefPtr client, + content::WebContents* web_contents, + scoped_refptr browser_info, + CefRefPtr opener, + CefRefPtr request_context, + std::unique_ptr platform_delegate); // Give the platform delegate an opportunity to create the host window. bool CreateHostWindow(); @@ -544,13 +544,10 @@ class CefBrowserHostImpl : public CefBrowserHost, // Remove the references to all frames and mark them as detached. void DetachAllFrames(); - void OnAddressChange(CefRefPtr frame, - const GURL& url); + void OnAddressChange(CefRefPtr frame, const GURL& url); void OnLoadStart(CefRefPtr frame, ui::PageTransition transition_type); - void OnLoadError(CefRefPtr frame, - const GURL& url, - int error_code); + void OnLoadError(CefRefPtr frame, const GURL& url, int error_code); void OnLoadEnd(CefRefPtr frame, const GURL& url, int http_status_code); @@ -588,7 +585,7 @@ class CefBrowserHostImpl : public CefBrowserHost, bool queue_messages_; // Map of unique frame ids to CefFrameHostImpl references. - typedef std::map > FrameMap; + typedef std::map> FrameMap; FrameMap frames_; // The unique frame id currently identified as the main frame. int64 main_frame_id_; diff --git a/libcef/browser/browser_info.cc b/libcef/browser/browser_info.cc index 34dc541f3..7c128f2d4 100644 --- a/libcef/browser/browser_info.cc +++ b/libcef/browser/browser_info.cc @@ -12,41 +12,45 @@ // CefBrowserInfo::RenderIDManager CefBrowserInfo::RenderIDManager::RenderIDManager(base::Lock* lock) - : lock_(lock) { + : lock_(lock) { DCHECK(lock); } void CefBrowserInfo::RenderIDManager::add_render_view_id( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { add_render_id(&render_view_id_set_, render_process_id, render_routing_id); } void CefBrowserInfo::RenderIDManager::add_render_frame_id( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { add_render_id(&render_frame_id_set_, render_process_id, render_routing_id); } void CefBrowserInfo::RenderIDManager::remove_render_view_id( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { remove_render_id(&render_view_id_set_, render_process_id, render_routing_id); } void CefBrowserInfo::RenderIDManager::remove_render_frame_id( - int render_process_id, int render_routing_id) { + int render_process_id, + int render_routing_id) { remove_render_id(&render_frame_id_set_, render_process_id, render_routing_id); } bool CefBrowserInfo::RenderIDManager::is_render_view_id_match( - int render_process_id, int render_routing_id) const { - return is_render_id_match(&render_view_id_set_, - render_process_id, + int render_process_id, + int render_routing_id) const { + return is_render_id_match(&render_view_id_set_, render_process_id, render_routing_id); } bool CefBrowserInfo::RenderIDManager::is_render_frame_id_match( - int render_process_id, int render_routing_id) const { - return is_render_id_match(&render_frame_id_set_, - render_process_id, + int render_process_id, + int render_routing_id) const { + return is_render_id_match(&render_frame_id_set_, render_process_id, render_routing_id); } @@ -80,8 +84,8 @@ void CefBrowserInfo::RenderIDManager::remove_render_id(RenderIdSet* id_set, if (id_set->empty()) return; - bool erased = id_set->erase( - std::make_pair(render_process_id, render_routing_id)) != 0; + bool erased = + id_set->erase(std::make_pair(render_process_id, render_routing_id)) != 0; DCHECK(erased); } @@ -99,7 +103,6 @@ bool CefBrowserInfo::RenderIDManager::is_render_id_match( return (it != id_set->end()); } - // CefBrowserInfo CefBrowserInfo::CefBrowserInfo(int browser_id, bool is_popup) @@ -111,8 +114,7 @@ CefBrowserInfo::CefBrowserInfo(int browser_id, bool is_popup) DCHECK_GT(browser_id, 0); } -CefBrowserInfo::~CefBrowserInfo() { -} +CefBrowserInfo::~CefBrowserInfo() {} void CefBrowserInfo::set_windowless(bool windowless) { is_windowless_ = windowless; diff --git a/libcef/browser/browser_info.h b/libcef/browser/browser_info.h index c5d4707f1..0f1646c6c 100644 --- a/libcef/browser/browser_info.h +++ b/libcef/browser/browser_info.h @@ -39,10 +39,10 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { bool is_render_view_id_match(int render_process_id, int render_routing_id) const; bool is_render_frame_id_match(int render_process_id, - int render_routing_id)const ; + int render_routing_id) const; private: - typedef std::set > RenderIdSet; + typedef std::set> RenderIdSet; void add_render_id(RenderIdSet* id_set, int render_process_id, @@ -81,9 +81,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { void set_windowless(bool windowless); // Returns the render ID manager for this browser. - RenderIDManager* render_id_manager() { - return &render_id_manager_; - } + RenderIDManager* render_id_manager() { return &render_id_manager_; } // Returns the render ID manager for guest views owned by this browser. RenderIDManager* guest_render_id_manager() { diff --git a/libcef/browser/browser_info_manager.cc b/libcef/browser/browser_info_manager.cc index 43a59d146..ba0b1c834 100644 --- a/libcef/browser/browser_info_manager.cc +++ b/libcef/browser/browser_info_manager.cc @@ -6,20 +6,20 @@ #include -#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_host_impl.h" +#include "libcef/browser/browser_platform_delegate.h" +#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/thread_util.h" #include "libcef/common/cef_messages.h" #include "libcef/common/extensions/extensions_util.h" -#include "libcef/browser/extensions/browser_extensions_util.h" #include "base/logging.h" +#include "content/common/view_messages.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/child_process_host.h" -#include "content/common/view_messages.h" namespace { @@ -32,25 +32,24 @@ void TranslatePopupFeatures(const blink::mojom::WindowFeatures& webKitFeatures, features.width = static_cast(webKitFeatures.width); features.widthSet = webKitFeatures.has_width; features.height = static_cast(webKitFeatures.height); - features.heightSet = webKitFeatures.has_height; + features.heightSet = webKitFeatures.has_height; - features.menuBarVisible = webKitFeatures.menu_bar_visible; - features.statusBarVisible = webKitFeatures.status_bar_visible; - features.toolBarVisible = webKitFeatures.tool_bar_visible; - features.locationBarVisible = webKitFeatures.location_bar_visible; - features.scrollbarsVisible = webKitFeatures.scrollbars_visible; - features.resizable = webKitFeatures.resizable; + features.menuBarVisible = webKitFeatures.menu_bar_visible; + features.statusBarVisible = webKitFeatures.status_bar_visible; + features.toolBarVisible = webKitFeatures.tool_bar_visible; + features.locationBarVisible = webKitFeatures.location_bar_visible; + features.scrollbarsVisible = webKitFeatures.scrollbars_visible; + features.resizable = webKitFeatures.resizable; - features.fullscreen = webKitFeatures.fullscreen; - features.dialog = webKitFeatures.dialog; + features.fullscreen = webKitFeatures.fullscreen; + features.dialog = webKitFeatures.dialog; } CefBrowserInfoManager* g_info_manager = nullptr; } // namespace -CefBrowserInfoManager::CefBrowserInfoManager() - : next_browser_id_(0) { +CefBrowserInfoManager::CefBrowserInfoManager() : next_browser_id_(0) { DCHECK(!g_info_manager); g_info_manager = this; } @@ -100,8 +99,8 @@ scoped_refptr CefBrowserInfoManager::CreatePopupBrowserInfo( scoped_refptr browser_info = new CefBrowserInfo(++next_browser_id_, true); - browser_info->render_id_manager()->add_render_view_id( - render_process_id, render_view_routing_id); + browser_info->render_id_manager()->add_render_view_id(render_process_id, + render_view_routing_id); browser_info->render_id_manager()->add_render_frame_id( render_process_id, render_frame_routing_id); browser_info_list_.push_back(browser_info); @@ -117,8 +116,8 @@ scoped_refptr CefBrowserInfoManager::CreatePopupBrowserInfo( if (info->render_process_id == render_process_id && info->render_view_routing_id == render_view_routing_id && info->render_frame_routing_id == render_frame_routing_id) { - SendNewBrowserInfoResponse(render_process_id, browser_info.get(), - false, info->reply_msg); + SendNewBrowserInfoResponse(render_process_id, browser_info.get(), false, + info->reply_msg); pending_new_browser_info_list_.erase(it); break; @@ -153,15 +152,13 @@ bool CefBrowserInfoManager::CanCreateWindow( } if (is_guest_view) { - content::OpenURLParams params(target_url, - referrer, - disposition, - ui::PAGE_TRANSITION_LINK, - true); + content::OpenURLParams params(target_url, referrer, disposition, + ui::PAGE_TRANSITION_LINK, true); params.user_gesture = user_gesture; // Pass navigation to the owner browser. - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefBrowserHostImpl::OpenURLFromTab), browser.get(), nullptr, params)); @@ -210,17 +207,12 @@ bool CefBrowserInfoManager::CanCreateWindow( window_info->height = cef_features.height; #endif - allow = !handler->OnBeforePopup(browser.get(), - frame, - pending_popup->target_url.spec(), + allow = !handler->OnBeforePopup( + browser.get(), frame, pending_popup->target_url.spec(), pending_popup->target_frame_name, - static_cast(disposition), - user_gesture, - cef_features, - *window_info, - pending_popup->client, - pending_popup->settings, - no_javascript_access); + static_cast(disposition), user_gesture, + cef_features, *window_info, pending_popup->client, + pending_popup->settings, no_javascript_access); } } @@ -239,8 +231,8 @@ bool CefBrowserInfoManager::CanCreateWindow( // Filtering needs to be done on the UI thread. CEF_POST_TASK(CEF_UIT, - base::Bind(FilterPendingPopupURL, opener_render_process_id, - base::Passed(&pending_popup))); + base::Bind(FilterPendingPopupURL, opener_render_process_id, + base::Passed(&pending_popup))); } return allow; @@ -288,11 +280,10 @@ void CefBrowserInfoManager::WebContentsCreated( platform_delegate = std::move(pending_popup->platform_delegate); } -void CefBrowserInfoManager::OnGetNewBrowserInfo( - int render_process_id, - int render_view_routing_id, - int render_frame_routing_id, - IPC::Message* reply_msg) { +void CefBrowserInfoManager::OnGetNewBrowserInfo(int render_process_id, + int render_view_routing_id, + int render_frame_routing_id, + IPC::Message* reply_msg) { DCHECK_NE(render_process_id, content::ChildProcessHost::kInvalidUniqueID); DCHECK_GT(render_view_routing_id, 0); DCHECK_GT(render_frame_routing_id, 0); @@ -303,9 +294,8 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo( bool is_guest_view = false; scoped_refptr browser_info = GetBrowserInfo( - render_process_id, render_view_routing_id, - render_process_id, render_frame_routing_id, - &is_guest_view); + render_process_id, render_view_routing_id, render_process_id, + render_frame_routing_id, &is_guest_view); if (browser_info.get()) { // Send the response immediately. @@ -463,11 +453,10 @@ void CefBrowserInfoManager::PushPendingPopup( } std::unique_ptr - CefBrowserInfoManager::PopPendingPopup( - PendingPopup::Step step, - int opener_process_id, - int opener_frame_id, - const GURL& target_url) { +CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step step, + int opener_process_id, + int opener_frame_id, + const GURL& target_url) { DCHECK_GT(opener_process_id, 0); DCHECK_GT(opener_frame_id, 0); @@ -476,8 +465,7 @@ std::unique_ptr PendingPopupList::iterator it = pending_popup_list_.begin(); for (; it != pending_popup_list_.end(); ++it) { PendingPopup* popup = *it; - if (popup->step == step && - popup->opener_process_id == opener_process_id && + if (popup->step == step && popup->opener_process_id == opener_process_id && popup->opener_frame_id == opener_frame_id && popup->target_url == target_url) { pending_popup_list_.weak_erase(it); @@ -499,10 +487,10 @@ scoped_refptr CefBrowserInfoManager::GetBrowserInfo( if (is_guest_view) *is_guest_view = false; - const bool valid_view_ids = render_view_process_id > 0 && - render_view_routing_id > 0; - const bool valid_frame_ids = render_frame_process_id > 0 && - render_frame_routing_id > 0; + const bool valid_view_ids = + render_view_process_id > 0 && render_view_routing_id > 0; + const bool valid_frame_ids = + render_frame_process_id > 0 && render_frame_routing_id > 0; BrowserInfoList::const_iterator it = browser_info_list_.begin(); for (; it != browser_info_list_.end(); ++it) { @@ -550,7 +538,8 @@ void CefBrowserInfoManager::SendNewBrowserInfoResponse( bool is_guest_view, IPC::Message* reply_msg) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefBrowserInfoManager::SendNewBrowserInfoResponse, render_process_id, browser_info, is_guest_view, reply_msg)); return; diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index 772237d3e..6b7ac57a5 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -60,26 +60,25 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // Called from CefContentBrowserClient::CanCreateWindow. See comments on // PendingPopup for more information. - bool CanCreateWindow( - const GURL& target_url, - const content::Referrer& referrer, - const std::string& frame_name, - WindowOpenDisposition disposition, - const blink::mojom::WindowFeatures& features, - bool user_gesture, - bool opener_suppressed, - int opener_render_process_id, - int opener_render_frame_id, - bool* no_javascript_access); + bool CanCreateWindow(const GURL& target_url, + const content::Referrer& referrer, + const std::string& frame_name, + WindowOpenDisposition disposition, + const blink::mojom::WindowFeatures& features, + bool user_gesture, + bool opener_suppressed, + int opener_render_process_id, + int opener_render_frame_id, + bool* no_javascript_access); // Called from CefBrowserHostImpl::GetCustomWebContentsView. See comments on // PendingPopup for more information. void GetCustomWebContentsView( - const GURL& target_url, - int opener_render_process_id, - int opener_render_frame_id, - content::WebContentsView** view, - content::RenderViewHostDelegateView** delegate_view); + const GURL& target_url, + int opener_render_process_id, + int opener_render_frame_id, + content::WebContentsView** view, + content::RenderViewHostDelegateView** delegate_view); // Called from CefBrowserHostImpl::WebContentsCreated. See comments on // PendingPopup for more information. @@ -98,11 +97,10 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // exist for explicitly created browsers and guest views. It may sometimes // already exist for traditional popup browsers depending on timing. See // comments on PendingPopup for more information. - void OnGetNewBrowserInfo( - int render_process_id, - int render_view_routing_id, - int render_frame_routing_id, - IPC::Message* reply_msg); + void OnGetNewBrowserInfo(int render_process_id, + int render_view_routing_id, + int render_frame_routing_id, + IPC::Message* reply_msg); // Called from CefBrowserHostImpl::DestroyBrowser() when a browser is // destroyed. @@ -125,7 +123,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { bool* is_guest_view); // Retrieves all existing CefBrowserInfo objects. - typedef std::list > BrowserInfoList; + typedef std::list> BrowserInfoList; void GetBrowserInfoList(BrowserInfoList& list); private: @@ -176,32 +174,29 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // URIs, rewrites the URL to "about:blank". We need to apply the same filter // otherwise GetCustomWebContentsView will fail to retrieve the PopupInfo. static void FilterPendingPopupURL( - int opener_process_id, - std::unique_ptr pending_popup); + int opener_process_id, + std::unique_ptr pending_popup); // Manage pending popups. void PushPendingPopup(std::unique_ptr popup); - std::unique_ptr PopPendingPopup( - PendingPopup::Step step, - int opener_process_id, - int opener_frame_id, - const GURL& target_url); + std::unique_ptr PopPendingPopup(PendingPopup::Step step, + int opener_process_id, + int opener_frame_id, + const GURL& target_url); // Retrieves the BrowserInfo matching the specified IDs. If both sets are // valid then this method makes sure both sets have been registered. - scoped_refptr GetBrowserInfo( - int render_view_process_id, - int render_view_routing_id, - int render_frame_process_id, - int render_frame_routing_id, - bool* is_guest_view); + scoped_refptr GetBrowserInfo(int render_view_process_id, + int render_view_routing_id, + int render_frame_process_id, + int render_frame_routing_id, + bool* is_guest_view); // Send the response for a pending OnGetNewBrowserInfo request. - static void SendNewBrowserInfoResponse( - int render_process_id, - CefBrowserInfo* browser_info, - bool is_guest_view, - IPC::Message* reply_msg); + static void SendNewBrowserInfoResponse(int render_process_id, + CefBrowserInfo* browser_info, + bool is_guest_view, + IPC::Message* reply_msg); // Pending request for OnGetNewBrowserInfo. struct PendingNewBrowserInfo { diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index cbab8b753..aab64ded0 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -15,8 +15,8 @@ #include "libcef/browser/context.h" #include "libcef/browser/devtools_manager_delegate.h" #include "libcef/browser/extensions/browser_context_keyed_service_factories.h" -#include "libcef/browser/extensions/extensions_browser_client.h" #include "libcef/browser/extensions/extension_system_factory.h" +#include "libcef/browser/extensions/extensions_browser_client.h" #include "libcef/browser/net/chrome_scheme_handler.h" #include "libcef/browser/printing/printing_message_filter.h" #include "libcef/browser/thread_util.h" @@ -74,8 +74,8 @@ class CefAccessTokenStore : public device::AccessTokenStore { callback.Run(access_token_map_, system_context_); } - void SaveAccessToken( - const GURL& server_url, const base::string16& access_token) override { + void SaveAccessToken(const GURL& server_url, + const base::string16& access_token) override { access_token_map_[server_url] = access_token; } @@ -101,17 +101,14 @@ class CefGeolocationDelegate : public device::GeolocationDelegate { DISALLOW_COPY_AND_ASSIGN(CefGeolocationDelegate); }; - + } // namespace CefBrowserMainParts::CefBrowserMainParts( const content::MainFunctionParams& parameters) - : BrowserMainParts(), - devtools_delegate_(NULL) { -} + : BrowserMainParts(), devtools_delegate_(NULL) {} -CefBrowserMainParts::~CefBrowserMainParts() { -} +CefBrowserMainParts::~CefBrowserMainParts() {} void CefBrowserMainParts::PreMainMessageLoopStart() { if (!base::MessageLoop::current()) { @@ -176,7 +173,8 @@ void CefBrowserMainParts::PreMainMessageLoopRun() { // BrowserContext. extensions_client_.reset(new extensions::CefExtensionsClient()); extensions::ExtensionsClient::Set(extensions_client_.get()); - extensions_browser_client_.reset(new extensions::CefExtensionsBrowserClient); + extensions_browser_client_.reset( + new extensions::CefExtensionsBrowserClient); extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); // Register additional KeyedService factories here. See diff --git a/libcef/browser/browser_main.h b/libcef/browser/browser_main.h index e55bdba8c..daaabbaef 100644 --- a/libcef/browser/browser_main.h +++ b/libcef/browser/browser_main.h @@ -56,9 +56,7 @@ class CefBrowserMainParts : public content::BrowserMainParts { CefRefPtr request_context() const { return global_request_context_; } - CefDevToolsDelegate* devtools_delegate() const { - return devtools_delegate_; - } + CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_; } private: #if defined(OS_WIN) @@ -70,7 +68,8 @@ class CefBrowserMainParts : public content::BrowserMainParts { std::unique_ptr message_loop_; std::unique_ptr extensions_client_; - std::unique_ptr extensions_browser_client_; + std::unique_ptr + extensions_browser_client_; #if defined(USE_AURA) std::unique_ptr wm_state_; diff --git a/libcef/browser/browser_main_win.cc b/libcef/browser/browser_main_win.cc index 0c4bbe579..fa85e6761 100644 --- a/libcef/browser/browser_main_win.cc +++ b/libcef/browser/browser_main_win.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include -#include #include +#include +#include #include "libcef/browser/browser_main.h" @@ -23,7 +23,7 @@ void CefBrowserMainParts::PlatformInitialize() { DCHECK(SUCCEEDED(res)); INITCOMMONCONTROLSEX InitCtrlEx; InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); - InitCtrlEx.dwICC = ICC_STANDARD_CLASSES; + InitCtrlEx.dwICC = ICC_STANDARD_CLASSES; InitCommonControlsEx(&InitCtrlEx); // Start COM stuff. diff --git a/libcef/browser/browser_message_filter.cc b/libcef/browser/browser_message_filter.cc index dfa23ba25..a06fa1477 100644 --- a/libcef/browser/browser_message_filter.cc +++ b/libcef/browser/browser_message_filter.cc @@ -14,18 +14,16 @@ #include "libcef/common/content_client.h" #include "libcef/common/values_impl.h" -#include "base/compiler_specific.h" #include "base/bind.h" +#include "base/compiler_specific.h" #include "content/common/frame_messages.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/child_process_host.h" CefBrowserMessageFilter::CefBrowserMessageFilter(int render_process_id) - : render_process_id_(render_process_id) { -} + : render_process_id_(render_process_id) {} -CefBrowserMessageFilter::~CefBrowserMessageFilter() { -} +CefBrowserMessageFilter::~CefBrowserMessageFilter() {} void CefBrowserMessageFilter::OnFilterRemoved() { render_process_id_ = content::ChildProcessHost::kInvalidUniqueID; @@ -53,8 +51,8 @@ bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) { bool CefBrowserMessageFilter::Send(IPC::Message* message) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, - base::Bind(base::IgnoreResult(&CefBrowserMessageFilter::Send), this, - message)); + base::Bind(base::IgnoreResult(&CefBrowserMessageFilter::Send), + this, message)); return true; } @@ -78,22 +76,19 @@ void CefBrowserMessageFilter::OnGetNewRenderThreadInfo( app->GetBrowserProcessHandler(); if (handler.get()) { CefRefPtr listValuePtr( - new CefListValueImpl(¶ms->extra_info, false, false)); + new CefListValueImpl(¶ms->extra_info, false, false)); handler->OnRenderProcessThreadCreated(listValuePtr.get()); listValuePtr->Detach(NULL); } } } -void CefBrowserMessageFilter::OnGetNewBrowserInfo( - int render_view_routing_id, - int render_frame_routing_id, - IPC::Message* reply_msg) { +void CefBrowserMessageFilter::OnGetNewBrowserInfo(int render_view_routing_id, + int render_frame_routing_id, + IPC::Message* reply_msg) { if (render_process_id_ != content::ChildProcessHost::kInvalidUniqueID) { CefBrowserInfoManager::GetInstance()->OnGetNewBrowserInfo( - render_process_id_, - render_view_routing_id, - render_frame_routing_id, + render_process_id_, render_view_routing_id, render_frame_routing_id, reply_msg); } else { delete reply_msg; @@ -102,9 +97,8 @@ void CefBrowserMessageFilter::OnGetNewBrowserInfo( void CefBrowserMessageFilter::OnFrameFocused(int32_t render_frame_routing_id) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBrowserMessageFilter::OnFrameFocused, this, - render_frame_routing_id)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserMessageFilter::OnFrameFocused, + this, render_frame_routing_id)); return; } diff --git a/libcef/browser/browser_message_filter.h b/libcef/browser/browser_message_filter.h index 01942672b..ad4e82812 100644 --- a/libcef/browser/browser_message_filter.h +++ b/libcef/browser/browser_message_filter.h @@ -36,10 +36,9 @@ class CefBrowserMessageFilter : public IPC::MessageFilter { // Message handlers. void OnGetNewRenderThreadInfo( CefProcessHostMsg_GetNewRenderThreadInfo_Params* params); - void OnGetNewBrowserInfo( - int render_view_routing_id, - int render_frame_routing_id, - IPC::Message* reply_msg); + void OnGetNewBrowserInfo(int render_view_routing_id, + int render_frame_routing_id, + IPC::Message* reply_msg); void OnFrameFocused(int32_t render_frame_routing_id); int render_process_id_; @@ -47,5 +46,4 @@ class CefBrowserMessageFilter : public IPC::MessageFilter { DISALLOW_COPY_AND_ASSIGN(CefBrowserMessageFilter); }; - #endif // CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_FILTER_H_ diff --git a/libcef/browser/browser_message_loop.cc b/libcef/browser/browser_message_loop.cc index 9f7351ae2..e287c3d3e 100644 --- a/libcef/browser/browser_message_loop.cc +++ b/libcef/browser/browser_message_loop.cc @@ -21,9 +21,7 @@ class MessagePumpExternal : public base::MessagePump { public: MessagePumpExternal(float max_time_slice, CefRefPtr handler) - : max_time_slice_(max_time_slice), - handler_(handler) { - } + : max_time_slice_(max_time_slice), handler_(handler) {} void Run(Delegate* delegate) override { base::TimeTicks start = base::TimeTicks::Now(); @@ -42,12 +40,9 @@ class MessagePumpExternal : public base::MessagePump { } } - void Quit() override { - } + void Quit() override {} - void ScheduleWork() override { - handler_->OnScheduleMessagePumpWork(0); - } + void ScheduleWork() override { handler_->OnScheduleMessagePumpWork(0); } void ScheduleDelayedWork(const base::TimeTicks& delayed_work_time) override { const base::TimeDelta& delta = delayed_work_time - base::TimeTicks::Now(); @@ -68,7 +63,7 @@ class MessagePumpExternal : public base::MessagePump { // We are using an external timer, so we don't have any action based on the // returned next delayed work time. base::TimeTicks next_time; - did_delayed_work = delegate->DoDelayedWork(&next_time); + did_delayed_work = delegate->DoDelayedWork(&next_time); if (!did_work && !did_delayed_work) { did_idle_work = delegate->DoIdleWork(); @@ -103,12 +98,11 @@ std::unique_ptr CreatePump() { } // namespace CefBrowserMessageLoop::CefBrowserMessageLoop() - : base::MessageLoopForUI(CreatePump()) { + : base::MessageLoopForUI(CreatePump()) { BindToCurrentThread(); } -CefBrowserMessageLoop::~CefBrowserMessageLoop() { -} +CefBrowserMessageLoop::~CefBrowserMessageLoop() {} // static CefBrowserMessageLoop* CefBrowserMessageLoop::current() { diff --git a/libcef/browser/browser_platform_delegate.cc b/libcef/browser/browser_platform_delegate.cc index 765818e7e..c247d7d31 100644 --- a/libcef/browser/browser_platform_delegate.cc +++ b/libcef/browser/browser_platform_delegate.cc @@ -12,9 +12,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" -CefBrowserPlatformDelegate::CefBrowserPlatformDelegate() - : browser_(nullptr) { -} +CefBrowserPlatformDelegate::CefBrowserPlatformDelegate() : browser_(nullptr) {} CefBrowserPlatformDelegate::~CefBrowserPlatformDelegate() { DCHECK(!browser_); @@ -27,8 +25,7 @@ void CefBrowserPlatformDelegate::CreateViewForWebContents( } void CefBrowserPlatformDelegate::WebContentsCreated( - content::WebContents* web_contents) { -} + content::WebContents* web_contents) {} void CefBrowserPlatformDelegate::RenderViewCreated( content::RenderViewHost* render_view_host) { @@ -43,11 +40,9 @@ void CefBrowserPlatformDelegate::BrowserCreated(CefBrowserHostImpl* browser) { browser_ = browser; } -void CefBrowserPlatformDelegate::NotifyBrowserCreated() { -} +void CefBrowserPlatformDelegate::NotifyBrowserCreated() {} -void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() { -} +void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() {} void CefBrowserPlatformDelegate::BrowserDestroyed(CefBrowserHostImpl* browser) { DCHECK(browser_ && browser_ == browser); @@ -80,18 +75,15 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated( CefRefPtr client, content::WebContents* new_web_contents, CefBrowserPlatformDelegate* new_platform_delegate, - bool is_devtools) { -} + bool is_devtools) {} void CefBrowserPlatformDelegate::PopupBrowserCreated( CefBrowserHostImpl* new_browser, - bool is_devtools) { -} + bool is_devtools) {} void CefBrowserPlatformDelegate::SendCaptureLostEvent() { - content::RenderWidgetHostImpl* widget = - content::RenderWidgetHostImpl::From( - browser_->web_contents()->GetRenderViewHost()->GetWidget()); + content::RenderWidgetHostImpl* widget = content::RenderWidgetHostImpl::From( + browser_->web_contents()->GetRenderViewHost()->GetWidget()); if (widget) widget->LostCapture(); } @@ -104,17 +96,16 @@ void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() { host->NotifyMoveOrResizeStarted(); } -void CefBrowserPlatformDelegate::SizeTo(int width, int height) { -} +void CefBrowserPlatformDelegate::SizeTo(int width, int height) {} #endif std::unique_ptr - CefBrowserPlatformDelegate::CreateFileDialogRunner() { +CefBrowserPlatformDelegate::CreateFileDialogRunner() { return nullptr; } std::unique_ptr - CefBrowserPlatformDelegate::CreateJavaScriptDialogRunner() { +CefBrowserPlatformDelegate::CreateJavaScriptDialogRunner() { return nullptr; } @@ -134,7 +125,8 @@ void CefBrowserPlatformDelegate::SetWindowlessFrameRate(int frame_rate) { NOTREACHED(); } -void CefBrowserPlatformDelegate::ImeSetComposition(const CefString& text, +void CefBrowserPlatformDelegate::ImeSetComposition( + const CefString& text, const std::vector& underlines, const CefRange& replacement_range, const CefRange& selection_range) { @@ -193,7 +185,8 @@ void CefBrowserPlatformDelegate::UpdateDragCursor( } void CefBrowserPlatformDelegate::DragSourceEndedAt( - int x, int y, + int x, + int y, cef_drag_operations_mask_t op) { NOTREACHED(); } diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index 4098afe9a..dbdcbf2c5 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -11,8 +11,8 @@ #include "include/cef_client.h" #include "include/cef_drag_data.h" -#include "include/views/cef_browser_view.h" #include "include/internal/cef_types.h" +#include "include/views/cef_browser_view.h" #include "libcef/browser/browser_host_impl.h" #include "base/callback.h" @@ -64,8 +64,7 @@ class CefBrowserPlatformDelegate { virtual void WebContentsCreated(content::WebContents* web_contents); // Called after the RenderViewHost is created. - virtual void RenderViewCreated( - content::RenderViewHost* render_view_host); + virtual void RenderViewCreated(content::RenderViewHost* render_view_host); // Called after the owning CefBrowserHostImpl is created. Will only be called // a single time per instance. Do not send any client notifications from this @@ -79,7 +78,7 @@ class CefBrowserPlatformDelegate { // Send any notifications related to browser destruction. Called before // BrowserDestroyed(). virtual void NotifyBrowserDestroyed(); - + // Called before the owning CefBrowserHostImpl is destroyed. Will only be // called a single time per instance. All references to the CefBrowserHostImpl // and WebContents should be cleared when this method is called. Do not send @@ -98,7 +97,7 @@ class CefBrowserPlatformDelegate { // Return the OS handle for the window that hosts the browser. For windowed // rendering this will return the most immediate parent window handle. For // windowless rendering this will return the parent window handle specified by - // the client, which may be NULL. May be called on multiple threads. + // the client, which may be NULL. May be called on multiple threads. virtual CefWindowHandle GetHostWindowHandle() const = 0; #if defined(USE_AURA) @@ -130,9 +129,8 @@ class CefBrowserPlatformDelegate { // CefLifeSpanHandler::OnAfterCreated() for the popup browser. It is safe to // make the new browser visible in this callback (for example, add the browser // to a window and show it). - virtual void PopupBrowserCreated( - CefBrowserHostImpl* new_browser, - bool is_devtools); + virtual void PopupBrowserCreated(CefBrowserHostImpl* new_browser, + bool is_devtools); // Returns the background color for the browser. The alpha component will be // either SK_AlphaTRANSPARENT or SK_AlphaOPAQUE (e.g. fully transparent or @@ -187,13 +185,15 @@ class CefBrowserPlatformDelegate { virtual void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const = 0; + bool mouseUp, + int clickCount) const = 0; virtual void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const = 0; virtual void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const = 0; + int deltaX, + int deltaY) const = 0; // Returns the OS event handle, if any, associated with |event|. virtual CefEventHandle GetEventHandle( @@ -203,7 +203,8 @@ class CefBrowserPlatformDelegate { virtual std::unique_ptr CreateFileDialogRunner(); // Create the platform-specific JavaScript dialog runner. - virtual std::unique_ptr CreateJavaScriptDialogRunner(); + virtual std::unique_ptr + CreateJavaScriptDialogRunner(); // Create the platform-specific menu runner. virtual std::unique_ptr CreateMenuRunner() = 0; @@ -245,22 +246,20 @@ class CefBrowserPlatformDelegate { // Drag/drop-related callbacks. See documentation in CefRenderHandler. Only // used with windowless rendering. virtual void DragTargetDragEnter(CefRefPtr drag_data, - const CefMouseEvent& event, - cef_drag_operations_mask_t allowed_ops); + const CefMouseEvent& event, + cef_drag_operations_mask_t allowed_ops); virtual void DragTargetDragOver(const CefMouseEvent& event, cef_drag_operations_mask_t allowed_ops); virtual void DragTargetDragLeave(); virtual void DragTargetDrop(const CefMouseEvent& event); - virtual void StartDragging( - const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, - content::RenderWidgetHostImpl* source_rwh); + virtual void StartDragging(const content::DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const content::DragEventSourceInfo& event_info, + content::RenderWidgetHostImpl* source_rwh); virtual void UpdateDragCursor(blink::WebDragOperation operation); - virtual void DragSourceEndedAt(int x, int y, - cef_drag_operations_mask_t op); + virtual void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op); virtual void DragSourceSystemDragEnded(); virtual void AccessibilityEventReceived( const std::vector& eventData); @@ -276,7 +275,7 @@ class CefBrowserPlatformDelegate { static int TranslateModifiers(uint32 cef_modifiers); - CefBrowserHostImpl *browser_; // Not owned by this object. + CefBrowserHostImpl* browser_; // Not owned by this object. private: DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate); diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc index c7fb11e07..f7bae8418 100644 --- a/libcef/browser/browser_platform_delegate_create.cc +++ b/libcef/browser/browser_platform_delegate_create.cc @@ -67,8 +67,7 @@ std::unique_ptr CefBrowserPlatformDelegate::Create( const bool is_windowless = create_params.window_info && create_params.window_info->windowless_rendering_enabled && - create_params.client && - create_params.client->GetRenderHandler().get(); + create_params.client && create_params.client->GetRenderHandler().get(); const SkColor background_color = CefContext::Get()->GetBackgroundColor( &create_params.settings, is_windowless ? STATE_ENABLED : STATE_DISABLED); diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index 6fd73dd25..297fd9c15 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -45,7 +45,8 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate { int64 total, int64_t current_network_bytes) override; void OnURLFetchUploadProgress(const net::URLFetcher* source, - int64 current, int64 total) override; + int64 current, + int64 total) override; private: // The context_ pointer will outlive this object. @@ -53,15 +54,12 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate { int request_flags_; }; -class NET_EXPORT CefURLFetcherResponseWriter : - public net::URLFetcherResponseWriter { +class CefURLFetcherResponseWriter : public net::URLFetcherResponseWriter { public: CefURLFetcherResponseWriter( CefRefPtr url_request, scoped_refptr task_runner) - : url_request_(url_request), - task_runner_(task_runner) { - } + : url_request_(url_request), task_runner_(task_runner) {} // net::URLFetcherResponseWriter methods. int Initialize(const net::CompletionCallback& callback) override { @@ -72,7 +70,8 @@ class NET_EXPORT CefURLFetcherResponseWriter : int num_bytes, const net::CompletionCallback& callback) override { if (url_request_.get()) { - task_runner_->PostTask(FROM_HERE, + task_runner_->PostTask( + FROM_HERE, base::Bind(&CefURLFetcherResponseWriter::WriteOnClientThread, url_request_, scoped_refptr(buffer), num_bytes, callback, @@ -99,14 +98,14 @@ class NET_EXPORT CefURLFetcherResponseWriter : if (client.get()) client->OnDownloadData(url_request.get(), buffer->data(), num_bytes); - source_message_loop_proxy->PostTask(FROM_HERE, + source_message_loop_proxy->PostTask( + FROM_HERE, base::Bind(&CefURLFetcherResponseWriter::ContinueOnSourceThread, num_bytes, callback)); } - static void ContinueOnSourceThread( - int num_bytes, - const net::CompletionCallback& callback) { + static void ContinueOnSourceThread(int num_bytes, + const net::CompletionCallback& callback) { callback.Run(num_bytes); } @@ -123,7 +122,6 @@ base::SupportsUserData::Data* CreateURLRequestUserData( } // namespace - // CefBrowserURLRequest::Context ---------------------------------------------- class CefBrowserURLRequest::Context @@ -133,15 +131,15 @@ class CefBrowserURLRequest::Context CefRefPtr request, CefRefPtr client, CefRefPtr request_context) - : url_request_(url_request), - request_(request), - client_(client), - request_context_(request_context), - task_runner_(base::MessageLoop::current()->task_runner()), - status_(UR_IO_PENDING), - error_code_(ERR_NONE), - upload_data_size_(0), - got_upload_progress_complete_(false) { + : url_request_(url_request), + request_(request), + client_(client), + request_context_(request_context), + task_runner_(base::MessageLoop::current()->task_runner()), + status_(UR_IO_PENDING), + error_code_(ERR_NONE), + upload_data_size_(0), + got_upload_progress_complete_(false) { // Mark the request as read-only. static_cast(request_.get())->SetReadOnly(true); } @@ -175,12 +173,11 @@ class CefBrowserURLRequest::Context } BrowserThread::PostTaskAndReply( - BrowserThread::UI, - FROM_HERE, - base::Bind(&CefBrowserURLRequest::Context::GetRequestContextOnUIThread, - this), - base::Bind(&CefBrowserURLRequest::Context::ContinueOnOriginatingThread, - this, url, request_type)); + BrowserThread::UI, FROM_HERE, + base::Bind(&CefBrowserURLRequest::Context::GetRequestContextOnUIThread, + this), + base::Bind(&CefBrowserURLRequest::Context::ContinueOnOriginatingThread, + this, url, request_type)); return true; } @@ -211,14 +208,14 @@ class CefBrowserURLRequest::Context int request_flags = request_->GetFlags(); fetcher_delegate_.reset(new CefURLFetcherDelegate(this, request_flags)); - fetcher_ = net::URLFetcher::Create(url, request_type, - fetcher_delegate_.get()); + fetcher_ = + net::URLFetcher::Create(url, request_type, fetcher_delegate_.get()); DCHECK(url_request_getter_.get()); fetcher_->SetRequestContext(url_request_getter_.get()); - static_cast(request_.get())->Get(*fetcher_, - upload_data_size_); + static_cast(request_.get()) + ->Get(*fetcher_, upload_data_size_); fetcher_->SetURLRequestUserData( CefURLRequestUserData::kUserDataKey, @@ -277,7 +274,7 @@ class CefBrowserURLRequest::Context error_code_ = static_cast(status.error()); - if(!response_.get()) + if (!response_.get()) OnResponse(); } @@ -295,7 +292,7 @@ class CefBrowserURLRequest::Context DCHECK(CalledOnValidThread()); DCHECK(url_request_.get()); - if(!response_.get()) + if (!response_.get()) OnResponse(); NotifyUploadProgressIfNecessary(); @@ -307,11 +304,11 @@ class CefBrowserURLRequest::Context DCHECK(CalledOnValidThread()); DCHECK(url_request_.get()); - if(!response_.get()) + if (!response_.get()) OnResponse(); client_->OnDownloadData(url_request_.get(), download_data->c_str(), - download_data->length()); + download_data->length()); } void OnUploadProgress(int64 current, int64 total) { @@ -350,7 +347,7 @@ class CefBrowserURLRequest::Context } void OnResponse() { - if (fetcher_.get()) { + if (fetcher_.get()) { response_ = new CefResponseImpl(); CefResponseImpl* responseImpl = static_cast(response_.get()); @@ -380,25 +377,22 @@ class CefBrowserURLRequest::Context scoped_refptr url_request_getter_; }; - // CefURLFetcherDelegate ------------------------------------------------------ namespace { CefURLFetcherDelegate::CefURLFetcherDelegate( - CefBrowserURLRequest::Context* context, int request_flags) - : context_(context), - request_flags_(request_flags) { -} + CefBrowserURLRequest::Context* context, + int request_flags) + : context_(context), request_flags_(request_flags) {} -CefURLFetcherDelegate::~CefURLFetcherDelegate() { -} +CefURLFetcherDelegate::~CefURLFetcherDelegate() {} -void CefURLFetcherDelegate::OnURLFetchComplete( - const net::URLFetcher* source) { +void CefURLFetcherDelegate::OnURLFetchComplete(const net::URLFetcher* source) { // Complete asynchronously so as not to delete the URLFetcher while it's still // in the call stack. - base::MessageLoop::current()->task_runner()->PostTask(FROM_HERE, + base::MessageLoop::current()->task_runner()->PostTask( + FROM_HERE, base::Bind(&CefBrowserURLRequest::Context::OnComplete, context_)); } @@ -412,14 +406,14 @@ void CefURLFetcherDelegate::OnURLFetchDownloadProgress( void CefURLFetcherDelegate::OnURLFetchUploadProgress( const net::URLFetcher* source, - int64 current, int64 total) { + int64 current, + int64 total) { if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS) context_->OnUploadProgress(current, total); } } // namespace - // CefBrowserURLRequest ------------------------------------------------------- CefBrowserURLRequest::CefBrowserURLRequest( @@ -429,8 +423,7 @@ CefBrowserURLRequest::CefBrowserURLRequest( context_ = new Context(this, request, client, request_context); } -CefBrowserURLRequest::~CefBrowserURLRequest() { -} +CefBrowserURLRequest::~CefBrowserURLRequest() {} bool CefBrowserURLRequest::Start() { if (!VerifyContext()) diff --git a/libcef/browser/browser_urlrequest_impl.h b/libcef/browser/browser_urlrequest_impl.h index 706cdf706..6b465d16e 100644 --- a/libcef/browser/browser_urlrequest_impl.h +++ b/libcef/browser/browser_urlrequest_impl.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_BROWSER_URLREQUEST_IMPL_H_ #include "include/cef_urlrequest.h" + #include "base/memory/ref_counted.h" class CefBrowserURLRequest : public CefURLRequest { diff --git a/libcef/browser/browser_util.cc b/libcef/browser/browser_util.cc index 0575fea66..fbe292ed3 100644 --- a/libcef/browser/browser_util.cc +++ b/libcef/browser/browser_util.cc @@ -48,8 +48,7 @@ bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event, return true; } -bool GetCefKeyEvent(const ui::KeyEvent& event, - CefKeyEvent& cef_event) { +bool GetCefKeyEvent(const ui::KeyEvent& event, CefKeyEvent& cef_event) { content::NativeWebKeyboardEvent native_event(event); return GetCefKeyEvent(native_event, cef_event); } diff --git a/libcef/browser/browser_util.h b/libcef/browser/browser_util.h index fc95d97da..74c36f146 100644 --- a/libcef/browser/browser_util.h +++ b/libcef/browser/browser_util.h @@ -23,8 +23,7 @@ bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event, CefKeyEvent& cef_event); // Convert a ui::KeyEvent to a CefKeyEvent. -bool GetCefKeyEvent(const ui::KeyEvent& event, - CefKeyEvent& cef_event); +bool GetCefKeyEvent(const ui::KeyEvent& event, CefKeyEvent& cef_event); } // namespace browser_util diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 00a440837..c3186af67 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -18,10 +18,10 @@ #include "ui/message_center/message_center.h" ChromeBrowserProcessStub::ChromeBrowserProcessStub() - : initialized_(false), - context_initialized_(false), - shutdown_(false), - locale_("en-US") { + : initialized_(false), + context_initialized_(false), + shutdown_(false), + locale_("en-US") { chrome::SetBrowserContextIncognitoHelper(this); } @@ -88,7 +88,7 @@ void ChromeBrowserProcessStub::EndSession() { }; metrics_services_manager::MetricsServicesManager* - ChromeBrowserProcessStub::GetMetricsServicesManager() { +ChromeBrowserProcessStub::GetMetricsServicesManager() { NOTREACHED(); return NULL; } @@ -124,18 +124,17 @@ ProfileManager* ChromeBrowserProcessStub::profile_manager() { PrefService* ChromeBrowserProcessStub::local_state() { DCHECK(context_initialized_); - return profile_manager_->GetLastUsedProfile( - profile_manager_->user_data_dir())->GetPrefs(); + return profile_manager_->GetLastUsedProfile(profile_manager_->user_data_dir()) + ->GetPrefs(); } net::URLRequestContextGetter* - ChromeBrowserProcessStub::system_request_context() { +ChromeBrowserProcessStub::system_request_context() { NOTREACHED(); return NULL; } -variations::VariationsService* - ChromeBrowserProcessStub::variations_service() { +variations::VariationsService* ChromeBrowserProcessStub::variations_service() { NOTREACHED(); return NULL; } @@ -146,7 +145,7 @@ BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() { } extensions::EventRouterForwarder* - ChromeBrowserProcessStub::extension_event_router_forwarder() { +ChromeBrowserProcessStub::extension_event_router_forwarder() { DCHECK(context_initialized_); return event_router_forwarder_.get(); } @@ -157,7 +156,7 @@ NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() { } NotificationPlatformBridge* - ChromeBrowserProcessStub::notification_platform_bridge() { +ChromeBrowserProcessStub::notification_platform_bridge() { NOTREACHED(); return NULL; } @@ -168,7 +167,7 @@ message_center::MessageCenter* ChromeBrowserProcessStub::message_center() { } policy::BrowserPolicyConnector* - ChromeBrowserProcessStub::browser_policy_connector() { +ChromeBrowserProcessStub::browser_policy_connector() { NOTREACHED(); return NULL; } @@ -214,24 +213,24 @@ printing::PrintJobManager* ChromeBrowserProcessStub::print_job_manager() { } printing::PrintPreviewDialogController* - ChromeBrowserProcessStub::print_preview_dialog_controller() { +ChromeBrowserProcessStub::print_preview_dialog_controller() { NOTREACHED(); return NULL; } printing::BackgroundPrintingManager* - ChromeBrowserProcessStub::background_printing_manager() { +ChromeBrowserProcessStub::background_printing_manager() { NOTREACHED(); return NULL; } IntranetRedirectDetector* - ChromeBrowserProcessStub::intranet_redirect_detector() { +ChromeBrowserProcessStub::intranet_redirect_detector() { NOTREACHED(); return NULL; } -const std::string &ChromeBrowserProcessStub::GetApplicationLocale() { +const std::string& ChromeBrowserProcessStub::GetApplicationLocale() { DCHECK(!locale_.empty()); return locale_; } @@ -256,7 +255,7 @@ BackgroundModeManager* ChromeBrowserProcessStub::background_mode_manager() { } void ChromeBrowserProcessStub::set_background_mode_manager_for_test( - std::unique_ptr manager) { + std::unique_ptr manager) { NOTREACHED(); } @@ -266,26 +265,25 @@ StatusTray* ChromeBrowserProcessStub::status_tray() { } safe_browsing::SafeBrowsingService* - ChromeBrowserProcessStub::safe_browsing_service() { +ChromeBrowserProcessStub::safe_browsing_service() { NOTREACHED(); return NULL; } safe_browsing::ClientSideDetectionService* - ChromeBrowserProcessStub::safe_browsing_detection_service() { +ChromeBrowserProcessStub::safe_browsing_detection_service() { NOTREACHED(); return NULL; } subresource_filter::ContentRulesetService* - ChromeBrowserProcessStub::subresource_filter_ruleset_service() { +ChromeBrowserProcessStub::subresource_filter_ruleset_service() { NOTREACHED(); return NULL; } #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) -void ChromeBrowserProcessStub::StartAutoupdateTimer() { -} +void ChromeBrowserProcessStub::StartAutoupdateTimer() {} #endif net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() { @@ -294,7 +292,7 @@ net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() { } component_updater::ComponentUpdateService* - ChromeBrowserProcessStub::component_updater() { +ChromeBrowserProcessStub::component_updater() { NOTREACHED(); return NULL; } @@ -305,19 +303,19 @@ CRLSetFetcher* ChromeBrowserProcessStub::crl_set_fetcher() { } component_updater::PnaclComponentInstaller* - ChromeBrowserProcessStub::pnacl_component_installer() { +ChromeBrowserProcessStub::pnacl_component_installer() { NOTREACHED(); return NULL; } component_updater::SupervisedUserWhitelistInstaller* - ChromeBrowserProcessStub::supervised_user_whitelist_installer() { +ChromeBrowserProcessStub::supervised_user_whitelist_installer() { NOTREACHED(); return NULL; } MediaFileSystemRegistry* - ChromeBrowserProcessStub::media_file_system_registry() { +ChromeBrowserProcessStub::media_file_system_registry() { NOTREACHED(); return NULL; } @@ -335,7 +333,7 @@ WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() { #endif network_time::NetworkTimeTracker* - ChromeBrowserProcessStub::network_time_tracker() { +ChromeBrowserProcessStub::network_time_tracker() { NOTREACHED(); return NULL; } diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index bc767d8e8..63e403aae 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -12,10 +12,10 @@ #include #include +#include "base/compiler_specific.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "base/compiler_specific.h" #include "media/media_features.h" class ChromeProfileManagerStub; @@ -24,6 +24,7 @@ class BackgroundModeManager { public: BackgroundModeManager(); virtual ~BackgroundModeManager(); + private: DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); }; @@ -41,8 +42,8 @@ class ChromeBrowserProcessStub : public BrowserProcess, // BrowserProcess implementation. void ResourceDispatcherHostCreated() override; void EndSession() override; - metrics_services_manager::MetricsServicesManager* - GetMetricsServicesManager() override; + metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() + override; metrics::MetricsService* metrics_service() override; rappor::RapporServiceImpl* rappor_service() override; IOThread* io_thread() override; @@ -53,8 +54,7 @@ class ChromeBrowserProcessStub : public BrowserProcess, net::URLRequestContextGetter* system_request_context() override; variations::VariationsService* variations_service() override; BrowserProcessPlatformPart* platform_part() override; - extensions::EventRouterForwarder* - extension_event_router_forwarder() override; + extensions::EventRouterForwarder* extension_event_router_forwarder() override; NotificationUIManager* notification_ui_manager() override; NotificationPlatformBridge* notification_platform_bridge() override; message_center::MessageCenter* message_center() override; @@ -68,10 +68,9 @@ class ChromeBrowserProcessStub : public BrowserProcess, void CreateDevToolsAutoOpener() override; bool IsShuttingDown() override; printing::PrintJobManager* print_job_manager() override; - printing::PrintPreviewDialogController* - print_preview_dialog_controller() override; - printing::BackgroundPrintingManager* - background_printing_manager() override; + printing::PrintPreviewDialogController* print_preview_dialog_controller() + override; + printing::BackgroundPrintingManager* background_printing_manager() override; IntranetRedirectDetector* intranet_redirect_detector() override; const std::string& GetApplicationLocale() override; void SetApplicationLocale(const std::string& locale) override; @@ -82,33 +81,31 @@ class ChromeBrowserProcessStub : public BrowserProcess, std::unique_ptr manager) override; StatusTray* status_tray() override; safe_browsing::SafeBrowsingService* safe_browsing_service() override; - safe_browsing::ClientSideDetectionService* - safe_browsing_detection_service() override; + safe_browsing::ClientSideDetectionService* safe_browsing_detection_service() + override; subresource_filter::ContentRulesetService* - subresource_filter_ruleset_service() override; + subresource_filter_ruleset_service() override; #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) void StartAutoupdateTimer() override; #endif net_log::ChromeNetLog* net_log() override; - component_updater::ComponentUpdateService* - component_updater() override; + component_updater::ComponentUpdateService* component_updater() override; CRLSetFetcher* crl_set_fetcher() override; - component_updater::PnaclComponentInstaller* - pnacl_component_installer() override; + component_updater::PnaclComponentInstaller* pnacl_component_installer() + override; component_updater::SupervisedUserWhitelistInstaller* - supervised_user_whitelist_installer() override; - MediaFileSystemRegistry* - media_file_system_registry() override; + supervised_user_whitelist_installer() override; + MediaFileSystemRegistry* media_file_system_registry() override; bool created_local_state() const override; #if BUILDFLAG(ENABLE_WEBRTC) WebRtcLogUploader* webrtc_log_uploader() override; #endif network_time::NetworkTimeTracker* network_time_tracker() override; gcm::GCMDriver* gcm_driver() override; - shell_integration::DefaultWebClientState - CachedDefaultWebClientState() override; + shell_integration::DefaultWebClientState CachedDefaultWebClientState() + override; memory::TabManager* GetTabManager() override; physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() override; diff --git a/libcef/browser/chrome_profile_manager_stub.cc b/libcef/browser/chrome_profile_manager_stub.cc index 1c3cde34b..8e476584c 100644 --- a/libcef/browser/chrome_profile_manager_stub.cc +++ b/libcef/browser/chrome_profile_manager_stub.cc @@ -28,11 +28,9 @@ CefBrowserContextImpl* GetActiveBrowserContext() { } // namespace ChromeProfileManagerStub::ChromeProfileManagerStub() - : ProfileManager(base::FilePath()) { -} + : ProfileManager(base::FilePath()) {} -ChromeProfileManagerStub::~ChromeProfileManagerStub() { -} +ChromeProfileManagerStub::~ChromeProfileManagerStub() {} Profile* ChromeProfileManagerStub::GetProfile( const base::FilePath& profile_dir) { @@ -54,8 +52,7 @@ bool ChromeProfileManagerStub::IsValidProfile(const void* profile) { if (!profile) return false; return !!CefBrowserContextImpl::GetForContext( - reinterpret_cast( - const_cast(profile))); + reinterpret_cast(const_cast(profile))); } Profile* ChromeProfileManagerStub::GetLastUsedProfile( diff --git a/libcef/browser/chrome_profile_stub.cc b/libcef/browser/chrome_profile_stub.cc index 1844e145b..6afa417a1 100644 --- a/libcef/browser/chrome_profile_stub.cc +++ b/libcef/browser/chrome_profile_stub.cc @@ -5,11 +5,9 @@ #include "libcef/browser/chrome_profile_stub.h" -ChromeProfileStub::ChromeProfileStub() { -} +ChromeProfileStub::ChromeProfileStub() {} -ChromeProfileStub::~ChromeProfileStub() { -} +ChromeProfileStub::~ChromeProfileStub() {} scoped_refptr ChromeProfileStub::GetIOTaskRunner() { NOTREACHED(); @@ -57,7 +55,7 @@ bool ChromeProfileStub::IsLegacySupervised() const { } ExtensionSpecialStoragePolicy* - ChromeProfileStub::GetExtensionSpecialStoragePolicy() { +ChromeProfileStub::GetExtensionSpecialStoragePolicy() { NOTREACHED(); return NULL; } @@ -68,7 +66,7 @@ PrefService* ChromeProfileStub::GetOffTheRecordPrefs() { } net::URLRequestContextGetter* - ChromeProfileStub::GetRequestContextForExtensions() { +ChromeProfileStub::GetRequestContextForExtensions() { // TODO(cef): Consider creating a separate context for extensions to match // Chrome behavior. return GetRequestContext(); @@ -110,7 +108,7 @@ chrome_browser_net::Predictor* ChromeProfileStub::GetNetworkPredictor() { } DevToolsNetworkControllerHandle* - ChromeProfileStub::GetDevToolsNetworkControllerHandle() { +ChromeProfileStub::GetDevToolsNetworkControllerHandle() { NOTREACHED(); return NULL; } @@ -126,8 +124,7 @@ GURL ChromeProfileStub::GetHomePage() { return GURL(); } -bool ChromeProfileStub::WasCreatedByVersionOrLater( - const std::string& version) { +bool ChromeProfileStub::WasCreatedByVersionOrLater(const std::string& version) { NOTREACHED(); return false; } diff --git a/libcef/browser/chrome_profile_stub.h b/libcef/browser/chrome_profile_stub.h index 723f9c986..e4b08bed9 100644 --- a/libcef/browser/chrome_profile_stub.h +++ b/libcef/browser/chrome_profile_stub.h @@ -30,8 +30,7 @@ class ChromeProfileStub : public Profile { bool IsSupervised() const override; bool IsChild() const override; bool IsLegacySupervised() const override; - ExtensionSpecialStoragePolicy* - GetExtensionSpecialStoragePolicy() override; + ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; PrefService* GetOffTheRecordPrefs() override; net::URLRequestContextGetter* GetRequestContextForExtensions() override; net::SSLConfigService* GetSSLConfigService() override; @@ -41,8 +40,8 @@ class ChromeProfileStub : public Profile { void set_last_selected_directory(const base::FilePath& path) override; PrefProxyConfigTracker* GetProxyConfigTracker() override; chrome_browser_net::Predictor* GetNetworkPredictor() override; - DevToolsNetworkControllerHandle* - GetDevToolsNetworkControllerHandle() override; + DevToolsNetworkControllerHandle* GetDevToolsNetworkControllerHandle() + override; void ClearNetworkingHistorySince(base::Time time, const base::Closure& completion) override; GURL GetHomePage() override; diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 16462ae6d..e655e8d72 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -8,9 +8,9 @@ #include #include "libcef/browser/browser_context.h" +#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info_manager.h" -#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_main.h" #include "libcef/browser/browser_message_filter.h" #include "libcef/browser/browser_platform_delegate.h" @@ -70,9 +70,9 @@ #include "content/public/common/service_names.mojom.h" #include "content/public/common/storage_quota_params.h" #include "content/public/common/web_preferences.h" -#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extension_message_filter.h" #include "extensions/browser/extension_registry.h" +#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" #include "extensions/browser/io_thread_extension_message_filter.h" #include "extensions/common/constants.h" @@ -111,8 +111,7 @@ class CefQuotaCallbackImpl : public CefRequestCallback { public: explicit CefQuotaCallbackImpl( const content::QuotaPermissionContext::PermissionCallback& callback) - : callback_(callback) { - } + : callback_(callback) {} ~CefQuotaCallbackImpl() { if (!callback_.is_null()) { @@ -120,8 +119,8 @@ class CefQuotaCallbackImpl : public CefRequestCallback { if (CEF_CURRENTLY_ON_IOT()) { RunNow(callback_, false); } else { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefQuotaCallbackImpl::RunNow, callback_, false)); + CEF_POST_TASK(CEF_IOT, base::Bind(&CefQuotaCallbackImpl::RunNow, + callback_, false)); } } } @@ -134,26 +133,23 @@ class CefQuotaCallbackImpl : public CefRequestCallback { } } else { CEF_POST_TASK(CEF_IOT, - base::Bind(&CefQuotaCallbackImpl::Continue, this, allow)); + base::Bind(&CefQuotaCallbackImpl::Continue, this, allow)); } } - void Cancel() override { - Continue(false); - } + void Cancel() override { Continue(false); } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void RunNow( const content::QuotaPermissionContext::PermissionCallback& callback, bool allow) { CEF_REQUIRE_IOT(); - callback.Run(allow ? - content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW : - content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_DISALLOW); + callback.Run( + allow ? content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW + : content::QuotaPermissionContext:: + QUOTA_PERMISSION_RESPONSE_DISALLOW); } content::QuotaPermissionContext::PermissionCallback callback_; @@ -168,8 +164,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback { CallbackType; explicit CefAllowCertificateErrorCallbackImpl(const CallbackType& callback) - : callback_(callback) { - } + : callback_(callback) {} ~CefAllowCertificateErrorCallbackImpl() { if (!callback_.is_null()) { @@ -178,8 +173,8 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback { RunNow(callback_, false); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefAllowCertificateErrorCallbackImpl::RunNow, - callback_, false)); + base::Bind(&CefAllowCertificateErrorCallbackImpl::RunNow, + callback_, false)); } } } @@ -192,24 +187,20 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefAllowCertificateErrorCallbackImpl::Continue, - this, allow)); + base::Bind(&CefAllowCertificateErrorCallbackImpl::Continue, + this, allow)); } } - void Cancel() override { - Continue(false); - } + void Cancel() override { Continue(false); } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void RunNow(const CallbackType& callback, bool allow) { CEF_REQUIRE_UIT(); - callback.Run(allow ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE : - content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); + callback.Run(allow ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE + : content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); } CallbackType callback_; @@ -218,13 +209,12 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback { DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl); }; -class CefSelectClientCertificateCallbackImpl : - public CefSelectClientCertificateCallback { +class CefSelectClientCertificateCallbackImpl + : public CefSelectClientCertificateCallback { public: explicit CefSelectClientCertificateCallbackImpl( std::unique_ptr delegate) - : delegate_(std::move(delegate)) { - } + : delegate_(std::move(delegate)) {} ~CefSelectClientCertificateCallbackImpl() { // If Select has not been called, call it with NULL to continue without any @@ -244,8 +234,8 @@ class CefSelectClientCertificateCallbackImpl : RunNow(std::move(delegate_), cert); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefSelectClientCertificateCallbackImpl::RunNow, - base::Passed(std::move(delegate_)), cert)); + base::Bind(&CefSelectClientCertificateCallbackImpl::RunNow, + base::Passed(std::move(delegate_)), cert)); } } @@ -272,14 +262,12 @@ class CefSelectClientCertificateCallbackImpl : class CefQuotaPermissionContext : public content::QuotaPermissionContext { public: - CefQuotaPermissionContext() { - } + CefQuotaPermissionContext() {} // The callback will be dispatched on the IO thread. - void RequestQuotaPermission( - const content::StorageQuotaParams& params, - int render_process_id, - const PermissionCallback& callback) override { + void RequestQuotaPermission(const content::StorageQuotaParams& params, + int render_process_id, + const PermissionCallback& callback) override { if (params.storage_type != storage::kStorageTypePersistent) { // To match Chrome behavior we only support requesting quota with this // interface for Persistent storage type. @@ -299,10 +287,9 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext { if (handler.get()) { CefRefPtr callbackImpl( new CefQuotaCallbackImpl(callback)); - handled = handler->OnQuotaRequest(browser.get(), - params.origin_url.spec(), - params.requested_size, - callbackImpl.get()); + handled = handler->OnQuotaRequest( + browser.get(), params.origin_url.spec(), params.requested_size, + callbackImpl.get()); if (!handled) callbackImpl->Disconnect(); } @@ -331,8 +318,8 @@ breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( // Uploads will only occur if a non-empty crash URL is specified in // CefMainDelegate::InitCrashReporter. breakpad::CrashHandlerHostLinux* crash_handler = - new breakpad::CrashHandlerHostLinux( - process_type, dumps_path, true /* upload */); + new breakpad::CrashHandlerHostLinux(process_type, dumps_path, + true /* upload */); crash_handler->StartUploaderThread(); return crash_handler; } @@ -408,12 +395,9 @@ bool NavigationOnUIThread( } else { // Create a temporary frame object for navigation of sub-frames that // don't yet exist. - frame = new CefFrameHostImpl(browser.get(), - CefFrameHostImpl::kInvalidFrameId, - false, - CefString(), - CefString(), - parent_frame_id); + frame = new CefFrameHostImpl( + browser.get(), CefFrameHostImpl::kInvalidFrameId, false, + CefString(), CefString(), parent_frame_id); } CefRefPtr request = new CefRequestImpl(); @@ -441,16 +425,13 @@ void FindFrameHostForNavigationHandle( } // namespace - -CefContentBrowserClient::CefContentBrowserClient() - : browser_main_parts_(NULL) { +CefContentBrowserClient::CefContentBrowserClient() : browser_main_parts_(NULL) { plugin_service_filter_.reset(new CefPluginServiceFilter); content::PluginServiceImpl::GetInstance()->SetFilter( plugin_service_filter_.get()); } -CefContentBrowserClient::~CefContentBrowserClient() { -} +CefContentBrowserClient::~CefContentBrowserClient() {} // static CefContentBrowserClient* CefContentBrowserClient::Get() { @@ -481,12 +462,11 @@ void CefContentBrowserClient::RenderProcessWillLaunch( #endif } - host->AddFilter(new CefPluginInfoMessageFilter(id, - static_cast(profile))); + host->AddFilter(new CefPluginInfoMessageFilter( + id, static_cast(profile))); if (extensions::ExtensionsEnabled()) { - host->AddFilter( - new extensions::ExtensionMessageFilter(id, profile)); + host->AddFilter(new extensions::ExtensionMessageFilter(id, profile)); host->AddFilter( new extensions::IOThreadExtensionMessageFilter(id, profile)); host->AddFilter( @@ -499,8 +479,8 @@ void CefContentBrowserClient::RenderProcessWillLaunch( host->RemoveObserver(CefBrowserInfoManager::GetInstance()); host->AddObserver(CefBrowserInfoManager::GetInstance()); - host->Send(new CefProcessMsg_SetIsIncognitoProcess( - profile->IsOffTheRecord())); + host->Send( + new CefProcessMsg_SetIsIncognitoProcess(profile->IsOffTheRecord())); } bool CefContentBrowserClient::ShouldUseProcessPerSite( @@ -556,16 +536,14 @@ void CefContentBrowserClient::SiteInstanceGotProcess( static_cast(site_instance->GetBrowserContext()); extensions::ProcessMap::Get(browser_context) - ->Insert(extension->id(), - site_instance->GetProcess()->GetID(), + ->Insert(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); - CEF_POST_TASK(CEF_IOT, - base::Bind(&extensions::InfoMap::RegisterExtensionProcess, - browser_context->extension_system()->info_map(), - extension->id(), - site_instance->GetProcess()->GetID(), - site_instance->GetId())); + CEF_POST_TASK( + CEF_IOT, base::Bind(&extensions::InfoMap::RegisterExtensionProcess, + browser_context->extension_system()->info_map(), + extension->id(), site_instance->GetProcess()->GetID(), + site_instance->GetId())); } void CefContentBrowserClient::SiteInstanceDeleting( @@ -586,20 +564,18 @@ void CefContentBrowserClient::SiteInstanceDeleting( static_cast(site_instance->GetBrowserContext()); extensions::ProcessMap::Get(browser_context) - ->Remove(extension->id(), - site_instance->GetProcess()->GetID(), + ->Remove(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); - CEF_POST_TASK(CEF_IOT, - base::Bind(&extensions::InfoMap::UnregisterExtensionProcess, - browser_context->extension_system()->info_map(), - extension->id(), - site_instance->GetProcess()->GetID(), - site_instance->GetId())); + CEF_POST_TASK( + CEF_IOT, base::Bind(&extensions::InfoMap::UnregisterExtensionProcess, + browser_context->extension_system()->info_map(), + extension->id(), site_instance->GetProcess()->GetID(), + site_instance->GetId())); } -std::unique_ptr -CefContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { +std::unique_ptr CefContentBrowserClient::GetServiceManifestOverlay( + base::StringPiece name) { int id = -1; if (name == content::mojom::kBrowserServiceName) id = IDR_CEF_BROWSER_MANIFEST_OVERLAY; @@ -617,9 +593,9 @@ CefContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { } void CefContentBrowserClient::AppendExtraCommandLineSwitches( - base::CommandLine* command_line, int child_process_id) { - const base::CommandLine* browser_cmd = - base::CommandLine::ForCurrentProcess(); + base::CommandLine* command_line, + int child_process_id) { + const base::CommandLine* browser_cmd = base::CommandLine::ForCurrentProcess(); { // Propagate the following switches to all command lines (along with any @@ -647,16 +623,11 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( // Propagate the following switches to the renderer command line (along with // any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { - switches::kDisableExtensions, - switches::kDisablePdfExtension, - switches::kDisableScrollBounce, - switches::kDisableSpellChecking, - switches::kEnableSpeechInput, - switches::kEnableSystemFlash, - switches::kPpapiFlashArgs, - switches::kPpapiFlashPath, - switches::kPpapiFlashVersion, - switches::kUncaughtExceptionStackSize, + switches::kDisableExtensions, switches::kDisablePdfExtension, + switches::kDisableScrollBounce, switches::kDisableSpellChecking, + switches::kEnableSpeechInput, switches::kEnableSystemFlash, + switches::kPpapiFlashArgs, switches::kPpapiFlashPath, + switches::kPpapiFlashVersion, switches::kUncaughtExceptionStackSize, }; command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames, arraysize(kSwitchNames)); @@ -668,9 +639,8 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( content::RenderProcessHost::FromID(child_process_id); content::BrowserContext* browser_context = process ? process->GetBrowserContext() : NULL; - if (browser_context && - extensions::ProcessMap::Get(browser_context)->Contains( - process->GetID())) { + if (browser_context && extensions::ProcessMap::Get(browser_context) + ->Contains(process->GetID())) { command_line->AppendSwitch(extensions::switches::kExtensionProcess); } } @@ -681,8 +651,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( // Propagate the following switches to the zygote command line (along with // any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { - switches::kPpapiFlashPath, - switches::kPpapiFlashVersion, + switches::kPpapiFlashPath, switches::kPpapiFlashVersion, }; command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames, arraysize(kSwitchNames)); @@ -721,7 +690,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( } content::QuotaPermissionContext* - CefContentBrowserClient::CreateQuotaPermissionContext() { +CefContentBrowserClient::CreateQuotaPermissionContext() { return new CefQuotaPermissionContext(); } @@ -741,7 +710,7 @@ content::MediaObserver* CefContentBrowserClient::GetMediaObserver() { } content::SpeechRecognitionManagerDelegate* - CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { +CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnableSpeechInput)) @@ -759,8 +728,8 @@ void CefContentBrowserClient::AllowCertificateError( bool overridable, bool strict_enforcement, bool expired_previous_decision, - const base::Callback< - void(content::CertificateRequestResultType)>& callback) { + const base::Callback& + callback) { CEF_REQUIRE_UIT(); if (resource_type != content::ResourceType::RESOURCE_TYPE_MAIN_FRAME) { @@ -817,9 +786,9 @@ void CefContentBrowserClient::SelectClientCertificate( } CefRequestHandler::X509CertificateList certs; - for (std::vector >::iterator iter = + for (std::vector>::iterator iter = cert_request_info->client_certs.begin(); - iter != cert_request_info->client_certs.end(); iter++) { + iter != cert_request_info->client_certs.end(); iter++) { certs.push_back(new CefX509CertificateImpl(*iter)); } @@ -829,8 +798,7 @@ void CefContentBrowserClient::SelectClientCertificate( bool proceed = handler->OnSelectClientCertificate( browser.get(), cert_request_info->is_proxy, cert_request_info->host_and_port.host(), - cert_request_info->host_and_port.port(), - certs, callbackImpl.get()); + cert_request_info->host_and_port.port(), certs, callbackImpl.get()); if (!proceed && !certs.empty()) { callbackImpl->Select(certs[0]); @@ -899,7 +867,7 @@ void CefContentBrowserClient::DidCreatePpapiPlugin( } content::DevToolsManagerDelegate* - CefContentBrowserClient::GetDevToolsManagerDelegate() { +CefContentBrowserClient::GetDevToolsManagerDelegate() { return new CefDevToolsManagerDelegate(); } @@ -921,9 +889,9 @@ CefContentBrowserClient::CreateThrottlesForNavigation( // comments in content/browser/frame_host/navigation_handle_impl.h. content::WebContents* web_contents = navigation_handle->GetWebContents(); content::RenderFrameHost* parent_frame_host = NULL; - web_contents->ForEachFrame( - base::Bind(FindFrameHostForNavigationHandle, - navigation_handle, &parent_frame_host)); + web_contents->ForEachFrame(base::Bind(FindFrameHostForNavigationHandle, + navigation_handle, + &parent_frame_host)); DCHECK(parent_frame_host); parent_frame_id = parent_frame_host->GetRoutingID(); @@ -961,10 +929,9 @@ void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess( } #endif // defined(OS_POSIX) && !defined(OS_MACOSX) - #if defined(OS_WIN) const wchar_t* CefContentBrowserClient::GetResourceDllName() { - static wchar_t file_path[MAX_PATH+1] = {0}; + static wchar_t file_path[MAX_PATH + 1] = {0}; if (file_path[0] == 0) { // Retrieve the module path (usually libcef.dll). @@ -979,8 +946,7 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() { return file_path; } -bool CefContentBrowserClient::PreSpawnRenderer( - sandbox::TargetPolicy* policy) { +bool CefContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy) { return true; } #endif // defined(OS_WIN) @@ -995,8 +961,8 @@ void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) { policy->RegisterWebSafeScheme(scheme); } -CefRefPtr -CefContentBrowserClient::request_context() const { +CefRefPtr CefContentBrowserClient::request_context() + const { return browser_main_parts_->request_context(); } diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 57a44c576..7081f5923 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -43,8 +43,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { // ContentBrowserClient implementation. content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) override; - void RenderProcessWillLaunch( - content::RenderProcessHost* host) override; + void RenderProcessWillLaunch(content::RenderProcessHost* host) override; bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, const GURL& effective_url) override; bool IsHandledURL(const GURL& url) override; @@ -53,16 +52,15 @@ class CefContentBrowserClient : public content::ContentBrowserClient { std::unique_ptr GetServiceManifestOverlay( base::StringPiece name) override; void AppendExtraCommandLineSwitches(base::CommandLine* command_line, - int child_process_id) override; - content::QuotaPermissionContext* - CreateQuotaPermissionContext() override; + int child_process_id) override; + content::QuotaPermissionContext* CreateQuotaPermissionContext() override; void GetQuotaSettings( content::BrowserContext* context, content::StoragePartition* partition, const storage::OptionalQuotaSettingsCallback& callback) override; content::MediaObserver* GetMediaObserver() override; content::SpeechRecognitionManagerDelegate* - CreateSpeechRecognitionManagerDelegate() override; + CreateSpeechRecognitionManagerDelegate() override; void AllowCertificateError( content::WebContents* web_contents, int cert_error, @@ -72,8 +70,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient { bool overridable, bool strict_enforcement, bool expired_previous_decision, - const base::Callback< - void(content::CertificateRequestResultType)>& callback) override; + const base::Callback& + callback) override; void SelectClientCertificate( content::WebContents* web_contents, net::SSLCertRequestInfo* cert_request_info, @@ -96,12 +94,10 @@ class CefContentBrowserClient : public content::ContentBrowserClient { void ResourceDispatcherHostCreated() override; void OverrideWebkitPrefs(content::RenderViewHost* rvh, content::WebPreferences* prefs) override; - void BrowserURLHandlerCreated( - content::BrowserURLHandler* handler) override; + void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; std::string GetDefaultDownloadName() override; void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; - content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() - override; + content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; std::vector> CreateThrottlesForNavigation( content::NavigationHandle* navigation_handle) override; diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index adf8a21a6..bd4d0e9b1 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -2,13 +2,13 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "libcef/browser/context.h" #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_main.h" #include "libcef/browser/browser_message_loop.h" #include "libcef/browser/chrome_browser_process_stub.h" +#include "libcef/browser/context.h" #include "libcef/browser/thread_util.h" #include "libcef/browser/trace_subscriber.h" #include "libcef/common/cef_switches.h" @@ -33,8 +33,8 @@ #if defined(OS_WIN) #include "base/strings/utf_string_conversions.h" #include "chrome_elf/chrome_elf_main.h" -#include "content/public/app/sandbox_helper_win.h" #include "components/crash/content/app/crashpad.h" +#include "content/public/app/sandbox_helper_win.h" #include "sandbox/win/src/sandbox_types.h" #endif @@ -51,9 +51,7 @@ CefContext* g_context = NULL; // When the process terminates check if CefShutdown() has been called. class CefShutdownChecker { public: - ~CefShutdownChecker() { - DCHECK(!g_context) << "CefShutdown was not called"; - } + ~CefShutdownChecker() { DCHECK(!g_context) << "CefShutdown was not called"; } } g_shutdown_checker; #endif // DCHECK_IS_ON() @@ -97,13 +95,14 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) { base::CommandLine::StringVector argv = command_line.argv(); const base::CommandLine::StringType process_type = FILE_PATH_LITERAL("--type="); - argv.erase(std::remove_if(argv.begin(), argv.end(), - [&process_type](const base::CommandLine::StringType& str) { - return base::StartsWith(str, process_type, - base::CompareCase::SENSITIVE) || - (!str.empty() && str[0] == L'/'); - }), - argv.end()); + argv.erase( + std::remove_if(argv.begin(), argv.end(), + [&process_type](const base::CommandLine::StringType& str) { + return base::StartsWith(str, process_type, + base::CompareCase::SENSITIVE) || + (!str.empty() && str[0] == L'/'); + }), + argv.end()); #if defined(OS_MACOSX) // HandlerMain on macOS uses the system version of getopt_long which expects @@ -184,7 +183,7 @@ int CefExecuteProcess(const CefMainArgs& args, CefMainDelegate main_delegate(application); - // Execute the secondary process. +// Execute the secondary process. #if defined(OS_WIN) sandbox::SandboxInterfaceInfo sandbox_info = {0}; if (windows_sandbox_info == NULL) { @@ -321,17 +320,12 @@ void CefSetOSModalLoop(bool osModalLoop) { #endif // defined(OS_WIN) } - // CefContext CefContext::CefContext() - : initialized_(false), - shutting_down_(false), - init_thread_id_(0) { -} + : initialized_(false), shutting_down_(false), init_thread_id_(0) {} -CefContext::~CefContext() { -} +CefContext::~CefContext() {} // static CefContext* CefContext::Get() { @@ -390,8 +384,8 @@ bool CefContext::Initialize(const CefMainArgs& args, if (exit_code >= 0) return false; - static_cast(g_browser_process)->Initialize( - *base::CommandLine::ForCurrentProcess()); + static_cast(g_browser_process) + ->Initialize(*base::CommandLine::ForCurrentProcess()); // Run the process. Results in a call to CefMainDelegate::RunProcess() which // will create the browser runner and message loop without blocking. @@ -403,8 +397,8 @@ bool CefContext::Initialize(const CefMainArgs& args, OnContextInitialized(); } else { // Continue initialization on the UI thread. - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefContext::OnContextInitialized, base::Unretained(this))); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefContext::OnContextInitialized, + base::Unretained(this))); } return true; @@ -425,9 +419,8 @@ void CefContext::Shutdown() { // Finish shutdown on the UI thread. CEF_POST_TASK(CEF_UIT, - base::Bind(&CefContext::FinishShutdownOnUIThread, - base::Unretained(this), - &uithread_shutdown_event)); + base::Bind(&CefContext::FinishShutdownOnUIThread, + base::Unretained(this), &uithread_shutdown_event)); /// Block until UI thread shutdown is complete. uithread_shutdown_event.Wait(); @@ -448,9 +441,11 @@ bool CefContext::OnInitThread() { SkColor CefContext::GetBackgroundColor( const CefBrowserSettings* browser_settings, cef_state_t windowless_state) const { - bool is_windowless = windowless_state == STATE_ENABLED ? true : - (windowless_state == STATE_DISABLED ? false : - !!settings_.windowless_rendering_enabled); + bool is_windowless = windowless_state == STATE_ENABLED + ? true + : (windowless_state == STATE_DISABLED + ? false + : !!settings_.windowless_rendering_enabled); // Default to opaque white if no acceptable color values are found. SkColor sk_color = SK_ColorWHITE; @@ -495,8 +490,8 @@ void CefContext::PopulateRequestContextSettings( void CefContext::OnContextInitialized() { CEF_REQUIRE_UIT(); - static_cast(g_browser_process)-> - OnContextInitialized(); + static_cast(g_browser_process) + ->OnContextInitialized(); #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) CefWidevineLoader::GetInstance()->OnContextInitialized(); diff --git a/libcef/browser/context.h b/libcef/browser/context.h index c49b738c9..d83f79122 100644 --- a/libcef/browser/context.h +++ b/libcef/browser/context.h @@ -34,7 +34,7 @@ class CefTraceSubscriber; class CefContext { public: - typedef std::list > BrowserList; + typedef std::list> BrowserList; CefContext(); ~CefContext(); @@ -104,8 +104,8 @@ class CefContext { }; // Helper macro that returns true if the global context is in a valid state. -#define CONTEXT_STATE_VALID() \ - (CefContext::Get() && CefContext::Get()->initialized() && \ - !CefContext::Get()->shutting_down()) +#define CONTEXT_STATE_VALID() \ + (CefContext::Get() && CefContext::Get()->initialized() && \ + !CefContext::Get()->shutting_down()) #endif // CEF_LIBCEF_BROWSER_CONTEXT_H_ diff --git a/libcef/browser/context_menu_params_impl.cc b/libcef/browser/context_menu_params_impl.cc index f1ad329c0..3eea0ce5b 100644 --- a/libcef/browser/context_menu_params_impl.cc +++ b/libcef/browser/context_menu_params_impl.cc @@ -8,9 +8,12 @@ CefContextMenuParamsImpl::CefContextMenuParamsImpl( content::ContextMenuParams* value) - : CefValueBase( - value, NULL, kOwnerNoDelete, true, - new CefValueControllerNonThreadSafe()) { + : CefValueBase( + value, + NULL, + kOwnerNoDelete, + true, + new CefValueControllerNonThreadSafe()) { // Indicate that this object owns the controller. SetOwnsController(); } @@ -90,7 +93,7 @@ CefContextMenuParamsImpl::MediaType CefContextMenuParamsImpl::GetMediaType() { } CefContextMenuParamsImpl::MediaStateFlags - CefContextMenuParamsImpl::GetMediaStateFlags() { +CefContextMenuParamsImpl::GetMediaStateFlags() { CEF_VALUE_VERIFY_RETURN(false, CM_MEDIAFLAG_NONE); return static_cast(const_value().media_flags); } @@ -112,7 +115,7 @@ bool CefContextMenuParamsImpl::GetDictionarySuggestions( if (!suggestions.empty()) suggestions.clear(); - if(const_value().dictionary_suggestions.empty()) + if (const_value().dictionary_suggestions.empty()) return false; std::vector::const_iterator it = @@ -134,7 +137,7 @@ bool CefContextMenuParamsImpl::IsSpellCheckEnabled() { } CefContextMenuParamsImpl::EditStateFlags - CefContextMenuParamsImpl::GetEditStateFlags() { +CefContextMenuParamsImpl::GetEditStateFlags() { CEF_VALUE_VERIFY_RETURN(false, CM_EDITFLAG_NONE); return static_cast(const_value().edit_flags); } diff --git a/libcef/browser/context_menu_params_impl.h b/libcef/browser/context_menu_params_impl.h index 71fb29226..dfce520a0 100644 --- a/libcef/browser/context_menu_params_impl.h +++ b/libcef/browser/context_menu_params_impl.h @@ -33,8 +33,7 @@ class CefContextMenuParamsImpl MediaStateFlags GetMediaStateFlags() override; CefString GetSelectionText() override; CefString GetMisspelledWord() override; - bool GetDictionarySuggestions( - std::vector& suggestions) override; + bool GetDictionarySuggestions(std::vector& suggestions) override; bool IsEditable() override; bool IsSpellCheckEnabled() override; EditStateFlags GetEditStateFlags() override; diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index ca3555efd..eb2d32449 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -35,9 +35,7 @@ class VisitCookiesCallback : public base::RefCounted { explicit VisitCookiesCallback( const CefCookieManagerImpl::CookieStoreGetter& cookie_store_getter, CefRefPtr visitor) - : cookie_store_getter_(cookie_store_getter), - visitor_(visitor) { - } + : cookie_store_getter_(cookie_store_getter), visitor_(visitor) {} void Run(const net::CookieList& list) { CEF_REQUIRE_IOT(); @@ -55,8 +53,8 @@ class VisitCookiesCallback : public base::RefCounted { if (deleteCookie) { net::CookieStore* cookie_store = cookie_store_getter_.Run(); if (cookie_store) { - cookie_store->DeleteCanonicalCookieAsync(cc, - net::CookieMonster::DeleteCallback()); + cookie_store->DeleteCanonicalCookieAsync( + cc, net::CookieMonster::DeleteCallback()); } } if (!keepLooping) @@ -73,7 +71,6 @@ class VisitCookiesCallback : public base::RefCounted { CefRefPtr visitor_; }; - // Methods extracted from net/cookies/cookie_store.cc // Determine the cookie domain to use for setting the specified cookie. @@ -84,7 +81,7 @@ bool GetCookieDomain(const GURL& url, if (pc.HasDomain()) domain_string = pc.Domain(); return net::cookie_util::GetCookieDomainWithString(url, domain_string, - result); + result); } // Always execute the callback asynchronously. @@ -92,7 +89,7 @@ void RunAsyncCompletionOnIOThread(CefRefPtr callback) { if (!callback.get()) return; CEF_POST_TASK(CEF_IOT, - base::Bind(&CefCompletionCallback::OnComplete, callback.get())); + base::Bind(&CefCompletionCallback::OnComplete, callback.get())); } // Always execute the callback asynchronously. @@ -100,9 +97,8 @@ void DeleteCookiesCallbackImpl(CefRefPtr callback, int num_deleted) { if (!callback.get()) return; - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefDeleteCookiesCallback::OnComplete, callback.get(), - num_deleted)); + CEF_POST_TASK(CEF_IOT, base::Bind(&CefDeleteCookiesCallback::OnComplete, + callback.get(), num_deleted)); } // Always execute the callback asynchronously. @@ -110,8 +106,8 @@ void SetCookieCallbackImpl(CefRefPtr callback, bool success) { if (!callback.get()) return; - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefSetCookieCallback::OnComplete, callback.get(), success)); + CEF_POST_TASK(CEF_IOT, base::Bind(&CefSetCookieCallback::OnComplete, + callback.get(), success)); } net::CookieStore* GetExistingCookieStoreHelper( @@ -123,10 +119,7 @@ net::CookieStore* GetExistingCookieStoreHelper( } // namespace - -CefCookieManagerImpl::CefCookieManagerImpl() - : weak_ptr_factory_(this) { -} +CefCookieManagerImpl::CefCookieManagerImpl() : weak_ptr_factory_(this) {} CefCookieManagerImpl::~CefCookieManagerImpl() { CEF_REQUIRE_IOT(); @@ -154,9 +147,8 @@ void CefCookieManagerImpl::GetCookieStore( task_runner = base::MessageLoop::current()->task_runner(); if (!CEF_CURRENTLY_ON_IOT()) { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefCookieManagerImpl::GetCookieStore, this, task_runner, - callback)); + CEF_POST_TASK(CEF_IOT, base::Bind(&CefCookieManagerImpl::GetCookieStore, + this, task_runner, callback)); return; } @@ -177,16 +169,14 @@ void CefCookieManagerImpl::GetCookieStore( // that case, the CookieStoreGetter will return nullptr instead of keeping // the CefCookieManagerImpl alive (see issue #1882). const CookieStoreGetter& cookie_store_getter = - base::Bind(GetExistingCookieStoreHelper, - weak_ptr_factory_.GetWeakPtr()); + base::Bind(GetExistingCookieStoreHelper, weak_ptr_factory_.GetWeakPtr()); if (task_runner->BelongsToCurrentThread()) { // Execute the callback immediately. callback.Run(cookie_store_getter); } else { // Execute the callback on the target thread. - task_runner->PostTask(FROM_HERE, - base::Bind(callback, cookie_store_getter)); + task_runner->PostTask(FROM_HERE, base::Bind(callback, cookie_store_getter)); } } @@ -210,8 +200,8 @@ void CefCookieManagerImpl::SetSupportedSchemes( CefRefPtr callback) { if (!CEF_CURRENTLY_ON_IOT()) { CEF_POST_TASK(CEF_IOT, - base::Bind(&CefCookieManagerImpl::SetSupportedSchemes, this, schemes, - callback)); + base::Bind(&CefCookieManagerImpl::SetSupportedSchemes, this, + schemes, callback)); return; } @@ -225,10 +215,9 @@ void CefCookieManagerImpl::SetSupportedSchemes( bool CefCookieManagerImpl::VisitAllCookies( CefRefPtr visitor) { - GetCookieStore( - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - base::Bind(&CefCookieManagerImpl::VisitAllCookiesInternal, this, - visitor)); + GetCookieStore(BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + base::Bind(&CefCookieManagerImpl::VisitAllCookiesInternal, + this, visitor)); return true; } @@ -236,25 +225,22 @@ bool CefCookieManagerImpl::VisitUrlCookies( const CefString& url, bool includeHttpOnly, CefRefPtr visitor) { - GetCookieStore( - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - base::Bind(&CefCookieManagerImpl::VisitUrlCookiesInternal, this, url, - includeHttpOnly, visitor)); + GetCookieStore(BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + base::Bind(&CefCookieManagerImpl::VisitUrlCookiesInternal, + this, url, includeHttpOnly, visitor)); return true; } -bool CefCookieManagerImpl::SetCookie( - const CefString& url, - const CefCookie& cookie, - CefRefPtr callback) { +bool CefCookieManagerImpl::SetCookie(const CefString& url, + const CefCookie& cookie, + CefRefPtr callback) { GURL gurl = GURL(url.ToString()); if (!gurl.is_valid()) return false; - GetCookieStore( - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - base::Bind(&CefCookieManagerImpl::SetCookieInternal, this, gurl, cookie, - callback)); + GetCookieStore(BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + base::Bind(&CefCookieManagerImpl::SetCookieInternal, this, + gurl, cookie, callback)); return true; } @@ -267,10 +253,9 @@ bool CefCookieManagerImpl::DeleteCookies( if (!gurl.is_empty() && !gurl.is_valid()) return false; - GetCookieStore( - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - base::Bind(&CefCookieManagerImpl::DeleteCookiesInternal, this, gurl, - cookie_name, callback)); + GetCookieStore(BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + base::Bind(&CefCookieManagerImpl::DeleteCookiesInternal, this, + gurl, cookie_name, callback)); return true; } @@ -279,7 +264,8 @@ bool CefCookieManagerImpl::SetStoragePath( bool persist_session_cookies, CefRefPtr callback) { if (!CEF_CURRENTLY_ON_IOT()) { - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(base::IgnoreResult(&CefCookieManagerImpl::SetStoragePath), this, path, persist_session_cookies, callback)); return true; @@ -296,8 +282,8 @@ bool CefCookieManagerImpl::SetStoragePath( if (!path.empty()) new_path = base::FilePath(path); - if (cookie_store_.get() && ((storage_path_.empty() && path.empty()) || - storage_path_ == new_path)) { + if (cookie_store_.get() && + ((storage_path_.empty() && path.empty()) || storage_path_ == new_path)) { // The path has not changed so don't do anything. RunAsyncCompletionOnIOThread(callback); return true; @@ -308,16 +294,12 @@ bool CefCookieManagerImpl::SetStoragePath( // TODO(cef): Move directory creation to the blocking pool instead of // allowing file IO on this thread. base::ThreadRestrictions::ScopedAllowIO allow_io; - if (base::DirectoryExists(new_path) || - base::CreateDirectory(new_path)) { + if (base::DirectoryExists(new_path) || base::CreateDirectory(new_path)) { const base::FilePath& cookie_path = new_path.AppendASCII("Cookies"); - persistent_store = - new net::SQLitePersistentCookieStore( - cookie_path, - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), - persist_session_cookies, - NULL); + persistent_store = new net::SQLitePersistentCookieStore( + cookie_path, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), + persist_session_cookies, NULL); } else { NOTREACHED() << "The cookie storage directory could not be created"; storage_path_.clear(); @@ -427,8 +409,7 @@ void CefCookieManagerImpl::RunMethodWithContext( } else if (request_context_.get()) { // Try again after the request context is initialized. request_context_->GetRequestContextImpl( - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - method); + BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), method); } else { NOTREACHED(); } @@ -485,9 +466,8 @@ void CefCookieManagerImpl::GetCookieStoreWithContext( CEF_REQUIRE_IOT(); DCHECK(request_context->GetExistingCookieStore()); - const CookieStoreGetter& cookie_store_getter = - base::Bind(&CefURLRequestContextGetterImpl::GetExistingCookieStore, - request_context); + const CookieStoreGetter& cookie_store_getter = base::Bind( + &CefURLRequestContextGetterImpl::GetExistingCookieStore, request_context); if (task_runner->BelongsToCurrentThread()) { // Execute the callback immediately. @@ -555,8 +535,8 @@ void CefCookieManagerImpl::VisitUrlCookiesInternal( new VisitCookiesCallback(cookie_store_getter, visitor)); GURL gurl = GURL(url.ToString()); - cookie_store->GetCookieListWithOptionsAsync(gurl, options, - base::Bind(&VisitCookiesCallback::Run, callback.get())); + cookie_store->GetCookieListWithOptionsAsync( + gurl, options, base::Bind(&VisitCookiesCallback::Run, callback.get())); } void CefCookieManagerImpl::SetCookieInternal( @@ -584,10 +564,8 @@ void CefCookieManagerImpl::SetCookieInternal( base::Time(), // Creation time. expiration_time, base::Time(), // Last access time. - cookie.secure ? true : false, - cookie.httponly ? true : false, - net::CookieSameSite::DEFAULT_MODE, - net::COOKIE_PRIORITY_DEFAULT, + cookie.secure ? true : false, cookie.httponly ? true : false, + net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT, base::Bind(SetCookieCallbackImpl, callback)); } @@ -614,8 +592,8 @@ void CefCookieManagerImpl::DeleteCookiesInternal( base::Bind(DeleteCookiesCallbackImpl, callback)); } else { // Delete all matching host and domain cookies. - cookie_store->DeleteCookieAsync(url, cookie_name, - base::Bind(DeleteCookiesCallbackImpl, callback, -1)); + cookie_store->DeleteCookieAsync( + url, cookie_name, base::Bind(DeleteCookiesCallbackImpl, callback, -1)); } } @@ -628,8 +606,7 @@ void CefCookieManagerImpl::FlushStoreInternal( if (!cookie_store) return; - cookie_store->FlushStore( - base::Bind(RunAsyncCompletionOnIOThread, callback)); + cookie_store->FlushStore(base::Bind(RunAsyncCompletionOnIOThread, callback)); } // CefCookieManager methods ---------------------------------------------------- diff --git a/libcef/browser/cookie_manager_impl.h b/libcef/browser/cookie_manager_impl.h index 773cb68ab..14a36e8fd 100644 --- a/libcef/browser/cookie_manager_impl.h +++ b/libcef/browser/cookie_manager_impl.h @@ -34,9 +34,8 @@ class CefCookieManagerImpl : public CefCookieManager { // store object can only be accessed on, the IO thread. typedef base::Callback CookieStoreGetter; typedef base::Callback CookieStoreCallback; - void GetCookieStore( - scoped_refptr task_runner, - const CookieStoreCallback& callback); + void GetCookieStore(scoped_refptr task_runner, + const CookieStoreCallback& callback); // Returns the existing cookie store object. Logs an error if the cookie // store does not yet exist. Must be called on the IO thread. @@ -46,7 +45,8 @@ class CefCookieManagerImpl : public CefCookieManager { void SetSupportedSchemes(const std::vector& schemes, CefRefPtr callback) override; bool VisitAllCookies(CefRefPtr visitor) override; - bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, + bool VisitUrlCookies(const CefString& url, + bool includeHttpOnly, CefRefPtr visitor) override; bool SetCookie(const CefString& url, const CefCookie& cookie, @@ -60,7 +60,8 @@ class CefCookieManagerImpl : public CefCookieManager { bool FlushStore(CefRefPtr callback) override; static bool GetCefCookie(const net::CanonicalCookie& cc, CefCookie& cookie); - static bool GetCefCookie(const GURL& url, const std::string& cookie_line, + static bool GetCefCookie(const GURL& url, + const std::string& cookie_line, CefCookie& cookie); // Set the schemes supported by |cookie_monster|. Default schemes will always @@ -93,30 +94,24 @@ class CefCookieManagerImpl : public CefCookieManager { const CookieStoreCallback& callback, scoped_refptr request_context); - void SetSupportedSchemesInternal( - const std::vector& schemes, - CefRefPtr callback); - void VisitAllCookiesInternal( - CefRefPtr visitor, - const CookieStoreGetter& cookie_store_getter); - void VisitUrlCookiesInternal( - const CefString& url, - bool includeHttpOnly, - CefRefPtr visitor, - const CookieStoreGetter& cookie_store_getter); - void SetCookieInternal( - const GURL& url, - const CefCookie& cookie, - CefRefPtr callback, - const CookieStoreGetter& cookie_store_getter); - void DeleteCookiesInternal( - const GURL& url, - const CefString& cookie_name, - CefRefPtr callback, - const CookieStoreGetter& cookie_store_getter); - void FlushStoreInternal( - CefRefPtr callback, - const CookieStoreGetter& cookie_store_getter); + void SetSupportedSchemesInternal(const std::vector& schemes, + CefRefPtr callback); + void VisitAllCookiesInternal(CefRefPtr visitor, + const CookieStoreGetter& cookie_store_getter); + void VisitUrlCookiesInternal(const CefString& url, + bool includeHttpOnly, + CefRefPtr visitor, + const CookieStoreGetter& cookie_store_getter); + void SetCookieInternal(const GURL& url, + const CefCookie& cookie, + CefRefPtr callback, + const CookieStoreGetter& cookie_store_getter); + void DeleteCookiesInternal(const GURL& url, + const CefString& cookie_name, + CefRefPtr callback, + const CookieStoreGetter& cookie_store_getter); + void FlushStoreInternal(CefRefPtr callback, + const CookieStoreGetter& cookie_store_getter); // Used for cookie monsters owned by the context. CefRefPtr request_context_; diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index 3cecf13fb..93bc1cd09 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -37,7 +37,6 @@ namespace { - // ResponseWriter ------------------------------------------------------------- class ResponseWriter : public net::URLFetcherResponseWriter { @@ -63,12 +62,9 @@ class ResponseWriter : public net::URLFetcherResponseWriter { ResponseWriter::ResponseWriter( base::WeakPtr shell_devtools, int stream_id) - : shell_devtools_(shell_devtools), - stream_id_(stream_id) { -} + : shell_devtools_(shell_devtools), stream_id_(stream_id) {} -ResponseWriter::~ResponseWriter() { -} +ResponseWriter::~ResponseWriter() {} int ResponseWriter::Initialize(const net::CompletionCallback& callback) { return net::OK; @@ -86,9 +82,9 @@ int ResponseWriter::Write(net::IOBuffer* buffer, content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&CefDevToolsFrontend::CallClientFunction, - shell_devtools_, "DevToolsAPI.streamWrite", - base::Owned(id), base::Owned(chunkValue), nullptr)); + base::Bind(&CefDevToolsFrontend::CallClientFunction, shell_devtools_, + "DevToolsAPI.streamWrite", base::Owned(id), + base::Owned(chunkValue), nullptr)); return num_bytes; } @@ -99,7 +95,8 @@ int ResponseWriter::Finish(int net_error, static std::string GetFrontendURL() { return base::StringPrintf("%s://%s/inspector.html", - content::kChromeDevToolsScheme, scheme::kChromeDevToolsHost); + content::kChromeDevToolsScheme, + scheme::kChromeDevToolsHost); } } // namespace @@ -164,10 +161,9 @@ void CefDevToolsFrontend::InspectElementAt(int x, int y) { } void CefDevToolsFrontend::Close() { - content::BrowserThread::PostTask( - content::BrowserThread::UI, FROM_HERE, - base::Bind(&CefBrowserHostImpl::CloseBrowser, frontend_browser_.get(), - true)); + content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, + base::Bind(&CefBrowserHostImpl::CloseBrowser, + frontend_browser_.get(), true)); } void CefDevToolsFrontend::DisconnectFromTarget() { @@ -185,8 +181,7 @@ CefDevToolsFrontend::CefDevToolsFrontend( frontend_browser_(frontend_browser), inspected_contents_(inspected_contents), inspect_element_at_(inspect_element_at), - weak_factory_(this) { -} + weak_factory_(this) {} CefDevToolsFrontend::~CefDevToolsFrontend() { for (const auto& pair : pending_requests_) @@ -213,8 +208,8 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() { agent_host_ = agent_host; agent_host_->AttachClient(this); if (!inspect_element_at_.IsEmpty()) { - agent_host_->InspectElement( - this, inspect_element_at_.x, inspect_element_at_.y); + agent_host_->InspectElement(this, inspect_element_at_.x, + inspect_element_at_.y); } } } @@ -250,8 +245,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( base::ListValue* params = NULL; base::DictionaryValue* dict = NULL; std::unique_ptr parsed_message = base::JSONReader::Read(message); - if (!parsed_message || - !parsed_message->GetAsDictionary(&dict) || + if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || !dict->GetString("method", &method)) { return; } @@ -274,8 +268,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( std::string url; std::string headers; int stream_id; - if (!params->GetString(0, &url) || - !params->GetString(1, &headers) || + if (!params->GetString(0, &url) || !params->GetString(1, &headers) || !params->GetInteger(2, &stream_id)) { return; } @@ -293,8 +286,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( pending_requests_[fetcher] = request_id; fetcher->SetRequestContext( content::BrowserContext::GetDefaultStoragePartition( - web_contents()->GetBrowserContext())-> - GetURLRequestContext()); + web_contents()->GetBrowserContext()) + ->GetURLRequestContext()); fetcher->SetExtraRequestHeaders(headers); fetcher->SaveResponseWithWriter( std::unique_ptr( @@ -308,8 +301,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( } else if (method == "setPreference") { std::string name; std::string value; - if (!params->GetString(0, &name) || - !params->GetString(1, &value)) { + if (!params->GetString(0, &name) || !params->GetString(1, &value)) { return; } DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences); @@ -335,8 +327,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( } void CefDevToolsFrontend::DispatchProtocolMessage( - content::DevToolsAgentHost* agent_host, const std::string& message) { - + content::DevToolsAgentHost* agent_host, + const std::string& message) { if (message.length() < kMaxMessageChunkSize) { std::string param; base::EscapeJSONString(message, true, ¶m); @@ -382,11 +374,10 @@ void CefDevToolsFrontend::OnURLFetchComplete(const net::URLFetcher* source) { delete source; } -void CefDevToolsFrontend::CallClientFunction( - const std::string& function_name, - const base::Value* arg1, - const base::Value* arg2, - const base::Value* arg3) { +void CefDevToolsFrontend::CallClientFunction(const std::string& function_name, + const base::Value* arg1, + const base::Value* arg2, + const base::Value* arg3) { std::string javascript = function_name + "("; if (arg1) { std::string json; @@ -409,12 +400,12 @@ void CefDevToolsFrontend::CallClientFunction( void CefDevToolsFrontend::SendMessageAck(int request_id, const base::Value* arg) { base::Value id_value(request_id); - CallClientFunction("DevToolsAPI.embedderMessageAck", - &id_value, arg, nullptr); + CallClientFunction("DevToolsAPI.embedderMessageAck", &id_value, arg, nullptr); } void CefDevToolsFrontend::AgentHostClosed( - content::DevToolsAgentHost* agent_host, bool replaced) { + content::DevToolsAgentHost* agent_host, + bool replaced) { DCHECK(agent_host == agent_host_.get()); agent_host_ = nullptr; Close(); @@ -422,5 +413,6 @@ void CefDevToolsFrontend::AgentHostClosed( PrefService* CefDevToolsFrontend::GetPrefs() const { return static_cast( - frontend_browser_->web_contents()->GetBrowserContext())->GetPrefs(); + frontend_browser_->web_contents()->GetBrowserContext()) + ->GetPrefs(); } diff --git a/libcef/browser/devtools_frontend.h b/libcef/browser/devtools_frontend.h index 9d4885945..21b181d46 100644 --- a/libcef/browser/devtools_frontend.h +++ b/libcef/browser/devtools_frontend.h @@ -80,8 +80,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, // net::URLFetcherDelegate overrides. void OnURLFetchComplete(const net::URLFetcher* source) override; - void SendMessageAck(int request_id, - const base::Value* arg1); + void SendMessageAck(int request_id, const base::Value* arg1); PrefService* GetPrefs() const; diff --git a/libcef/browser/devtools_manager_delegate.cc b/libcef/browser/devtools_manager_delegate.cc index 90e128bc4..ccddf1711 100644 --- a/libcef/browser/devtools_manager_delegate.cc +++ b/libcef/browser/devtools_manager_delegate.cc @@ -81,8 +81,8 @@ std::unique_ptr CreateSocketFactory() { int temp_port; std::string port_str = command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); - if (base::StringToInt(port_str, &temp_port) && - temp_port >= 1024 && temp_port < 65535) { + if (base::StringToInt(port_str, &temp_port) && temp_port >= 1024 && + temp_port < 65535) { port = static_cast(temp_port); } else { DLOG(WARNING) << "Invalid http debugger port number " << temp_port; @@ -94,7 +94,7 @@ std::unique_ptr CreateSocketFactory() { new TCPServerSocketFactory("127.0.0.1", port)); } -} // namespace +} // namespace // CefDevToolsManagerDelegate ---------------------------------------------- @@ -106,12 +106,8 @@ void CefDevToolsManagerDelegate::StartHttpHandler( if (!socket_factory) return; content::DevToolsAgentHost::StartRemoteDebuggingServer( - std::move(socket_factory), - std::string(), - browser_context->GetPath(), - base::FilePath(), - std::string(), - CefContentClient::Get()->GetUserAgent()); + std::move(socket_factory), std::string(), browser_context->GetPath(), + base::FilePath(), std::string(), CefContentClient::Get()->GetUserAgent()); } // static @@ -120,11 +116,9 @@ void CefDevToolsManagerDelegate::StopHttpHandler() { content::DevToolsAgentHost::StopRemoteDebuggingServer(); } -CefDevToolsManagerDelegate::CefDevToolsManagerDelegate() { -} +CefDevToolsManagerDelegate::CefDevToolsManagerDelegate() {} -CefDevToolsManagerDelegate::~CefDevToolsManagerDelegate() { -} +CefDevToolsManagerDelegate::~CefDevToolsManagerDelegate() {} scoped_refptr CefDevToolsManagerDelegate::CreateNewTarget(const GURL& url) { @@ -135,8 +129,9 @@ CefDevToolsManagerDelegate::CreateNewTarget(const GURL& url) { } std::string CefDevToolsManagerDelegate::GetDiscoveryPageHTML() { - return ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_CEF_DEVTOOLS_DISCOVERY_PAGE).as_string(); + return ui::ResourceBundle::GetSharedInstance() + .GetRawDataResource(IDR_CEF_DEVTOOLS_DISCOVERY_PAGE) + .as_string(); } std::string CefDevToolsManagerDelegate::GetFrontendResource( diff --git a/libcef/browser/devtools_manager_delegate.h b/libcef/browser/devtools_manager_delegate.h index f887af61e..bbd8db243 100644 --- a/libcef/browser/devtools_manager_delegate.h +++ b/libcef/browser/devtools_manager_delegate.h @@ -22,8 +22,8 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate { ~CefDevToolsManagerDelegate() override; // DevToolsManagerDelegate implementation. - scoped_refptr CreateNewTarget(const GURL& url) - override; + scoped_refptr CreateNewTarget( + const GURL& url) override; std::string GetDiscoveryPageHTML() override; std::string GetFrontendResource(const std::string& path) override; diff --git a/libcef/browser/download_item_impl.cc b/libcef/browser/download_item_impl.cc index f0f340d67..cc7e5ca03 100644 --- a/libcef/browser/download_item_impl.cc +++ b/libcef/browser/download_item_impl.cc @@ -9,11 +9,13 @@ #include "content/public/browser/download_item.h" #include "url/gurl.h" - CefDownloadItemImpl::CefDownloadItemImpl(content::DownloadItem* value) - : CefValueBase( - value, NULL, kOwnerNoDelete, true, - new CefValueControllerNonThreadSafe()) { + : CefValueBase( + value, + NULL, + kOwnerNoDelete, + true, + new CefValueControllerNonThreadSafe()) { // Indicate that this object owns the controller. SetOwnsController(); } diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 3031c9348..5b900fa53 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -34,30 +34,27 @@ CefRefPtr GetDownloadHandler( return NULL; } - // CefBeforeDownloadCallback implementation. class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { public: - CefBeforeDownloadCallbackImpl( - const base::WeakPtr& manager, - uint32 download_id, - const base::FilePath& suggested_name, - const content::DownloadTargetCallback& callback) + CefBeforeDownloadCallbackImpl(const base::WeakPtr& manager, + uint32 download_id, + const base::FilePath& suggested_name, + const content::DownloadTargetCallback& callback) : manager_(manager), download_id_(download_id), suggested_name_(suggested_name), - callback_(callback) { - } + callback_(callback) {} - void Continue(const CefString& download_path, - bool show_dialog) override { + void Continue(const CefString& download_path, bool show_dialog) override { if (CEF_CURRENTLY_ON_UIT()) { if (download_id_ <= 0) return; if (manager_) { base::FilePath path = base::FilePath(download_path); - CEF_POST_TASK(CEF_FILET, + CEF_POST_TASK( + CEF_FILET, base::Bind(&CefBeforeDownloadCallbackImpl::GenerateFilename, manager_, download_id_, suggested_name_, path, show_dialog, callback_)); @@ -67,8 +64,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { callback_.Reset(); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBeforeDownloadCallbackImpl::Continue, this, - download_path, show_dialog)); + base::Bind(&CefBeforeDownloadCallbackImpl::Continue, this, + download_path, show_dialog)); } } @@ -101,10 +98,10 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } } - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, - manager, download_id, suggested_path, show_dialog, - callback)); + CEF_POST_TASK( + CEF_UIT, + base::Bind(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, manager, + download_id, suggested_path, show_dialog, callback)); } static void ChooseDownloadPath( @@ -139,7 +136,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } } - browser->RunFileChooser(params, + browser->RunFileChooser( + params, base::Bind( &CefBeforeDownloadCallbackImpl::ChooseDownloadPathCallback, callback)); @@ -147,10 +145,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } if (!handled) { - callback.Run(suggested_path, - DownloadItem::TARGET_DISPOSITION_OVERWRITE, - content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - suggested_path, + callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, + content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path, content::DOWNLOAD_INTERRUPT_REASON_NONE); } } @@ -159,17 +155,16 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { const content::DownloadTargetCallback& callback, int selected_accept_filter, const std::vector& file_paths) { - DCHECK_LE(file_paths.size(), (size_t) 1); + DCHECK_LE(file_paths.size(), (size_t)1); base::FilePath path; if (file_paths.size() > 0) path = file_paths.front(); // The download will be cancelled if |path| is empty. - callback.Run(path, - DownloadItem::TARGET_DISPOSITION_OVERWRITE, - content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - path, content::DOWNLOAD_INTERRUPT_REASON_NONE); + callback.Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, + content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path, + content::DOWNLOAD_INTERRUPT_REASON_NONE); } base::WeakPtr manager_; @@ -181,31 +176,29 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { DISALLOW_COPY_AND_ASSIGN(CefBeforeDownloadCallbackImpl); }; - // CefDownloadItemCallback implementation. class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { public: explicit CefDownloadItemCallbackImpl( const base::WeakPtr& manager, uint32 download_id) - : manager_(manager), - download_id_(download_id) { - } + : manager_(manager), download_id_(download_id) {} void Cancel() override { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoCancel, this)); + CEF_POST_TASK(CEF_UIT, + base::Bind(&CefDownloadItemCallbackImpl::DoCancel, this)); } void Pause() override { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoPause, this)); + CEF_POST_TASK(CEF_UIT, + base::Bind(&CefDownloadItemCallbackImpl::DoPause, this)); } void Resume() override { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoResume, this)); + CEF_POST_TASK(CEF_UIT, + base::Bind(&CefDownloadItemCallbackImpl::DoResume, this)); } + private: void DoCancel() { if (download_id_ <= 0) @@ -251,11 +244,8 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { } // namespace - -CefDownloadManagerDelegate::CefDownloadManagerDelegate( - DownloadManager* manager) - : manager_(manager), - manager_ptr_factory_(manager) { +CefDownloadManagerDelegate::CefDownloadManagerDelegate(DownloadManager* manager) + : manager_(manager), manager_ptr_factory_(manager) { DCHECK(manager); manager->AddObserver(this); @@ -276,8 +266,7 @@ CefDownloadManagerDelegate::~CefDownloadManagerDelegate() { OnDownloadDestroyed(item_browser_map_.begin()->first); } -void CefDownloadManagerDelegate::OnDownloadUpdated( - DownloadItem* download) { +void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) { CefRefPtr browser = GetBrowser(download); CefRefPtr handler; if (browser.get()) @@ -286,9 +275,8 @@ void CefDownloadManagerDelegate::OnDownloadUpdated( if (handler.get()) { CefRefPtr download_item( new CefDownloadItemImpl(download)); - CefRefPtr callback( - new CefDownloadItemCallbackImpl(manager_ptr_factory_.GetWeakPtr(), - download->GetId())); + CefRefPtr callback(new CefDownloadItemCallbackImpl( + manager_ptr_factory_.GetWeakPtr(), download->GetId())); handler->OnDownloadUpdated(browser.get(), download_item.get(), callback); @@ -296,8 +284,7 @@ void CefDownloadManagerDelegate::OnDownloadUpdated( } } -void CefDownloadManagerDelegate::OnDownloadDestroyed( - DownloadItem* item) { +void CefDownloadManagerDelegate::OnDownloadDestroyed(DownloadItem* item) { item->RemoveObserver(this); CefBrowserHostImpl* browser = nullptr; @@ -326,9 +313,8 @@ void CefDownloadManagerDelegate::OnDownloadDestroyed( } } -void CefDownloadManagerDelegate::OnDownloadCreated( - DownloadManager* manager, - DownloadItem* item) { +void CefDownloadManagerDelegate::OnDownloadCreated(DownloadManager* manager, + DownloadItem* item) { item->AddObserver(this); CefBrowserHostImpl* browser = nullptr; @@ -345,8 +331,7 @@ void CefDownloadManagerDelegate::OnDownloadCreated( browser->AddObserver(this); } -void CefDownloadManagerDelegate::ManagerGoingDown( - DownloadManager* manager) { +void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) { DCHECK_EQ(manager, manager_); manager->SetDelegate(NULL); manager->RemoveObserver(this); @@ -358,11 +343,10 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( DownloadItem* item, const content::DownloadTargetCallback& callback) { if (!item->GetForcedFilePath().empty()) { - callback.Run(item->GetForcedFilePath(), - DownloadItem::TARGET_DISPOSITION_OVERWRITE, - content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - item->GetForcedFilePath(), - content::DOWNLOAD_INTERRUPT_REASON_NONE); + callback.Run( + item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE, + content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(), + content::DOWNLOAD_INTERRUPT_REASON_NONE); return true; } @@ -373,12 +357,8 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( if (handler.get()) { base::FilePath suggested_name = net::GenerateFileName( - item->GetURL(), - item->GetContentDisposition(), - std::string(), - item->GetSuggestedFilename(), - item->GetMimeType(), - "download"); + item->GetURL(), item->GetContentDisposition(), std::string(), + item->GetSuggestedFilename(), item->GetMimeType(), "download"); CefRefPtr download_item(new CefDownloadItemImpl(item)); CefRefPtr callbackObj( diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 47471a1ff..d0a7627b9 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -16,11 +16,10 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager_delegate.h" -class CefDownloadManagerDelegate - : public content::DownloadItem::Observer, - public content::DownloadManager::Observer, - public content::DownloadManagerDelegate, - public CefBrowserHostImpl::Observer { +class CefDownloadManagerDelegate : public content::DownloadItem::Observer, + public content::DownloadManager::Observer, + public content::DownloadManagerDelegate, + public CefBrowserHostImpl::Observer { public: explicit CefDownloadManagerDelegate(content::DownloadManager* manager); ~CefDownloadManagerDelegate() override; @@ -52,7 +51,7 @@ class CefDownloadManagerDelegate // Map of DownloadItem to originating CefBrowserHostImpl. Maintaining this // map is necessary because DownloadItem::GetWebContents() may return NULL if // the browser navigates while the download is in progress. - typedef std::map ItemBrowserMap; + typedef std::map ItemBrowserMap; ItemBrowserMap item_browser_map_; DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate); diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index a91653a79..aa2b511a9 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -43,8 +43,9 @@ bool GetTabById(int tab_id, // BrowserContext. Profile* profile = Profile::FromBrowserContext(browser_context); Profile* incognito_profile = - include_incognito && profile->HasOffTheRecordProfile() ? - profile->GetOffTheRecordProfile() : NULL; + include_incognito && profile->HasOffTheRecordProfile() + ? profile->GetOffTheRecordProfile() + : NULL; CefBrowserInfoManager::BrowserInfoList list; CefBrowserInfoManager::GetInstance()->GetBrowserInfoList(list); @@ -65,8 +66,7 @@ bool GetTabById(int tab_id, if (!browser_context) continue; - if (browser_context == profile || - browser_context == incognito_profile) { + if (browser_context == profile || browser_context == incognito_profile) { content::WebContents* web_contents = cef_browser->web_contents(); if (SessionTabHelper::IdForTab(web_contents) == tab_id) { if (browser) @@ -94,8 +94,8 @@ bool GetTabById(int tab_id, } if (error_message) { - *error_message = ErrorUtils::FormatErrorMessage( - keys::kTabNotFoundError, base::IntToString(tab_id)); + *error_message = ErrorUtils::FormatErrorMessage(keys::kTabNotFoundError, + base::IntToString(tab_id)); } return false; @@ -134,11 +134,8 @@ content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) { content::WebContents* web_contents = NULL; if (tab_id != -1) { // We assume this call leaves web_contents unchanged if it is unsuccessful. - GetTabById(tab_id, - context_, - include_incognito(), - NULL /* ignore CefBrowserHostImpl* output */, - &web_contents, + GetTabById(tab_id, context_, include_incognito(), + NULL /* ignore CefBrowserHostImpl* output */, &web_contents, &error_); } else { // Use the sender as the default. diff --git a/libcef/browser/extensions/browser_extensions_util.cc b/libcef/browser/extensions/browser_extensions_util.cc index 29bd4b9ee..0196060ff 100644 --- a/libcef/browser/extensions/browser_extensions_util.cc +++ b/libcef/browser/extensions/browser_extensions_util.cc @@ -77,10 +77,10 @@ CefRefPtr GetOwnerBrowserForFrame(int render_process_id, if (info.get()) { CefRefPtr browser = info->browser(); if (!browser.get()) { - LOG(WARNING) << "Found browser id " << info->browser_id() << - " but no browser object matching view process id " << - render_process_id << " and frame routing id " << - render_routing_id; + LOG(WARNING) << "Found browser id " << info->browser_id() + << " but no browser object matching view process id " + << render_process_id << " and frame routing id " + << render_routing_id; } return browser; } diff --git a/libcef/browser/extensions/chrome_api_registration.cc b/libcef/browser/extensions/chrome_api_registration.cc index fdaeb5efa..22aa83413 100644 --- a/libcef/browser/extensions/chrome_api_registration.cc +++ b/libcef/browser/extensions/chrome_api_registration.cc @@ -26,16 +26,16 @@ namespace cefimpl = extensions::cef; // static bool ChromeFunctionRegistry::IsSupported(const std::string& name) { static const char* const supported_apis[] = { - "resourcesPrivate", - EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction), - "streamsPrivate", - EXTENSION_FUNCTION_NAME(StreamsPrivateAbortFunction), - "tabs", - EXTENSION_FUNCTION_NAME(cefimpl::TabsGetFunction), - EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomFunction), - EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomFunction), - EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomSettingsFunction), - EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomSettingsFunction), + "resourcesPrivate", + EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction), + "streamsPrivate", + EXTENSION_FUNCTION_NAME(StreamsPrivateAbortFunction), + "tabs", + EXTENSION_FUNCTION_NAME(cefimpl::TabsGetFunction), + EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomFunction), + EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomFunction), + EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomSettingsFunction), + EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomSettingsFunction), }; for (size_t i = 0; i < arraysize(supported_apis); ++i) { if (name == supported_apis[i]) diff --git a/libcef/browser/extensions/component_extension_resource_manager.cc b/libcef/browser/extensions/component_extension_resource_manager.cc index 1929da16b..3d1017d7b 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.cc +++ b/libcef/browser/extensions/component_extension_resource_manager.cc @@ -12,9 +12,8 @@ namespace extensions { CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() { - AddComponentResourceEntries( - kComponentExtensionResources, - kComponentExtensionResourcesSize); + AddComponentResourceEntries(kComponentExtensionResources, + kComponentExtensionResourcesSize); } CefComponentExtensionResourceManager::~CefComponentExtensionResourceManager() {} @@ -45,12 +44,12 @@ void CefComponentExtensionResourceManager::AddComponentResourceEntries( const GritResourceMap* entries, size_t size) { for (size_t i = 0; i < size; ++i) { - base::FilePath resource_path = base::FilePath().AppendASCII( - entries[i].name); + base::FilePath resource_path = + base::FilePath().AppendASCII(entries[i].name); resource_path = resource_path.NormalizePathSeparators(); DCHECK(path_to_resource_id_.find(resource_path) == - path_to_resource_id_.end()); + path_to_resource_id_.end()); path_to_resource_id_[resource_path] = entries[i].value; } } diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index b0240ec9d..f318e402e 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -64,8 +64,7 @@ std::string GenerateId(const base::DictionaryValue* manifest, } // Implementation based on ComponentLoader::ParseManifest. -base::DictionaryValue* ParseManifest( - const std::string& manifest_contents) { +base::DictionaryValue* ParseManifest(const std::string& manifest_contents) { JSONStringValueDeserializer deserializer(manifest_contents); std::unique_ptr manifest(deserializer.Deserialize(NULL, NULL)); @@ -86,11 +85,9 @@ CefExtensionSystem::CefExtensionSystem(BrowserContext* browser_context) renderer_helper_( extensions::RendererStartupHelperFactory::GetForBrowserContext( browser_context)), - weak_ptr_factory_(this) { -} + weak_ptr_factory_(this) {} -CefExtensionSystem::~CefExtensionSystem() { -} +CefExtensionSystem::~CefExtensionSystem() {} void CefExtensionSystem::Init() { DCHECK(!initialized_); @@ -189,8 +186,7 @@ void CefExtensionSystem::RemoveExtension(const std::string& extension_id) { } } -void CefExtensionSystem::Shutdown() { -} +void CefExtensionSystem::Shutdown() {} void CefExtensionSystem::InitForRegularProfile(bool extensions_enabled) { DCHECK(!initialized_); @@ -254,14 +250,11 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts( // TODO(extensions): The |incognito_enabled| value should be set based on // manifest settings. BrowserThread::PostTaskAndReply( - BrowserThread::IO, - FROM_HERE, - base::Bind(&InfoMap::AddExtension, - info_map(), - base::RetainedRef(extension), - base::Time::Now(), - true, // incognito_enabled - false), // notifications_disabled + BrowserThread::IO, FROM_HERE, + base::Bind(&InfoMap::AddExtension, info_map(), + base::RetainedRef(extension), base::Time::Now(), + true, // incognito_enabled + false), // notifications_disabled callback); } @@ -271,8 +264,7 @@ void CefExtensionSystem::UnregisterExtensionWithRequestContexts( const std::string& extension_id, const UnloadedExtensionInfo::Reason reason) { BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, + BrowserThread::IO, FROM_HERE, base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); } @@ -295,11 +287,10 @@ void CefExtensionSystem::InstallUpdate(const std::string& extension_id, base::DeleteFile(temp_dir, true /* recursive */); } - CefExtensionSystem::ComponentExtensionInfo::ComponentExtensionInfo( - const base::DictionaryValue* manifest, const base::FilePath& directory) - : manifest(manifest), - root_directory(directory) { + const base::DictionaryValue* manifest, + const base::FilePath& directory) + : manifest(manifest), root_directory(directory) { if (!root_directory.IsAbsolute()) { // This path structure is required by // url_request_util::MaybeCreateURLRequestResourceBundleJob. @@ -311,16 +302,13 @@ CefExtensionSystem::ComponentExtensionInfo::ComponentExtensionInfo( // Implementation based on ComponentLoader::CreateExtension. scoped_refptr CefExtensionSystem::CreateExtension( - const ComponentExtensionInfo& info, std::string* utf8_error) { + const ComponentExtensionInfo& info, + std::string* utf8_error) { // TODO(abarth): We should REQUIRE_MODERN_MANIFEST_VERSION once we've updated // our component extensions to the new manifest version. int flags = Extension::REQUIRE_KEY; - return Extension::Create( - info.root_directory, - Manifest::COMPONENT, - *info.manifest, - flags, - utf8_error); + return Extension::Create(info.root_directory, Manifest::COMPONENT, + *info.manifest, flags, utf8_error); } // Implementation based on ComponentLoader::Load and @@ -343,9 +331,8 @@ const Extension* CefExtensionSystem::LoadExtension( } // Implementation based on ExtensionService::UnloadExtension. -void CefExtensionSystem::UnloadExtension( - const std::string& extension_id, - UnloadedExtensionInfo::Reason reason) { +void CefExtensionSystem::UnloadExtension(const std::string& extension_id, + UnloadedExtensionInfo::Reason reason) { // Make sure the extension gets deleted after we return from this function. int include_mask = ExtensionRegistry::EVERYTHING & ~ExtensionRegistry::TERMINATED; @@ -418,7 +405,7 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) { info.path = base::FilePath::FromUTF8Unsafe(extension->url().spec()); for (std::set::const_iterator mime_type = - handler->mime_type_set().begin(); + handler->mime_type_set().begin(); mime_type != handler->mime_type_set().end(); ++mime_type) { content::WebPluginMimeType mime_type_info; mime_type_info.mime_type = *mime_type; diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index 949faca98..c5f35e0bf 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -97,23 +97,22 @@ class CefExtensionSystem : public ExtensionSystem { }; scoped_refptr CreateExtension( - const ComponentExtensionInfo& info, std::string* utf8_error); + const ComponentExtensionInfo& info, + std::string* utf8_error); // Loads a registered component extension. const Extension* LoadExtension(const ComponentExtensionInfo& info); // Unload the specified extension. - void UnloadExtension( - const std::string& extension_id, - extensions::UnloadedExtensionInfo::Reason reason); + void UnloadExtension(const std::string& extension_id, + extensions::UnloadedExtensionInfo::Reason reason); // Handles sending notification that |extension| was loaded. void NotifyExtensionLoaded(const Extension* extension); // Handles sending notification that |extension| was unloaded. - void NotifyExtensionUnloaded( - const Extension* extension, - UnloadedExtensionInfo::Reason reason); + void NotifyExtensionUnloaded(const Extension* extension, + UnloadedExtensionInfo::Reason reason); // Completes extension loading after URLRequestContexts have been updated // on the IO thread. diff --git a/libcef/browser/extensions/extension_system_factory.cc b/libcef/browser/extensions/extension_system_factory.cc index b20cff187..ed8d9f120 100644 --- a/libcef/browser/extensions/extension_system_factory.cc +++ b/libcef/browser/extensions/extension_system_factory.cc @@ -35,8 +35,7 @@ CefExtensionSystemFactory::CefExtensionSystemFactory() DependsOn(ExtensionRegistryFactory::GetInstance()); } -CefExtensionSystemFactory::~CefExtensionSystemFactory() { -} +CefExtensionSystemFactory::~CefExtensionSystemFactory() {} KeyedService* CefExtensionSystemFactory::BuildServiceInstanceFor( BrowserContext* context) const { diff --git a/libcef/browser/extensions/extension_web_contents_observer.cc b/libcef/browser/extensions/extension_web_contents_observer.cc index 33de2f7e0..d5133f561 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.cc +++ b/libcef/browser/extensions/extension_web_contents_observer.cc @@ -15,11 +15,9 @@ namespace extensions { CefExtensionWebContentsObserver::CefExtensionWebContentsObserver( content::WebContents* web_contents) - : ExtensionWebContentsObserver(web_contents) { -} + : ExtensionWebContentsObserver(web_contents) {} -CefExtensionWebContentsObserver::~CefExtensionWebContentsObserver() { -} +CefExtensionWebContentsObserver::~CefExtensionWebContentsObserver() {} void CefExtensionWebContentsObserver::RenderViewCreated( content::RenderViewHost* render_view_host) { diff --git a/libcef/browser/extensions/extension_web_contents_observer.h b/libcef/browser/extensions/extension_web_contents_observer.h index 8f6614bc6..84e52ec38 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.h +++ b/libcef/browser/extensions/extension_web_contents_observer.h @@ -17,8 +17,7 @@ class CefExtensionWebContentsObserver private: friend class content::WebContentsUserData; - explicit CefExtensionWebContentsObserver( - content::WebContents* web_contents); + explicit CefExtensionWebContentsObserver(content::WebContents* web_contents); ~CefExtensionWebContentsObserver() override; // content::WebContentsObserver overrides. diff --git a/libcef/browser/extensions/extensions_api_client.cc b/libcef/browser/extensions/extensions_api_client.cc index daaa19eee..41b1b44a2 100644 --- a/libcef/browser/extensions/extensions_api_client.cc +++ b/libcef/browser/extensions/extensions_api_client.cc @@ -21,8 +21,7 @@ namespace extensions { -CefExtensionsAPIClient::CefExtensionsAPIClient() { -} +CefExtensionsAPIClient::CefExtensionsAPIClient() {} AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate() const { @@ -42,9 +41,8 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate( // to provide the *Impl object instead of |context| which may be a *Proxy // object. If we don't do this then the Delegate may attempt to access a // *Proxy object that has already been deleted. - return base::WrapUnique( - new extensions::ExtensionsGuestViewManagerDelegate( - CefBrowserContextImpl::GetForContext(context))); + return base::WrapUnique(new extensions::ExtensionsGuestViewManagerDelegate( + CefBrowserContextImpl::GetForContext(context))); } std::unique_ptr @@ -62,9 +60,8 @@ void CefExtensionsAPIClient::AttachWebContentsHelpers( // Used by the PDF extension. pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( - web_contents, - std::unique_ptr( - new CefPDFWebContentsHelperClient())); + web_contents, std::unique_ptr( + new CefPDFWebContentsHelperClient())); // Used by the tabs extension API. SessionTabHelper::CreateForWebContents(web_contents); diff --git a/libcef/browser/extensions/extensions_api_client.h b/libcef/browser/extensions/extensions_api_client.h index 356ba5dc0..5e83d963b 100644 --- a/libcef/browser/extensions/extensions_api_client.h +++ b/libcef/browser/extensions/extensions_api_client.h @@ -22,8 +22,8 @@ class CefExtensionsAPIClient : public ExtensionsAPIClient { std::unique_ptr CreateMimeHandlerViewGuestDelegate( MimeHandlerViewGuest* guest) const override; - void AttachWebContentsHelpers(content::WebContents* web_contents) const - override; + void AttachWebContentsHelpers( + content::WebContents* web_contents) const override; }; } // namespace extensions diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index 467425ed3..d8f098064 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -40,11 +40,9 @@ namespace extensions { CefExtensionsBrowserClient::CefExtensionsBrowserClient() : api_client_(new CefExtensionsAPIClient), - resource_manager_(new CefComponentExtensionResourceManager) { -} + resource_manager_(new CefComponentExtensionResourceManager) {} -CefExtensionsBrowserClient::~CefExtensionsBrowserClient() { -} +CefExtensionsBrowserClient::~CefExtensionsBrowserClient() {} bool CefExtensionsBrowserClient::IsShuttingDown() { return false; @@ -84,8 +82,7 @@ BrowserContext* CefExtensionsBrowserClient::GetOriginalContext( return chrome::GetBrowserContextRedirectedInIncognito(context); } -bool CefExtensionsBrowserClient::IsGuestSession( - BrowserContext* context) const { +bool CefExtensionsBrowserClient::IsGuestSession(BrowserContext* context) const { return false; } @@ -109,10 +106,7 @@ CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob( const std::string& content_security_policy, bool send_cors_header) { return chrome_url_request_util::MaybeCreateURLRequestResourceBundleJob( - request, - network_delegate, - directory_path, - content_security_policy, + request, network_delegate, directory_path, content_security_policy, send_cors_header); } @@ -145,11 +139,10 @@ PrefService* CefExtensionsBrowserClient::GetPrefServiceForContext( void CefExtensionsBrowserClient::GetEarlyExtensionPrefsObservers( content::BrowserContext* context, - std::vector* observers) const { -} + std::vector* observers) const {} -ProcessManagerDelegate* -CefExtensionsBrowserClient::GetProcessManagerDelegate() const { +ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate() + const { return NULL; } @@ -165,14 +158,13 @@ bool CefExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) { return false; } -void CefExtensionsBrowserClient::PermitExternalProtocolHandler() { -} +void CefExtensionsBrowserClient::PermitExternalProtocolHandler() {} bool CefExtensionsBrowserClient::IsRunningInForcedAppMode() { return false; } -bool CefExtensionsBrowserClient::IsLoggedInAsPublicAccount() { +bool CefExtensionsBrowserClient::IsLoggedInAsPublicAccount() { return false; } @@ -189,7 +181,7 @@ void CefExtensionsBrowserClient::RegisterExtensionFunctions( // CEF-only APIs. // TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See // libcef/common/extensions/api/README.txt for details. - //api::cef::CefGeneratedFunctionRegistry::RegisterAll(registry); + // api::cef::CefGeneratedFunctionRegistry::RegisterAll(registry); // Chrome APIs whitelisted by CEF. api::cef::ChromeFunctionRegistry::RegisterAll(registry); @@ -218,9 +210,9 @@ void CefExtensionsBrowserClient::BroadcastEventToRenderers( events::HistogramValue histogram_value, const std::string& event_name, std::unique_ptr args) { - g_browser_process->extension_event_router_forwarder()-> - BroadcastEventToRenderers(histogram_value, event_name, std::move(args), - GURL()); + g_browser_process->extension_event_router_forwarder() + ->BroadcastEventToRenderers(histogram_value, event_name, std::move(args), + GURL()); } net::NetLog* CefExtensionsBrowserClient::GetNetLog() { diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index 718cf9a8d..8ca8586ad 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -53,11 +53,9 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context) override; void GetEarlyExtensionPrefsObservers( content::BrowserContext* context, - std::vector* observers) const - override; + std::vector* observers) const override; ProcessManagerDelegate* GetProcessManagerDelegate() const override; - std::unique_ptr - CreateExtensionHostDelegate() override; + std::unique_ptr CreateExtensionHostDelegate() override; bool DidVersionUpdate(content::BrowserContext* context) override; void PermitExternalProtocolHandler() override; bool IsRunningInForcedAppMode() override; @@ -71,9 +69,10 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context) const override; const ComponentExtensionResourceManager* GetComponentExtensionResourceManager() override; - void BroadcastEventToRenderers(events::HistogramValue histogram_value, - const std::string& event_name, - std::unique_ptr args) override; + void BroadcastEventToRenderers( + events::HistogramValue histogram_value, + const std::string& event_name, + std::unique_ptr args) override; net::NetLog* GetNetLog() override; ExtensionCache* GetExtensionCache() override; bool IsBackgroundUpdateAllowed() override; diff --git a/libcef/browser/extensions/mime_handler_view_guest_delegate.cc b/libcef/browser/extensions/mime_handler_view_guest_delegate.cc index da3a1c829..10c52a669 100644 --- a/libcef/browser/extensions/mime_handler_view_guest_delegate.cc +++ b/libcef/browser/extensions/mime_handler_view_guest_delegate.cc @@ -32,11 +32,9 @@ CefRefPtr GetOwnerBrowser( CefMimeHandlerViewGuestDelegate::CefMimeHandlerViewGuestDelegate( MimeHandlerViewGuest* guest) - : guest_(guest) { -} + : guest_(guest) {} -CefMimeHandlerViewGuestDelegate::~CefMimeHandlerViewGuestDelegate() { -} +CefMimeHandlerViewGuestDelegate::~CefMimeHandlerViewGuestDelegate() {} void CefMimeHandlerViewGuestDelegate::OverrideWebContentsCreateParams( content::WebContents::CreateParams* params) { @@ -64,11 +62,9 @@ void CefMimeHandlerViewGuestDelegate::OnGuestAttached( // Associate guest state information with the owner browser. scoped_refptr info = owner_browser->browser_info(); info->guest_render_id_manager()->add_render_view_id( - view_host->GetProcess()->GetID(), - view_host->GetRoutingID()); + view_host->GetProcess()->GetID(), view_host->GetRoutingID()); info->guest_render_id_manager()->add_render_frame_id( - main_frame_host->GetProcess()->GetID(), - main_frame_host->GetRoutingID()); + main_frame_host->GetProcess()->GetID(), main_frame_host->GetRoutingID()); } void CefMimeHandlerViewGuestDelegate::OnGuestDetached( @@ -88,10 +84,9 @@ void CefMimeHandlerViewGuestDelegate::OnGuestDetached( // Disassociate guest state information with the owner browser. scoped_refptr info = owner_browser->browser_info(); info->guest_render_id_manager()->remove_render_view_id( - view_host->GetProcess()->GetID(), - view_host->GetRoutingID()); - info->guest_render_id_manager()->remove_render_frame_id( - render_process_id, render_frame_id); + view_host->GetProcess()->GetID(), view_host->GetRoutingID()); + info->guest_render_id_manager()->remove_render_frame_id(render_process_id, + render_frame_id); CefBrowserContext* context = static_cast(web_contents->GetBrowserContext()); @@ -107,8 +102,9 @@ bool CefMimeHandlerViewGuestDelegate::HandleContextMenu( content::ContextMenuParams new_params = params; gfx::Point guest_coordinates = - static_cast(web_contents)-> - GetBrowserPluginGuest()->GetScreenCoordinates(gfx::Point()); + static_cast(web_contents) + ->GetBrowserPluginGuest() + ->GetScreenCoordinates(gfx::Point()); // Adjust (x,y) position for offset from guest to embedder. new_params.x += guest_coordinates.x(); diff --git a/libcef/browser/extensions/pdf_extension_util.cc b/libcef/browser/extensions/pdf_extension_util.cc index 158f4e19d..9e72c5066 100644 --- a/libcef/browser/extensions/pdf_extension_util.cc +++ b/libcef/browser/extensions/pdf_extension_util.cc @@ -32,12 +32,12 @@ const char kPdfResourceIdentifier[] = "chromium-pdf"; const char kPdfPluginName[] = "Chrome PDF Viewer"; std::string GetManifest() { - std::string manifest_contents = - ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_PDF_MANIFEST).as_string(); + std::string manifest_contents = ResourceBundle::GetSharedInstance() + .GetRawDataResource(IDR_PDF_MANIFEST) + .as_string(); DCHECK(manifest_contents.find(kNameTag) != std::string::npos); - base::ReplaceFirstSubstringAfterOffset( - &manifest_contents, 0, kNameTag, kPdfPluginName); + base::ReplaceFirstSubstringAfterOffset(&manifest_contents, 0, kNameTag, + kPdfPluginName); return manifest_contents; } diff --git a/libcef/browser/extensions/pdf_web_contents_helper_client.cc b/libcef/browser/extensions/pdf_web_contents_helper_client.cc index fb3a951fd..678fcc6f9 100644 --- a/libcef/browser/extensions/pdf_web_contents_helper_client.cc +++ b/libcef/browser/extensions/pdf_web_contents_helper_client.cc @@ -6,23 +6,17 @@ namespace extensions { -CefPDFWebContentsHelperClient::CefPDFWebContentsHelperClient() { -} +CefPDFWebContentsHelperClient::CefPDFWebContentsHelperClient() {} -CefPDFWebContentsHelperClient::~CefPDFWebContentsHelperClient() { -} +CefPDFWebContentsHelperClient::~CefPDFWebContentsHelperClient() {} void CefPDFWebContentsHelperClient::UpdateContentRestrictions( content::WebContents* contents, - int content_restrictions) { -} + int content_restrictions) {} void CefPDFWebContentsHelperClient::OnPDFHasUnsupportedFeature( - content::WebContents* contents) { -} + content::WebContents* contents) {} -void CefPDFWebContentsHelperClient::OnSaveURL( - content::WebContents* contents) { -} +void CefPDFWebContentsHelperClient::OnSaveURL(content::WebContents* contents) {} } // namespace extensions diff --git a/libcef/browser/extensions/pdf_web_contents_helper_client.h b/libcef/browser/extensions/pdf_web_contents_helper_client.h index 642792606..6d42c9c24 100644 --- a/libcef/browser/extensions/pdf_web_contents_helper_client.h +++ b/libcef/browser/extensions/pdf_web_contents_helper_client.h @@ -10,8 +10,7 @@ namespace extensions { -class CefPDFWebContentsHelperClient - : public pdf::PDFWebContentsHelperClient { +class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient { public: CefPDFWebContentsHelperClient(); ~CefPDFWebContentsHelperClient() override; diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index dff2b4984..4cb3b6ea8 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -21,16 +21,15 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback { public: explicit CefFileDialogCallbackImpl( const CefFileDialogRunner::RunFileChooserCallback& callback) - : callback_(callback) { - } + : callback_(callback) {} ~CefFileDialogCallbackImpl() override { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. if (CEF_CURRENTLY_ON_UIT()) { CancelNow(callback_); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefFileDialogCallbackImpl::CancelNow, callback_)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefFileDialogCallbackImpl::CancelNow, + callback_)); } } } @@ -50,8 +49,8 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefFileDialogCallbackImpl::Continue, this, - selected_accept_filter, file_paths)); + base::Bind(&CefFileDialogCallbackImpl::Continue, this, + selected_accept_filter, file_paths)); } } @@ -63,17 +62,13 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefFileDialogCallbackImpl::Cancel, this)); + base::Bind(&CefFileDialogCallbackImpl::Cancel, this)); } } - bool IsConnected() { - return !callback_.is_null(); - } + bool IsConnected() { return !callback_.is_null(); } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void CancelNow( @@ -88,10 +83,9 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback { IMPLEMENT_REFCOUNTING(CefFileDialogCallbackImpl); }; -void RunFileDialogDismissed( - CefRefPtr callback, - int selected_accept_filter, - const std::vector& file_paths) { +void RunFileDialogDismissed(CefRefPtr callback, + int selected_accept_filter, + const std::vector& file_paths) { std::vector paths; if (file_paths.size() > 0) { for (size_t i = 0; i < file_paths.size(); ++i) @@ -100,13 +94,12 @@ void RunFileDialogDismissed( callback->OnFileDialogDismissed(selected_accept_filter, paths); } -class UploadFolderHelper : - public net::DirectoryLister::DirectoryListerDelegate { +class UploadFolderHelper + : public net::DirectoryLister::DirectoryListerDelegate { public: explicit UploadFolderHelper( const CefFileDialogRunner::RunFileChooserCallback& callback) - : callback_(callback) { - } + : callback_(callback) {} ~UploadFolderHelper() override { if (!callback_.is_null()) { @@ -114,7 +107,7 @@ class UploadFolderHelper : CancelNow(callback_); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&UploadFolderHelper::CancelNow, callback_)); + base::Bind(&UploadFolderHelper::CancelNow, callback_)); } } } @@ -162,8 +155,7 @@ CefFileDialogManager::CefFileDialogManager( DCHECK(web_contents()); } -CefFileDialogManager::~CefFileDialogManager() { -} +CefFileDialogManager::~CefFileDialogManager() {} void CefFileDialogManager::Destroy() { DCHECK(!file_chooser_pending_); @@ -171,12 +163,12 @@ void CefFileDialogManager::Destroy() { } void CefFileDialogManager::RunFileDialog( - cef_file_dialog_mode_t mode, - const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, - int selected_accept_filter, - CefRefPtr callback) { + cef_file_dialog_mode_t mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) { DCHECK(callback.get()); if (!callback.get()) return; @@ -231,9 +223,9 @@ void CefFileDialogManager::RunFileChooser( &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, weak_ptr_factory_.GetWeakPtr(), params.mode); } else { - callback = base::Bind( - &CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode); + callback = + base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), params.mode); } RunFileChooserInternal(render_frame_host, cef_params, callback); @@ -303,13 +295,9 @@ void CefFileDialogManager::RunFileChooserInternal( CefRefPtr callbackImpl( new CefFileDialogCallbackImpl(callback)); handled = handler->OnFileDialog( - browser_, - static_cast(mode), - params.title, - params.default_file_name.value(), - accept_filters, - params.selected_accept_filter, - callbackImpl.get()); + browser_, static_cast(mode), params.title, + params.default_file_name.value(), accept_filters, + params.selected_accept_filter, callbackImpl.get()); if (!handled) { if (callbackImpl->IsConnected()) { callbackImpl->Disconnect(); @@ -342,7 +330,7 @@ void CefFileDialogManager::OnRunFileChooserCallback( // Execute the callback asynchronously. CEF_POST_TASK(CEF_UIT, - base::Bind(callback, selected_accept_filter, file_paths)); + base::Bind(callback, selected_accept_filter, file_paths)); } void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( @@ -357,8 +345,7 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( OnRunFileChooserDelegateCallback(mode, selected_accept_filter, file_paths); } else { lister_.reset(new net::DirectoryLister( - file_paths[0], - net::DirectoryLister::NO_SORT_RECURSIVE, + file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE, new UploadFolderHelper( base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, weak_ptr_factory_.GetWeakPtr(), mode)))); diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index de93d3113..c11a2177f 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -27,9 +27,8 @@ class CefBrowserHostImpl; class CefFileDialogManager : public content::WebContentsObserver { public: // |runner| may be NULL if the platform doesn't implement dialogs. - CefFileDialogManager( - CefBrowserHostImpl* browser, - std::unique_ptr runner); + CefFileDialogManager(CefBrowserHostImpl* browser, + std::unique_ptr runner); ~CefFileDialogManager() override; // Delete the runner to free any platform constructs. @@ -37,19 +36,17 @@ class CefFileDialogManager : public content::WebContentsObserver { // Called from CefBrowserHostImpl::RunFileChooser. // See CefBrowserHost::RunFileDialog documentation. - void RunFileDialog( - cef_file_dialog_mode_t mode, - const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, - int selected_accept_filter, - CefRefPtr callback); + void RunFileDialog(cef_file_dialog_mode_t mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback); // Called from CefBrowserHostImpl::RunFileChooser. // See WebContentsDelegate::RunFileChooser documentation. - void RunFileChooser( - content::RenderFrameHost* render_frame_host, - const content::FileChooserParams& params); + void RunFileChooser(content::RenderFrameHost* render_frame_host, + const content::FileChooserParams& params); // Run the file chooser dialog specified by |params|. Only a single dialog may // be pending at any given time. |callback| will be executed asynchronously @@ -89,8 +86,7 @@ class CefFileDialogManager : public content::WebContentsObserver { void Cleanup(); // WebContentsObserver methods: - void RenderFrameDeleted( - content::RenderFrameHost* render_frame_host) override; + void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; // CefBrowserHostImpl pointer is guaranteed to outlive this object. CefBrowserHostImpl* browser_; diff --git a/libcef/browser/file_dialog_runner.h b/libcef/browser/file_dialog_runner.h index 912644c58..c06d0ba08 100644 --- a/libcef/browser/file_dialog_runner.h +++ b/libcef/browser/file_dialog_runner.h @@ -9,8 +9,8 @@ #include -#include "base/files/file_path.h" #include "base/callback.h" +#include "base/files/file_path.h" #include "content/public/common/file_chooser_params.h" class CefBrowserHostImpl; diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index a626a9303..575117a67 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -2,12 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "libcef/browser/frame_host_impl.h" #include "include/cef_request.h" #include "include/cef_stream.h" #include "include/cef_v8.h" -#include "libcef/common/cef_messages.h" #include "libcef/browser/browser_host_impl.h" +#include "libcef/browser/frame_host_impl.h" +#include "libcef/common/cef_messages.h" namespace { @@ -15,11 +15,11 @@ namespace { class StringVisitHandler : public CefResponseManager::Handler { public: explicit StringVisitHandler(CefRefPtr visitor) - : visitor_(visitor) { - } + : visitor_(visitor) {} void OnResponse(const Cef_Response_Params& params) override { visitor_->Visit(params.response); } + private: CefRefPtr visitor_; @@ -29,16 +29,15 @@ class StringVisitHandler : public CefResponseManager::Handler { // Implementation of CommandResponseHandler for calling ViewText(). class ViewTextHandler : public CefResponseManager::Handler { public: - explicit ViewTextHandler(CefRefPtr frame) - : frame_(frame) { - } + explicit ViewTextHandler(CefRefPtr frame) : frame_(frame) {} void OnResponse(const Cef_Response_Params& params) override { CefRefPtr browser = frame_->GetBrowser(); if (browser.get()) { - static_cast(browser.get())->ViewText( - params.response); + static_cast(browser.get()) + ->ViewText(params.response); } } + private: CefRefPtr frame_; @@ -59,12 +58,11 @@ CefFrameHostImpl::CefFrameHostImpl(CefBrowserHostImpl* browser, is_focused_(is_main_frame_), // The main frame always starts focused. url_(url), name_(name), - parent_frame_id_(parent_frame_id == kUnspecifiedFrameId ? - kInvalidFrameId : parent_frame_id) { -} + parent_frame_id_(parent_frame_id == kUnspecifiedFrameId + ? kInvalidFrameId + : parent_frame_id) {} -CefFrameHostImpl::~CefFrameHostImpl() { -} +CefFrameHostImpl::~CefFrameHostImpl() {} bool CefFrameHostImpl::IsValid() { base::AutoLock lock_scope(state_lock_); @@ -234,10 +232,9 @@ void CefFrameHostImpl::VisitDOM(CefRefPtr visitor) { NOTREACHED() << "VisitDOM cannot be called from the browser process"; } -void CefFrameHostImpl::SendJavaScript( - const std::string& jsCode, - const std::string& scriptUrl, - int startLine) { +void CefFrameHostImpl::SendJavaScript(const std::string& jsCode, + const std::string& scriptUrl, + int startLine) { if (jsCode.empty()) return; if (startLine <= 0) { diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index 6565620a1..16943514d 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -7,8 +7,10 @@ #pragma once #include + #include "include/cef_frame.h" #include "libcef/common/response_manager.h" + #include "base/synchronization/lock.h" class CefBrowserHostImpl; @@ -19,11 +21,11 @@ class CefBrowserHostImpl; class CefFrameHostImpl : public CefFrame { public: CefFrameHostImpl(CefBrowserHostImpl* browser, - int64 frame_id, - bool is_main_frame, - const CefString& url, - const CefString& name, - int64 parent_frame_id); + int64 frame_id, + bool is_main_frame, + const CefString& url, + const CefString& name, + int64 parent_frame_id); ~CefFrameHostImpl() override; // CefFrame methods @@ -40,8 +42,7 @@ class CefFrameHostImpl : public CefFrame { void GetText(CefRefPtr visitor) override; void LoadRequest(CefRefPtr request) override; void LoadURL(const CefString& url) override; - void LoadString(const CefString& string, - const CefString& url) override; + void LoadString(const CefString& string, const CefString& url) override; void ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) override; diff --git a/libcef/browser/geolocation_impl.cc b/libcef/browser/geolocation_impl.cc index 28922cfee..5d4ac62a2 100644 --- a/libcef/browser/geolocation_impl.cc +++ b/libcef/browser/geolocation_impl.cc @@ -6,14 +6,15 @@ #include "libcef/browser/context.h" #include "libcef/browser/thread_util.h" #include "libcef/common/time_util.h" + #include "base/logging.h" #include "device/geolocation/geolocation_provider.h" #include "device/geolocation/geoposition.h" namespace { -class CefLocationRequest : - public base::RefCountedThreadSafe { +class CefLocationRequest + : public base::RefCountedThreadSafe { public: explicit CefLocationRequest(CefRefPtr callback) : callback_(callback) { @@ -99,7 +100,7 @@ bool CefGetGeolocation(CefRefPtr callback) { return false; } else { CEF_POST_TASK(CEF_UIT, - base::Bind(base::IgnoreResult(CefGetGeolocation), callback)); + base::Bind(base::IgnoreResult(CefGetGeolocation), callback)); return true; } } diff --git a/libcef/browser/image_impl.cc b/libcef/browser/image_impl.cc index 0ba906860..b36d4fca9 100644 --- a/libcef/browser/image_impl.cc +++ b/libcef/browser/image_impl.cc @@ -49,13 +49,12 @@ bool PNGMethod(bool with_transparency, std::vector* compressed) { return gfx::PNGCodec::Encode( reinterpret_cast(bitmap.getPixels()), - bitmap.colorType() == kBGRA_8888_SkColorType ? - gfx::PNGCodec::FORMAT_BGRA : gfx::PNGCodec::FORMAT_RGBA, + bitmap.colorType() == kBGRA_8888_SkColorType ? gfx::PNGCodec::FORMAT_BGRA + : gfx::PNGCodec::FORMAT_RGBA, gfx::Size(bitmap.width(), bitmap.height()), static_cast(bitmap.rowBytes()), bitmap.alphaType() == kOpaque_SkAlphaType || !with_transparency, - std::vector(), - compressed); + std::vector(), compressed); } // Compress as JPEG. This internally uses JCS_EXT_RGBX or JCS_EXT_BGRX which @@ -65,13 +64,11 @@ bool JPEGMethod(int quality, std::vector* compressed) { return gfx::JPEGCodec::Encode( reinterpret_cast(bitmap.getPixels()), - bitmap.colorType() == kBGRA_8888_SkColorType ? - gfx::JPEGCodec::FORMAT_BGRA : gfx::JPEGCodec::FORMAT_RGBA, - bitmap.width(), - bitmap.height(), - static_cast(bitmap.rowBytes()), - quality, - compressed); + bitmap.colorType() == kBGRA_8888_SkColorType + ? gfx::JPEGCodec::FORMAT_BGRA + : gfx::JPEGCodec::FORMAT_RGBA, + bitmap.width(), bitmap.height(), static_cast(bitmap.rowBytes()), + quality, compressed); } } // namespace @@ -124,7 +121,7 @@ bool CefImageImpl::AddBitmap(float scale_factor, CEF_REQUIRE_UIT_RETURN(false); const SkColorType ct = GetSkColorType(color_type); const SkAlphaType at = GetSkAlphaType(alpha_type); - + // Make sure the client passed in the expected values. if (ct != kBGRA_8888_SkColorType && ct != kRGBA_8888_SkColorType) return false; @@ -166,9 +163,8 @@ bool CefImageImpl::AddJPEG(float scale_factor, size_t jpeg_data_size) { CEF_REQUIRE_UIT_RETURN(false); - std::unique_ptr bitmap( - gfx::JPEGCodec::Decode(static_cast(jpeg_data), - jpeg_data_size)); + std::unique_ptr bitmap(gfx::JPEGCodec::Decode( + static_cast(jpeg_data), jpeg_data_size)); if (!bitmap.get()) return false; @@ -219,12 +215,11 @@ bool CefImageImpl::GetRepresentationInfo(float scale_factor, return true; } -CefRefPtr CefImageImpl::GetAsBitmap( - float scale_factor, - cef_color_type_t color_type, - cef_alpha_type_t alpha_type, - int& pixel_width, - int& pixel_height) { +CefRefPtr CefImageImpl::GetAsBitmap(float scale_factor, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + int& pixel_width, + int& pixel_height) { CEF_REQUIRE_UIT_RETURN(nullptr); const SkColorType desired_ct = GetSkColorType(color_type); @@ -307,8 +302,8 @@ void CefImageImpl::AddBitmaps(int32_t scale_1x_size, for (const SkBitmap& bitmap : bitmaps) { const int32_t size = std::max(bitmap.width(), bitmap.height()); - const float scale_factor = static_cast(size) / - static_cast(scale_1x_size); + const float scale_factor = + static_cast(size) / static_cast(scale_1x_size); AddBitmap(scale_factor, bitmap); } } @@ -327,8 +322,7 @@ gfx::ImageSkia CefImageImpl::GetForced1xScaleRepresentation( return image_skia; } -bool CefImageImpl::AddBitmap(float scale_factor, - const SkBitmap& bitmap) { +bool CefImageImpl::AddBitmap(float scale_factor, const SkBitmap& bitmap) { #if DCHECK_IS_ON() { SkAutoLockPixels bitmap_lock(bitmap); @@ -370,9 +364,8 @@ bool CefImageImpl::ConvertBitmap(const SkBitmap& src_bitmap, src_bitmap.alphaType() != target_at); DCHECK(target_bitmap); - SkImageInfo target_info = - SkImageInfo::Make(src_bitmap.width(), src_bitmap.height(), target_ct, - target_at); + SkImageInfo target_info = SkImageInfo::Make( + src_bitmap.width(), src_bitmap.height(), target_ct, target_at); if (!target_bitmap->tryAllocPixels(target_info)) return false; diff --git a/libcef/browser/image_impl.h b/libcef/browser/image_impl.h index be9fb19da..a687ceded 100644 --- a/libcef/browser/image_impl.h +++ b/libcef/browser/image_impl.h @@ -67,8 +67,7 @@ class CefImageImpl : public CefImage { // |scale_1x_size| is the size in pixels of the 1x factor image. If // |scale_1x_size| is 0 the smallest image size in pixels will be used as the // 1x factor size. - void AddBitmaps(int32_t scale_1x_size, - const std::vector& bitmaps); + void AddBitmaps(int32_t scale_1x_size, const std::vector& bitmaps); // Return a representation of this Image that contains only the bitmap nearest // |scale_factor| as the 1x scale representation. Conceptually this is an @@ -81,8 +80,7 @@ class CefImageImpl : public CefImage { private: // Add a bitmap. - bool AddBitmap(float scale_factor, - const SkBitmap& bitmap); + bool AddBitmap(float scale_factor, const SkBitmap& bitmap); // Returns the bitmap that most closely matches |scale_factor| or nullptr if // one doesn't exist. diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index cedce7e6f..813683144 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -21,37 +21,32 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { public: CefJSDialogCallbackImpl( const content::JavaScriptDialogManager::DialogClosedCallback& callback) - : callback_(callback) { - } + : callback_(callback) {} ~CefJSDialogCallbackImpl() override { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. if (CEF_CURRENTLY_ON_UIT()) { CancelNow(callback_); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefJSDialogCallbackImpl::CancelNow, callback_)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::CancelNow, + callback_)); } } } - void Continue(bool success, - const CefString& user_input) override { + void Continue(bool success, const CefString& user_input) override { if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { callback_.Run(success, user_input); callback_.Reset(); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefJSDialogCallbackImpl::Continue, this, success, - user_input)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::Continue, + this, success, user_input)); } } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void CancelNow( @@ -67,18 +62,15 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { } // namespace - CefJavaScriptDialogManager::CefJavaScriptDialogManager( CefBrowserHostImpl* browser, std::unique_ptr runner) : browser_(browser), runner_(std::move(runner)), dialog_running_(false), - weak_ptr_factory_(this) { -} + weak_ptr_factory_(this) {} -CefJavaScriptDialogManager::~CefJavaScriptDialogManager() { -} +CefJavaScriptDialogManager::~CefJavaScriptDialogManager() {} void CefJavaScriptDialogManager::Destroy() { if (runner_.get()) { @@ -105,10 +97,10 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( new CefJSDialogCallbackImpl(callback)); // Execute the user callback. - bool handled = handler->OnJSDialog(browser_, origin_url.spec(), - static_cast(message_type), - message_text, default_prompt_text, callbackPtr.get(), - *did_suppress_message); + bool handled = handler->OnJSDialog( + browser_, origin_url.spec(), + static_cast(message_type), message_text, + default_prompt_text, callbackPtr.get(), *did_suppress_message); if (handled) { // Invalid combination of values. Crash sooner rather than later. CHECK(!*did_suppress_message); @@ -166,8 +158,8 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( new CefJSDialogCallbackImpl(callback)); // Execute the user callback. - bool handled = handler->OnBeforeUnloadDialog(browser_, message_text, - is_reload, callbackPtr.get()); + bool handled = handler->OnBeforeUnloadDialog( + browser_, message_text, is_reload, callbackPtr.get()); if (handled) return; @@ -186,8 +178,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( dialog_running_ = true; - runner_->Run(browser_, - content::JAVASCRIPT_DIALOG_TYPE_CONFIRM, + runner_->Run(browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM, base::string16(), // display_url message_text, base::string16(), // default_prompt_text diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index 683e47aa3..7178c09d8 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -20,27 +20,24 @@ class CefBrowserHostImpl; class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { public: // |runner| may be NULL if the platform doesn't implement dialogs. - CefJavaScriptDialogManager( - CefBrowserHostImpl* browser, - std::unique_ptr runner); + CefJavaScriptDialogManager(CefBrowserHostImpl* browser, + std::unique_ptr runner); ~CefJavaScriptDialogManager() override; // Delete the runner to free any platform constructs. void Destroy(); // JavaScriptDialogManager methods. - void RunJavaScriptDialog( - content::WebContents* web_contents, - const GURL& origin_url, - content::JavaScriptDialogType message_type, - const base::string16& message_text, - const base::string16& default_prompt_text, - const DialogClosedCallback& callback, - bool* did_suppress_message) override; - void RunBeforeUnloadDialog( - content::WebContents* web_contents, - bool is_reload, - const DialogClosedCallback& callback) override; + void RunJavaScriptDialog(content::WebContents* web_contents, + const GURL& origin_url, + content::JavaScriptDialogType message_type, + const base::string16& message_text, + const base::string16& default_prompt_text, + const DialogClosedCallback& callback, + bool* did_suppress_message) override; + void RunBeforeUnloadDialog(content::WebContents* web_contents, + bool is_reload, + const DialogClosedCallback& callback) override; void CancelDialogs(content::WebContents* web_contents, bool reset_state) override; diff --git a/libcef/browser/javascript_dialog_runner.h b/libcef/browser/javascript_dialog_runner.h index f6a58c6e5..7056b7428 100644 --- a/libcef/browser/javascript_dialog_runner.h +++ b/libcef/browser/javascript_dialog_runner.h @@ -17,16 +17,15 @@ class CefJavaScriptDialogRunner { public: typedef base::Callback - DialogClosedCallback; + DialogClosedCallback; // Run the dialog. Execute |callback| on completion. - virtual void Run( - CefBrowserHostImpl* browser, - content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, - const DialogClosedCallback& callback) = 0; + virtual void Run(CefBrowserHostImpl* browser, + content::JavaScriptDialogType message_type, + const base::string16& display_url, + const base::string16& message_text, + const base::string16& default_prompt_text, + const DialogClosedCallback& callback) = 0; // Cancel a dialog mid-flight. virtual void Cancel() = 0; diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index 39ea5364e..bc2ba4391 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -33,9 +33,8 @@ const content::MediaStreamDevice* FindDefaultDeviceWithId( } // namespace - CefMediaCaptureDevicesDispatcher* - CefMediaCaptureDevicesDispatcher::GetInstance() { +CefMediaCaptureDevicesDispatcher::GetInstance() { return base::Singleton::get(); } @@ -95,11 +94,9 @@ void CefMediaCaptureDevicesDispatcher::GetRequestedDevice( } } -void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged() { -} +void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged() {} -void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged() { -} +void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged() {} void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( int render_process_id, @@ -107,21 +104,18 @@ void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( int page_request_id, const GURL& security_origin, content::MediaStreamType stream_type, - content::MediaRequestState state) { -} + content::MediaRequestState state) {} void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( int render_process_id, - int render_view_id) { -} + int render_view_id) {} void CefMediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured( int render_process_id, int render_frame_id, int page_request_id, content::MediaStreamType stream_type, - bool is_secure) { -} + bool is_secure) {} const MediaStreamDevices& CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() { diff --git a/libcef/browser/media_capture_devices_dispatcher.h b/libcef/browser/media_capture_devices_dispatcher.h index 729f8fe2b..3abaffea9 100644 --- a/libcef/browser/media_capture_devices_dispatcher.h +++ b/libcef/browser/media_capture_devices_dispatcher.h @@ -43,20 +43,19 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { // Overridden from content::MediaObserver: void OnAudioCaptureDevicesChanged() override; void OnVideoCaptureDevicesChanged() override; - void OnMediaRequestStateChanged( - int render_process_id, - int render_frame_id, - int page_request_id, - const GURL& security_origin, - content::MediaStreamType stream_type, - content::MediaRequestState state) override; - void OnCreatingAudioStream(int render_process_id, - int render_view_id) override; - void OnSetCapturingLinkSecured(int render_process_id, + void OnMediaRequestStateChanged(int render_process_id, int render_frame_id, int page_request_id, + const GURL& security_origin, content::MediaStreamType stream_type, - bool is_secure) override; + content::MediaRequestState state) override; + void OnCreatingAudioStream(int render_process_id, + int render_view_id) override; + void OnSetCapturingLinkSecured(int render_process_id, + int render_frame_id, + int page_request_id, + content::MediaStreamType stream_type, + bool is_secure) override; private: friend struct base::DefaultSingletonTraits; diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index b869969ca..66ed86e58 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -34,11 +34,10 @@ const cef_event_flags_t kEmptyEventFlags = static_cast(0); class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { public: - typedef base::Callback Callback; + typedef base::Callback Callback; explicit CefRunContextMenuCallbackImpl(const Callback& callback) - : callback_(callback) { - } + : callback_(callback) {} ~CefRunContextMenuCallbackImpl() { if (!callback_.is_null()) { @@ -46,7 +45,8 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { if (CEF_CURRENTLY_ON_UIT()) { RunNow(callback_, kInvalidCommandId, kEmptyEventFlags); } else { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefRunContextMenuCallbackImpl::RunNow, callback_, kInvalidCommandId, kEmptyEventFlags)); } @@ -61,18 +61,14 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefRunContextMenuCallbackImpl::Continue, this, - command_id, event_flags)); + base::Bind(&CefRunContextMenuCallbackImpl::Continue, this, + command_id, event_flags)); } } - void Cancel() override { - Continue(kInvalidCommandId, kEmptyEventFlags); - } + void Cancel() override { Continue(kInvalidCommandId, kEmptyEventFlags); } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void RunNow(const Callback& callback, @@ -92,11 +88,11 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser, std::unique_ptr runner) - : content::WebContentsObserver(browser->web_contents()), - browser_(browser), - runner_(std::move(runner)), - custom_menu_callback_(NULL), - weak_ptr_factory_(this) { + : content::WebContentsObserver(browser->web_contents()), + browser_(browser), + runner_(std::move(runner)), + custom_menu_callback_(NULL), + weak_ptr_factory_(this) { DCHECK(web_contents()); DCHECK(runner_.get()); model_ = new CefMenuModelImpl(this, nullptr, false); @@ -145,17 +141,14 @@ bool CefMenuManager::CreateContextMenu( // Give the client a chance to modify the model. CefRefPtr client = browser_->GetClient(); if (client.get()) { - CefRefPtr handler = - client->GetContextMenuHandler(); + CefRefPtr handler = client->GetContextMenuHandler(); if (handler.get()) { CefRefPtr paramsPtr( new CefContextMenuParamsImpl(¶ms_)); CefRefPtr frame = browser_->GetFocusedFrame(); - handler->OnBeforeContextMenu(browser_, - frame, - paramsPtr.get(), - model_.get()); + handler->OnBeforeContextMenu(browser_, frame, paramsPtr.get(), + model_.get()); MenuWillShow(model_); @@ -163,17 +156,14 @@ bool CefMenuManager::CreateContextMenu( CefRefPtr callbackImpl( new CefRunContextMenuCallbackImpl( base::Bind(&CefMenuManager::ExecuteCommandCallback, - weak_ptr_factory_.GetWeakPtr()))); + weak_ptr_factory_.GetWeakPtr()))); // This reference will be cleared when the callback is executed or // the callback object is deleted. custom_menu_callback_ = callbackImpl.get(); - if (handler->RunContextMenu(browser_, - frame, - paramsPtr.get(), - model_.get(), - callbackImpl.get())) { + if (handler->RunContextMenu(browser_, frame, paramsPtr.get(), + model_.get(), callbackImpl.get())) { custom_menu = true; } else { // Callback should not be executed if the handler returns false. @@ -216,17 +206,13 @@ void CefMenuManager::ExecuteCommand(CefRefPtr source, // Give the client a chance to handle the command. CefRefPtr client = browser_->GetClient(); if (client.get()) { - CefRefPtr handler = - client->GetContextMenuHandler(); + CefRefPtr handler = client->GetContextMenuHandler(); if (handler.get()) { CefRefPtr paramsPtr( new CefContextMenuParamsImpl(¶ms_)); bool handled = handler->OnContextMenuCommand( - browser_, - browser_->GetFocusedFrame(), - paramsPtr.get(), - command_id, + browser_, browser_->GetFocusedFrame(), paramsPtr.get(), command_id, event_flags); // Do not keep references to the parameters in the callback. @@ -274,8 +260,7 @@ void CefMenuManager::MenuClosed(CefRefPtr source) { // Notify the client. CefRefPtr client = browser_->GetClient(); if (client.get()) { - CefRefPtr handler = - client->GetContextMenuHandler(); + CefRefPtr handler = client->GetContextMenuHandler(); if (handler.get()) { handler->OnContextMenuDismissed(browser_, browser_->GetFocusedFrame()); } @@ -347,34 +332,31 @@ void CefMenuManager::CreateDefaultModel() { if (!(params_.edit_flags & CM_EDITFLAG_CAN_SELECT_ALL)) model_->SetEnabled(MENU_ID_SELECT_ALL, false); - if(!params_.misspelled_word.empty()) { + if (!params_.misspelled_word.empty()) { // Always add a separator before the list of dictionary suggestions or // "No spelling suggestions". model_->AddSeparator(); if (!params_.dictionary_suggestions.empty()) { - for (size_t i = 0; - i < params_.dictionary_suggestions.size() && - MENU_ID_SPELLCHECK_SUGGESTION_0 + i <= - MENU_ID_SPELLCHECK_SUGGESTION_LAST; + for (size_t i = 0; i < params_.dictionary_suggestions.size() && + MENU_ID_SPELLCHECK_SUGGESTION_0 + i <= + MENU_ID_SPELLCHECK_SUGGESTION_LAST; ++i) { model_->AddItem(MENU_ID_SPELLCHECK_SUGGESTION_0 + static_cast(i), - params_.dictionary_suggestions[i].c_str()); + params_.dictionary_suggestions[i].c_str()); } // When there are dictionary suggestions add a separator before "Add to // dictionary". model_->AddSeparator(); } else { - model_->AddItem( - MENU_ID_NO_SPELLING_SUGGESTIONS, - GetLabel(IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS)); + model_->AddItem(MENU_ID_NO_SPELLING_SUGGESTIONS, + GetLabel(IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS)); model_->SetEnabled(MENU_ID_NO_SPELLING_SUGGESTIONS, false); } - model_->AddItem( - MENU_ID_ADD_TO_DICTIONARY, - GetLabel(IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY)); + model_->AddItem(MENU_ID_ADD_TO_DICTIONARY, + GetLabel(IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY)); } } else if (!params_.selection_text.empty()) { // Something is selected. @@ -418,65 +400,65 @@ void CefMenuManager::ExecuteDefaultCommand(int command_id) { } switch (command_id) { - // Navigation. - case MENU_ID_BACK: - browser_->GoBack(); - break; - case MENU_ID_FORWARD: - browser_->GoForward(); - break; - case MENU_ID_RELOAD: - browser_->Reload(); - break; - case MENU_ID_RELOAD_NOCACHE: - browser_->ReloadIgnoreCache(); - break; - case MENU_ID_STOPLOAD: - browser_->StopLoad(); - break; + // Navigation. + case MENU_ID_BACK: + browser_->GoBack(); + break; + case MENU_ID_FORWARD: + browser_->GoForward(); + break; + case MENU_ID_RELOAD: + browser_->Reload(); + break; + case MENU_ID_RELOAD_NOCACHE: + browser_->ReloadIgnoreCache(); + break; + case MENU_ID_STOPLOAD: + browser_->StopLoad(); + break; - // Editing. - case MENU_ID_UNDO: - browser_->GetFocusedFrame()->Undo(); - break; - case MENU_ID_REDO: - browser_->GetFocusedFrame()->Redo(); - break; - case MENU_ID_CUT: - browser_->GetFocusedFrame()->Cut(); - break; - case MENU_ID_COPY: - browser_->GetFocusedFrame()->Copy(); - break; - case MENU_ID_PASTE: - browser_->GetFocusedFrame()->Paste(); - break; - case MENU_ID_DELETE: - browser_->GetFocusedFrame()->Delete(); - break; - case MENU_ID_SELECT_ALL: - browser_->GetFocusedFrame()->SelectAll(); - break; + // Editing. + case MENU_ID_UNDO: + browser_->GetFocusedFrame()->Undo(); + break; + case MENU_ID_REDO: + browser_->GetFocusedFrame()->Redo(); + break; + case MENU_ID_CUT: + browser_->GetFocusedFrame()->Cut(); + break; + case MENU_ID_COPY: + browser_->GetFocusedFrame()->Copy(); + break; + case MENU_ID_PASTE: + browser_->GetFocusedFrame()->Paste(); + break; + case MENU_ID_DELETE: + browser_->GetFocusedFrame()->Delete(); + break; + case MENU_ID_SELECT_ALL: + browser_->GetFocusedFrame()->SelectAll(); + break; - // Miscellaneous. - case MENU_ID_FIND: - // TODO(cef): Implement. - NOTIMPLEMENTED(); - break; - case MENU_ID_PRINT: - browser_->Print(); - break; - case MENU_ID_VIEW_SOURCE: - browser_->GetFocusedFrame()->ViewSource(); - break; + // Miscellaneous. + case MENU_ID_FIND: + // TODO(cef): Implement. + NOTIMPLEMENTED(); + break; + case MENU_ID_PRINT: + browser_->Print(); + break; + case MENU_ID_VIEW_SOURCE: + browser_->GetFocusedFrame()->ViewSource(); + break; - // Spell checking. - case MENU_ID_ADD_TO_DICTIONARY: - browser_->GetHost()->AddWordToDictionary(params_.misspelled_word); - break; + // Spell checking. + case MENU_ID_ADD_TO_DICTIONARY: + browser_->GetHost()->AddWordToDictionary(params_.misspelled_word); + break; - default: - break; + default: + break; } } diff --git a/libcef/browser/menu_manager.h b/libcef/browser/menu_manager.h index 8f21abe07..4ef302242 100644 --- a/libcef/browser/menu_manager.h +++ b/libcef/browser/menu_manager.h @@ -49,8 +49,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, bool FormatLabel(CefRefPtr source, base::string16& label) override; - void ExecuteCommandCallback(int command_id, - cef_event_flags_t event_flags); + void ExecuteCommandCallback(int command_id, cef_event_flags_t event_flags); // Create the default menu model. void CreateDefaultModel(); diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index d319329a9..4b8d741d7 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -30,34 +30,28 @@ class CefSimpleMenuModel : public ui::MenuModel { // The Delegate can be NULL, though if it is items can't be checked or // disabled. explicit CefSimpleMenuModel(CefMenuModelImpl* impl) - : impl_(impl), - menu_model_delegate_(NULL) { - } + : impl_(impl), menu_model_delegate_(NULL) {} // MenuModel methods. - bool HasIcons() const override { - return false; - } + bool HasIcons() const override { return false; } - int GetItemCount() const override { - return impl_->GetCount(); - } + int GetItemCount() const override { return impl_->GetCount(); } ItemType GetTypeAt(int index) const override { switch (impl_->GetTypeAt(index)) { - case MENUITEMTYPE_COMMAND: - return TYPE_COMMAND; - case MENUITEMTYPE_CHECK: - return TYPE_CHECK; - case MENUITEMTYPE_RADIO: - return TYPE_RADIO; - case MENUITEMTYPE_SEPARATOR: - return TYPE_SEPARATOR; - case MENUITEMTYPE_SUBMENU: - return TYPE_SUBMENU; - default: - NOTREACHED(); - return TYPE_COMMAND; + case MENUITEMTYPE_COMMAND: + return TYPE_COMMAND; + case MENUITEMTYPE_CHECK: + return TYPE_CHECK; + case MENUITEMTYPE_RADIO: + return TYPE_RADIO; + case MENUITEMTYPE_SEPARATOR: + return TYPE_SEPARATOR; + case MENUITEMTYPE_SUBMENU: + return TYPE_SUBMENU; + default: + NOTREACHED(); + return TYPE_COMMAND; } } @@ -73,9 +67,7 @@ class CefSimpleMenuModel : public ui::MenuModel { return impl_->GetFormattedLabelAt(index); } - bool IsItemDynamicAt(int index) const override { - return false; - } + bool IsItemDynamicAt(int index) const override { return false; } const gfx::FontList* GetLabelFontListAt(int index) const override { return impl_->GetLabelFontListAt(index); @@ -97,8 +89,8 @@ class CefSimpleMenuModel : public ui::MenuModel { if (alt_pressed) modifiers |= ui::EF_ALT_DOWN; - *accelerator = ui::Accelerator(static_cast(key_code), - modifiers); + *accelerator = + ui::Accelerator(static_cast(key_code), modifiers); return true; } return false; @@ -112,12 +104,9 @@ class CefSimpleMenuModel : public ui::MenuModel { return impl_->GetGroupIdAt(index); } - bool GetIconAt(int index, gfx::Image* icon) override { - return false; - } + bool GetIconAt(int index, gfx::Image* icon) override { return false; } - ui::ButtonMenuItemModel* GetButtonMenuItemAt( - int index) const override { + ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const override { return NULL; } @@ -129,12 +118,9 @@ class CefSimpleMenuModel : public ui::MenuModel { return impl_->IsVisibleAt(index); } - void HighlightChangedTo(int index) override { - } + void HighlightChangedTo(int index) override {} - void ActivatedAt(int index) override { - ActivatedAt(index, 0); - } + void ActivatedAt(int index) override { ActivatedAt(index, 0); } void ActivatedAt(int index, int event_flags) override { impl_->ActivatedAt(index, static_cast(event_flags)); @@ -172,13 +158,9 @@ class CefSimpleMenuModel : public ui::MenuModel { return impl_->GetBackgroundColor(index, is_hovered, override_color); } - void MenuWillShow() override { - impl_->MenuWillShow(); - } + void MenuWillShow() override { impl_->MenuWillShow(); } - void MenuWillClose() override { - impl_->MenuWillClose(); - } + void MenuWillClose() override { impl_->MenuWillClose(); } void SetMenuModelDelegate( ui::MenuModelDelegate* menu_model_delegate) override { @@ -201,15 +183,15 @@ cef_menu_color_type_t GetMenuColorType(bool is_text, bool is_hovered) { if (is_text) { if (is_accelerator) { - return is_hovered ? CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED : - CEF_MENU_COLOR_TEXT_ACCELERATOR; + return is_hovered ? CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED + : CEF_MENU_COLOR_TEXT_ACCELERATOR; } return is_hovered ? CEF_MENU_COLOR_TEXT_HOVERED : CEF_MENU_COLOR_TEXT; } - + DCHECK(!is_accelerator); - return is_hovered ? CEF_MENU_COLOR_BACKGROUND_HOVERED : - CEF_MENU_COLOR_BACKGROUND; + return is_hovered ? CEF_MENU_COLOR_BACKGROUND_HOVERED + : CEF_MENU_COLOR_BACKGROUND; } } // namespace @@ -235,8 +217,7 @@ struct CefMenuModelImpl::Item { : type_(type), command_id_(command_id), label_(label), - group_id_(group_id) { - } + group_id_(group_id) {} // Basic information. cef_menu_item_type_t type_; @@ -262,7 +243,6 @@ struct CefMenuModelImpl::Item { bool has_font_list_ = false; }; - CefMenuModelImpl::CefMenuModelImpl( Delegate* delegate, CefRefPtr menu_model_delegate, @@ -275,8 +255,7 @@ CefMenuModelImpl::CefMenuModelImpl( model_.reset(new CefSimpleMenuModel(this)); } -CefMenuModelImpl::~CefMenuModelImpl() { -} +CefMenuModelImpl::~CefMenuModelImpl() {} bool CefMenuModelImpl::IsSubMenu() { if (!VerifyContext()) @@ -303,8 +282,8 @@ bool CefMenuModelImpl::AddSeparator() { if (!VerifyContext()) return false; - AppendItem(Item(MENUITEMTYPE_SEPARATOR, kSeparatorId, CefString(), - kInvalidGroupId)); + AppendItem( + Item(MENUITEMTYPE_SEPARATOR, kSeparatorId, CefString(), kInvalidGroupId)); return true; } @@ -312,8 +291,7 @@ bool CefMenuModelImpl::AddItem(int command_id, const CefString& label) { if (!VerifyContext()) return false; - AppendItem(Item(MENUITEMTYPE_COMMAND, command_id, label, - kInvalidGroupId)); + AppendItem(Item(MENUITEMTYPE_COMMAND, command_id, label, kInvalidGroupId)); return true; } @@ -325,7 +303,8 @@ bool CefMenuModelImpl::AddCheckItem(int command_id, const CefString& label) { return true; } -bool CefMenuModelImpl::AddRadioItem(int command_id, const CefString& label, +bool CefMenuModelImpl::AddRadioItem(int command_id, + const CefString& label, int group_id) { if (!VerifyContext()) return false; @@ -349,13 +328,14 @@ bool CefMenuModelImpl::InsertSeparatorAt(int index) { if (!VerifyContext()) return false; - InsertItemAt(Item(MENUITEMTYPE_SEPARATOR, kSeparatorId, CefString(), - kInvalidGroupId), - index); + InsertItemAt( + Item(MENUITEMTYPE_SEPARATOR, kSeparatorId, CefString(), kInvalidGroupId), + index); return true; } -bool CefMenuModelImpl::InsertItemAt(int index, int command_id, +bool CefMenuModelImpl::InsertItemAt(int index, + int command_id, const CefString& label) { if (!VerifyContext()) return false; @@ -365,8 +345,9 @@ bool CefMenuModelImpl::InsertItemAt(int index, int command_id, return true; } -bool CefMenuModelImpl::InsertCheckItemAt(int index, int command_id, - const CefString& label) { +bool CefMenuModelImpl::InsertCheckItemAt(int index, + int command_id, + const CefString& label) { if (!VerifyContext()) return false; @@ -375,8 +356,10 @@ bool CefMenuModelImpl::InsertCheckItemAt(int index, int command_id, return true; } -bool CefMenuModelImpl::InsertRadioItemAt(int index, int command_id, - const CefString& label, int group_id) { +bool CefMenuModelImpl::InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) { if (!VerifyContext()) return false; @@ -385,7 +368,9 @@ bool CefMenuModelImpl::InsertRadioItemAt(int index, int command_id, } CefRefPtr CefMenuModelImpl::InsertSubMenuAt( - int index, int command_id, const CefString& label) { + int index, + int command_id, + const CefString& label) { if (!VerifyContext()) return NULL; @@ -404,7 +389,7 @@ bool CefMenuModelImpl::RemoveAt(int index) { return false; if (index >= 0 && index < static_cast(items_.size())) { - items_.erase(items_.begin()+index); + items_.erase(items_.begin() + index); return true; } return false; @@ -621,15 +606,19 @@ bool CefMenuModelImpl::HasAcceleratorAt(int index) { return false; } -bool CefMenuModelImpl::SetAccelerator(int command_id, int key_code, - bool shift_pressed, bool ctrl_pressed, +bool CefMenuModelImpl::SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, bool alt_pressed) { return SetAcceleratorAt(GetIndexOf(command_id), key_code, shift_pressed, ctrl_pressed, alt_pressed); } -bool CefMenuModelImpl::SetAcceleratorAt(int index, int key_code, - bool shift_pressed, bool ctrl_pressed, +bool CefMenuModelImpl::SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, bool alt_pressed) { if (!VerifyContext()) return false; @@ -668,15 +657,19 @@ bool CefMenuModelImpl::RemoveAcceleratorAt(int index) { return false; } -bool CefMenuModelImpl::GetAccelerator(int command_id, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, +bool CefMenuModelImpl::GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, bool& alt_pressed) { return GetAcceleratorAt(GetIndexOf(command_id), key_code, shift_pressed, ctrl_pressed, alt_pressed); } -bool CefMenuModelImpl::GetAcceleratorAt(int index, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, +bool CefMenuModelImpl::GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, bool& alt_pressed) { if (!VerifyContext()) return false; @@ -786,7 +779,7 @@ bool CefMenuModelImpl::SetFontListAt(int index, const CefString& font_list) { void CefMenuModelImpl::ActivatedAt(int index, cef_event_flags_t event_flags) { if (!VerifyContext()) return; - + const int command_id = GetCommandIdAt(index); if (delegate_) delegate_->ExecuteCommand(this, command_id, event_flags); @@ -881,7 +874,7 @@ bool CefMenuModelImpl::GetBackgroundColor(int index, void CefMenuModelImpl::MenuWillShow() { if (!VerifyContext()) return; - + if (delegate_) delegate_->MenuWillShow(this); if (menu_model_delegate_) @@ -899,8 +892,7 @@ void CefMenuModelImpl::MenuWillClose() { // called after this. It's more convenient for the delegate to be called // afterwards, though, so post a task. base::MessageLoop::current()->task_runner()->PostTask( - FROM_HERE, - base::Bind(&CefMenuModelImpl::OnMenuClosed, this)); + FROM_HERE, base::Bind(&CefMenuModelImpl::OnMenuClosed, this)); } base::string16 CefMenuModelImpl::GetFormattedLabelAt(int index) { @@ -1014,8 +1006,8 @@ void CefMenuModelImpl::OnMouseOutsideMenu(const gfx::Point& screen_point) { if (delegate_) delegate_->MouseOutsideMenu(this, screen_point); if (menu_model_delegate_) { - menu_model_delegate_->MouseOutsideMenu(this, - CefPoint(screen_point.x(), screen_point.y())); + menu_model_delegate_->MouseOutsideMenu( + this, CefPoint(screen_point.x(), screen_point.y())); } } diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index 7efd6c720..fa44fbbab 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -28,7 +28,7 @@ class CefMenuModelImpl : public CefMenuModel { // optional |event_flags|. virtual void ExecuteCommand(CefRefPtr source, int command_id, - cef_event_flags_t event_flags) =0; + cef_event_flags_t event_flags) = 0; // Called when the user moves the mouse outside the menu and over the owning // window. @@ -43,14 +43,14 @@ class CefMenuModelImpl : public CefMenuModel { bool is_rtl) {} // Called when the menu is about to show. - virtual void MenuWillShow(CefRefPtr source) =0; + virtual void MenuWillShow(CefRefPtr source) = 0; // Called when the menu has closed. - virtual void MenuClosed(CefRefPtr source) =0; + virtual void MenuClosed(CefRefPtr source) = 0; // Allows the delegate to modify a menu item label before it's displayed. virtual bool FormatLabel(CefRefPtr source, - base::string16& label) =0; + base::string16& label) = 0; protected: virtual ~Delegate() {} @@ -70,19 +70,23 @@ class CefMenuModelImpl : public CefMenuModel { bool AddSeparator() override; bool AddItem(int command_id, const CefString& label) override; bool AddCheckItem(int command_id, const CefString& label) override; - bool AddRadioItem(int command_id, const CefString& label, - int group_id) override; + bool AddRadioItem(int command_id, + const CefString& label, + int group_id) override; CefRefPtr AddSubMenu(int command_id, - const CefString& label) override; + const CefString& label) override; bool InsertSeparatorAt(int index) override; - bool InsertItemAt(int index, int command_id, - const CefString& label) override; - bool InsertCheckItemAt(int index, int command_id, - const CefString& label) override; - bool InsertRadioItemAt(int index, int command_id, - const CefString& label, int group_id) override; - CefRefPtr InsertSubMenuAt(int index, int command_id, - const CefString& label) override; + bool InsertItemAt(int index, int command_id, const CefString& label) override; + bool InsertCheckItemAt(int index, + int command_id, + const CefString& label) override; + bool InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) override; + CefRefPtr InsertSubMenuAt(int index, + int command_id, + const CefString& label) override; bool Remove(int command_id) override; bool RemoveAt(int index) override; int GetIndexOf(int command_id) override; @@ -114,16 +118,28 @@ class CefMenuModelImpl : public CefMenuModel { bool SetCheckedAt(int index, bool checked) override; bool HasAccelerator(int command_id) override; bool HasAcceleratorAt(int index) override; - bool SetAccelerator(int command_id, int key_code, bool shift_pressed, - bool ctrl_pressed, bool alt_pressed) override; - bool SetAcceleratorAt(int index, int key_code, bool shift_pressed, - bool ctrl_pressed, bool alt_pressed) override; + bool SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) override; + bool SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) override; bool RemoveAccelerator(int command_id) override; bool RemoveAcceleratorAt(int index) override; - bool GetAccelerator(int command_id, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) override; - bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, - bool& ctrl_pressed, bool& alt_pressed) override; + bool GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) override; + bool GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) override; bool SetColor(int command_id, cef_menu_color_type_t color_type, cef_color_t color) override; diff --git a/libcef/browser/native/browser_platform_delegate_native.cc b/libcef/browser/native/browser_platform_delegate_native.cc index 887e0203a..feeed4647 100644 --- a/libcef/browser/native/browser_platform_delegate_native.cc +++ b/libcef/browser/native/browser_platform_delegate_native.cc @@ -14,8 +14,7 @@ CefBrowserPlatformDelegateNative::CefBrowserPlatformDelegateNative( SkColor background_color) : window_info_(window_info), background_color_(background_color), - windowless_handler_(nullptr) { -} + windowless_handler_(nullptr) {} SkColor CefBrowserPlatformDelegateNative::GetBackgroundColor() const { return background_color_; diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 0282199bf..64af2ba31 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -48,8 +48,7 @@ CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux( : CefBrowserPlatformDelegateNative(window_info, background_color), host_window_created_(false), window_widget_(nullptr), - window_x11_(nullptr) { -} + window_x11_(nullptr) {} void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed( CefBrowserHostImpl* browser) { @@ -70,8 +69,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { if (window_info_.height == 0) window_info_.height = 600; - gfx::Rect rect(window_info_.x, window_info_.y, - window_info_.width, window_info_.height); + gfx::Rect rect(window_info_.x, window_info_.y, window_info_.width, + window_info_.height); // Create a new window object. It will delete itself when the associated X11 // window is destroyed. @@ -85,8 +84,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { CefWindowDelegateView* delegate_view = new CefWindowDelegateView(GetBackgroundColor()); - delegate_view->Init(window_info_.window, - browser_->web_contents(), + delegate_view->Init(window_info_.window, browser_->web_contents(), gfx::Rect(gfx::Point(), rect.size())); window_widget_ = delegate_view->GetWidget(); @@ -109,7 +107,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50); // Set font-related attributes. - CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, + CR_DEFINE_STATIC_LOCAL( + const gfx::FontRenderParams, params, (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL))); prefs->should_antialias_text = params.antialiasing; prefs->use_subpixel_positioning = params.subpixel_positioning; @@ -128,8 +127,8 @@ void CefBrowserPlatformDelegateNativeLinux::CloseHostWindow() { window_x11_->Close(); } -CefWindowHandle - CefBrowserPlatformDelegateNativeLinux::GetHostWindowHandle() const { +CefWindowHandle CefBrowserPlatformDelegateNativeLinux::GetHostWindowHandle() + const { if (windowless_handler_) return windowless_handler_->GetParentWindowHandle(); return window_info_.window; @@ -176,8 +175,8 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() { // Send updated screen rectangle information to the renderer process so that // popups are displayed in the correct location. content::RenderWidgetHostImpl::From( - browser_->web_contents()->GetRenderViewHost()->GetWidget())-> - SendScreenRects(); + browser_->web_contents()->GetRenderViewHost()->GetWidget()) + ->SendScreenRects(); } void CefBrowserPlatformDelegateNativeLinux::SizeTo(int width, int height) { @@ -239,8 +238,7 @@ void CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent( } void CefBrowserPlatformDelegateNativeLinux::HandleExternalProtocol( - const GURL& url) { -} + const GURL& url) {} void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent( content::NativeWebKeyboardEvent& result, @@ -249,25 +247,24 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent( result.native_key_code = key_event.native_key_code; result.is_system_key = key_event.is_system_key ? 1 : 0; switch (key_event.type) { - case KEYEVENT_RAWKEYDOWN: - case KEYEVENT_KEYDOWN: - result.SetType(blink::WebInputEvent::kRawKeyDown); - break; - case KEYEVENT_KEYUP: - result.SetType(blink::WebInputEvent::kKeyUp); - break; - case KEYEVENT_CHAR: - result.SetType(blink::WebInputEvent::kChar); - break; - default: - NOTREACHED(); + case KEYEVENT_RAWKEYDOWN: + case KEYEVENT_KEYDOWN: + result.SetType(blink::WebInputEvent::kRawKeyDown); + break; + case KEYEVENT_KEYUP: + result.SetType(blink::WebInputEvent::kKeyUp); + break; + case KEYEVENT_CHAR: + result.SetType(blink::WebInputEvent::kChar); + break; + default: + NOTREACHED(); } // Populate DOM values that will be passed to JavaScript handlers via // KeyboardEvent. - result.dom_code = - static_cast(ui::KeycodeConverter::NativeKeycodeToDomCode( - key_event.native_key_code)); + result.dom_code = static_cast( + ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.native_key_code)); int keysym = ui::XKeysymForWindowsKeyCode( static_cast(key_event.windows_key_code), !!(key_event.modifiers & EVENTFLAG_SHIFT_DOWN)); @@ -277,35 +274,36 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent( result.text[0] = key_event.character; result.unmodified_text[0] = key_event.unmodified_character; - result.SetModifiers( - result.GetModifiers() | TranslateModifiers(key_event.modifiers)); + result.SetModifiers(result.GetModifiers() | + TranslateModifiers(key_event.modifiers)); } void CefBrowserPlatformDelegateNativeLinux::TranslateClickEvent( blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const { + bool mouseUp, + int clickCount) const { TranslateMouseEvent(result, mouse_event); switch (type) { - case MBT_LEFT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kLeft; - break; - case MBT_MIDDLE: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kMiddle; - break; - case MBT_RIGHT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kRight; - break; - default: - NOTREACHED(); + case MBT_LEFT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kLeft; + break; + case MBT_MIDDLE: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kMiddle; + break; + case MBT_RIGHT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kRight; + break; + default: + NOTREACHED(); } result.click_count = clickCount; @@ -338,7 +336,8 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMoveEvent( void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent( blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const { + int deltaX, + int deltaY) const { result = blink::WebMouseWheelEvent(); TranslateMouseEvent(result, mouse_event); @@ -374,7 +373,7 @@ CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle( } std::unique_ptr - CefBrowserPlatformDelegateNativeLinux::CreateMenuRunner() { +CefBrowserPlatformDelegateNativeLinux::CreateMenuRunner() { return base::WrapUnique(new CefMenuRunnerLinux); } @@ -389,10 +388,9 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateMouseEvent( result.SetPositionInScreen(screen_pt.x(), screen_pt.y()); // modifiers - result.SetModifiers( - result.GetModifiers() | TranslateModifiers(mouse_event.modifiers)); + result.SetModifiers(result.GetModifiers() | + TranslateModifiers(mouse_event.modifiers)); // timestamp result.SetTimeStampSeconds(GetSystemUptime()); } - diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.h b/libcef/browser/native/browser_platform_delegate_native_linux.h index 5b46e4af7..a3cfb9c1e 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.h +++ b/libcef/browser/native/browser_platform_delegate_native_linux.h @@ -10,8 +10,8 @@ class CefWindowX11; // Windowed browser implementation for Linux. -class CefBrowserPlatformDelegateNativeLinux : - public CefBrowserPlatformDelegateNative { +class CefBrowserPlatformDelegateNativeLinux + : public CefBrowserPlatformDelegateNative { public: CefBrowserPlatformDelegateNativeLinux(const CefWindowInfo& window_info, SkColor background_color); @@ -35,13 +35,15 @@ class CefBrowserPlatformDelegateNativeLinux : void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const override; + bool mouseUp, + int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const override; + int deltaX, + int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr CreateMenuRunner() override; diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.h b/libcef/browser/native/browser_platform_delegate_native_mac.h index 5c6be6223..abdae7f50 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.h +++ b/libcef/browser/native/browser_platform_delegate_native_mac.h @@ -8,8 +8,8 @@ #include "libcef/browser/native/browser_platform_delegate_native.h" // Windowed browser implementation for Mac OS X. -class CefBrowserPlatformDelegateNativeMac : - public CefBrowserPlatformDelegateNative { +class CefBrowserPlatformDelegateNativeMac + : public CefBrowserPlatformDelegateNative { public: CefBrowserPlatformDelegateNativeMac(const CefWindowInfo& window_info, SkColor background_color); @@ -30,13 +30,15 @@ class CefBrowserPlatformDelegateNativeMac : void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const override; + bool mouseUp, + int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const override; + int deltaX, + int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr CreateFileDialogRunner() override; diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index d3c0e03d0..ea0507a87 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -23,8 +23,8 @@ #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebMouseEvent.h" #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" -#import "ui/base/cocoa/cocoa_base_utils.h" -#import "ui/base/cocoa/underlay_opengl_hosting_window.h" +#import "ui/base/cocoa/cocoa_base_utils.h" +#import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "ui/events/keycodes/keyboard_codes_posix.h" #include "ui/gfx/geometry/rect.h" @@ -35,7 +35,7 @@ CefBrowserHostImpl* browser_; // weak } -@property (nonatomic, assign) CefBrowserHostImpl* browser; +@property(nonatomic, assign) CefBrowserHostImpl* browser; @end @@ -43,7 +43,7 @@ @synthesize browser = browser_; -- (void) dealloc { +- (void)dealloc { if (browser_) { // Force the browser to be destroyed and release the reference added in // PlatformCreateWindow(). @@ -56,7 +56,7 @@ @end // Receives notifications from the browser window. Will delete itself when done. -@interface CefWindowDelegate : NSObject { +@interface CefWindowDelegate : NSObject { @private CefBrowserHostImpl* browser_; // weak NSWindow* window_; @@ -144,8 +144,7 @@ CefBrowserPlatformDelegateNativeMac::CefBrowserPlatformDelegateNativeMac( const CefWindowInfo& window_info, SkColor background_color) : CefBrowserPlatformDelegateNative(window_info, background_color), - host_window_created_(false) { -} + host_window_created_(false) {} void CefBrowserPlatformDelegateNativeMac::BrowserDestroyed( CefBrowserHostImpl* browser) { @@ -168,9 +167,9 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() { if (parentView == nil) { // Create a new window. NSRect screen_rect = [[NSScreen mainScreen] visibleFrame]; - NSRect window_rect = {{window_info_.x, - screen_rect.size.height - window_info_.y}, - {window_info_.width, window_info_.height}}; + NSRect window_rect = { + {window_info_.x, screen_rect.size.height - window_info_.y}, + {window_info_.width, window_info_.height}}; if (window_rect.size.width == 0) window_rect.size.width = 750; if (window_rect.size.height == 0) @@ -182,14 +181,13 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() { contentRect.size.height = window_rect.size.height; newWnd = [[UnderlayOpenGLHostingWindow alloc] - initWithContentRect:window_rect - styleMask:(NSTitledWindowMask | - NSClosableWindowMask | - NSMiniaturizableWindowMask | - NSResizableWindowMask | - NSUnifiedTitleAndToolbarWindowMask ) - backing:NSBackingStoreBuffered - defer:NO]; + initWithContentRect:window_rect + styleMask:(NSTitledWindowMask | NSClosableWindowMask | + NSMiniaturizableWindowMask | + NSResizableWindowMask | + NSUnifiedTitleAndToolbarWindowMask) + backing:NSBackingStoreBuffered + defer:NO]; // Create the delegate for control and browser window events. [[CefWindowDelegate alloc] initWithWindow:newWnd andBrowser:browser_]; @@ -229,7 +227,7 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() { if (newWnd != nil && !window_info_.hidden) { // Show the window. - [newWnd makeKeyAndOrderFront: nil]; + [newWnd makeKeyAndOrderFront:nil]; } return true; @@ -244,8 +242,8 @@ void CefBrowserPlatformDelegateNativeMac::CloseHostWindow() { } } -CefWindowHandle - CefBrowserPlatformDelegateNativeMac::GetHostWindowHandle() const { +CefWindowHandle CefBrowserPlatformDelegateNativeMac::GetHostWindowHandle() + const { if (windowless_handler_) return windowless_handler_->GetParentWindowHandle(); return window_info_.view; @@ -296,8 +294,7 @@ void CefBrowserPlatformDelegateNativeMac::HandleKeyboardEvent( } void CefBrowserPlatformDelegateNativeMac::HandleExternalProtocol( - const GURL& url) { -} + const GURL& url) {} void CefBrowserPlatformDelegateNativeMac::TranslateKeyEvent( content::NativeWebKeyboardEvent& result, @@ -328,23 +325,24 @@ void CefBrowserPlatformDelegateNativeMac::TranslateKeyEvent( } } - NSString* charactersIgnoringModifiers = [[[NSString alloc] - initWithCharacters:&key_event.unmodified_character length:1] - autorelease]; - NSString* characters = [[[NSString alloc] - initWithCharacters:&key_event.character length:1] autorelease]; + NSString* charactersIgnoringModifiers = + [[[NSString alloc] initWithCharacters:&key_event.unmodified_character + length:1] autorelease]; + NSString* characters = + [[[NSString alloc] initWithCharacters:&key_event.character length:1] + autorelease]; NSEvent* synthetic_event = - [NSEvent keyEventWithType:event_type - location:NSMakePoint(0, 0) - modifierFlags:NativeModifiers(key_event.modifiers) - timestamp:currentEventTimestamp() - windowNumber:0 - context:nil - characters:characters - charactersIgnoringModifiers:charactersIgnoringModifiers - isARepeat:NO - keyCode:key_event.native_key_code]; + [NSEvent keyEventWithType:event_type + location:NSMakePoint(0, 0) + modifierFlags:NativeModifiers(key_event.modifiers) + timestamp:currentEventTimestamp() + windowNumber:0 + context:nil + characters:characters + charactersIgnoringModifiers:charactersIgnoringModifiers + isARepeat:NO + keyCode:key_event.native_key_code]; result = content::NativeWebKeyboardEvent(synthetic_event); if (key_event.type == KEYEVENT_CHAR) @@ -357,27 +355,28 @@ void CefBrowserPlatformDelegateNativeMac::TranslateClickEvent( blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const { + bool mouseUp, + int clickCount) const { TranslateMouseEvent(result, mouse_event); switch (type) { - case MBT_LEFT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kLeft; - break; - case MBT_MIDDLE: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kMiddle; - break; - case MBT_RIGHT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kRight; - break; - default: - NOTREACHED(); + case MBT_LEFT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kLeft; + break; + case MBT_MIDDLE: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kMiddle; + break; + case MBT_RIGHT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kRight; + break; + default: + NOTREACHED(); } result.click_count = clickCount; @@ -410,7 +409,8 @@ void CefBrowserPlatformDelegateNativeMac::TranslateMoveEvent( void CefBrowserPlatformDelegateNativeMac::TranslateWheelEvent( blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const { + int deltaX, + int deltaY) const { result = blink::WebMouseWheelEvent(); TranslateMouseEvent(result, mouse_event); @@ -444,17 +444,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeMac::GetEventHandle( } std::unique_ptr - CefBrowserPlatformDelegateNativeMac::CreateFileDialogRunner() { +CefBrowserPlatformDelegateNativeMac::CreateFileDialogRunner() { return base::WrapUnique(new CefFileDialogRunnerMac); } std::unique_ptr - CefBrowserPlatformDelegateNativeMac::CreateJavaScriptDialogRunner() { +CefBrowserPlatformDelegateNativeMac::CreateJavaScriptDialogRunner() { return base::WrapUnique(new CefJavaScriptDialogRunnerMac); } std::unique_ptr - CefBrowserPlatformDelegateNativeMac::CreateMenuRunner() { +CefBrowserPlatformDelegateNativeMac::CreateMenuRunner() { return base::WrapUnique(new CefMenuRunnerMac); } @@ -469,10 +469,9 @@ void CefBrowserPlatformDelegateNativeMac::TranslateMouseEvent( result.SetPositionInScreen(screen_pt.x(), screen_pt.y()); // modifiers - result.SetModifiers( - result.GetModifiers() | TranslateModifiers(mouse_event.modifiers)); + result.SetModifiers(result.GetModifiers() | + TranslateModifiers(mouse_event.modifiers)); // timestamp - Mac OSX specific result.SetTimeStampSeconds(currentEventTimestamp()); } - diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 93a9e6d73..906e5d43d 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -73,9 +73,9 @@ bool HasExternalHandler(const std::string& scheme) { DWORD size = 0; key.ReadValue(NULL, NULL, &size, NULL); if (size > 2) { - // ShellExecute crashes the process when the command is empty. - // We check for "2" because it always returns the trailing NULL. - return true; + // ShellExecute crashes the process when the command is empty. + // We check for "2" because it always returns the trailing NULL. + return true; } } @@ -119,8 +119,7 @@ CefBrowserPlatformDelegateNativeWin::CefBrowserPlatformDelegateNativeWin( SkColor background_color) : CefBrowserPlatformDelegateNative(window_info, background_color), host_window_created_(false), - window_widget_(nullptr) { -} + window_widget_(nullptr) {} void CefBrowserPlatformDelegateNativeWin::BrowserDestroyed( CefBrowserHostImpl* browser) { @@ -138,9 +137,9 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() { std::wstring windowName(CefString(&window_info_.window_name)); // Create the new browser window. - window_info_.window = CreateWindowEx(window_info_.ex_style, - GetWndClass(), windowName.c_str(), window_info_.style, - window_info_.x, window_info_.y, window_info_.width, + window_info_.window = CreateWindowEx( + window_info_.ex_style, GetWndClass(), windowName.c_str(), + window_info_.style, window_info_.x, window_info_.y, window_info_.width, window_info_.height, window_info_.parent_window, window_info_.menu, ::GetModuleHandle(NULL), NULL); @@ -166,15 +165,15 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() { // Adjust for potential display scaling. gfx::Point point = gfx::Point(cr.right, cr.bottom); - float scale = display::Screen::GetScreen()-> - GetDisplayNearestPoint(point).device_scale_factor(); - point = gfx::ToFlooredPoint( - gfx::ScalePoint(gfx::PointF(point), 1.0f / scale)); + float scale = display::Screen::GetScreen() + ->GetDisplayNearestPoint(point) + .device_scale_factor(); + point = + gfx::ToFlooredPoint(gfx::ScalePoint(gfx::PointF(point), 1.0f / scale)); CefWindowDelegateView* delegate_view = new CefWindowDelegateView(GetBackgroundColor()); - delegate_view->Init(window_info_.window, - browser_->web_contents(), + delegate_view->Init(window_info_.window, browser_->web_contents(), gfx::Rect(0, 0, point.x(), point.y())); window_widget_ = delegate_view->GetWidget(); @@ -190,8 +189,8 @@ void CefBrowserPlatformDelegateNativeWin::CloseHostWindow() { } } -CefWindowHandle - CefBrowserPlatformDelegateNativeWin::GetHostWindowHandle() const { +CefWindowHandle CefBrowserPlatformDelegateNativeWin::GetHostWindowHandle() + const { if (windowless_handler_) return windowless_handler_->GetParentWindowHandle(); return window_info_.window; @@ -278,8 +277,8 @@ void CefBrowserPlatformDelegateNativeWin::SizeTo(int width, int height) { AdjustWindowRectEx(&rect, style, has_menu, ex_style); // Size the window. - SetWindowPos(window, NULL, 0, 0, rect.right, - rect.bottom, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + SetWindowPos(window, NULL, 0, 0, rect.right, rect.bottom, + SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); } gfx::Point CefBrowserPlatformDelegateNativeWin::GetScreenPoint( @@ -296,10 +295,10 @@ gfx::Point CefBrowserPlatformDelegateNativeWin::GetScreenPoint( bounds_in_screen.y() + view.y()); // Adjust for potential display scaling. - float scale = display::Screen::GetScreen()-> - GetDisplayNearestPoint(screen_point).device_scale_factor(); - return gfx::ToFlooredPoint( - gfx::ScalePoint(gfx::PointF(screen_point), scale)); + float scale = display::Screen::GetScreen() + ->GetDisplayNearestPoint(screen_point) + .device_scale_factor(); + return gfx::ToFlooredPoint(gfx::ScalePoint(gfx::PointF(screen_point), scale)); } void CefBrowserPlatformDelegateNativeWin::ViewText(const std::string& text) { @@ -331,7 +330,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent( msg.message = event.is_system_key ? WM_SYSKEYUP : WM_KEYUP; break; case blink::WebInputEvent::kChar: - msg.message = event.is_system_key ? WM_SYSCHAR: WM_CHAR; + msg.message = event.is_system_key ? WM_SYSCHAR : WM_CHAR; break; default: NOTREACHED(); @@ -342,7 +341,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent( UINT scan_code = ::MapVirtualKeyW(event.windows_key_code, MAPVK_VK_TO_VSC); msg.lParam = (scan_code << 16) | // key scan code - 1; // key repeat count + 1; // key repeat count if (event.GetModifiers() & content::NativeWebKeyboardEvent::kAltKey) msg.lParam |= (1 << 29); @@ -353,8 +352,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent( void CefBrowserPlatformDelegateNativeWin::HandleExternalProtocol( const GURL& url) { // Execute on the FILE thread. - CEF_POST_TASK(CEF_FILET, - base::Bind(ExecuteExternalProtocol, url)); + CEF_POST_TASK(CEF_FILET, base::Bind(ExecuteExternalProtocol, url)); } void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent( @@ -364,25 +362,24 @@ void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent( result.native_key_code = key_event.native_key_code; result.is_system_key = key_event.is_system_key ? 1 : 0; switch (key_event.type) { - case KEYEVENT_RAWKEYDOWN: - case KEYEVENT_KEYDOWN: - result.SetType(blink::WebInputEvent::kRawKeyDown); - break; - case KEYEVENT_KEYUP: - result.SetType(blink::WebInputEvent::kKeyUp); - break; - case KEYEVENT_CHAR: - result.SetType(blink::WebInputEvent::kChar); - break; - default: - NOTREACHED(); + case KEYEVENT_RAWKEYDOWN: + case KEYEVENT_KEYDOWN: + result.SetType(blink::WebInputEvent::kRawKeyDown); + break; + case KEYEVENT_KEYUP: + result.SetType(blink::WebInputEvent::kKeyUp); + break; + case KEYEVENT_CHAR: + result.SetType(blink::WebInputEvent::kChar); + break; + default: + NOTREACHED(); } // Populate DOM values that will be passed to JavaScript handlers via // KeyboardEvent. - result.dom_code = - static_cast(ui::KeycodeConverter::NativeKeycodeToDomCode( - key_event.native_key_code)); + result.dom_code = static_cast( + ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.native_key_code)); if (result.GetType() == blink::WebInputEvent::kChar) { result.dom_key = ui::DomKey::FromCharacter(key_event.windows_key_code); } else { @@ -399,35 +396,36 @@ void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent( result.unmodified_text[0] = result.windows_key_code; } - result.SetModifiers( - result.GetModifiers() | TranslateModifiers(key_event.modifiers)); + result.SetModifiers(result.GetModifiers() | + TranslateModifiers(key_event.modifiers)); } void CefBrowserPlatformDelegateNativeWin::TranslateClickEvent( blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const { + bool mouseUp, + int clickCount) const { TranslateMouseEvent(result, mouse_event); switch (type) { - case MBT_LEFT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kLeft; - break; - case MBT_MIDDLE: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kMiddle; - break; - case MBT_RIGHT: - result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp : - blink::WebInputEvent::kMouseDown); - result.button = blink::WebMouseEvent::Button::kRight; - break; - default: - NOTREACHED(); + case MBT_LEFT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kLeft; + break; + case MBT_MIDDLE: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kMiddle; + break; + case MBT_RIGHT: + result.SetType(mouseUp ? blink::WebInputEvent::kMouseUp + : blink::WebInputEvent::kMouseDown); + result.button = blink::WebMouseEvent::Button::kRight; + break; + default: + NOTREACHED(); } result.click_count = clickCount; @@ -460,7 +458,8 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMoveEvent( void CefBrowserPlatformDelegateNativeWin::TranslateWheelEvent( blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const { + int deltaX, + int deltaY) const { TranslateMouseEvent(result, mouse_event); result.SetType(blink::WebInputEvent::kMouseWheel); @@ -510,17 +509,17 @@ CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle( } std::unique_ptr - CefBrowserPlatformDelegateNativeWin::CreateFileDialogRunner() { +CefBrowserPlatformDelegateNativeWin::CreateFileDialogRunner() { return base::WrapUnique(new CefFileDialogRunnerWin); } std::unique_ptr - CefBrowserPlatformDelegateNativeWin::CreateJavaScriptDialogRunner() { +CefBrowserPlatformDelegateNativeWin::CreateJavaScriptDialogRunner() { return base::WrapUnique(new CefJavaScriptDialogRunnerWin); } std::unique_ptr - CefBrowserPlatformDelegateNativeWin::CreateMenuRunner() { +CefBrowserPlatformDelegateNativeWin::CreateMenuRunner() { return base::WrapUnique(new CefMenuRunnerWin); } @@ -535,8 +534,8 @@ void CefBrowserPlatformDelegateNativeWin::TranslateMouseEvent( result.SetPositionInScreen(screen_pt.x(), screen_pt.y()); // modifiers - result.SetModifiers( - result.GetModifiers() | TranslateModifiers(mouse_event.modifiers)); + result.SetModifiers(result.GetModifiers() | + TranslateModifiers(mouse_event.modifiers)); // timestamp result.SetTimeStampSeconds(GetMessageTime() / 1000.0); @@ -550,18 +549,18 @@ void CefBrowserPlatformDelegateNativeWin::RegisterWindowClass() { // Register the window class WNDCLASSEX wcex = { - /* cbSize = */ sizeof(WNDCLASSEX), - /* style = */ CS_HREDRAW | CS_VREDRAW, - /* lpfnWndProc = */ CefBrowserPlatformDelegateNativeWin::WndProc, - /* cbClsExtra = */ 0, - /* cbWndExtra = */ 0, - /* hInstance = */ ::GetModuleHandle(NULL), - /* hIcon = */ NULL, - /* hCursor = */ LoadCursor(NULL, IDC_ARROW), - /* hbrBackground = */ 0, - /* lpszMenuName = */ NULL, - /* lpszClassName = */ CefBrowserPlatformDelegateNativeWin::GetWndClass(), - /* hIconSm = */ NULL, + /* cbSize = */ sizeof(WNDCLASSEX), + /* style = */ CS_HREDRAW | CS_VREDRAW, + /* lpfnWndProc = */ CefBrowserPlatformDelegateNativeWin::WndProc, + /* cbClsExtra = */ 0, + /* cbWndExtra = */ 0, + /* hInstance = */ ::GetModuleHandle(NULL), + /* hIcon = */ NULL, + /* hCursor = */ LoadCursor(NULL, IDC_ARROW), + /* hbrBackground = */ 0, + /* lpszMenuName = */ NULL, + /* lpszClassName = */ CefBrowserPlatformDelegateNativeWin::GetWndClass(), + /* hIconSm = */ NULL, }; RegisterClassEx(&wcex); @@ -574,64 +573,65 @@ LPCTSTR CefBrowserPlatformDelegateNativeWin::GetWndClass() { } // static -LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc( - HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { CefBrowserPlatformDelegateNativeWin* platform_delegate = static_cast( gfx::GetWindowUserData(hwnd)); CefBrowserHostImpl* browser = nullptr; if (platform_delegate) - browser = platform_delegate->browser_; + browser = platform_delegate->browser_; switch (message) { - case WM_CLOSE: - if (browser && !browser->TryCloseBrowser()) { - // Cancel the close. + case WM_CLOSE: + if (browser && !browser->TryCloseBrowser()) { + // Cancel the close. + return 0; + } + + // Allow the close. + break; + + case WM_DESTROY: + if (platform_delegate) { + // Clear the user data pointer. + gfx::SetWindowUserData(hwnd, NULL); + + // Force the browser to be destroyed. This will result in a call to + // BrowserDestroyed() that will release the reference added in + // CreateHostWindow(). + browser->WindowDestroyed(); + } return 0; - } - // Allow the close. - break; + case WM_SIZE: + if (platform_delegate && platform_delegate->window_widget_) { + // Pass window resize events to the HWND for the DesktopNativeWidgetAura + // root window. Passing size 0x0 (wParam == SIZE_MINIMIZED, for example) + // will cause the widget to be hidden which reduces resource usage. + RECT rc; + GetClientRect(hwnd, &rc); + SetWindowPos(HWNDForWidget(platform_delegate->window_widget_), NULL, + rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, + SWP_NOZORDER); + } + return 0; - case WM_DESTROY: - if (platform_delegate) { - // Clear the user data pointer. - gfx::SetWindowUserData(hwnd, NULL); + case WM_MOVING: + case WM_MOVE: + if (browser) + browser->NotifyMoveOrResizeStarted(); + return 0; - // Force the browser to be destroyed. This will result in a call to - // BrowserDestroyed() that will release the reference added in - // CreateHostWindow(). - browser->WindowDestroyed(); - } - return 0; + case WM_SETFOCUS: + if (browser) + browser->SetFocus(true); + return 0; - case WM_SIZE: - if (platform_delegate && platform_delegate->window_widget_) { - // Pass window resize events to the HWND for the DesktopNativeWidgetAura - // root window. Passing size 0x0 (wParam == SIZE_MINIMIZED, for example) - // will cause the widget to be hidden which reduces resource usage. - RECT rc; - GetClientRect(hwnd, &rc); - SetWindowPos(HWNDForWidget(platform_delegate->window_widget_), NULL, - rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, - SWP_NOZORDER); - } - return 0; - - case WM_MOVING: - case WM_MOVE: - if (browser) - browser->NotifyMoveOrResizeStarted(); - return 0; - - case WM_SETFOCUS: - if (browser) - browser->SetFocus(true); - return 0; - - case WM_ERASEBKGND: - return 0; + case WM_ERASEBKGND: + return 0; } return DefWindowProc(hwnd, message, wParam, lParam); diff --git a/libcef/browser/native/browser_platform_delegate_native_win.h b/libcef/browser/native/browser_platform_delegate_native_win.h index bb370cd37..ec2e9673c 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.h +++ b/libcef/browser/native/browser_platform_delegate_native_win.h @@ -10,8 +10,8 @@ #include "libcef/browser/native/browser_platform_delegate_native.h" // Windowed browser implementation for Windows. -class CefBrowserPlatformDelegateNativeWin : - public CefBrowserPlatformDelegateNative { +class CefBrowserPlatformDelegateNativeWin + : public CefBrowserPlatformDelegateNative { public: CefBrowserPlatformDelegateNativeWin(const CefWindowInfo& window_info, SkColor background_color); @@ -35,17 +35,20 @@ class CefBrowserPlatformDelegateNativeWin : void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const override; + bool mouseUp, + int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const override; + int deltaX, + int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr CreateFileDialogRunner() override; - std::unique_ptr CreateJavaScriptDialogRunner() override; + std::unique_ptr CreateJavaScriptDialogRunner() + override; std::unique_ptr CreateMenuRunner() override; private: @@ -54,8 +57,10 @@ class CefBrowserPlatformDelegateNativeWin : static void RegisterWindowClass(); static LPCTSTR GetWndClass(); - static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam); + static LRESULT CALLBACK WndProc(HWND hwnd, + UINT message, + WPARAM wParam, + LPARAM lParam); // True if the host window has been created. bool host_window_created_; diff --git a/libcef/browser/native/file_dialog_runner_mac.mm b/libcef/browser/native/file_dialog_runner_mac.mm index f255e2fc4..28d146a47 100644 --- a/libcef/browser/native/file_dialog_runner_mac.mm +++ b/libcef/browser/native/file_dialog_runner_mac.mm @@ -31,10 +31,10 @@ base::string16 GetDescriptionFromMimeType(const std::string& mime_type) { const char* mime_type; int string_id; } kWildCardMimeTypes[] = { - { "audio", IDS_AUDIO_FILES }, - { "image", IDS_IMAGE_FILES }, - { "text", IDS_TEXT_FILES }, - { "video", IDS_VIDEO_FILES }, + {"audio", IDS_AUDIO_FILES}, + {"image", IDS_IMAGE_FILES}, + {"text", IDS_TEXT_FILES}, + {"video", IDS_VIDEO_FILES}, }; for (size_t i = 0; i < arraysize(kWildCardMimeTypes); ++i) { @@ -45,10 +45,10 @@ base::string16 GetDescriptionFromMimeType(const std::string& mime_type) { return base::string16(); } -void AddFilters(NSPopUpButton *button, +void AddFilters(NSPopUpButton* button, const std::vector& accept_filters, bool include_all_files, - std::vector >* all_extensions) { + std::vector>* all_extensions) { for (size_t i = 0; i < accept_filters.size(); ++i) { const base::string16& filter = accept_filters[i]; if (filter.empty()) @@ -62,11 +62,9 @@ void AddFilters(NSPopUpButton *button, // Treat as a filter of the form "Filter Name|.ext1;.ext2;.ext3". description = filter.substr(0, sep_index); - const std::vector& ext = - base::SplitString(filter.substr(sep_index + 1), - base::ASCIIToUTF16(";"), - base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); + const std::vector& ext = base::SplitString( + filter.substr(sep_index + 1), base::ASCIIToUTF16(";"), + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (size_t x = 0; x < ext.size(); ++x) { const base::string16& file_ext = ext[x]; if (!file_ext.empty() && file_ext[0] == '.') @@ -131,12 +129,12 @@ void AddFilters(NSPopUpButton *button, @interface CefFilterDelegate : NSObject { @private NSSavePanel* panel_; - std::vector > extensions_; + std::vector> extensions_; int selected_index_; } - (id)initWithPanel:(NSSavePanel*)panel - andAcceptFilters:(const std::vector&)accept_filters - andFilterIndex:(int)index; + andAcceptFilters:(const std::vector&)accept_filters + andFilterIndex:(int)index; - (void)setFilter:(int)index; - (int)filter; - (void)filterSelectionChanged:(id)sender; @@ -146,14 +144,14 @@ void AddFilters(NSPopUpButton *button, @implementation CefFilterDelegate - (id)initWithPanel:(NSSavePanel*)panel - andAcceptFilters:(const std::vector&)accept_filters - andFilterIndex:(int)index { + andAcceptFilters:(const std::vector&)accept_filters + andFilterIndex:(int)index { if (self = [super init]) { DCHECK(panel); panel_ = panel; selected_index_ = 0; - NSPopUpButton *button = [[NSPopUpButton alloc] init]; + NSPopUpButton* button = [[NSPopUpButton alloc] init]; AddFilters(button, accept_filters, true, &extensions_); [button sizeToFit]; [button setTarget:self]; @@ -181,8 +179,8 @@ void AddFilters(NSPopUpButton *button, if (!extensions_[index].empty()) { acceptArray = [[NSMutableArray alloc] init]; for (size_t i = 0; i < extensions_[index].size(); ++i) { - [acceptArray addObject: - base::SysUTF16ToNSString(extensions_[index][i].substr(1))]; + [acceptArray + addObject:base::SysUTF16ToNSString(extensions_[index][i].substr(1))]; } } [panel_ setAllowedFileTypes:acceptArray]; @@ -200,7 +198,7 @@ void AddFilters(NSPopUpButton *button, // Called when the selected filter is changed via the NSPopUpButton. - (void)filterSelectionChanged:(id)sender { - NSPopUpButton *button = (NSPopUpButton*)sender; + NSPopUpButton* button = (NSPopUpButton*)sender; [self setFilter:[button indexOfSelectedItem]]; } @@ -233,11 +231,10 @@ void AddFilters(NSPopUpButton *button, namespace { -void RunOpenFileDialog( - const CefFileDialogRunner::FileChooserParams& params, - NSView* view, - int filter_index, - CefFileDialogRunner::RunFileChooserCallback callback) { +void RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index, + CefFileDialogRunner::RunFileChooserCallback callback) { NSOpenPanel* openPanel = [NSOpenPanel openPanel]; base::string16 title; @@ -245,10 +242,11 @@ void RunOpenFileDialog( title = params.title; } else { title = l10n_util::GetStringUTF16( - params.mode == content::FileChooserParams::Open ? - IDS_OPEN_FILE_DIALOG_TITLE : - (params.mode == content::FileChooserParams::OpenMultiple ? - IDS_OPEN_FILES_DIALOG_TITLE : IDS_SELECT_FOLDER_DIALOG_TITLE)); + params.mode == content::FileChooserParams::Open + ? IDS_OPEN_FILE_DIALOG_TITLE + : (params.mode == content::FileChooserParams::OpenMultiple + ? IDS_OPEN_FILES_DIALOG_TITLE + : IDS_SELECT_FOLDER_DIALOG_TITLE)); } [openPanel setTitle:base::SysUTF16ToNSString(title)]; @@ -268,8 +266,8 @@ void RunOpenFileDialog( [openPanel setNameFieldStringValue:base::SysUTF8ToNSString(filename)]; } if (!directory.empty()) { - [openPanel setDirectoryURL: - [NSURL fileURLWithPath:base::SysUTF8ToNSString(directory)]]; + [openPanel setDirectoryURL:[NSURL fileURLWithPath:base::SysUTF8ToNSString( + directory)]]; } CefFilterDelegate* filter_delegate = nil; @@ -284,38 +282,42 @@ void RunOpenFileDialog( // Further panel configuration. [openPanel setAllowsOtherFileTypes:YES]; - [openPanel setAllowsMultipleSelection: - (params.mode == content::FileChooserParams::OpenMultiple)]; - [openPanel setCanChooseFiles: - (params.mode != content::FileChooserParams::UploadFolder)]; - [openPanel setCanChooseDirectories: - (params.mode == content::FileChooserParams::UploadFolder)]; + [openPanel + setAllowsMultipleSelection:(params.mode == + content::FileChooserParams::OpenMultiple)]; + [openPanel setCanChooseFiles:(params.mode != + content::FileChooserParams::UploadFolder)]; + [openPanel + setCanChooseDirectories:(params.mode == + content::FileChooserParams::UploadFolder)]; [openPanel setShowsHiddenFiles:!params.hidereadonly]; // Show panel. - [openPanel beginSheetModalForWindow:[view window] - completionHandler:^(NSInteger returnCode) { - int filter_index_to_use = - (filter_delegate != nil) ? [filter_delegate filter] : filter_index; - if (returnCode == NSFileHandlingPanelOKButton) { - std::vector files; - files.reserve(openPanel.URLs.count); - for (NSURL* url in openPanel.URLs) { - if (url.isFileURL) - files.push_back(base::FilePath(url.path.UTF8String)); - } - callback.Run(filter_index_to_use, files); - } else { - callback.Run(filter_index_to_use, std::vector()); - } - }]; + [openPanel + beginSheetModalForWindow:[view window] + completionHandler:^(NSInteger returnCode) { + int filter_index_to_use = (filter_delegate != nil) + ? [filter_delegate filter] + : filter_index; + if (returnCode == NSFileHandlingPanelOKButton) { + std::vector files; + files.reserve(openPanel.URLs.count); + for (NSURL* url in openPanel.URLs) { + if (url.isFileURL) + files.push_back(base::FilePath(url.path.UTF8String)); + } + callback.Run(filter_index_to_use, files); + } else { + callback.Run(filter_index_to_use, + std::vector()); + } + }]; } -void RunSaveFileDialog( - const CefFileDialogRunner::FileChooserParams& params, - NSView* view, - int filter_index, - CefFileDialogRunner::RunFileChooserCallback callback) { +void RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index, + CefFileDialogRunner::RunFileChooserCallback callback) { NSSavePanel* savePanel = [NSSavePanel savePanel]; base::string16 title; @@ -340,8 +342,8 @@ void RunSaveFileDialog( [savePanel setNameFieldStringValue:base::SysUTF8ToNSString(filename)]; } if (!directory.empty()) { - [savePanel setDirectoryURL: - [NSURL fileURLWithPath:base::SysUTF8ToNSString(directory)]]; + [savePanel setDirectoryURL:[NSURL fileURLWithPath:base::SysUTF8ToNSString( + directory)]]; } CefFilterDelegate* filter_delegate = nil; @@ -357,25 +359,27 @@ void RunSaveFileDialog( [savePanel setShowsHiddenFiles:!params.hidereadonly]; // Show panel. - [savePanel beginSheetModalForWindow:view.window - completionHandler:^(NSInteger resultCode) { - int filter_index_to_use = - (filter_delegate != nil) ? [filter_delegate filter] : filter_index; - if (resultCode == NSFileHandlingPanelOKButton) { - NSURL* url = savePanel.URL; - const char* path = url.path.UTF8String; - std::vector files(1, base::FilePath(path)); - callback.Run(filter_index_to_use, files); - } else { - callback.Run(filter_index_to_use, std::vector()); - } - }]; + [savePanel + beginSheetModalForWindow:view.window + completionHandler:^(NSInteger resultCode) { + int filter_index_to_use = (filter_delegate != nil) + ? [filter_delegate filter] + : filter_index; + if (resultCode == NSFileHandlingPanelOKButton) { + NSURL* url = savePanel.URL; + const char* path = url.path.UTF8String; + std::vector files(1, base::FilePath(path)); + callback.Run(filter_index_to_use, files); + } else { + callback.Run(filter_index_to_use, + std::vector()); + } + }]; } } // namespace -CefFileDialogRunnerMac::CefFileDialogRunnerMac() { -} +CefFileDialogRunnerMac::CefFileDialogRunnerMac() {} void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser, const FileChooserParams& params, @@ -389,7 +393,7 @@ void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser, RunOpenFileDialog(params, owner, filter_index, callback); } else if (params.mode == content::FileChooserParams::Save) { RunSaveFileDialog(params, owner, filter_index, callback); - } else { + } else { NOTIMPLEMENTED(); } } diff --git a/libcef/browser/native/file_dialog_runner_win.cc b/libcef/browser/native/file_dialog_runner_win.cc index 3920eacd9..0c746df2b 100644 --- a/libcef/browser/native/file_dialog_runner_win.cc +++ b/libcef/browser/native/file_dialog_runner_win.cc @@ -66,8 +66,8 @@ std::wstring FormatFilterForExtensions( bool include_all_files) { const std::wstring all_ext = L"*.*"; const std::wstring all_desc = - l10n_util::GetStringUTF16(IDS_APP_SAVEAS_ALL_FILES) + - L" (" + all_ext + L")"; + l10n_util::GetStringUTF16(IDS_APP_SAVEAS_ALL_FILES) + L" (" + all_ext + + L")"; DCHECK(file_ext.size() >= ext_desc.size()); @@ -132,10 +132,10 @@ std::wstring GetDescriptionFromMimeType(const std::string& mime_type) { const char* mime_type; int string_id; } kWildCardMimeTypes[] = { - { "audio", IDS_AUDIO_FILES }, - { "image", IDS_IMAGE_FILES }, - { "text", IDS_TEXT_FILES }, - { "video", IDS_VIDEO_FILES }, + {"audio", IDS_AUDIO_FILES}, + {"image", IDS_IMAGE_FILES}, + {"text", IDS_TEXT_FILES}, + {"video", IDS_VIDEO_FILES}, }; for (size_t i = 0; i < arraysize(kWildCardMimeTypes); ++i) { @@ -160,11 +160,9 @@ std::wstring GetFilterString( if (sep_index != base::string16::npos) { // Treat as a filter of the form "Filter Name|.ext1;.ext2;.ext3". const base::string16& desc = filter.substr(0, sep_index); - const std::vector& ext = - base::SplitString(filter.substr(sep_index + 1), - base::ASCIIToUTF16(";"), - base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); + const std::vector& ext = base::SplitString( + filter.substr(sep_index + 1), base::ASCIIToUTF16(";"), + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); std::wstring ext_str; for (size_t x = 0; x < ext.size(); ++x) { const base::string16& file_ext = ext[x]; @@ -205,11 +203,10 @@ std::wstring GetFilterString( // From chrome/browser/views/shell_dialogs_win.cc -bool RunOpenFileDialog( - const CefFileDialogRunner::FileChooserParams& params, - HWND owner, - int* filter_index, - base::FilePath* path) { +bool RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params, + HWND owner, + int* filter_index, + base::FilePath* path) { OPENFILENAME ofn; // We must do this otherwise the ofn's FlagsEx may be initialized to random @@ -231,7 +228,7 @@ bool RunOpenFileDialog( } else { // The value is a file name and possibly a directory. base::wcslcpy(filename, params.default_file_name.value().c_str(), - arraysize(filename)); + arraysize(filename)); directory = params.default_file_name.DirName().value(); } } @@ -248,8 +245,8 @@ bool RunOpenFileDialog( // We use OFN_NOCHANGEDIR so that the user can rename or delete the directory // without having to close Chrome first. - ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR | OFN_EXPLORER | - OFN_ENABLESIZING; + ofn.Flags = + OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLESIZING; if (params.hidereadonly) ofn.Flags |= OFN_HIDEREADONLY; @@ -358,8 +355,7 @@ bool RunOpenMultiFileDialog( int CALLBACK BrowseCallbackProc(HWND window, UINT message, LPARAM parameter, - LPARAM data) -{ + LPARAM data) { if (message == BFFM_INITIALIZED) { // WParam is TRUE since passing a path. // data lParam member of the BROWSEINFO structure. @@ -368,10 +364,9 @@ int CALLBACK BrowseCallbackProc(HWND window, return 0; } -bool RunOpenFolderDialog( - const CefFileDialogRunner::FileChooserParams& params, - HWND owner, - base::FilePath* path) { +bool RunOpenFolderDialog(const CefFileDialogRunner::FileChooserParams& params, + HWND owner, + base::FilePath* path) { wchar_t dir_buffer[MAX_PATH + 1] = {0}; bool result = false; @@ -423,11 +418,10 @@ bool RunOpenFolderDialog( return result; } -bool RunSaveFileDialog( - const CefFileDialogRunner::FileChooserParams& params, - HWND owner, - int* filter_index, - base::FilePath* path) { +bool RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params, + HWND owner, + int* filter_index, + base::FilePath* path) { OPENFILENAME ofn; // We must do this otherwise the ofn's FlagsEx may be initialized to random @@ -449,7 +443,7 @@ bool RunSaveFileDialog( } else { // The value is a file name and possibly a directory. base::wcslcpy(filename, params.default_file_name.value().c_str(), - arraysize(filename)); + arraysize(filename)); directory = params.default_file_name.DirName().value(); } } @@ -466,8 +460,8 @@ bool RunSaveFileDialog( // We use OFN_NOCHANGEDIR so that the user can rename or delete the directory // without having to close Chrome first. - ofn.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_NOCHANGEDIR | - OFN_PATHMUSTEXIST; + ofn.Flags = + OFN_EXPLORER | OFN_ENABLESIZING | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST; if (params.hidereadonly) ofn.Flags |= OFN_HIDEREADONLY; if (params.overwriteprompt) @@ -493,8 +487,7 @@ bool RunSaveFileDialog( } // namespace -CefFileDialogRunnerWin::CefFileDialogRunnerWin() { -} +CefFileDialogRunnerWin::CefFileDialogRunnerWin() {} void CefFileDialogRunnerWin::Run(CefBrowserHostImpl* browser, const FileChooserParams& params, diff --git a/libcef/browser/native/javascript_dialog_runner_mac.h b/libcef/browser/native/javascript_dialog_runner_mac.h index cf7ac0bf9..cc90a4684 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.h +++ b/libcef/browser/native/javascript_dialog_runner_mac.h @@ -24,18 +24,16 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner { ~CefJavaScriptDialogRunnerMac() override; // CefJavaScriptDialogRunner methods: - void Run( - CefBrowserHostImpl* browser, - content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, - const DialogClosedCallback& callback) override; + void Run(CefBrowserHostImpl* browser, + content::JavaScriptDialogType message_type, + const base::string16& display_url, + const base::string16& message_text, + const base::string16& default_prompt_text, + const DialogClosedCallback& callback) override; void Cancel() override; // Callback from CefJavaScriptDialogHelper when the dialog is closed. - void DialogClosed(bool success, - const base::string16& user_input); + void DialogClosed(bool success, const base::string16& user_input); private: DialogClosedCallback callback_; diff --git a/libcef/browser/native/javascript_dialog_runner_mac.mm b/libcef/browser/native/javascript_dialog_runner_mac.mm index cbf02428d..03e6056de 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.mm +++ b/libcef/browser/native/javascript_dialog_runner_mac.mm @@ -23,7 +23,7 @@ } - (id)initHelperWithCallback: - (CefJavaScriptDialogRunner::DialogClosedCallback)callback; + (CefJavaScriptDialogRunner::DialogClosedCallback)callback; - (NSAlert*)alert; - (NSTextField*)textField; - (void)alertDidEnd:(NSAlert*)alert @@ -36,7 +36,7 @@ @implementation CefJavaScriptDialogHelper - (id)initHelperWithCallback: - (CefJavaScriptDialogRunner::DialogClosedCallback)callback { + (CefJavaScriptDialogRunner::DialogClosedCallback)callback { if (self = [super init]) callback_ = callback; @@ -80,8 +80,7 @@ @end CefJavaScriptDialogRunnerMac::CefJavaScriptDialogRunnerMac() - : weak_ptr_factory_(this) { -} + : weak_ptr_factory_(this) {} CefJavaScriptDialogRunnerMac::~CefJavaScriptDialogRunnerMac() { Cancel(); @@ -97,15 +96,13 @@ void CefJavaScriptDialogRunnerMac::Run( DCHECK(!helper_.get()); callback_ = callback; - bool text_field = - message_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT; - bool one_button = - message_type == content::JAVASCRIPT_DIALOG_TYPE_ALERT; + bool text_field = message_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT; + bool one_button = message_type == content::JAVASCRIPT_DIALOG_TYPE_ALERT; - helper_.reset( - [[CefJavaScriptDialogHelper alloc] initHelperWithCallback: - base::Bind(&CefJavaScriptDialogRunnerMac::DialogClosed, - weak_ptr_factory_.GetWeakPtr())]); + helper_.reset([[CefJavaScriptDialogHelper alloc] + initHelperWithCallback:base::Bind( + &CefJavaScriptDialogRunnerMac::DialogClosed, + weak_ptr_factory_.GetWeakPtr())]); // Show the modal dialog. NSAlert* alert = [helper_ alert]; @@ -145,11 +142,10 @@ void CefJavaScriptDialogRunnerMac::Run( // building with the 10.11 SDK. See http://crbug.com/383820 for related // discussion. id nilArg = nil; - [alert - beginSheetModalForWindow:nilArg // nil here makes it app-modal - modalDelegate:helper_ - didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) - contextInfo:this]; + [alert beginSheetModalForWindow:nilArg // nil here makes it app-modal + modalDelegate:helper_ + didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) + contextInfo:this]; if ([alert accessoryView]) [[alert window] makeFirstResponder:[alert accessoryView]]; diff --git a/libcef/browser/native/javascript_dialog_runner_win.cc b/libcef/browser/native/javascript_dialog_runner_win.cc index f5e50c4d2..a0cfd99de 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.cc +++ b/libcef/browser/native/javascript_dialog_runner_win.cc @@ -18,8 +18,10 @@ class CefJavaScriptDialogRunnerWin; HHOOK CefJavaScriptDialogRunnerWin::msg_hook_ = NULL; int CefJavaScriptDialogRunnerWin::msg_hook_user_count_ = 0; -INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc( - HWND dialog, UINT message, WPARAM wparam, LPARAM lparam) { +INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog, + UINT message, + WPARAM wparam, + LPARAM lparam) { switch (message) { case WM_INITDIALOG: { SetWindowLongPtr(dialog, DWLP_USER, static_cast(lparam)); @@ -84,10 +86,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc( } CefJavaScriptDialogRunnerWin::CefJavaScriptDialogRunnerWin() - : dialog_win_(NULL), - parent_win_(NULL), - hook_installed_(false) { -} + : dialog_win_(NULL), parent_win_(NULL), hook_installed_(false) {} CefJavaScriptDialogRunnerWin::~CefJavaScriptDialogRunnerWin() { Cancel(); @@ -129,17 +128,15 @@ void CefJavaScriptDialogRunnerWin::Run( DCHECK(hModule); parent_win_ = GetAncestor(browser->GetWindowHandle(), GA_ROOT); - dialog_win_ = CreateDialogParam(hModule, - MAKEINTRESOURCE(dialog_type), - parent_win_, - DialogProc, - reinterpret_cast(this)); + dialog_win_ = + CreateDialogParam(hModule, MAKEINTRESOURCE(dialog_type), parent_win_, + DialogProc, reinterpret_cast(this)); DCHECK(dialog_win_); if (!display_url.empty()) { // Add the display URL to the window title. TCHAR text[64]; - GetWindowText(dialog_win_, text, sizeof(text)/sizeof(TCHAR)); + GetWindowText(dialog_win_, text, sizeof(text) / sizeof(TCHAR)); base::string16 new_window_text = text + base::ASCIIToUTF16(" - ") + display_url; @@ -181,13 +178,14 @@ void CefJavaScriptDialogRunnerWin::Cancel() { } // static -LRESULT CALLBACK CefJavaScriptDialogRunnerWin::GetMsgProc( - int code, WPARAM wparam, LPARAM lparam) { +LRESULT CALLBACK CefJavaScriptDialogRunnerWin::GetMsgProc(int code, + WPARAM wparam, + LPARAM lparam) { // Mostly borrowed from http://support.microsoft.com/kb/q187988/ // and http://www.codeproject.com/KB/atl/cdialogmessagehook.aspx. LPMSG msg = reinterpret_cast(lparam); - if (code >= 0 && wparam == PM_REMOVE && - msg->message >= WM_KEYFIRST && msg->message <= WM_KEYLAST) { + if (code >= 0 && wparam == PM_REMOVE && msg->message >= WM_KEYFIRST && + msg->message <= WM_KEYLAST) { HWND hwnd = GetActiveWindow(); if (::IsWindow(hwnd) && ::IsDialogMessage(hwnd, msg)) { // The value returned from this hookproc is ignored, and it cannot @@ -216,8 +214,7 @@ bool CefJavaScriptDialogRunnerWin::InstallMessageHook() { msg_hook_ = ::SetWindowsHookEx(WH_GETMESSAGE, &CefJavaScriptDialogRunnerWin::GetMsgProc, - NULL, - GetCurrentThreadId()); + NULL, GetCurrentThreadId()); DCHECK(msg_hook_ != NULL); return msg_hook_ != NULL; } diff --git a/libcef/browser/native/javascript_dialog_runner_win.h b/libcef/browser/native/javascript_dialog_runner_win.h index 833795a3a..07f9d04ad 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.h +++ b/libcef/browser/native/javascript_dialog_runner_win.h @@ -15,13 +15,12 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner { ~CefJavaScriptDialogRunnerWin() override; // CefJavaScriptDialogRunner methods: - void Run( - CefBrowserHostImpl* browser, - content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, - const DialogClosedCallback& callback) override; + void Run(CefBrowserHostImpl* browser, + content::JavaScriptDialogType message_type, + const base::string16& display_url, + const base::string16& message_text, + const base::string16& default_prompt_text, + const DialogClosedCallback& callback) override; void Cancel() override; private: @@ -35,7 +34,9 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner { bool hook_installed_; - static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam, + static INT_PTR CALLBACK DialogProc(HWND dialog, + UINT message, + WPARAM wparam, LPARAM lparam); // Since the message loop we expect to run in isn't going to be nicely diff --git a/libcef/browser/native/menu_2.cc b/libcef/browser/native/menu_2.cc index d57abd727..c35b08385 100644 --- a/libcef/browser/native/menu_2.cc +++ b/libcef/browser/native/menu_2.cc @@ -10,8 +10,7 @@ namespace views { Menu2::Menu2(ui::MenuModel* model) - : model_(model), - wrapper_(MenuWrapper::CreateWrapper(model)) { + : model_(model), wrapper_(MenuWrapper::CreateWrapper(model)) { Rebuild(); } diff --git a/libcef/browser/native/menu_2.h b/libcef/browser/native/menu_2.h index b4f734ba1..59d8c249b 100644 --- a/libcef/browser/native/menu_2.h +++ b/libcef/browser/native/menu_2.h @@ -31,10 +31,7 @@ class Menu2 { public: // How the menu is aligned relative to the point it is shown at. // The alignment is reversed by menu if text direction is right to left. - enum Alignment { - ALIGN_TOPLEFT, - ALIGN_TOPRIGHT - }; + enum Alignment { ALIGN_TOPLEFT, ALIGN_TOPRIGHT }; // Creates a new menu populated with the contents of |model|. // WARNING: this populates the menu on construction by invoking methods on @@ -83,7 +80,6 @@ class Menu2 { void SetMinimumWidth(int width); private: - ui::MenuModel* model_; // The object that actually implements the menu. diff --git a/libcef/browser/native/menu_runner_linux.cc b/libcef/browser/native/menu_runner_linux.cc index 219f75325..af29995d1 100644 --- a/libcef/browser/native/menu_runner_linux.cc +++ b/libcef/browser/native/menu_runner_linux.cc @@ -10,8 +10,7 @@ #include "base/strings/string_util.h" #include "ui/gfx/geometry/point.h" -CefMenuRunnerLinux::CefMenuRunnerLinux() { -} +CefMenuRunnerLinux::CefMenuRunnerLinux() {} bool CefMenuRunnerLinux::RunContextMenu( CefBrowserHostImpl* browser, @@ -27,11 +26,9 @@ bool CefMenuRunnerLinux::RunContextMenu( if (!browser->IsWindowless()) parent_widget = browser->GetWindowWidget(); - views::MenuRunner::RunResult result = - menu_->RunMenuAt(parent_widget, - NULL, gfx::Rect(screen_point, gfx::Size()), - views::MENU_ANCHOR_TOPRIGHT, - ui::MENU_SOURCE_NONE); + views::MenuRunner::RunResult result = menu_->RunMenuAt( + parent_widget, NULL, gfx::Rect(screen_point, gfx::Size()), + views::MENU_ANCHOR_TOPRIGHT, ui::MENU_SOURCE_NONE); ALLOW_UNUSED_LOCAL(result); return true; diff --git a/libcef/browser/native/menu_runner_linux.h b/libcef/browser/native/menu_runner_linux.h index 77ecfb254..f48fc3596 100644 --- a/libcef/browser/native/menu_runner_linux.h +++ b/libcef/browser/native/menu_runner_linux.h @@ -10,7 +10,7 @@ #include "ui/views/controls/menu/menu_runner.h" -class CefMenuRunnerLinux: public CefMenuRunner { +class CefMenuRunnerLinux : public CefMenuRunner { public: CefMenuRunnerLinux(); diff --git a/libcef/browser/native/menu_runner_mac.mm b/libcef/browser/native/menu_runner_mac.mm index 555d2a350..de4b733b2 100644 --- a/libcef/browser/native/menu_runner_mac.mm +++ b/libcef/browser/native/menu_runner_mac.mm @@ -6,17 +6,15 @@ #include "libcef/browser/browser_host_impl.h" -#include "base/message_loop/message_loop.h" #include "base/compiler_specific.h" #import "base/mac/scoped_sending_event.h" +#include "base/message_loop/message_loop.h" #import "ui/base/cocoa/menu_controller.h" #include "ui/gfx/geometry/point.h" -CefMenuRunnerMac::CefMenuRunnerMac() { -} +CefMenuRunnerMac::CefMenuRunnerMac() {} -CefMenuRunnerMac::~CefMenuRunnerMac() { -} +CefMenuRunnerMac::~CefMenuRunnerMac() {} bool CefMenuRunnerMac::RunContextMenu( CefBrowserHostImpl* browser, @@ -88,4 +86,3 @@ void CefMenuRunnerMac::CancelContextMenu() { if (menu_controller_.get()) [menu_controller_ cancel]; } - diff --git a/libcef/browser/native/menu_runner_win.cc b/libcef/browser/native/menu_runner_win.cc index 77baad1fb..cf1c25658 100644 --- a/libcef/browser/native/menu_runner_win.cc +++ b/libcef/browser/native/menu_runner_win.cc @@ -10,8 +10,7 @@ #include "base/message_loop/message_loop.h" #include "ui/gfx/geometry/point.h" -CefMenuRunnerWin::CefMenuRunnerWin() { -} +CefMenuRunnerWin::CefMenuRunnerWin() {} bool CefMenuRunnerWin::RunContextMenu( CefBrowserHostImpl* browser, diff --git a/libcef/browser/native/menu_runner_win.h b/libcef/browser/native/menu_runner_win.h index 11bb221a7..4f807972a 100644 --- a/libcef/browser/native/menu_runner_win.h +++ b/libcef/browser/native/menu_runner_win.h @@ -10,7 +10,6 @@ #include "libcef/browser/native/native_menu_win.h" - class CefMenuRunnerWin : public CefMenuRunner { public: CefMenuRunnerWin(); diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 92770c189..8db808187 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -57,7 +57,10 @@ namespace { // HDC to back the canvas if one doesn't already exist, tearing it down // before returning. If |src_rect| is null, copies the entire canvas. // Deleted from skia/ext/platform_canvas.h in https://crbug.com/675977#c13 -void DrawToNativeContext(SkCanvas* canvas, HDC destination_hdc, int x, int y, +void DrawToNativeContext(SkCanvas* canvas, + HDC destination_hdc, + int x, + int y, const RECT* src_rect) { RECT temp_rect; if (!src_rect) { @@ -111,9 +114,7 @@ class CefNativeMenuWin::MenuHostWindow { gfx::SetWindowUserData(hwnd_, this); } - ~MenuHostWindow() { - DestroyWindow(hwnd_); - } + ~MenuHostWindow() { DestroyWindow(hwnd_); } HWND hwnd() const { return hwnd_; } @@ -127,17 +128,9 @@ class CefNativeMenuWin::MenuHostWindow { WNDCLASSEX window_class; base::win::InitializeWindowClass( - kWindowClassName, - &base::win::WrappedWindowProc, - CS_DBLCLKS, - 0, - 0, - NULL, - reinterpret_cast(COLOR_WINDOW+1), - NULL, - NULL, - NULL, - &window_class); + kWindowClassName, &base::win::WrappedWindowProc, + CS_DBLCLKS, 0, 0, NULL, reinterpret_cast(COLOR_WINDOW + 1), + NULL, NULL, NULL, &window_class); ATOM clazz = RegisterClassEx(&window_class); CHECK(clazz); registered = true; @@ -201,8 +194,8 @@ class CefNativeMenuWin::MenuHostWindow { if (data) { gfx::FontList font_list; measure_item_struct->itemWidth = - gfx::GetStringWidth(data->label, font_list) + - kIconWidth + kItemLeftMargin + views::kItemLabelSpacing - + gfx::GetStringWidth(data->label, font_list) + kIconWidth + + kItemLeftMargin + views::kItemLabelSpacing - GetSystemMetrics(SM_CXMENUCHECK); if (data->submenu.get()) measure_item_struct->itemWidth += kArrowWidth; @@ -275,8 +268,8 @@ class CefNativeMenuWin::MenuHostWindow { static_cast(label.size()), &rect, format | DT_LEFT, NULL); if (!accel.empty()) DrawTextEx(dc, const_cast(accel.data()), - static_cast(accel.size()), &rect, - format | DT_RIGHT, NULL); + static_cast(accel.size()), &rect, format | DT_RIGHT, + NULL); SelectObject(dc, old_font); ui::MenuModel::ItemType type = @@ -293,10 +286,12 @@ class CefNativeMenuWin::MenuHostWindow { skia_icon.width(), skia_icon.height(), false); canvas->drawBitmap(*skia_icon.bitmap(), 0, 0); DrawToNativeContext( - canvas.get(), dc, - draw_item_struct->rcItem.left + kItemLeftMargin, - draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - - draw_item_struct->rcItem.top - skia_icon.height()) / 2, NULL); + canvas.get(), dc, draw_item_struct->rcItem.left + kItemLeftMargin, + draw_item_struct->rcItem.top + + (draw_item_struct->rcItem.bottom - + draw_item_struct->rcItem.top - skia_icon.height()) / + 2, + NULL); } else if (type == ui::MenuModel::TYPE_CHECK && data->native_menu_win->model_->IsItemCheckedAt( data->model_index)) { @@ -306,8 +301,9 @@ class CefNativeMenuWin::MenuHostWindow { if (draw_item_struct->itemState & ODS_DISABLED) { state = NativeTheme::kDisabled; } else { - state = draw_item_struct->itemState & ODS_SELECTED ? - NativeTheme::kHovered : NativeTheme::kNormal; + state = draw_item_struct->itemState & ODS_SELECTED + ? NativeTheme::kHovered + : NativeTheme::kNormal; } std::unique_ptr canvas = skia::CreatePlatformCanvas( @@ -321,17 +317,19 @@ class CefNativeMenuWin::MenuHostWindow { // Draw the background and the check. ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); - native_theme->Paint( - &paint_canvas, NativeTheme::kMenuCheckBackground, - state, bounds, extra); - native_theme->Paint( - &paint_canvas, NativeTheme::kMenuCheck, state, bounds, extra); + native_theme->Paint(&paint_canvas, NativeTheme::kMenuCheckBackground, + state, bounds, extra); + native_theme->Paint(&paint_canvas, NativeTheme::kMenuCheck, state, + bounds, extra); // Draw checkbox to menu. - DrawToNativeContext(canvas.get(), dc, - draw_item_struct->rcItem.left + kItemLeftMargin, - draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - - draw_item_struct->rcItem.top - config.check_height) / 2, NULL); + DrawToNativeContext( + canvas.get(), dc, draw_item_struct->rcItem.left + kItemLeftMargin, + draw_item_struct->rcItem.top + + (draw_item_struct->rcItem.bottom - + draw_item_struct->rcItem.top - config.check_height) / + 2, + NULL); } } else { @@ -367,7 +365,7 @@ class CefNativeMenuWin::MenuHostWindow { OnDrawItem(w_param, reinterpret_cast(l_param)); *l_result = 0; return true; - // TODO(beng): bring over owner draw from old menu system. + // TODO(beng): bring over owner draw from old menu system. } return false; } @@ -395,11 +393,7 @@ class CefNativeMenuWin::MenuHostWindow { struct CefNativeMenuWin::HighlightedMenuItemInfo { HighlightedMenuItemInfo() - : has_parent(false), - has_submenu(false), - menu(NULL), - position(-1) { - } + : has_parent(false), has_submenu(false), menu(NULL), position(-1) {} bool has_parent; bool has_submenu; @@ -428,8 +422,7 @@ CefNativeMenuWin::CefNativeMenuWin(ui::MenuModel* model, HWND system_menu_for) position_to_select_(-1), parent_(NULL), destroyed_flag_(NULL), - menu_to_select_factory_(this) { -} + menu_to_select_factory_(this) {} CefNativeMenuWin::~CefNativeMenuWin() { if (destroyed_flag_) @@ -481,9 +474,8 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) { // does. menu_to_select_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&CefNativeMenuWin::DelayedSelect, - menu_to_select_factory_.GetWeakPtr())); + FROM_HERE, base::Bind(&CefNativeMenuWin::DelayedSelect, + menu_to_select_factory_.GetWeakPtr())); menu_action_ = MENU_ACTION_SELECTED; } // Send MenuWillClose after we schedule the select, otherwise MenuWillClose is @@ -502,7 +494,7 @@ void CefNativeMenuWin::Rebuild(MenuInsertionDelegateWin* delegate) { owner_draw_ = model_->HasIcons() || owner_draw_; first_item_index_ = delegate ? delegate->GetInsertionIndex(menu_) : 0; for (int menu_index = first_item_index_; - menu_index < first_item_index_ + model_->GetItemCount(); ++menu_index) { + menu_index < first_item_index_ + model_->GetItemCount(); ++menu_index) { int model_index = menu_index - first_item_index_; if (model_->GetTypeAt(model_index) == ui::MenuModel::TYPE_SEPARATOR) AddSeparatorItemAt(menu_index, model_index); @@ -585,8 +577,9 @@ bool CefNativeMenuWin::GetHighlightedMenuItemInfo( } // static -LRESULT CALLBACK CefNativeMenuWin::MenuMessageHook( - int n_code, WPARAM w_param, LPARAM l_param) { +LRESULT CALLBACK CefNativeMenuWin::MenuMessageHook(int n_code, + WPARAM w_param, + LPARAM l_param) { LRESULT result = CallNextHookEx(NULL, n_code, w_param, l_param); CefNativeMenuWin* this_ptr = open_native_menu_win_; @@ -685,8 +678,10 @@ void CefNativeMenuWin::AddSeparatorItemAt(int menu_index, int model_index) { InsertMenuItem(menu_, menu_index, TRUE, &mii); } -void CefNativeMenuWin::SetMenuItemState( - int menu_index, bool enabled, bool checked, bool is_default) { +void CefNativeMenuWin::SetMenuItemState(int menu_index, + bool enabled, + bool checked, + bool is_default) { if (IsSeparatorItemAt(menu_index)) return; @@ -704,8 +699,8 @@ void CefNativeMenuWin::SetMenuItemState( } void CefNativeMenuWin::SetMenuItemLabel(int menu_index, - int model_index, - const base::string16& label) { + int model_index, + const base::string16& label) { if (IsSeparatorItemAt(menu_index)) return; @@ -715,9 +710,10 @@ void CefNativeMenuWin::SetMenuItemLabel(int menu_index, SetMenuItemInfo(menu_, menu_index, MF_BYPOSITION, &mii); } -void CefNativeMenuWin::UpdateMenuItemInfoForString(MENUITEMINFO* mii, - int model_index, - const base::string16& label) { +void CefNativeMenuWin::UpdateMenuItemInfoForString( + MENUITEMINFO* mii, + int model_index, + const base::string16& label) { base::string16 formatted = label; ui::MenuModel::ItemType type = model_->GetTypeAt(model_index); // Strip out any tabs, otherwise they get interpreted as accelerators and can @@ -738,8 +734,7 @@ void CefNativeMenuWin::UpdateMenuItemInfoForString(MENUITEMINFO* mii, // Give Windows a pointer to the label string. mii->fMask |= MIIM_STRING; - mii->dwTypeData = - const_cast(items_[model_index]->label.c_str()); + mii->dwTypeData = const_cast(items_[model_index]->label.c_str()); } UINT CefNativeMenuWin::GetAlignmentFlags(int alignment) const { diff --git a/libcef/browser/native/native_menu_win.h b/libcef/browser/native/native_menu_win.h index a50edbb6f..793c908ee 100644 --- a/libcef/browser/native/native_menu_win.h +++ b/libcef/browser/native/native_menu_win.h @@ -10,8 +10,8 @@ #include "libcef/browser/native/menu_wrapper.h" -#include "base/macros.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/strings/string16.h" @@ -105,8 +105,9 @@ class CefNativeMenuWin : public MenuWrapper { HighlightedMenuItemInfo* info); // Hook to receive keyboard events while the menu is open. - static LRESULT CALLBACK MenuMessageHook( - int n_code, WPARAM w_param, LPARAM l_param); + static LRESULT CALLBACK MenuMessageHook(int n_code, + WPARAM w_param, + LPARAM l_param); // Our attached model and delegate. ui::MenuModel* model_; diff --git a/libcef/browser/native/window_delegate_view.cc b/libcef/browser/native/window_delegate_view.cc index 2b0a68d1f..26cc41feb 100644 --- a/libcef/browser/native/window_delegate_view.cc +++ b/libcef/browser/native/window_delegate_view.cc @@ -11,14 +11,11 @@ #include "ui/views/widget/widget.h" CefWindowDelegateView::CefWindowDelegateView(SkColor background_color) - : background_color_(background_color), - web_view_(NULL) { -} + : background_color_(background_color), web_view_(NULL) {} -void CefWindowDelegateView::Init( - gfx::AcceleratedWidget parent_widget, - content::WebContents* web_contents, - const gfx::Rect& bounds) { +void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget, + content::WebContents* web_contents, + const gfx::Rect& bounds) { DCHECK(!web_view_); web_view_ = new views::WebView(web_contents->GetBrowserContext()); web_view_->SetWebContents(web_contents); @@ -67,4 +64,3 @@ void CefWindowDelegateView::ViewHierarchyChanged( if (details.is_add && details.child == this) InitContent(); } - diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index 53a342c64..638269961 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -6,10 +6,10 @@ #include "libcef/browser/native/window_x11.h" #include "libcef/browser/thread_util.h" -#include #include #include #include +#include #include "ui/base/x/x11_util.h" #include "ui/events/platform/platform_event_source.h" @@ -28,15 +28,8 @@ const char kNetWMState[] = "_NET_WM_STATE"; const char kXdndProxy[] = "XdndProxy"; const char* kAtomsToCache[] = { - kAtom, - kWMDeleteWindow, - kWMProtocols, - kNetWMPid, - kNetWMPing, - kNetWMState, - kXdndProxy, - NULL -}; + kAtom, kWMDeleteWindow, kWMProtocols, kNetWMPid, + kNetWMPing, kNetWMState, kXdndProxy, NULL}; ::Window FindEventTarget(const base::NativeEvent& xev) { ::Window target = xev->xany.window; @@ -93,15 +86,15 @@ CEF_EXPORT XDisplay* cef_get_xdisplay() { CefWindowX11::CefWindowX11(CefRefPtr browser, ::Window parent_xwindow, const gfx::Rect& bounds) - : browser_(browser), - xdisplay_(gfx::GetXDisplay()), - parent_xwindow_(parent_xwindow), - xwindow_(0), - window_mapped_(false), - bounds_(bounds), - focus_pending_(false), - atom_cache_(xdisplay_, kAtomsToCache), - weak_ptr_factory_(this) { + : browser_(browser), + xdisplay_(gfx::GetXDisplay()), + parent_xwindow_(parent_xwindow), + xwindow_(0), + window_mapped_(false), + bounds_(bounds), + focus_pending_(false), + atom_cache_(xdisplay_, kAtomsToCache), + weak_ptr_factory_(this) { if (parent_xwindow_ == None) parent_xwindow_ = DefaultRootWindow(xdisplay_); @@ -109,15 +102,13 @@ CefWindowX11::CefWindowX11(CefRefPtr browser, memset(&swa, 0, sizeof(swa)); swa.background_pixmap = None; swa.override_redirect = false; - xwindow_ = XCreateWindow( - xdisplay_, parent_xwindow_, - bounds.x(), bounds.y(), bounds.width(), bounds.height(), - 0, // border width - CopyFromParent, // depth - InputOutput, - CopyFromParent, // visual - CWBackPixmap | CWOverrideRedirect, - &swa); + xwindow_ = XCreateWindow(xdisplay_, parent_xwindow_, bounds.x(), bounds.y(), + bounds.width(), bounds.height(), + 0, // border width + CopyFromParent, // depth + InputOutput, + CopyFromParent, // visual + CWBackPixmap | CWOverrideRedirect, &swa); if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); @@ -144,12 +135,8 @@ CefWindowX11::CefWindowX11(CefRefPtr browser, static_assert(sizeof(long) >= sizeof(pid_t), "pid_t should not be larger than long"); long pid = getpid(); - XChangeProperty(xdisplay_, - xwindow_, - atom_cache_.GetAtom(kNetWMPid), - XA_CARDINAL, - 32, - PropModeReplace, + XChangeProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kNetWMPid), + XA_CARDINAL, 32, PropModeReplace, reinterpret_cast(&pid), 1); // Allow subclasses to create and cache additional atoms. @@ -213,21 +200,14 @@ void CefWindowX11::Show() { if (proxy_target != child) { // Set the proxy target for the top-most window. - XChangeProperty(xdisplay_, - toplevel_window, - atom_cache_.GetAtom(kXdndProxy), - XA_WINDOW, - 32, - PropModeReplace, - reinterpret_cast(&child), 1); + XChangeProperty(xdisplay_, toplevel_window, + atom_cache_.GetAtom(kXdndProxy), XA_WINDOW, 32, + PropModeReplace, + reinterpret_cast(&child), 1); // Do the same for the proxy target per the spec. - XChangeProperty(xdisplay_, - child, - atom_cache_.GetAtom(kXdndProxy), - XA_WINDOW, - 32, - PropModeReplace, - reinterpret_cast(&child), 1); + XChangeProperty(xdisplay_, child, atom_cache_.GetAtom(kXdndProxy), + XA_WINDOW, 32, PropModeReplace, + reinterpret_cast(&child), 1); } } } @@ -304,7 +284,7 @@ views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() { bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) { ::Window target = FindEventTarget(event); - return target == xwindow_; + return target == xwindow_; } uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { @@ -317,7 +297,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { // than from within Aura (e.g. the X window manager can change the // size). Make sure the root window size is maintained properly. gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, - xev->xconfigure.width, xev->xconfigure.height); + xev->xconfigure.width, xev->xconfigure.height); bounds_ = bounds; if (browser_.get()) { @@ -348,9 +328,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { XEvent reply_event = *xev; reply_event.xclient.window = parent_xwindow_; - XSendEvent(xdisplay_, - reply_event.xclient.window, - False, + XSendEvent(xdisplay_, reply_event.xclient.window, False, SubstructureRedirectMask | SubstructureNotifyMask, &reply_event); XFlush(xdisplay_); @@ -378,9 +356,9 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { if (!focus_pending_) { focus_pending_ = true; CEF_POST_DELAYED_TASK(CEF_UIT, - base::Bind(&CefWindowX11::ContinueFocus, - weak_ptr_factory_.GetWeakPtr()), - 100); + base::Bind(&CefWindowX11::ContinueFocus, + weak_ptr_factory_.GetWeakPtr()), + 100); } break; case FocusOut: @@ -400,20 +378,18 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { // Forward the state change to the child DesktopWindowTreeHostX11 // window so that resource usage will be reduced while the window is // minimized. - std::vector< ::Atom> atom_list; + std::vector<::Atom> atom_list; if (ui::GetAtomArrayProperty(xwindow_, kNetWMState, &atom_list) && !atom_list.empty()) { ui::SetAtomArrayProperty(child, kNetWMState, "ATOM", atom_list); } else { // Set an empty list of property values to pass the check in // DesktopWindowTreeHostX11::OnWMStateUpdated(). - XChangeProperty(xdisplay_, - child, + XChangeProperty(xdisplay_, child, atom_cache_.GetAtom(kNetWMState), // name - atom_cache_.GetAtom(kAtom), // type + atom_cache_.GetAtom(kAtom), // type 32, // size in bits of items in 'value' - PropModeReplace, - NULL, + PropModeReplace, NULL, 0); // num items } } @@ -433,4 +409,3 @@ void CefWindowX11::ContinueFocus() { browser_->SetFocus(true); focus_pending_ = false; } - diff --git a/libcef/browser/navigate_params.cc b/libcef/browser/navigate_params.cc index 6baf16121..e57999f5e 100644 --- a/libcef/browser/navigate_params.cc +++ b/libcef/browser/navigate_params.cc @@ -5,16 +5,13 @@ #include "libcef/browser/navigate_params.h" -CefNavigateParams::CefNavigateParams( - const GURL& a_url, - ui::PageTransition a_transition) +CefNavigateParams::CefNavigateParams(const GURL& a_url, + ui::PageTransition a_transition) : url(a_url), frame_id(-1), disposition(WindowOpenDisposition::CURRENT_TAB), transition(a_transition), is_renderer_initiated(false), - user_gesture(true) { -} + user_gesture(true) {} -CefNavigateParams::~CefNavigateParams() { -} +CefNavigateParams::~CefNavigateParams() {} diff --git a/libcef/browser/navigate_params.h b/libcef/browser/navigate_params.h index cda2619b5..50b6fdaa3 100644 --- a/libcef/browser/navigate_params.h +++ b/libcef/browser/navigate_params.h @@ -19,8 +19,7 @@ // Parameters that tell CefBrowserHostImpl::Navigate() what to do. struct CefNavigateParams { - CefNavigateParams(const GURL& a_url, - ui::PageTransition a_transition); + CefNavigateParams(const GURL& a_url, ui::PageTransition a_transition); ~CefNavigateParams(); // The following parameters are sent to the renderer via CefMsg_LoadRequest. @@ -52,7 +51,6 @@ struct CefNavigateParams { // Upload data (may be NULL). scoped_refptr upload_data; - // The following parameters are used to define browser behavior when servicing // the navigation request. // --------------------------------------------------------------------------- diff --git a/libcef/browser/navigation_entry_impl.cc b/libcef/browser/navigation_entry_impl.cc index 74947bb30..8fb7a169a 100644 --- a/libcef/browser/navigation_entry_impl.cc +++ b/libcef/browser/navigation_entry_impl.cc @@ -11,9 +11,12 @@ #include "url/gurl.h" CefNavigationEntryImpl::CefNavigationEntryImpl(content::NavigationEntry* value) - : CefValueBase( - value, NULL, kOwnerNoDelete, true, - new CefValueControllerNonThreadSafe()) { + : CefValueBase( + value, + NULL, + kOwnerNoDelete, + true, + new CefValueControllerNonThreadSafe()) { // Indicate that this object owns the controller. SetOwnsController(); } @@ -68,4 +71,3 @@ CefRefPtr CefNavigationEntryImpl::GetSSLStatus() { CEF_VALUE_VERIFY_RETURN(false, nullptr); return new CefSSLStatusImpl(const_value().GetSSL()); } - diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index c380ae684..62f1bc199 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -55,31 +55,30 @@ const char kChromeUIWebUIHostsHost[] = "webui-hosts"; // additional changes. Do not add new hosts to this list without also manually // testing all related functionality in CEF. const char* kAllowedWebUIHosts[] = { - content::kChromeUIAppCacheInternalsHost, - content::kChromeUIAccessibilityHost, - content::kChromeUIBlobInternalsHost, - chrome::kChromeUICreditsHost, - content::kChromeUIGpuHost, - content::kChromeUIHistogramHost, - content::kChromeUIIndexedDBInternalsHost, - content::kChromeUIMediaInternalsHost, - chrome::kChromeUINetExportHost, - chrome::kChromeUINetInternalsHost, - content::kChromeUINetworkErrorHost, - content::kChromeUINetworkErrorsListingHost, - content::kChromeUINetworkViewCacheHost, - content::kChromeUIResourcesHost, - content::kChromeUIServiceWorkerInternalsHost, - chrome::kChromeUISystemInfoHost, - content::kChromeUITracingHost, - content::kChromeUIWebRTCInternalsHost, + content::kChromeUIAppCacheInternalsHost, + content::kChromeUIAccessibilityHost, + content::kChromeUIBlobInternalsHost, + chrome::kChromeUICreditsHost, + content::kChromeUIGpuHost, + content::kChromeUIHistogramHost, + content::kChromeUIIndexedDBInternalsHost, + content::kChromeUIMediaInternalsHost, + chrome::kChromeUINetExportHost, + chrome::kChromeUINetInternalsHost, + content::kChromeUINetworkErrorHost, + content::kChromeUINetworkErrorsListingHost, + content::kChromeUINetworkViewCacheHost, + content::kChromeUIResourcesHost, + content::kChromeUIServiceWorkerInternalsHost, + chrome::kChromeUISystemInfoHost, + content::kChromeUITracingHost, + content::kChromeUIWebRTCInternalsHost, }; // Hosts that don't have useful output when linked directly. They'll be excluded // from the "chrome://webui-hosts" listing. const char* kUnlistedHosts[] = { - content::kChromeUINetworkErrorHost, - content::kChromeUIResourcesHost, + content::kChromeUINetworkErrorHost, content::kChromeUIResourcesHost, }; enum ChromeHostId { @@ -94,14 +93,14 @@ const struct { const char* host; ChromeHostId host_id; } kAllowedCefHosts[] = { - { kChromeUILicenseHost, CHROME_LICENSE }, - { chrome::kChromeUIVersionHost, CHROME_VERSION }, - { kChromeUIWebUIHostsHost, CHROME_WEBUI_HOSTS }, + {kChromeUILicenseHost, CHROME_LICENSE}, + {chrome::kChromeUIVersionHost, CHROME_VERSION}, + {kChromeUIWebUIHostsHost, CHROME_WEBUI_HOSTS}, }; ChromeHostId GetChromeHostId(const std::string& host) { - for (size_t i = 0; - i < sizeof(kAllowedCefHosts) / sizeof(kAllowedCefHosts[0]); ++i) { + for (size_t i = 0; i < sizeof(kAllowedCefHosts) / sizeof(kAllowedCefHosts[0]); + ++i) { if (base::EqualsCaseInsensitiveASCII(kAllowedCefHosts[i].host, host.c_str())) { return kAllowedCefHosts[i].host_id; @@ -115,8 +114,8 @@ ChromeHostId GetChromeHostId(const std::string& host) { // crashing, etc). void GetAllowedHosts(std::vector* hosts) { // Hosts implemented by CEF. - for (size_t i = 0; - i < sizeof(kAllowedCefHosts) / sizeof(kAllowedCefHosts[0]); ++i) { + for (size_t i = 0; i < sizeof(kAllowedCefHosts) / sizeof(kAllowedCefHosts[0]); + ++i) { hosts->push_back(kAllowedCefHosts[i].host); } @@ -129,8 +128,8 @@ void GetAllowedHosts(std::vector* hosts) { // Returns true if a host should not be listed on "chrome://webui-hosts". bool IsUnlistedHost(const std::string& host) { - for (size_t i = 0; - i < sizeof(kUnlistedHosts) / sizeof(kUnlistedHosts[0]); ++i) { + for (size_t i = 0; i < sizeof(kUnlistedHosts) / sizeof(kUnlistedHosts[0]); + ++i) { if (host == kUnlistedHosts[i]) return true; } @@ -141,9 +140,8 @@ bool IsUnlistedHost(const std::string& host) { bool IsAllowedWebUIHost(const std::string& host) { // Explicitly whitelisted WebUI hosts. for (size_t i = 0; - i < sizeof(kAllowedWebUIHosts) / sizeof(kAllowedWebUIHosts[0]); ++i) { - if (base::EqualsCaseInsensitiveASCII(kAllowedWebUIHosts[i], - host.c_str())) { + i < sizeof(kAllowedWebUIHosts) / sizeof(kAllowedWebUIHosts[0]); ++i) { + if (base::EqualsCaseInsensitiveASCII(kAllowedWebUIHosts[i], host.c_str())) { return true; } } @@ -153,7 +151,7 @@ bool IsAllowedWebUIHost(const std::string& host) { // Additional debug URLs that are not included in chrome::kChromeDebugURLs. const char* kAllowedDebugURLs[] = { - content::kChromeUIBrowserCrashURL, + content::kChromeUIBrowserCrashURL, }; // Returns true for debug URLs that receive special handling (for crashes, etc). @@ -214,13 +212,13 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { if (!AllowWebUIForURL(url)) return controller; - controller = content::ContentWebUIControllerFactory::GetInstance()-> - CreateWebUIControllerForURL(web_ui, url); + controller = content::ContentWebUIControllerFactory::GetInstance() + ->CreateWebUIControllerForURL(web_ui, url); if (controller != nullptr) return controller; - controller = ChromeWebUIControllerFactory::GetInstance()-> - CreateWebUIControllerForURL(web_ui, url); + controller = ChromeWebUIControllerFactory::GetInstance() + ->CreateWebUIControllerForURL(web_ui, url); if (controller != nullptr) return controller; @@ -266,8 +264,8 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { if (!AllowWebUIForURL(url)) return false; - if (content::ContentWebUIControllerFactory::GetInstance()-> - UseWebUIBindingsForURL(browser_context, url) || + if (content::ContentWebUIControllerFactory::GetInstance() + ->UseWebUIBindingsForURL(browser_context, url) || ChromeWebUIControllerFactory::GetInstance()->UseWebUIBindingsForURL( browser_context, url)) { return true; @@ -393,7 +391,6 @@ CefWebUIControllerFactory* CefWebUIControllerFactory::GetInstance() { return &g_web_ui_controller_factory.Get(); } - std::string GetOSType() { #if defined(OS_WIN) return "Windows"; @@ -441,16 +438,10 @@ std::string GetModulePath() { class TemplateParser { public: - TemplateParser() - : ident_start_("$$"), - ident_end_("$$") { - } + TemplateParser() : ident_start_("$$"), ident_end_("$$") {} - TemplateParser(const std::string& ident_start, - const std::string& ident_end) - : ident_start_(ident_start), - ident_end_(ident_end) { - } + TemplateParser(const std::string& ident_start, const std::string& ident_end) + : ident_start_(ident_start), ident_end_(ident_end) {} void Add(const std::string& key, const std::string& value) { values_.insert(std::make_pair(key, value)); @@ -461,7 +452,7 @@ class TemplateParser { int ident_start_len = ident_start_.length(); int ident_end_len = ident_end_.length(); - while(true) { + while (true) { start_pos = tmpl->find(ident_start_, end_pos); if (start_pos >= 0) { end_pos = tmpl->find(ident_end_, start_pos + ident_start_len); @@ -473,7 +464,7 @@ class TemplateParser { if (it != values_.end()) { // Peform the substitution. tmpl->replace(start_pos, end_pos + ident_end_len - start_pos, - it->second); + it->second); end_pos = start_pos + it->second.length(); } else { // Leave the unknown identifier in place. @@ -481,7 +472,7 @@ class TemplateParser { } if (end_pos >= static_cast(tmpl->length()) - ident_start_len - - ident_end_len) { + ident_end_len) { // Not enough room remaining for more identifiers. break; } @@ -533,8 +524,8 @@ class Delegate : public InternalHandlerDelegate { } if (!handled && host_id != CHROME_VERSION) { - LOG(INFO) << "Reguest for unknown chrome resource: " << - url.spec().c_str(); + LOG(INFO) << "Reguest for unknown chrome resource: " + << url.spec().c_str(); action->redirect_url = GURL(std::string(kChromeURL) + chrome::kChromeUIVersionHost); @@ -546,7 +537,7 @@ class Delegate : public InternalHandlerDelegate { bool OnLicense(Action* action) { base::StringPiece piece = CefContentClient::Get()->GetDataResource( - IDR_CEF_LICENSE_TXT, ui::SCALE_FACTOR_NONE); + IDR_CEF_LICENSE_TXT, ui::SCALE_FACTOR_NONE); if (piece.empty()) { NOTREACHED() << "Failed to load license txt resource."; return false; @@ -556,17 +547,16 @@ class Delegate : public InternalHandlerDelegate { piece.as_string() + ""; action->mime_type = "text/html"; - action->stream = CefStreamReader::CreateForData( + action->stream = CefStreamReader::CreateForData( const_cast(html.c_str()), html.length()); action->stream_size = html.length(); return true; } - bool OnVersion(CefRefPtr browser, - Action* action) { + bool OnVersion(CefRefPtr browser, Action* action) { base::StringPiece piece = CefContentClient::Get()->GetDataResource( - IDR_CEF_VERSION_HTML, ui::SCALE_FACTOR_NONE); + IDR_CEF_VERSION_HTML, ui::SCALE_FACTOR_NONE); if (piece.empty()) { NOTREACHED() << "Failed to load version html resource."; return false; @@ -576,11 +566,9 @@ class Delegate : public InternalHandlerDelegate { parser.Add("YEAR", MAKE_STRING(COPYRIGHT_YEAR)); parser.Add("CEF", CEF_VERSION); parser.Add("CHROMIUM", - base::StringPrintf("%d.%d.%d.%d", - CHROME_VERSION_MAJOR, - CHROME_VERSION_MINOR, - CHROME_VERSION_BUILD, - CHROME_VERSION_PATCH)); + base::StringPrintf("%d.%d.%d.%d", CHROME_VERSION_MAJOR, + CHROME_VERSION_MINOR, CHROME_VERSION_BUILD, + CHROME_VERSION_PATCH)); parser.Add("OS", GetOSType()); parser.Add("WEBKIT", content::GetWebKitVersion()); parser.Add("JAVASCRIPT", v8::V8::GetVersion()); @@ -588,14 +576,16 @@ class Delegate : public InternalHandlerDelegate { parser.Add("USERAGENT", CefContentClient::Get()->GetUserAgent()); parser.Add("COMMANDLINE", GetCommandLine()); parser.Add("MODULEPATH", GetModulePath()); - parser.Add("CACHEPATH", browser.get() ? - browser->GetHost()->GetRequestContext()->GetCachePath() : ""); + parser.Add("CACHEPATH", + browser.get() + ? browser->GetHost()->GetRequestContext()->GetCachePath() + : ""); std::string tmpl = piece.as_string(); parser.Parse(&tmpl); action->mime_type = "text/html"; - action->stream = CefStreamReader::CreateForData( + action->stream = CefStreamReader::CreateForData( const_cast(tmpl.c_str()), tmpl.length()); action->stream_size = tmpl.length(); @@ -603,8 +593,9 @@ class Delegate : public InternalHandlerDelegate { } bool OnWebUIHosts(Action* action) { - std::string html = "\nWebUI Hosts\n" - "

WebUI Hosts

\n
    \n"; + std::string html = + "\nWebUI Hosts\n" + "

    WebUI Hosts

    \n
      \n"; std::vector list; GetAllowedHosts(&list); @@ -614,15 +605,16 @@ class Delegate : public InternalHandlerDelegate { if (IsUnlistedHost(list[i])) continue; - html += "
    • chrome://" + - list[i] + "
    • \n"; + html += "
    • chrome://" + list[i] + + "
    • \n"; } list.clear(); GetDebugURLs(&list); std::sort(list.begin(), list.end()); - html += "
    \n

    For Debug

    \n" + html += + "
\n

For Debug

\n" "

The following pages are for debugging purposes only. Because they " "crash or hang the renderer, they're not linked directly; you can type " "them into the address bar if you need them.

\n
    \n"; @@ -634,7 +626,7 @@ class Delegate : public InternalHandlerDelegate { html += "\n"; action->mime_type = "text/html"; - action->stream = CefStreamReader::CreateForData( + action->stream = CefStreamReader::CreateForData( const_cast(html.c_str()), html.length()); action->stream_size = html.length(); @@ -646,12 +638,11 @@ void DidFinishChromeVersionLoad(CefRefPtr frame) { // Retieve Flash version information and update asynchronously. class Visitor : public CefWebPluginInfoVisitor { public: - Visitor(CefRefPtr frame) - : frame_(frame) { - } + Visitor(CefRefPtr frame) : frame_(frame) {} bool Visit(CefRefPtr info, - int count, int total) override { + int count, + int total) override { std::string name = info->GetName(); if (name == "Shockwave Flash") { if (frame_->IsValid()) { @@ -676,9 +667,9 @@ void DidFinishChromeVersionLoad(CefRefPtr frame) { } // Wrapper for a ChromeProtocolHandler instance from -// content/browser/webui/url_data_manager_backend.cc. -class ChromeProtocolHandlerWrapper : - public net::URLRequestJobFactory::ProtocolHandler { +// content/browser/webui/url_data_manager_backend.cc. +class ChromeProtocolHandlerWrapper + : public net::URLRequestJobFactory::ProtocolHandler { public: ChromeProtocolHandlerWrapper( CefURLRequestManager* request_manager, @@ -716,8 +707,7 @@ class ChromeProtocolHandlerWrapper : void RegisterChromeHandler(CefURLRequestManager* request_manager) { request_manager->AddFactory( - content::kChromeUIScheme, - std::string(), + content::kChromeUIScheme, std::string(), CreateInternalHandlerFactory(base::WrapUnique(new Delegate()))); } @@ -734,8 +724,7 @@ void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) { CefWebUIControllerFactory::BrowserURLHandlerCreated(handler); } -void DidFinishChromeLoad(CefRefPtr frame, - const GURL& validated_url) { +void DidFinishChromeLoad(CefRefPtr frame, const GURL& validated_url) { ChromeHostId host_id = GetChromeHostId(validated_url.host()); switch (host_id) { case CHROME_VERSION: diff --git a/libcef/browser/net/chrome_scheme_handler.h b/libcef/browser/net/chrome_scheme_handler.h index f2d1d9294..ec6fae426 100644 --- a/libcef/browser/net/chrome_scheme_handler.h +++ b/libcef/browser/net/chrome_scheme_handler.h @@ -39,8 +39,7 @@ void RegisterWebUIControllerFactory(); void BrowserURLHandlerCreated(content::BrowserURLHandler* handler); // Used to fire any asynchronous content updates. -void DidFinishChromeLoad(CefRefPtr frame, - const GURL& validated_url); +void DidFinishChromeLoad(CefRefPtr frame, const GURL& validated_url); // Create a new ProtocolHandler that will filter the URLs passed to the default // "chrome" protocol handler and forward the rest to CEF's handler. diff --git a/libcef/browser/net/cookie_store_proxy.cc b/libcef/browser/net/cookie_store_proxy.cc index b0e6130c3..1d8fa0a71 100644 --- a/libcef/browser/net/cookie_store_proxy.cc +++ b/libcef/browser/net/cookie_store_proxy.cc @@ -14,8 +14,7 @@ CefCookieStoreProxy::CefCookieStoreProxy( CefURLRequestContextImpl* parent, CefRefPtr handler) - : parent_(parent), - handler_(handler) { + : parent_(parent), handler_(handler) { CEF_REQUIRE_IOT(); DCHECK(parent_); DCHECK(handler_.get()); @@ -53,10 +52,9 @@ void CefCookieStoreProxy::SetCookieWithDetailsAsync( const SetCookiesCallback& callback) { net::CookieStore* cookie_store = GetCookieStore(); if (cookie_store) { - cookie_store->SetCookieWithDetailsAsync(url, name, value, domain, path, - creation_time, expiration_time, - last_access_time, secure, http_only, - same_site, priority, callback); + cookie_store->SetCookieWithDetailsAsync( + url, name, value, domain, path, creation_time, expiration_time, + last_access_time, secure, http_only, same_site, priority, callback); } } @@ -85,10 +83,9 @@ void CefCookieStoreProxy::GetAllCookiesAsync( cookie_store->GetAllCookiesAsync(callback); } -void CefCookieStoreProxy::DeleteCookieAsync( - const GURL& url, - const std::string& cookie_name, - const base::Closure& callback) { +void CefCookieStoreProxy::DeleteCookieAsync(const GURL& url, + const std::string& cookie_name, + const base::Closure& callback) { net::CookieStore* cookie_store = GetCookieStore(); if (cookie_store) cookie_store->DeleteCookieAsync(url, cookie_name, callback); @@ -164,8 +161,8 @@ net::CookieStore* CefCookieStoreProxy::GetCookieStore() { CefRefPtr manager = handler_->GetCookieManager(); if (manager.get()) { // Use the cookie store provided by the manager. - cookie_store = reinterpret_cast(manager.get())-> - GetExistingCookieStore(); + cookie_store = reinterpret_cast(manager.get()) + ->GetExistingCookieStore(); DCHECK(cookie_store); return cookie_store; } diff --git a/libcef/browser/net/cookie_store_proxy.h b/libcef/browser/net/cookie_store_proxy.h index cc39d8145..78f1effcb 100644 --- a/libcef/browser/net/cookie_store_proxy.h +++ b/libcef/browser/net/cookie_store_proxy.h @@ -22,29 +22,26 @@ class CefCookieStoreProxy : public net::CookieStore { ~CefCookieStoreProxy() override; // net::CookieStore methods. - void SetCookieWithOptionsAsync( - const GURL& url, - const std::string& cookie_line, - const net::CookieOptions& options, - const SetCookiesCallback& callback) override; - void SetCookieWithDetailsAsync( - const GURL& url, - const std::string& name, - const std::string& value, - const std::string& domain, - const std::string& path, - base::Time creation_time, - base::Time expiration_time, - base::Time last_access_time, - bool secure, - bool http_only, - net::CookieSameSite same_site, - net::CookiePriority priority, - const SetCookiesCallback& callback) override; - void GetCookiesWithOptionsAsync( - const GURL& url, - const net::CookieOptions& options, - const GetCookiesCallback& callback) override; + void SetCookieWithOptionsAsync(const GURL& url, + const std::string& cookie_line, + const net::CookieOptions& options, + const SetCookiesCallback& callback) override; + void SetCookieWithDetailsAsync(const GURL& url, + const std::string& name, + const std::string& value, + const std::string& domain, + const std::string& path, + base::Time creation_time, + base::Time expiration_time, + base::Time last_access_time, + bool secure, + bool http_only, + net::CookieSameSite same_site, + net::CookiePriority priority, + const SetCookiesCallback& callback) override; + void GetCookiesWithOptionsAsync(const GURL& url, + const net::CookieOptions& options, + const GetCookiesCallback& callback) override; void GetCookieListWithOptionsAsync( const GURL& url, const net::CookieOptions& options, diff --git a/libcef/browser/net/devtools_scheme_handler.cc b/libcef/browser/net/devtools_scheme_handler.cc index 45ec23639..a7f0d9ed1 100644 --- a/libcef/browser/net/devtools_scheme_handler.cc +++ b/libcef/browser/net/devtools_scheme_handler.cc @@ -48,8 +48,7 @@ class Delegate : public InternalHandlerDelegate { void RegisterChromeDevToolsHandler(CefURLRequestManager* request_manager) { request_manager->AddFactory( - content::kChromeDevToolsScheme, - kChromeDevToolsHost, + content::kChromeDevToolsScheme, kChromeDevToolsHost, CreateInternalHandlerFactory(base::WrapUnique(new Delegate()))); } diff --git a/libcef/browser/net/internal_scheme_handler.cc b/libcef/browser/net/internal_scheme_handler.cc index e62c9bdfa..615e7ee96 100644 --- a/libcef/browser/net/internal_scheme_handler.cc +++ b/libcef/browser/net/internal_scheme_handler.cc @@ -50,9 +50,7 @@ std::string GetMimeType(const std::string& filename) { class RedirectHandler : public CefResourceHandler { public: - explicit RedirectHandler(const GURL& url) - : url_(url) { - } + explicit RedirectHandler(const GURL& url) : url_(url) {} bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override { @@ -74,8 +72,7 @@ class RedirectHandler : public CefResourceHandler { return false; } - void Cancel() override { - } + void Cancel() override {} private: GURL url_; @@ -88,10 +85,7 @@ class InternalHandler : public CefResourceHandler { InternalHandler(const std::string& mime_type, CefRefPtr reader, int size) - : mime_type_(mime_type), - reader_(reader), - size_(size) { - } + : mime_type_(mime_type), reader_(reader), size_(size) {} bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override { @@ -116,8 +110,7 @@ class InternalHandler : public CefResourceHandler { return (bytes_read > 0); } - void Cancel() override { - } + void Cancel() override {} private: std::string mime_type_; @@ -131,14 +124,12 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory { public: explicit InternalHandlerFactory( std::unique_ptr delegate) - : delegate_(std::move(delegate)) { - } + : delegate_(std::move(delegate)) {} - CefRefPtr Create( - CefRefPtr browser, - CefRefPtr frame, - const CefString& scheme_name, - CefRefPtr request) override { + CefRefPtr Create(CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) override { GURL url = GURL(request->GetURL().ToString()); InternalHandlerDelegate::Action action; @@ -153,20 +144,19 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory { base::StringPiece piece = CefContentClient::Get()->GetDataResource( action.resource_id, ui::SCALE_FACTOR_NONE); if (!piece.empty()) { - action.stream = - CefStreamReader::CreateForData(const_cast(piece.data()), - piece.size()); + action.stream = CefStreamReader::CreateForData( + const_cast(piece.data()), piece.size()); action.stream_size = piece.size(); } else { - NOTREACHED() << "Failed to load internal resource for id: " << - action.resource_id << " URL: " << url.spec().c_str(); + NOTREACHED() << "Failed to load internal resource for id: " + << action.resource_id << " URL: " << url.spec().c_str(); return NULL; } } if (action.stream.get()) { return new InternalHandler(action.mime_type, action.stream, - action.stream_size); + action.stream_size); } } @@ -181,10 +171,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory { } // namespace -InternalHandlerDelegate::Action::Action() - : stream_size(-1), - resource_id(-1) { -} +InternalHandlerDelegate::Action::Action() : stream_size(-1), resource_id(-1) {} CefRefPtr CreateInternalHandlerFactory( std::unique_ptr delegate) { diff --git a/libcef/browser/net/network_delegate.cc b/libcef/browser/net/network_delegate.cc index bc61e4084..b4770f312 100644 --- a/libcef/browser/net/network_delegate.cc +++ b/libcef/browser/net/network_delegate.cc @@ -32,12 +32,11 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback { public: typedef net::CompletionCallback CallbackType; - CefBeforeResourceLoadCallbackImpl( - CefRefPtr cef_request, - GURL* new_url, - net::URLRequest* url_request, - bool force_google_safesearch, - const CallbackType& callback) + CefBeforeResourceLoadCallbackImpl(CefRefPtr cef_request, + GURL* new_url, + net::URLRequest* url_request, + bool force_google_safesearch, + const CallbackType& callback) : cef_request_(cef_request), new_url_(new_url), url_request_(url_request), @@ -57,10 +56,10 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback { RunNow(cef_request_, new_url_, url_request_, callback_, force_google_safesearch_, false); } else { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefBeforeResourceLoadCallbackImpl::RunNow, - cef_request_, new_url_, url_request_, callback_, - force_google_safesearch_, false)); + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefBeforeResourceLoadCallbackImpl::RunNow, + cef_request_, new_url_, url_request_, callback_, + force_google_safesearch_, false)); } } } @@ -68,13 +67,11 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback { void Continue(bool allow) override { // Always continue asynchronously. CEF_POST_TASK(CEF_IOT, - base::Bind(&CefBeforeResourceLoadCallbackImpl::ContinueNow, - this, allow)); + base::Bind(&CefBeforeResourceLoadCallbackImpl::ContinueNow, + this, allow)); } - void Cancel() override { - Continue(false); - } + void Cancel() override { Continue(false); } void ContinueNow(bool allow) { CEF_REQUIRE_IOT(); @@ -99,16 +96,13 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback { class Disconnector : public base::SupportsUserData::Data { public: explicit Disconnector(CefBeforeResourceLoadCallbackImpl* callback) - : callback_(callback) { - } + : callback_(callback) {} ~Disconnector() override { if (callback_) callback_->Disconnect(); } - void Disconnect() { - callback_ = NULL; - } + void Disconnect() { callback_ = NULL; } private: CefBeforeResourceLoadCallbackImpl* callback_; @@ -151,9 +145,7 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback { } } - static inline void* UserDataKey() { - return &kLocatorKey; - } + static inline void* UserDataKey() { return &kLocatorKey; } CefRefPtr cef_request_; const GURL old_url_; @@ -175,9 +167,7 @@ class CefAuthCallbackImpl : public CefAuthCallback { public: CefAuthCallbackImpl(const net::NetworkDelegate::AuthCallback& callback, net::AuthCredentials* credentials) - : callback_(callback), - credentials_(credentials) { - } + : callback_(callback), credentials_(credentials) {} ~CefAuthCallbackImpl() override { if (!callback_.is_null()) { // The auth callback is still pending. Cancel it now. @@ -185,13 +175,12 @@ class CefAuthCallbackImpl : public CefAuthCallback { CancelNow(callback_); } else { CEF_POST_TASK(CEF_IOT, - base::Bind(&CefAuthCallbackImpl::CancelNow, callback_)); + base::Bind(&CefAuthCallbackImpl::CancelNow, callback_)); } } } - void Continue(const CefString& username, - const CefString& password) override { + void Continue(const CefString& username, const CefString& password) override { if (CEF_CURRENTLY_ON_IOT()) { if (!callback_.is_null()) { credentials_->Set(username, password); @@ -199,8 +188,8 @@ class CefAuthCallbackImpl : public CefAuthCallback { callback_.Reset(); } } else { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefAuthCallbackImpl::Continue, this, username, password)); + CEF_POST_TASK(CEF_IOT, base::Bind(&CefAuthCallbackImpl::Continue, this, + username, password)); } } @@ -215,9 +204,7 @@ class CefAuthCallbackImpl : public CefAuthCallback { } } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: static void CancelNow(const net::NetworkDelegate::AuthCallback& callback) { @@ -233,20 +220,17 @@ class CefAuthCallbackImpl : public CefAuthCallback { } // namespace -CefNetworkDelegate::CefNetworkDelegate() - : force_google_safesearch_(nullptr) { -} +CefNetworkDelegate::CefNetworkDelegate() : force_google_safesearch_(nullptr) {} -CefNetworkDelegate::~CefNetworkDelegate() { -} +CefNetworkDelegate::~CefNetworkDelegate() {} // static bool CefNetworkDelegate::AreExperimentalCookieFeaturesEnabled() { static bool initialized = false; static bool enabled = false; if (!initialized) { - enabled = base::CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kEnableExperimentalWebPlatformFeatures); + enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExperimentalWebPlatformFeatures); initialized = true; } return enabled; @@ -274,9 +258,8 @@ std::unique_ptr CefNetworkDelegate::CreateSourceStream( cefResponse->Set(request); cefResponse->SetReadOnly(true); - cef_filter = handler->GetResourceResponseFilter(browser.get(), frame, - cefRequest.get(), - cefResponse.get()); + cef_filter = handler->GetResourceResponseFilter( + browser.get(), frame, cefRequest.get(), cefResponse.get()); } } } @@ -384,11 +367,8 @@ void CefNetworkDelegate::OnCompleted(net::URLRequest* request, bool started) { const int64 received_content_length = request->received_response_content_length(); - handler->OnResourceLoadComplete(browser.get(), - frame, - cefRequest.get(), - cefResponse.get(), - status, + handler->OnResourceLoadComplete(browser.get(), frame, cefRequest.get(), + cefResponse.get(), status, received_content_length); } } @@ -411,14 +391,10 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired( CefRefPtr callbackPtr( new CefAuthCallbackImpl(callback, credentials)); - if (handler->GetAuthCredentials(browser.get(), - frame, - auth_info.is_proxy, - auth_info.challenger.host(), - auth_info.challenger.port(), - auth_info.realm, - auth_info.scheme, - callbackPtr.get())) { + if (handler->GetAuthCredentials( + browser.get(), frame, auth_info.is_proxy, + auth_info.challenger.host(), auth_info.challenger.port(), + auth_info.realm, auth_info.scheme, callbackPtr.get())) { return AUTH_REQUIRED_RESPONSE_IO_PENDING; } else { callbackPtr->Disconnect(); @@ -435,12 +411,10 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired( if (client.get()) { CefRefPtr callbackPtr( new CefAuthCallbackImpl(callback, credentials)); - if (client->GetAuthCredentials(auth_info.is_proxy, - auth_info.challenger.host(), - auth_info.challenger.port(), - auth_info.realm, - auth_info.scheme, - callbackPtr.get())) { + if (client->GetAuthCredentials( + auth_info.is_proxy, auth_info.challenger.host(), + auth_info.challenger.port(), auth_info.realm, auth_info.scheme, + callbackPtr.get())) { return AUTH_REQUIRED_RESPONSE_IO_PENDING; } else { callbackPtr->Disconnect(); diff --git a/libcef/browser/net/network_delegate.h b/libcef/browser/net/network_delegate.h index 57c3f2918..761f36971 100644 --- a/libcef/browser/net/network_delegate.h +++ b/libcef/browser/net/network_delegate.h @@ -9,7 +9,8 @@ #include "base/macros.h" #include "net/base/network_delegate_impl.h" -template class PrefMember; +template +class PrefMember; typedef PrefMember BooleanPrefMember; // Used for intercepting resource requests, redirects and responses. The single @@ -23,8 +24,7 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl { // RenderFrameMessageFilter::OnSetCookie. static bool AreExperimentalCookieFeaturesEnabled(); - void set_force_google_safesearch( - BooleanPrefMember* force_google_safesearch) { + void set_force_google_safesearch(BooleanPrefMember* force_google_safesearch) { force_google_safesearch_ = force_google_safesearch; } diff --git a/libcef/browser/net/resource_request_job.cc b/libcef/browser/net/resource_request_job.cc index 34d7c9288..0b045de55 100644 --- a/libcef/browser/net/resource_request_job.cc +++ b/libcef/browser/net/resource_request_job.cc @@ -32,7 +32,7 @@ bool SetHeaderIfMissing(CefRequest::HeaderMap& headerMap, const std::string& value) { if (value.empty()) return false; - + CefRequest::HeaderMap::const_iterator it = headerMap.find(name); if (it == headerMap.end()) { headerMap.insert(std::make_pair(name, value)); @@ -53,20 +53,19 @@ class CefResourceRequestJobCallback : public CefCallback { }; explicit CefResourceRequestJobCallback(CefResourceRequestJob* job, Type type) - : job_(job), - type_(type), - dest_(NULL), - dest_size_(0) {} + : job_(job), type_(type), dest_(NULL), dest_size_(0) {} void Continue() override { // Continue asynchronously. - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefResourceRequestJobCallback::ContinueOnIOThread, this)); } void Cancel() override { // Cancel asynchronously. - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefResourceRequestJobCallback::CancelOnIOThread, this)); } @@ -103,8 +102,7 @@ class CefResourceRequestJobCallback : public CefCallback { Detach(); } else if (type_ == BYTES_AVAILABLE) { // Callback for bytes available. - if (job_->has_response_started() && - job_->GetStatus().is_io_pending()) { + if (job_->has_response_started() && job_->GetStatus().is_io_pending()) { // Read the bytes. They should be available but, if not, wait again. int bytes_read = job_->ReadRawData(dest_, dest_size_); if (bytes_read == net::ERR_IO_PENDING) { @@ -155,11 +153,9 @@ CefResourceRequestJob::CefResourceRequestJob( remaining_bytes_(0), sent_bytes_(0), response_cookies_save_index_(0), - weak_factory_(this) { -} + weak_factory_(this) {} -CefResourceRequestJob::~CefResourceRequestJob() { -} +CefResourceRequestJob::~CefResourceRequestJob() {} void CefResourceRequestJob::Start() { CEF_REQUIRE_IOT(); @@ -186,8 +182,7 @@ void CefResourceRequestJob::Start() { changed = true; } - if (SetHeaderIfMissing(headerMap, - net::HttpRequestHeaders::kUserAgent, + if (SetHeaderIfMissing(headerMap, net::HttpRequestHeaders::kUserAgent, ua_settings->GetUserAgent())) { changed = true; } @@ -239,8 +234,8 @@ int CefResourceRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size) { if (!callback_.get()) { // Create the bytes available callback that will be used until the request // is completed. - callback_ = new CefResourceRequestJobCallback(this, - CefResourceRequestJobCallback::BYTES_AVAILABLE); + callback_ = new CefResourceRequestJobCallback( + this, CefResourceRequestJobCallback::BYTES_AVAILABLE); } // Read response data from the handler. @@ -306,10 +301,10 @@ bool CefResourceRequestJob::IsRedirectResponse(GURL* location, response_->GetHeaderMap(headerMap); CefRequest::HeaderMap::iterator iter = headerMap.find("Location"); if (iter != headerMap.end()) { - GURL new_url = GURL(std::string(iter->second)); - *http_status_code = status; - location->Swap(&new_url); - return true; + GURL new_url = GURL(std::string(iter->second)); + *http_status_code = status; + location->Swap(&new_url); + return true; } } } @@ -391,7 +386,7 @@ void CefResourceRequestJob::AddCookieHeaderAndStart() { cookie_store->GetAllCookiesForURLAsync( request_->url(), base::Bind(&CefResourceRequestJob::CheckCookiePolicyAndLoad, - weak_factory_.GetWeakPtr())); + weak_factory_.GetWeakPtr())); } else { DoStartTransaction(); } @@ -450,8 +445,8 @@ void CefResourceRequestJob::DoStartTransaction() { void CefResourceRequestJob::StartTransaction() { // Create the callback that will be used to notify when header information is // available. - callback_ = new CefResourceRequestJobCallback(this, - CefResourceRequestJobCallback::HEADERS_AVAILABLE); + callback_ = new CefResourceRequestJobCallback( + this, CefResourceRequestJobCallback::HEADERS_AVAILABLE); // Protect against deletion of this object. base::WeakPtr weak_ptr(weak_factory_.GetWeakPtr()); @@ -499,12 +494,13 @@ void CefResourceRequestJob::SaveNextCookie() { net::CookieOptions options; options.set_include_httponly(); - bool can_set_cookie = CanSetCookie( - response_cookies_[response_cookies_save_index_], &options); + bool can_set_cookie = + CanSetCookie(response_cookies_[response_cookies_save_index_], &options); if (can_set_cookie) { CefCookie cookie; - if (CefCookieManagerImpl::GetCefCookie(request_->url(), - response_cookies_[response_cookies_save_index_], cookie)) { + if (CefCookieManagerImpl::GetCefCookie( + request_->url(), response_cookies_[response_cookies_save_index_], + cookie)) { can_set_cookie = handler_->CanSetCookie(cookie); } else { can_set_cookie = false; @@ -514,8 +510,9 @@ void CefResourceRequestJob::SaveNextCookie() { if (can_set_cookie) { request_->context()->cookie_store()->SetCookieWithOptionsAsync( request_->url(), response_cookies_[response_cookies_save_index_], - options, base::Bind(&CefResourceRequestJob::OnCookieSaved, - weak_factory_.GetWeakPtr())); + options, + base::Bind(&CefResourceRequestJob::OnCookieSaved, + weak_factory_.GetWeakPtr())); return; } diff --git a/libcef/browser/net/resource_request_job.h b/libcef/browser/net/resource_request_job.h index 364415810..d73ed4341 100644 --- a/libcef/browser/net/resource_request_job.h +++ b/libcef/browser/net/resource_request_job.h @@ -37,10 +37,8 @@ class CefResourceRequestJob : public net::URLRequestJob { void Kill() override; int ReadRawData(net::IOBuffer* dest, int dest_size) override; void GetResponseInfo(net::HttpResponseInfo* info) override; - void GetLoadTimingInfo( - net::LoadTimingInfo* load_timing_info) const override; - bool IsRedirectResponse(GURL* location, int* http_status_code) - override; + void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; + bool IsRedirectResponse(GURL* location, int* http_status_code) override; bool GetMimeType(std::string* mime_type) const override; void SendHeaders(); diff --git a/libcef/browser/net/scheme_handler.cc b/libcef/browser/net/scheme_handler.cc index 8dae14f69..ffa282ee0 100644 --- a/libcef/browser/net/scheme_handler.cc +++ b/libcef/browser/net/scheme_handler.cc @@ -28,30 +28,28 @@ void InstallInternalProtectedHandlers( CefURLRequestManager* request_manager, content::ProtocolHandlerMap* protocol_handlers, net::HostResolver* host_resolver) { - protocol_handlers->insert( - std::make_pair(url::kDataScheme, - linked_ptr( - new net::DataProtocolHandler))); - protocol_handlers->insert( - std::make_pair(url::kFileScheme, - linked_ptr( - new net::FileProtocolHandler( - content::BrowserThread::GetBlockingPool()-> - GetTaskRunnerWithShutdownBehavior( - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))))); + protocol_handlers->insert(std::make_pair( + url::kDataScheme, linked_ptr( + new net::DataProtocolHandler))); + protocol_handlers->insert(std::make_pair( + url::kFileScheme, + linked_ptr( + new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool() + ->GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))))); #if !BUILDFLAG(DISABLE_FTP_SUPPORT) - protocol_handlers->insert( - std::make_pair(url::kFtpScheme, - linked_ptr( - net::FtpProtocolHandler::Create(host_resolver).release()))); + protocol_handlers->insert(std::make_pair( + url::kFtpScheme, + linked_ptr( + net::FtpProtocolHandler::Create(host_resolver).release()))); #endif - for (content::ProtocolHandlerMap::iterator it = - protocol_handlers->begin(); - it != protocol_handlers->end(); - ++it) { + for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin(); + it != protocol_handlers->end(); ++it) { const std::string& scheme = it->first; - std::unique_ptr protocol_handler; + std::unique_ptr + protocol_handler; if (scheme == content::kChromeDevToolsScheme) { // Don't use the default "chrome-devtools" handler. @@ -61,8 +59,8 @@ void InstallInternalProtectedHandlers( // not to interfere with CEF's "chrome" handler. protocol_handler.reset( scheme::WrapChromeProtocolHandler( - request_manager, - base::WrapUnique(it->second.release())).release()); + request_manager, base::WrapUnique(it->second.release())) + .release()); } else { protocol_handler.reset(it->second.release()); } diff --git a/libcef/browser/net/source_stream.cc b/libcef/browser/net/source_stream.cc index 5c6622c01..0a9fd4f39 100644 --- a/libcef/browser/net/source_stream.cc +++ b/libcef/browser/net/source_stream.cc @@ -10,13 +10,11 @@ // Use TYPE_INVALID so that URLRequestJob::NotifyHeadersComplete() doesn't // assume that the "content-length" header is accurate. -CefSourceStream::CefSourceStream( - CefRefPtr cef_filter, - std::unique_ptr upstream) - : net::FilterSourceStream(net::SourceStream::TYPE_INVALID, - std::move(upstream)), - cef_filter_(cef_filter) { -} +CefSourceStream::CefSourceStream(CefRefPtr cef_filter, + std::unique_ptr upstream) + : net::FilterSourceStream(net::SourceStream::TYPE_INVALID, + std::move(upstream)), + cef_filter_(cef_filter) {} int CefSourceStream::FilterData(net::IOBuffer* output_buffer, int output_buffer_size, @@ -40,9 +38,8 @@ int CefSourceStream::FilterData(net::IOBuffer* output_buffer, size_t data_out_written = 0; last_status_ = cef_filter_->Filter( - data_in_size > 0 ? input_buffer->data() : nullptr, - data_in_size, data_in_read, - output_buffer->data(), data_out_size, data_out_written); + data_in_size > 0 ? input_buffer->data() : nullptr, data_in_size, + data_in_read, output_buffer->data(), data_out_size, data_out_written); // Return early if there's an error. if (last_status_ == RESPONSE_FILTER_ERROR) diff --git a/libcef/browser/net/url_request_context.h b/libcef/browser/net/url_request_context.h index 0b56188bf..b39479082 100644 --- a/libcef/browser/net/url_request_context.h +++ b/libcef/browser/net/url_request_context.h @@ -21,7 +21,7 @@ class CefURLRequestContext : public net::URLRequestContext { #if DCHECK_IS_ON() // Simple tracking of allocated objects. - static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) + static base::AtomicRefCount DebugObjCt; #endif private: diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index b0d734ed7..5c72557b2 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -41,8 +41,8 @@ #include "net/cert/ct_policy_enforcer.h" #include "net/cert/multi_log_ct_verifier.h" #include "net/cookies/cookie_monster.h" -#include "net/extras/sqlite/sqlite_persistent_cookie_store.h" #include "net/dns/host_resolver.h" +#include "net/extras/sqlite/sqlite_persistent_cookie_store.h" #include "net/ftp/ftp_network_layer.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_auth_preferences.h" @@ -52,7 +52,6 @@ #include "net/http/transport_security_state.h" #include "net/proxy/proxy_service.h" #include "net/ssl/ssl_config_service_defaults.h" -#include "url/url_constants.h" #include "net/url_request/http_user_agent_settings.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" @@ -60,6 +59,7 @@ #include "net/url_request/url_request_intercepting_job_factory.h" #include "net/url_request/url_request_job_factory_impl.h" #include "net/url_request/url_request_job_manager.h" +#include "url/url_constants.h" #if defined(OS_WIN) #include @@ -83,8 +83,8 @@ namespace { class CefHttpUserAgentSettings : public net::HttpUserAgentSettings { public: explicit CefHttpUserAgentSettings(const std::string& raw_language_list) - : http_accept_language_(net::HttpUtil::GenerateAcceptLanguageHeader( - raw_language_list)) { + : http_accept_language_( + net::HttpUtil::GenerateAcceptLanguageHeader(raw_language_list)) { CEF_REQUIRE_IOT(); } @@ -115,8 +115,7 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( content::ProtocolHandlerMap* protocol_handlers, std::unique_ptr proxy_config_service, content::URLRequestInterceptorScopedVector request_interceptors) - : settings_(settings), - io_state_(base::MakeUnique()) { + : settings_(settings), io_state_(base::MakeUnique()) { // Must first be created on the UI thread. CEF_REQUIRE_UIT(); @@ -150,13 +149,13 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( auth_server_whitelist_.Init( prefs::kAuthServerWhitelist, pref_service, base::Bind(&CefURLRequestContextGetterImpl::UpdateServerWhitelist, - base::Unretained(this))); + base::Unretained(this))); auth_server_whitelist_.MoveToThread(io_thread_proxy); auth_negotiate_delegate_whitelist_.Init( prefs::kAuthNegotiateDelegateWhitelist, pref_service, base::Bind(&CefURLRequestContextGetterImpl::UpdateDelegateWhitelist, - base::Unretained(this))); + base::Unretained(this))); auth_negotiate_delegate_whitelist_.MoveToThread(io_thread_proxy); } @@ -169,7 +168,7 @@ CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() { // static void CefURLRequestContextGetterImpl::RegisterPrefs( PrefRegistrySimple* registry) { - // Based on IOThread::RegisterPrefs. +// Based on IOThread::RegisterPrefs. #if defined(OS_POSIX) && !defined(OS_ANDROID) registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); #endif @@ -188,7 +187,8 @@ void CefURLRequestContextGetterImpl::ShutdownOnUIThread() { auth_server_whitelist_.Destroy(); auth_negotiate_delegate_whitelist_.Destroy(); - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefURLRequestContextGetterImpl::ShutdownOnIOThread, this)); } @@ -235,10 +235,11 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { io_state_->storage_->set_network_delegate(std::move(network_delegate)); const std::string& accept_language = - settings_.accept_language_list.length > 0 ? - CefString(&settings_.accept_language_list): "en-US,en"; - io_state_->storage_->set_http_user_agent_settings(base::WrapUnique( - new CefHttpUserAgentSettings(accept_language))); + settings_.accept_language_list.length > 0 + ? CefString(&settings_.accept_language_list) + : "en-US,en"; + io_state_->storage_->set_http_user_agent_settings( + base::WrapUnique(new CefHttpUserAgentSettings(accept_language))); io_state_->storage_->set_host_resolver( net::HostResolver::CreateDefaultResolver(io_state_->net_log_)); @@ -266,11 +267,9 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { std::unique_ptr system_proxy_service = ProxyServiceFactory::CreateProxyService( - io_state_->net_log_, - io_state_->url_request_context_.get(), + io_state_->net_log_, io_state_->url_request_context_.get(), io_state_->url_request_context_->network_delegate(), - std::move(io_state_->proxy_config_service_), - *command_line, + std::move(io_state_->proxy_config_service_), *command_line, quick_check_enabled_.GetValue(), pac_https_url_stripping_enabled_.GetValue()); io_state_->storage_->set_proxy_service(std::move(system_proxy_service)); @@ -284,10 +283,11 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { supported_schemes.push_back("ntlm"); supported_schemes.push_back("negotiate"); - io_state_->http_auth_preferences_.reset( - new net::HttpAuthPreferences(supported_schemes + io_state_->http_auth_preferences_.reset(new net::HttpAuthPreferences( + supported_schemes #if defined(OS_POSIX) && !defined(OS_ANDROID) - , io_state_->gsapi_library_name_ + , + io_state_->gsapi_library_name_ #endif )); @@ -295,8 +295,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { net::HttpAuthHandlerRegistryFactory::Create( io_state_->http_auth_preferences_.get(), io_state_->url_request_context_->host_resolver())); - io_state_->storage_->set_http_server_properties(base::WrapUnique( - new net::HttpServerPropertiesImpl)); + io_state_->storage_->set_http_server_properties( + base::WrapUnique(new net::HttpServerPropertiesImpl)); base::FilePath http_cache_path; if (!cache_path.empty()) @@ -308,11 +308,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { std::unique_ptr main_backend( new net::HttpCache::DefaultBackend( cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE, - net::CACHE_BACKEND_DEFAULT, - http_cache_path, - 0, - BrowserThread::GetTaskRunnerForThread( - BrowserThread::CACHE))); + net::CACHE_BACKEND_DEFAULT, http_cache_path, 0, + BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE))); net::HttpNetworkSession::Params network_session_params; network_session_params.host_resolver = @@ -339,10 +336,10 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { io_state_->storage_->set_http_network_session( base::WrapUnique(new net::HttpNetworkSession(network_session_params))); - io_state_->storage_->set_http_transaction_factory(base::WrapUnique( - new net::HttpCache(io_state_->storage_->http_network_session(), - std::move(main_backend), - true /* set_up_quic_server_info */))); + io_state_->storage_->set_http_transaction_factory( + base::WrapUnique(new net::HttpCache( + io_state_->storage_->http_network_session(), + std::move(main_backend), true /* set_up_quic_server_info */))); std::unique_ptr job_factory( new net::URLRequestJobFactoryImpl()); @@ -351,10 +348,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { // Install internal scheme handlers that cannot be overridden. scheme::InstallInternalProtectedHandlers( - job_factory.get(), - io_state_->url_request_manager_.get(), - &io_state_->protocol_handlers_, - network_session_params.host_resolver); + job_factory.get(), io_state_->url_request_manager_.get(), + &io_state_->protocol_handlers_, network_session_params.host_resolver); io_state_->protocol_handlers_.clear(); // Register internal scheme handlers that can be overridden. @@ -390,7 +385,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { } scoped_refptr - CefURLRequestContextGetterImpl::GetNetworkTaskRunner() const { +CefURLRequestContextGetterImpl::GetNetworkTaskRunner() const { return BrowserThread::GetTaskRunnerForThread(CEF_IOT); } @@ -415,16 +410,12 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath( // TODO(cef): Move directory creation to the blocking pool instead of // allowing file IO on this thread. base::ThreadRestrictions::ScopedAllowIO allow_io; - if (base::DirectoryExists(path) || - base::CreateDirectory(path)) { + if (base::DirectoryExists(path) || base::CreateDirectory(path)) { const base::FilePath& cookie_path = path.AppendASCII("Cookies"); - persistent_store = - new net::SQLitePersistentCookieStore( - cookie_path, - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), - BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), - persist_session_cookies, - NULL); + persistent_store = new net::SQLitePersistentCookieStore( + cookie_path, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), + BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), + persist_session_cookies, NULL); } else { NOTREACHED() << "The cookie storage directory could not be created"; } @@ -436,7 +427,7 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath( std::unique_ptr cookie_monster( new net::CookieMonster(persistent_store.get(), NULL)); if (persistent_store.get() && persist_session_cookies) - cookie_monster->SetPersistSessionCookies(true); + cookie_monster->SetPersistSessionCookies(true); io_state_->cookie_store_path_ = path; // Restore the previously supported schemes. @@ -459,15 +450,16 @@ void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes( void CefURLRequestContextGetterImpl::AddHandler( CefRefPtr handler) { if (!CEF_CURRENTLY_ON_IOT()) { - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefURLRequestContextGetterImpl::AddHandler, this, handler)); return; } io_state_->handler_list_.push_back(handler); } -net::CookieStore* - CefURLRequestContextGetterImpl::GetExistingCookieStore() const { +net::CookieStore* CefURLRequestContextGetterImpl::GetExistingCookieStore() + const { CEF_REQUIRE_IOT(); if (io_state_->url_request_context_ && io_state_->url_request_context_->cookie_store()) { diff --git a/libcef/browser/net/url_request_context_getter_impl.h b/libcef/browser/net/url_request_context_getter_impl.h index 2612b679a..758fcbea3 100644 --- a/libcef/browser/net/url_request_context_getter_impl.h +++ b/libcef/browser/net/url_request_context_getter_impl.h @@ -62,8 +62,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { // net::URLRequestContextGetter implementation. net::URLRequestContext* GetURLRequestContext() override; - scoped_refptr - GetNetworkTaskRunner() const override; + scoped_refptr GetNetworkTaskRunner() + const override; // CefURLRequestContextGetter implementation. net::HostResolver* GetHostResolver() const override; @@ -118,7 +118,7 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { base::FilePath cookie_store_path_; std::vector cookie_supported_schemes_; - std::vector > handler_list_; + std::vector> handler_list_; }; std::unique_ptr io_state_; diff --git a/libcef/browser/net/url_request_context_getter_proxy.cc b/libcef/browser/net/url_request_context_getter_proxy.cc index e814eeb5e..de4c2607c 100644 --- a/libcef/browser/net/url_request_context_getter_proxy.cc +++ b/libcef/browser/net/url_request_context_getter_proxy.cc @@ -11,8 +11,7 @@ CefURLRequestContextGetterProxy::CefURLRequestContextGetterProxy( CefRefPtr handler, scoped_refptr parent) - : handler_(handler), - parent_(parent) { + : handler_(handler), parent_(parent) { DCHECK(handler_.get()); DCHECK(parent_.get()); } @@ -23,7 +22,8 @@ CefURLRequestContextGetterProxy::~CefURLRequestContextGetterProxy() { void CefURLRequestContextGetterProxy::ShutdownOnUIThread() { CEF_REQUIRE_UIT(); - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefURLRequestContextGetterProxy::ShutdownOnIOThread, this)); } @@ -35,23 +35,22 @@ void CefURLRequestContextGetterProxy::ShutdownOnIOThread() { } net::URLRequestContext* - CefURLRequestContextGetterProxy::GetURLRequestContext() { +CefURLRequestContextGetterProxy::GetURLRequestContext() { CEF_REQUIRE_IOT(); if (shutting_down_) return nullptr; if (!context_proxy_) { - context_proxy_.reset( - new CefURLRequestContextProxy(static_cast( - parent_->GetURLRequestContext()), - handler_)); + context_proxy_.reset(new CefURLRequestContextProxy( + static_cast(parent_->GetURLRequestContext()), + handler_)); } return context_proxy_.get(); } scoped_refptr - CefURLRequestContextGetterProxy::GetNetworkTaskRunner() const { +CefURLRequestContextGetterProxy::GetNetworkTaskRunner() const { return parent_->GetNetworkTaskRunner(); } diff --git a/libcef/browser/net/url_request_context_getter_proxy.h b/libcef/browser/net/url_request_context_getter_proxy.h index ed693d9d2..4c2b3f1d2 100644 --- a/libcef/browser/net/url_request_context_getter_proxy.h +++ b/libcef/browser/net/url_request_context_getter_proxy.h @@ -10,7 +10,6 @@ #include "libcef/browser/net/url_request_context_getter.h" #include "libcef/browser/net/url_request_context_getter_impl.h" - class CefURLRequestContextProxy; // URLRequestContextGetter implementation for a particular CefRequestContext. @@ -29,8 +28,8 @@ class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter { // net::URLRequestContextGetter implementation. net::URLRequestContext* GetURLRequestContext() override; - scoped_refptr - GetNetworkTaskRunner() const override; + scoped_refptr GetNetworkTaskRunner() + const override; // CefURLRequestContextGetter implementation. net::HostResolver* GetHostResolver() const override; diff --git a/libcef/browser/net/url_request_context_proxy.h b/libcef/browser/net/url_request_context_proxy.h index fabb4fe03..4862e1051 100644 --- a/libcef/browser/net/url_request_context_proxy.h +++ b/libcef/browser/net/url_request_context_proxy.h @@ -9,7 +9,6 @@ #include "include/cef_request_context_handler.h" #include "libcef/browser/net/url_request_context.h" - class CefBrowserHostImpl; class CefCookieStoreProxy; class CefURLRequestContextImpl; diff --git a/libcef/browser/net/url_request_interceptor.cc b/libcef/browser/net/url_request_interceptor.cc index aa744caa1..757e48ddf 100644 --- a/libcef/browser/net/url_request_interceptor.cc +++ b/libcef/browser/net/url_request_interceptor.cc @@ -149,6 +149,6 @@ net::URLRequestJob* CefRequestInterceptor::MaybeInterceptResponse( } // Otherwise queue a new job. - return net::URLRequestJobManager::GetInstance()->CreateJob( - request, network_delegate); + return net::URLRequestJobManager::GetInstance()->CreateJob(request, + network_delegate); } diff --git a/libcef/browser/net/url_request_manager.cc b/libcef/browser/net/url_request_manager.cc index 9db89e119..4a76d1540 100644 --- a/libcef/browser/net/url_request_manager.cc +++ b/libcef/browser/net/url_request_manager.cc @@ -42,8 +42,8 @@ struct SchemeToFactory { net::URLRequest::ProtocolFactory* factory; }; static const SchemeToFactory kBuiltinFactories[] = { - { "http", net::URLRequestHttpJob::Factory }, - { "https", net::URLRequestHttpJob::Factory }, + {"http", net::URLRequestHttpJob::Factory}, + {"https", net::URLRequestHttpJob::Factory}, }; bool IsBuiltinScheme(const std::string& scheme) { @@ -73,7 +73,7 @@ net::URLRequestJob* GetBuiltinSchemeRequestJob( std::string ToLower(const std::string& str) { std::string str_lower = str; std::transform(str_lower.begin(), str_lower.end(), str_lower.begin(), - towlower); + towlower); return str; } @@ -85,8 +85,7 @@ class CefProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { public: CefProtocolHandler(CefURLRequestManager* request_manager, const std::string& scheme) - : request_manager_(request_manager), - scheme_(scheme) {} + : request_manager_(request_manager), scheme_(scheme) {} // From net::URLRequestJobFactory::ProtocolHandler net::URLRequestJob* MaybeCreateJob( @@ -101,7 +100,6 @@ class CefProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { std::string scheme_; }; - CefURLRequestManager::CefURLRequestManager( net::URLRequestJobFactoryImpl* job_factory) : job_factory_(job_factory) { @@ -165,12 +163,12 @@ void CefURLRequestManager::ClearFactories() { // Create a unique set of scheme names. std::set schemes; for (HandlerMap::const_iterator i = handler_map_.begin(); - i != handler_map_.end(); ++i) { + i != handler_map_.end(); ++i) { schemes.insert(i->first.first); } for (std::set::const_iterator scheme = schemes.begin(); - scheme != schemes.end(); ++scheme) { + scheme != schemes.end(); ++scheme) { const std::string& scheme_name = *scheme; if (!scheme::IsInternalProtectedScheme(scheme_name)) { bool set_protocol = job_factory_->SetProtocolHandler(scheme_name, NULL); @@ -211,7 +209,7 @@ bool CefURLRequestManager::HasFactory(const std::string& scheme) { return false; for (HandlerMap::const_iterator i = handler_map_.begin(); - i != handler_map_.end(); ++i) { + i != handler_map_.end(); ++i) { if (scheme == i->first.first) return true; } diff --git a/libcef/browser/net/url_request_manager.h b/libcef/browser/net/url_request_manager.h index 46e2b5e44..f4717ec01 100644 --- a/libcef/browser/net/url_request_manager.h +++ b/libcef/browser/net/url_request_manager.h @@ -33,8 +33,7 @@ class CefURLRequestManager { CefRefPtr factory); // Remove all factories associated with the specified |scheme| and |domain|. - void RemoveFactory(const std::string& scheme, - const std::string& domain); + void RemoveFactory(const std::string& scheme, const std::string& domain); // Clear all the existing URL handlers and unregister the ProtocolFactory. void ClearFactories(); @@ -57,7 +56,8 @@ class CefURLRequestManager { // Retrieve the matching handler factory, if any. |scheme| will already be in // lower case. CefRefPtr GetHandlerFactory( - net::URLRequest* request, const std::string& scheme); + net::URLRequest* request, + const std::string& scheme); // Create the job that will handle the request. |scheme| will already be in // lower case. @@ -71,7 +71,8 @@ class CefURLRequestManager { // Map (scheme, domain) to factories. typedef std::map, - CefRefPtr > HandlerMap; + CefRefPtr> + HandlerMap; HandlerMap handler_map_; DISALLOW_COPY_AND_ASSIGN(CefURLRequestManager); diff --git a/libcef/browser/net/url_request_user_data.h b/libcef/browser/net/url_request_user_data.h index 9cbee24a7..da9ea2fd0 100644 --- a/libcef/browser/net/url_request_user_data.h +++ b/libcef/browser/net/url_request_user_data.h @@ -6,10 +6,10 @@ #define CEF_LIBCEF_BROWSER_NET_URL_REQUEST_USER_DATA_H_ #include "include/cef_base.h" -#include "base/supports_user_data.h" - #include "include/cef_urlrequest.h" +#include "base/supports_user_data.h" + // Used to annotate all URLRequests for which the request can be associated // with the CefURLRequestClient. class CefURLRequestUserData : public base::SupportsUserData::Data { @@ -20,7 +20,7 @@ class CefURLRequestUserData : public base::SupportsUserData::Data { CefRefPtr GetClient(); static const void* kUserDataKey; -private: + private: CefRefPtr client_; }; diff --git a/libcef/browser/origin_whitelist_impl.cc b/libcef/browser/origin_whitelist_impl.cc index b6bd2ac57..6bd3bca6a 100644 --- a/libcef/browser/origin_whitelist_impl.cc +++ b/libcef/browser/origin_whitelist_impl.cc @@ -207,7 +207,8 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, return CefOriginWhitelistManager::GetInstance()->AddOriginEntry( source_origin, target_protocol, target_domain, allow_target_subdomains); } else { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefAddCrossOriginWhitelistEntry), source_origin, target_protocol, target_domain, allow_target_subdomains)); @@ -237,7 +238,8 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, return CefOriginWhitelistManager::GetInstance()->RemoveOriginEntry( source_origin, target_protocol, target_domain, allow_target_subdomains); } else { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefRemoveCrossOriginWhitelistEntry), source_origin, target_protocol, target_domain, allow_target_subdomains)); @@ -256,8 +258,8 @@ bool CefClearCrossOriginWhitelist() { if (CEF_CURRENTLY_ON_UIT()) { CefOriginWhitelistManager::GetInstance()->ClearOrigins(); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(base::IgnoreResult(&CefClearCrossOriginWhitelist))); + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefClearCrossOriginWhitelist))); } return true; diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index efe0f483e..2f022cc97 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -19,8 +19,7 @@ CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr( std::unique_ptr native_delegate) - : native_delegate_(std::move(native_delegate)), - view_osr_(nullptr) { + : native_delegate_(std::move(native_delegate)), view_osr_(nullptr) { native_delegate_->set_windowless_handler(this); } @@ -111,8 +110,8 @@ gfx::Point CefBrowserPlatformDelegateOsr::GetScreenPoint( CefRefPtr handler = browser_->client()->GetRenderHandler(); if (handler.get()) { int screenX = 0, screenY = 0; - if (handler->GetScreenPoint(browser_, view.x(), view.y(), - screenX, screenY)) { + if (handler->GetScreenPoint(browser_, view.x(), view.y(), screenX, + screenY)) { return gfx::Point(screenX, screenY); } } @@ -142,7 +141,8 @@ void CefBrowserPlatformDelegateOsr::TranslateClickEvent( blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const { + bool mouseUp, + int clickCount) const { native_delegate_->TranslateClickEvent(result, mouse_event, type, mouseUp, clickCount); } @@ -157,7 +157,8 @@ void CefBrowserPlatformDelegateOsr::TranslateMoveEvent( void CefBrowserPlatformDelegateOsr::TranslateWheelEvent( blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const { + int deltaX, + int deltaY) const { native_delegate_->TranslateWheelEvent(result, mouse_event, deltaX, deltaY); } @@ -167,12 +168,12 @@ CefEventHandle CefBrowserPlatformDelegateOsr::GetEventHandle( } std::unique_ptr - CefBrowserPlatformDelegateOsr::CreateFileDialogRunner() { +CefBrowserPlatformDelegateOsr::CreateFileDialogRunner() { return native_delegate_->CreateFileDialogRunner(); } std::unique_ptr - CefBrowserPlatformDelegateOsr::CreateJavaScriptDialogRunner() { +CefBrowserPlatformDelegateOsr::CreateJavaScriptDialogRunner() { return native_delegate_->CreateJavaScriptDialogRunner(); } @@ -224,8 +225,8 @@ void CefBrowserPlatformDelegateOsr::ImeSetComposition( const CefRange& selection_range) { CefRenderWidgetHostViewOSR* view = GetOSRHostView(); if (view) { - view->ImeSetComposition(text, underlines, - replacement_range, selection_range); + view->ImeSetComposition(text, underlines, replacement_range, + selection_range); } } @@ -266,9 +267,11 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( const gfx::Point client_pt(event.x, event.y); gfx::Point transformed_pt; current_rwh_for_drag_ = - web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( - web_contents->GetRenderViewHost()->GetWidget()->GetView(), - client_pt, &transformed_pt)->GetWeakPtr(); + web_contents->GetInputEventRouter() + ->GetRenderWidgetHostAtPoint( + web_contents->GetRenderViewHost()->GetWidget()->GetView(), + client_pt, &transformed_pt) + ->GetWeakPtr(); current_rvh_for_drag_ = web_contents->GetRenderViewHost(); drag_data_ = drag_data; @@ -285,15 +288,14 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( current_rwh_for_drag_->FilterDropData(drop_data); // Give the delegate an opportunity to cancel the drag. - if (web_contents->GetDelegate() && - !web_contents->GetDelegate()->CanDragEnter( - web_contents, *drop_data, ops)) { + if (web_contents->GetDelegate() && !web_contents->GetDelegate()->CanDragEnter( + web_contents, *drop_data, ops)) { drag_data_ = nullptr; return; } - current_rwh_for_drag_->DragTargetDragEnter( - *drop_data, transformed_pt, screen_pt, ops, modifiers); + current_rwh_for_drag_->DragTargetDragEnter(*drop_data, transformed_pt, + screen_pt, ops, modifiers); } void CefBrowserPlatformDelegateOsr::DragTargetDragOver( @@ -313,8 +315,8 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragOver( gfx::Point transformed_pt; content::RenderWidgetHostImpl* target_rwh = web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( - web_contents->GetRenderViewHost()->GetWidget()->GetView(), - client_pt, &transformed_pt); + web_contents->GetRenderViewHost()->GetWidget()->GetView(), client_pt, + &transformed_pt); if (target_rwh != current_rwh_for_drag_.get()) { if (current_rwh_for_drag_) { @@ -379,8 +381,8 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) { gfx::Point transformed_pt; content::RenderWidgetHostImpl* target_rwh = web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( - web_contents->GetRenderViewHost()->GetWidget()->GetView(), - client_pt, &transformed_pt); + web_contents->GetRenderViewHost()->GetWidget()->GetView(), client_pt, + &transformed_pt); if (target_rwh != current_rwh_for_drag_.get()) { if (current_rwh_for_drag_) { @@ -439,18 +441,15 @@ void CefBrowserPlatformDelegateOsr::StartDragging( if (handler.get()) { CefRefPtr cef_image(new CefImageImpl(image)); CefPoint cef_image_pos(image_offset.x(), image_offset.y()); - CefRefPtr drag_data(new CefDragDataImpl(drop_data, - cef_image, - cef_image_pos)); + CefRefPtr drag_data( + new CefDragDataImpl(drop_data, cef_image, cef_image_pos)); drag_data->SetReadOnly(true); base::MessageLoop::ScopedNestableTaskAllower allow( base::MessageLoop::current()); handled = handler->StartDragging( - browser_, - drag_data.get(), + browser_, drag_data.get(), static_cast(allowed_ops), - event_info.event_location.x(), - event_info.event_location.y()); + event_info.event_location.x(), event_info.event_location.y()); } if (!handled) @@ -468,7 +467,8 @@ void CefBrowserPlatformDelegateOsr::UpdateDragCursor( } void CefBrowserPlatformDelegateOsr::DragSourceEndedAt( - int x, int y, + int x, + int y, cef_drag_operations_mask_t op) { if (!drag_start_rwh_) return; @@ -560,8 +560,8 @@ gfx::Point CefBrowserPlatformDelegateOsr::GetParentScreenPoint( return GetScreenPoint(view); } -CefRenderWidgetHostViewOSR* - CefBrowserPlatformDelegateOsr::GetOSRHostView() const { +CefRenderWidgetHostViewOSR* CefBrowserPlatformDelegateOsr::GetOSRHostView() + const { content::WebContents* web_contents = browser_->web_contents(); CefRenderWidgetHostViewOSR* fs_view = static_cast( diff --git a/libcef/browser/osr/browser_platform_delegate_osr.h b/libcef/browser/osr/browser_platform_delegate_osr.h index 951b72479..f670f2af4 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.h +++ b/libcef/browser/osr/browser_platform_delegate_osr.h @@ -16,9 +16,9 @@ class RenderWidgetHostImpl; } // Base implementation of windowless browser functionality. -class CefBrowserPlatformDelegateOsr : - public CefBrowserPlatformDelegate, - public CefBrowserPlatformDelegateNative::WindowlessHandler { +class CefBrowserPlatformDelegateOsr + : public CefBrowserPlatformDelegate, + public CefBrowserPlatformDelegateNative::WindowlessHandler { public: // CefBrowserPlatformDelegate methods: void CreateViewForWebContents( @@ -43,17 +43,20 @@ class CefBrowserPlatformDelegateOsr : void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const override; + bool mouseUp, + int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const override; + int deltaX, + int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr CreateFileDialogRunner() override; - std::unique_ptr CreateJavaScriptDialogRunner() override; + std::unique_ptr CreateJavaScriptDialogRunner() + override; std::unique_ptr CreateMenuRunner() override; bool IsWindowless() const override; bool IsViewsHosted() const override; @@ -61,12 +64,12 @@ class CefBrowserPlatformDelegateOsr : void NotifyScreenInfoChanged() override; void Invalidate(cef_paint_element_type_t type) override; void SetWindowlessFrameRate(int frame_rate) override; - void ImeSetComposition( - const CefString& text, - const std::vector& underlines, - const CefRange& replacement_range, - const CefRange& selection_range) override; - void ImeCommitText(const CefString& text, const CefRange& replacement_range, + void ImeSetComposition(const CefString& text, + const std::vector& underlines, + const CefRange& replacement_range, + const CefRange& selection_range) override; + void ImeCommitText(const CefString& text, + const CefRange& replacement_range, int relative_cursor_pos) override; void ImeFinishComposingText(bool keep_selection) override; void ImeCancelComposition() override; @@ -77,16 +80,14 @@ class CefBrowserPlatformDelegateOsr : cef_drag_operations_mask_t allowed_ops) override; void DragTargetDragLeave() override; void DragTargetDrop(const CefMouseEvent& event) override; - void StartDragging( - const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, - content::RenderWidgetHostImpl* source_rwh) override; + void StartDragging(const content::DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const content::DragEventSourceInfo& event_info, + content::RenderWidgetHostImpl* source_rwh) override; void UpdateDragCursor(blink::WebDragOperation operation) override; - void DragSourceEndedAt(int x, int y, - cef_drag_operations_mask_t op) override; + void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op) override; void DragSourceSystemDragEnded() override; void AccessibilityEventReceived( const std::vector& eventData) diff --git a/libcef/browser/osr/browser_platform_delegate_osr_linux.cc b/libcef/browser/osr/browser_platform_delegate_osr_linux.cc index 5c768f638..fda16ef30 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr_linux.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr_linux.cc @@ -10,11 +10,9 @@ CefBrowserPlatformDelegateOsrLinux::CefBrowserPlatformDelegateOsrLinux( std::unique_ptr native_delegate) - : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) { -} + : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {} -CefWindowHandle - CefBrowserPlatformDelegateOsrLinux::GetHostWindowHandle() const { +CefWindowHandle CefBrowserPlatformDelegateOsrLinux::GetHostWindowHandle() + const { return native_delegate_->window_info().parent_window; } - diff --git a/libcef/browser/osr/browser_platform_delegate_osr_linux.h b/libcef/browser/osr/browser_platform_delegate_osr_linux.h index 0ed8ae6b4..4dc86ff3d 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr_linux.h +++ b/libcef/browser/osr/browser_platform_delegate_osr_linux.h @@ -8,8 +8,8 @@ #include "libcef/browser/osr/browser_platform_delegate_osr.h" // Windowless browser implementation for Linux. -class CefBrowserPlatformDelegateOsrLinux : - public CefBrowserPlatformDelegateOsr { +class CefBrowserPlatformDelegateOsrLinux + : public CefBrowserPlatformDelegateOsr { public: explicit CefBrowserPlatformDelegateOsrLinux( std::unique_ptr native_delegate); diff --git a/libcef/browser/osr/browser_platform_delegate_osr_mac.h b/libcef/browser/osr/browser_platform_delegate_osr_mac.h index 84fec3c84..923e3c40b 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr_mac.h +++ b/libcef/browser/osr/browser_platform_delegate_osr_mac.h @@ -12,7 +12,7 @@ class CefBrowserPlatformDelegateOsrMac : public CefBrowserPlatformDelegateOsr { public: explicit CefBrowserPlatformDelegateOsrMac( std::unique_ptr native_delegate); - + // CefBrowserPlatformDelegate methods: CefWindowHandle GetHostWindowHandle() const override; }; diff --git a/libcef/browser/osr/browser_platform_delegate_osr_mac.mm b/libcef/browser/osr/browser_platform_delegate_osr_mac.mm index 4f8c4172d..a1f4afe4f 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr_mac.mm +++ b/libcef/browser/osr/browser_platform_delegate_osr_mac.mm @@ -11,10 +11,8 @@ CefBrowserPlatformDelegateOsrMac::CefBrowserPlatformDelegateOsrMac( std::unique_ptr native_delegate) - : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) { -} + : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {} CefWindowHandle CefBrowserPlatformDelegateOsrMac::GetHostWindowHandle() const { return native_delegate_->window_info().parent_view; } - diff --git a/libcef/browser/osr/browser_platform_delegate_osr_win.cc b/libcef/browser/osr/browser_platform_delegate_osr_win.cc index 5a26a4029..c09e79ccd 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr_win.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr_win.cc @@ -10,8 +10,7 @@ CefBrowserPlatformDelegateOsrWin::CefBrowserPlatformDelegateOsrWin( std::unique_ptr native_delegate) - : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) { -} + : CefBrowserPlatformDelegateOsr(std::move(native_delegate)) {} CefWindowHandle CefBrowserPlatformDelegateOsrWin::GetHostWindowHandle() const { return native_delegate_->window_info().parent_window; diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index 19b71841e..f308c6b6d 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -12,20 +12,20 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "content/public/browser/ax_event_notification_details.h" -#include "ui/accessibility/ax_tree_update.h" #include "ui/accessibility/ax_text_utils.h" +#include "ui/accessibility/ax_tree_update.h" #include "ui/gfx/transform.h" namespace { using ui::ToString; -template +template CefRefPtr ToCefValue(const std::vector& vecData); -template<> +template <> CefRefPtr ToCefValue(const std::vector& vecData) { - CefRefPtr value = CefListValue::Create(); - for (size_t i = 0; i value = CefListValue::Create(); + for (size_t i = 0; i < vecData.size(); i++) value->SetInt(i, vecData[i]); return value; @@ -34,37 +34,23 @@ CefRefPtr ToCefValue(const std::vector& vecData) { // Helper function for AXNodeData::ToCefValue - Converts AXState attributes to // CefListValue. CefRefPtr ToCefValue(uint32_t state) { - CefRefPtr value = CefListValue::Create(); + CefRefPtr value = CefListValue::Create(); static ui::AXState state_arr[] = { - ui::AX_STATE_NONE, - ui::AX_STATE_BUSY, - ui::AX_STATE_CHECKED, - ui::AX_STATE_COLLAPSED, - ui::AX_STATE_DEFAULT, - ui::AX_STATE_DISABLED, - ui::AX_STATE_EDITABLE, - ui::AX_STATE_EXPANDED, - ui::AX_STATE_FOCUSABLE, - ui::AX_STATE_HASPOPUP, - ui::AX_STATE_HORIZONTAL, - ui::AX_STATE_HOVERED, - ui::AX_STATE_INVISIBLE, - ui::AX_STATE_LINKED, - ui::AX_STATE_MULTILINE, - ui::AX_STATE_MULTISELECTABLE, - ui::AX_STATE_OFFSCREEN, - ui::AX_STATE_PRESSED, - ui::AX_STATE_PROTECTED, - ui::AX_STATE_READ_ONLY, - ui::AX_STATE_REQUIRED, - ui::AX_STATE_RICHLY_EDITABLE, - ui::AX_STATE_SELECTABLE, - ui::AX_STATE_SELECTED, - ui::AX_STATE_VERTICAL, - ui::AX_STATE_VISITED, - ui::AX_STATE_LAST - }; + ui::AX_STATE_NONE, ui::AX_STATE_BUSY, + ui::AX_STATE_CHECKED, ui::AX_STATE_COLLAPSED, + ui::AX_STATE_DEFAULT, ui::AX_STATE_DISABLED, + ui::AX_STATE_EDITABLE, ui::AX_STATE_EXPANDED, + ui::AX_STATE_FOCUSABLE, ui::AX_STATE_HASPOPUP, + ui::AX_STATE_HORIZONTAL, ui::AX_STATE_HOVERED, + ui::AX_STATE_INVISIBLE, ui::AX_STATE_LINKED, + ui::AX_STATE_MULTILINE, ui::AX_STATE_MULTISELECTABLE, + ui::AX_STATE_OFFSCREEN, ui::AX_STATE_PRESSED, + ui::AX_STATE_PROTECTED, ui::AX_STATE_READ_ONLY, + ui::AX_STATE_REQUIRED, ui::AX_STATE_RICHLY_EDITABLE, + ui::AX_STATE_SELECTABLE, ui::AX_STATE_SELECTED, + ui::AX_STATE_VERTICAL, ui::AX_STATE_VISITED, + ui::AX_STATE_LAST}; int index = 0; // Iterate and find which states are set. @@ -78,7 +64,7 @@ CefRefPtr ToCefValue(uint32_t state) { // Helper function for AXNodeData::ToCefValue - converts GfxRect to // CefDictionaryValue. CefRefPtr ToCefValue(const gfx::RectF& bounds) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); value->SetDouble("x", bounds.x()); value->SetDouble("y", bounds.y()); value->SetDouble("width", bounds.width()); @@ -90,8 +76,8 @@ CefRefPtr ToCefValue(const gfx::RectF& bounds) { struct PopulateAxNodeAttributes { CefRefPtr attributes; - explicit PopulateAxNodeAttributes(CefRefPtr attrs) : - attributes(attrs) {} + explicit PopulateAxNodeAttributes(CefRefPtr attrs) + : attributes(attrs) {} // Int Attributes void operator()(const std::pair attr) { @@ -137,25 +123,29 @@ struct PopulateAxNodeAttributes { attributes->SetInt(ToString(attr.first), attr.second); break; case ui::AX_ATTR_ACTION: - attributes->SetString(ToString(attr.first), + attributes->SetString( + ToString(attr.first), ui::ActionToUnlocalizedString( static_cast(attr.second))); break; case ui::AX_ATTR_INVALID_STATE: if (ui::AX_INVALID_STATE_NONE != attr.second) { - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); } break; case ui::AX_ATTR_SORT_DIRECTION: if (ui::AX_SORT_DIRECTION_NONE != attr.second) { - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); } break; case ui::AX_ATTR_NAME_FROM: - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); break; case ui::AX_ATTR_COLOR_VALUE: case ui::AX_ATTR_BACKGROUND_COLOR: @@ -164,43 +154,42 @@ struct PopulateAxNodeAttributes { base::StringPrintf("0x%X", attr.second)); break; case ui::AX_ATTR_DESCRIPTION_FROM: - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); break; case ui::AX_ATTR_ARIA_CURRENT_STATE: if (ui::AX_ARIA_CURRENT_STATE_NONE != attr.second) { - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); } break; case ui::AX_ATTR_TEXT_DIRECTION: if (ui::AX_TEXT_DIRECTION_NONE != attr.second) { - attributes->SetString(ToString(attr.first), ToString( - static_cast(attr.second))); + attributes->SetString( + ToString(attr.first), + ToString(static_cast(attr.second))); } break; case ui::AX_ATTR_TEXT_STYLE: { - auto text_style = static_cast(attr.second); - if (text_style == ui::AX_TEXT_STYLE_NONE) - break; + auto text_style = static_cast(attr.second); + if (text_style == ui::AX_TEXT_STYLE_NONE) + break; - static ui::AXTextStyle textStyleArr[] = { - ui::AX_TEXT_STYLE_BOLD, - ui::AX_TEXT_STYLE_ITALIC, - ui::AX_TEXT_STYLE_UNDERLINE, - ui::AX_TEXT_STYLE_LINE_THROUGH - }; + static ui::AXTextStyle textStyleArr[] = { + ui::AX_TEXT_STYLE_BOLD, ui::AX_TEXT_STYLE_ITALIC, + ui::AX_TEXT_STYLE_UNDERLINE, ui::AX_TEXT_STYLE_LINE_THROUGH}; - CefRefPtr list = CefListValue::Create(); - int index = 0; - // Iterate and find which states are set. - for (unsigned i = 0; i < arraysize(textStyleArr); i++) { - if (text_style & textStyleArr[i]) - list->SetString(index++, ToString(textStyleArr[i])); - } - attributes->SetList(ToString(attr.first), list); + CefRefPtr list = CefListValue::Create(); + int index = 0; + // Iterate and find which states are set. + for (unsigned i = 0; i < arraysize(textStyleArr); i++) { + if (text_style & textStyleArr[i]) + list->SetString(index++, ToString(textStyleArr[i])); } - break; + attributes->SetList(ToString(attr.first), list); + } break; } } @@ -221,8 +210,8 @@ struct PopulateAxNodeAttributes { } // Set Int list attributes. - void operator()(const std::pair>& attr) { + void operator()( + const std::pair>& attr) { if (attr.first != ui::AX_INT_LIST_ATTRIBUTE_NONE) { CefRefPtr list; @@ -236,10 +225,8 @@ struct PopulateAxNodeAttributes { continue; static ui::AXMarkerType marktypeArr[] = { - ui::AX_MARKER_TYPE_SPELLING, - ui::AX_MARKER_TYPE_GRAMMAR, - ui::AX_MARKER_TYPE_TEXT_MATCH - }; + ui::AX_MARKER_TYPE_SPELLING, ui::AX_MARKER_TYPE_GRAMMAR, + ui::AX_MARKER_TYPE_TEXT_MATCH}; // Iterate and find which markers are set. for (unsigned j = 0; j < arraysize(marktypeArr); j++) { @@ -257,7 +244,7 @@ struct PopulateAxNodeAttributes { // Converts AXNodeData to CefDictionaryValue(like AXNodeData::ToString). CefRefPtr ToCefValue(const ui::AXNodeData& node) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (node.id != -1) value->SetInt("id", node.id); @@ -278,26 +265,26 @@ CefRefPtr ToCefValue(const ui::AXNodeData& node) { if (!node.child_ids.empty()) value->SetList("child_ids", ToCefValue(node.child_ids)); - CefRefPtr attributes = CefDictionaryValue::Create(); + CefRefPtr attributes = CefDictionaryValue::Create(); PopulateAxNodeAttributes func(attributes); // Poupulate Int Attributes. std::for_each(node.int_attributes.begin(), node.int_attributes.end(), func); // Poupulate String Attributes. - std::for_each(node.string_attributes.begin(), - node.string_attributes.end(), func); + std::for_each(node.string_attributes.begin(), node.string_attributes.end(), + func); // Poupulate Float Attributes. - std::for_each(node.float_attributes.begin(), - node.float_attributes.end(), func); + std::for_each(node.float_attributes.begin(), node.float_attributes.end(), + func); // Poupulate Bool Attributes. std::for_each(node.bool_attributes.begin(), node.bool_attributes.end(), func); // Populate int list attributes. - std::for_each(node.intlist_attributes.begin(), - node.intlist_attributes.end(), func); + std::for_each(node.intlist_attributes.begin(), node.intlist_attributes.end(), + func); value->SetDictionary("attributes", attributes); @@ -306,7 +293,7 @@ CefRefPtr ToCefValue(const ui::AXNodeData& node) { // Converts AXTreeData to CefDictionaryValue(like AXTreeData::ToString). CefRefPtr ToCefValue(const ui::AXTreeData& treeData) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (treeData.tree_id != -1) value->SetInt("tree_id", treeData.tree_id); @@ -353,7 +340,7 @@ CefRefPtr ToCefValue(const ui::AXTreeData& treeData) { // Converts AXTreeUpdate to CefDictionaryValue(like AXTreeUpdate::ToString). CefRefPtr ToCefValue(const ui::AXTreeUpdate& update) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (update.has_tree_data) { value->SetBool("has_tree_data", true); @@ -374,7 +361,7 @@ CefRefPtr ToCefValue(const ui::AXTreeUpdate& update) { // Convert AXEventNotificationDetails to CefDictionaryValue. CefRefPtr ToCefValue( const content::AXEventNotificationDetails& eventData) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (eventData.id != -1) value->SetInt("id", eventData.id); @@ -395,7 +382,7 @@ CefRefPtr ToCefValue( // Convert AXRelativeBounds to CefDictionaryValue. Similar to // AXRelativeBounds::ToString. See that for more details CefRefPtr ToCefValue(const ui::AXRelativeBounds& location) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (location.offset_container_id != -1) value->SetInt("offset_container_id", location.offset_container_id); @@ -413,7 +400,7 @@ CefRefPtr ToCefValue(const ui::AXRelativeBounds& location) { // Convert AXEventNotificationDetails to CefDictionaryValue. CefRefPtr ToCefValue( const content::AXLocationChangeNotificationDetails& locData) { - CefRefPtr value = CefDictionaryValue::Create(); + CefRefPtr value = CefDictionaryValue::Create(); if (locData.id != -1) value->SetInt("id", locData.id); @@ -426,11 +413,11 @@ CefRefPtr ToCefValue( return value; } -template +template CefRefPtr ToCefValue(const std::vector& vecData) { - CefRefPtr value = CefListValue::Create(); + CefRefPtr value = CefListValue::Create(); - for (size_t i = 0; i SetDictionary(i, ToCefValue(vecData[i])); return value; @@ -442,14 +429,14 @@ namespace osr_accessibility_util { CefRefPtr ParseAccessibilityEventData( const std::vector& data) { - CefRefPtr value = CefValue::Create(); + CefRefPtr value = CefValue::Create(); value->SetList(ToCefValue(data)); return value; } CefRefPtr ParseAccessibilityLocationData( const std::vector& data) { - CefRefPtr value = CefValue::Create(); + CefRefPtr value = CefValue::Create(); value->SetList(ToCefValue(data)); return value; } diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index e78ba16b4..aa9709a01 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -26,8 +26,8 @@ #include "content/browser/frame_host/render_widget_host_view_guest.h" #include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" -#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h" #include "content/common/input_messages.h" #include "content/common/view_messages.h" #include "content/public/browser/browser_thread.h" @@ -52,12 +52,11 @@ static content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { screenInfo.depth = src.depth; screenInfo.depth_per_component = src.depth_per_component; screenInfo.is_monochrome = src.is_monochrome ? true : false; - screenInfo.rect = gfx::Rect(src.rect.x, src.rect.y, - src.rect.width, src.rect.height); - screenInfo.available_rect = gfx::Rect(src.available_rect.x, - src.available_rect.y, - src.available_rect.width, - src.available_rect.height); + screenInfo.rect = + gfx::Rect(src.rect.x, src.rect.y, src.rect.width, src.rect.height); + screenInfo.available_rect = + gfx::Rect(src.available_rect.x, src.available_rect.y, + src.available_rect.width, src.available_rect.height); return screenInfo; } @@ -71,17 +70,14 @@ class CefCopyFrameGenerator { public: CefCopyFrameGenerator(int frame_rate_threshold_ms, CefRenderWidgetHostViewOSR* view) - : frame_rate_threshold_ms_(frame_rate_threshold_ms), - view_(view), - frame_pending_(false), - frame_in_progress_(false), - frame_retry_count_(0), - weak_ptr_factory_(this) { - } + : frame_rate_threshold_ms_(frame_rate_threshold_ms), + view_(view), + frame_pending_(false), + frame_in_progress_(false), + frame_retry_count_(0), + weak_ptr_factory_(this) {} - void GenerateCopyFrame( - bool force_frame, - const gfx::Rect& damage_rect) { + void GenerateCopyFrame(bool force_frame, const gfx::Rect& damage_rect) { if (force_frame && !frame_pending_) frame_pending_ = true; @@ -103,7 +99,8 @@ class CefCopyFrameGenerator { (base::TimeTicks::Now() - frame_start_time_).InMilliseconds(); if (frame_rate_delta < frame_rate_threshold_ms_) { // Generate the frame after the necessary time has passed. - CEF_POST_DELAYED_TASK(CEF_UIT, + CEF_POST_DELAYED_TASK( + CEF_UIT, base::Bind(&CefCopyFrameGenerator::InternalGenerateCopyFrame, weak_ptr_factory_.GetWeakPtr()), frame_rate_threshold_ms_ - frame_rate_delta); @@ -136,8 +133,7 @@ class CefCopyFrameGenerator { std::unique_ptr request = cc::CopyOutputRequest::CreateRequest(base::Bind( &CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult, - weak_ptr_factory_.GetWeakPtr(), - damage_rect)); + weak_ptr_factory_.GetWeakPtr(), damage_rect)); request->set_area(gfx::Rect(view_->GetPhysicalBackingSize())); view_->GetRootLayer()->RequestCopyOfOutput(std::move(request)); @@ -167,22 +163,18 @@ class CefCopyFrameGenerator { DCHECK(result->HasTexture()); base::ScopedClosureRunner scoped_callback_runner( base::Bind(&CefCopyFrameGenerator::OnCopyFrameCaptureFailure, - weak_ptr_factory_.GetWeakPtr(), - damage_rect)); + weak_ptr_factory_.GetWeakPtr(), damage_rect)); const gfx::Size& result_size = result->size(); SkIRect bitmap_size; if (bitmap_) bitmap_->getBounds(&bitmap_size); - if (!bitmap_ || - bitmap_size.width() != result_size.width() || + if (!bitmap_ || bitmap_size.width() != result_size.width() || bitmap_size.height() != result_size.height()) { // Create a new bitmap if the size has changed. bitmap_.reset(new SkBitmap); - bitmap_->allocN32Pixels(result_size.width(), - result_size.height(), - true); + bitmap_->allocN32Pixels(result_size.width(), result_size.height(), true); if (bitmap_->drawsNothing()) return; } @@ -207,19 +199,12 @@ class CefCopyFrameGenerator { ignore_result(scoped_callback_runner.Release()); gl_helper->CropScaleReadbackAndCleanMailbox( - texture_mailbox.mailbox(), - texture_mailbox.sync_token(), - result_size, - gfx::Rect(result_size), - result_size, - pixels, - kN32_SkColorType, + texture_mailbox.mailbox(), texture_mailbox.sync_token(), result_size, + gfx::Rect(result_size), result_size, pixels, kN32_SkColorType, base::Bind( &CefCopyFrameGenerator::CopyFromCompositingSurfaceFinishedProxy, - weak_ptr_factory_.GetWeakPtr(), - base::Passed(&release_callback), - damage_rect, - base::Passed(&bitmap_), + weak_ptr_factory_.GetWeakPtr(), base::Passed(&release_callback), + damage_rect, base::Passed(&bitmap_), base::Passed(&bitmap_pixels_lock)), display_compositor::GLHelper::SCALER_QUALITY_FAST); } @@ -286,8 +271,7 @@ class CefCopyFrameGenerator { } } - void OnCopyFrameCaptureFailure( - const gfx::Rect& damage_rect) { + void OnCopyFrameCaptureFailure(const gfx::Rect& damage_rect) { // Retry with the same |damage_rect|. pending_damage_rect_.Union(damage_rect); @@ -316,11 +300,10 @@ class CefCopyFrameGenerator { if (frame_pending_) { // Another frame was requested while the current frame was in-progress. // Generate the pending frame now. - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefCopyFrameGenerator::GenerateCopyFrame, - weak_ptr_factory_.GetWeakPtr(), - force_frame, - gfx::Rect())); + weak_ptr_factory_.GetWeakPtr(), force_frame, gfx::Rect())); } } @@ -343,8 +326,7 @@ class CefCopyFrameGenerator { // enabled. class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient { public: - CefBeginFrameTimer(int frame_rate_threshold_ms, - const base::Closure& callback) + CefBeginFrameTimer(int frame_rate_threshold_ms, const base::Closure& callback) : callback_(callback) { time_source_.reset(new cc::DelayBasedTimeSource( content::BrowserThread::GetTaskRunnerForThread(CEF_UIT).get())); @@ -354,13 +336,9 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient { time_source_->SetClient(this); } - void SetActive(bool active) { - time_source_->SetActive(active); - } + void SetActive(bool active) { time_source_->SetActive(active); } - bool IsActive() const { - return time_source_->Active(); - } + bool IsActive() const { return time_source_->Active(); } void SetFrameRateThresholdMs(int frame_rate_threshold_ms) { time_source_->SetTimebaseAndInterval( @@ -370,9 +348,7 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient { private: // cc::TimerSourceClient implementation. - void OnTimerTick() override { - callback_.Run(); - } + void OnTimerTick() override { callback_.Run(); } const base::Closure callback_; std::unique_ptr time_source_; @@ -380,7 +356,6 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient { DISALLOW_COPY_AND_ASSIGN(CefBeginFrameTimer); }; - CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( SkColor background_color, content::RenderWidgetHost* widget, @@ -499,16 +474,14 @@ void CefRenderWidgetHostViewOSR::InitAsChild(gfx::NativeView parent_view) { Show(); } -content::RenderWidgetHost* - CefRenderWidgetHostViewOSR::GetRenderWidgetHost() const { +content::RenderWidgetHost* CefRenderWidgetHostViewOSR::GetRenderWidgetHost() + const { return render_widget_host_; } -void CefRenderWidgetHostViewOSR::SetSize(const gfx::Size& size) { -} +void CefRenderWidgetHostViewOSR::SetSize(const gfx::Size& size) {} -void CefRenderWidgetHostViewOSR::SetBounds(const gfx::Rect& rect) { -} +void CefRenderWidgetHostViewOSR::SetBounds(const gfx::Rect& rect) {} gfx::Vector2dF CefRenderWidgetHostViewOSR::GetLastScrollOffset() const { return last_scroll_offset_; @@ -519,12 +492,11 @@ gfx::NativeView CefRenderWidgetHostViewOSR::GetNativeView() const { } gfx::NativeViewAccessible - CefRenderWidgetHostViewOSR::GetNativeViewAccessible() { +CefRenderWidgetHostViewOSR::GetNativeViewAccessible() { return gfx::NativeViewAccessible(); } -void CefRenderWidgetHostViewOSR::Focus() { -} +void CefRenderWidgetHostViewOSR::Focus() {} bool CefRenderWidgetHostViewOSR::HasFocus() const { return false; @@ -598,8 +570,8 @@ void CefRenderWidgetHostViewOSR::SetBackgroundColor(SkColor color) { DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE || SkColorGetA(color) == SK_AlphaTRANSPARENT); if (render_widget_host_) { - render_widget_host_->SetBackgroundOpaque( - SkColorGetA(color) == SK_AlphaOPAQUE); + render_widget_host_->SetBackgroundOpaque(SkColorGetA(color) == + SK_AlphaOPAQUE); } } @@ -611,12 +583,10 @@ bool CefRenderWidgetHostViewOSR::LockMouse() { return false; } -void CefRenderWidgetHostViewOSR::UnlockMouse() { -} +void CefRenderWidgetHostViewOSR::UnlockMouse() {} void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink( - cc::mojom::MojoCompositorFrameSinkClient* - renderer_compositor_frame_sink) { + cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink) { renderer_compositor_frame_sink_ = renderer_compositor_frame_sink; if (GetDelegatedFrameHost()) { GetDelegatedFrameHost()->DidCreateNewRendererCompositorFrameSink( @@ -634,7 +604,8 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame( if (!is_scroll_offset_changed_pending_) { // Send the notification asnychronously. - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefRenderWidgetHostViewOSR::OnScrollOffsetChanged, weak_ptr_factory_.GetWeakPtr())); } @@ -656,7 +627,7 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame( // Consequently we instead call the SwapDelegatedFrame method directly. GetDelegatedFrameHost()->SubmitCompositorFrame(local_surface_id, std::move(frame)); - } else { + } else { if (!copy_frame_generator_.get()) { copy_frame_generator_.reset( new CefCopyFrameGenerator(frame_rate_threshold_ms_, this)); @@ -786,8 +757,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor( #endif } -void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) { -} +void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {} void CefRenderWidgetHostViewOSR::RenderProcessGone( base::TerminationStatus status, @@ -841,8 +811,8 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface( const gfx::Size& dst_size, const content::ReadbackRequestCallback& callback, const SkColorType color_type) { - GetDelegatedFrameHost()->CopyFromCompositingSurface( - src_subrect, dst_size, callback, color_type); + GetDelegatedFrameHost()->CopyFromCompositingSurface(src_subrect, dst_size, + callback, color_type); } void CefRenderWidgetHostViewOSR::CopyFromSurfaceToVideoFrame( @@ -884,17 +854,16 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() { } content::BrowserAccessibilityManager* - CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager( - content::BrowserAccessibilityDelegate* delegate, - bool for_root_frame) { +CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager( + content::BrowserAccessibilityDelegate* delegate, + bool for_root_frame) { return NULL; } #if defined(TOOLKIT_VIEWS) || defined(USE_AURA) void CefRenderWidgetHostViewOSR::ShowDisambiguationPopup( const gfx::Rect& rect_pixels, - const SkBitmap& zoomed_bitmap) { -} + const SkBitmap& zoomed_bitmap) {} #endif void CefRenderWidgetHostViewOSR::ImeSetComposition( @@ -909,21 +878,17 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition( std::vector web_underlines; web_underlines.reserve(underlines.size()); for (const CefCompositionUnderline& line : underlines) { - web_underlines.push_back( - blink::WebCompositionUnderline(line.range.from, - line.range.to, - line.color, - line.thick ? true : false, - line.background_color)); + web_underlines.push_back(blink::WebCompositionUnderline( + line.range.from, line.range.to, line.color, line.thick ? true : false, + line.background_color)); } gfx::Range range(replacement_range.from, replacement_range.to); // Start Monitoring for composition updates before we set. RequestImeCompositionUpdate(true); - render_widget_host_->ImeSetComposition(text, web_underlines, range, - selection_range.from, - selection_range.to); + render_widget_host_->ImeSetComposition( + text, web_underlines, range, selection_range.from, selection_range.to); } void CefRenderWidgetHostViewOSR::ImeCommitText( @@ -984,8 +949,7 @@ bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpace( gfx::Point* transformed_point) { // Transformations use physical pixels rather than DIP, so conversion // is necessary. - gfx::Point point_in_pixels = - gfx::ConvertPointToPixel(scale_factor_, point); + gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor_, point); if (!GetDelegatedFrameHost()->TransformPointToLocalCoordSpace( point_in_pixels, original_surface, transformed_point)) { return false; @@ -1047,8 +1011,8 @@ SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor( return color; } -gfx::Size -CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP() const { +gfx::Size CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP() + const { return GetRootLayer()->bounds().size(); } @@ -1116,17 +1080,16 @@ void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) { if (!browser_impl_.get()) return; - CefScreenInfo screen_info( - kDefaultScaleFactor, 0, 0, false, CefRect(), CefRect()); + CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(), + CefRect()); CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); if (handler.get() && (!handler->GetScreenInfo(browser_impl_.get(), screen_info) || - screen_info.rect.width == 0 || - screen_info.rect.height == 0 || - screen_info.available_rect.width == 0 || - screen_info.available_rect.height == 0)) { + screen_info.rect.width == 0 || screen_info.rect.height == 0 || + screen_info.available_rect.width == 0 || + screen_info.available_rect.height == 0)) { // If a screen rectangle was not provided, try using the view rectangle // instead. Otherwise, popup views may be drawn incorrectly, or not at all. CefRect screenRect; @@ -1166,7 +1129,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { void CefRenderWidgetHostViewOSR::Invalidate( CefBrowserHost::PaintElementType type) { TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Invalidate", "type", - type); + type); if (!IsPopupWidget() && type == PET_POPUP) { if (popup_host_view_) popup_host_view_->Invalidate(type); @@ -1221,7 +1184,7 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( if (popup_host_view_) { if (popup_host_view_->popup_position_.Contains( - event.PositionInWidget().x, event.PositionInWidget().y)) { + event.PositionInWidget().x, event.PositionInWidget().y)) { blink::WebMouseWheelEvent popup_event(event); popup_event.SetPositionInWidget( event.PositionInWidget().x - popup_host_view_->popup_position_.x(), @@ -1235,7 +1198,8 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( // Scrolling outside of the popup widget so destroy it. // Execute asynchronously to avoid deleting the widget from inside some // other callback. - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefRenderWidgetHostViewOSR::CancelWidget, popup_host_view_->weak_ptr_factory_.GetWeakPtr())); } @@ -1285,17 +1249,15 @@ void CefRenderWidgetHostViewOSR::ReleaseResize() { hold_resize_ = false; if (pending_resize_) { pending_resize_ = false; - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefRenderWidgetHostViewOSR::WasResized, - weak_ptr_factory_.GetWeakPtr())); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefRenderWidgetHostViewOSR::WasResized, + weak_ptr_factory_.GetWeakPtr())); } } -void CefRenderWidgetHostViewOSR::OnPaint( - const gfx::Rect& damage_rect, - int bitmap_width, - int bitmap_height, - void* bitmap_pixels) { +void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect, + int bitmap_width, + int bitmap_height, + void* bitmap_pixels) { TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnPaint"); CefRefPtr handler = @@ -1313,13 +1275,8 @@ void CefRenderWidgetHostViewOSR::OnPaint( rcList.push_back(CefRect(rect_in_bitmap.x(), rect_in_bitmap.y(), rect_in_bitmap.width(), rect_in_bitmap.height())); - handler->OnPaint( - browser_impl_.get(), - IsPopupWidget() ? PET_POPUP : PET_VIEW, - rcList, - bitmap_pixels, - bitmap_width, - bitmap_height); + handler->OnPaint(browser_impl_.get(), IsPopupWidget() ? PET_POPUP : PET_VIEW, + rcList, bitmap_pixels, bitmap_width, bitmap_height); ReleaseResize(); } @@ -1374,20 +1331,20 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() { begin_frame_timer_.reset(new CefBeginFrameTimer( frame_rate_threshold_ms_, base::Bind(&CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick, - weak_ptr_factory_.GetWeakPtr()))); + weak_ptr_factory_.GetWeakPtr()))); } } void CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { float new_scale_factor = kDefaultScaleFactor; - if (browser_impl_.get()) { - CefScreenInfo screen_info( - kDefaultScaleFactor, 0, 0, false, CefRect(), CefRect()); + if (browser_impl_.get()) { + CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(), + CefRect()); CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get() && handler->GetScreenInfo(browser_impl_.get(), - screen_info)) { + if (handler.get() && + handler->GetScreenInfo(browser_impl_.get(), screen_info)) { new_scale_factor = screen_info.device_scale_factor; } } @@ -1395,14 +1352,15 @@ void CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { scale_factor_ = new_scale_factor; if (render_widget_host_ && render_widget_host_->delegate()) - render_widget_host_->delegate()->UpdateDeviceScaleFactor(new_scale_factor); + render_widget_host_->delegate()->UpdateDeviceScaleFactor(new_scale_factor); // Notify the guest hosts if any. for (auto guest_host_view : guest_host_views_) { if (guest_host_view->render_widget_host() && guest_host_view->render_widget_host()->delegate()) { - guest_host_view->render_widget_host()->delegate()-> - UpdateDeviceScaleFactor(new_scale_factor); + guest_host_view->render_widget_host() + ->delegate() + ->UpdateDeviceScaleFactor(new_scale_factor); } } } @@ -1452,17 +1410,15 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time, base::TimeTicks deadline = display_time - estimated_browser_composite_time; - const cc::BeginFrameArgs& begin_frame_args = - cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, - begin_frame_source_.source_id(), - begin_frame_number_, frame_time, deadline, - vsync_period, cc::BeginFrameArgs::NORMAL); + const cc::BeginFrameArgs& begin_frame_args = cc::BeginFrameArgs::Create( + BEGINFRAME_FROM_HERE, begin_frame_source_.source_id(), + begin_frame_number_, frame_time, deadline, vsync_period, + cc::BeginFrameArgs::NORMAL); DCHECK(begin_frame_args.IsValid()); begin_frame_number_++; render_widget_host_->Send(new ViewMsg_BeginFrame( - render_widget_host_->GetRoutingID(), - begin_frame_args)); + render_widget_host_->GetRoutingID(), begin_frame_args)); } void CefRenderWidgetHostViewOSR::CancelWidget() { @@ -1525,10 +1481,10 @@ void CefRenderWidgetHostViewOSR::RemoveGuestHostView( void CefRenderWidgetHostViewOSR::RegisterGuestViewFrameSwappedCallback( content::RenderWidgetHostViewGuest* guest_host_view) { - guest_host_view->RegisterFrameSwappedCallback(base::MakeUnique( - base::Bind(&CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped, - weak_ptr_factory_.GetWeakPtr(), - base::Unretained(guest_host_view)))); + guest_host_view->RegisterFrameSwappedCallback( + base::MakeUnique(base::Bind( + &CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped, + weak_ptr_factory_.GetWeakPtr(), base::Unretained(guest_host_view)))); } void CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped( @@ -1586,11 +1542,11 @@ cc::FrameSinkId CefRenderWidgetHostViewOSR::AllocateFrameSinkId( content::ImageTransportFactory* factory = content::ImageTransportFactory::GetInstance(); return is_guest_view_hack - ? factory->GetContextFactoryPrivate()->AllocateFrameSinkId() - : cc::FrameSinkId(base::checked_cast( - render_widget_host_->GetProcess()->GetID()), - base::checked_cast( - render_widget_host_->GetRoutingID())); + ? factory->GetContextFactoryPrivate()->AllocateFrameSinkId() + : cc::FrameSinkId(base::checked_cast( + render_widget_host_->GetProcess()->GetID()), + base::checked_cast( + render_widget_host_->GetRoutingID())); } void CefRenderWidgetHostViewOSR::UpdateBackgroundColorFromRenderer( diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index c598ec939..320ca746e 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -82,12 +82,12 @@ class CefWindowX11; class MacHelper; #endif -class CefRenderWidgetHostViewOSR - : public content::RenderWidgetHostViewBase, - public ui::CompositorDelegate +class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, + public ui::CompositorDelegate #if !defined(OS_MACOSX) - , public content::DelegatedFrameHostClient, - public content::CompositorResizeLockClient + , + public content::DelegatedFrameHostClient, + public content::CompositorResizeLockClient #endif { public: @@ -129,8 +129,8 @@ class CefRenderWidgetHostViewOSR // RenderWidgetHostViewBase implementation. void DidCreateNewRendererCompositorFrameSink( - cc::mojom::MojoCompositorFrameSinkClient* - renderer_compositor_frame_sink) override; + cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink) + override; void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, cc::CompositorFrame frame) override; void ClearCompositorFrame() override; @@ -149,11 +149,10 @@ class CefRenderWidgetHostViewOSR gfx::Size GetRequestedRendererSize() const override; gfx::Size GetPhysicalBackingSize() const override; - void CopyFromSurface( - const gfx::Rect& src_subrect, - const gfx::Size& dst_size, - const content::ReadbackRequestCallback& callback, - const SkColorType color_type) override; + void CopyFromSurface(const gfx::Rect& src_subrect, + const gfx::Size& dst_size, + const content::ReadbackRequestCallback& callback, + const SkColorType color_type) override; void CopyFromSurfaceToVideoFrame( const gfx::Rect& src_subrect, scoped_refptr target, @@ -164,10 +163,9 @@ class CefRenderWidgetHostViewOSR void EndFrameSubscription() override; bool HasAcceleratedSurface(const gfx::Size& desired_size) override; gfx::Rect GetBoundsInRootWindow() override; - content::BrowserAccessibilityManager* - CreateBrowserAccessibilityManager( - content::BrowserAccessibilityDelegate* delegate, - bool for_root_frame) override; + content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager( + content::BrowserAccessibilityDelegate* delegate, + bool for_root_frame) override; #if defined(TOOLKIT_VIEWS) || defined(USE_AURA) void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, @@ -179,10 +177,9 @@ class CefRenderWidgetHostViewOSR void SetNeedsBeginFrames(bool enabled) override; - bool TransformPointToLocalCoordSpace( - const gfx::Point& point, - const cc::SurfaceId& original_surface, - gfx::Point* transformed_point) override; + bool TransformPointToLocalCoordSpace(const gfx::Point& point, + const cc::SurfaceId& original_surface, + gfx::Point* transformed_point) override; bool TransformPointToCoordSpaceForView( const gfx::Point& point, RenderWidgetHostViewBase* target_view, @@ -200,7 +197,7 @@ class CefRenderWidgetHostViewOSR gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override; bool DelegatedFrameCanCreateResizeLock() const override; std::unique_ptr - DelegatedFrameHostCreateResizeLock() override; + DelegatedFrameHostCreateResizeLock() override; void OnBeginFrame(const cc::BeginFrameArgs& args) override; bool IsAutoResizeEnabled() const override; @@ -230,15 +227,12 @@ class CefRenderWidgetHostViewOSR int bitmap_height, void* bitmap_pixels); - bool IsPopupWidget() const { - return popup_type_ != blink::kWebPopupTypeNone; - } + bool IsPopupWidget() const { return popup_type_ != blink::kWebPopupTypeNone; } - void ImeSetComposition( - const CefString& text, - const std::vector& underlines, - const CefRange& replacement_range, - const CefRange& selection_range); + void ImeSetComposition(const CefString& text, + const std::vector& underlines, + const CefRange& replacement_range, + const CefRange& selection_range); void ImeCommitText(const CefString& text, const CefRange& replacement_range, int relative_cursor_pos); @@ -258,8 +252,9 @@ class CefRenderWidgetHostViewOSR } ui::Compositor* GetCompositor() const; - content::RenderWidgetHostImpl* render_widget_host() const - { return render_widget_host_; } + content::RenderWidgetHostImpl* render_widget_host() const { + return render_widget_host_; + } ui::Layer* GetRootLayer() const; private: @@ -271,8 +266,7 @@ class CefRenderWidgetHostViewOSR // Called by CefBeginFrameTimer to send a BeginFrame request. void OnBeginFrameTimerTick(); - void SendBeginFrame(base::TimeTicks frame_time, - base::TimeDelta vsync_period); + void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period); void CancelWidget(); @@ -383,4 +377,3 @@ class CefRenderWidgetHostViewOSR }; #endif // CEF_LIBCEF_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_OSR_H_ - diff --git a/libcef/browser/osr/render_widget_host_view_osr_linux.cc b/libcef/browser/osr/render_widget_host_view_osr_linux.cc index 528395952..e0a2b73b9 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_linux.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_linux.cc @@ -5,8 +5,8 @@ #include "libcef/browser/osr/render_widget_host_view_osr.h" -#include #include +#include #undef Status // Avoid conflicts with url_request_status.h #include "libcef/browser/native/window_x11.h" @@ -122,15 +122,13 @@ int ToCursorID(WebCursorInfo::Type type) { class XCursorCache { public: XCursorCache() {} - ~XCursorCache() { - Clear(); - } + ~XCursorCache() { Clear(); } ::Cursor GetCursor(int cursor_shape) { // Lookup cursor by attempting to insert a null value, which avoids // a second pass through the map after a cache miss. - std::pair::iterator, bool> it = cache_.insert( - std::make_pair(cursor_shape, 0)); + std::pair::iterator, bool> it = + cache_.insert(std::make_pair(cursor_shape, 0)); if (it.second) { XDisplay* display = gfx::GetXDisplay(); it.first->second = XCreateFontCursor(display, cursor_shape); @@ -140,8 +138,8 @@ class XCursorCache { void Clear() { XDisplay* display = gfx::GetXDisplay(); - for (std::map::iterator it = - cache_.begin(); it != cache_.end(); ++it) { + for (std::map::iterator it = cache_.begin(); + it != cache_.end(); ++it) { XFreeCursor(display, it->second); } cache_.clear(); @@ -174,8 +172,7 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget( } void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget( - const gfx::Size&) { -} + const gfx::Size&) {} void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() { DCHECK(window_); @@ -187,9 +184,8 @@ ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor( blink::WebCursorInfo::Type type) { if (type == WebCursorInfo::kTypeNone) { if (!invisible_cursor_) { - invisible_cursor_.reset( - new ui::XScopedCursor(ui::CreateInvisibleCursor(), - gfx::GetXDisplay())); + invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(), + gfx::GetXDisplay())); } return invisible_cursor_->get(); } else { diff --git a/libcef/browser/osr/render_widget_host_view_osr_mac.mm b/libcef/browser/osr/render_widget_host_view_osr_mac.mm index ad5122461..d61d69198 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -18,13 +18,10 @@ #include "content/common/view_messages.h" #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" -class MacHelper : - public content::BrowserCompositorMacClient, - public ui::AcceleratedWidgetMacNSView { +class MacHelper : public content::BrowserCompositorMacClient, + public ui::AcceleratedWidgetMacNSView { public: - explicit MacHelper(CefRenderWidgetHostViewOSR* view) - : view_(view) { - } + explicit MacHelper(CefRenderWidgetHostViewOSR* view) : view_(view) {} virtual ~MacHelper() {} // BrowserCompositorMacClient methods: @@ -49,9 +46,8 @@ class MacHelper : void BrowserCompositorMacSendBeginFrame( const cc::BeginFrameArgs& args) override { - view_->render_widget_host()->Send( - new ViewMsg_BeginFrame(view_->render_widget_host()->GetRoutingID(), - args)); + view_->render_widget_host()->Send(new ViewMsg_BeginFrame( + view_->render_widget_host()->GetRoutingID(), args)); } // AcceleratedWidgetMacNSView methods: @@ -61,13 +57,13 @@ class MacHelper : } void AcceleratedWidgetGetVSyncParameters( - base::TimeTicks* timebase, base::TimeDelta* interval) const override { + base::TimeTicks* timebase, + base::TimeDelta* interval) const override { *timebase = base::TimeTicks(); *interval = base::TimeDelta(); } - void AcceleratedWidgetSwapCompleted() override { - } + void AcceleratedWidgetSwapCompleted() override {} private: // Guaranteed to outlive this object. @@ -76,7 +72,6 @@ class MacHelper : DISALLOW_COPY_AND_ASSIGN(MacHelper); }; - ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac() const { if (browser_compositor_) @@ -84,25 +79,21 @@ ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac() return nullptr; } -void CefRenderWidgetHostViewOSR::SetActive(bool active) { -} +void CefRenderWidgetHostViewOSR::SetActive(bool active) {} -void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() { -} +void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {} bool CefRenderWidgetHostViewOSR::SupportsSpeech() const { return false; } -void CefRenderWidgetHostViewOSR::SpeakSelection() { -} +void CefRenderWidgetHostViewOSR::SpeakSelection() {} bool CefRenderWidgetHostViewOSR::IsSpeaking() const { return false; } -void CefRenderWidgetHostViewOSR::StopSpeaking() { -} +void CefRenderWidgetHostViewOSR::StopSpeaking() {} ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const { return browser_compositor_->GetCompositor(); @@ -138,8 +129,8 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget( AllocateFrameSinkId(is_guest_view_hack))); } -void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size&) { -} +void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget( + const gfx::Size&) {} void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() { DCHECK(window_); diff --git a/libcef/browser/osr/render_widget_host_view_osr_win.cc b/libcef/browser/osr/render_widget_host_view_osr_win.cc index 991a8d62f..844c5d43e 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_win.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_win.cc @@ -23,23 +23,18 @@ class CefCompositorHostWin : public gfx::WindowImpl { Init(NULL, gfx::Rect(0, 0, 1, 1)); } - ~CefCompositorHostWin() override { - DestroyWindow(hwnd()); - } + ~CefCompositorHostWin() override { DestroyWindow(hwnd()); } private: CR_BEGIN_MSG_MAP_EX(CompositorHostWin) CR_MSG_WM_PAINT(OnPaint) CR_END_MSG_MAP() - void OnPaint(HDC dc) { - ValidateRect(hwnd(), NULL); - } + void OnPaint(HDC dc) { ValidateRect(hwnd(), NULL); } DISALLOW_COPY_AND_ASSIGN(CefCompositorHostWin); }; - // From content/common/cursors/webcursor_win.cc. using blink::WebCursorInfo; @@ -167,8 +162,8 @@ ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor( HMODULE module_handle = NULL; const wchar_t* cursor_id = ToCursorID(type); if (!IsSystemCursorID(cursor_id)) { - module_handle = ::GetModuleHandle( - CefContentBrowserClient::Get()->GetResourceDllName()); + module_handle = + ::GetModuleHandle(CefContentBrowserClient::Get()->GetResourceDllName()); if (!module_handle) module_handle = ::GetModuleHandle(NULL); } diff --git a/libcef/browser/osr/software_output_device_osr.cc b/libcef/browser/osr/software_output_device_osr.cc index 70ae96422..510198633 100644 --- a/libcef/browser/osr/software_output_device_osr.cc +++ b/libcef/browser/osr/software_output_device_osr.cc @@ -17,9 +17,7 @@ CefSoftwareOutputDeviceOSR::CefSoftwareOutputDeviceOSR( ui::Compositor* compositor, bool transparent, const OnPaintCallback& callback) - : transparent_(transparent), - callback_(callback), - active_(false) { + : transparent_(transparent), callback_(callback), active_(false) { CEF_REQUIRE_UIT(); DCHECK(!callback_.is_null()); } @@ -40,8 +38,7 @@ void CefSoftwareOutputDeviceOSR::Resize(const gfx::Size& viewport_pixel_size, canvas_.reset(NULL); bitmap_.reset(new SkBitmap); bitmap_->allocN32Pixels(viewport_pixel_size.width(), - viewport_pixel_size.height(), - !transparent_); + viewport_pixel_size.height(), !transparent_); if (bitmap_->drawsNothing()) { NOTREACHED(); bitmap_.reset(NULL); diff --git a/libcef/browser/osr/software_output_device_osr.h b/libcef/browser/osr/software_output_device_osr.h index 81f424cf6..ab3ab9a49 100644 --- a/libcef/browser/osr/software_output_device_osr.h +++ b/libcef/browser/osr/software_output_device_osr.h @@ -17,7 +17,7 @@ class Compositor; // All Rect/Size values are in pixels. class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice { public: - typedef base::Callback + typedef base::Callback OnPaintCallback; CefSoftwareOutputDeviceOSR(ui::Compositor* compositor, @@ -27,7 +27,7 @@ class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice { // cc::SoftwareOutputDevice implementation. void Resize(const gfx::Size& viewport_pixel_size, - float scale_factor) override; + float scale_factor) override; SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; void EndPaint() override; diff --git a/libcef/browser/osr/text_input_client_osr_mac.h b/libcef/browser/osr/text_input_client_osr_mac.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/libcef/browser/osr/text_input_client_osr_mac.mm b/libcef/browser/osr/text_input_client_osr_mac.mm deleted file mode 100644 index e69de29bb..000000000 diff --git a/libcef/browser/osr/web_contents_view_osr.cc b/libcef/browser/osr/web_contents_view_osr.cc index cb480691c..405fcc61c 100644 --- a/libcef/browser/osr/web_contents_view_osr.cc +++ b/libcef/browser/osr/web_contents_view_osr.cc @@ -16,12 +16,9 @@ #include "content/public/browser/render_widget_host.h" CefWebContentsViewOSR::CefWebContentsViewOSR(SkColor background_color) - : background_color_(background_color), - web_contents_(NULL) { -} + : background_color_(background_color), web_contents_(NULL) {} -CefWebContentsViewOSR::~CefWebContentsViewOSR() { -} +CefWebContentsViewOSR::~CefWebContentsViewOSR() {} void CefWebContentsViewOSR::WebContentsCreated( content::WebContents* web_contents) { @@ -56,20 +53,15 @@ void CefWebContentsViewOSR::GetContainerBounds(gfx::Rect* out) const { *out = GetViewBounds(); } -void CefWebContentsViewOSR::SizeContents(const gfx::Size& size) { -} +void CefWebContentsViewOSR::SizeContents(const gfx::Size& size) {} -void CefWebContentsViewOSR::Focus() { -} +void CefWebContentsViewOSR::Focus() {} -void CefWebContentsViewOSR::SetInitialFocus() { -} +void CefWebContentsViewOSR::SetInitialFocus() {} -void CefWebContentsViewOSR::StoreFocus() { -} +void CefWebContentsViewOSR::StoreFocus() {} -void CefWebContentsViewOSR::RestoreFocus() { -} +void CefWebContentsViewOSR::RestoreFocus() {} void CefWebContentsViewOSR::GotFocus() { if (web_contents_) { @@ -95,8 +87,7 @@ gfx::Rect CefWebContentsViewOSR::GetViewBounds() const { } void CefWebContentsViewOSR::CreateView(const gfx::Size& initial_size, - gfx::NativeView context) { -} + gfx::NativeView context) {} content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget( content::RenderWidgetHost* render_widget_host, @@ -119,7 +110,7 @@ content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget( // Called for popup and fullscreen widgets. content::RenderWidgetHostViewBase* - CefWebContentsViewOSR::CreateViewForPopupWidget( +CefWebContentsViewOSR::CreateViewForPopupWidget( content::RenderWidgetHost* render_widget_host) { CefRenderWidgetHostViewOSR* view = GetView(); CHECK(view); @@ -128,8 +119,7 @@ content::RenderWidgetHostViewBase* view, false); } -void CefWebContentsViewOSR::SetPageTitle(const base::string16& title) { -} +void CefWebContentsViewOSR::SetPageTitle(const base::string16& title) {} void CefWebContentsViewOSR::RenderViewCreated(content::RenderViewHost* host) { // |view| will be nullptr the first time this method is called for popup @@ -139,16 +129,13 @@ void CefWebContentsViewOSR::RenderViewCreated(content::RenderViewHost* host) { view->InstallTransparency(); } -void CefWebContentsViewOSR::RenderViewSwappedIn( - content::RenderViewHost* host) { +void CefWebContentsViewOSR::RenderViewSwappedIn(content::RenderViewHost* host) { } -void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) { -} +void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {} #if defined(OS_MACOSX) -void CefWebContentsViewOSR::SetAllowOtherViews(bool allow) { -} +void CefWebContentsViewOSR::SetAllowOtherViews(bool allow) {} bool CefWebContentsViewOSR::GetAllowOtherViews() const { return false; @@ -158,8 +145,7 @@ bool CefWebContentsViewOSR::IsEventTracking() const { return false; } -void CefWebContentsViewOSR::CloseTabAfterEventTracking() { -} +void CefWebContentsViewOSR::CloseTabAfterEventTracking() {} #endif // defined(OS_MACOSX) void CefWebContentsViewOSR::StartDragging( diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 09d31c4f9..39abd5041 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -62,13 +62,12 @@ class CefWebContentsViewOSR : public content::WebContentsView, #endif // RenderViewHostDelegateView methods. - void StartDragging( - const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, - content::RenderWidgetHostImpl* source_rwh) override; + void StartDragging(const content::DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const content::DragEventSourceInfo& event_info, + content::RenderWidgetHostImpl* source_rwh) override; void UpdateDragCursor(blink::WebDragOperation operation) override; virtual void GotFocus() override; virtual void TakeFocus(bool reverse) override; diff --git a/libcef/browser/path_util_impl.cc b/libcef/browser/path_util_impl.cc index 6a759309b..eecb2e38c 100644 --- a/libcef/browser/path_util_impl.cc +++ b/libcef/browser/path_util_impl.cc @@ -11,7 +11,7 @@ bool CefGetPath(PathKey key, CefString& path) { int pref_key = base::PATH_START; - switch(key) { + switch (key) { case PK_DIR_CURRENT: pref_key = base::DIR_CURRENT; break; diff --git a/libcef/browser/pepper/browser_pepper_host_factory.cc b/libcef/browser/pepper/browser_pepper_host_factory.cc index 310e8ba22..a22430973 100644 --- a/libcef/browser/pepper/browser_pepper_host_factory.cc +++ b/libcef/browser/pepper/browser_pepper_host_factory.cc @@ -4,8 +4,8 @@ #include "libcef/browser/pepper/browser_pepper_host_factory.h" -#include "build/build_config.h" #include "base/memory/ptr_util.h" +#include "build/build_config.h" #include "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h" #include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h" #include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" diff --git a/libcef/browser/permissions/permission_context.cc b/libcef/browser/permissions/permission_context.cc index 0cf5e0c2b..b36382fc8 100644 --- a/libcef/browser/permissions/permission_context.cc +++ b/libcef/browser/permissions/permission_context.cc @@ -35,22 +35,20 @@ class CefGeolocationCallbackImpl : public CefGeolocationCallback { if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { if (allow) { - device::GeolocationProvider::GetInstance()-> - UserDidOptIntoLocationServices(); + device::GeolocationProvider::GetInstance() + ->UserDidOptIntoLocationServices(); } callback_.Run(allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); callback_.Reset(); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefGeolocationCallbackImpl::Continue, this, allow)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefGeolocationCallbackImpl::Continue, + this, allow)); } } - void Disconnect() { - callback_.Reset(); - } + void Disconnect() { callback_.Reset(); } private: CallbackType callback_; @@ -62,9 +60,7 @@ class CefGeolocationCallbackImpl : public CefGeolocationCallback { } // namespace CefPermissionContext::CefPermissionContext(CefBrowserContext* profile) - : profile_(profile), - weak_ptr_factory_(this) { -} + : profile_(profile), weak_ptr_factory_(this) {} bool CefPermissionContext::SupportsPermission( content::PermissionType permission) { @@ -80,12 +76,8 @@ void CefPermissionContext::RequestPermission( const BrowserPermissionCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - DecidePermission(permission, - web_contents, - id, - requesting_frame.GetOrigin(), - web_contents->GetLastCommittedURL().GetOrigin(), - callback); + DecidePermission(permission, web_contents, id, requesting_frame.GetOrigin(), + web_contents->GetLastCommittedURL().GetOrigin(), callback); } void CefPermissionContext::CancelPermissionRequest( @@ -108,16 +100,14 @@ void CefPermissionContext::CancelPermissionRequest( } } -void CefPermissionContext::ResetPermission( - content::PermissionType permission, - const GURL& requesting_origin, - const GURL& embedding_origin) { +void CefPermissionContext::ResetPermission(content::PermissionType permission, + const GURL& requesting_origin, + const GURL& embedding_origin) { profile_->GetHostContentSettingsMap()->SetContentSettingCustomScope( ContentSettingsPattern::FromURLNoWildcard(requesting_origin), ContentSettingsPattern::FromURLNoWildcard(embedding_origin), permission_util::PermissionTypeToContentSetting(permission), - std::string(), - CONTENT_SETTING_DEFAULT); + std::string(), CONTENT_SETTING_DEFAULT); } ContentSetting CefPermissionContext::GetPermissionStatus( @@ -130,8 +120,7 @@ ContentSetting CefPermissionContext::GetPermissionStatus( } return profile_->GetHostContentSettingsMap()->GetContentSetting( - requesting_origin, - embedding_origin, + requesting_origin, embedding_origin, permission_util::PermissionTypeToContentSetting(permission), std::string()); } @@ -160,8 +149,7 @@ void CefPermissionContext::DecidePermission( ContentSetting content_setting = profile_->GetHostContentSettingsMap()->GetContentSetting( - requesting_origin, - embedding_origin, + requesting_origin, embedding_origin, permission_util::PermissionTypeToContentSetting(permission), std::string()); @@ -172,12 +160,11 @@ void CefPermissionContext::DecidePermission( return; } - QueryPermission( - permission, id, requesting_origin, embedding_origin, - base::Bind(&CefPermissionContext::NotifyPermissionSet, - weak_ptr_factory_.GetWeakPtr(), permission, id, - requesting_origin, embedding_origin, callback, - false /* persist */)); + QueryPermission(permission, id, requesting_origin, embedding_origin, + base::Bind(&CefPermissionContext::NotifyPermissionSet, + weak_ptr_factory_.GetWeakPtr(), permission, id, + requesting_origin, embedding_origin, callback, + false /* persist */)); } void CefPermissionContext::QueryPermission( @@ -259,6 +246,5 @@ void CefPermissionContext::UpdateContentSetting( ContentSettingsPattern::FromURLNoWildcard(requesting_origin), ContentSettingsPattern::FromURLNoWildcard(embedding_origin), permission_util::PermissionTypeToContentSetting(permission), - std::string(), - content_setting); + std::string(), content_setting); } diff --git a/libcef/browser/permissions/permission_context.h b/libcef/browser/permissions/permission_context.h index be3361085..1fba37406 100644 --- a/libcef/browser/permissions/permission_context.h +++ b/libcef/browser/permissions/permission_context.h @@ -81,11 +81,10 @@ class CefPermissionContext { ContentSetting content_setting); // Store the decided permission as a content setting. - void UpdateContentSetting( - content::PermissionType permission, - const GURL& requesting_origin, - const GURL& embedding_origin, - ContentSetting content_setting); + void UpdateContentSetting(content::PermissionType permission, + const GURL& requesting_origin, + const GURL& embedding_origin, + ContentSetting content_setting); CefBrowserContext* profile_; @@ -94,4 +93,4 @@ class CefPermissionContext { DISALLOW_COPY_AND_ASSIGN(CefPermissionContext); }; -#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_ +#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_ diff --git a/libcef/browser/permissions/permission_manager.cc b/libcef/browser/permissions/permission_manager.cc index 437682835..94c070fdf 100644 --- a/libcef/browser/permissions/permission_manager.cc +++ b/libcef/browser/permissions/permission_manager.cc @@ -104,17 +104,17 @@ PermissionStatus GetPermissionStatusForConstantPermission(PermissionType type) { class CefPermissionManager::PendingRequest { public: - PendingRequest(content::RenderFrameHost* render_frame_host, - const std::vector permissions, - const base::Callback&)>& callback) - : render_process_id_(render_frame_host->GetProcess()->GetID()), - render_frame_id_(render_frame_host->GetRoutingID()), - callback_(callback), - permissions_(permissions), - results_(permissions.size(), PermissionStatus::DENIED), - remaining_results_(permissions.size()) { - } + PendingRequest( + content::RenderFrameHost* render_frame_host, + const std::vector permissions, + const base::Callback&)>& + callback) + : render_process_id_(render_frame_host->GetProcess()->GetID()), + render_frame_id_(render_frame_host->GetRoutingID()), + callback_(callback), + permissions_(permissions), + results_(permissions.size(), PermissionStatus::DENIED), + remaining_results_(permissions.size()) {} void SetPermissionStatus(int permission_id, PermissionStatus status) { DCHECK(!IsComplete()); @@ -123,25 +123,19 @@ class CefPermissionManager::PendingRequest { --remaining_results_; } - bool IsComplete() const { - return remaining_results_ == 0; - } + bool IsComplete() const { return remaining_results_ == 0; } int render_process_id() const { return render_process_id_; } int render_frame_id() const { return render_frame_id_; } - const base::Callback&)> - callback() const { + const base::Callback&)> callback() + const { return callback_; } - std::vector permissions() const { - return permissions_; - } + std::vector permissions() const { return permissions_; } - std::vector results() const { - return results_; - } + std::vector results() const { return results_; } private: int render_process_id_; @@ -161,10 +155,7 @@ struct CefPermissionManager::Subscription { }; CefPermissionManager::CefPermissionManager(CefBrowserContext* profile) - : profile_(profile), - context_(profile), - weak_ptr_factory_(this) { -} + : profile_(profile), context_(profile), weak_ptr_factory_(this) {} CefPermissionManager::~CefPermissionManager() { if (!subscriptions_.IsEmpty()) @@ -178,10 +169,8 @@ int CefPermissionManager::RequestPermission( bool user_gesture, const base::Callback& callback) { return RequestPermissions( - std::vector(1, permission), - render_frame_host, - requesting_origin, - user_gesture, + std::vector(1, permission), render_frame_host, + requesting_origin, user_gesture, base::Bind(&PermissionRequestResponseCallbackWrapper, callback)); } @@ -190,8 +179,8 @@ int CefPermissionManager::RequestPermissions( content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, - const base::Callback&)>& callback) { + const base::Callback&)>& + callback) { if (permissions.empty()) { callback.Run(std::vector()); return kNoPendingOperation; @@ -202,8 +191,8 @@ int CefPermissionManager::RequestPermissions( GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); std::unique_ptr pending_request = - base::MakeUnique( - render_frame_host, permissions, callback); + base::MakeUnique(render_frame_host, permissions, + callback); int request_id = pending_requests_.Add(std::move(pending_request)); const PermissionRequestID request(render_frame_host, request_id); @@ -213,14 +202,16 @@ int CefPermissionManager::RequestPermissions( if (IsConstantPermission(permission) || !context_.SupportsPermission(permission)) { - OnPermissionsRequestResponseStatus(request_id, i, + OnPermissionsRequestResponseStatus( + request_id, i, GetPermissionStatus(permission, requesting_origin, embedding_origin)); continue; } context_.RequestPermission( permission, web_contents, request, requesting_origin, - base::Bind(&ContentSettingToPermissionStatusCallbackWrapper, + base::Bind( + &ContentSettingToPermissionStatusCallbackWrapper, base::Bind( &CefPermissionManager::OnPermissionsRequestResponseStatus, weak_ptr_factory_.GetWeakPtr(), request_id, i))); @@ -289,9 +280,8 @@ PermissionStatus CefPermissionManager::GetPermissionStatus( if (!context_.SupportsPermission(permission)) return PermissionStatus::DENIED; - return ContentSettingToPermissionStatus( - context_.GetPermissionStatus(permission, requesting_origin, - embedding_origin)); + return ContentSettingToPermissionStatus(context_.GetPermissionStatus( + permission, requesting_origin, embedding_origin)); } int CefPermissionManager::SubscribePermissionStatusChange( @@ -309,8 +299,7 @@ int CefPermissionManager::SubscribePermissionStatusChange( subscription->callback = callback; subscription->current_value = PermissionStatusToContentSetting( - GetPermissionStatus(permission, - subscription->requesting_origin, + GetPermissionStatus(permission, subscription->requesting_origin, subscription->embedding_origin)); return subscriptions_.Add(std::move(subscription)); @@ -332,8 +321,8 @@ void CefPermissionManager::OnContentSettingChanged( std::string resource_identifier) { std::list callbacks; - for (SubscriptionsMap::iterator iter(&subscriptions_); - !iter.IsAtEnd(); iter.Advance()) { + for (SubscriptionsMap::iterator iter(&subscriptions_); !iter.IsAtEnd(); + iter.Advance()) { Subscription* subscription = iter.GetCurrentValue(); if (permission_util::PermissionTypeToContentSetting( subscription->permission) != content_type) { @@ -347,10 +336,10 @@ void CefPermissionManager::OnContentSettingChanged( !secondary_pattern.Matches(subscription->embedding_origin)) continue; - ContentSetting new_value = PermissionStatusToContentSetting( - GetPermissionStatus(subscription->permission, - subscription->requesting_origin, - subscription->embedding_origin)); + ContentSetting new_value = + PermissionStatusToContentSetting(GetPermissionStatus( + subscription->permission, subscription->requesting_origin, + subscription->embedding_origin)); if (subscription->current_value == new_value) continue; @@ -358,9 +347,8 @@ void CefPermissionManager::OnContentSettingChanged( // Add the callback to |callbacks| which will be run after the loop to // prevent re-entrance issues. - callbacks.push_back( - base::Bind(subscription->callback, - ContentSettingToPermissionStatus(new_value))); + callbacks.push_back(base::Bind( + subscription->callback, ContentSettingToPermissionStatus(new_value))); } for (const auto& callback : callbacks) diff --git a/libcef/browser/permissions/permission_manager.h b/libcef/browser/permissions/permission_manager.h index a43bdd398..07cb3dadd 100644 --- a/libcef/browser/permissions/permission_manager.h +++ b/libcef/browser/permissions/permission_manager.h @@ -44,8 +44,8 @@ class CefPermissionManager : public KeyedService, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, - const base::Callback&)>& callback) + const base::Callback< + void(const std::vector&)>& callback) override; void CancelPermissionRequest(int request_id) override; void ResetPermission(content::PermissionType permission, @@ -97,4 +97,4 @@ class CefPermissionManager : public KeyedService, DISALLOW_COPY_AND_ASSIGN(CefPermissionManager); }; -#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ +#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ diff --git a/libcef/browser/permissions/permission_util.h b/libcef/browser/permissions/permission_util.h index 430e84e99..e3c5d4d5e 100644 --- a/libcef/browser/permissions/permission_util.h +++ b/libcef/browser/permissions/permission_util.h @@ -16,4 +16,4 @@ ContentSettingsType PermissionTypeToContentSetting( } // namespace permission_util -#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ +#endif // CEF_LIBCEF_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ diff --git a/libcef/browser/plugins/plugin_info_message_filter.cc b/libcef/browser/plugins/plugin_info_message_filter.cc index d7f4ffd07..6a7518a80 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.cc +++ b/libcef/browser/plugins/plugin_info_message_filter.cc @@ -67,15 +67,14 @@ class ShutdownNotifierFactory ShutdownNotifierFactory() : BrowserContextKeyedServiceShutdownNotifierFactory( - "CefPluginInfoMessageFilter") { - } + "CefPluginInfoMessageFilter") {} ~ShutdownNotifierFactory() override {} DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; -base::LazyInstance::Leaky - g_shutdown_notifier_factory = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance::Leaky g_shutdown_notifier_factory = + LAZY_INSTANCE_INITIALIZER; // static ShutdownNotifierFactory* ShutdownNotifierFactory::GetInstance() { @@ -122,8 +121,8 @@ static void SendPluginAvailabilityUMA(const std::string& mime_type, if (mime_type != kWidevineCdmPluginMimeType) return; - UMA_HISTOGRAM_ENUMERATION("Plugin.AvailabilityStatus.WidevineCdm", - status, PLUGIN_AVAILABILITY_STATUS_MAX); + UMA_HISTOGRAM_ENUMERATION("Plugin.AvailabilityStatus.WidevineCdm", status, + PLUGIN_AVAILABILITY_STATUS_MAX); #endif // defined(WIDEVINE_CDM_AVAILABLE) } @@ -131,8 +130,7 @@ static void SendPluginAvailabilityUMA(const std::string& mime_type, void ReportMetrics(const std::string& mime_type, const GURL& url, - const url::Origin& main_frame_origin) { -} + const url::Origin& main_frame_origin) {} #if BUILDFLAG(ENABLE_EXTENSIONS) // Returns whether a request from a plugin to load |resource| from a renderer @@ -154,7 +152,7 @@ bool IsPluginLoadingAccessibleResourceInWebView( const extensions::Extension* extension = extension_registry->GetExtensionById( extension_id, extensions::ExtensionRegistry::ENABLED); if (!extension || !extensions::WebviewInfo::IsResourceWebviewAccessible( - extension, partition_id, resource.path())) { + extension, partition_id, resource.path())) { return false; } @@ -168,9 +166,8 @@ bool IsPluginLoadingAccessibleResourceInWebView( } // namespace -CefPluginInfoMessageFilter::Context::Context( - int render_process_id, - CefBrowserContext* profile) +CefPluginInfoMessageFilter::Context::Context(int render_process_id, + CefBrowserContext* profile) : render_process_id_(render_process_id), resource_context_( static_cast(profile->GetResourceContext())), @@ -192,8 +189,7 @@ CefPluginInfoMessageFilter::Context::Context( content::BrowserThread::IO)); } -CefPluginInfoMessageFilter::Context::~Context() { -} +CefPluginInfoMessageFilter::Context::~Context() {} void CefPluginInfoMessageFilter::Context::ShutdownOnUIThread() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -210,8 +206,8 @@ CefPluginInfoMessageFilter::CefPluginInfoMessageFilter( weak_ptr_factory_(this) { shutdown_notifier_ = ShutdownNotifierFactory::GetInstance()->Get(profile)->Subscribe( - base::Bind(&CefPluginInfoMessageFilter::ShutdownOnUIThread, - base::Unretained(this))); + base::Bind(&CefPluginInfoMessageFilter::ShutdownOnUIThread, + base::Unretained(this))); } void CefPluginInfoMessageFilter::ShutdownOnUIThread() { @@ -226,9 +222,8 @@ bool CefPluginInfoMessageFilter::OnMessageReceived( IPC_MESSAGE_HANDLER_DELAY_REPLY(CefViewHostMsg_GetPluginInfo, OnGetPluginInfo) #if BUILDFLAG(ENABLE_PEPPER_CDMS) - IPC_MESSAGE_HANDLER( - CefViewHostMsg_IsInternalPluginAvailableForMimeType, - OnIsInternalPluginAvailableForMimeType) + IPC_MESSAGE_HANDLER(CefViewHostMsg_IsInternalPluginAvailableForMimeType, + OnIsInternalPluginAvailableForMimeType) #endif IPC_MESSAGE_UNHANDLED(return false) IPC_END_MESSAGE_MAP() @@ -236,8 +231,8 @@ bool CefPluginInfoMessageFilter::OnMessageReceived( } void CefPluginInfoMessageFilter::OnDestruct() const { - const_cast(this)-> - weak_ptr_factory_.InvalidateWeakPtrs(); + const_cast(this) + ->weak_ptr_factory_.InvalidateWeakPtrs(); // Destroy on the UI thread because we contain a |PrefMember|. content::BrowserThread::DeleteOnUIThread::Destruct(this); @@ -260,17 +255,11 @@ void CefPluginInfoMessageFilter::OnGetPluginInfo( const url::Origin& main_frame_origin, const std::string& mime_type, IPC::Message* reply_msg) { - GetPluginInfo_Params params = { - render_frame_id, - url, - is_main_frame, - main_frame_origin, - mime_type - }; + GetPluginInfo_Params params = {render_frame_id, url, is_main_frame, + main_frame_origin, mime_type}; PluginService::GetInstance()->GetPlugins( base::Bind(&CefPluginInfoMessageFilter::PluginsLoaded, - weak_ptr_factory_.GetWeakPtr(), - params, reply_msg)); + weak_ptr_factory_.GetWeakPtr(), params, reply_msg)); } void CefPluginInfoMessageFilter::PluginsLoaded( @@ -281,10 +270,8 @@ void CefPluginInfoMessageFilter::PluginsLoaded( // This also fills in |actual_mime_type|. std::unique_ptr plugin_metadata; - context_.FindEnabledPlugin(params, - &output.status, &output.plugin, - &output.actual_mime_type, - &plugin_metadata); + context_.FindEnabledPlugin(params, &output.status, &output.plugin, + &output.actual_mime_type, &plugin_metadata); if (plugin_metadata) { output.group_identifier = plugin_metadata->identifier(); @@ -293,8 +280,7 @@ void CefPluginInfoMessageFilter::PluginsLoaded( CefViewHostMsg_GetPluginInfo::WriteReplyParams(reply_msg, output); Send(reply_msg); - if (output.status != - CefViewHostMsg_GetPluginInfo_Status::kNotFound) { + if (output.status != CefViewHostMsg_GetPluginInfo_Status::kNotFound) { main_thread_task_runner_->PostTask( FROM_HERE, base::Bind(&ReportMetrics, output.actual_mime_type, params.url, params.main_frame_origin)); @@ -337,7 +323,7 @@ void CefPluginInfoMessageFilter::OnIsInternalPluginAvailableForMimeType( mime_type, is_plugin_disabled ? PLUGIN_DISABLED : PLUGIN_NOT_REGISTERED); } -#endif // BUILDFLAG(ENABLE_PEPPER_CDMS) +#endif // BUILDFLAG(ENABLE_PEPPER_CDMS) void CefPluginInfoMessageFilter::Context::DecidePluginStatus( const GetPluginInfo_Params& params, @@ -373,8 +359,7 @@ void CefPluginInfoMessageFilter::Context::DecidePluginStatus( // Check if the plugin is crashing too much. if (PluginService::GetInstance()->IsPluginUnstable(plugin.path) && !always_authorize_plugins_.GetValue() && - plugin_setting != CONTENT_SETTING_BLOCK && - uses_default_content_setting) { + plugin_setting != CONTENT_SETTING_BLOCK && uses_default_content_setting) { *status = CefViewHostMsg_GetPluginInfo_Status::kUnauthorized; return; } @@ -409,8 +394,7 @@ void CefPluginInfoMessageFilter::Context::DecidePluginStatus( // embedder. if (*status == CefViewHostMsg_GetPluginInfo_Status::kAllowed || *status == CefViewHostMsg_GetPluginInfo_Status::kBlocked || - *status == - CefViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { + *status == CefViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { if (extensions::WebViewRendererState::GetInstance()->IsGuest( render_process_id_)) { *status = CefViewHostMsg_GetPluginInfo_Status::kUnauthorized; @@ -451,13 +435,9 @@ bool CefPluginInfoMessageFilter::Context::FindEnabledPlugin( *plugin_metadata = PluginFinder::GetInstance()->GetPluginMetadata(*plugin); DecidePluginStatus(params, *plugin, (*plugin_metadata).get(), status); - if (filter->IsPluginAvailable(render_process_id_, - resource_context_, - params.url, - params.is_main_frame, - params.main_frame_origin, - plugin, - status)) { + if (filter->IsPluginAvailable(render_process_id_, resource_context_, + params.url, params.is_main_frame, + params.main_frame_origin, plugin, status)) { break; } @@ -492,28 +472,19 @@ void CefPluginInfoMessageFilter::Context::GetPluginContentSetting( bool uses_plugin_specific_setting = false; if (ShouldUseJavaScriptSettingForPlugin(plugin)) { value = host_content_settings_map_->GetWebsiteSetting( - policy_url, - policy_url, - CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string(), + policy_url, policy_url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &info); } else { content_settings::SettingInfo specific_info; std::unique_ptr specific_setting = host_content_settings_map_->GetWebsiteSetting( - policy_url, - plugin_url, - CONTENT_SETTINGS_TYPE_PLUGINS, - resource, + policy_url, plugin_url, CONTENT_SETTINGS_TYPE_PLUGINS, resource, &specific_info); content_settings::SettingInfo general_info; std::unique_ptr general_setting = host_content_settings_map_->GetWebsiteSetting( - policy_url, - plugin_url, - CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), - &general_info); + policy_url, plugin_url, CONTENT_SETTINGS_TYPE_PLUGINS, + std::string(), &general_info); // If there is a plugin-specific setting, we use it, unless the general // setting was set by policy, in which case it takes precedence. diff --git a/libcef/browser/plugins/plugin_info_message_filter.h b/libcef/browser/plugins/plugin_info_message_filter.h index 743ca9cd3..6b1fe3a0a 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.h +++ b/libcef/browser/plugins/plugin_info_message_filter.h @@ -53,11 +53,10 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter { ~Context(); void ShutdownOnUIThread(); - void DecidePluginStatus( - const GetPluginInfo_Params& params, - const content::WebPluginInfo& plugin, - const PluginMetadata* plugin_metadata, - CefViewHostMsg_GetPluginInfo_Status* status) const; + void DecidePluginStatus(const GetPluginInfo_Params& params, + const content::WebPluginInfo& plugin, + const PluginMetadata* plugin_metadata, + CefViewHostMsg_GetPluginInfo_Status* status) const; bool FindEnabledPlugin( const GetPluginInfo_Params& params, CefViewHostMsg_GetPluginInfo_Status* status, @@ -85,8 +84,7 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter { BooleanPrefMember always_authorize_plugins_; }; - CefPluginInfoMessageFilter(int render_process_id, - CefBrowserContext* profile); + CefPluginInfoMessageFilter(int render_process_id, CefBrowserContext* profile); // content::BrowserMessageFilter methods: bool OnMessageReceived(const IPC::Message& message) override; diff --git a/libcef/browser/plugins/plugin_service_filter.cc b/libcef/browser/plugins/plugin_service_filter.cc index 81c5afe24..4aa182387 100644 --- a/libcef/browser/plugins/plugin_service_filter.cc +++ b/libcef/browser/plugins/plugin_service_filter.cc @@ -14,8 +14,7 @@ #include "extensions/common/constants.h" -CefPluginServiceFilter::CefPluginServiceFilter() { -} +CefPluginServiceFilter::CefPluginServiceFilter() {} bool CefPluginServiceFilter::IsPluginAvailable( int render_process_id, @@ -97,9 +96,9 @@ bool CefPluginServiceFilter::IsPluginAvailable( } // Check for a cached plugin load decision. - if (resource_context->HasPluginLoadDecision( - render_process_id, plugin->path, - is_main_frame, main_frame_origin, status)) { + if (resource_context->HasPluginLoadDecision(render_process_id, plugin->path, + is_main_frame, main_frame_origin, + status)) { return *status != CefViewHostMsg_GetPluginInfo_Status::kDisabled; } @@ -129,11 +128,9 @@ bool CefPluginServiceFilter::IsPluginAvailable( } if (handler->OnBeforePluginLoad(plugin->mime_types[0].mime_type, - url.possibly_invalid_spec(), - is_main_frame, + url.possibly_invalid_spec(), is_main_frame, policy_url.possibly_invalid_spec(), - pluginInfo.get(), - &plugin_policy)) { + pluginInfo.get(), &plugin_policy)) { switch (plugin_policy) { case PLUGIN_POLICY_ALLOW: *status = CefViewHostMsg_GetPluginInfo_Status::kAllowed; @@ -151,9 +148,9 @@ bool CefPluginServiceFilter::IsPluginAvailable( } // Cache the plugin load decision. - resource_context->AddPluginLoadDecision( - render_process_id, plugin->path, - is_main_frame, main_frame_origin, *status); + resource_context->AddPluginLoadDecision(render_process_id, plugin->path, + is_main_frame, main_frame_origin, + *status); return *status != CefViewHostMsg_GetPluginInfo_Status::kDisabled; } diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index f3a0b7ae3..c1ae1251e 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -25,12 +25,12 @@ #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/google/core/browser/google_url_tracker.h" +#include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/json_pref_store.h" #include "components/prefs/pref_filter.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_store.h" -#include "components/pref_registry/pref_registry_syncable.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" #include "components/spellcheck/browser/pref_names.h" @@ -84,8 +84,8 @@ void RegisterLocalizedValue(PrefRegistrySimple* registry, } default: { - NOTREACHED() << - "list and dictionary types cannot have default locale values"; + NOTREACHED() + << "list and dictionary types cannot have default locale values"; } } NOTREACHED(); @@ -95,11 +95,10 @@ void RegisterLocalizedValue(PrefRegistrySimple* registry, const char kUserPrefsFileName[] = "UserPrefs.json"; -std::unique_ptr CreatePrefService( - Profile* profile, - const base::FilePath& cache_path, - bool persist_user_preferences, - bool is_pre_initialization) { +std::unique_ptr CreatePrefService(Profile* profile, + const base::FilePath& cache_path, + bool persist_user_preferences, + bool is_pre_initialization) { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -116,8 +115,8 @@ std::unique_ptr CreatePrefService( factory.set_command_line_prefs(command_line_pref_store); // True if preferences will be stored on disk. - const bool store_on_disk = !cache_path.empty() && persist_user_preferences && - !is_pre_initialization; + const bool store_on_disk = + !cache_path.empty() && persist_user_preferences && !is_pre_initialization; scoped_refptr sequenced_task_runner; if (store_on_disk) { @@ -133,9 +132,8 @@ std::unique_ptr CreatePrefService( if (store_on_disk) { const base::FilePath& pref_path = cache_path.AppendASCII(browser_prefs::kUserPrefsFileName); - scoped_refptr json_pref_store = - new JsonPrefStore(pref_path, sequenced_task_runner, - std::unique_ptr()); + scoped_refptr json_pref_store = new JsonPrefStore( + pref_path, sequenced_task_runner, std::unique_ptr()); factory.set_user_prefs(json_pref_store.get()); } else { scoped_refptr testing_pref_store = new TestingPrefStore(); @@ -151,8 +149,8 @@ std::unique_ptr CreatePrefService( SupervisedUserSettingsServiceFactory::GetForProfile(profile); if (store_on_disk) { - supervised_user_settings->Init( - cache_path, sequenced_task_runner.get(), true); + supervised_user_settings->Init(cache_path, sequenced_task_runner.get(), + true); } else { scoped_refptr testing_pref_store = new TestingPrefStore(); @@ -197,10 +195,9 @@ std::unique_ptr CreatePrefService( registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, spellcheck_lang); } else { - RegisterLocalizedValue(registry.get(), - spellcheck::prefs::kSpellCheckDictionary, - base::Value::Type::STRING, - IDS_SPELLCHECK_DICTIONARY); + RegisterLocalizedValue( + registry.get(), spellcheck::prefs::kSpellCheckDictionary, + base::Value::Type::STRING, IDS_SPELLCHECK_DICTIONARY); } registry->RegisterBooleanPref( spellcheck::prefs::kSpellCheckUseSpellingService, @@ -223,9 +220,9 @@ std::unique_ptr CreatePrefService( registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false); registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false); - // Theme preferences. - // Based on ThemeServiceFactory::RegisterProfilePrefs. - // TODO(cef/chrome): Remove this once CEF supports ThemeService. +// Theme preferences. +// Based on ThemeServiceFactory::RegisterProfilePrefs. +// TODO(cef/chrome): Remove this once CEF supports ThemeService. #if defined(USE_X11) registry->RegisterBooleanPref(prefs::kUsesSystemTheme, false); #endif diff --git a/libcef/browser/prefs/browser_prefs.h b/libcef/browser/prefs/browser_prefs.h index a08f60ae4..c9654f2cc 100644 --- a/libcef/browser/prefs/browser_prefs.h +++ b/libcef/browser/prefs/browser_prefs.h @@ -22,11 +22,10 @@ extern const char kUserPrefsFileName[]; // Create the PrefService used to manage pref registration and storage. If // |is_pre_initialization| is true a non-persistent PrefService will be created // for temporary usage during BrowserContextServices initialization. -std::unique_ptr CreatePrefService( - Profile* profile, - const base::FilePath& cache_path, - bool persist_user_preferences, - bool is_pre_initialization); +std::unique_ptr CreatePrefService(Profile* profile, + const base::FilePath& cache_path, + bool persist_user_preferences, + bool is_pre_initialization); } // namespace browser_prefs diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 2a1da1771..a34dc5e9d 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -23,10 +23,10 @@ #include "chrome/browser/ui/prefs/prefs_tab_helper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/command_line_pref_store.h" #include "components/prefs/pref_service.h" #include "components/prefs/pref_store.h" -#include "components/pref_registry/pref_registry_syncable.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/site_instance.h" @@ -55,7 +55,7 @@ void SetDefaultPrefs(content::WebPreferences& web) { !command_line->HasSwitch(switches::kDisableJavascriptAccessClipboard); web.allow_universal_access_from_file_urls = command_line->HasSwitch(switches::kAllowUniversalAccessFromFileUrls); - web.shrinks_standalone_images_to_fit = + web.shrinks_standalone_images_to_fit = command_line->HasSwitch(switches::kImageShrinkStandaloneToFit); web.text_areas_are_resizable = !command_line->HasSwitch(switches::kDisableTextAreaResize); @@ -63,19 +63,16 @@ void SetDefaultPrefs(content::WebPreferences& web) { // Chrome preferences. // Should match ChromeContentBrowserClient::OverrideWebkitPrefs. -void SetChromePrefs(CefBrowserContext* profile, - content::WebPreferences& web) { +void SetChromePrefs(CefBrowserContext* profile, content::WebPreferences& web) { PrefService* prefs = profile->GetPrefs(); // Fill per-script font preferences. FontFamilyCache::FillFontFamilyMap(profile, prefs::kWebKitStandardFontFamilyMap, &web.standard_font_family_map); - FontFamilyCache::FillFontFamilyMap(profile, - prefs::kWebKitFixedFontFamilyMap, + FontFamilyCache::FillFontFamilyMap(profile, prefs::kWebKitFixedFontFamilyMap, &web.fixed_font_family_map); - FontFamilyCache::FillFontFamilyMap(profile, - prefs::kWebKitSerifFontFamilyMap, + FontFamilyCache::FillFontFamilyMap(profile, prefs::kWebKitSerifFontFamilyMap, &web.serif_font_family_map); FontFamilyCache::FillFontFamilyMap(profile, prefs::kWebKitSansSerifFontFamilyMap, @@ -90,12 +87,10 @@ void SetChromePrefs(CefBrowserContext* profile, prefs::kWebKitPictographFontFamilyMap, &web.pictograph_font_family_map); - web.default_font_size = - prefs->GetInteger(prefs::kWebKitDefaultFontSize); + web.default_font_size = prefs->GetInteger(prefs::kWebKitDefaultFontSize); web.default_fixed_font_size = prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); - web.minimum_font_size = - prefs->GetInteger(prefs::kWebKitMinimumFontSize); + web.minimum_font_size = prefs->GetInteger(prefs::kWebKitMinimumFontSize); web.minimum_logical_font_size = prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize); @@ -103,8 +98,7 @@ void SetChromePrefs(CefBrowserContext* profile, web.javascript_can_open_windows_automatically = prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); - web.dom_paste_enabled = - prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); + web.dom_paste_enabled = prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); web.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks); if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled)) @@ -133,8 +127,7 @@ void SetChromePrefs(CefBrowserContext* profile, std::string image_animation_policy = prefs->GetString(prefs::kAnimationPolicy); if (image_animation_policy == kAnimationPolicyOnce) - web.animation_policy = - content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; + web.animation_policy = content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; else if (image_animation_policy == kAnimationPolicyNone) web.animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; else @@ -142,8 +135,8 @@ void SetChromePrefs(CefBrowserContext* profile, } // Make sure we will set the default_encoding with canonical encoding name. - web.default_encoding = base::GetCanonicalEncodingNameByAliasName( - web.default_encoding); + web.default_encoding = + base::GetCanonicalEncodingNameByAliasName(web.default_encoding); if (web.default_encoding.empty()) { prefs->ClearPref(prefs::kDefaultCharset); web.default_encoding = prefs->GetString(prefs::kDefaultCharset); @@ -192,15 +185,14 @@ void SetExtensionPrefs(content::RenderViewHost* rvh, // Helper macro for setting a WebPreferences variable based on the value of a // CefBrowserSettings variable. -#define SET_STATE(cef_var, web_var) \ - if (cef_var == STATE_ENABLED) \ - web_var = true; \ - else if (cef_var == STATE_DISABLED) \ - web_var = false; +#define SET_STATE(cef_var, web_var) \ + if (cef_var == STATE_ENABLED) \ + web_var = true; \ + else if (cef_var == STATE_DISABLED) \ + web_var = false; // Set preferences based on CefBrowserSettings. -void SetCefPrefs(const CefBrowserSettings& cef, - content::WebPreferences& web) { +void SetCefPrefs(const CefBrowserSettings& cef, content::WebPreferences& web) { if (cef.standard_font_family.length > 0) { web.standard_font_family_map[content::kCommonScript] = CefString(&cef.standard_font_family); @@ -241,20 +233,20 @@ void SetCefPrefs(const CefBrowserSettings& cef, SET_STATE(cef.remote_fonts, web.remote_fonts_enabled); SET_STATE(cef.javascript, web.javascript_enabled); SET_STATE(cef.javascript_open_windows, - web.javascript_can_open_windows_automatically); + web.javascript_can_open_windows_automatically); SET_STATE(cef.javascript_close_windows, web.allow_scripts_to_close_windows); SET_STATE(cef.javascript_access_clipboard, - web.javascript_can_access_clipboard); + web.javascript_can_access_clipboard); SET_STATE(cef.javascript_dom_paste, web.dom_paste_enabled); SET_STATE(cef.plugins, web.plugins_enabled); SET_STATE(cef.universal_access_from_file_urls, - web.allow_universal_access_from_file_urls); + web.allow_universal_access_from_file_urls); SET_STATE(cef.file_access_from_file_urls, - web.allow_file_access_from_file_urls); + web.allow_file_access_from_file_urls); SET_STATE(cef.web_security, web.web_security_enabled); SET_STATE(cef.image_loading, web.loads_images_automatically); SET_STATE(cef.image_shrink_standalone_to_fit, - web.shrinks_standalone_images_to_fit); + web.shrinks_standalone_images_to_fit); SET_STATE(cef.text_area_resize, web.text_areas_are_resizable); SET_STATE(cef.tab_to_links, web.tabs_to_links); SET_STATE(cef.local_storage, web.local_storage_enabled); @@ -270,18 +262,13 @@ void SetCefPrefs(const CefBrowserSettings& cef, void SetString(CommandLinePrefStore* prefs, const std::string& key, const std::string& value) { - prefs->SetValue( - key, - base::WrapUnique(new base::Value(value)), - WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); + prefs->SetValue(key, base::WrapUnique(new base::Value(value)), + WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } -void SetBool(CommandLinePrefStore* prefs, - const std::string& key, - bool value) { - prefs->SetValue(key, - base::WrapUnique(new base::Value(value)), - WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); +void SetBool(CommandLinePrefStore* prefs, const std::string& key, bool value) { + prefs->SetValue(key, base::WrapUnique(new base::Value(value)), + WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } } // namespace @@ -311,8 +298,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { // From chrome::RegisterBrowserUserPrefs. registry->RegisterBooleanPref( - prefs::kEnableDoNotTrack, - false, + prefs::kEnableDoNotTrack, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); #if BUILDFLAG(ENABLE_WEBRTC) @@ -347,9 +333,8 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, // Set preferences based on the context's PrefService. if (browser) { - CefBrowserContext* profile = - static_cast( - browser->web_contents()->GetBrowserContext()); + CefBrowserContext* profile = static_cast( + browser->web_contents()->GetBrowserContext()); SetChromePrefs(profile, web); } diff --git a/libcef/browser/print_settings_impl.cc b/libcef/browser/print_settings_impl.cc index 6502b2922..a284a5f38 100644 --- a/libcef/browser/print_settings_impl.cc +++ b/libcef/browser/print_settings_impl.cc @@ -9,10 +9,12 @@ CefPrintSettingsImpl::CefPrintSettingsImpl(printing::PrintSettings* value, bool will_delete, bool read_only) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - read_only, NULL) { -} + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + read_only, + NULL) {} bool CefPrintSettingsImpl::IsValid() { return !detached(); @@ -46,8 +48,7 @@ void CefPrintSettingsImpl::SetPrinterPrintableArea( CEF_VALUE_VERIFY_RETURN_VOID(true); gfx::Size size(physical_size_device_units.width, physical_size_device_units.height); - gfx::Rect rect(printable_area_device_units.x, - printable_area_device_units.y, + gfx::Rect rect(printable_area_device_units.x, printable_area_device_units.y, printable_area_device_units.width, printable_area_device_units.height); mutable_value()->SetPrinterPrintableArea(size, rect, landscape_needs_flip); @@ -77,7 +78,7 @@ void CefPrintSettingsImpl::SetPageRanges(const PageRangeList& ranges) { CEF_VALUE_VERIFY_RETURN_VOID(true); printing::PageRanges page_ranges; PageRangeList::const_iterator it = ranges.begin(); - for(; it != ranges.end(); ++it) { + for (; it != ranges.end(); ++it) { const CefRange& cef_range = *it; printing::PageRange range; range.from = cef_range.from; @@ -154,12 +155,9 @@ CefPrintSettings::DuplexMode CefPrintSettingsImpl::GetDuplexMode() { return static_cast(const_value().duplex_mode()); } - // CefPrintSettings implementation. // static CefRefPtr CefPrintSettings::Create() { - return new CefPrintSettingsImpl( - new printing::PrintSettings(), true, false); + return new CefPrintSettingsImpl(new printing::PrintSettings(), true, false); } - diff --git a/libcef/browser/print_settings_impl.h b/libcef/browser/print_settings_impl.h index 0ae7e10e4..0855038a2 100644 --- a/libcef/browser/print_settings_impl.h +++ b/libcef/browser/print_settings_impl.h @@ -25,10 +25,9 @@ class CefPrintSettingsImpl CefRefPtr Copy() override; void SetOrientation(bool landscape) override; bool IsLandscape() override; - void SetPrinterPrintableArea( - const CefSize& physical_size_device_units, - const CefRect& printable_area_device_units, - bool landscape_needs_flip) override; + void SetPrinterPrintableArea(const CefSize& physical_size_device_units, + const CefRect& printable_area_device_units, + bool landscape_needs_flip) override; void SetDeviceName(const CefString& name) override; CefString GetDeviceName() override; void SetDPI(int dpi) override; diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index 970bc5dca..c45980fb8 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -31,8 +31,7 @@ using printing::PrintSettings; class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { public: explicit CefPrintDialogCallbackImpl(CefRefPtr dialog) - : dialog_(dialog) { - } + : dialog_(dialog) {} void Continue(CefRefPtr settings) override { if (CEF_CURRENTLY_ON_UIT()) { @@ -41,8 +40,8 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { dialog_ = NULL; } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintDialogCallbackImpl::Continue, this, settings)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogCallbackImpl::Continue, + this, settings)); } } @@ -54,13 +53,11 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintDialogCallbackImpl::Cancel, this)); + base::Bind(&CefPrintDialogCallbackImpl::Cancel, this)); } } - void Disconnect() { - dialog_ = NULL; - } + void Disconnect() { dialog_ = NULL; } private: CefRefPtr dialog_; @@ -72,8 +69,7 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { class CefPrintJobCallbackImpl : public CefPrintJobCallback { public: explicit CefPrintJobCallbackImpl(CefRefPtr dialog) - : dialog_(dialog) { - } + : dialog_(dialog) {} void Continue() override { if (CEF_CURRENTLY_ON_UIT()) { @@ -83,13 +79,11 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintJobCallbackImpl::Continue, this)); + base::Bind(&CefPrintJobCallbackImpl::Continue, this)); } } - void Disconnect() { - dialog_ = NULL; - } + void Disconnect() { dialog_ = NULL; } private: CefRefPtr dialog_; @@ -98,7 +92,6 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback { DISALLOW_COPY_AND_ASSIGN(CefPrintJobCallbackImpl); }; - // static printing::PrintDialogGtkInterface* CefPrintDialogLinux::CreatePrintDialog( PrintingContextLinux* context) { @@ -121,8 +114,8 @@ gfx::Size CefPrintDialogLinux::GetPdfPaperSize( CefRefPtr handler = browser_handler->GetPrintHandler(); if (handler.get()) { const printing::PrintSettings& settings = context->settings(); - CefSize cef_size = handler->GetPdfPaperSize( - settings.device_units_per_inch()); + CefSize cef_size = + handler->GetPdfPaperSize(settings.device_units_per_inch()); size.SetSize(cef_size.width, cef_size.height); } } @@ -139,9 +132,8 @@ gfx::Size CefPrintDialogLinux::GetPdfPaperSize( void CefPrintDialogLinux::OnPrintStart(int render_process_id, int render_routing_id) { if (!CEF_CURRENTLY_ON(CEF_UIT)) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintDialogLinux::OnPrintStart, - render_process_id, render_routing_id)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogLinux::OnPrintStart, + render_process_id, render_routing_id)); return; } @@ -158,17 +150,14 @@ void CefPrintDialogLinux::OnPrintStart(int render_process_id, if (!handler.get()) return; - CefRefPtr browser = - extensions::GetOwnerBrowserForFrame(render_process_id, - render_routing_id, - NULL); + CefRefPtr browser = extensions::GetOwnerBrowserForFrame( + render_process_id, render_routing_id, NULL); if (browser.get()) handler->OnPrintStart(browser.get()); } CefPrintDialogLinux::CefPrintDialogLinux(PrintingContextLinux* context) - : context_(context) { -} + : context_(context) {} CefPrintDialogLinux::~CefPrintDialogLinux() { CEF_REQUIRE_UIT(); @@ -237,10 +226,8 @@ void CefPrintDialogLinux::PrintDocument( } // No errors, continue printing. - CEF_POST_TASK( - CEF_UIT, - base::Bind(&CefPrintDialogLinux::SendDocumentToPrinter, this, - document_name)); + CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogLinux::SendDocumentToPrinter, + this, document_name)); } void CefPrintDialogLinux::AddRefToDialog() { @@ -332,4 +319,3 @@ void CefPrintDialogLinux::OnJobCompleted() { // Printing finished. Matches AddRef() in PrintDocument(); Release(); } - diff --git a/libcef/browser/printing/print_dialog_linux.h b/libcef/browser/printing/print_dialog_linux.h index 7f2a8eda9..fca6c9274 100644 --- a/libcef/browser/printing/print_dialog_linux.h +++ b/libcef/browser/printing/print_dialog_linux.h @@ -24,22 +24,20 @@ class PrintSettings; using printing::PrintingContextLinux; // Needs to be freed on the UI thread to clean up its member variables. -class CefPrintDialogLinux - : public printing::PrintDialogGtkInterface, - public base::RefCountedThreadSafe< - CefPrintDialogLinux, content::BrowserThread::DeleteOnUIThread> { +class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, + public base::RefCountedThreadSafe< + CefPrintDialogLinux, + content::BrowserThread::DeleteOnUIThread> { public: // Creates and returns a print dialog. static printing::PrintDialogGtkInterface* CreatePrintDialog( PrintingContextLinux* context); // Returns the paper size in device units. - static gfx::Size GetPdfPaperSize( - printing::PrintingContextLinux* context); + static gfx::Size GetPdfPaperSize(printing::PrintingContextLinux* context); // Notify the client when printing has started. - static void OnPrintStart(int render_process_id, - int render_routing_id); + static void OnPrintStart(int render_process_id, int render_routing_id); // printing::CefPrintDialogLinuxInterface implementation. void UseDefaultSettings() override; @@ -56,7 +54,8 @@ class CefPrintDialogLinux private: friend class base::DeleteHelper; friend class base::RefCountedThreadSafe< - CefPrintDialogLinux, content::BrowserThread::DeleteOnUIThread>; + CefPrintDialogLinux, + content::BrowserThread::DeleteOnUIThread>; friend struct content::BrowserThread::DeleteOnThread< content::BrowserThread::UI>; friend class CefPrintDialogCallbackImpl; @@ -68,8 +67,7 @@ class CefPrintDialogLinux void SetHandler(); void ReleaseHandler(); - bool UpdateSettings(printing::PrintSettings* settings, - bool get_defaults); + bool UpdateSettings(printing::PrintSettings* settings, bool get_defaults); // Prints document named |document_name|. void SendDocumentToPrinter(const base::string16& document_name); diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index c26229939..d7a8363e7 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -61,13 +61,16 @@ void FillInDictionaryFromPdfPrintSettings( !!pdf_settings.backgrounds_enabled); print_settings.SetBoolean(kSettingHeaderFooterEnabled, !!pdf_settings.header_footer_enabled); - print_settings.SetInteger(kSettingScaleFactor, - pdf_settings.scale_factor > 0 ? pdf_settings.scale_factor : 100); + print_settings.SetInteger(kSettingScaleFactor, pdf_settings.scale_factor > 0 + ? pdf_settings.scale_factor + : 100); if (pdf_settings.header_footer_enabled) { - print_settings.SetString(kSettingHeaderFooterTitle, + print_settings.SetString( + kSettingHeaderFooterTitle, CefString(&pdf_settings.header_footer_title).ToString16()); - print_settings.SetString(kSettingHeaderFooterURL, + print_settings.SetString( + kSettingHeaderFooterURL, CefString(&pdf_settings.header_footer_url).ToString16()); } @@ -117,14 +120,15 @@ void StopWorker(int document_cookie) { scoped_refptr printer_query = queue->PopPrinterQuery(document_cookie); if (printer_query.get()) { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&PrinterQuery::StopWorker, - printer_query)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&PrinterQuery::StopWorker, printer_query)); } } -scoped_refptr - GetDataFromHandle(base::SharedMemoryHandle handle, uint32_t data_size) { +scoped_refptr GetDataFromHandle( + base::SharedMemoryHandle handle, + uint32_t data_size) { std::unique_ptr shared_buf = base::MakeUnique(handle, true); @@ -153,8 +157,7 @@ void SavePdfFile(scoped_refptr data, bool ok = file.IsValid() && metafile.SaveTo(&file); if (!callback.is_null()) { - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(callback, ok)); } } @@ -169,8 +172,7 @@ struct CefPrintViewManager::PdfPrintState { }; CefPrintViewManager::CefPrintViewManager(content::WebContents* web_contents) - : CefPrintViewManagerBase(web_contents) { -} + : CefPrintViewManagerBase(web_contents) {} CefPrintViewManager::~CefPrintViewManager() { TerminatePdfPrintJob(); @@ -197,8 +199,7 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, pdf_print_state_->output_path_ = path; pdf_print_state_->callback_ = callback; - FillInDictionaryFromPdfPrintSettings(settings, - ++next_pdf_request_id_, + FillInDictionaryFromPdfPrintSettings(settings, ++next_pdf_request_id_, pdf_print_state_->settings_); rfh->Send(new PrintMsg_InitiatePrintPreview(rfh->GetRoutingID(), @@ -233,8 +234,7 @@ bool CefPrintViewManager::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefPrintViewManager, message, render_frame_host) IPC_MESSAGE_HANDLER(PrintHostMsg_DidShowPrintDialog, OnDidShowPrintDialog) - IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, - OnRequestPrintPreview) + IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, OnRequestPrintPreview) IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, OnMetafileReadyForPrinting) IPC_MESSAGE_UNHANDLED(handled = false) @@ -244,8 +244,7 @@ bool CefPrintViewManager::OnMessageReceived( CefPrintViewManagerBase::OnMessageReceived(message, render_frame_host); } -void CefPrintViewManager::OnDidShowPrintDialog(content::RenderFrameHost* rfh) { -} +void CefPrintViewManager::OnDidShowPrintDialog(content::RenderFrameHost* rfh) {} void CefPrintViewManager::OnRequestPrintPreview( const PrintHostMsg_RequestPrintPreview_Params&) { @@ -253,9 +252,9 @@ void CefPrintViewManager::OnRequestPrintPreview( if (!pdf_print_state_) return; - pdf_print_state_->printing_rfh_->Send(new PrintMsg_PrintPreview( - pdf_print_state_->printing_rfh_->GetRoutingID(), - pdf_print_state_->settings_)); + pdf_print_state_->printing_rfh_->Send( + new PrintMsg_PrintPreview(pdf_print_state_->printing_rfh_->GetRoutingID(), + pdf_print_state_->settings_)); } void CefPrintViewManager::OnMetafileReadyForPrinting( @@ -280,8 +279,8 @@ void CefPrintViewManager::OnMetafileReadyForPrinting( pdf_print_state_.reset(); // Save the PDF file to disk and then execute the callback. - BrowserThread::PostTask(BrowserThread::FILE, - FROM_HERE, + BrowserThread::PostTask( + BrowserThread::FILE, FROM_HERE, base::Bind(&SavePdfFile, data_bytes, output_path, print_callback)); } @@ -292,9 +291,8 @@ void CefPrintViewManager::TerminatePdfPrintJob() { if (!pdf_print_state_->callback_.is_null()) { // Execute the callback. - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, - base::Bind(pdf_print_state_->callback_, false)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(pdf_print_state_->callback_, false)); } // Reset state information. diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index e586f63fb..062e70665 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -21,9 +21,9 @@ struct PrintHostMsg_RequestPrintPreview_Params; namespace printing { // Manages the print commands for a WebContents. -class CefPrintViewManager : - public CefPrintViewManagerBase, - public content::WebContentsUserData { +class CefPrintViewManager + : public CefPrintViewManagerBase, + public content::WebContentsUserData { public: ~CefPrintViewManager() override; diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index 21a604c7d..da2ce094f 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -104,13 +104,13 @@ base::string16 CefPrintViewManagerBase::RenderSourceName() { } void CefPrintViewManagerBase::OnDidGetPrintedPagesCount(int cookie, - int number_pages) { + int number_pages) { PrintManager::OnDidGetPrintedPagesCount(cookie, number_pages); OpportunisticallyCreatePrintJob(cookie); } void CefPrintViewManagerBase::OnDidPrintPage( - const PrintHostMsg_DidPrintPage_Params& params) { + const PrintHostMsg_DidPrintPage_Params& params) { if (!OpportunisticallyCreatePrintJob(params.document_cookie)) return; @@ -183,23 +183,20 @@ void CefPrintViewManagerBase::OnDidPrintPage( // Update : The missing letters seem to have been caused by the same // problem as https://crbug.com/659604 which was resolved. GDI printing // seems to work with the fix for this bug applied. - bool print_text_with_gdi = settings.print_text_with_gdi() && - !settings.printer_is_xps() && - base::FeatureList::IsEnabled( - features::kGdiTextPrinting); + bool print_text_with_gdi = + settings.print_text_with_gdi() && !settings.printer_is_xps() && + base::FeatureList::IsEnabled(features::kGdiTextPrinting); print_job_->StartPdfToEmfConversion( bytes, params.page_size, params.content_area, print_text_with_gdi); } } #else // Update the rendered document. It will send notifications to the listener. - document->SetPage(params.page_number, - std::move(metafile), + document->SetPage(params.page_number, std::move(metafile), #if defined(OS_WIN) 0.0f /* dummy shrink_factor */, #endif - params.page_size, - params.content_area); + params.page_size, params.content_area); ShouldQuitFromInnerMessageLoop(); #endif @@ -216,8 +213,7 @@ void CefPrintViewManagerBase::OnPrintingFailed(int cookie) { content::NotificationService::NoDetails()); } -void CefPrintViewManagerBase::OnShowInvalidPrinterSettingsError() { -} +void CefPrintViewManagerBase::OnShowInvalidPrinterSettingsError() {} void CefPrintViewManagerBase::DidStartLoading() { UpdatePrintingEnabled(); @@ -321,8 +317,7 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() { return false; // We can't print if there is no renderer. - if (!web_contents() || - !web_contents()->GetRenderViewHost() || + if (!web_contents() || !web_contents()->GetRenderViewHost() || !web_contents()->GetRenderViewHost()->IsRenderViewLive()) { return false; } @@ -355,8 +350,7 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() { void CefPrintViewManagerBase::ShouldQuitFromInnerMessageLoop() { // Look at the reason. DCHECK(print_job_->document()); - if (print_job_->document() && - print_job_->document()->IsComplete() && + if (print_job_->document() && print_job_->document()->IsComplete() && inside_inner_message_loop_) { // We are in a message loop created by RenderAllMissingPagesNow. Quit from // it. @@ -398,8 +392,7 @@ void CefPrintViewManagerBase::DisconnectFromCurrentPrintJob() { bool result = RenderAllMissingPagesNow(); // Verify that assertion. - if (print_job_.get() && - print_job_->document() && + if (print_job_.get() && print_job_->document() && !print_job_->document()->IsComplete()) { DCHECK(!result); // That failed. @@ -549,9 +542,8 @@ void CefPrintViewManagerBase::ReleasePrinterQuery() { printer_query = queue_->PopPrinterQuery(cookie); if (!printer_query.get()) return; - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&PrinterQuery::StopWorker, printer_query)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::Bind(&PrinterQuery::StopWorker, printer_query)); } void CefPrintViewManagerBase::SendPrintingEnabled( diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index d315b41e5..16fe8c0dd 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -52,15 +52,14 @@ class ShutdownNotifierFactory ShutdownNotifierFactory() : BrowserContextKeyedServiceShutdownNotifierFactory( - "CefPrintingMessageFilter") { - } + "CefPrintingMessageFilter") {} ~ShutdownNotifierFactory() override {} DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; -base::LazyInstance::Leaky - g_shutdown_notifier_factory = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance::Leaky g_shutdown_notifier_factory = + LAZY_INSTANCE_INITIALIZER; // static ShutdownNotifierFactory* ShutdownNotifierFactory::GetInstance() { @@ -100,7 +99,8 @@ void CefPrintingMessageFilter::ShutdownOnUIThread() { } void CefPrintingMessageFilter::OverrideThreadForMessage( - const IPC::Message& message, BrowserThread::ID* thread) { + const IPC::Message& message, + BrowserThread::ID* thread) { #if defined(OS_ANDROID) if (message.type() == PrintHostMsg_AllocateTempFileForPrinting::ID || message.type() == PrintHostMsg_TempFileForPrintingWritten::ID) { @@ -235,7 +235,8 @@ void CefPrintingMessageFilter::OnScriptedPrintReply( } void CefPrintingMessageFilter::OnUpdatePrintSettings( - int document_cookie, const base::DictionaryValue& job_settings, + int document_cookie, + const base::DictionaryValue& job_settings, IPC::Message* reply_msg) { std::unique_ptr new_settings(job_settings.DeepCopy()); diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index f7a59b43e..e9fb4b9c9 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -2,12 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/browser/request_context_impl.h" #include "libcef/browser/browser_context_impl.h" #include "libcef/browser/browser_context_proxy.h" #include "libcef/browser/content_browser_client.h" #include "libcef/browser/context.h" #include "libcef/browser/cookie_manager_impl.h" +#include "libcef/browser/request_context_impl.h" #include "libcef/browser/thread_util.h" #include "libcef/common/values_impl.h" @@ -53,8 +53,7 @@ const char* GetTypeString(base::Value::Type type) { // Helper for HostResolver::Resolve. struct ResolveHostHelper { explicit ResolveHostHelper(CefRefPtr callback) - : callback_(callback) { - } + : callback_(callback) {} void OnResolveCompleted(int result) { std::vector resolved_ips; @@ -63,7 +62,8 @@ struct ResolveHostHelper { for (; iter != address_list_.end(); ++iter) resolved_ips.push_back(iter->ToStringWithoutPort()); - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefResolveCallback::OnResolveCompleted, callback_, static_cast(result), resolved_ips)); @@ -77,7 +77,6 @@ struct ResolveHostHelper { } // namespace - // CefBrowserContext // static @@ -130,7 +129,6 @@ CefRefPtr CefRequestContext::CreateContext( return CefRequestContextImpl::GetOrCreateRequestContext(config); } - // CefRequestContextImpl CefRequestContextImpl::~CefRequestContextImpl() { @@ -161,12 +159,12 @@ CefRequestContextImpl::CreateGlobalRequestContext( // static CefRefPtr CefRequestContextImpl::GetOrCreateForRequestContext( - CefRefPtr request_context) { - if (request_context.get()) { + CefRefPtr request_context) { + if (request_context.get()) { // Use the context from the provided CefRequestContext. return static_cast(request_context.get()); } - + // Use the global context. Config config; config.is_global = true; @@ -257,7 +255,8 @@ bool CefRequestContextImpl::IsSharingWith(CefRefPtr other) { return pending_other->IsSharingWith(this); } - if (request_context_getter_impl_ && other_impl->request_context_getter_impl_) { + if (request_context_getter_impl_ && + other_impl->request_context_getter_impl_) { // Both objects are initialized. Compare the request context objects. return (request_context_getter_impl_ == other_impl->request_context_getter_impl_); @@ -267,9 +266,9 @@ bool CefRequestContextImpl::IsSharingWith(CefRefPtr other) { // If both are non-empty and the same then they'll share the same storage. if (config_.settings.cache_path.length > 0 && other_impl->config_.settings.cache_path.length > 0) { - return (base::FilePath(CefString(&config_.settings.cache_path)) == - base::FilePath( - CefString(&other_impl->config_.settings.cache_path))); + return ( + base::FilePath(CefString(&config_.settings.cache_path)) == + base::FilePath(CefString(&other_impl->config_.settings.cache_path))); } return false; @@ -316,8 +315,8 @@ bool CefRequestContextImpl::ClearSchemeHandlerFactories() { void CefRequestContextImpl::PurgePluginListCache(bool reload_pages) { GetBrowserContext( BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), - base::Bind(&CefRequestContextImpl::PurgePluginListCacheInternal, - this, reload_pages)); + base::Bind(&CefRequestContextImpl::PurgePluginListCacheInternal, this, + reload_pages)); } bool CefRequestContextImpl::HasPreference(const CefString& name) { @@ -518,8 +517,7 @@ CefRequestContextImpl::GetOrCreateRequestContext(const Config& config) { CefRequestContextImpl::CefRequestContextImpl( const CefRequestContextImpl::Config& config) - : config_(config) { -} + : config_(config) {} void CefRequestContextImpl::Initialize() { CEF_REQUIRE_UIT(); @@ -562,9 +560,8 @@ void CefRequestContextImpl::Initialize() { if (config_.handler.get()) { // Use a proxy that will execute handler callbacks where appropriate and // otherwise forward all requests to |browser_context_impl_|. - browser_context_proxy_.reset( - new CefBrowserContextProxy(this, config_.handler, - browser_context_impl_)); + browser_context_proxy_.reset(new CefBrowserContextProxy( + this, config_.handler, browser_context_impl_)); browser_context_proxy_->Initialize(); DCHECK(!config_.is_global); } @@ -598,9 +595,9 @@ void CefRequestContextImpl::GetBrowserContextOnUIThread( scoped_refptr task_runner, const BrowserContextCallback& callback) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefRequestContextImpl::GetBrowserContextOnUIThread, - this, task_runner, callback)); + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefRequestContextImpl::GetBrowserContextOnUIThread, + this, task_runner, callback)); return; } @@ -621,7 +618,8 @@ void CefRequestContextImpl::GetRequestContextImplOnIOThread( const RequestContextCallback& callback, CefBrowserContext* browser_context) { if (!CEF_CURRENTLY_ON_IOT()) { - CEF_POST_TASK(CEF_IOT, + CEF_POST_TASK( + CEF_IOT, base::Bind(&CefRequestContextImpl::GetRequestContextImplOnIOThread, this, task_runner, callback, browser_context)); return; @@ -637,7 +635,8 @@ void CefRequestContextImpl::GetRequestContextImplOnIOThread( callback.Run(request_context_getter_impl_); } else { // Execute the callback on the target thread. - task_runner->PostTask(FROM_HERE, + task_runner->PostTask( + FROM_HERE, base::Bind(callback, make_scoped_refptr(request_context_getter_impl_))); } } @@ -663,8 +662,8 @@ void CefRequestContextImpl::PurgePluginListCacheInternal( CefBrowserContext* browser_context) { CEF_REQUIRE_UIT(); browser_context->OnPurgePluginListCache(); - content::PluginService::GetInstance()->PurgePluginListCache( - browser_context, false); + content::PluginService::GetInstance()->PurgePluginListCache(browser_context, + false); } void CefRequestContextImpl::ClearCertificateExceptionsInternal( @@ -679,7 +678,7 @@ void CefRequestContextImpl::ClearCertificateExceptionsInternal( if (callback) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefCompletionCallback::OnComplete, callback)); + base::Bind(&CefCompletionCallback::OnComplete, callback)); } } @@ -701,7 +700,7 @@ void CefRequestContextImpl::CloseAllConnectionsInternal( if (callback) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefCompletionCallback::OnComplete, callback)); + base::Bind(&CefCompletionCallback::OnComplete, callback)); } } @@ -721,8 +720,7 @@ void CefRequestContextImpl::ResolveHostInternal( net::HostResolver::RequestInfo request_info( net::HostPortPair::FromURL(GURL(origin.ToString()))); retval = host_resolver->Resolve( - request_info, net::DEFAULT_PRIORITY, - &helper->address_list_, + request_info, net::DEFAULT_PRIORITY, &helper->address_list_, base::Bind(&ResolveHostHelper::OnResolveCompleted, base::Unretained(helper)), &helper->request_, net::NetLogWithSource()); @@ -740,4 +738,3 @@ CefBrowserContext* CefRequestContextImpl::browser_context() const { return browser_context_proxy_.get(); return browser_context_impl_; } - diff --git a/libcef/browser/request_context_impl.h b/libcef/browser/request_context_impl.h index 3cfd069a3..507862bb1 100644 --- a/libcef/browser/request_context_impl.h +++ b/libcef/browser/request_context_impl.h @@ -75,9 +75,8 @@ class CefRequestContextImpl : public CefRequestContext { void ClearCertificateExceptions( CefRefPtr callback) override; void CloseAllConnections(CefRefPtr callback) override; - void ResolveHost( - const CefString& origin, - CefRefPtr callback) override; + void ResolveHost(const CefString& origin, + CefRefPtr callback) override; cef_errorcode_t ResolveHostCached( const CefString& origin, std::vector& resolved_ips) override; @@ -133,9 +132,8 @@ class CefRequestContextImpl : public CefRequestContext { scoped_refptr request_context); void ClearSchemeHandlerFactoriesInternal( scoped_refptr request_context); - void PurgePluginListCacheInternal( - bool reload_pages, - CefBrowserContext* browser_context); + void PurgePluginListCacheInternal(bool reload_pages, + CefBrowserContext* browser_context); void ClearCertificateExceptionsInternal( CefRefPtr callback, CefBrowserContext* browser_context); diff --git a/libcef/browser/resource_context.cc b/libcef/browser/resource_context.cc index 328a37035..3728995ce 100644 --- a/libcef/browser/resource_context.cc +++ b/libcef/browser/resource_context.cc @@ -40,14 +40,12 @@ CefResourceContext::CefResourceContext( CefRefPtr handler) : parent_(nullptr), is_off_the_record_(is_off_the_record), - handler_(handler) { -} + handler_(handler) {} -CefResourceContext::~CefResourceContext() { -} +CefResourceContext::~CefResourceContext() {} -base::SupportsUserData::Data* CefResourceContext::GetUserData(const void* key) - const { +base::SupportsUserData::Data* CefResourceContext::GetUserData( + const void* key) const { if (parent_ && ShouldProxyUserData(key)) return parent_->GetUserData(key); return content::ResourceContext::GetUserData(key); @@ -86,7 +84,7 @@ net::URLRequestContext* CefResourceContext::GetRequestContext() { } std::unique_ptr - CefResourceContext::CreateClientCertStore() { +CefResourceContext::CreateClientCertStore() { #if defined(USE_NSS_CERTS) return std::unique_ptr(new net::ClientCertStoreNSS( net::ClientCertStoreNSS::PasswordDelegateFactory())); @@ -132,11 +130,10 @@ void CefResourceContext::AddPluginLoadDecision( DCHECK_GE(render_process_id, 0); DCHECK(!plugin_path.empty()); - plugin_load_decision_map_.insert( - std::make_pair( - std::make_pair(std::make_pair(render_process_id, plugin_path), - std::make_pair(is_main_frame, main_frame_origin)), - status)); + plugin_load_decision_map_.insert(std::make_pair( + std::make_pair(std::make_pair(render_process_id, plugin_path), + std::make_pair(is_main_frame, main_frame_origin)), + status)); } bool CefResourceContext::HasPluginLoadDecision( @@ -149,10 +146,9 @@ bool CefResourceContext::HasPluginLoadDecision( DCHECK_GE(render_process_id, 0); DCHECK(!plugin_path.empty()); - PluginLoadDecisionMap::const_iterator it = - plugin_load_decision_map_.find( - std::make_pair(std::make_pair(render_process_id, plugin_path), - std::make_pair(is_main_frame, main_frame_origin))); + PluginLoadDecisionMap::const_iterator it = plugin_load_decision_map_.find( + std::make_pair(std::make_pair(render_process_id, plugin_path), + std::make_pair(is_main_frame, main_frame_origin))); if (it == plugin_load_decision_map_.end()) return false; diff --git a/libcef/browser/resource_context.h b/libcef/browser/resource_context.h index a4c0ea8cd..d00668387 100644 --- a/libcef/browser/resource_context.h +++ b/libcef/browser/resource_context.h @@ -86,9 +86,9 @@ class CefResourceContext : public content::ResourceContext { // Map (render_process_id, plugin_path, is_main_frame, main_frame_origin) to // plugin load decision. - typedef std::map, - std::pair>, - CefViewHostMsg_GetPluginInfo_Status> + typedef std::map< + std::pair, std::pair>, + CefViewHostMsg_GetPluginInfo_Status> PluginLoadDecisionMap; PluginLoadDecisionMap plugin_load_decision_map_; diff --git a/libcef/browser/resource_dispatcher_host_delegate.cc b/libcef/browser/resource_dispatcher_host_delegate.cc index d207fa80f..99972a1ea 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.cc +++ b/libcef/browser/resource_dispatcher_host_delegate.cc @@ -75,20 +75,19 @@ void SendExecuteMimeTypeHandlerEvent( } // namespace -CefResourceDispatcherHostDelegate::CefResourceDispatcherHostDelegate() { -} +CefResourceDispatcherHostDelegate::CefResourceDispatcherHostDelegate() {} -CefResourceDispatcherHostDelegate::~CefResourceDispatcherHostDelegate() { -} +CefResourceDispatcherHostDelegate::~CefResourceDispatcherHostDelegate() {} bool CefResourceDispatcherHostDelegate::HandleExternalProtocol( const GURL& url, content::ResourceRequestInfo* info) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate:: - HandleExternalProtocolOnUIThread), - base::Unretained(this), url, - info->GetWebContentsGetterForRequest())); + HandleExternalProtocolOnUIThread), + base::Unretained(this), url, + info->GetWebContentsGetterForRequest())); return false; } @@ -119,9 +118,8 @@ bool CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream( extension_info_map->extensions().GetByID(extension_id); // The white-listed extension may not be installed, so we have to NULL check // |extension|. - if (!extension || - (profile_is_off_the_record && - !extension_info_map->IsIncognitoEnabled(extension_id))) { + if (!extension || (profile_is_off_the_record && + !extension_info_map->IsIncognitoEnabled(extension_id))) { continue; } @@ -170,7 +168,8 @@ void CefResourceDispatcherHostDelegate::OnStreamCreated( stream_target_info_.find(request); CHECK(ix != stream_target_info_.end()); bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME; - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream), request->GetExpectedContentSize(), ix->second.extension_id, ix->second.view_id, embedded, info->GetFrameTreeNodeId(), @@ -191,17 +190,18 @@ void CefResourceDispatcherHostDelegate::OnRequestRedirected( response->head.headers = new net::HttpResponseHeaders(std::string()); // Add CORS headers to support XMLHttpRequest redirects. - response->head.headers->AddHeader("Access-Control-Allow-Origin: " + - active_url.scheme() + "://" + active_url.host()); + response->head.headers->AddHeader( + "Access-Control-Allow-Origin: " + active_url.scheme() + "://" + + active_url.host()); response->head.headers->AddHeader("Access-Control-Allow-Credentials: true"); } } std::unique_ptr - CefResourceDispatcherHostDelegate::CreateClientCertStore( - content::ResourceContext* resource_context) { - return static_cast(resource_context)-> - CreateClientCertStore(); +CefResourceDispatcherHostDelegate::CreateClientCertStore( + content::ResourceContext* resource_context) { + return static_cast(resource_context) + ->CreateClientCertStore(); } void CefResourceDispatcherHostDelegate::HandleExternalProtocolOnUIThread( diff --git a/libcef/browser/resource_dispatcher_host_delegate.h b/libcef/browser/resource_dispatcher_host_delegate.h index fbbca4b54..25cda504b 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.h +++ b/libcef/browser/resource_dispatcher_host_delegate.h @@ -21,9 +21,8 @@ class CefResourceDispatcherHostDelegate ~CefResourceDispatcherHostDelegate() override; // ResourceDispatcherHostDelegate methods. - bool HandleExternalProtocol( - const GURL& url, - content::ResourceRequestInfo* info) override; + bool HandleExternalProtocol(const GURL& url, + content::ResourceRequestInfo* info) override; bool ShouldInterceptResourceAsStream(net::URLRequest* request, const base::FilePath& plugin_path, const std::string& mime_type, @@ -31,11 +30,10 @@ class CefResourceDispatcherHostDelegate std::string* payload) override; void OnStreamCreated(net::URLRequest* request, std::unique_ptr stream) override; - void OnRequestRedirected( - const GURL& redirect_url, - net::URLRequest* request, - content::ResourceContext* resource_context, - content::ResourceResponse* response) override; + void OnRequestRedirected(const GURL& redirect_url, + net::URLRequest* request, + content::ResourceContext* resource_context, + content::ResourceResponse* response) override; std::unique_ptr CreateClientCertStore( content::ResourceContext* resource_context) override; @@ -43,7 +41,7 @@ class CefResourceDispatcherHostDelegate void HandleExternalProtocolOnUIThread( const GURL& url, const content::ResourceRequestInfo::WebContentsGetter& - web_contents_getter); + web_contents_getter); struct StreamTargetInfo { std::string extension_id; diff --git a/libcef/browser/scheme_impl.cc b/libcef/browser/scheme_impl.cc index b63769f01..f5423c059 100644 --- a/libcef/browser/scheme_impl.cc +++ b/libcef/browser/scheme_impl.cc @@ -17,8 +17,8 @@ bool CefRegisterSchemeHandlerFactory( return false; } - return CefRequestContext::GetGlobalContext()-> - RegisterSchemeHandlerFactory(scheme_name, domain_name, factory); + return CefRequestContext::GetGlobalContext()->RegisterSchemeHandlerFactory( + scheme_name, domain_name, factory); } bool CefClearSchemeHandlerFactories() { @@ -28,6 +28,5 @@ bool CefClearSchemeHandlerFactories() { return false; } - return CefRequestContext::GetGlobalContext()-> - ClearSchemeHandlerFactories(); + return CefRequestContext::GetGlobalContext()->ClearSchemeHandlerFactories(); } diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 06bbf6dc4..2ea3ddd7e 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -41,24 +41,24 @@ class CefSpeechRecognitionManagerDelegate::WebContentsWatcher WebContentsClosedCallback; WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback, - BrowserThread::ID callback_thread) + BrowserThread::ID callback_thread) : web_contents_closed_callback_(web_contents_closed_callback), - callback_thread_(callback_thread) { - } + callback_thread_(callback_thread) {} // Starts monitoring the WebContents corresponding to the given // |render_process_id|, |render_view_id| pair, invoking // |web_contents_closed_callback_| if closed/unloaded. void Watch(int render_process_id, int render_view_id) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( - &WebContentsWatcher::Watch, this, render_process_id, render_view_id)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(&WebContentsWatcher::Watch, this, + render_process_id, render_view_id)); return; } WebContents* web_contents = NULL; content::RenderViewHost* render_view_host = - content::RenderViewHost::FromID(render_process_id, render_view_id); + content::RenderViewHost::FromID(render_process_id, render_view_id); if (render_view_host) web_contents = WebContents::FromRenderViewHost(render_view_host); DCHECK(web_contents); @@ -74,8 +74,7 @@ class CefSpeechRecognitionManagerDelegate::WebContentsWatcher if (!registrar_.get()) registrar_.reset(new content::NotificationRegistrar()); - registrar_->Add(this, - content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, + registrar_->Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, content::Source(web_contents)); } @@ -90,13 +89,13 @@ class CefSpeechRecognitionManagerDelegate::WebContentsWatcher int render_process_id = web_contents->GetRenderProcessHost()->GetID(); int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); - registrar_->Remove(this, - content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, + registrar_->Remove(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, content::Source(web_contents)); registered_web_contents_.erase(web_contents); - BrowserThread::PostTask(callback_thread_, FROM_HERE, base::Bind( - web_contents_closed_callback_, render_process_id, render_view_id)); + BrowserThread::PostTask(callback_thread_, FROM_HERE, + base::Bind(web_contents_closed_callback_, + render_process_id, render_view_id)); } private: @@ -123,20 +122,18 @@ class CefSpeechRecognitionManagerDelegate::WebContentsWatcher DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher); }; -CefSpeechRecognitionManagerDelegate -::CefSpeechRecognitionManagerDelegate() { +CefSpeechRecognitionManagerDelegate ::CefSpeechRecognitionManagerDelegate() { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); filter_profanities_ = command_line->HasSwitch(switches::kEnableProfanityFilter); } -CefSpeechRecognitionManagerDelegate -::~CefSpeechRecognitionManagerDelegate() { -} +CefSpeechRecognitionManagerDelegate ::~CefSpeechRecognitionManagerDelegate() {} void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback( - int render_process_id, int render_view_id) { + int render_process_id, + int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance(); @@ -149,8 +146,7 @@ void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback( manager->AbortAllSessionsForRenderView(render_process_id, render_view_id); } -void CefSpeechRecognitionManagerDelegate::OnRecognitionStart( - int session_id) { +void CefSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) { const content::SpeechRecognitionSessionContext& context = SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); @@ -167,36 +163,31 @@ void CefSpeechRecognitionManagerDelegate::OnRecognitionStart( context.render_view_id); } -void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) { -} +void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {} void CefSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete( - int session_id) { -} + int session_id) {} -void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) { -} +void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {} -void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) { -} +void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {} -void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) { -} +void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {} void CefSpeechRecognitionManagerDelegate::OnRecognitionResults( - int session_id, const content::SpeechRecognitionResults& result) { -} + int session_id, + const content::SpeechRecognitionResults& result) {} void CefSpeechRecognitionManagerDelegate::OnRecognitionError( - int session_id, const content::SpeechRecognitionError& error) { -} + int session_id, + const content::SpeechRecognitionError& error) {} void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange( - int session_id, float volume, float noise_volume) { -} + int session_id, + float volume, + float noise_volume) {} -void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) { -} +void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {} void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( int session_id, diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index b8b0bdb0e..5b4ed330b 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -10,7 +10,6 @@ #include "content/public/browser/speech_recognition_event_listener.h" #include "content/public/browser/speech_recognition_manager_delegate.h" - // This is CEF's implementation of the SpeechRecognitionManagerDelegate // interface. Based on chrome/browser/speech/ // chrome_speech_recognition_manager_delegate.[cc|h] @@ -31,10 +30,13 @@ class CefSpeechRecognitionManagerDelegate void OnAudioEnd(int session_id) override; void OnRecognitionEnd(int session_id) override; void OnRecognitionResults( - int session_id, const content::SpeechRecognitionResults& result) override; + int session_id, + const content::SpeechRecognitionResults& result) override; void OnRecognitionError( - int session_id, const content::SpeechRecognitionError& error) override; - void OnAudioLevelsChange(int session_id, float volume, + int session_id, + const content::SpeechRecognitionError& error) override; + void OnAudioLevelsChange(int session_id, + float volume, float noise_volume) override; // SpeechRecognitionManagerDelegate methods. diff --git a/libcef/browser/ssl_host_state_delegate.cc b/libcef/browser/ssl_host_state_delegate.cc index 5f44a2d65..f51c42a5a 100644 --- a/libcef/browser/ssl_host_state_delegate.cc +++ b/libcef/browser/ssl_host_state_delegate.cc @@ -18,10 +18,8 @@ net::SHA256HashValue getChainFingerprint256(const net::X509Certificate& cert) { return fingerprint; } -CertPolicy::CertPolicy() { -} -CertPolicy::~CertPolicy() { -} +CertPolicy::CertPolicy() {} +CertPolicy::~CertPolicy() {} // For an allowance, we consider a given |cert| to be a match to a saved // allowed cert if the |error| is an exact match to or subset of the errors @@ -49,11 +47,9 @@ void CertPolicy::Allow(const net::X509Certificate& cert, } // namespace internal -CefSSLHostStateDelegate::CefSSLHostStateDelegate() { -} +CefSSLHostStateDelegate::CefSSLHostStateDelegate() {} -CefSSLHostStateDelegate::~CefSSLHostStateDelegate() { -} +CefSSLHostStateDelegate::~CefSSLHostStateDelegate() {} void CefSSLHostStateDelegate::HostRanInsecureContent( const std::string& host, diff --git a/libcef/browser/storage_partition_proxy.cc b/libcef/browser/storage_partition_proxy.cc index 6cbcbb007..7c6010e3d 100644 --- a/libcef/browser/storage_partition_proxy.cc +++ b/libcef/browser/storage_partition_proxy.cc @@ -7,9 +7,7 @@ CefStoragePartitionProxy::CefStoragePartitionProxy( content::StoragePartition* parent, CefURLRequestContextGetterProxy* url_request_context) - : parent_(parent), - url_request_context_(url_request_context) { -} + : parent_(parent), url_request_context_(url_request_context) {} CefStoragePartitionProxy::~CefStoragePartitionProxy() { url_request_context_->ShutdownOnUIThread(); @@ -159,4 +157,3 @@ void CefStoragePartitionProxy::Bind( mojo::InterfaceRequest request) { parent_->Bind(std::move(request)); } - diff --git a/libcef/browser/storage_partition_proxy.h b/libcef/browser/storage_partition_proxy.h index bf030afb9..01d7f903b 100644 --- a/libcef/browser/storage_partition_proxy.h +++ b/libcef/browser/storage_partition_proxy.h @@ -68,9 +68,8 @@ class CefStoragePartitionProxy : public content::StoragePartition { const base::Closure& callback) override; void Flush() override; void ClearBluetoothAllowedDevicesMapForTesting() override; - void Bind( - mojo::InterfaceRequest request) - override; + void Bind(mojo::InterfaceRequest + request) override; content::StoragePartition* parent() const { return parent_; } diff --git a/libcef/browser/stream_impl.cc b/libcef/browser/stream_impl.cc index 6d30aec0c..3216bd013 100644 --- a/libcef/browser/stream_impl.cc +++ b/libcef/browser/stream_impl.cc @@ -2,11 +2,11 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/browser/stream_impl.h" #include #include "base/files/file_util.h" #include "base/logging.h" #include "base/threading/thread_restrictions.h" +#include "libcef/browser/stream_impl.h" // Static functions @@ -27,7 +27,7 @@ CefRefPtr CefStreamReader::CreateForFile( CefRefPtr CefStreamReader::CreateForData(void* data, size_t size) { DCHECK(data != NULL); - DCHECK(size > 0); // NOLINT(readability/check) + DCHECK(size > 0); CefRefPtr reader; if (data && size > 0) reader = new CefBytesReader(data, size, true); @@ -66,12 +66,10 @@ CefRefPtr CefStreamWriter::CreateForHandler( return writer; } - // CefFileReader CefFileReader::CefFileReader(FILE* file, bool close) - : close_(close), file_(file) { -} + : close_(close), file_(file) {} CefFileReader::~CefFileReader() { base::AutoLock lock_scope(lock_); @@ -107,13 +105,10 @@ int CefFileReader::Eof() { return feof(file_); } - // CefFileWriter CefFileWriter::CefFileWriter(FILE* file, bool close) - : file_(file), - close_(close) { -} + : file_(file), close_(close) {} CefFileWriter::~CefFileWriter() { base::AutoLock lock_scope(lock_); @@ -141,14 +136,10 @@ int CefFileWriter::Flush() { return fflush(file_); } - // CefBytesReader CefBytesReader::CefBytesReader(void* data, int64 datasize, bool copy) - : data_(NULL), - datasize_(0), - copy_(false), - offset_(0) { + : data_(NULL), datasize_(0), copy_(false), offset_(0) { SetData(data, datasize, copy); } @@ -169,26 +160,26 @@ int CefBytesReader::Seek(int64 offset, int whence) { int rv = -1L; base::AutoLock lock_scope(lock_); switch (whence) { - case SEEK_CUR: - if (offset_ + offset > datasize_ || offset_ + offset < 0) + case SEEK_CUR: + if (offset_ + offset > datasize_ || offset_ + offset < 0) + break; + offset_ += offset; + rv = 0; break; - offset_ += offset; - rv = 0; - break; - case SEEK_END: { - int64 offset_abs = std::abs(offset); - if (offset_abs > datasize_) + case SEEK_END: { + int64 offset_abs = std::abs(offset); + if (offset_abs > datasize_) + break; + offset_ = datasize_ - offset_abs; + rv = 0; break; - offset_ = datasize_ - offset_abs; - rv = 0; - break; - } - case SEEK_SET: - if (offset > datasize_ || offset < 0) + } + case SEEK_SET: + if (offset > datasize_ || offset < 0) + break; + offset_ = offset; + rv = 0; break; - offset_ = offset; - rv = 0; - break; } return rv; @@ -223,14 +214,11 @@ void CefBytesReader::SetData(void* data, int64 datasize, bool copy) { } } - // CefBytesWriter CefBytesWriter::CefBytesWriter(size_t grow) - : grow_(grow), - datasize_(grow), - offset_(0) { - DCHECK(grow > 0); // NOLINT(readability/check) + : grow_(grow), datasize_(grow), offset_(0) { + DCHECK(grow > 0); data_ = malloc(grow); DCHECK(data_ != NULL); } @@ -260,26 +248,26 @@ int CefBytesWriter::Seek(int64 offset, int whence) { int rv = -1L; base::AutoLock lock_scope(lock_); switch (whence) { - case SEEK_CUR: - if (offset_ + offset > datasize_ || offset_ + offset < 0) + case SEEK_CUR: + if (offset_ + offset > datasize_ || offset_ + offset < 0) + break; + offset_ += offset; + rv = 0; break; - offset_ += offset; - rv = 0; - break; - case SEEK_END: { - int64 offset_abs = std::abs(offset); - if (offset_abs > datasize_) + case SEEK_END: { + int64 offset_abs = std::abs(offset); + if (offset_abs > datasize_) + break; + offset_ = datasize_ - offset_abs; + rv = 0; break; - offset_ = datasize_ - offset_abs; - rv = 0; - break; - } - case SEEK_SET: - if (offset > datasize_ || offset < 0) + } + case SEEK_SET: + if (offset > datasize_ || offset < 0) + break; + offset_ = offset; + rv = 0; break; - offset_ = offset; - rv = 0; - break; } return rv; diff --git a/libcef/browser/stream_impl.h b/libcef/browser/stream_impl.h index 0d5a97673..dde3d6027 100644 --- a/libcef/browser/stream_impl.h +++ b/libcef/browser/stream_impl.h @@ -124,15 +124,9 @@ class CefHandlerReader : public CefStreamReader { int Seek(int64 offset, int whence) override { return handler_->Seek(offset, whence); } - int64 Tell() override { - return handler_->Tell(); - } - int Eof() override { - return handler_->Eof(); - } - bool MayBlock() override { - return handler_->MayBlock(); - } + int64 Tell() override { return handler_->Tell(); } + int Eof() override { return handler_->Eof(); } + bool MayBlock() override { return handler_->MayBlock(); } protected: CefRefPtr handler_; @@ -152,15 +146,9 @@ class CefHandlerWriter : public CefStreamWriter { int Seek(int64 offset, int whence) override { return handler_->Seek(offset, whence); } - int64 Tell() override { - return handler_->Tell(); - } - int Flush() override { - return handler_->Flush(); - } - bool MayBlock() override { - return handler_->MayBlock(); - } + int64 Tell() override { return handler_->Tell(); } + int Flush() override { return handler_->Flush(); } + bool MayBlock() override { return handler_->MayBlock(); } protected: CefRefPtr handler_; diff --git a/libcef/browser/thread_util.h b/libcef/browser/thread_util.h index 49bc0bf8b..e3deeb761 100644 --- a/libcef/browser/thread_util.h +++ b/libcef/browser/thread_util.h @@ -24,53 +24,48 @@ #define CEF_REQUIRE_IOT() CEF_REQUIRE(CEF_IOT) #define CEF_REQUIRE_FILET() CEF_REQUIRE(CEF_FILET) -#define CEF_REQUIRE_RETURN(id, var) \ - if (!CEF_CURRENTLY_ON(id)) { \ +#define CEF_REQUIRE_RETURN(id, var) \ + if (!CEF_CURRENTLY_ON(id)) { \ NOTREACHED() << "called on invalid thread"; \ - return var; \ + return var; \ } #define CEF_REQUIRE_UIT_RETURN(var) CEF_REQUIRE_RETURN(CEF_UIT, var) #define CEF_REQUIRE_IOT_RETURN(var) CEF_REQUIRE_RETURN(CEF_IOT, var) -#define CEF_REQUIRE_RETURN_VOID(id) \ - if (!CEF_CURRENTLY_ON(id)) { \ +#define CEF_REQUIRE_RETURN_VOID(id) \ + if (!CEF_CURRENTLY_ON(id)) { \ NOTREACHED() << "called on invalid thread"; \ - return; \ + return; \ } #define CEF_REQUIRE_UIT_RETURN_VOID() CEF_REQUIRE_RETURN_VOID(CEF_UIT) #define CEF_REQUIRE_IOT_RETURN_VOID() CEF_REQUIRE_RETURN_VOID(CEF_IOT) #define CEF_POST_TASK(id, task) \ - content::BrowserThread::PostTask(id, FROM_HERE, task) + content::BrowserThread::PostTask(id, FROM_HERE, task) #define CEF_POST_DELAYED_TASK(id, task, delay_ms) \ - content::BrowserThread::PostDelayedTask(id, FROM_HERE, task, \ - base::TimeDelta::FromMilliseconds(delay_ms)) + content::BrowserThread::PostDelayedTask( \ + id, FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms)) // Same as IMPLEMENT_REFCOUNTING() but using the specified Destructor. -#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \ - public: \ - void AddRef() const OVERRIDE { \ - ref_count_.AddRef(); \ - } \ - bool Release() const OVERRIDE { \ - if (ref_count_.Release()) { \ - Destructor::Destruct(this); \ - return true; \ - } \ - return false; \ - } \ - bool HasOneRef() const OVERRIDE { \ - return ref_count_.HasOneRef(); \ - } \ - private: \ - CefRefCount ref_count_; +#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \ + public: \ + void AddRef() const OVERRIDE { ref_count_.AddRef(); } \ + bool Release() const OVERRIDE { \ + if (ref_count_.Release()) { \ + Destructor::Destruct(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const OVERRIDE { return ref_count_.HasOneRef(); } \ + \ + private: \ + CefRefCount ref_count_; -#define IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ClassName) \ - IMPLEMENT_REFCOUNTING_EX(ClassName, \ - content::BrowserThread::DeleteOnUIThread) +#define IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ClassName) \ + IMPLEMENT_REFCOUNTING_EX(ClassName, content::BrowserThread::DeleteOnUIThread) -#define IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(ClassName) \ - IMPLEMENT_REFCOUNTING_EX(ClassName, \ - content::BrowserThread::DeleteOnIOThread) +#define IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(ClassName) \ + IMPLEMENT_REFCOUNTING_EX(ClassName, content::BrowserThread::DeleteOnIOThread) #endif // CEF_LIBCEF_BROWSER_THREAD_UTIL_H_ diff --git a/libcef/browser/trace_impl.cc b/libcef/browser/trace_impl.cc index 92c40a76e..6fdab14d6 100644 --- a/libcef/browser/trace_impl.cc +++ b/libcef/browser/trace_impl.cc @@ -3,9 +3,9 @@ // be found in the LICENSE file. #include "include/cef_trace.h" -#include "libcef/browser/trace_subscriber.h" #include "libcef/browser/context.h" #include "libcef/browser/thread_util.h" +#include "libcef/browser/trace_subscriber.h" #include "base/time/time.h" diff --git a/libcef/browser/trace_subscriber.cc b/libcef/browser/trace_subscriber.cc index 47dd4a84d..4a24b69e8 100644 --- a/libcef/browser/trace_subscriber.cc +++ b/libcef/browser/trace_subscriber.cc @@ -2,9 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "libcef/browser/trace_subscriber.h" #include "include/cef_trace.h" #include "libcef/browser/thread_util.h" +#include "libcef/browser/trace_subscriber.h" #include "base/files/file_util.h" #include "base/threading/thread_task_runner_handle.h" @@ -14,7 +14,7 @@ namespace { // Create the temporary file and then execute |callback| on the thread -// represented by |message_loop_proxy|. +// represented by |message_loop_proxy|. void CreateTemporaryFileOnFileThread( scoped_refptr message_loop_proxy, base::Callback callback) { @@ -30,8 +30,7 @@ class CefCompletionCallbackWrapper : public CefCompletionCallback { public: explicit CefCompletionCallbackWrapper( CefRefPtr callback) - : callback_(callback) { - } + : callback_(callback) {} void OnComplete() override { if (callback_) { @@ -52,8 +51,7 @@ class CefCompletionCallbackWrapper : public CefCompletionCallback { using content::TracingController; CefTraceSubscriber::CefTraceSubscriber() - : collecting_trace_data_(false), - weak_factory_(this) { + : collecting_trace_data_(false), weak_factory_(this) { CEF_REQUIRE_UIT(); } @@ -83,14 +81,12 @@ bool CefTraceSubscriber::BeginTracing( } TracingController::GetInstance()->StartTracing( - base::trace_event::TraceConfig(categories, ""), - done_callback); + base::trace_event::TraceConfig(categories, ""), done_callback); return true; } -bool CefTraceSubscriber::EndTracing( - const base::FilePath& tracing_file, - CefRefPtr callback) { +bool CefTraceSubscriber::EndTracing(const base::FilePath& tracing_file, + CefRefPtr callback) { CEF_REQUIRE_UIT(); if (!collecting_trace_data_) @@ -106,10 +102,10 @@ bool CefTraceSubscriber::EndTracing( if (tracing_file.empty()) { // Create a new temporary file path on the FILE thread, then continue. CEF_POST_TASK(CEF_FILET, - base::Bind(CreateTemporaryFileOnFileThread, - base::ThreadTaskRunnerHandle::Get(), - base::Bind(&CefTraceSubscriber::ContinueEndTracing, - weak_factory_.GetWeakPtr(), callback))); + base::Bind(CreateTemporaryFileOnFileThread, + base::ThreadTaskRunnerHandle::Get(), + base::Bind(&CefTraceSubscriber::ContinueEndTracing, + weak_factory_.GetWeakPtr(), callback))); return true; } diff --git a/libcef/browser/views/basic_label_button_impl.cc b/libcef/browser/views/basic_label_button_impl.cc index cae258ff2..16967c476 100644 --- a/libcef/browser/views/basic_label_button_impl.cc +++ b/libcef/browser/views/basic_label_button_impl.cc @@ -30,9 +30,9 @@ CefRefPtr CefBasicLabelButtonImpl::Create( return label_button; } -CefBasicLabelButtonImpl::CefBasicLabelButtonImpl(CefRefPtr delegate) - : ParentClass(delegate) { -} +CefBasicLabelButtonImpl::CefBasicLabelButtonImpl( + CefRefPtr delegate) + : ParentClass(delegate) {} views::LabelButton* CefBasicLabelButtonImpl::CreateRootView() { return new CefBasicLabelButtonView(delegate()); diff --git a/libcef/browser/views/basic_label_button_impl.h b/libcef/browser/views/basic_label_button_impl.h index 10d5b3e21..cb2170719 100644 --- a/libcef/browser/views/basic_label_button_impl.h +++ b/libcef/browser/views/basic_label_button_impl.h @@ -6,19 +6,21 @@ #define CEF_LIBCEF_BROWSER_VIEWS_BASIC_LABEL_BUTTON_IMPL_H_ #pragma once -#include "include/views/cef_label_button.h" #include "include/views/cef_button_delegate.h" +#include "include/views/cef_label_button.h" #include "libcef/browser/views/label_button_impl.h" #include "ui/views/controls/button/label_button.h" -class CefBasicLabelButtonImpl : - public CefLabelButtonImpl { +class CefBasicLabelButtonImpl : public CefLabelButtonImpl { public: - typedef CefLabelButtonImpl ParentClass; + typedef CefLabelButtonImpl + ParentClass; // Create a new CefLabelButton instance. |delegate| may be nullptr. static CefRefPtr Create( diff --git a/libcef/browser/views/basic_label_button_view.cc b/libcef/browser/views/basic_label_button_view.cc index 004cd950c..607806b17 100644 --- a/libcef/browser/views/basic_label_button_view.cc +++ b/libcef/browser/views/basic_label_button_view.cc @@ -6,5 +6,4 @@ CefBasicLabelButtonView::CefBasicLabelButtonView( CefButtonDelegate* cef_delegate) - : ParentClass(cef_delegate) { -} + : ParentClass(cef_delegate) {} diff --git a/libcef/browser/views/basic_label_button_view.h b/libcef/browser/views/basic_label_button_view.h index 86f7ba668..e6fda326e 100644 --- a/libcef/browser/views/basic_label_button_view.h +++ b/libcef/browser/views/basic_label_button_view.h @@ -15,15 +15,13 @@ // Extend views::LabelButton with a no-argument constructor as required by the // CefViewView template and extend views::ButtonListener as required by the // CefButtonView template. -class LabelButtonEx : public views::LabelButton, - public views::ButtonListener { +class LabelButtonEx : public views::LabelButton, public views::ButtonListener { public: - LabelButtonEx() : views::LabelButton(this, base::string16()) { - } + LabelButtonEx() : views::LabelButton(this, base::string16()) {} }; -class CefBasicLabelButtonView : - public CefLabelButtonView { +class CefBasicLabelButtonView + : public CefLabelButtonView { public: typedef CefLabelButtonView ParentClass; diff --git a/libcef/browser/views/basic_panel_impl.cc b/libcef/browser/views/basic_panel_impl.cc index 86d7d0de0..e7b36b3ed 100644 --- a/libcef/browser/views/basic_panel_impl.cc +++ b/libcef/browser/views/basic_panel_impl.cc @@ -22,8 +22,7 @@ CefRefPtr CefBasicPanelImpl::Create( } CefBasicPanelImpl::CefBasicPanelImpl(CefRefPtr delegate) - : ParentClass(delegate) { -} + : ParentClass(delegate) {} views::View* CefBasicPanelImpl::CreateRootView() { return new CefBasicPanelView(delegate()); diff --git a/libcef/browser/views/basic_panel_impl.h b/libcef/browser/views/basic_panel_impl.h index 437df7696..209be5e0f 100644 --- a/libcef/browser/views/basic_panel_impl.h +++ b/libcef/browser/views/basic_panel_impl.h @@ -13,8 +13,8 @@ #include "ui/views/view.h" -class CefBasicPanelImpl : - public CefPanelImpl { +class CefBasicPanelImpl + : public CefPanelImpl { public: typedef CefPanelImpl ParentClass; diff --git a/libcef/browser/views/basic_panel_view.cc b/libcef/browser/views/basic_panel_view.cc index 70077fd27..7df66a368 100644 --- a/libcef/browser/views/basic_panel_view.cc +++ b/libcef/browser/views/basic_panel_view.cc @@ -5,5 +5,4 @@ #include "libcef/browser/views/basic_panel_view.h" CefBasicPanelView::CefBasicPanelView(CefPanelDelegate* cef_delegate) - : ParentClass(cef_delegate) { -} + : ParentClass(cef_delegate) {} diff --git a/libcef/browser/views/box_layout_impl.cc b/libcef/browser/views/box_layout_impl.cc index 5d834997c..62f58dc5a 100644 --- a/libcef/browser/views/box_layout_impl.cc +++ b/libcef/browser/views/box_layout_impl.cc @@ -50,16 +50,15 @@ void CefBoxLayoutImpl::ClearFlexForView(CefRefPtr view) { } CefBoxLayoutImpl::CefBoxLayoutImpl(const CefBoxLayoutSettings& settings) - : settings_(settings) { -} + : settings_(settings) {} views::BoxLayout* CefBoxLayoutImpl::CreateLayout() { - views::BoxLayout* layout = new views::BoxLayout( - settings_.horizontal ? views::BoxLayout::kHorizontal : - views::BoxLayout::kVertical, - settings_.inside_border_horizontal_spacing, - settings_.inside_border_vertical_spacing, - settings_.between_child_spacing); + views::BoxLayout* layout = + new views::BoxLayout(settings_.horizontal ? views::BoxLayout::kHorizontal + : views::BoxLayout::kVertical, + settings_.inside_border_horizontal_spacing, + settings_.inside_border_vertical_spacing, + settings_.between_child_spacing); layout->set_main_axis_alignment( static_cast( settings_.main_axis_alignment)); @@ -67,8 +66,7 @@ views::BoxLayout* CefBoxLayoutImpl::CreateLayout() { static_cast( settings_.cross_axis_alignment)); layout->set_inside_border_insets(gfx::Insets( - settings_.inside_border_insets.top, - settings_.inside_border_insets.left, + settings_.inside_border_insets.top, settings_.inside_border_insets.left, settings_.inside_border_insets.bottom, settings_.inside_border_insets.right)); layout->set_minimum_cross_axis_size(settings_.minimum_cross_axis_size); diff --git a/libcef/browser/views/box_layout_impl.h b/libcef/browser/views/box_layout_impl.h index 23e6e9c91..c1c4d9c5f 100644 --- a/libcef/browser/views/box_layout_impl.h +++ b/libcef/browser/views/box_layout_impl.h @@ -11,8 +11,7 @@ #include "libcef/browser/views/layout_impl.h" #include "ui/views/layout/box_layout.h" -class CefBoxLayoutImpl : - public CefLayoutImpl { +class CefBoxLayoutImpl : public CefLayoutImpl { public: // Necessary for the CEF_REQUIRE_VALID_*() macros to compile. typedef CefLayoutImpl ParentClass; diff --git a/libcef/browser/views/browser_platform_delegate_views.cc b/libcef/browser/views/browser_platform_delegate_views.cc index b9aa12a86..fe00d323c 100644 --- a/libcef/browser/views/browser_platform_delegate_views.cc +++ b/libcef/browser/views/browser_platform_delegate_views.cc @@ -21,8 +21,7 @@ namespace { class PopupWindowDelegate : public CefWindowDelegate { public: explicit PopupWindowDelegate(CefRefPtr browser_view) - : browser_view_(browser_view) { - } + : browser_view_(browser_view) {} void OnWindowCreated(CefRefPtr window) override { window->AddChildView(browser_view_); @@ -118,8 +117,8 @@ views::Widget* CefBrowserPlatformDelegateViews::GetWindowWidget() const { return nullptr; } -CefRefPtr - CefBrowserPlatformDelegateViews::GetBrowserView() const { +CefRefPtr CefBrowserPlatformDelegateViews::GetBrowserView() + const { return browser_view_.get(); } @@ -238,7 +237,8 @@ void CefBrowserPlatformDelegateViews::TranslateClickEvent( blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const { + bool mouseUp, + int clickCount) const { native_delegate_->TranslateClickEvent(result, mouse_event, type, mouseUp, clickCount); } @@ -253,7 +253,8 @@ void CefBrowserPlatformDelegateViews::TranslateMoveEvent( void CefBrowserPlatformDelegateViews::TranslateWheelEvent( blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const { + int deltaX, + int deltaY) const { native_delegate_->TranslateWheelEvent(result, mouse_event, deltaX, deltaY); } @@ -263,17 +264,17 @@ CefEventHandle CefBrowserPlatformDelegateViews::GetEventHandle( } std::unique_ptr - CefBrowserPlatformDelegateViews::CreateFileDialogRunner() { +CefBrowserPlatformDelegateViews::CreateFileDialogRunner() { return native_delegate_->CreateFileDialogRunner(); } std::unique_ptr - CefBrowserPlatformDelegateViews::CreateJavaScriptDialogRunner() { +CefBrowserPlatformDelegateViews::CreateJavaScriptDialogRunner() { return native_delegate_->CreateJavaScriptDialogRunner(); } std::unique_ptr - CefBrowserPlatformDelegateViews::CreateMenuRunner() { +CefBrowserPlatformDelegateViews::CreateMenuRunner() { return base::WrapUnique(new CefMenuRunnerViews(browser_view_.get())); } diff --git a/libcef/browser/views/browser_platform_delegate_views.h b/libcef/browser/views/browser_platform_delegate_views.h index b42f8a1b7..8909f2bb8 100644 --- a/libcef/browser/views/browser_platform_delegate_views.h +++ b/libcef/browser/views/browser_platform_delegate_views.h @@ -10,9 +10,9 @@ #include "libcef/browser/views/browser_view_impl.h" // Implementation of Views-based browser functionality. -class CefBrowserPlatformDelegateViews : - public CefBrowserPlatformDelegate, - public CefBrowserPlatformDelegateNative::WindowlessHandler { +class CefBrowserPlatformDelegateViews + : public CefBrowserPlatformDelegate, + public CefBrowserPlatformDelegateNative::WindowlessHandler { public: // Platform-specific behaviors will be delegated to |native_delegate|. // |browser_view_getter| may be initially empty for popup browsers. @@ -39,9 +39,8 @@ class CefBrowserPlatformDelegateViews : content::WebContents* new_web_contents, CefBrowserPlatformDelegate* new_platform_delegate, bool is_devtools) override; - void PopupBrowserCreated( - CefBrowserHostImpl* new_browser, - bool is_devtools) override; + void PopupBrowserCreated(CefBrowserHostImpl* new_browser, + bool is_devtools) override; SkColor GetBackgroundColor() const override; void WasResized() override; void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override; @@ -58,17 +57,20 @@ class CefBrowserPlatformDelegateViews : void TranslateClickEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, CefBrowserHost::MouseButtonType type, - bool mouseUp, int clickCount) const override; + bool mouseUp, + int clickCount) const override; void TranslateMoveEvent(blink::WebMouseEvent& result, const CefMouseEvent& mouse_event, bool mouseLeave) const override; void TranslateWheelEvent(blink::WebMouseWheelEvent& result, const CefMouseEvent& mouse_event, - int deltaX, int deltaY) const override; + int deltaX, + int deltaY) const override; CefEventHandle GetEventHandle( const content::NativeWebKeyboardEvent& event) const override; std::unique_ptr CreateFileDialogRunner() override; - std::unique_ptr CreateJavaScriptDialogRunner() override; + std::unique_ptr CreateJavaScriptDialogRunner() + override; std::unique_ptr CreateMenuRunner() override; bool IsWindowless() const override; bool IsViewsHosted() const override; diff --git a/libcef/browser/views/browser_view_impl.cc b/libcef/browser/views/browser_view_impl.cc index 3de872ff2..cbe8d4717 100644 --- a/libcef/browser/views/browser_view_impl.cc +++ b/libcef/browser/views/browser_view_impl.cc @@ -7,8 +7,8 @@ #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_util.h" #include "libcef/browser/context.h" -#include "libcef/browser/views/window_impl.h" #include "libcef/browser/thread_util.h" +#include "libcef/browser/views/window_impl.h" #include "content/public/browser/native_web_keyboard_event.h" #include "ui/content_accelerators/accelerator_util.h" @@ -16,10 +16,10 @@ // static CefRefPtr CefBrowserView::CreateBrowserView( CefRefPtr client, - const CefString& url, - const CefBrowserSettings& settings, - CefRefPtr request_context, - CefRefPtr delegate) { + const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context, + CefRefPtr delegate) { return CefBrowserViewImpl::Create(client, url, settings, request_context, delegate); } @@ -164,8 +164,7 @@ void CefBrowserViewImpl::OnBrowserViewAdded() { CefBrowserViewImpl::CefBrowserViewImpl( CefRefPtr delegate) - : ParentClass(delegate) { -} + : ParentClass(delegate) {} void CefBrowserViewImpl::SetPendingBrowserCreateParams( CefRefPtr client, diff --git a/libcef/browser/views/browser_view_impl.h b/libcef/browser/views/browser_view_impl.h index 332aa7989..eed5d8b23 100644 --- a/libcef/browser/views/browser_view_impl.h +++ b/libcef/browser/views/browser_view_impl.h @@ -11,18 +11,20 @@ #include "include/views/cef_browser_view_delegate.h" #include "libcef/browser/browser_host_impl.h" -#include "libcef/browser/views/view_impl.h" #include "libcef/browser/views/browser_view_view.h" +#include "libcef/browser/views/view_impl.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -class CefBrowserViewImpl : - public CefViewImpl, - public CefBrowserViewView::Delegate { +class CefBrowserViewImpl : public CefViewImpl, + public CefBrowserViewView::Delegate { public: - typedef CefViewImpl ParentClass; + typedef CefViewImpl + ParentClass; // Create a new CefBrowserView instance. |delegate| may be nullptr. static CefRefPtr Create( diff --git a/libcef/browser/views/browser_view_view.cc b/libcef/browser/views/browser_view_view.cc index 8ada9d8b2..d3b6bccd2 100644 --- a/libcef/browser/views/browser_view_view.cc +++ b/libcef/browser/views/browser_view_view.cc @@ -8,8 +8,7 @@ CefBrowserViewView::CefBrowserViewView(CefBrowserViewDelegate* cef_delegate, Delegate* browser_view_delegate) - : ParentClass(cef_delegate), - browser_view_delegate_(browser_view_delegate) { + : ParentClass(cef_delegate), browser_view_delegate_(browser_view_delegate) { DCHECK(browser_view_delegate_); } diff --git a/libcef/browser/views/browser_view_view.h b/libcef/browser/views/browser_view_view.h index b50208f4a..462a4eedc 100644 --- a/libcef/browser/views/browser_view_view.h +++ b/libcef/browser/views/browser_view_view.h @@ -16,12 +16,11 @@ // CefViewView template. class WebViewEx : public views::WebView { public: - WebViewEx() : views::WebView(nullptr) { - } + WebViewEx() : views::WebView(nullptr) {} }; -class CefBrowserViewView : - public CefViewView { +class CefBrowserViewView + : public CefViewView { public: typedef CefViewView ParentClass; diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 8d3518c07..cc373b502 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -44,8 +44,7 @@ CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D { // Always call Initialize() after creation. // |delegate| may be nullptr. explicit CefButtonImpl(CefRefPtr delegate) - : ParentClass(delegate) { - } + : ParentClass(delegate) {} }; CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { @@ -62,8 +61,8 @@ CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() { CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { CEF_REQUIRE_VALID_RETURN_VOID(); ParentClass::root_view()->SetInkDropMode( - enabled ? views::InkDropHostView::InkDropMode::ON : - views::InkDropHostView::InkDropMode::OFF); + enabled ? views::InkDropHostView::InkDropMode::ON + : views::InkDropHostView::InkDropMode::OFF); if (enabled) { ParentClass::root_view()->set_ink_drop_base_color( color_utils::BlendTowardOppositeLuma( @@ -83,8 +82,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetAccessibleName( ParentClass::root_view()->SetAccessibleName(name); } -CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetFocusable( - bool focusable) { +CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetFocusable(bool focusable) { CEF_REQUIRE_VALID_RETURN_VOID(); ParentClass::root_view()->set_request_focus_on_press(focusable); ParentClass::SetFocusable(focusable); diff --git a/libcef/browser/views/button_view.h b/libcef/browser/views/button_view.h index 01b10f7b9..1512c04c1 100644 --- a/libcef/browser/views/button_view.h +++ b/libcef/browser/views/button_view.h @@ -29,8 +29,7 @@ CEF_BUTTON_VIEW_T class CefButtonView : public CEF_VIEW_VIEW_D { // |cef_delegate| may be nullptr. explicit CefButtonView(CefViewDelegateClass* cef_delegate) - : ParentClass(cef_delegate) { - } + : ParentClass(cef_delegate) {} // Returns the CefButton associated with this view. See comments on // CefViewView::GetCefView. @@ -55,7 +54,8 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::StateChanged( } CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed( - views::Button* sender, const ui::Event& event) { + views::Button* sender, + const ui::Event& event) { if (ParentClass::cef_delegate()) ParentClass::cef_delegate()->OnButtonPressed(GetCefButton()); if (ParentClass::ink_drop_mode() != views::CustomButton::InkDropMode::OFF && diff --git a/libcef/browser/views/display_impl.cc b/libcef/browser/views/display_impl.cc index be79310d4..4f6d7234f 100644 --- a/libcef/browser/views/display_impl.cc +++ b/libcef/browser/views/display_impl.cc @@ -40,7 +40,7 @@ size_t CefDisplay::GetDisplayCount() { } // static -void CefDisplay::GetAllDisplays(std::vector >& displays) { +void CefDisplay::GetAllDisplays(std::vector>& displays) { CEF_REQUIRE_UIT_RETURN_VOID(); displays.clear(); @@ -87,15 +87,15 @@ void CefDisplayImpl::ConvertPointFromPixels(CefPoint& point) { CefRect CefDisplayImpl::GetBounds() { CEF_REQUIRE_UIT_RETURN(CefRect()); const gfx::Rect& gfx_rect = display_.bounds(); - return CefRect(gfx_rect.x(), gfx_rect.y(), - gfx_rect.width(), gfx_rect.height()); + return CefRect(gfx_rect.x(), gfx_rect.y(), gfx_rect.width(), + gfx_rect.height()); } CefRect CefDisplayImpl::GetWorkArea() { CEF_REQUIRE_UIT_RETURN(CefRect()); const gfx::Rect& gfx_rect = display_.work_area(); - return CefRect(gfx_rect.x(), gfx_rect.y(), - gfx_rect.width(), gfx_rect.height()); + return CefRect(gfx_rect.x(), gfx_rect.y(), gfx_rect.width(), + gfx_rect.height()); } int CefDisplayImpl::GetRotation() { diff --git a/libcef/browser/views/fill_layout_impl.cc b/libcef/browser/views/fill_layout_impl.cc index 65a2d0045..fa7bdf93e 100644 --- a/libcef/browser/views/fill_layout_impl.cc +++ b/libcef/browser/views/fill_layout_impl.cc @@ -14,8 +14,7 @@ CefRefPtr CefFillLayoutImpl::Create(views::View* owner_view) { return impl; } -CefFillLayoutImpl::CefFillLayoutImpl() { -} +CefFillLayoutImpl::CefFillLayoutImpl() {} views::FillLayout* CefFillLayoutImpl::CreateLayout() { return new views::FillLayout(); diff --git a/libcef/browser/views/fill_layout_impl.h b/libcef/browser/views/fill_layout_impl.h index 664ab88f7..e4b28a29c 100644 --- a/libcef/browser/views/fill_layout_impl.h +++ b/libcef/browser/views/fill_layout_impl.h @@ -11,8 +11,8 @@ #include "libcef/browser/views/layout_impl.h" #include "ui/views/layout/fill_layout.h" -class CefFillLayoutImpl : - public CefLayoutImpl { +class CefFillLayoutImpl + : public CefLayoutImpl { public: // Create a new CefFillLayout insance. |owner_view| must be non-nullptr. static CefRefPtr Create(views::View* owner_view); diff --git a/libcef/browser/views/label_button_impl.h b/libcef/browser/views/label_button_impl.h index 45ac76ccf..61ad6d246 100644 --- a/libcef/browser/views/label_button_impl.h +++ b/libcef/browser/views/label_button_impl.h @@ -59,8 +59,7 @@ CEF_LABEL_BUTTON_IMPL_T class CefLabelButtonImpl : public CEF_BUTTON_IMPL_D { // Always call Initialize() after creation. // |delegate| may be nullptr. explicit CefLabelButtonImpl(CefRefPtr delegate) - : ParentClass(delegate) { - } + : ParentClass(delegate) {} }; CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetText( @@ -96,7 +95,8 @@ CEF_LABEL_BUTTON_IMPL_T CefRefPtr CEF_LABEL_BUTTON_IMPL_D::GetImage( } CEF_LABEL_BUTTON_IMPL_T void CEF_LABEL_BUTTON_IMPL_D::SetTextColor( - cef_button_state_t for_state, cef_color_t color) { + cef_button_state_t for_state, + cef_color_t color) { CEF_REQUIRE_VALID_RETURN_VOID(); ParentClass::root_view()->SetTextColor( static_cast(for_state), color); diff --git a/libcef/browser/views/label_button_view.h b/libcef/browser/views/label_button_view.h index 4bc9614a4..3c326c442 100644 --- a/libcef/browser/views/label_button_view.h +++ b/libcef/browser/views/label_button_view.h @@ -26,8 +26,7 @@ CEF_LABEL_BUTTON_VIEW_T class CefLabelButtonView : public CEF_BUTTON_VIEW_D { // |cef_delegate| may be nullptr. explicit CefLabelButtonView(CefViewDelegateClass* cef_delegate) - : ParentClass(cef_delegate) { - } + : ParentClass(cef_delegate) {} void Initialize() override { ParentClass::Initialize(); diff --git a/libcef/browser/views/layout_impl.h b/libcef/browser/views/layout_impl.h index d6a5a4132..e10f42b1e 100644 --- a/libcef/browser/views/layout_impl.h +++ b/libcef/browser/views/layout_impl.h @@ -21,8 +21,7 @@ // Base template for implementing CefLayout-derived classes. See comments in // view_impl.h for a usage overview. template -class CefLayoutImpl : public CefLayoutAdapter, - public CefLayoutClass { +class CefLayoutImpl : public CefLayoutAdapter, public CefLayoutClass { public: // Returns the underlying views::LayoutManager object as the derived type. // Does not transfer ownership. @@ -32,9 +31,7 @@ class CefLayoutImpl : public CefLayoutAdapter, views::View* owner_view() const { return owner_view_; } // CefLayoutAdapter methods: - views::LayoutManager* Get() const override { - return layout(); - } + views::LayoutManager* Get() const override { return layout(); } void Detach() override { owner_view_ = nullptr; layout_ref_ = nullptr; @@ -46,16 +43,13 @@ class CefLayoutImpl : public CefLayoutAdapter, CefRefPtr AsFillLayout() override { return nullptr; } bool IsValid() override { CEF_REQUIRE_UIT_RETURN(false); - return !!layout_ref_; + return !!layout_ref_; } protected: // Create a new implementation object. // Always call Initialize() after creation. - CefLayoutImpl() - : layout_ref_(nullptr), - owner_view_(nullptr) { - } + CefLayoutImpl() : layout_ref_(nullptr), owner_view_(nullptr) {} // Initialize this object and assign ownership to |owner_view|. void Initialize(views::View* owner_view) { diff --git a/libcef/browser/views/layout_util.cc b/libcef/browser/views/layout_util.cc index c935dfd9e..d54c78896 100644 --- a/libcef/browser/views/layout_util.cc +++ b/libcef/browser/views/layout_util.cc @@ -29,8 +29,7 @@ class UserData : public base::SupportsUserData::Data { // reference to the CefLayout and the CefLayout will keep an unowned reference // to the views::LayoutManager. Destruction of the views::View will release // the reference to the CefLayout. - static void Assign(CefRefPtr cef_layout, - views::View* owner_view) { + static void Assign(CefRefPtr cef_layout, views::View* owner_view) { DCHECK(owner_view); DCHECK(cef_layout->IsValid()); @@ -43,14 +42,11 @@ class UserData : public base::SupportsUserData::Data { } private: - explicit UserData(CefRefPtr cef_layout) - : layout_(cef_layout) { + explicit UserData(CefRefPtr cef_layout) : layout_(cef_layout) { DCHECK(layout_); } - ~UserData() override { - CefLayoutAdapter::GetFor(layout_)->Detach(); - } + ~UserData() override { CefLayoutAdapter::GetFor(layout_)->Detach(); } static void* UserDataKey() { // We just need a unique constant. Use the address of a static that diff --git a/libcef/browser/views/menu_button_impl.cc b/libcef/browser/views/menu_button_impl.cc index 4e7ef9478..dfbda6dbe 100644 --- a/libcef/browser/views/menu_button_impl.cc +++ b/libcef/browser/views/menu_button_impl.cc @@ -59,8 +59,9 @@ void CefMenuButtonImpl::TriggerMenu() { void CefMenuButtonImpl::SetFocusable(bool focusable) { CEF_REQUIRE_VALID_RETURN_VOID(); - static_cast(root_view())->SetDrawStringsFlags( - focusable ? gfx::Canvas::SHOW_PREFIX : gfx::Canvas::HIDE_PREFIX); + static_cast(root_view()) + ->SetDrawStringsFlags(focusable ? gfx::Canvas::SHOW_PREFIX + : gfx::Canvas::HIDE_PREFIX); ParentClass::SetFocusable(focusable); } diff --git a/libcef/browser/views/menu_button_impl.h b/libcef/browser/views/menu_button_impl.h index 3f4a7d858..72d101f0f 100644 --- a/libcef/browser/views/menu_button_impl.h +++ b/libcef/browser/views/menu_button_impl.h @@ -14,12 +14,14 @@ #include "ui/views/controls/button/menu_button.h" -class CefMenuButtonImpl : - public CefLabelButtonImpl { +class CefMenuButtonImpl : public CefLabelButtonImpl { public: - typedef CefLabelButtonImpl ParentClass; + typedef CefLabelButtonImpl + ParentClass; // Create a new CefMenuButton instance. |delegate| must not be nullptr. static CefRefPtr Create( diff --git a/libcef/browser/views/menu_button_view.cc b/libcef/browser/views/menu_button_view.cc index 8d402ae31..96bb99942 100644 --- a/libcef/browser/views/menu_button_view.cc +++ b/libcef/browser/views/menu_button_view.cc @@ -7,8 +7,7 @@ #include "ui/gfx/canvas.h" #include "ui/views/controls/menu/menu_config.h" -CefMenuButtonView::CefMenuButtonView( - CefMenuButtonDelegate* cef_delegate) +CefMenuButtonView::CefMenuButtonView(CefMenuButtonDelegate* cef_delegate) : ParentClass(cef_delegate) { DCHECK(cef_delegate); } @@ -16,8 +15,8 @@ CefMenuButtonView::CefMenuButtonView( void CefMenuButtonView::Initialize() { ParentClass::Initialize(); - SetDrawStringsFlags(IsFocusable() ? gfx::Canvas::SHOW_PREFIX : - gfx::Canvas::HIDE_PREFIX); + SetDrawStringsFlags(IsFocusable() ? gfx::Canvas::SHOW_PREFIX + : gfx::Canvas::HIDE_PREFIX); // Use the same default font as MenuItemView. SetFontList(views::MenuConfig::instance().font_list); diff --git a/libcef/browser/views/menu_button_view.h b/libcef/browser/views/menu_button_view.h index 569928c4e..6a7d15452 100644 --- a/libcef/browser/views/menu_button_view.h +++ b/libcef/browser/views/menu_button_view.h @@ -28,8 +28,8 @@ class MenuButtonEx : public views::MenuButton, } }; -class CefMenuButtonView : - public CefLabelButtonView { +class CefMenuButtonView + : public CefLabelButtonView { public: typedef CefLabelButtonView ParentClass; diff --git a/libcef/browser/views/menu_runner_views.cc b/libcef/browser/views/menu_runner_views.cc index e5ae5f179..b6d976a74 100644 --- a/libcef/browser/views/menu_runner_views.cc +++ b/libcef/browser/views/menu_runner_views.cc @@ -8,8 +8,7 @@ #include "libcef/browser/views/browser_view_impl.h" CefMenuRunnerViews::CefMenuRunnerViews(CefBrowserViewImpl* browser_view) - : browser_view_(browser_view) { -} + : browser_view_(browser_view) {} bool CefMenuRunnerViews::RunContextMenu( CefBrowserHostImpl* browser, diff --git a/libcef/browser/views/menu_runner_views.h b/libcef/browser/views/menu_runner_views.h index c534fa0aa..9030dbbff 100644 --- a/libcef/browser/views/menu_runner_views.h +++ b/libcef/browser/views/menu_runner_views.h @@ -10,7 +10,7 @@ class CefBrowserViewImpl; -class CefMenuRunnerViews: public CefMenuRunner { +class CefMenuRunnerViews : public CefMenuRunner { public: // |browser_view| is guaranteed to outlive this object. explicit CefMenuRunnerViews(CefBrowserViewImpl* browser_view); diff --git a/libcef/browser/views/panel_impl.h b/libcef/browser/views/panel_impl.h index dddc0569f..a8fc173ae 100644 --- a/libcef/browser/views/panel_impl.h +++ b/libcef/browser/views/panel_impl.h @@ -38,10 +38,8 @@ CEF_PANEL_IMPL_T class CefPanelImpl : public CEF_VIEW_IMPL_D { CefRefPtr GetLayout() override; void Layout() override; void AddChildView(CefRefPtr view) override; - void AddChildViewAt(CefRefPtr view, - int index) override; - void ReorderChildView(CefRefPtr view, - int index) override; + void AddChildViewAt(CefRefPtr view, int index) override; + void ReorderChildView(CefRefPtr view, int index) override; void RemoveChildView(CefRefPtr view) override; void RemoveAllChildViews() override; size_t GetChildViewCount() override; @@ -80,8 +78,7 @@ CEF_PANEL_IMPL_T class CefPanelImpl : public CEF_VIEW_IMPL_D { // Always call Initialize() after creation. // |delegate| may be nullptr. explicit CefPanelImpl(CefRefPtr delegate) - : ParentClass(delegate) { - } + : ParentClass(delegate) {} void Initialize() override { ParentClass::Initialize(); @@ -112,8 +109,7 @@ CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::Layout() { return ParentClass::root_view()->Layout(); } -CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::AddChildView( - CefRefPtr view) { +CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::AddChildView(CefRefPtr view) { CEF_REQUIRE_VALID_RETURN_VOID(); DCHECK(view.get()); DCHECK(view->IsValid()); @@ -125,17 +121,16 @@ CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::AddChildView( ParentClass::content_view()->AddChildView(view_ptr.release()); } -CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::AddChildViewAt( - CefRefPtr view, - int index) { +CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::AddChildViewAt(CefRefPtr view, + int index) { CEF_REQUIRE_VALID_RETURN_VOID(); DCHECK(view.get()); DCHECK(view->IsValid()); DCHECK(!view->IsAttached()); DCHECK_GE(index, 0); DCHECK_LE(index, ParentClass::content_view()->child_count()); - if (!view.get() || !view->IsValid() || view->IsAttached() || - index < 0 || index > ParentClass::content_view()->child_count()) { + if (!view.get() || !view->IsValid() || view->IsAttached() || index < 0 || + index > ParentClass::content_view()->child_count()) { return; } @@ -152,7 +147,7 @@ CEF_PANEL_IMPL_T void CEF_PANEL_IMPL_D::ReorderChildView( DCHECK(view->IsAttached()); if (!view.get() || !view->IsValid() || !view->IsAttached()) return; - + views::View* view_ptr = view_util::GetFor(view); DCHECK(view_ptr); DCHECK_EQ(view_ptr->parent(), ParentClass::content_view()); diff --git a/libcef/browser/views/panel_view.h b/libcef/browser/views/panel_view.h index 3a453cdf7..13d780841 100644 --- a/libcef/browser/views/panel_view.h +++ b/libcef/browser/views/panel_view.h @@ -27,8 +27,7 @@ CEF_PANEL_VIEW_T class CefPanelView : public CEF_VIEW_VIEW_D { // |cef_delegate| may be nullptr. explicit CefPanelView(CefViewDelegateClass* cef_delegate) - : ParentClass(cef_delegate) { - } + : ParentClass(cef_delegate) {} // Returns the CefPanel associated with this view. See comments on // CefViewView::GetCefView. diff --git a/libcef/browser/views/scroll_view_impl.cc b/libcef/browser/views/scroll_view_impl.cc index 396aa5922..3367cfde5 100644 --- a/libcef/browser/views/scroll_view_impl.cc +++ b/libcef/browser/views/scroll_view_impl.cc @@ -80,8 +80,7 @@ void CefScrollViewImpl::GetDebugInfo(base::DictionaryValue* info, } CefScrollViewImpl::CefScrollViewImpl(CefRefPtr delegate) - : ParentClass(delegate) { -} + : ParentClass(delegate) {} CefScrollViewView* CefScrollViewImpl::CreateRootView() { return new CefScrollViewView(delegate()); diff --git a/libcef/browser/views/scroll_view_impl.h b/libcef/browser/views/scroll_view_impl.h index c7cf05db7..ca2769004 100644 --- a/libcef/browser/views/scroll_view_impl.h +++ b/libcef/browser/views/scroll_view_impl.h @@ -12,8 +12,8 @@ #include "libcef/browser/views/scroll_view_view.h" #include "libcef/browser/views/view_impl.h" -class CefScrollViewImpl : - public CefViewImpl { +class CefScrollViewImpl + : public CefViewImpl { public: typedef CefViewImpl ParentClass; diff --git a/libcef/browser/views/scroll_view_view.cc b/libcef/browser/views/scroll_view_view.cc index 45987b75b..39ac25cc0 100644 --- a/libcef/browser/views/scroll_view_view.cc +++ b/libcef/browser/views/scroll_view_view.cc @@ -5,5 +5,4 @@ #include "libcef/browser/views/scroll_view_view.h" CefScrollViewView::CefScrollViewView(CefViewDelegate* cef_delegate) - : ParentClass(cef_delegate) { -} + : ParentClass(cef_delegate) {} diff --git a/libcef/browser/views/scroll_view_view.h b/libcef/browser/views/scroll_view_view.h index 8a8f496f5..62a7c4be3 100644 --- a/libcef/browser/views/scroll_view_view.h +++ b/libcef/browser/views/scroll_view_view.h @@ -12,8 +12,8 @@ #include "ui/views/controls/scroll_view.h" -class CefScrollViewView : - public CefViewView { +class CefScrollViewView + : public CefViewView { public: typedef CefViewView ParentClass; diff --git a/libcef/browser/views/textfield_impl.cc b/libcef/browser/views/textfield_impl.cc index 7c90f718e..0765e9c68 100644 --- a/libcef/browser/views/textfield_impl.cc +++ b/libcef/browser/views/textfield_impl.cc @@ -23,8 +23,8 @@ CefRefPtr CefTextfieldImpl::Create( void CefTextfieldImpl::SetPasswordInput(bool password_input) { CEF_REQUIRE_VALID_RETURN_VOID(); - root_view()->SetTextInputType(password_input ? ui::TEXT_INPUT_TYPE_PASSWORD : - ui::TEXT_INPUT_TYPE_TEXT); + root_view()->SetTextInputType(password_input ? ui::TEXT_INPUT_TYPE_PASSWORD + : ui::TEXT_INPUT_TYPE_TEXT); } bool CefTextfieldImpl::IsPasswordInput() { @@ -201,8 +201,7 @@ void CefTextfieldImpl::SetAccessibleName(const CefString& name) { } CefTextfieldImpl::CefTextfieldImpl(CefRefPtr delegate) - : ParentClass(delegate) { -} + : ParentClass(delegate) {} CefTextfieldView* CefTextfieldImpl::CreateRootView() { return new CefTextfieldView(delegate()); diff --git a/libcef/browser/views/textfield_impl.h b/libcef/browser/views/textfield_impl.h index 9da071d70..b620fc4de 100644 --- a/libcef/browser/views/textfield_impl.h +++ b/libcef/browser/views/textfield_impl.h @@ -9,11 +9,11 @@ #include "include/views/cef_textfield.h" #include "include/views/cef_textfield_delegate.h" -#include "libcef/browser/views/view_impl.h" #include "libcef/browser/views/textfield_view.h" +#include "libcef/browser/views/view_impl.h" -class CefTextfieldImpl : - public CefViewImpl { +class CefTextfieldImpl + : public CefViewImpl { public: typedef CefViewImpl ParentClass; @@ -45,8 +45,7 @@ class CefTextfieldImpl : void SetSelectionBackgroundColor(cef_color_t color) override; cef_color_t GetSelectionBackgroundColor() override; void SetFontList(const CefString& font_list) override; - void ApplyTextColor(cef_color_t color, - const CefRange& range) override; + void ApplyTextColor(cef_color_t color, const CefRange& range) override; void ApplyTextStyle(cef_text_style_t style, bool add, const CefRange& range) override; diff --git a/libcef/browser/views/textfield_view.h b/libcef/browser/views/textfield_view.h index 187ddf546..b97187b23 100644 --- a/libcef/browser/views/textfield_view.h +++ b/libcef/browser/views/textfield_view.h @@ -14,9 +14,9 @@ #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" -class CefTextfieldView : - public CefViewView, - public views::TextfieldController { +class CefTextfieldView + : public CefViewView, + public views::TextfieldController { public: typedef CefViewView ParentClass; diff --git a/libcef/browser/views/view_adapter.cc b/libcef/browser/views/view_adapter.cc index ce79adee1..8f3aa4bff 100644 --- a/libcef/browser/views/view_adapter.cc +++ b/libcef/browser/views/view_adapter.cc @@ -23,8 +23,8 @@ CefViewAdapter* CefViewAdapter::GetFor(CefRefPtr view) { if (button->AsLabelButton()) { CefRefPtr label_button = button->AsLabelButton(); if (label_button->AsMenuButton()) { - adapter = static_cast( - label_button->AsMenuButton().get()); + adapter = + static_cast(label_button->AsMenuButton().get()); } else { adapter = static_cast(label_button.get()); } diff --git a/libcef/browser/views/view_impl.h b/libcef/browser/views/view_impl.h index 32270c166..c9e9e223f 100644 --- a/libcef/browser/views/view_impl.h +++ b/libcef/browser/views/view_impl.h @@ -39,7 +39,7 @@ // CefBasicPanelView. // // Example 2: In some cases an intermediary type is required to meet CEF -// template requirements (e.g. CefViewView requires a no-argument constructor). +// template requirements (e.g. CefViewView requires a no-argument constructor). // The CefBasicLabelButtonImpl object created via // CefLabelButton::CreateLabelButton() has the following object hierarchy: // @@ -179,7 +179,7 @@ // /*--cef(optional_param=delegate)--*/ // static CefRefPtr CreateFooBar( // CefRefPtr delegate); -// +// // /// // // Do a task. // /// @@ -303,17 +303,15 @@ #include "ui/views/view.h" // Helpers for template boiler-plate. -#define CEF_VIEW_IMPL_T \ - template -#define CEF_VIEW_IMPL_A \ - ViewsViewClass, CefViewClass, CefViewDelegateClass +#define CEF_VIEW_IMPL_T \ + template +#define CEF_VIEW_IMPL_A ViewsViewClass, CefViewClass, CefViewDelegateClass #define CEF_VIEW_IMPL_D CefViewImpl // Base template for implementing CefView-derived classes. See above comments // for a usage overview. -CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, - public CefViewClass { +CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, public CefViewClass { public: // Necessary for the CEF_REQUIRE_VALID_*() macros to compile. typedef CEF_VIEW_IMPL_D ParentClass; @@ -329,9 +327,7 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, ViewsViewClass* root_view() const { return root_view_ref_; } // CefViewAdapter methods: - views::View* Get() const override { - return root_view(); - } + views::View* Get() const override { return root_view(); } std::unique_ptr PassOwnership() override { DCHECK(root_view_); return std::move(root_view_); @@ -353,7 +349,8 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, // Use GetBounds() because some subclasses (like CefWindowImpl) override it. const CefRect& bounds = GetBounds(); - std::unique_ptr bounds_value(new base::DictionaryValue()); + std::unique_ptr bounds_value( + new base::DictionaryValue()); bounds_value->SetInteger("x", bounds.x); bounds_value->SetInteger("y", bounds.y); bounds_value->SetInteger("width", bounds.width); @@ -400,7 +397,7 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, void SetEnabled(bool enabled) override; bool IsEnabled() override; void SetFocusable(bool focusable) override; - bool IsFocusable() override;; + bool IsFocusable() override; bool IsAccessibilityFocusable() override; void RequestFocus() override; void SetBackgroundColor(cef_color_t color) override; @@ -409,19 +406,15 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, bool ConvertPointFromScreen(CefPoint& point) override; bool ConvertPointToWindow(CefPoint& point) override; bool ConvertPointFromWindow(CefPoint& point) override; - bool ConvertPointToView(CefRefPtr view, - CefPoint& point) override; - bool ConvertPointFromView(CefRefPtr view, - CefPoint& point) override; + bool ConvertPointToView(CefRefPtr view, CefPoint& point) override; + bool ConvertPointFromView(CefRefPtr view, CefPoint& point) override; protected: // Create a new implementation object. // Always call Initialize() after creation. // |delegate| may be nullptr. explicit CefViewImpl(CefRefPtr delegate) - : delegate_(delegate), - root_view_ref_(nullptr) { - } + : delegate_(delegate), root_view_ref_(nullptr) {} // Initialize this object. virtual void Initialize() { @@ -471,7 +464,7 @@ CEF_VIEW_IMPL_T CefString CEF_VIEW_IMPL_D::ToString(bool include_children) { CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsValid() { CEF_REQUIRE_UIT_RETURN(false); - return !!root_view_ref_; + return !!root_view_ref_; } CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsAttached() { @@ -509,7 +502,6 @@ CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetID(int id) { root_view()->set_id(id); } - CEF_VIEW_IMPL_T int CEF_VIEW_IMPL_D::GetGroupID() { CEF_REQUIRE_VALID_RETURN(0); return root_view()->GetGroup(); @@ -640,8 +632,8 @@ CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsEnabled() { CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetFocusable(bool focusable) { CEF_REQUIRE_VALID_RETURN_VOID(); - root_view()->SetFocusBehavior(focusable ? views::View::FocusBehavior::ALWAYS : - views::View::FocusBehavior::NEVER); + root_view()->SetFocusBehavior(focusable ? views::View::FocusBehavior::ALWAYS + : views::View::FocusBehavior::NEVER); } CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsFocusable() { diff --git a/libcef/browser/views/view_util.cc b/libcef/browser/views/view_util.cc index 8bd629413..5a6a4bdf2 100644 --- a/libcef/browser/views/view_util.cc +++ b/libcef/browser/views/view_util.cc @@ -10,10 +10,10 @@ #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" -#include "ui/gfx/geometry/point.h" -#include "ui/gfx/geometry/point_conversions.h" #include "ui/display/display.h" #include "ui/display/screen.h" +#include "ui/gfx/geometry/point.h" +#include "ui/gfx/geometry/point_conversions.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/non_client_view.h" @@ -56,8 +56,8 @@ class UserData : public base::SupportsUserData::Data { // gain a ref-counted reference to the CefView and the CefView will keep an // unowned reference to the views::View. Destruction of the views::View will // release the ref-counted reference to the CefView. - static std::unique_ptr PassOwnership( - CefRefPtr cef_view) WARN_UNUSED_RESULT { + static std::unique_ptr PassOwnership(CefRefPtr cef_view) + WARN_UNUSED_RESULT { DCHECK(cef_view->IsValid()); DCHECK(!cef_view->IsAttached()); @@ -90,8 +90,7 @@ class UserData : public base::SupportsUserData::Data { } private: - explicit UserData(CefRefPtr cef_view) - : view_ref_(cef_view.get()) { + explicit UserData(CefRefPtr cef_view) : view_ref_(cef_view.get()) { DCHECK(view_ref_); } @@ -103,13 +102,9 @@ class UserData : public base::SupportsUserData::Data { } } - void TakeReference() { - view_ = view_ref_; - } + void TakeReference() { view_ = view_ref_; } - void ReleaseReference() { - view_ = nullptr; - } + void ReleaseReference() { view_ = nullptr; } static void* UserDataKey() { // We just need a unique constant. Use the address of a static that @@ -177,7 +172,7 @@ CefRefPtr GetWindowFor(views::Widget* widget) { // The Window should always exist if we created the views::Widget. DCHECK(window); } - + return window; } @@ -196,21 +191,19 @@ display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, gfx::Rect find_bounds = bounds; #if defined(OS_WIN) if (input_pixel_coords) { - find_bounds = display::win::ScreenWin::ScreenToDIPRect(nullptr, - find_bounds); + find_bounds = + display::win::ScreenWin::ScreenToDIPRect(nullptr, find_bounds); } #endif return display::Screen::GetScreen()->GetDisplayMatching(find_bounds); } -void ConvertPointFromPixels(gfx::Point* point, - int device_scale_factor) { +void ConvertPointFromPixels(gfx::Point* point, int device_scale_factor) { *point = gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(*point), 1.0f / device_scale_factor)); } -void ConvertPointToPixels(gfx::Point* point, - int device_scale_factor) { +void ConvertPointToPixels(gfx::Point* point, int device_scale_factor) { *point = gfx::ToFlooredPoint( gfx::ScalePoint(gfx::PointF(*point), device_scale_factor)); } @@ -247,8 +240,7 @@ bool ConvertPointFromScreen(views::View* view, return true; } -bool ConvertPointToWindow(views::View* view, - gfx::Point* point) { +bool ConvertPointToWindow(views::View* view, gfx::Point* point) { views::Widget* widget = view->GetWidget(); if (!widget) return false; @@ -271,9 +263,7 @@ bool ConvertPointToWindow(views::View* view, return true; } -bool ConvertPointFromWindow(views::View* view, - gfx::Point* point) { - +bool ConvertPointFromWindow(views::View* view, gfx::Point* point) { views::Widget* widget = view->GetWidget(); if (!widget) return false; diff --git a/libcef/browser/views/view_util.h b/libcef/browser/views/view_util.h index 6d2693d18..6590f5bb6 100644 --- a/libcef/browser/views/view_util.h +++ b/libcef/browser/views/view_util.h @@ -23,12 +23,12 @@ namespace views { class Widget; } -#define CEF_REQUIRE_VALID_RETURN(ret) \ - if (!ParentClass::IsValid()) \ +#define CEF_REQUIRE_VALID_RETURN(ret) \ + if (!ParentClass::IsValid()) \ return ret; -#define CEF_REQUIRE_VALID_RETURN_VOID() \ - if (!ParentClass::IsValid()) \ +#define CEF_REQUIRE_VALID_RETURN_VOID() \ + if (!ParentClass::IsValid()) \ return; // The below functions manage the relationship between CefView and views::View @@ -84,13 +84,11 @@ display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds, // Convert |point| from pixel coordinates to density independent pixels (DIP) // using |device_scale_factor|. -void ConvertPointFromPixels(gfx::Point* point, - int device_scale_factor); +void ConvertPointFromPixels(gfx::Point* point, int device_scale_factor); // Convert |point| to pixel coordinates from density independent pixels (DIP) // using |device_scale_factor|. -void ConvertPointToPixels(gfx::Point* point, - int device_scale_factor); +void ConvertPointToPixels(gfx::Point* point, int device_scale_factor); // Convert |point| from |view| to screen coordinates. If |output_pixel_coords| // is true then |point| will be output in pixel coordinates instead of density @@ -110,13 +108,11 @@ bool ConvertPointFromScreen(views::View* view, // Convert |point| from |view| to window (Widget) coordinates. Returns false if // |view| does not currently belong to a Widget. -bool ConvertPointToWindow(views::View* view, - gfx::Point* point); +bool ConvertPointToWindow(views::View* view, gfx::Point* point); // Convert |point| from window (Widget) to |view| coordinates. Returns false if // |view| does not currently belong to a Widget. -bool ConvertPointFromWindow(views::View* view, - gfx::Point* point); +bool ConvertPointFromWindow(views::View* view, gfx::Point* point); // Returns the native window handle for |widget|. May return nullptr. gfx::NativeWindow GetNativeWindow(views::Widget* widget); diff --git a/libcef/browser/views/view_view.h b/libcef/browser/views/view_view.h index c095e1dc9..3610c2247 100644 --- a/libcef/browser/views/view_view.h +++ b/libcef/browser/views/view_view.h @@ -18,9 +18,8 @@ // Helpers for template boiler-plate. #define CEF_VIEW_VIEW_T \ - template -#define CEF_VIEW_VIEW_A \ - ViewsViewClass, CefViewDelegateClass + template +#define CEF_VIEW_VIEW_A ViewsViewClass, CefViewDelegateClass #define CEF_VIEW_VIEW_D CefViewView // Base template for implementing views::View-derived classes. The views::View- @@ -36,8 +35,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass { // constructor as they may attempt to call back into CefViewImpl before // registration has been performed. |cef_delegate| may be nullptr. explicit CefViewView(CefViewDelegateClass* cef_delegate) - : cef_delegate_(cef_delegate) { - } + : cef_delegate_(cef_delegate) {} // Should be called from InitializeRootView() in the CefViewImpl-derived // class that created this object. This method will be called after diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index bcd16e830..fc1dc8d9b 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -58,11 +58,10 @@ void InitializeUITesting() { // CefBrowserViewImpl::HandleKeyboardEvent. class CefUnhandledKeyEventHandler : public ui::EventHandler { public: - CefUnhandledKeyEventHandler(CefWindowImpl* window_impl, - views::Widget* widget) - : window_impl_(window_impl), - widget_(widget), - window_(widget->GetNativeWindow()) { + CefUnhandledKeyEventHandler(CefWindowImpl* window_impl, views::Widget* widget) + : window_impl_(window_impl), + widget_(widget), + window_(widget->GetNativeWindow()) { DCHECK(window_); window_->AddPostTargetHandler(this); } @@ -159,7 +158,7 @@ void CefWindowImpl::Activate() { void CefWindowImpl::Deactivate() { CEF_REQUIRE_VALID_RETURN_VOID(); - if (widget_&& widget_->CanActivate() && widget_->IsActive()) + if (widget_ && widget_->CanActivate() && widget_->IsActive()) widget_->Deactivate(); } @@ -419,7 +418,7 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button, if (!widget_) return; - + CefMenuModelImpl* menu_model_impl = static_cast(menu_model.get()); if (!menu_model_impl || !menu_model_impl->model()) @@ -433,13 +432,12 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button, menu_runner_.reset( new views::MenuRunner(menu_model_impl->model(), views::MenuRunner::ASYNC | - (menu_button ? views::MenuRunner::HAS_MNEMONICS : - views::MenuRunner::CONTEXT_MENU), + (menu_button ? views::MenuRunner::HAS_MNEMONICS + : views::MenuRunner::CONTEXT_MENU), base::Bind(&CefWindowImpl::MenuClosed, this))); views::MenuRunner::RunResult result = menu_runner_->RunMenuAt( - widget_, - menu_button, + widget_, menu_button, gfx::Rect(gfx::Point(screen_point.x, screen_point.y), gfx::Size()), static_cast(anchor_position), ui::MENU_SOURCE_NONE); @@ -504,8 +502,7 @@ CefWindowHandle CefWindowImpl::GetWindowHandle() { return view_util::GetWindowHandle(widget_); } -void CefWindowImpl::SendKeyPress(int key_code, - uint32 event_flags) { +void CefWindowImpl::SendKeyPress(int key_code, uint32 event_flags) { CEF_REQUIRE_VALID_RETURN_VOID(); InitializeUITesting(); @@ -620,10 +617,7 @@ void CefWindowImpl::RemoveAllAccelerators() { } CefWindowImpl::CefWindowImpl(CefRefPtr delegate) - : ParentClass(delegate), - widget_(nullptr), - destroyed_(false) { -} + : ParentClass(delegate), widget_(nullptr), destroyed_(false) {} CefWindowView* CefWindowImpl::CreateRootView() { return new CefWindowView(delegate(), this); diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h index 39f54c860..adcb4d86f 100644 --- a/libcef/browser/views/window_impl.h +++ b/libcef/browser/views/window_impl.h @@ -23,10 +23,10 @@ namespace views { class MenuButton; } -class CefWindowImpl : - public CefPanelImpl, - public CefWindowView::Delegate, - public ui::AcceleratorTarget { +class CefWindowImpl + : public CefPanelImpl, + public CefWindowView::Delegate, + public ui::AcceleratorTarget { public: typedef CefPanelImpl ParentClass; @@ -67,8 +67,7 @@ class CefWindowImpl : void SetDraggableRegions( const std::vector& regions) override; CefWindowHandle GetWindowHandle() override; - void SendKeyPress(int key_code, - uint32 event_flags) override; + void SendKeyPress(int key_code, uint32 event_flags) override; void SendMouseMove(int screen_x, int screen_y) override; void SendMouseEvents(cef_mouse_button_type_t button, bool mouse_down, diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 026cde467..094536c69 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -30,14 +30,12 @@ class ClientViewEx : public views::ClientView { ClientViewEx(views::Widget* widget, views::View* contents_view, CefWindowView::Delegate* window_delegate) - : views::ClientView(widget, contents_view), - window_delegate_(window_delegate) { + : views::ClientView(widget, contents_view), + window_delegate_(window_delegate) { DCHECK(window_delegate_); } - bool CanClose() override { - return window_delegate_->CanWidgetClose(); - } + bool CanClose() override { return window_delegate_->CanWidgetClose(); } private: CefWindowView::Delegate* window_delegate_; // Not owned by this object. @@ -48,12 +46,8 @@ class ClientViewEx : public views::ClientView { // Extend NativeFrameView with draggable region handling. class NativeFrameViewEx : public views::NativeFrameView { public: - NativeFrameViewEx(views::Widget* widget, - CefWindowView* view) - : views::NativeFrameView(widget), - widget_(widget), - view_(view) { - } + NativeFrameViewEx(views::Widget* widget, CefWindowView* view) + : views::NativeFrameView(widget), widget_(widget), view_(view) {} gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const override { @@ -65,8 +59,7 @@ class NativeFrameViewEx : public views::NativeFrameView { display::Screen::GetScreen()->DIPToScreenRectInWindow( view_util::GetNativeWindow(widget_), client_bounds); pixel_bounds = views::GetWindowBoundsForClientBounds( - static_cast(const_cast(this)), - pixel_bounds); + static_cast(const_cast(this)), pixel_bounds); return display::Screen::GetScreen()->ScreenToDIPRectInWindow( view_util::GetNativeWindow(widget_), pixel_bounds); #else @@ -108,11 +101,8 @@ const int kResizeAreaCornerSize = 16; // with a resizable border. Based on AppWindowFrameView and CustomFrameView. class CaptionlessFrameView : public views::NonClientFrameView { public: - CaptionlessFrameView(views::Widget* widget, - CefWindowView* view) - : widget_(widget), - view_(view) { - } + CaptionlessFrameView(views::Widget* widget, CefWindowView* view) + : widget_(widget), view_(view) {} gfx::Rect GetBoundsForClientView() const override { return client_view_bounds_; @@ -139,12 +129,9 @@ class CaptionlessFrameView : public views::NonClientFrameView { // Don't allow overlapping resize handles when the window is maximized or // fullscreen, as it can't be resized in those states. int resize_border_thickness = ResizeBorderThickness(); - int frame_component = GetHTComponentForFrame(point, - resize_border_thickness, - resize_border_thickness, - kResizeAreaCornerSize, - kResizeAreaCornerSize, - can_ever_resize); + int frame_component = GetHTComponentForFrame( + point, resize_border_thickness, resize_border_thickness, + kResizeAreaCornerSize, kResizeAreaCornerSize, can_ever_resize); if (frame_component != HTNOWHERE) return frame_component; @@ -190,28 +177,34 @@ class CaptionlessFrameView : public views::NonClientFrameView { } gfx::Size GetPreferredSize() const override { - return widget_->non_client_view()->GetWindowBoundsForClientBounds( - gfx::Rect(widget_->client_view()->GetPreferredSize())).size(); + return widget_->non_client_view() + ->GetWindowBoundsForClientBounds( + gfx::Rect(widget_->client_view()->GetPreferredSize())) + .size(); } gfx::Size GetMinimumSize() const override { - return widget_->non_client_view()->GetWindowBoundsForClientBounds( - gfx::Rect(widget_->client_view()->GetMinimumSize())).size(); + return widget_->non_client_view() + ->GetWindowBoundsForClientBounds( + gfx::Rect(widget_->client_view()->GetMinimumSize())) + .size(); } gfx::Size GetMaximumSize() const override { gfx::Size max_size = widget_->client_view()->GetMaximumSize(); gfx::Size converted_size = - widget_->non_client_view()->GetWindowBoundsForClientBounds( - gfx::Rect(max_size)).size(); + widget_->non_client_view() + ->GetWindowBoundsForClientBounds(gfx::Rect(max_size)) + .size(); return gfx::Size(max_size.width() == 0 ? 0 : converted_size.width(), max_size.height() == 0 ? 0 : converted_size.height()); } private: int ResizeBorderThickness() const { - return (widget_->IsMaximized() || widget_->IsFullscreen() ? - 0 : kResizeBorderThickness); + return (widget_->IsMaximized() || widget_->IsFullscreen() + ? 0 + : kResizeBorderThickness); } // Not owned by this object. @@ -225,8 +218,8 @@ class CaptionlessFrameView : public views::NonClientFrameView { }; bool IsWindowBorderHit(int code) { - // On Windows HTLEFT = 10 and HTBORDER = 18. Values are not ordered the same - // in base/hit_test.h for non-Windows platforms. +// On Windows HTLEFT = 10 and HTBORDER = 18. Values are not ordered the same +// in base/hit_test.h for non-Windows platforms. #if defined(OS_WIN) return code >= HTLEFT && code <= HTBORDER; #else @@ -240,9 +233,9 @@ bool IsWindowBorderHit(int code) { CefWindowView::CefWindowView(CefWindowDelegate* cef_delegate, Delegate* window_delegate) - : ParentClass(cef_delegate), - window_delegate_(window_delegate), - is_frameless_(false) { + : ParentClass(cef_delegate), + window_delegate_(window_delegate), + is_frameless_(false) { DCHECK(window_delegate_); } @@ -295,7 +288,7 @@ void CefWindowView::CreateWidget() { }; enum { MWM_HINTS_FUNCTIONS = (1L << 0), - MWM_HINTS_DECORATIONS = (1L << 1), + MWM_HINTS_DECORATIONS = (1L << 1), MWM_FUNC_ALL = (1L << 0), MWM_FUNC_RESIZE = (1L << 1), @@ -310,7 +303,7 @@ void CefWindowView::CreateWidget() { hints.flags = MWM_HINTS_DECORATIONS; hints.decorations = 0; XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32, - PropModeReplace, (unsigned char *)&hints, 5); + PropModeReplace, (unsigned char*)&hints, 5); } #endif // defined(OS_LINUX) } @@ -357,15 +350,15 @@ base::string16 CefWindowView::GetWindowTitle() const { gfx::ImageSkia CefWindowView::GetWindowIcon() { if (!window_icon_) return ParentClass::GetWindowIcon(); - return static_cast(window_icon_.get())-> - GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + return static_cast(window_icon_.get()) + ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); } gfx::ImageSkia CefWindowView::GetWindowAppIcon() { if (!window_app_icon_) return ParentClass::GetWindowAppIcon(); - return static_cast(window_app_icon_.get())-> - GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + return static_cast(window_app_icon_.get()) + ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); } void CefWindowView::WindowClosing() { @@ -383,7 +376,7 @@ views::ClientView* CefWindowView::CreateClientView(views::Widget* widget) { } views::NonClientFrameView* CefWindowView::CreateNonClientFrameView( - views::Widget* widget) { + views::Widget* widget) { if (is_frameless_) { // Custom frame type that doesn't render a caption. return new CaptionlessFrameView(widget, this); @@ -477,9 +470,7 @@ void CefWindowView::SetDraggableRegions( draggable_region_.reset(new SkRegion); for (const CefDraggableRegion& region : regions) { draggable_region_->op( - region.bounds.x, - region.bounds.y, - region.bounds.x + region.bounds.width, + region.bounds.x, region.bounds.y, region.bounds.x + region.bounds.width, region.bounds.y + region.bounds.height, region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); } diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index a65cdae57..005668c71 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -18,8 +18,8 @@ class SkRegion; // Manages the views-based root window. This object will be deleted // automatically when the associated root window is destroyed. -class CefWindowView : - public CefPanelView { +class CefWindowView + : public CefPanelView { public: typedef CefPanelView ParentClass; @@ -41,8 +41,7 @@ class CefWindowView : // |cef_delegate| may be nullptr. // |window_delegate| must be non-nullptr. - CefWindowView(CefWindowDelegate* cef_delegate, - Delegate* window_delegate); + CefWindowView(CefWindowDelegate* cef_delegate, Delegate* window_delegate); // Create the Widget. void CreateWidget(); @@ -94,8 +93,7 @@ class CefWindowView : CefRefPtr window_app_icon() const { return window_app_icon_; } // Set/get the draggable regions. - void SetDraggableRegions( - const std::vector& regions); + void SetDraggableRegions(const std::vector& regions); SkRegion* draggable_region() const { return draggable_region_.get(); } // Returns the NonClientFrameView for this Window. May be nullptr. diff --git a/libcef/browser/web_plugin_impl.cc b/libcef/browser/web_plugin_impl.cc index 9788a3592..102403aa4 100644 --- a/libcef/browser/web_plugin_impl.cc +++ b/libcef/browser/web_plugin_impl.cc @@ -37,7 +37,8 @@ void DeliverWidevineCdmError(const std::string& error_message, CefRefPtr callback) { LOG(ERROR) << error_message; if (callback.get()) { - CEF_POST_TASK(CEF_UIT, + CEF_POST_TASK( + CEF_UIT, base::Bind(&CefRegisterCdmCallback::OnCdmRegistrationComplete, callback.get(), CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED, error_message)); @@ -48,13 +49,11 @@ void DeliverWidevineCdmError(const std::string& error_message, } // namespace - // CefWebPluginInfoImpl CefWebPluginInfoImpl::CefWebPluginInfoImpl( const content::WebPluginInfo& plugin_info) - : plugin_info_(plugin_info) { -} + : plugin_info_(plugin_info) {} CefString CefWebPluginInfoImpl::GetName() { return plugin_info_.name; @@ -72,7 +71,6 @@ CefString CefWebPluginInfoImpl::GetDescription() { return plugin_info_.desc; } - // Global functions. void CefVisitWebPluginInfo(CefRefPtr visitor) { @@ -145,9 +143,8 @@ void CefRegisterWebPluginCrash(const CefString& path) { } } -void CefIsWebPluginUnstable( - const CefString& path, - CefRefPtr callback) { +void CefIsWebPluginUnstable(const CefString& path, + CefRefPtr callback) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -160,9 +157,9 @@ void CefIsWebPluginUnstable( } if (CEF_CURRENTLY_ON_IOT()) { - callback->IsUnstable(path, - content::PluginServiceImpl::GetInstance()->IsPluginUnstable( - base::FilePath(path))); + callback->IsUnstable( + path, content::PluginServiceImpl::GetInstance()->IsPluginUnstable( + base::FilePath(path))); } else { // Execute on the IO thread. CEF_POST_TASK(CEF_IOT, base::Bind(CefIsWebPluginUnstable, path, callback)); diff --git a/libcef/browser/web_plugin_impl.h b/libcef/browser/web_plugin_impl.h index 2a4fbee68..2e5842536 100644 --- a/libcef/browser/web_plugin_impl.h +++ b/libcef/browser/web_plugin_impl.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_BROWSER_WEB_PLUGIN_IMPL_H_ #pragma once -#include "include/cef_web_plugin.h" #include "content/public/common/webplugininfo.h" +#include "include/cef_web_plugin.h" class CefWebPluginInfoImpl : public CefWebPluginInfo { public: diff --git a/libcef/browser/x509_cert_principal_impl.cc b/libcef/browser/x509_cert_principal_impl.cc index cf2f07e4e..233447bf4 100644 --- a/libcef/browser/x509_cert_principal_impl.cc +++ b/libcef/browser/x509_cert_principal_impl.cc @@ -22,8 +22,7 @@ void TransferVector(const std::vector& source, CefX509CertPrincipalImpl::CefX509CertPrincipalImpl( const net::CertPrincipal& value) - : value_(value) { -} + : value_(value) {} CefString CefX509CertPrincipalImpl::GetDisplayName() { return value_.GetDisplayName(); diff --git a/libcef/browser/x509_certificate_impl.cc b/libcef/browser/x509_certificate_impl.cc index 1002d0cb2..23459a9f5 100644 --- a/libcef/browser/x509_certificate_impl.cc +++ b/libcef/browser/x509_certificate_impl.cc @@ -2,18 +2,19 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/browser/x509_certificate_impl.h" #include "libcef/browser/x509_cert_principal_impl.h" +#include "libcef/browser/x509_certificate_impl.h" #include "libcef/common/time_util.h" namespace { CefRefPtr EncodeCertificate( - const net::X509Certificate::OSCertHandle& os_handle, bool der) { + const net::X509Certificate::OSCertHandle& os_handle, + bool der) { CefRefPtr bin_encoded; std::string encoded; - if (( der && net::X509Certificate::GetDEREncoded(os_handle, &encoded)) || + if ((der && net::X509Certificate::GetDEREncoded(os_handle, &encoded)) || (!der && net::X509Certificate::GetPEMEncoded(os_handle, &encoded))) { bin_encoded = CefBinaryValue::Create(encoded.c_str(), encoded.size()); } @@ -25,8 +26,7 @@ CefRefPtr EncodeCertificate( CefX509CertificateImpl::CefX509CertificateImpl( scoped_refptr cert) - :cert_(cert) { -} + : cert_(cert) {} CefRefPtr CefX509CertificateImpl::GetSubject() { if (cert_) @@ -93,13 +93,15 @@ size_t CefX509CertificateImpl::GetIssuerChainSize() { } void CefX509CertificateImpl::GetEncodedIssuerChain( - CefX509Certificate::IssuerChainBinaryList& chain, bool der) { + CefX509Certificate::IssuerChainBinaryList& chain, + bool der) { chain.clear(); if (cert_) { const net::X509Certificate::OSCertHandles& handles = cert_->GetIntermediateCertificates(); for (net::X509Certificate::OSCertHandles::const_iterator it = - handles.begin(); it != handles.end(); it++) { + handles.begin(); + it != handles.end(); it++) { // Add each to the chain, even if one conversion unexpectedly failed. // GetIssuerChainSize depends on these being the same length. chain.push_back(EncodeCertificate(*it, der)); diff --git a/libcef/browser/xml_reader_impl.cc b/libcef/browser/xml_reader_impl.cc index b66ea6326..729f0d3c8 100644 --- a/libcef/browser/xml_reader_impl.cc +++ b/libcef/browser/xml_reader_impl.cc @@ -2,9 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/browser/xml_reader_impl.h" -#include "include/cef_stream.h" #include "base/logging.h" +#include "include/cef_stream.h" +#include "libcef/browser/xml_reader_impl.h" // Static functions @@ -18,7 +18,6 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, return impl.get(); } - // CefXmlReaderImpl namespace { @@ -33,7 +32,7 @@ namespace { * * Returns the number of bytes read or -1 in case of error */ -int XMLCALL xml_read_callback(void * context, char * buffer, int len) { +int XMLCALL xml_read_callback(void* context, char* buffer, int len) { CefRefPtr reader(static_cast(context)); return reader->Read(buffer, 1, len); } @@ -47,15 +46,16 @@ int XMLCALL xml_read_callback(void * context, char * buffer, int len) { * * Signature of an error callback from a reader parser */ -void XMLCALL xml_error_callback(void *arg, const char *msg, +void XMLCALL xml_error_callback(void* arg, + const char* msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { if (!msg) return; std::string error_str(msg); - if (!error_str.empty() && error_str[error_str.length()-1] == '\n') - error_str.resize(error_str.length()-1); + if (!error_str.empty() && error_str[error_str.length() - 1] == '\n') + error_str.resize(error_str.length() - 1); std::stringstream ss; ss << error_str << ", line " << xmlTextReaderLocatorLineNumber(locator); @@ -74,13 +74,13 @@ void XMLCALL xml_error_callback(void *arg, const char *msg, * Signature of the function to use when there is an error and * the module handles the new error reporting mechanism. */ -void XMLCALL xml_structured_error_callback(void *userData, xmlErrorPtr error) { +void XMLCALL xml_structured_error_callback(void* userData, xmlErrorPtr error) { if (!error->message) return; std::string error_str(error->message); - if (!error_str.empty() && error_str[error_str.length()-1] == '\n') - error_str.resize(error_str.length()-1); + if (!error_str.empty() && error_str[error_str.length() - 1] == '\n') + error_str.resize(error_str.length() - 1); std::stringstream ss; ss << error_str << ", line " << error->line; @@ -107,8 +107,7 @@ CefString xmlCharToString(const xmlChar* xmlStr, bool free) { } // namespace CefXmlReaderImpl::CefXmlReaderImpl() - : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL) { -} + : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL) {} CefXmlReaderImpl::~CefXmlReaderImpl() { if (reader_ != NULL) { @@ -165,8 +164,8 @@ bool CefXmlReaderImpl::Initialize(CefRefPtr stream, // Register the error callbacks. xmlTextReaderSetErrorHandler(reader_, xml_error_callback, this); - xmlTextReaderSetStructuredErrorHandler(reader_, - xml_structured_error_callback, this); + xmlTextReaderSetStructuredErrorHandler(reader_, xml_structured_error_callback, + this); return true; } @@ -344,8 +343,9 @@ CefString CefXmlReaderImpl::GetAttribute(const CefString& qualifiedName) { return CefString(); std::string qualifiedNameStr = qualifiedName; - return xmlCharToString(xmlTextReaderGetAttribute(reader_, - BAD_CAST qualifiedNameStr.c_str()), true); + return xmlCharToString( + xmlTextReaderGetAttribute(reader_, BAD_CAST qualifiedNameStr.c_str()), + true); } CefString CefXmlReaderImpl::GetAttribute(const CefString& localName, @@ -355,8 +355,10 @@ CefString CefXmlReaderImpl::GetAttribute(const CefString& localName, std::string localNameStr = localName; std::string namespaceURIStr = namespaceURI; - return xmlCharToString(xmlTextReaderGetAttributeNs(reader_, - BAD_CAST localNameStr.c_str(), BAD_CAST namespaceURIStr.c_str()), true); + return xmlCharToString( + xmlTextReaderGetAttributeNs(reader_, BAD_CAST localNameStr.c_str(), + BAD_CAST namespaceURIStr.c_str()), + true); } CefString CefXmlReaderImpl::GetInnerXml() { @@ -393,7 +395,9 @@ bool CefXmlReaderImpl::MoveToAttribute(const CefString& qualifiedName) { std::string qualifiedNameStr = qualifiedName; return xmlTextReaderMoveToAttribute(reader_, - BAD_CAST qualifiedNameStr.c_str()) == 1 ? true : false; + BAD_CAST qualifiedNameStr.c_str()) == 1 + ? true + : false; } bool CefXmlReaderImpl::MoveToAttribute(const CefString& localName, @@ -403,9 +407,10 @@ bool CefXmlReaderImpl::MoveToAttribute(const CefString& localName, std::string localNameStr = localName; std::string namespaceURIStr = namespaceURI; - return xmlTextReaderMoveToAttributeNs(reader_, - BAD_CAST localNameStr.c_str(), BAD_CAST namespaceURIStr.c_str()) == 1 ? - true : false; + return xmlTextReaderMoveToAttributeNs(reader_, BAD_CAST localNameStr.c_str(), + BAD_CAST namespaceURIStr.c_str()) == 1 + ? true + : false; } bool CefXmlReaderImpl::MoveToFirstAttribute() { diff --git a/libcef/browser/xml_reader_impl.h b/libcef/browser/xml_reader_impl.h index 7afb51cb0..eafa63f73 100644 --- a/libcef/browser/xml_reader_impl.h +++ b/libcef/browser/xml_reader_impl.h @@ -9,8 +9,8 @@ #include #include -#include "include/cef_xml_reader.h" #include "base/threading/platform_thread.h" +#include "include/cef_xml_reader.h" // Implementation of CefXmlReader class CefXmlReaderImpl : public CefXmlReader { @@ -20,7 +20,8 @@ class CefXmlReaderImpl : public CefXmlReader { // Initialize the reader context. bool Initialize(CefRefPtr stream, - EncodingType encodingType, const CefString& URI); + EncodingType encodingType, + const CefString& URI); bool MoveToNextNode() override; bool Close() override; diff --git a/libcef/browser/zip_reader_impl.cc b/libcef/browser/zip_reader_impl.cc index 4f509c495..e0f3cf098 100644 --- a/libcef/browser/zip_reader_impl.cc +++ b/libcef/browser/zip_reader_impl.cc @@ -2,10 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/browser/zip_reader_impl.h" #include -#include "include/cef_stream.h" #include "base/logging.h" +#include "include/cef_stream.h" +#include "libcef/browser/zip_reader_impl.h" // Static functions @@ -18,19 +18,19 @@ CefRefPtr CefZipReader::Create( return impl.get(); } - // CefZipReaderImpl namespace { -voidpf ZCALLBACK zlib_open_callback OF((voidpf opaque, const void* filename, - int mode)) { +voidpf ZCALLBACK zlib_open_callback OF((voidpf opaque, + const void* filename, + int mode)) { // The stream is already implicitly open so just return the pointer. return opaque; } -uLong ZCALLBACK zlib_read_callback OF((voidpf opaque, voidpf stream, void* buf, - uLong size)) { +uLong ZCALLBACK zlib_read_callback +OF((voidpf opaque, voidpf stream, void* buf, uLong size)) { CefRefPtr reader(static_cast(opaque)); return reader->Read(buf, 1, size); } @@ -40,9 +40,8 @@ ZPOS64_T ZCALLBACK zlib_tell_callback OF((voidpf opaque, voidpf stream)) { return reader->Tell(); } -long ZCALLBACK zlib_seek_callback OF((voidpf opaque, // NOLINT(runtime/int) - voidpf stream, ZPOS64_T offset, - int origin)) { +long ZCALLBACK zlib_seek_callback +OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)) { CefRefPtr reader(static_cast(opaque)); int whence; switch (origin) { @@ -76,12 +75,12 @@ int ZCALLBACK zlib_error_callback OF((voidpf opaque, voidpf stream)) { } // namespace CefZipReaderImpl::CefZipReaderImpl() - : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL), - has_fileopen_(false), - has_fileinfo_(false), - filesize_(0), - filemodified_(0) { -} + : supported_thread_id_(base::PlatformThread::CurrentId()), + reader_(NULL), + has_fileopen_(false), + has_fileinfo_(false), + filesize_(0), + filemodified_(0) {} CefZipReaderImpl::~CefZipReaderImpl() { if (reader_ != NULL) { diff --git a/libcef/browser/zip_reader_impl.h b/libcef/browser/zip_reader_impl.h index 18d5298c9..722dbf959 100644 --- a/libcef/browser/zip_reader_impl.h +++ b/libcef/browser/zip_reader_impl.h @@ -8,8 +8,8 @@ #include -#include "include/cef_zip_reader.h" #include "base/threading/platform_thread.h" +#include "include/cef_zip_reader.h" #include "third_party/zlib/contrib/minizip/unzip.h" // Implementation of CefZipReader diff --git a/libcef/common/base_impl.cc b/libcef/common/base_impl.cc index f3b3e6cbb..60b3b76b4 100644 --- a/libcef/common/base_impl.cc +++ b/libcef/common/base_impl.cc @@ -6,12 +6,13 @@ #if defined(OS_WIN) #include + #include #endif -#include "include/internal/cef_trace_event_internal.h" #include "include/internal/cef_logging_internal.h" #include "include/internal/cef_thread_internal.h" +#include "include/internal/cef_trace_event_internal.h" #include "base/logging.h" #include "base/threading/platform_thread.h" @@ -26,11 +27,10 @@ namespace { // Win8.1 supports monitor-specific DPI scaling. bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { - typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); + typedef HRESULT(WINAPI * SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); SetProcessDpiAwarenessPtr set_process_dpi_awareness_func = - reinterpret_cast( - GetProcAddress(GetModuleHandleA("user32.dll"), - "SetProcessDpiAwarenessInternal")); + reinterpret_cast(GetProcAddress( + GetModuleHandleA("user32.dll"), "SetProcessDpiAwarenessInternal")); if (set_process_dpi_awareness_func) { HRESULT hr = set_process_dpi_awareness_func(value); if (SUCCEEDED(hr)) { @@ -38,7 +38,7 @@ bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { return true; } else if (hr == E_ACCESSDENIED) { LOG(ERROR) << "Access denied error from SetProcessDpiAwareness. " - "Function called twice, or manifest was used."; + "Function called twice, or manifest was used."; } } return false; @@ -47,13 +47,11 @@ bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { // This function works for Windows Vista through Win8. Win8.1 must use // SetProcessDpiAwareness[Wrapper]. BOOL SetProcessDPIAwareWrapper() { - typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); + typedef BOOL(WINAPI * SetProcessDPIAwarePtr)(VOID); SetProcessDPIAwarePtr set_process_dpi_aware_func = reinterpret_cast( - GetProcAddress(GetModuleHandleA("user32.dll"), - "SetProcessDPIAware")); - return set_process_dpi_aware_func && - set_process_dpi_aware_func(); + GetProcAddress(GetModuleHandleA("user32.dll"), "SetProcessDPIAware")); + return set_process_dpi_aware_func && set_process_dpi_aware_func(); } void EnableHighDPISupport() { @@ -79,7 +77,6 @@ void base_impl_stub() {} #pragma optimize("", on) #endif - CEF_EXPORT void cef_trace_event_instant(const char* category, const char* name, const char* arg1_name, @@ -106,11 +103,11 @@ CEF_EXPORT void cef_trace_event_instant(const char* category, if (arg1_name == NULL && arg2_name == NULL) { TRACE_EVENT_INSTANT0(category, name, TRACE_EVENT_SCOPE_THREAD); } else if (arg2_name == NULL) { - TRACE_EVENT_INSTANT1(category, name, TRACE_EVENT_SCOPE_THREAD, - arg1_name, arg1_val); + TRACE_EVENT_INSTANT1(category, name, TRACE_EVENT_SCOPE_THREAD, arg1_name, + arg1_val); } else { - TRACE_EVENT_INSTANT2(category, name, TRACE_EVENT_SCOPE_THREAD, - arg1_name, arg1_val, arg2_name, arg2_val); + TRACE_EVENT_INSTANT2(category, name, TRACE_EVENT_SCOPE_THREAD, arg1_name, + arg1_val, arg2_name, arg2_val); } } } @@ -133,8 +130,8 @@ CEF_EXPORT void cef_trace_event_begin(const char* category, } else if (arg2_name == NULL) { TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val); } else { - TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, - arg2_name, arg2_val); + TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, + arg2_val); } } else { if (arg1_name == NULL && arg2_name == NULL) { @@ -142,8 +139,8 @@ CEF_EXPORT void cef_trace_event_begin(const char* category, } else if (arg2_name == NULL) { TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val); } else { - TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, - arg2_name, arg2_val); + TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, arg2_name, + arg2_val); } } } @@ -166,8 +163,8 @@ CEF_EXPORT void cef_trace_event_end(const char* category, } else if (arg2_name == NULL) { TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val); } else { - TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, - arg2_name, arg2_val); + TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, arg2_name, + arg2_val); } } else { if (arg1_name == NULL && arg2_name == NULL) { @@ -175,8 +172,8 @@ CEF_EXPORT void cef_trace_event_end(const char* category, } else if (arg2_name == NULL) { TRACE_EVENT_END1(category, name, arg1_name, arg1_val); } else { - TRACE_EVENT_END2(category, name, arg1_name, arg1_val, - arg2_name, arg2_val); + TRACE_EVENT_END2(category, name, arg1_name, arg1_val, arg2_name, + arg2_val); } } } @@ -197,15 +194,15 @@ CEF_EXPORT void cef_trace_counter(const char* category, if (value1_name == NULL && value2_name == NULL) { TRACE_COPY_COUNTER1(category, name, value1_val); } else { - TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, - value2_name, value2_val); + TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, value2_name, + value2_val); } } else { if (value1_name == NULL && value2_name == NULL) { TRACE_COUNTER1(category, name, value1_val); } else { - TRACE_COUNTER2(category, name, value1_name, value1_val, - value2_name, value2_val); + TRACE_COUNTER2(category, name, value1_name, value1_val, value2_name, + value2_val); } } } @@ -227,8 +224,8 @@ CEF_EXPORT void cef_trace_counter_id(const char* category, if (value1_name == NULL && value2_name == NULL) { TRACE_COPY_COUNTER_ID1(category, name, id, value1_val); } else { - TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, - value1_val, value2_name, value2_val); + TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, + value2_name, value2_val); } } else { if (value1_name == NULL && value2_name == NULL) { @@ -289,18 +286,19 @@ CEF_EXPORT void cef_trace_event_async_step_into(const char* category, if (copy) { if (arg1_name == NULL) { INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step); + category, name, id, + TRACE_EVENT_FLAG_COPY, "step", step); } else { - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, - arg1_name, arg1_val); + INTERNAL_TRACE_EVENT_ADD_WITH_ID( + TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category, name, id, + TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val); } } else { if (arg1_name == NULL) { TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step); } else { - TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, - arg1_name, arg1_val); + TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, arg1_name, + arg1_val); } } } @@ -320,18 +318,19 @@ CEF_EXPORT void cef_trace_event_async_step_past(const char* category, if (copy) { if (arg1_name == NULL) { INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step); + category, name, id, + TRACE_EVENT_FLAG_COPY, "step", step); } else { - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, - arg1_name, arg1_val); + INTERNAL_TRACE_EVENT_ADD_WITH_ID( + TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category, name, id, + TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val); } } else { if (arg1_name == NULL) { TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step); } else { - TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, - arg1_name, arg1_val); + TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, arg1_name, + arg1_val); } } } @@ -353,21 +352,19 @@ CEF_EXPORT void cef_trace_event_async_end(const char* category, if (arg1_name == NULL && arg2_name == NULL) { TRACE_EVENT_COPY_ASYNC_END0(category, name, id); } else if (arg2_name == NULL) { - TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, - arg1_val); + TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val); } else { - TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, - arg1_val, arg2_name, arg2_val); + TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, + arg2_name, arg2_val); } } else { if (arg1_name == NULL && arg2_name == NULL) { TRACE_EVENT_ASYNC_END0(category, name, id); } else if (arg2_name == NULL) { - TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, - arg1_val); + TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val); } else { - TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, - arg1_val, arg2_name, arg2_val); + TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, arg2_name, + arg2_val); } } } @@ -392,7 +389,7 @@ CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id() { } CEF_EXPORT cef_platform_thread_handle_t - cef_get_current_platform_thread_handle() { +cef_get_current_platform_thread_handle() { #if defined(OS_WIN) return base::PlatformThread::CurrentId(); #else diff --git a/libcef/common/cef_crash_report_upload_thread.cc b/libcef/common/cef_crash_report_upload_thread.cc index 242874c3e..db204880c 100644 --- a/libcef/common/cef_crash_report_upload_thread.cc +++ b/libcef/common/cef_crash_report_upload_thread.cc @@ -17,13 +17,9 @@ class CallRecordUploadAttempt { public: CallRecordUploadAttempt(CrashReportDatabase* database, const CrashReportDatabase::Report* report) - : database_(database), - report_(report) { - } + : database_(database), report_(report) {} - ~CallRecordUploadAttempt() { - Fire(); - } + ~CallRecordUploadAttempt() { Fire(); } void Fire() { if (report_) { @@ -33,12 +29,10 @@ class CallRecordUploadAttempt { Disarm(); } - void Disarm() { - report_ = nullptr; - } + void Disarm() { report_ = nullptr; } private: - CrashReportDatabase* database_; // weak + CrashReportDatabase* database_; // weak const CrashReportDatabase::Report* report_; // weak DISALLOW_COPY_AND_ASSIGN(CallRecordUploadAttempt); @@ -53,11 +47,9 @@ CefCrashReportUploadThread::CefCrashReportUploadThread( bool upload_gzip, int max_uploads) : CrashReportUploadThread(database, url, rate_limit, upload_gzip), - max_uploads_(max_uploads) { -} + max_uploads_(max_uploads) {} -CefCrashReportUploadThread::~CefCrashReportUploadThread() { -} +CefCrashReportUploadThread::~CefCrashReportUploadThread() {} void CefCrashReportUploadThread::ProcessPendingReports() { if (BackoffPending()) { @@ -69,7 +61,7 @@ void CefCrashReportUploadThread::ProcessPendingReports() { // Retrieve all completed reports. std::vector reports; if (database_->GetCompletedReports(&reports) != - CrashReportDatabase::kNoError) { + CrashReportDatabase::kNoError) { // The database is sick. It might be prudent to stop trying to poke it // from this thread by abandoning the thread altogether. On the other // hand, if the problem is transient, it might be possible to talk to it @@ -171,8 +163,8 @@ void CefCrashReportUploadThread::ProcessPendingReport( bool CefCrashReportUploadThread::UploadsEnabled() const { Settings* const settings = database_->GetSettings(); bool uploads_enabled; - return !url_.empty() && - settings->GetUploadsEnabled(&uploads_enabled) && uploads_enabled; + return !url_.empty() && settings->GetUploadsEnabled(&uploads_enabled) && + uploads_enabled; } bool CefCrashReportUploadThread::MaxUploadsEnabled() const { @@ -206,12 +198,12 @@ void CefCrashReportUploadThread::IncreaseBackoff() { const int kHour = 60 * 60; // 1 hour const int kBackoffSchedule[] = { - kHour / 4, // 15 minutes - kHour, // 1 hour - kHour * 2, // 2 hours - kHour * 4, // 4 hours - kHour * 8, // 8 hours - kHour * 24, // 24 hours + kHour / 4, // 15 minutes + kHour, // 1 hour + kHour * 2, // 2 hours + kHour * 4, // 4 hours + kHour * 8, // 8 hours + kHour * 24, // 24 hours }; const int kBackoffScheduleSize = sizeof(kBackoffSchedule) / sizeof(kBackoffSchedule[0]); diff --git a/libcef/common/cef_crash_report_upload_thread.h b/libcef/common/cef_crash_report_upload_thread.h index 5c99ba85a..b369688da 100644 --- a/libcef/common/cef_crash_report_upload_thread.h +++ b/libcef/common/cef_crash_report_upload_thread.h @@ -19,7 +19,7 @@ class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread { private: void ProcessPendingReports() override; void ProcessPendingReport( - const crashpad::CrashReportDatabase::Report& report) override; + const crashpad::CrashReportDatabase::Report& report) override; bool UploadsEnabled() const; diff --git a/libcef/common/cef_message_generator.cc b/libcef/common/cef_message_generator.cc index dd6ffb9c3..a410cd1ce 100644 --- a/libcef/common/cef_message_generator.cc +++ b/libcef/common/cef_message_generator.cc @@ -7,32 +7,32 @@ #include "libcef/common/cef_message_generator.h" // Generate constructors. -#include "ipc/struct_constructor_macros.h" #include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h" +#include "ipc/struct_constructor_macros.h" #include "libcef/common/cef_message_generator.h" // Generate destructors. -#include "ipc/struct_destructor_macros.h" #include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h" +#include "ipc/struct_destructor_macros.h" #include "libcef/common/cef_message_generator.h" // Generate param traits write methods. -#include "ipc/param_traits_write_macros.h" #include "chrome/common/safe_browsing/protobuf_message_write_macros.h" +#include "ipc/param_traits_write_macros.h" namespace IPC { #include "libcef/common/cef_message_generator.h" } // namespace IPC // Generate param traits read methods. -#include "ipc/param_traits_read_macros.h" #include "chrome/common/safe_browsing/protobuf_message_read_macros.h" +#include "ipc/param_traits_read_macros.h" namespace IPC { #include "libcef/common/cef_message_generator.h" } // namespace IPC // Generate param traits log methods. -#include "ipc/param_traits_log_macros.h" #include "chrome/common/safe_browsing/protobuf_message_log_macros.h" +#include "ipc/param_traits_log_macros.h" namespace IPC { #include "libcef/common/cef_message_generator.h" } // namespace IPC diff --git a/libcef/common/cef_messages.cc b/libcef/common/cef_messages.cc index cb9e5e2b1..34d74b7a6 100644 --- a/libcef/common/cef_messages.cc +++ b/libcef/common/cef_messages.cc @@ -71,8 +71,8 @@ struct ParamTraits { } }; -void ParamTraits >::Write(base::Pickle* m, - const param_type& p) { +void ParamTraits>::Write(base::Pickle* m, + const param_type& p) { WriteParam(m, p.get() != NULL); if (p.get()) { WriteParam(m, p->elements()); @@ -82,7 +82,7 @@ void ParamTraits >::Write(base::Pickle* m, } } -bool ParamTraits >::Read( +bool ParamTraits>::Read( const base::Pickle* m, base::PickleIterator* iter, param_type* r) { @@ -111,8 +111,8 @@ bool ParamTraits >::Read( return true; } -void ParamTraits >::Log(const param_type& p, - std::string* l) { +void ParamTraits>::Log(const param_type& p, + std::string* l) { l->append(""); } diff --git a/libcef/common/cef_messages.h b/libcef/common/cef_messages.h index 4551e44e5..8ca021a62 100644 --- a/libcef/common/cef_messages.h +++ b/libcef/common/cef_messages.h @@ -14,8 +14,8 @@ #include "base/values.h" #include "content/public/common/common_param_traits.h" #include "content/public/common/referrer.h" -#include "ui/gfx/ipc/gfx_param_traits.h" #include "ipc/ipc_message_macros.h" +#include "ui/gfx/ipc/gfx_param_traits.h" // Singly-included section for enums and custom IPC traits. #ifndef CEF_LIBCEF_COMMON_CEF_MESSAGES_H_ @@ -39,10 +39,11 @@ namespace IPC { // Extracted from chrome/common/automation_messages.h. template <> -struct ParamTraits > { +struct ParamTraits> { typedef scoped_refptr param_type; static void Write(base::Pickle* m, const param_type& p); - static bool Read(const base::Pickle* m, base::PickleIterator* iter, + static bool Read(const base::Pickle* m, + base::PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -51,7 +52,6 @@ struct ParamTraits > { #endif // CEF_LIBCEF_COMMON_CEF_MESSAGES_H_ - // TODO(cef): Re-using the message start for extensions may be problematic in // the future. It would be better if ipc_message_utils.h contained a value // reserved for consumers of the content API. @@ -110,7 +110,6 @@ IPC_STRUCT_BEGIN(Cef_DraggableRegion_Params) IPC_STRUCT_MEMBER(bool, draggable) IPC_STRUCT_END() - // Messages sent from the browser to the renderer. // Parameters for a resource request. @@ -149,27 +148,22 @@ IPC_STRUCT_BEGIN(CefMsg_LoadRequest_Params) IPC_STRUCT_END() // Tell the renderer to load a request. -IPC_MESSAGE_ROUTED1(CefMsg_LoadRequest, - CefMsg_LoadRequest_Params) +IPC_MESSAGE_ROUTED1(CefMsg_LoadRequest, CefMsg_LoadRequest_Params) // Sent when the browser has a request for the renderer. The renderer may // respond with a CefHostMsg_Response. -IPC_MESSAGE_ROUTED1(CefMsg_Request, - Cef_Request_Params) +IPC_MESSAGE_ROUTED1(CefMsg_Request, Cef_Request_Params) // Optional message sent in response to a CefHostMsg_Request. -IPC_MESSAGE_ROUTED1(CefMsg_Response, - Cef_Response_Params) +IPC_MESSAGE_ROUTED1(CefMsg_Response, Cef_Response_Params) // Optional Ack message sent to the browser to notify that a CefHostMsg_Response // has been processed. -IPC_MESSAGE_ROUTED1(CefMsg_ResponseAck, - int /* request_id */) +IPC_MESSAGE_ROUTED1(CefMsg_ResponseAck, int /* request_id */) // Tells the render frame to load all blocked plugins with the given identifier. // Based on ChromeViewMsg_LoadBlockedPlugins. -IPC_MESSAGE_ROUTED1(CefViewMsg_LoadBlockedPlugins, - std::string /* identifier */) +IPC_MESSAGE_ROUTED1(CefViewMsg_LoadBlockedPlugins, std::string /* identifier */) // Sent on process startup to indicate whether this process is running in // incognito mode. Based on ChromeViewMsg_SetIsIncognitoProcess. @@ -184,7 +178,6 @@ IPC_MESSAGE_CONTROL2(CefProcessMsg_ModifyCrossOriginWhitelistEntry, // Sent to child processes to clear the cross-origin whitelist. IPC_MESSAGE_CONTROL0(CefProcessMsg_ClearCrossOriginWhitelist) - // Messages sent from the renderer to the browser. // Parameters for a newly created render thread. @@ -268,17 +261,14 @@ IPC_MESSAGE_ROUTED4(CefHostMsg_DidFinishLoad, // Sent when the renderer has a request for the browser. The browser may respond // with a CefMsg_Response. -IPC_MESSAGE_ROUTED1(CefHostMsg_Request, - Cef_Request_Params) +IPC_MESSAGE_ROUTED1(CefHostMsg_Request, Cef_Request_Params) // Optional message sent in response to a CefMsg_Request. -IPC_MESSAGE_ROUTED1(CefHostMsg_Response, - Cef_Response_Params) +IPC_MESSAGE_ROUTED1(CefHostMsg_Response, Cef_Response_Params) // Optional Ack message sent to the browser to notify that a CefMsg_Response // has been processed. -IPC_MESSAGE_ROUTED1(CefHostMsg_ResponseAck, - int /* request_id */) +IPC_MESSAGE_ROUTED1(CefHostMsg_ResponseAck, int /* request_id */) // Sent by the renderer when the draggable regions are updated. IPC_MESSAGE_ROUTED1(CefHostMsg_UpdateDraggableRegions, diff --git a/libcef/common/cef_switches.cc b/libcef/common/cef_switches.cc index 23650cc0f..1d77af4dd 100644 --- a/libcef/common/cef_switches.cc +++ b/libcef/common/cef_switches.cc @@ -7,34 +7,33 @@ namespace switches { // Log file path. -const char kLogFile[] = "log-file"; +const char kLogFile[] = "log-file"; // Severity of messages to log. -const char kLogSeverity[] = "log-severity"; -const char kLogSeverity_Verbose[] = "verbose"; -const char kLogSeverity_Info[] = "info"; -const char kLogSeverity_Warning[] = "warning"; -const char kLogSeverity_Error[] = "error"; -const char kLogSeverity_Disable[] = "disable"; +const char kLogSeverity[] = "log-severity"; +const char kLogSeverity_Verbose[] = "verbose"; +const char kLogSeverity_Info[] = "info"; +const char kLogSeverity_Warning[] = "warning"; +const char kLogSeverity_Error[] = "error"; +const char kLogSeverity_Disable[] = "disable"; // Path to resources directory. -const char kResourcesDirPath[] = "resources-dir-path"; +const char kResourcesDirPath[] = "resources-dir-path"; // Path to locales directory. -const char kLocalesDirPath[] = "locales-dir-path"; +const char kLocalesDirPath[] = "locales-dir-path"; // Path to locales directory. -const char kDisablePackLoading[] = "disable-pack-loading"; +const char kDisablePackLoading[] = "disable-pack-loading"; // Stack size for uncaught exceptions. -const char kUncaughtExceptionStackSize[] = "uncaught-exception-stack-size"; +const char kUncaughtExceptionStackSize[] = "uncaught-exception-stack-size"; // Default encoding. -const char kDefaultEncoding[] = "default-encoding"; +const char kDefaultEncoding[] = "default-encoding"; // Disable opening of windows via JavaScript. -const char kDisableJavascriptOpenWindows[] = - "disable-javascript-open-windows"; +const char kDisableJavascriptOpenWindows[] = "disable-javascript-open-windows"; // Disable closing of windows via JavaScript. const char kDisableJavascriptCloseWindows[] = @@ -45,7 +44,7 @@ const char kDisableJavascriptAccessClipboard[] = "disable-javascript-access-clipboard"; // Disable DOM paste via JavaScript execCommand("paste"). -const char kDisableJavascriptDomPaste[] = "disable-javascript-dom-paste"; +const char kDisableJavascriptDomPaste[] = "disable-javascript-dom-paste"; // Allow universal access from file URLs. const char kAllowUniversalAccessFromFileUrls[] = @@ -53,72 +52,72 @@ const char kAllowUniversalAccessFromFileUrls[] = // Disable loading of images from the network. A cached image will still be // rendered if requested. -const char kDisableImageLoading[] = "disable-image-loading"; +const char kDisableImageLoading[] = "disable-image-loading"; // Shrink stand-alone images to fit. -const char kImageShrinkStandaloneToFit[] = "image-shrink-standalone-to-fit"; +const char kImageShrinkStandaloneToFit[] = "image-shrink-standalone-to-fit"; // Disable resizing of text areas. -const char kDisableTextAreaResize[] = "disable-text-area-resize"; +const char kDisableTextAreaResize[] = "disable-text-area-resize"; // Disable using the tab key to advance focus to links. -const char kDisableTabToLinks[] = "disable-tab-to-links"; +const char kDisableTabToLinks[] = "disable-tab-to-links"; // Persist session cookies. -const char kPersistSessionCookies[] = "persist-session-cookies"; +const char kPersistSessionCookies[] = "persist-session-cookies"; // Persist user preferences. -const char kPersistUserPreferences[] = "persist-user-preferences"; +const char kPersistUserPreferences[] = "persist-user-preferences"; // Enable media (WebRTC audio/video) streaming. -const char kEnableMediaStream[] = "enable-media-stream"; +const char kEnableMediaStream[] = "enable-media-stream"; // Enable speech input (x-webkit-speech). -const char kEnableSpeechInput[] = "enable-speech-input"; +const char kEnableSpeechInput[] = "enable-speech-input"; // Enable the speech input profanity filter. -const char kEnableProfanityFilter[] = "enable-profanity-filter"; +const char kEnableProfanityFilter[] = "enable-profanity-filter"; // Disable spell checking. -const char kDisableSpellChecking[] = "disable-spell-checking"; +const char kDisableSpellChecking[] = "disable-spell-checking"; // Enable the remote spelling service. -const char kEnableSpellingService[] = "enable-spelling-service"; +const char kEnableSpellingService[] = "enable-spelling-service"; // Override the default spellchecking language which comes from locales.pak. -const char kOverrideSpellCheckLang[] = "override-spell-check-lang"; +const char kOverrideSpellCheckLang[] = "override-spell-check-lang"; // Enable detection and use of a system-wide Pepper Flash install. -const char kEnableSystemFlash[] = "enable-system-flash"; +const char kEnableSystemFlash[] = "enable-system-flash"; // Disable scroll bounce (rubber-banding) on OS X Lion and newer. -const char kDisableScrollBounce[] = "disable-scroll-bounce"; +const char kDisableScrollBounce[] = "disable-scroll-bounce"; // Disable the PDF extension. -const char kDisablePdfExtension[] = "disable-pdf-extension"; +const char kDisablePdfExtension[] = "disable-pdf-extension"; // Path to Widevine CDM binaries. -const char kWidevineCdmPath[] = "widevine-cdm-path"; +const char kWidevineCdmPath[] = "widevine-cdm-path"; // Default plugin policy action. -const char kPluginPolicy[] = "plugin-policy"; +const char kPluginPolicy[] = "plugin-policy"; // Allow the content. This is the default value. -const char kPluginPolicy_Allow[] = "allow"; +const char kPluginPolicy_Allow[] = "allow"; // Allow important content and block unimportant content based on heuristics. // The user can manually load blocked content. -const char kPluginPolicy_Detect[] = "detect"; +const char kPluginPolicy_Detect[] = "detect"; // Block the content. The user can manually load blocked content. -const char kPluginPolicy_Block[] = "block"; +const char kPluginPolicy_Block[] = "block"; // Expose preferences used only by unit tests. -const char kEnablePreferenceTesting[] = "enable-preference-testing"; +const char kEnablePreferenceTesting[] = "enable-preference-testing"; // Enable date-based expiration of built in network security information. const char kEnableNetSecurityExpiration[] = "enable-net-security-expiration"; #if defined(OS_MACOSX) // Path to the framework directory. -const char kFrameworkDirPath[] = "framework-dir-path"; +const char kFrameworkDirPath[] = "framework-dir-path"; #endif } // namespace switches diff --git a/libcef/common/command_line_impl.cc b/libcef/common/command_line_impl.cc index b61911060..182727f5e 100644 --- a/libcef/common/command_line_impl.cc +++ b/libcef/common/command_line_impl.cc @@ -10,10 +10,12 @@ CefCommandLineImpl::CefCommandLineImpl(base::CommandLine* value, bool will_delete, bool read_only) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - read_only, NULL) { -} + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + read_only, + NULL) {} bool CefCommandLineImpl::IsValid() { return !detached(); @@ -25,8 +27,8 @@ bool CefCommandLineImpl::IsReadOnly() { CefRefPtr CefCommandLineImpl::Copy() { CEF_VALUE_VERIFY_RETURN(false, NULL); - return new CefCommandLineImpl( - new base::CommandLine(const_value().argv()), true, false); + return new CefCommandLineImpl(new base::CommandLine(const_value().argv()), + true, false); } void CefCommandLineImpl::InitFromArgv(int argc, const char* const* argv) { @@ -137,7 +139,6 @@ void CefCommandLineImpl::PrependWrapper(const CefString& wrapper) { mutable_value()->PrependWrapper(wrapper); } - // CefCommandLine implementation. // static diff --git a/libcef/common/command_line_impl.h b/libcef/common/command_line_impl.h index b07e7f646..ed4761a11 100644 --- a/libcef/common/command_line_impl.h +++ b/libcef/common/command_line_impl.h @@ -12,8 +12,8 @@ #include "base/command_line.h" // CefCommandLine implementation -class CefCommandLineImpl : - public CefValueBase { +class CefCommandLineImpl + : public CefValueBase { public: CefCommandLineImpl(base::CommandLine* value, bool will_delete, diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index 8b641ae14..9f333b99f 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -17,10 +17,10 @@ #include "libcef/common/scheme_registrar_impl.h" #include "base/command_line.h" -#include "base/logging.h" -#include "base/path_service.h" #include "base/files/file_util.h" #include "base/json/json_reader.h" +#include "base/logging.h" +#include "base/path_service.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -50,10 +50,9 @@ CefContentClient* g_content_client = NULL; const char kPDFPluginExtension[] = "pdf"; const char kPDFPluginDescription[] = "Portable Document Format"; -const char kPDFPluginOutOfProcessMimeType[] = - "application/x-google-chrome-pdf"; -const uint32_t kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | - ppapi::PERMISSION_DEV; +const char kPDFPluginOutOfProcessMimeType[] = "application/x-google-chrome-pdf"; +const uint32_t kPDFPluginPermissions = + ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; content::PepperPluginInfo::GetInterfaceFunc g_pdf_get_interface; content::PepperPluginInfo::PPP_InitializeModuleFunc g_pdf_initialize_module; @@ -73,10 +72,9 @@ void ComputeBuiltInPlugins(std::vector* plugins) { pdf_info.description = kPDFPluginDescription; pdf_info.path = base::FilePath::FromUTF8Unsafe(CefContentClient::kPDFPluginPath); - content::WebPluginMimeType pdf_mime_type( - kPDFPluginOutOfProcessMimeType, - kPDFPluginExtension, - kPDFPluginDescription); + content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType, + kPDFPluginExtension, + kPDFPluginDescription); pdf_info.mime_types.push_back(pdf_mime_type); pdf_info.internal_entry_points.get_interface = g_pdf_get_interface; pdf_info.internal_entry_points.initialize_module = g_pdf_initialize_module; @@ -107,7 +105,8 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, flash_version_numbers.push_back("999"); // E.g., "Shockwave Flash 10.2 r154": plugin.description = plugin.name + " " + flash_version_numbers[0] + "." + - flash_version_numbers[1] + " r" + flash_version_numbers[2]; + flash_version_numbers[1] + " r" + + flash_version_numbers[2]; plugin.version = base::JoinString(flash_version_numbers, "."); content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType, content::kFlashPluginSwfExtension, @@ -242,9 +241,9 @@ std::string CefContentClient::GetUserAgent() const { product_version = command_line->GetSwitchValueASCII(switches::kProductVersion); } else { - product_version = base::StringPrintf("Chrome/%d.%d.%d.%d", - CHROME_VERSION_MAJOR, CHROME_VERSION_MINOR, CHROME_VERSION_BUILD, - CHROME_VERSION_PATCH); + product_version = base::StringPrintf( + "Chrome/%d.%d.%d.%d", CHROME_VERSION_MAJOR, CHROME_VERSION_MINOR, + CHROME_VERSION_BUILD, CHROME_VERSION_PATCH); } return content::BuildUserAgentFromProduct(product_version); @@ -371,8 +370,8 @@ bool CefContentClient::GetRawDataResource(int resource_id, size_t data_size = 0; if (scale_factor != ui::SCALE_FACTOR_NONE) { if (handler->GetDataResourceForScale( - resource_id, static_cast(scale_factor), data, - data_size)) { + resource_id, static_cast(scale_factor), + data, data_size)) { *value = base::StringPiece(static_cast(data), data_size); } } else if (handler->GetDataResource(resource_id, data, data_size)) { diff --git a/libcef/common/content_client.h b/libcef/common/content_client.h index 657167388..2deaa32f4 100644 --- a/libcef/common/content_client.h +++ b/libcef/common/content_client.h @@ -39,8 +39,7 @@ class CefContentClient : public content::ContentClient, base::StringPiece GetDataResource( int resource_id, ui::ScaleFactor scale_factor) const override; - base::RefCountedMemory* GetDataResourceBytes( - int resource_id) const override; + base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; gfx::Image& GetNativeImageNamed(int resource_id) const override; // Values are registered with all processes (url/url_util.h) and with Blink @@ -67,7 +66,7 @@ class CefContentClient : public content::ContentClient, // restrict access. // This value is registered with Blink only. bool is_display_isolated; - + // A scheme that will be treated the same as "https". For example, loading // this scheme from other secure schemes will not trigger mixed content // warnings. @@ -104,12 +103,10 @@ class CefContentClient : public content::ContentClient, private: // ui::ResourceBundle::Delegate methods. - base::FilePath GetPathForResourcePack( - const base::FilePath& pack_path, - ui::ScaleFactor scale_factor) override; - base::FilePath GetPathForLocalePack( - const base::FilePath& pack_path, - const std::string& locale) override; + base::FilePath GetPathForResourcePack(const base::FilePath& pack_path, + ui::ScaleFactor scale_factor) override; + base::FilePath GetPathForLocalePack(const base::FilePath& pack_path, + const std::string& locale) override; gfx::Image GetImageNamed(int resource_id) override; gfx::Image GetNativeImageNamed(int resource_id) override; base::RefCountedStaticMemory* LoadDataResourceBytes( @@ -118,8 +115,7 @@ class CefContentClient : public content::ContentClient, bool GetRawDataResource(int resource_id, ui::ScaleFactor scale_factor, base::StringPiece* value) override; - bool GetLocalizedString(int message_id, - base::string16* value) override; + bool GetLocalizedString(int message_id, base::string16* value) override; CefRefPtr application_; bool pack_loading_disabled_; diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 3aa1b9025..f1d0af827 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -12,10 +12,10 @@ #include "base/logging.h" #include "base/strings/string16.h" -#include "base/strings/stringprintf.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/crash_keys.h" @@ -104,7 +104,7 @@ const char kInvalidFileChars[] = "<>:\"/\\|?*"; bool isInvalidFileCharacter(unsigned char c) { if (c < ' ' || c == 0x7F) return true; - for(size_t i = 0; i < sizeof(kInvalidFileChars); ++i) { + for (size_t i = 0; i < sizeof(kInvalidFileChars); ++i) { if (c == kInvalidFileChars[i]) return true; } @@ -191,7 +191,7 @@ std::string sanitizePath(const std::string& s) { std::string part = parts[i]; if (part != "." && part != "..") part = sanitizePathComponent(part); - if (!result.empty() && result[result.length()-1] != kPathSep) + if (!result.empty() && result[result.length() - 1] != kPathSep) result += kPathSep; result += part; } @@ -222,7 +222,6 @@ std::string joinPath(const std::string& s1, const std::string& s2) { return result; } - // This will only be non-nullptr in the chrome_elf address space. CefCrashReporterClient* g_crash_reporter_client = nullptr; @@ -253,7 +252,6 @@ bool __declspec(dllexport) __cdecl GetCrashKeyImpl(size_t index, } // extern "C" - // The below functions were deleted from chrome/install_static/install_util.cc // in https://crbug.com/565446#c17. @@ -262,9 +260,8 @@ constexpr wchar_t kUserDataDirname[] = L"User Data"; // Populates |result| with the default User Data directory for the current // user.This may be overidden by a command line option. Returns false if all // attempts at locating a User Data directory fail. -bool GetDefaultUserDataDirectory( - std::wstring* result, - const std::wstring& install_sub_directory) { +bool GetDefaultUserDataDirectory(std::wstring* result, + const std::wstring& install_sub_directory) { // This environment variable should be set on Windows Vista and later // (https://msdn.microsoft.com/library/windows/desktop/dd378457.aspx). std::wstring user_data_dir = @@ -293,9 +290,8 @@ bool GetDefaultUserDataDirectory( // Populates |crash_dir| with the default crash dump location regardless of // whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden. -bool GetDefaultCrashDumpLocation( - std::wstring* crash_dir, - const std::wstring& install_sub_directory) { +bool GetDefaultCrashDumpLocation(std::wstring* crash_dir, + const std::wstring& install_sub_directory) { // In order to be able to start crash handling very early, we do not rely on // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on // Windows. See https://crbug.com/564398. @@ -525,9 +521,8 @@ bool CefCrashReporterClient::GetCrashMetricsLocation( #elif defined(OS_POSIX) -void CefCrashReporterClient::GetProductNameAndVersion( - const char** product_name, - const char** version) { +void CefCrashReporterClient::GetProductNameAndVersion(const char** product_name, + const char** version) { *product_name = product_name_.c_str(); *version = product_version_.c_str(); } @@ -631,18 +626,18 @@ void CefCrashReporterClient::GetCrashOptionalArguments( arguments->push_back(std::string("--no-rate-limit")); if (max_uploads_ > 0) { - arguments->push_back( - std::string("--max-uploads=") + base::IntToString(max_uploads_)); + arguments->push_back(std::string("--max-uploads=") + + base::IntToString(max_uploads_)); } if (max_db_size_ > 0) { - arguments->push_back( - std::string("--max-db-size=") + base::IntToString(max_db_size_)); + arguments->push_back(std::string("--max-db-size=") + + base::IntToString(max_db_size_)); } if (max_db_age_ > 0) { - arguments->push_back( - std::string("--max-db-age=") + base::IntToString(max_db_age_)); + arguments->push_back(std::string("--max-db-age=") + + base::IntToString(max_db_age_)); } } diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index f96980d4a..62f8c7d28 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -5,8 +5,8 @@ #ifndef CEF_LIBCEF_COMMON_CRASH_REPORTER_CLIENT_H_ #define CEF_LIBCEF_COMMON_CRASH_REPORTER_CLIENT_H_ -#include #include +#include #include "include/cef_version.h" @@ -89,7 +89,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { bool EnableBrowserCrashForwarding() override; #endif -private: + private: bool has_crash_config_file_ = false; // Values that will persist until the end of the program. diff --git a/libcef/common/crash_reporting.cc b/libcef/common/crash_reporting.cc index f785e69a8..d1c16582f 100644 --- a/libcef/common/crash_reporting.cc +++ b/libcef/common/crash_reporting.cc @@ -82,7 +82,7 @@ void InitCrashReporter(const base::CommandLine& command_line, } g_crash_reporting_enabled = true; -#else // !defined(OS_MACOSX) +#else // !defined(OS_MACOSX) breakpad::SetCrashServerURL(crash_client->GetCrashServerURL()); if (process_type != switches::kZygoteProcess) { @@ -102,14 +102,12 @@ bool IsBoringCEFSwitch(const std::string& flag) { return true; static const char* const kIgnoreSwitches[] = { - // CEF internals. - switches::kLogFile, + // CEF internals. + switches::kLogFile, - // Chromium internals. - "content-image-texture-target", - "mojo-platform-channel-handle", - "primordial-pipe-token", - "service-request-channel-token", + // Chromium internals. + "content-image-texture-target", "mojo-platform-channel-handle", + "primordial-pipe-token", "service-request-channel-token", }; if (!base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) @@ -156,8 +154,8 @@ void PreSandboxStartup(const base::CommandLine& command_line, #endif if (g_crash_reporting_enabled) { - LOG(INFO) << "Crash reporting enabled for process: " << - (process_type.empty() ? "browser" : process_type.c_str()); + LOG(INFO) << "Crash reporting enabled for process: " + << (process_type.empty() ? "browser" : process_type.c_str()); } // After platform crash reporting have been initialized, store the command diff --git a/libcef/common/crash_reporting_win.cc b/libcef/common/crash_reporting_win.cc index aa74c76ef..f5b89ea0b 100644 --- a/libcef/common/crash_reporting_win.cc +++ b/libcef/common/crash_reporting_win.cc @@ -42,8 +42,7 @@ bool GetCrashKeyTrampoline(size_t index, static GetCrashKey get_crash_key = []() { HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName); return reinterpret_cast( - elf_module ? GetProcAddress(elf_module, "GetCrashKeyImpl") - : nullptr); + elf_module ? GetProcAddress(elf_module, "GetCrashKeyImpl") : nullptr); }(); if (get_crash_key) { return (get_crash_key)(index, key_name, max_length); @@ -51,7 +50,6 @@ bool GetCrashKeyTrampoline(size_t index, return false; } - // From chrome/common/child_process_logging_win.cc: // exported in breakpad_win.cc/crashpad_win.cc: diff --git a/libcef/common/drag_data_impl.cc b/libcef/common/drag_data_impl.cc index 6db3da394..88e79a1b8 100644 --- a/libcef/common/drag_data_impl.cc +++ b/libcef/common/drag_data_impl.cc @@ -4,20 +4,18 @@ #include +#include "base/files/file_path.h" #include "libcef/browser/stream_impl.h" #include "libcef/common/drag_data_impl.h" -#include "base/files/file_path.h" -#define CHECK_READONLY_RETURN_VOID() \ - if (read_only_) { \ +#define CHECK_READONLY_RETURN_VOID() \ + if (read_only_) { \ NOTREACHED() << "object is read only"; \ - return; \ + return; \ } CefDragDataImpl::CefDragDataImpl(const content::DropData& data) - : data_(data), - read_only_(false) { -} + : data_(data), read_only_(false) {} CefDragDataImpl::CefDragDataImpl(const content::DropData& data, CefRefPtr image, @@ -25,12 +23,9 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data, : data_(data), image_(image), image_hotspot_(image_hotspot), - read_only_(false) { -} + read_only_(false) {} -CefDragDataImpl::CefDragDataImpl() - : read_only_(false) { -} +CefDragDataImpl::CefDragDataImpl() : read_only_(false) {} CefRefPtr CefDragData::Create() { return new CefDragDataImpl(); @@ -128,8 +123,7 @@ bool CefDragDataImpl::GetFileNames(std::vector& names) { if (data_.filenames.empty()) return false; - std::vector::const_iterator it = - data_.filenames.begin(); + std::vector::const_iterator it = data_.filenames.begin(); for (; it != data_.filenames.end(); ++it) names.push_back(it->path.value()); @@ -185,8 +179,8 @@ void CefDragDataImpl::AddFile(const CefString& path, const CefString& display_name) { base::AutoLock lock_scope(lock_); CHECK_READONLY_RETURN_VOID(); - data_.filenames.push_back(ui::FileInfo(base::FilePath(path), - base::FilePath(display_name))); + data_.filenames.push_back( + ui::FileInfo(base::FilePath(path), base::FilePath(display_name))); } void CefDragDataImpl::SetReadOnly(bool read_only) { diff --git a/libcef/common/drag_data_impl.h b/libcef/common/drag_data_impl.h index 37c398d2e..c44f83c55 100644 --- a/libcef/common/drag_data_impl.h +++ b/libcef/common/drag_data_impl.h @@ -50,9 +50,7 @@ class CefDragDataImpl : public CefDragData { bool HasImage() override; // This method is not safe. Use Lock/Unlock to get mutually exclusive access. - content::DropData* drop_data() { - return &data_; - } + content::DropData* drop_data() { return &data_; } void SetReadOnly(bool read_only); diff --git a/libcef/common/extensions/extensions_client.cc b/libcef/common/extensions/extensions_client.cc index d6b6d2817..78a53a782 100644 --- a/libcef/common/extensions/extensions_client.cc +++ b/libcef/common/extensions/extensions_client.cc @@ -22,8 +22,8 @@ #include "chrome/grit/common_resources.h" #include "extensions/common/api/generated_schemas.h" #include "extensions/common/common_manifest_handlers.h" -#include "extensions/common/extensions_aliases.h" #include "extensions/common/extension_urls.h" +#include "extensions/common/extensions_aliases.h" #include "extensions/common/features/json_feature_provider_source.h" #include "extensions/common/features/simple_feature.h" #include "extensions/common/manifest_handler.h" @@ -45,12 +45,10 @@ SimpleFeature* CreateFeature() { } // namespace CefExtensionsClient::CefExtensionsClient() - : webstore_base_url_(extension_urls::kChromeWebstoreBaseURL), - webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) { -} + : webstore_base_url_(extension_urls::kChromeWebstoreBaseURL), + webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {} -CefExtensionsClient::~CefExtensionsClient() { -} +CefExtensionsClient::~CefExtensionsClient() {} void CefExtensionsClient::Initialize() { RegisterCommonManifestHandlers(); @@ -133,13 +131,12 @@ bool CefExtensionsClient::IsScriptableURL(const GURL& url, return true; } -bool CefExtensionsClient::IsAPISchemaGenerated( - const std::string& name) const { +bool CefExtensionsClient::IsAPISchemaGenerated(const std::string& name) const { // Schema for CEF-only APIs. // TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See // libcef/common/extensions/api/README.txt for details. - //if (api::cef::CefGeneratedSchemas::IsGenerated(name)) - // return true; + // if (api::cef::CefGeneratedSchemas::IsGenerated(name)) + // return true; // Chrome APIs whitelisted by CEF. if (api::cef::ChromeGeneratedSchemas::IsGenerated(name)) @@ -157,8 +154,8 @@ base::StringPiece CefExtensionsClient::GetAPISchema( // Schema for CEF-only APIs. // TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See // libcef/common/extensions/api/README.txt for details. - //if (api::cef::CefGeneratedSchemas::IsGenerated(name)) - // return api::cef::CefGeneratedSchemas::Get(name); + // if (api::cef::CefGeneratedSchemas::IsGenerated(name)) + // return api::cef::CefGeneratedSchemas::Get(name); // Chrome APIs whitelisted by CEF. if (api::cef::ChromeGeneratedSchemas::IsGenerated(name)) @@ -172,8 +169,7 @@ bool CefExtensionsClient::ShouldSuppressFatalErrors() const { return true; } -void CefExtensionsClient::RecordDidSuppressFatalError() { -} +void CefExtensionsClient::RecordDidSuppressFatalError() {} const GURL& CefExtensionsClient::GetWebstoreBaseURL() const { return webstore_base_url_; diff --git a/libcef/common/extensions/extensions_util.cc b/libcef/common/extensions/extensions_util.cc index 34ac517c1..a1ba43e11 100644 --- a/libcef/common/extensions/extensions_util.cc +++ b/libcef/common/extensions/extensions_util.cc @@ -19,9 +19,8 @@ bool ExtensionsEnabled() { bool PdfExtensionEnabled() { static bool enabled = - ExtensionsEnabled() && - !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisablePdfExtension); + ExtensionsEnabled() && !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisablePdfExtension); return enabled; } diff --git a/libcef/common/json_impl.cc b/libcef/common/json_impl.cc index 922633132..16c02db1f 100644 --- a/libcef/common/json_impl.cc +++ b/libcef/common/json_impl.cc @@ -5,9 +5,9 @@ #include "include/cef_parser.h" #include "libcef/common/values_impl.h" -#include "base/values.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/values.h" namespace { @@ -50,8 +50,9 @@ CefRefPtr CefParseJSONAndReturnError( int error_code; std::string error_msg; - std::unique_ptr parse_result = base::JSONReader::ReadAndReturnError( - json, GetJSONReaderOptions(options), &error_code, &error_msg); + std::unique_ptr parse_result = + base::JSONReader::ReadAndReturnError(json, GetJSONReaderOptions(options), + &error_code, &error_msg); if (parse_result) return new CefValueImpl(parse_result.release()); @@ -69,9 +70,8 @@ CefString CefWriteJSON(CefRefPtr node, CefValueImpl::ScopedLockedValue scoped_value(impl); std::string json_string; - if (base::JSONWriter::WriteWithOptions(*scoped_value.value(), - GetJSONWriterOptions(options), - &json_string)) { + if (base::JSONWriter::WriteWithOptions( + *scoped_value.value(), GetJSONWriterOptions(options), &json_string)) { return json_string; } return CefString(); diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 88fa2d0e3..a9a2ffd90 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "libcef/common/main_delegate.h" #include "libcef/browser/content_browser_client.h" #include "libcef/browser/context.h" #include "libcef/common/cef_switches.h" #include "libcef/common/command_line_impl.h" #include "libcef/common/crash_reporting.h" #include "libcef/common/extensions/extensions_util.h" +#include "libcef/common/main_delegate.h" #include "libcef/renderer/content_renderer_client.h" #include "libcef/utility/content_utility_client.h" @@ -45,20 +45,20 @@ #define IPC_MESSAGE_MACROS_LOG_ENABLED #include "content/public/common/content_ipc_logging.h" #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ - content::RegisterIPCLogger(msg_id, logger) + content::RegisterIPCLogger(msg_id, logger) #include "libcef/common/cef_message_generator.h" #endif #if defined(OS_WIN) -#include // NOLINT(build/include_order) +#include #include "base/win/registry.h" #endif #if defined(OS_MACOSX) -#include "libcef/common/util_mac.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "content/public/common/content_paths.h" +#include "libcef/common/util_mac.h" #endif #if defined(OS_LINUX) @@ -129,8 +129,8 @@ bool GetSystemFlashFilename(base::FilePath* out_path) { L"SOFTWARE\\Macromedia\\FlashPlayerPepper"; const wchar_t kFlashPlayerPathValueName[] = L"PlayerPath"; - base::win::RegKey path_key( - HKEY_LOCAL_MACHINE, kPepperFlashRegistryRoot, KEY_READ); + base::win::RegKey path_key(HKEY_LOCAL_MACHINE, kPepperFlashRegistryRoot, + KEY_READ); base::string16 path_str; if (FAILED(path_key.ReadValue(kFlashPlayerPathValueName, &path_str))) return false; @@ -155,7 +155,7 @@ void OverridePepperFlashSystemPluginPath() { if (!util_mac::GetLocalLibraryDirectory(&plugin_filename)) return; plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory) - .Append(chrome::kPepperFlashPluginFilename); + .Append(chrome::kPepperFlashPluginFilename); #else // A system plugin is not available on other platforms. return; @@ -177,10 +177,8 @@ void OverridePepperFlashSystemPluginPath() { // (This also helps us sidestep issues with other apps grabbing ~/.chromium .) bool GetDefaultUserDataDirectory(base::FilePath* result) { std::unique_ptr env(base::Environment::Create()); - base::FilePath config_dir( - base::nix::GetXDGDirectory(env.get(), - base::nix::kXdgConfigHomeEnvVar, - base::nix::kDotConfigDir)); + base::FilePath config_dir(base::nix::GetXDGDirectory( + env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir)); *result = config_dir.Append(FILE_PATH_LITERAL("cef_user_data")); return true; } @@ -239,9 +237,8 @@ bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) { class CefUIThread : public base::Thread { public: explicit CefUIThread(const content::MainFunctionParams& main_function_params) - : base::Thread("CefUIThread"), - main_function_params_(main_function_params) { - } + : base::Thread("CefUIThread"), + main_function_params_(main_function_params) {} void Init() override { #if defined(OS_WIN) @@ -283,8 +280,7 @@ CefMainDelegate::CefMainDelegate(CefRefPtr application) base_impl_stub(); } -CefMainDelegate::~CefMainDelegate() { -} +CefMainDelegate::~CefMainDelegate() {} bool CefMainDelegate::BasicStartupComplete(int* exit_code) { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -345,15 +341,15 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { if (settings.user_agent.length > 0) { command_line->AppendSwitchASCII(switches::kUserAgent, - CefString(&settings.user_agent)); + CefString(&settings.user_agent)); } else if (settings.product_version.length > 0) { command_line->AppendSwitchASCII(switches::kProductVersion, - CefString(&settings.product_version)); + CefString(&settings.product_version)); } if (settings.locale.length > 0) { command_line->AppendSwitchASCII(switches::kLang, - CefString(&settings.locale)); + CefString(&settings.locale)); } else if (!command_line->HasSwitch(switches::kLang)) { command_line->AppendSwitchASCII(switches::kLang, "en-US"); } @@ -400,7 +396,7 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { if (settings.javascript_flags.length > 0) { command_line->AppendSwitchASCII(switches::kJavaScriptFlags, - CefString(&settings.javascript_flags)); + CefString(&settings.javascript_flags)); } if (settings.pack_loading_disabled) { @@ -425,13 +421,15 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { if (settings.remote_debugging_port >= 1024 && settings.remote_debugging_port <= 65535) { - command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, + command_line->AppendSwitchASCII( + switches::kRemoteDebuggingPort, base::IntToString(settings.remote_debugging_port)); } if (settings.uncaught_exception_stack_size > 0) { - command_line->AppendSwitchASCII(switches::kUncaughtExceptionStackSize, - base::IntToString(settings.uncaught_exception_stack_size)); + command_line->AppendSwitchASCII( + switches::kUncaughtExceptionStackSize, + base::IntToString(settings.uncaught_exception_stack_size)); } } @@ -503,7 +501,7 @@ void CefMainDelegate::PreSandboxStartup() { command_line->GetSwitchValueASCII(switches::kProcessType); if (process_type.empty()) { - // Only override these paths when executing the main process. +// Only override these paths when executing the main process. #if defined(OS_MACOSX) OverrideChildProcessPath(); #endif @@ -536,10 +534,9 @@ void CefMainDelegate::PreSandboxStartup() { } void CefMainDelegate::SandboxInitialized(const std::string& process_type) { - CefContentClient::SetPDFEntryFunctions( - chrome_pdf::PPP_GetInterface, - chrome_pdf::PPP_InitializeModule, - chrome_pdf::PPP_ShutdownModule); + CefContentClient::SetPDFEntryFunctions(chrome_pdf::PPP_GetInterface, + chrome_pdf::PPP_InitializeModule, + chrome_pdf::PPP_ShutdownModule); } int CefMainDelegate::RunProcess( @@ -583,10 +580,9 @@ void CefMainDelegate::ProcessExiting(const std::string& process_type) { #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) void CefMainDelegate::ZygoteForked() { - base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - const std::string& process_type = command_line->GetSwitchValueASCII( - switches::kProcessType); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + const std::string& process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); // Initialize crash reporting state for the newly forked process. crash_reporting::ZygoteForked(command_line, process_type); } @@ -597,8 +593,7 @@ content::ContentBrowserClient* CefMainDelegate::CreateContentBrowserClient() { return browser_client_.get(); } -content::ContentRendererClient* - CefMainDelegate::CreateContentRendererClient() { +content::ContentRendererClient* CefMainDelegate::CreateContentRendererClient() { renderer_client_.reset(new CefContentRendererClient); return renderer_client_.get(); } @@ -624,8 +619,8 @@ void CefMainDelegate::InitializeResourceBundle() { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::FilePath cef_pak_file, cef_100_percent_pak_file, - cef_200_percent_pak_file, cef_extensions_pak_file, - devtools_pak_file, locales_dir; + cef_200_percent_pak_file, cef_extensions_pak_file, devtools_pak_file, + locales_dir; base::FilePath resources_dir; if (command_line->HasSwitch(switches::kResourcesDirPath)) { @@ -666,9 +661,7 @@ void CefMainDelegate::InitializeResourceBundle() { const std::string loaded_locale = ui::ResourceBundle::InitSharedInstanceWithLocale( - locale, - &content_client_, - ui::ResourceBundle::LOAD_COMMON_RESOURCES); + locale, &content_client_, ui::ResourceBundle::LOAD_COMMON_RESOURCES); if (!loaded_locale.empty() && g_browser_process) g_browser_process->SetApplicationLocale(loaded_locale); @@ -697,8 +690,8 @@ void CefMainDelegate::InitializeResourceBundle() { if (load_100_percent) { if (base::PathExists(cef_100_percent_pak_file)) { - resource_bundle.AddDataPackFromPath( - cef_100_percent_pak_file, ui::SCALE_FACTOR_100P); + resource_bundle.AddDataPackFromPath(cef_100_percent_pak_file, + ui::SCALE_FACTOR_100P); } else { LOG(ERROR) << "Could not load cef_100_percent.pak"; } @@ -706,8 +699,8 @@ void CefMainDelegate::InitializeResourceBundle() { if (IsScaleFactorSupported(ui::SCALE_FACTOR_200P)) { if (base::PathExists(cef_200_percent_pak_file)) { - resource_bundle.AddDataPackFromPath( - cef_200_percent_pak_file, ui::SCALE_FACTOR_200P); + resource_bundle.AddDataPackFromPath(cef_200_percent_pak_file, + ui::SCALE_FACTOR_200P); } else { LOG(ERROR) << "Could not load cef_200_percent.pak"; } @@ -715,16 +708,16 @@ void CefMainDelegate::InitializeResourceBundle() { if (extensions::ExtensionsEnabled()) { if (base::PathExists(cef_extensions_pak_file)) { - resource_bundle.AddDataPackFromPath( - cef_extensions_pak_file, ui::SCALE_FACTOR_NONE); + resource_bundle.AddDataPackFromPath(cef_extensions_pak_file, + ui::SCALE_FACTOR_NONE); } else { LOG(ERROR) << "Could not load cef_extensions.pak"; } } if (base::PathExists(devtools_pak_file)) { - resource_bundle.AddDataPackFromPath( - devtools_pak_file, ui::SCALE_FACTOR_NONE); + resource_bundle.AddDataPackFromPath(devtools_pak_file, + ui::SCALE_FACTOR_NONE); } content_client_.set_allow_pack_file_load(false); diff --git a/libcef/common/main_delegate.h b/libcef/common/main_delegate.h index 6607470ee..3e188734b 100644 --- a/libcef/common/main_delegate.h +++ b/libcef/common/main_delegate.h @@ -8,8 +8,8 @@ #include -#include "libcef/common/content_client.h" #include "include/cef_app.h" +#include "libcef/common/content_client.h" #include "base/compiler_specific.h" #include "content/public/app/content_main_delegate.h" @@ -43,8 +43,7 @@ class CefMainDelegate : public content::ContentMainDelegate { void ZygoteForked() override; #endif content::ContentBrowserClient* CreateContentBrowserClient() override; - content::ContentRendererClient* - CreateContentRendererClient() override; + content::ContentRendererClient* CreateContentRendererClient() override; content::ContentUtilityClient* CreateContentUtilityClient() override; // Shut down the browser runner. diff --git a/libcef/common/net/http_header_utils.cc b/libcef/common/net/http_header_utils.cc index e81d9ef33..a0afebd2d 100644 --- a/libcef/common/net/http_header_utils.cc +++ b/libcef/common/net/http_header_utils.cc @@ -14,8 +14,7 @@ namespace HttpHeaderUtils { std::string GenerateHeaders(const HeaderMap& map) { std::string headers; - for (HeaderMap::const_iterator header = map.begin(); - header != map.end(); + for (HeaderMap::const_iterator header = map.begin(); header != map.end(); ++header) { const CefString& key = header->first; const CefString& value = header->second; @@ -34,9 +33,9 @@ std::string GenerateHeaders(const HeaderMap& map) { void ParseHeaders(const std::string& header_str, HeaderMap& map) { // Parse the request header values - for (net::HttpUtil::HeadersIterator i(header_str.begin(), - header_str.end(), "\n"); - i.GetNext(); ) { + for (net::HttpUtil::HeadersIterator i(header_str.begin(), header_str.end(), + "\n"); + i.GetNext();) { map.insert(std::make_pair(i.name(), i.values())); } } diff --git a/libcef/common/net/scheme_registration.cc b/libcef/common/net/scheme_registration.cc index 9d778f103..16a7b7cd2 100644 --- a/libcef/common/net/scheme_registration.cc +++ b/libcef/common/net/scheme_registration.cc @@ -7,8 +7,8 @@ #include "libcef/common/content_client.h" #include "content/public/common/url_constants.h" -#include "net/net_features.h" #include "extensions/common/constants.h" +#include "net/net_features.h" #include "url/url_constants.h" namespace scheme { @@ -19,15 +19,14 @@ void AddInternalSchemes(content::ContentClient::Schemes* schemes) { // Access restrictions for chrome-extension: and chrome-extension-resource: // schemes will be applied in CefContentRendererClient::WillSendRequest(). static CefContentClient::SchemeInfo internal_schemes[] = { - { - extensions::kExtensionScheme, - true, /* is_standard */ - false, /* is_local */ - false, /* is_display_isolated */ - true, /* is_secure */ - true, /* is_cors_enabled */ - true, /* is_csp_bypassing */ - }, + { + extensions::kExtensionScheme, true, /* is_standard */ + false, /* is_local */ + false, /* is_display_isolated */ + true, /* is_secure */ + true, /* is_cors_enabled */ + true, /* is_csp_bypassing */ + }, }; // The |is_display_isolated| value is excluded here because it's registered diff --git a/libcef/common/net/upload_data.cc b/libcef/common/net/upload_data.cc index db815fec7..272b62e91 100644 --- a/libcef/common/net/upload_data.cc +++ b/libcef/common/net/upload_data.cc @@ -10,10 +10,7 @@ namespace net { UploadData::UploadData() - : identifier_(0), - is_chunked_(false), - last_chunk_appended_(false) { -} + : identifier_(0), is_chunked_(false), last_chunk_appended_(false) {} void UploadData::AppendBytes(const char* bytes, int bytes_len) { DCHECK(!is_chunked_); @@ -24,7 +21,8 @@ void UploadData::AppendBytes(const char* bytes, int bytes_len) { } void UploadData::AppendFileRange(const base::FilePath& file_path, - uint64_t offset, uint64_t length, + uint64_t offset, + uint64_t length, const base::Time& expected_modification_time) { DCHECK(!is_chunked_); elements_.push_back(base::MakeUnique()); @@ -32,7 +30,6 @@ void UploadData::AppendFileRange(const base::FilePath& file_path, expected_modification_time); } -UploadData::~UploadData() { -} +UploadData::~UploadData() {} } // namespace net diff --git a/libcef/common/net/upload_data.h b/libcef/common/net/upload_data.h index c8a9ff05d..ef6c96041 100644 --- a/libcef/common/net/upload_data.h +++ b/libcef/common/net/upload_data.h @@ -30,16 +30,16 @@ namespace net { // Until there is a more abstract class for this, this one derives from // SupportsUserData to allow users to stash random data by // key and ensure its destruction when UploadData is finally deleted. -class UploadData - : public base::RefCounted, - public base::SupportsUserData { +class UploadData : public base::RefCounted, + public base::SupportsUserData { public: UploadData(); void AppendBytes(const char* bytes, int bytes_len); void AppendFileRange(const base::FilePath& file_path, - uint64_t offset, uint64_t length, + uint64_t offset, + uint64_t length, const base::Time& expected_modification_time); // Initializes the object to send chunks of upload data over time rather @@ -53,17 +53,11 @@ class UploadData using ElementsVector = std::vector>; - const ElementsVector& elements() const { - return elements_; - } + const ElementsVector& elements() const { return elements_; } - ElementsVector* elements_mutable() { - return &elements_; - } + ElementsVector* elements_mutable() { return &elements_; } - void swap_elements(ElementsVector* elements) { - elements_.swap(*elements); - } + void swap_elements(ElementsVector* elements) { elements_.swap(*elements); } // Identifies a particular upload instance, which is used by the cache to // formulate a cache key. This value should be unique across browser diff --git a/libcef/common/net/upload_element.cc b/libcef/common/net/upload_element.cc index c0848b65a..01164c2ef 100644 --- a/libcef/common/net/upload_element.cc +++ b/libcef/common/net/upload_element.cc @@ -14,10 +14,8 @@ UploadElement::UploadElement() bytes_start_(NULL), bytes_length_(0), file_range_offset_(0), - file_range_length_(std::numeric_limits::max()) { -} + file_range_length_(std::numeric_limits::max()) {} -UploadElement::~UploadElement() { -} +UploadElement::~UploadElement() {} } // namespace net diff --git a/libcef/common/net/upload_element.h b/libcef/common/net/upload_element.h index f9c7e7210..9fb487d17 100644 --- a/libcef/common/net/upload_element.h +++ b/libcef/common/net/upload_element.h @@ -62,7 +62,8 @@ class UploadElement { // change. Also note that the granularity for comparison is time_t, not // the full precision. void SetToFilePathRange(const base::FilePath& path, - uint64_t offset, uint64_t length, + uint64_t offset, + uint64_t length, const base::Time& expected_modification_time) { type_ = TYPE_FILE; file_path_ = path; @@ -85,8 +86,7 @@ class UploadElement { }; #if defined(UNIT_TEST) -inline bool operator==(const UploadElement& a, - const UploadElement& b) { +inline bool operator==(const UploadElement& a, const UploadElement& b) { if (a.type() != b.type()) return false; if (a.type() == UploadElement::TYPE_BYTES) @@ -97,13 +97,12 @@ inline bool operator==(const UploadElement& a, a.file_range_offset() == b.file_range_offset() && a.file_range_length() == b.file_range_length() && a.expected_file_modification_time() == - b.expected_file_modification_time(); + b.expected_file_modification_time(); } return false; } -inline bool operator!=(const UploadElement& a, - const UploadElement& b) { +inline bool operator!=(const UploadElement& a, const UploadElement& b) { return !(a == b); } #endif // defined(UNIT_TEST) diff --git a/libcef/common/parser_impl.cc b/libcef/common/parser_impl.cc index 0ae44a976..2255eb510 100644 --- a/libcef/common/parser_impl.cc +++ b/libcef/common/parser_impl.cc @@ -13,8 +13,7 @@ #include "net/base/mime_util.h" #include "url/gurl.h" -bool CefParseURL(const CefString& url, - CefURLParts& parts) { +bool CefParseURL(const CefString& url, CefURLParts& parts) { GURL gurl(url.ToString()); if (!gurl.is_valid()) return false; @@ -32,8 +31,7 @@ bool CefParseURL(const CefString& url, return true; } -bool CefCreateURL(const CefURLParts& parts, - CefString& url) { +bool CefCreateURL(const CefURLParts& parts, CefString& url) { std::string spec = CefString(parts.spec.str, parts.spec.length, false); std::string scheme = CefString(parts.scheme.str, parts.scheme.length, false); std::string username = diff --git a/libcef/common/process_message_impl.cc b/libcef/common/process_message_impl.cc index a4e37c202..779643322 100644 --- a/libcef/common/process_message_impl.cc +++ b/libcef/common/process_message_impl.cc @@ -2,16 +2,15 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/common/process_message_impl.h" #include "libcef/common/cef_messages.h" +#include "libcef/common/process_message_impl.h" #include "libcef/common/values_impl.h" #include "base/logging.h" namespace { -void CopyValue(const Cef_Request_Params& source, - Cef_Request_Params& target) { +void CopyValue(const Cef_Request_Params& source, Cef_Request_Params& target) { target.name = source.name; auto copy = source.arguments.CreateDeepCopy(); target.arguments.Swap(copy.get()); @@ -29,10 +28,12 @@ CefRefPtr CefProcessMessage::Create(const CefString& name) { CefProcessMessageImpl::CefProcessMessageImpl(Cef_Request_Params* value, bool will_delete, bool read_only) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - read_only, NULL) { -} + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + read_only, + NULL) {} bool CefProcessMessageImpl::CopyTo(Cef_Request_Params& target) { CEF_VALUE_VERIFY_RETURN(false, false); @@ -63,8 +64,7 @@ CefString CefProcessMessageImpl::GetName() { CefRefPtr CefProcessMessageImpl::GetArgumentList() { CEF_VALUE_VERIFY_RETURN(false, NULL); return CefListValueImpl::GetOrCreateRef( - const_cast(&(const_value().arguments)), - const_cast(&const_value()), - read_only(), - controller()); + const_cast(&(const_value().arguments)), + const_cast(&const_value()), read_only(), + controller()); } diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 485210fee..0a53ef15f 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -7,11 +7,11 @@ #include #include +#include "libcef/browser/navigate_params.h" #include "libcef/common/cef_messages.h" #include "libcef/common/net/http_header_utils.h" #include "libcef/common/net/upload_data.h" #include "libcef/common/request_impl.h" -#include "libcef/browser/navigate_params.h" #include "base/command_line.h" #include "base/logging.h" @@ -24,9 +24,9 @@ #include "content/public/common/resource_type.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/load_flags.h" +#include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_data_stream.h" #include "net/base/upload_element_reader.h" -#include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_file_element_reader.h" #include "net/http/http_request_headers.h" #include "net/http/http_util.h" @@ -65,7 +65,8 @@ class BytesElementReader : public net::UploadBytesElementReader { base::TaskRunner* GetFileTaskRunner() { return content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE).get(); + content::BrowserThread::FILE) + .get(); } // A subclass of net::UploadFileElementReader that keeps the associated @@ -172,9 +173,7 @@ void GetHeaderMap(const blink::WebURLRequest& request, class HeaderVisitor : public blink::WebHTTPHeaderVisitor { public: HeaderVisitor(CefRequest::HeaderMap* map, GURL* referrer) - : map_(map), - referrer_(referrer) { - } + : map_(map), referrer_(referrer) {} void VisitHeader(const blink::WebString& name, const blink::WebString& value) override { @@ -221,26 +220,25 @@ void SetHeaderMap(const CefRequest::HeaderMap& map, } // Type used in UploadDataStream. -typedef std::vector> UploadElementReaders; +typedef std::vector> + UploadElementReaders; } // namespace - -#define CHECK_READONLY_RETURN(val) \ - if (read_only_) { \ +#define CHECK_READONLY_RETURN(val) \ + if (read_only_) { \ NOTREACHED() << "object is read only"; \ - return val; \ + return val; \ } -#define CHECK_READONLY_RETURN_VOID() \ - if (read_only_) { \ +#define CHECK_READONLY_RETURN_VOID() \ + if (read_only_) { \ NOTREACHED() << "object is read only"; \ - return; \ + return; \ } #define SETBOOLFLAG(obj, flags, method, FLAG) \ - obj.method((flags & (FLAG)) == (FLAG)) - + obj.method((flags & (FLAG)) == (FLAG)) // CefRequest ----------------------------------------------------------------- @@ -250,12 +248,9 @@ CefRefPtr CefRequest::Create() { return request; } - // CefRequestImpl ------------------------------------------------------------- -CefRequestImpl::CefRequestImpl() - : read_only_(false), - track_changes_(false) { +CefRequestImpl::CefRequestImpl() : read_only_(false), track_changes_(false) { base::AutoLock lock_scope(lock_); Reset(); } @@ -468,8 +463,7 @@ void CefRequestImpl::Set(net::URLRequest* request) { const content::ResourceRequestInfo* info = content::ResourceRequestInfo::ForRequest(request); if (info) { - resource_type_ = - static_cast(info->GetResourceType()); + resource_type_ = static_cast(info->GetResourceType()); transition_type_ = static_cast(info->GetPageTransition()); } @@ -571,13 +565,11 @@ void CefRequestImpl::Get(blink::WebURLRequest& request, if (!referrer_url_.is_empty()) { const blink::WebString& referrer = blink::WebSecurityPolicy::GenerateReferrerHeader( - static_cast(referrer_policy_), - url_, + static_cast(referrer_policy_), url_, blink::WebString::FromUTF8(referrer_url_.spec())); if (!referrer.IsEmpty()) { request.SetHTTPReferrer( - referrer, - static_cast(referrer_policy_)); + referrer, static_cast(referrer_policy_)); } } @@ -604,9 +596,9 @@ void CefRequestImpl::Get(blink::WebURLRequest& request, if (!first_party_for_cookies_.is_empty()) request.SetFirstPartyForCookies(first_party_for_cookies_); - request.SetCachePolicy((flags_ & UR_FLAG_SKIP_CACHE) ? - blink::WebCachePolicy::kBypassingCache : - blink::WebCachePolicy::kUseProtocolCachePolicy); + request.SetCachePolicy((flags_ & UR_FLAG_SKIP_CACHE) + ? blink::WebCachePolicy::kBypassingCache + : blink::WebCachePolicy::kUseProtocolCachePolicy); SETBOOLFLAG(request, flags_, SetAllowStoredCredentials, UR_FLAG_ALLOW_CACHED_CREDENTIALS); @@ -625,19 +617,17 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, const blink::WebString& referrer = blink::WebSecurityPolicy::GenerateReferrerHeader( static_cast(params.referrer_policy), - params.url, - blink::WebString::FromUTF8(params.referrer.spec())); + params.url, blink::WebString::FromUTF8(params.referrer.spec())); if (!referrer.IsEmpty()) { - request.SetHTTPReferrer( - referrer, - static_cast(params.referrer_policy)); + request.SetHTTPReferrer(referrer, static_cast( + params.referrer_policy)); } } if (!params.headers.empty()) { for (net::HttpUtil::HeadersIterator i(params.headers.begin(), params.headers.end(), "\n"); - i.GetNext(); ) { + i.GetNext();) { request.AddHTTPHeaderField(blink::WebString::FromUTF8(i.name()), blink::WebString::FromUTF8(i.values())); } @@ -651,8 +641,10 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, } // The comparison performed by httpHeaderField() is case insensitive. - if (request.HttpHeaderField(blink::WebString::FromASCII( - net::HttpRequestHeaders::kContentType)).length()== 0) { + if (request + .HttpHeaderField(blink::WebString::FromASCII( + net::HttpRequestHeaders::kContentType)) + .length() == 0) { request.SetHTTPHeaderField( blink::WebString::FromASCII(net::HttpRequestHeaders::kContentType), blink::WebString::FromASCII(kApplicationFormURLEncoded)); @@ -667,7 +659,8 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, data.Assign(element->bytes(), element->bytes_length()); body.AppendData(data); } else if (element->type() == net::UploadElement::TYPE_FILE) { - body.AppendFile(FilePathStringToWebString(element->file_path().value())); + body.AppendFile( + FilePathStringToWebString(element->file_path().value())); } else { NOTREACHED(); } @@ -679,9 +672,9 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, if (params.first_party_for_cookies.is_valid()) request.SetFirstPartyForCookies(params.first_party_for_cookies); - request.SetCachePolicy((params.load_flags & UR_FLAG_SKIP_CACHE) ? - blink::WebCachePolicy::kBypassingCache : - blink::WebCachePolicy::kUseProtocolCachePolicy); + request.SetCachePolicy((params.load_flags & UR_FLAG_SKIP_CACHE) + ? blink::WebCachePolicy::kBypassingCache + : blink::WebCachePolicy::kUseProtocolCachePolicy); SETBOOLFLAG(request, params.load_flags, SetAllowStoredCredentials, UR_FLAG_ALLOW_CACHED_CREDENTIALS); @@ -739,8 +732,7 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher, } } - fetcher.SetExtraRequestHeaders( - HttpHeaderUtils::GenerateHeaders(headerMap)); + fetcher.SetExtraRequestHeaders(HttpHeaderUtils::GenerateHeaders(headerMap)); if (postdata_.get()) { CefPostData::ElementVector elements; @@ -767,10 +759,8 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher, } case PDE_TYPE_FILE: fetcher.SetUploadFilePath( - content_type, - base::FilePath(impl->GetFile()), - 0, std::numeric_limits::max(), - GetFileTaskRunner()); + content_type, base::FilePath(impl->GetFile()), 0, + std::numeric_limits::max(), GetFileTaskRunner()); break; case PDE_TYPE_EMPTY: break; @@ -820,8 +810,8 @@ void CefRequestImpl::SetTrackChanges(bool track_changes) { changes_ = kChangedNone; if (postdata_.get()) { - static_cast(postdata_.get())-> - SetTrackChanges(track_changes); + static_cast(postdata_.get()) + ->SetTrackChanges(track_changes); } } @@ -895,15 +885,13 @@ CefRefPtr CefPostData::Create() { return postdata; } - // CefPostDataImpl ------------------------------------------------------------ CefPostDataImpl::CefPostDataImpl() - : read_only_(false), - has_excluded_elements_(false), - track_changes_(false), - has_changes_(false) { -} + : read_only_(false), + has_excluded_elements_(false), + track_changes_(false), + has_changes_(false) {} bool CefPostDataImpl::IsReadOnly() { base::AutoLock lock_scope(lock_); @@ -1015,8 +1003,8 @@ void CefPostDataImpl::Get(net::UploadData& data) const { for (const auto& element : elements_) { std::unique_ptr data_element = base::MakeUnique(); - static_cast(element.get())->Get( - *data_element.get()); + static_cast(element.get()) + ->Get(*data_element.get()); data_elements.push_back(std::move(data_element)); } data.swap_elements(&data_elements); @@ -1093,8 +1081,8 @@ void CefPostDataImpl::SetTrackChanges(bool track_changes) { ElementVector::const_iterator it = elements_.begin(); for (; it != elements_.end(); ++it) { - static_cast(it->get())-> - SetTrackChanges(track_changes); + static_cast(it->get())->SetTrackChanges( + track_changes); } } @@ -1118,7 +1106,6 @@ void CefPostDataImpl::Changed() { has_changes_ = true; } - // CefPostDataElement --------------------------------------------------------- // static @@ -1127,14 +1114,13 @@ CefRefPtr CefPostDataElement::Create() { return element; } - // CefPostDataElementImpl ----------------------------------------------------- CefPostDataElementImpl::CefPostDataElementImpl() - : type_(PDE_TYPE_EMPTY), - read_only_(false), - track_changes_(false), - has_changes_(false) { + : type_(PDE_TYPE_EMPTY), + read_only_(false), + track_changes_(false), + has_changes_(false) { memset(&data_, 0, sizeof(data_)); } @@ -1305,7 +1291,7 @@ void CefPostDataElementImpl::Set(const blink::WebHTTPBody::Element& element) { if (element.type == blink::WebHTTPBody::Element::kTypeData) { SetToBytes(element.data.size(), - static_cast(element.data.Data())); + static_cast(element.data.Data())); } else if (element.type == blink::WebHTTPBody::Element::kTypeFile) { SetToFile(element.file_path.Utf16()); } else { @@ -1318,8 +1304,8 @@ void CefPostDataElementImpl::Get(blink::WebHTTPBody::Element& element) const { if (type_ == PDE_TYPE_BYTES) { element.type = blink::WebHTTPBody::Element::kTypeData; - element.data.Assign( - static_cast(data_.bytes.bytes), data_.bytes.size); + element.data.Assign(static_cast(data_.bytes.bytes), + data_.bytes.size); } else if (type_ == PDE_TYPE_FILE) { element.type = blink::WebHTTPBody::Element::kTypeFile; element.file_path.Assign( diff --git a/libcef/common/request_impl.h b/libcef/common/request_impl.h index 134c6877d..9f5b59fc5 100644 --- a/libcef/common/request_impl.h +++ b/libcef/common/request_impl.h @@ -41,14 +41,14 @@ struct CefNavigateParams; class CefRequestImpl : public CefRequest { public: enum Changes { - kChangedNone = 0, - kChangedUrl = 1 << 0, - kChangedMethod = 1 << 1, - kChangedReferrer = 1 << 2, - kChangedPostData = 1 << 3, - kChangedHeaderMap = 1 << 4, - kChangedFlags = 1 << 5, - kChangedFirstPartyForCookies = 1 << 6, + kChangedNone = 0, + kChangedUrl = 1 << 0, + kChangedMethod = 1 << 1, + kChangedReferrer = 1 << 2, + kChangedPostData = 1 << 3, + kChangedHeaderMap = 1 << 4, + kChangedFlags = 1 << 5, + kChangedFirstPartyForCookies = 1 << 6, }; CefRequestImpl(); diff --git a/libcef/common/resource_bundle_impl.cc b/libcef/common/resource_bundle_impl.cc index 53e51524d..2f4d20c0c 100644 --- a/libcef/common/resource_bundle_impl.cc +++ b/libcef/common/resource_bundle_impl.cc @@ -6,8 +6,7 @@ #include "ui/base/resource/resource_bundle.h" -CefResourceBundleImpl::CefResourceBundleImpl() { -} +CefResourceBundleImpl::CefResourceBundleImpl() {} CefString CefResourceBundleImpl::GetLocalizedString(int string_id) { if (!ui::ResourceBundle::HasSharedInstance()) diff --git a/libcef/common/resource_bundle_impl.h b/libcef/common/resource_bundle_impl.h index eceee7c1d..cc0268214 100644 --- a/libcef/common/resource_bundle_impl.h +++ b/libcef/common/resource_bundle_impl.h @@ -6,7 +6,6 @@ #define CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_IMPL_H_ #pragma once - #include "include/cef_resource_bundle.h" class CefResourceBundleImpl : public CefResourceBundle { diff --git a/libcef/common/response_impl.cc b/libcef/common/response_impl.cc index b4c27754c..202ceaca5 100644 --- a/libcef/common/response_impl.cc +++ b/libcef/common/response_impl.cc @@ -15,14 +15,12 @@ #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURLResponse.h" - -#define CHECK_READONLY_RETURN_VOID() \ - if (read_only_) { \ +#define CHECK_READONLY_RETURN_VOID() \ + if (read_only_) { \ NOTREACHED() << "object is read only"; \ - return; \ + return; \ } - // CefResponse ---------------------------------------------------------------- // static @@ -31,14 +29,10 @@ CefRefPtr CefResponse::Create() { return response; } - // CefResponseImpl ------------------------------------------------------------ CefResponseImpl::CefResponseImpl() - : error_code_(ERR_NONE), - status_code_(0), - read_only_(false) { -} + : error_code_(ERR_NONE), status_code_(0), read_only_(false) {} bool CefResponseImpl::IsReadOnly() { base::AutoLock lock_scope(lock_); @@ -122,14 +116,13 @@ net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() { if (!status_text_.empty()) status_text = status_text_; else - status_text = (status_code_ == 200)?"OK":"ERROR"; + status_text = (status_code_ == 200) ? "OK" : "ERROR"; base::SStringPrintf(&response, "HTTP/1.1 %d %s", status_code_, status_text.c_str()); if (header_map_.size() > 0) { for (HeaderMap::const_iterator header = header_map_.begin(); - header != header_map_.end(); - ++header) { + header != header_map_.end(); ++header) { const CefString& key = header->first; const CefString& value = header->second; @@ -156,7 +149,8 @@ net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() { mime_type = "text/html"; base::StringAppendF(&response, "%c%s: %s", '\0', - net::HttpRequestHeaders::kContentType, mime_type.c_str()); + net::HttpRequestHeaders::kContentType, + mime_type.c_str()); } return new net::HttpResponseHeaders(response); diff --git a/libcef/common/response_manager.cc b/libcef/common/response_manager.cc index b7f6efcb7..197e1138e 100644 --- a/libcef/common/response_manager.cc +++ b/libcef/common/response_manager.cc @@ -2,14 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "libcef/common/response_manager.h" #include "libcef/common/cef_messages.h" +#include "libcef/common/response_manager.h" #include "base/logging.h" -CefResponseManager::CefResponseManager() - : next_request_id_(0) { -} +CefResponseManager::CefResponseManager() : next_request_id_(0) {} int CefResponseManager::GetNextRequestId() { DCHECK(CalledOnValidThread()); @@ -19,7 +17,8 @@ int CefResponseManager::GetNextRequestId() { int CefResponseManager::RegisterHandler(CefRefPtr handler) { DCHECK(CalledOnValidThread()); int request_id = GetNextRequestId(); - TRACE_EVENT_ASYNC_BEGIN1("libcef", "CefResponseManager::Handler", request_id, "request_id", request_id); + TRACE_EVENT_ASYNC_BEGIN1("libcef", "CefResponseManager::Handler", request_id, + "request_id", request_id); handlers_.insert(std::make_pair(request_id, handler)); return request_id; } @@ -32,10 +31,12 @@ bool CefResponseManager::RunHandler(const Cef_Response_Params& params) { TRACE_EVENT0("libcef", "CefResponseManager::RunHandler"); it->second->OnResponse(params); handlers_.erase(it); - TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 1); + TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", + params.request_id, "success", 1); return true; } - TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 0); + TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", + params.request_id, "success", 0); return false; } diff --git a/libcef/common/response_manager.h b/libcef/common/response_manager.h index 08baefc9c..9ee29af09 100644 --- a/libcef/common/response_manager.h +++ b/libcef/common/response_manager.h @@ -7,7 +7,9 @@ #pragma once #include + #include "include/cef_base.h" + #include "base/threading/non_thread_safe.h" struct Cef_Response_Params; @@ -18,13 +20,13 @@ class CefResponseManager : base::NonThreadSafe { // Used for handling response messages. class Handler : public virtual CefBaseRefCounted { public: - virtual void OnResponse(const Cef_Response_Params& params) =0; + virtual void OnResponse(const Cef_Response_Params& params) = 0; }; // Used for handling response ack messages. class AckHandler : public virtual CefBaseRefCounted { public: - virtual void OnResponseAck() =0; + virtual void OnResponseAck() = 0; }; CefResponseManager(); @@ -51,11 +53,11 @@ class CefResponseManager : base::NonThreadSafe { int next_request_id_; // Map of unique request ids to Handler references. - typedef std::map > HandlerMap; + typedef std::map> HandlerMap; HandlerMap handlers_; // Map of unique request ids to AckHandler references. - typedef std::map > AckHandlerMap; + typedef std::map> AckHandlerMap; AckHandlerMap ack_handlers_; }; diff --git a/libcef/common/scheme_registrar_impl.cc b/libcef/common/scheme_registrar_impl.cc index 62a6e3e3f..ef7c9d18f 100644 --- a/libcef/common/scheme_registrar_impl.cc +++ b/libcef/common/scheme_registrar_impl.cc @@ -21,20 +21,17 @@ void AppendArray(const std::vector& source, return; target->insert(target->end(), source.begin(), source.end()); } - } -CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() { -} +CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() {} -bool CefSchemeRegistrarImpl::AddCustomScheme( - const CefString& scheme_name, - bool is_standard, - bool is_local, - bool is_display_isolated, - bool is_secure, - bool is_cors_enabled, - bool is_csp_bypassing) { +bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name, + bool is_standard, + bool is_local, + bool is_display_isolated, + bool is_secure, + bool is_cors_enabled, + bool is_csp_bypassing) { const std::string& scheme = base::ToLowerASCII(scheme_name.ToString()); if (scheme::IsInternalHandledScheme(scheme) || registered_schemes_.find(scheme) != registered_schemes_.end()) { @@ -57,9 +54,8 @@ bool CefSchemeRegistrarImpl::AddCustomScheme( schemes_.csp_bypassing_schemes.push_back(scheme); CefContentClient::SchemeInfo scheme_info = { - scheme, is_standard, is_local, is_display_isolated, is_secure, - is_cors_enabled, is_csp_bypassing - }; + scheme, is_standard, is_local, is_display_isolated, + is_secure, is_cors_enabled, is_csp_bypassing}; CefContentClient::Get()->AddCustomScheme(scheme_info); return true; diff --git a/libcef/common/string_list_impl.cc b/libcef/common/string_list_impl.cc index 09aff868a..ce2517fac 100644 --- a/libcef/common/string_list_impl.cc +++ b/libcef/common/string_list_impl.cc @@ -3,7 +3,9 @@ // can be found in the LICENSE file. #include + #include "include/internal/cef_string_list.h" + #include "base/logging.h" typedef std::vector StringList; @@ -18,7 +20,8 @@ CEF_EXPORT size_t cef_string_list_size(cef_string_list_t list) { return impl->size(); } -CEF_EXPORT int cef_string_list_value(cef_string_list_t list, size_t index, +CEF_EXPORT int cef_string_list_value(cef_string_list_t list, + size_t index, cef_string_t* value) { DCHECK(list); DCHECK(value); diff --git a/libcef/common/string_map_impl.cc b/libcef/common/string_map_impl.cc index 9b8c6075e..16e682f8f 100644 --- a/libcef/common/string_map_impl.cc +++ b/libcef/common/string_map_impl.cc @@ -3,7 +3,9 @@ // can be found in the LICENSE file. #include + #include "include/internal/cef_string_map.h" + #include "base/logging.h" typedef std::map StringMap; @@ -32,7 +34,8 @@ CEF_EXPORT int cef_string_map_find(cef_string_map_t map, return cef_string_set(val.c_str(), val.length(), value, true); } -CEF_EXPORT int cef_string_map_key(cef_string_map_t map, size_t index, +CEF_EXPORT int cef_string_map_key(cef_string_map_t map, + size_t index, cef_string_t* key) { DCHECK(map); DCHECK(key); @@ -49,7 +52,8 @@ CEF_EXPORT int cef_string_map_key(cef_string_map_t map, size_t index, return 0; } -CEF_EXPORT int cef_string_map_value(cef_string_map_t map, size_t index, +CEF_EXPORT int cef_string_map_value(cef_string_map_t map, + size_t index, cef_string_t* value) { DCHECK(map); DCHECK(value); @@ -62,7 +66,7 @@ CEF_EXPORT int cef_string_map_value(cef_string_map_t map, size_t index, for (size_t ct = 0; it != impl->end(); ++it, ct++) { if (ct == index) { return cef_string_set(it->second.c_str(), it->second.length(), value, - true); + true); } } return 0; diff --git a/libcef/common/string_multimap_impl.cc b/libcef/common/string_multimap_impl.cc index 886fa814e..e2fe6e00b 100644 --- a/libcef/common/string_multimap_impl.cc +++ b/libcef/common/string_multimap_impl.cc @@ -3,7 +3,9 @@ // can be found in the LICENSE file. #include + #include "include/internal/cef_string_multimap.h" + #include "base/logging.h" typedef std::multimap StringMultimap; @@ -19,7 +21,7 @@ CEF_EXPORT size_t cef_string_multimap_size(cef_string_multimap_t map) { } CEF_EXPORT size_t cef_string_multimap_find_count(cef_string_multimap_t map, - const cef_string_t* key) { + const cef_string_t* key) { DCHECK(map); DCHECK(key); StringMultimap* impl = reinterpret_cast(map); @@ -55,7 +57,8 @@ CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, return cef_string_set(val.c_str(), val.length(), value, true); } -CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, size_t index, +CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, + size_t index, cef_string_t* key) { DCHECK(map); DCHECK(key); @@ -72,7 +75,8 @@ CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, size_t index, return 0; } -CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, size_t index, +CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, + size_t index, cef_string_t* value) { DCHECK(map); DCHECK(value); @@ -85,7 +89,7 @@ CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, size_t index for (size_t ct = 0; it != impl->end(); ++it, ct++) { if (ct == index) { return cef_string_set(it->second.c_str(), it->second.length(), value, - true); + true); } } return 0; diff --git a/libcef/common/string_types_impl.cc b/libcef/common/string_types_impl.cc index ebc0051cc..7c8bab1f3 100644 --- a/libcef/common/string_types_impl.cc +++ b/libcef/common/string_types_impl.cc @@ -2,8 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/internal/cef_string_types.h" #include + +#include "include/internal/cef_string_types.h" + #include "base/i18n/case_conversion.h" #include "base/logging.h" #include "base/strings/string16.h" @@ -13,15 +15,15 @@ namespace { void string_wide_dtor(wchar_t* str) { - delete [] str; + delete[] str; } void string_utf8_dtor(char* str) { - delete [] str; + delete[] str; } void string_utf16_dtor(char16* str) { - delete [] str; + delete[] str; } // Originally from base/strings/utf_string_conversions.cc @@ -32,13 +34,15 @@ std::wstring ASCIIToWide(const base::StringPiece& ascii) { } // namespace -CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, - cef_string_wide_t* output, int copy) { +CEF_EXPORT int cef_string_wide_set(const wchar_t* src, + size_t src_len, + cef_string_wide_t* output, + int copy) { cef_string_wide_clear(output); if (copy) { if (src && src_len > 0) { - output->str = new wchar_t[src_len+1]; + output->str = new wchar_t[src_len + 1]; if (!output->str) return 0; @@ -55,12 +59,14 @@ CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, return 1; } -CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, - cef_string_utf8_t* output, int copy) { +CEF_EXPORT int cef_string_utf8_set(const char* src, + size_t src_len, + cef_string_utf8_t* output, + int copy) { cef_string_utf8_clear(output); if (copy) { if (src && src_len > 0) { - output->str = new char[src_len+1]; + output->str = new char[src_len + 1]; if (!output->str) return 0; @@ -77,13 +83,15 @@ CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, return 1; } -CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, - cef_string_utf16_t* output, int copy) { +CEF_EXPORT int cef_string_utf16_set(const char16* src, + size_t src_len, + cef_string_utf16_t* output, + int copy) { cef_string_utf16_clear(output); if (copy) { if (src && src_len > 0) { - output->str = new char16[src_len+1]; + output->str = new char16[src_len + 1]; if (!output->str) return 0; @@ -163,8 +171,8 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, if (str1->length == 0 && str2->length == 0) return 0; #if defined(WCHAR_T_IS_UTF32) - int r = base::c16memcmp(str1->str, str2->str, std::min(str1->length, - str2->length)); + int r = base::c16memcmp(str1->str, str2->str, + std::min(str1->length, str2->length)); #else int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length)); #endif @@ -177,7 +185,8 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, return r; } -CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, +CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, + size_t src_len, cef_string_utf8_t* output) { std::string str; bool ret = base::WideToUTF8(src, src_len, &str); @@ -186,7 +195,8 @@ CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, +CEF_EXPORT int cef_string_utf8_to_wide(const char* src, + size_t src_len, cef_string_wide_t* output) { std::wstring str; bool ret = base::UTF8ToWide(src, src_len, &str); @@ -195,7 +205,8 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, +CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, + size_t src_len, cef_string_utf16_t* output) { base::string16 str; bool ret = base::WideToUTF16(src, src_len, &str); @@ -204,7 +215,8 @@ CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, + size_t src_len, cef_string_wide_t* output) { std::wstring str; bool ret = base::UTF16ToWide(src, src_len, &str); @@ -213,7 +225,8 @@ CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, +CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, + size_t src_len, cef_string_utf16_t* output) { base::string16 str; bool ret = base::UTF8ToUTF16(src, src_len, &str); @@ -222,7 +235,8 @@ CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, + size_t src_len, cef_string_utf8_t* output) { std::string str; bool ret = base::UTF16ToUTF8(src, src_len, &str); @@ -231,13 +245,15 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, +CEF_EXPORT int cef_string_ascii_to_wide(const char* src, + size_t src_len, cef_string_wide_t* output) { const std::wstring& str = ASCIIToWide(std::string(src, src_len)); return cef_string_wide_set(str.c_str(), str.length(), output, true); } -CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, +CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, + size_t src_len, cef_string_utf16_t* output) { const base::string16& str = base::ASCIIToUTF16(std::string(src, src_len)); return cef_string_utf16_set(str.c_str(), str.length(), output, true); @@ -277,13 +293,15 @@ CEF_EXPORT void cef_string_userfree_utf16_free( delete str; } -CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, + size_t src_len, cef_string_utf16_t* output) { const base::string16& str = base::i18n::ToLower(base::string16(src, src_len)); return cef_string_utf16_set(str.c_str(), str.length(), output, true); } -CEF_EXPORT int cef_string_utf16_to_upper(const char16* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_upper(const char16* src, + size_t src_len, cef_string_utf16_t* output) { const base::string16& str = base::i18n::ToUpper(base::string16(src, src_len)); return cef_string_utf16_set(str.c_str(), str.length(), output, true); diff --git a/libcef/common/task_impl.cc b/libcef/common/task_impl.cc index c7832ae1c..a1d7393c5 100644 --- a/libcef/common/task_impl.cc +++ b/libcef/common/task_impl.cc @@ -21,17 +21,19 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr task) { CefTaskRunnerImpl::GetTaskRunner(threadId); if (task_runner.get()) { return task_runner->PostTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get())); + base::Bind(&CefTask::Execute, task.get())); } return false; } -bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, int64 delay_ms) { +bool CefPostDelayedTask(CefThreadId threadId, + CefRefPtr task, + int64 delay_ms) { scoped_refptr task_runner = CefTaskRunnerImpl::GetTaskRunner(threadId); if (task_runner.get()) { - return task_runner->PostDelayedTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get()), + return task_runner->PostDelayedTask( + FROM_HERE, base::Bind(&CefTask::Execute, task.get()), base::TimeDelta::FromMilliseconds(delay_ms)); } return false; diff --git a/libcef/common/task_runner_impl.cc b/libcef/common/task_runner_impl.cc index 14300d801..bd24ad463 100644 --- a/libcef/common/task_runner_impl.cc +++ b/libcef/common/task_runner_impl.cc @@ -2,8 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "libcef/common/task_runner_impl.h" #include "libcef/common/content_client.h" +#include "libcef/common/task_runner_impl.h" #include "libcef/renderer/content_renderer_client.h" #include "base/bind.h" @@ -37,7 +37,6 @@ CefRefPtr CefTaskRunner::GetForThread(CefThreadId threadId) { return NULL; } - // CefTaskRunnerImpl CefTaskRunnerImpl::CefTaskRunnerImpl( @@ -47,8 +46,8 @@ CefTaskRunnerImpl::CefTaskRunnerImpl( } // static -scoped_refptr - CefTaskRunnerImpl::GetTaskRunner(CefThreadId threadId) { +scoped_refptr CefTaskRunnerImpl::GetTaskRunner( + CefThreadId threadId) { // Render process. if (threadId == TID_RENDERER) { CefContentRendererClient* client = CefContentRendererClient::Get(); @@ -60,29 +59,29 @@ scoped_refptr // Browser process. int id = -1; switch (threadId) { - case TID_UI: - id = BrowserThread::UI; - break; - case TID_DB: - id = BrowserThread::DB; - break; - case TID_FILE: - id = BrowserThread::FILE; - break; - case TID_FILE_USER_BLOCKING: - id = BrowserThread::FILE_USER_BLOCKING; - break; - case TID_PROCESS_LAUNCHER: - id = BrowserThread::PROCESS_LAUNCHER; - break; - case TID_CACHE: - id = BrowserThread::CACHE; - break; - case TID_IO: - id = BrowserThread::IO; - break; - default: - break; + case TID_UI: + id = BrowserThread::UI; + break; + case TID_DB: + id = BrowserThread::DB; + break; + case TID_FILE: + id = BrowserThread::FILE; + break; + case TID_FILE_USER_BLOCKING: + id = BrowserThread::FILE_USER_BLOCKING; + break; + case TID_PROCESS_LAUNCHER: + id = BrowserThread::PROCESS_LAUNCHER; + break; + case TID_CACHE: + id = BrowserThread::CACHE; + break; + case TID_IO: + id = BrowserThread::IO; + break; + default: + break; }; if (id >= 0 && CefContentClient::Get() && @@ -97,7 +96,7 @@ scoped_refptr // static scoped_refptr - CefTaskRunnerImpl::GetCurrentTaskRunner() { +CefTaskRunnerImpl::GetCurrentTaskRunner() { scoped_refptr task_runner; // For named browser process threads return the same TaskRunner as @@ -141,12 +140,12 @@ bool CefTaskRunnerImpl::BelongsToThread(CefThreadId threadId) { bool CefTaskRunnerImpl::PostTask(CefRefPtr task) { return task_runner_->PostTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get())); + base::Bind(&CefTask::Execute, task.get())); } bool CefTaskRunnerImpl::PostDelayedTask(CefRefPtr task, int64 delay_ms) { - return task_runner_->PostDelayedTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get()), - base::TimeDelta::FromMilliseconds(delay_ms)); + return task_runner_->PostDelayedTask( + FROM_HERE, base::Bind(&CefTask::Execute, task.get()), + base::TimeDelta::FromMilliseconds(delay_ms)); } diff --git a/libcef/common/task_runner_impl.h b/libcef/common/task_runner_impl.h index c0b3aa821..0f2aeec9a 100644 --- a/libcef/common/task_runner_impl.h +++ b/libcef/common/task_runner_impl.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef CEF_LIBCEF_COMMON_TASK_RUNNER_IMPL_H_ -#define CEF_LIBCEF_COMMON_TASK_RUNNER_IMPL_H_ +#ifndef CEF_LIBCEF_COMMON_TASK_RUNNER_IMPL_H_ +#define CEF_LIBCEF_COMMON_TASK_RUNNER_IMPL_H_ #pragma once #include "include/cef_task.h" + #include "base/sequenced_task_runner.h" class CefTaskRunnerImpl : public CefTaskRunner { @@ -15,8 +16,8 @@ class CefTaskRunnerImpl : public CefTaskRunner { scoped_refptr task_runner); // Returns the task runner associated with |threadId|. - static scoped_refptr - GetTaskRunner(CefThreadId threadId); + static scoped_refptr GetTaskRunner( + CefThreadId threadId); // Returns the current task runner. static scoped_refptr GetCurrentTaskRunner(); @@ -25,8 +26,7 @@ class CefTaskRunnerImpl : public CefTaskRunner { bool BelongsToCurrentThread() override; bool BelongsToThread(CefThreadId threadId) override; bool PostTask(CefRefPtr task) override; - bool PostDelayedTask(CefRefPtr task, - int64 delay_ms) override; + bool PostDelayedTask(CefRefPtr task, int64 delay_ms) override; private: scoped_refptr task_runner_; diff --git a/libcef/common/test/translator_test_impl.cc b/libcef/common/test/translator_test_impl.cc index 23ed616be..1962b5048 100644 --- a/libcef/common/test/translator_test_impl.cc +++ b/libcef/common/test/translator_test_impl.cc @@ -4,20 +4,14 @@ #include "include/test/cef_translator_test.h" -class CefTranslatorTestRefPtrLibraryImpl : - public CefTranslatorTestRefPtrLibrary { +class CefTranslatorTestRefPtrLibraryImpl + : public CefTranslatorTestRefPtrLibrary { public: - explicit CefTranslatorTestRefPtrLibraryImpl(int value) - : value_(value) { - } + explicit CefTranslatorTestRefPtrLibraryImpl(int value) : value_(value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } protected: int value_; @@ -33,29 +27,19 @@ CefTranslatorTestRefPtrLibrary::Create(int value) { return new CefTranslatorTestRefPtrLibraryImpl(value); } -class CefTranslatorTestRefPtrLibraryChildImpl : - public CefTranslatorTestRefPtrLibraryChild { +class CefTranslatorTestRefPtrLibraryChildImpl + : public CefTranslatorTestRefPtrLibraryChild { public: CefTranslatorTestRefPtrLibraryChildImpl(int value, int other_value) - : value_(value), - other_value_(other_value) { - } + : value_(value), other_value_(other_value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } - int GetOtherValue() override { - return other_value_; - } + int GetOtherValue() override { return other_value_; } - void SetOtherValue(int value) override { - other_value_ = value; - } + void SetOtherValue(int value) override { other_value_ = value; } protected: int value_; @@ -68,46 +52,31 @@ class CefTranslatorTestRefPtrLibraryChildImpl : // static CefRefPtr -CefTranslatorTestRefPtrLibraryChild::Create( - int value, - int other_value) { +CefTranslatorTestRefPtrLibraryChild::Create(int value, int other_value) { return new CefTranslatorTestRefPtrLibraryChildImpl(value, other_value); } -class CefTranslatorTestRefPtrLibraryChildChildImpl : - public CefTranslatorTestRefPtrLibraryChildChild { +class CefTranslatorTestRefPtrLibraryChildChildImpl + : public CefTranslatorTestRefPtrLibraryChildChild { public: CefTranslatorTestRefPtrLibraryChildChildImpl(int value, - int other_value, - int other_other_value) - : value_(value), - other_value_(other_value), - other_other_value_(other_other_value) { - } + int other_value, + int other_other_value) + : value_(value), + other_value_(other_value), + other_other_value_(other_other_value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } - int GetOtherValue() override { - return other_value_; - } + int GetOtherValue() override { return other_value_; } - void SetOtherValue(int value) override { - other_value_ = value; - } + void SetOtherValue(int value) override { other_value_ = value; } - int GetOtherOtherValue() override { - return other_other_value_; - } + int GetOtherOtherValue() override { return other_other_value_; } - void SetOtherOtherValue(int value) override { - other_other_value_ = value; - } + void SetOtherOtherValue(int value) override { other_other_value_ = value; } protected: int value_; @@ -121,29 +90,21 @@ class CefTranslatorTestRefPtrLibraryChildChildImpl : // static CefRefPtr -CefTranslatorTestRefPtrLibraryChildChild::Create( - int value, - int other_value, - int other_other_value) { +CefTranslatorTestRefPtrLibraryChildChild::Create(int value, + int other_value, + int other_other_value) { return new CefTranslatorTestRefPtrLibraryChildChildImpl(value, other_value, other_other_value); } - -class CefTranslatorTestScopedLibraryImpl : - public CefTranslatorTestScopedLibrary { +class CefTranslatorTestScopedLibraryImpl + : public CefTranslatorTestScopedLibrary { public: - explicit CefTranslatorTestScopedLibraryImpl(int value) - : value_(value) { - } + explicit CefTranslatorTestScopedLibraryImpl(int value) : value_(value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } protected: int value_; @@ -159,29 +120,19 @@ CefTranslatorTestScopedLibrary::Create(int value) { new CefTranslatorTestScopedLibraryImpl(value)); } -class CefTranslatorTestScopedLibraryChildImpl : - public CefTranslatorTestScopedLibraryChild { +class CefTranslatorTestScopedLibraryChildImpl + : public CefTranslatorTestScopedLibraryChild { public: CefTranslatorTestScopedLibraryChildImpl(int value, int other_value) - : value_(value), - other_value_(other_value) { - } + : value_(value), other_value_(other_value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } - int GetOtherValue() override { - return other_value_; - } + int GetOtherValue() override { return other_value_; } - void SetOtherValue(int value) override { - other_value_ = value; - } + void SetOtherValue(int value) override { other_value_ = value; } protected: int value_; @@ -193,47 +144,32 @@ class CefTranslatorTestScopedLibraryChildImpl : // static CefOwnPtr -CefTranslatorTestScopedLibraryChild::Create( - int value, - int other_value) { +CefTranslatorTestScopedLibraryChild::Create(int value, int other_value) { return CefOwnPtr( new CefTranslatorTestScopedLibraryChildImpl(value, other_value)); } -class CefTranslatorTestScopedLibraryChildChildImpl : - public CefTranslatorTestScopedLibraryChildChild { +class CefTranslatorTestScopedLibraryChildChildImpl + : public CefTranslatorTestScopedLibraryChildChild { public: CefTranslatorTestScopedLibraryChildChildImpl(int value, int other_value, int other_other_value) - : value_(value), - other_value_(other_value), - other_other_value_(other_other_value) { - } + : value_(value), + other_value_(other_value), + other_other_value_(other_other_value) {} - int GetValue() override { - return value_; - } + int GetValue() override { return value_; } - void SetValue(int value) override { - value_ = value; - } + void SetValue(int value) override { value_ = value; } - int GetOtherValue() override { - return other_value_; - } + int GetOtherValue() override { return other_value_; } - void SetOtherValue(int value) override { - other_value_ = value; - } + void SetOtherValue(int value) override { other_value_ = value; } - int GetOtherOtherValue() override { - return other_other_value_; - } + int GetOtherOtherValue() override { return other_other_value_; } - void SetOtherOtherValue(int value) override { - other_other_value_ = value; - } + void SetOtherOtherValue(int value) override { other_other_value_ = value; } protected: int value_; @@ -246,70 +182,43 @@ class CefTranslatorTestScopedLibraryChildChildImpl : // static CefOwnPtr -CefTranslatorTestScopedLibraryChildChild::Create( - int value, - int other_value, - int other_other_value) { +CefTranslatorTestScopedLibraryChildChild::Create(int value, + int other_value, + int other_other_value) { return CefOwnPtr( new CefTranslatorTestScopedLibraryChildChildImpl(value, other_value, other_other_value)); } - class CefTranslatorTestImpl : public CefTranslatorTest { public: - CefTranslatorTestImpl() { - } + CefTranslatorTestImpl() {} // PRIMITIVE VALUES - void GetVoid() override { - } + void GetVoid() override {} - bool GetBool() override { - return TEST_BOOL_VAL; - } + bool GetBool() override { return TEST_BOOL_VAL; } - int GetInt() override { - return TEST_INT_VAL; - } + int GetInt() override { return TEST_INT_VAL; } - double GetDouble() override { - return TEST_DOUBLE_VAL; - } + double GetDouble() override { return TEST_DOUBLE_VAL; } - long GetLong() override { - return TEST_LONG_VAL; - } + long GetLong() override { return TEST_LONG_VAL; } - size_t GetSizet() override { - return TEST_SIZET_VAL; - } + size_t GetSizet() override { return TEST_SIZET_VAL; } - bool SetVoid() override { - return true; - } + bool SetVoid() override { return true; } - bool SetBool(bool val) override { - return (val == TEST_BOOL_VAL); - } + bool SetBool(bool val) override { return (val == TEST_BOOL_VAL); } - bool SetInt(int val) override { - return (val == TEST_INT_VAL); - } + bool SetInt(int val) override { return (val == TEST_INT_VAL); } - bool SetDouble(double val) override { - return (val == TEST_DOUBLE_VAL); - } + bool SetDouble(double val) override { return (val == TEST_DOUBLE_VAL); } - bool SetLong(long val) override { - return (val == TEST_LONG_VAL); - } - - bool SetSizet(size_t val) override { - return (val == TEST_SIZET_VAL); - } + bool SetLong(long val) override { return (val == TEST_LONG_VAL); } + bool SetSizet(size_t val) override { return (val == TEST_SIZET_VAL); } // PRIMITIVE LIST VALUES @@ -328,33 +237,24 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - size_t GetIntListSize() override { - return 2U; - } - + size_t GetIntListSize() override { return 2U; } // STRING VALUES - CefString GetString() override { - return TEST_STRING_VAL; - } + CefString GetString() override { return TEST_STRING_VAL; } bool SetString(const CefString& val) override { return (val.ToString() == TEST_STRING_VAL); } - void GetStringByRef(CefString& val) override { - val = TEST_STRING_VAL; - } - + void GetStringByRef(CefString& val) override { val = TEST_STRING_VAL; } // STRING LIST VALUES bool SetStringList(const std::vector& val) override { if (val.size() != 3U) return false; - return val[0] == TEST_STRING_VAL && - val[1] == TEST_STRING_VAL2 && + return val[0] == TEST_STRING_VAL && val[1] == TEST_STRING_VAL2 && val[2] == TEST_STRING_VAL3; } @@ -367,7 +267,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - // STRING MAP VALUES bool SetStringMap(const StringMap& val) override { @@ -375,7 +274,7 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return false; StringMap::const_iterator it; - + it = val.find(TEST_STRING_KEY); if (it == val.end() || it->second != TEST_STRING_VAL) return false; @@ -398,7 +297,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - // STRING MULTIMAP VALUES bool SetStringMultimap( @@ -407,7 +305,7 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return false; StringMultimap::const_iterator it; - + it = val.find(TEST_STRING_KEY); if (it == val.end() || it->second != TEST_STRING_VAL) return false; @@ -430,12 +328,9 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - // STRUCT VALUES - CefPoint GetPoint() override { - return CefPoint(TEST_X_VAL, TEST_Y_VAL); - } + CefPoint GetPoint() override { return CefPoint(TEST_X_VAL, TEST_Y_VAL); } bool SetPoint(const CefPoint& val) override { return val.x == TEST_X_VAL && val.y == TEST_Y_VAL; @@ -445,7 +340,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { val = CefPoint(TEST_X_VAL, TEST_Y_VAL); } - // STRUCT LIST VALUES bool SetPointList(const std::vector& val) override { @@ -464,10 +358,7 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - size_t GetPointListSize() override { - return 2U; - } - + size_t GetPointListSize() override { return 2U; } // LIBRARY-SIDE REFPTR VALUES @@ -495,18 +386,19 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return val; } - // LIBRARY-SIDE REFPTR LIST VALUES bool SetRefPtrLibraryList( - const std::vector >& val, - int val1, int val2) override { + const std::vector>& val, + int val1, + int val2) override { if (val.size() != 2U) return false; return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; } - bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1, + bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, + int val1, int val2) override { if (val.size() != GetRefPtrLibraryListSize()) return false; @@ -516,10 +408,7 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - size_t GetRefPtrLibraryListSize() override { - return 2U; - } - + size_t GetRefPtrLibraryListSize() override { return 2U; } // CLIENT-SIDE REFPTR VALUES @@ -542,12 +431,12 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return val; } - // CLIENT-SIDE REFPTR LIST VALUES bool SetRefPtrClientList( - const std::vector >& val, - int val1, int val2) override { + const std::vector>& val, + int val1, + int val2) override { if (val.size() != 2U) return false; return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; @@ -565,10 +454,7 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return true; } - size_t GetRefPtrClientListSize() override { - return 2U; - } - + size_t GetRefPtrClientListSize() override { return 2U; } // LIBRARY-SIDE OWNPTR VALUES @@ -597,7 +483,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return CefOwnPtr(val.release()); } - // CLIENT-SIDE OWNPTR VALUES int SetOwnPtrClient(CefOwnPtr val) override { @@ -619,7 +504,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return CefOwnPtr(val.release()); } - // LIBRARY-SIDE RAWPTR VALUES int SetRawPtrLibrary(CefRawPtr val) override { @@ -631,18 +515,17 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return val->GetValue(); } - // LIBRARY-SIDE RAWPTR LIST VALUES bool SetRawPtrLibraryList( - const std::vector >& val, - int val1, int val2) override { + const std::vector>& val, + int val1, + int val2) override { if (val.size() != 2U) return false; return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; } - // CLIENT-SIDE RAWPTR VALUES int SetRawPtrClient(CefRawPtr val) override { @@ -654,12 +537,12 @@ class CefTranslatorTestImpl : public CefTranslatorTest { return val->GetValue(); } - // CLIENT-SIDE RAWPTR LIST VALUES bool SetRawPtrClientList( - const std::vector >& val, - int val1, int val2) override { + const std::vector>& val, + int val1, + int val2) override { if (val.size() != 2U) return false; return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; diff --git a/libcef/common/thread_impl.cc b/libcef/common/thread_impl.cc index 19a5ee41a..865ee220e 100644 --- a/libcef/common/thread_impl.cc +++ b/libcef/common/thread_impl.cc @@ -41,16 +41,15 @@ CefRefPtr CefThread::CreateThread( return thread_impl; } -CefThreadImpl::CefThreadImpl() - : thread_id_(kInvalidPlatformThreadId) { -} +CefThreadImpl::CefThreadImpl() : thread_id_(kInvalidPlatformThreadId) {} CefThreadImpl::~CefThreadImpl() { if (thread_.get()) { if (!owner_task_runner_->RunsTasksOnCurrentThread()) { // Delete |thread_| on the correct thread. - owner_task_runner_->PostTask(FROM_HERE, - base::Bind(StopAndDestroy, base::Unretained(thread_.release()))); + owner_task_runner_->PostTask( + FROM_HERE, + base::Bind(StopAndDestroy, base::Unretained(thread_.release()))); } else { StopAndDestroy(thread_.release()); } diff --git a/libcef/common/thread_impl.h b/libcef/common/thread_impl.h index d0c8d726c..34bfc9ea9 100644 --- a/libcef/common/thread_impl.h +++ b/libcef/common/thread_impl.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef CEF_LIBCEF_COMMON_THREAD_IMPL_H_ -#define CEF_LIBCEF_COMMON_THREAD_IMPL_H_ +#ifndef CEF_LIBCEF_COMMON_THREAD_IMPL_H_ +#define CEF_LIBCEF_COMMON_THREAD_IMPL_H_ #pragma once #include "include/cef_thread.h" + #include "base/threading/thread.h" class CefThreadImpl : public CefThread { diff --git a/libcef/common/time_util.h b/libcef/common/time_util.h index 8d92da7ec..bbfa0748f 100644 --- a/libcef/common/time_util.h +++ b/libcef/common/time_util.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_COMMON_TIME_UTIL_H_ #pragma once -#include "include/internal/cef_time.h" #include "base/time/time.h" +#include "include/internal/cef_time.h" // Converts cef_time_t to/from a base::Time object. void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time); diff --git a/libcef/common/tracker.cc b/libcef/common/tracker.cc index 0a94ddb10..4b4fce9bf 100644 --- a/libcef/common/tracker.cc +++ b/libcef/common/tracker.cc @@ -6,13 +6,9 @@ // CefTrackNode implementation. -CefTrackNode::CefTrackNode() - : track_next_(NULL), - track_prev_(NULL) { -} +CefTrackNode::CefTrackNode() : track_next_(NULL), track_prev_(NULL) {} -CefTrackNode::~CefTrackNode() { -} +CefTrackNode::~CefTrackNode() {} void CefTrackNode::InsertTrackPrev(CefTrackNode* object) { if (track_prev_) @@ -39,12 +35,9 @@ void CefTrackNode::RemoveTracking() { track_prev_ = NULL; } - // CefTrackManager implementation. -CefTrackManager::CefTrackManager() - : object_count_(0) { -} +CefTrackManager::CefTrackManager() : object_count_(0) {} CefTrackManager::~CefTrackManager() { DeleteAll(); diff --git a/libcef/common/tracker.h b/libcef/common/tracker.h index a165ef857..84aad6286 100644 --- a/libcef/common/tracker.h +++ b/libcef/common/tracker.h @@ -2,8 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef CEF_LIBCEF_COMMON_TRACKER_H_ -#define CEF_LIBCEF_COMMON_TRACKER_H_ +#ifndef CEF_LIBCEF_COMMON_TRACKER_H_ +#define CEF_LIBCEF_COMMON_TRACKER_H_ #pragma once #include "include/cef_base.h" diff --git a/libcef/common/urlrequest_impl.cc b/libcef/common/urlrequest_impl.cc index 3fa59cd9c..45f1a05ac 100644 --- a/libcef/common/urlrequest_impl.cc +++ b/libcef/common/urlrequest_impl.cc @@ -13,9 +13,9 @@ // static CefRefPtr CefURLRequest::Create( - CefRefPtr request, - CefRefPtr client, - CefRefPtr request_context) { + CefRefPtr request, + CefRefPtr client, + CefRefPtr request_context) { if (!request.get() || !client.get()) { NOTREACHED() << "called with invalid parameters"; return NULL; diff --git a/libcef/common/util_mac.mm b/libcef/common/util_mac.mm index bdb34e421..efeeea6f3 100644 --- a/libcef/common/util_mac.mm +++ b/libcef/common/util_mac.mm @@ -29,7 +29,7 @@ base::FilePath GetFrameworksPath() { return base::FilePath(); return bundle_path.Append(FILE_PATH_LITERAL("Contents")) - .Append(FILE_PATH_LITERAL("Frameworks")); + .Append(FILE_PATH_LITERAL("Frameworks")); } } // namespace @@ -74,7 +74,7 @@ base::FilePath GetMainResourcesDirectory() { return base::FilePath(); return bundle_path.Append(FILE_PATH_LITERAL("Contents")) - .Append(FILE_PATH_LITERAL("Resources")); + .Append(FILE_PATH_LITERAL("Resources")); } base::FilePath GetChildProcessPath() { @@ -84,9 +84,9 @@ base::FilePath GetChildProcessPath() { std::string exe_name = GetMainProcessPath().BaseName().value(); return frameworks_path.Append(FILE_PATH_LITERAL(exe_name + " Helper.app")) - .Append(FILE_PATH_LITERAL("Contents")) - .Append(FILE_PATH_LITERAL("MacOS")) - .Append(FILE_PATH_LITERAL(exe_name + " Helper")); + .Append(FILE_PATH_LITERAL("Contents")) + .Append(FILE_PATH_LITERAL("MacOS")) + .Append(FILE_PATH_LITERAL(exe_name + " Helper")); } } // namespace util_mac diff --git a/libcef/common/value_base.cc b/libcef/common/value_base.cc index c24664249..a31136939 100644 --- a/libcef/common/value_base.cc +++ b/libcef/common/value_base.cc @@ -4,11 +4,8 @@ #include "libcef/common/value_base.h" - CefValueController::CefValueController() - : owner_value_(NULL), - owner_object_(NULL) { -} + : owner_value_(NULL), owner_object_(NULL) {} CefValueController::~CefValueController() { // Everything should already have been removed. diff --git a/libcef/common/value_base.h b/libcef/common/value_base.h index 4a53894a5..3d3d25341 100644 --- a/libcef/common/value_base.h +++ b/libcef/common/value_base.h @@ -15,7 +15,6 @@ #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" - // Controller implementation base class. class CefValueController : public base::RefCountedThreadSafe { @@ -26,15 +25,14 @@ class CefValueController virtual ~Object() {} // Called when the value has been removed. - virtual void OnControlRemoved() =0; + virtual void OnControlRemoved() = 0; }; // Encapsulates context locking and verification logic. class AutoLock { public: explicit AutoLock(CefValueController* impl) - : impl_(impl), - verified_(impl && impl->VerifyThread()) { + : impl_(impl), verified_(impl && impl->VerifyThread()) { DCHECK(impl); if (verified_) impl_->lock(); @@ -56,22 +54,22 @@ class CefValueController CefValueController(); // Returns true if this controller is thread safe. - virtual bool thread_safe() =0; + virtual bool thread_safe() = 0; // Returns true if the current thread is allowed to access this controller. - virtual bool on_correct_thread() =0; + virtual bool on_correct_thread() = 0; // Lock the controller. - virtual void lock() =0; + virtual void lock() = 0; // Unlock the controller. - virtual void unlock() =0; + virtual void unlock() = 0; // Returns true if the controller is locked on the current thread. - virtual bool locked() =0; + virtual bool locked() = 0; // Assert that the lock has been acquired. - virtual void AssertLockAcquired() =0; + virtual void AssertLockAcquired() = 0; // Verify that the current thread is correct for accessing the controller. inline bool VerifyThread() { @@ -139,8 +137,7 @@ class CefValueController // Thread-safe access control implementation. class CefValueControllerThreadSafe : public CefValueController { public: - explicit CefValueControllerThreadSafe() - : locked_thread_id_(0) {} + explicit CefValueControllerThreadSafe() : locked_thread_id_(0) {} // CefValueController methods. bool thread_safe() override { return true; } @@ -156,9 +153,7 @@ class CefValueControllerThreadSafe : public CefValueController { bool locked() override { return (locked_thread_id_ == base::PlatformThread::CurrentId()); } - void AssertLockAcquired() override { - lock_.AssertAcquired(); - } + void AssertLockAcquired() override { lock_.AssertAcquired(); } private: base::Lock lock_; @@ -171,7 +166,7 @@ class CefValueControllerThreadSafe : public CefValueController { class CefValueControllerNonThreadSafe : public CefValueController { public: explicit CefValueControllerNonThreadSafe() - : thread_id_(base::PlatformThread::CurrentId()) {} + : thread_id_(base::PlatformThread::CurrentId()) {} // CefValueController methods. bool thread_safe() override { return false; } @@ -181,9 +176,7 @@ class CefValueControllerNonThreadSafe : public CefValueController { void lock() override {} void unlock() override {} bool locked() override { return on_correct_thread(); } - void AssertLockAcquired() override { - DCHECK(locked()); - } + void AssertLockAcquired() override { DCHECK(locked()); } private: base::PlatformThreadId thread_id_; @@ -191,32 +184,30 @@ class CefValueControllerNonThreadSafe : public CefValueController { DISALLOW_COPY_AND_ASSIGN(CefValueControllerNonThreadSafe); }; - // Helper macros for verifying context. #define CEF_VALUE_VERIFY_RETURN_VOID_EX(object, modify) \ - if (!VerifyAttached()) \ - return; \ - AutoLock auto_lock(object, modify); \ - if (!auto_lock.verified()) \ - return; + if (!VerifyAttached()) \ + return; \ + AutoLock auto_lock(object, modify); \ + if (!auto_lock.verified()) \ + return; #define CEF_VALUE_VERIFY_RETURN_VOID(modify) \ - CEF_VALUE_VERIFY_RETURN_VOID_EX(this, modify) + CEF_VALUE_VERIFY_RETURN_VOID_EX(this, modify) #define CEF_VALUE_VERIFY_RETURN_EX(object, modify, error_val) \ - if (!VerifyAttached()) \ - return error_val; \ - AutoLock auto_lock(object, modify); \ - if (!auto_lock.verified()) \ - return error_val; + if (!VerifyAttached()) \ + return error_val; \ + AutoLock auto_lock(object, modify); \ + if (!auto_lock.verified()) \ + return error_val; #define CEF_VALUE_VERIFY_RETURN(modify, error_val) \ - CEF_VALUE_VERIFY_RETURN_EX(this, modify, error_val) - + CEF_VALUE_VERIFY_RETURN_EX(this, modify, error_val) // Template class for implementing CEF wrappers of other types. -template +template class CefValueBase : public CefType, public CefValueController::Object { public: // Specifies how the value will be used. @@ -246,10 +237,10 @@ class CefValueBase : public CefType, public CefValueController::Object { ValueMode value_mode, bool read_only, CefValueController* controller) - : value_(value), - value_mode_(value_mode), - read_only_(read_only), - controller_(controller) { + : value_(value), + value_mode_(value_mode), + read_only_(read_only), + controller_(controller) { DCHECK(value_); // Specifying a parent value for a non-reference doesn't make sense. @@ -404,7 +395,7 @@ class CefValueBase : public CefType, public CefValueController::Object { class AutoLock { public: explicit AutoLock(CefValueBase* impl, bool modify) - : auto_lock_(impl->controller()) { + : auto_lock_(impl->controller()) { verified_ = (auto_lock_.verified() && impl->VerifyAccess(modify)); } @@ -428,5 +419,4 @@ class CefValueBase : public CefType, public CefValueController::Object { DISALLOW_COPY_AND_ASSIGN(CefValueBase); }; - #endif // CEF_LIBCEF_COMMON_VALUE_BASE_H_ diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index 2c40512dc..1643d61dd 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -25,8 +25,8 @@ CefRefPtr CefValueImpl::GetOrCreateRefOrCopy( DCHECK(value); if (value->IsType(base::Value::Type::BINARY)) { - return new CefValueImpl(CefBinaryValueImpl::GetOrCreateRef( - value, parent_value, controller)); + return new CefValueImpl( + CefBinaryValueImpl::GetOrCreateRef(value, parent_value, controller)); } if (value->IsType(base::Value::Type::DICTIONARY)) { @@ -45,27 +45,22 @@ CefRefPtr CefValueImpl::GetOrCreateRefOrCopy( return new CefValueImpl(value->DeepCopy()); } -CefValueImpl::CefValueImpl() { -} +CefValueImpl::CefValueImpl() {} CefValueImpl::CefValueImpl(base::Value* value) { SetValue(value); } CefValueImpl::CefValueImpl(CefRefPtr value) - : binary_value_(value) { -} + : binary_value_(value) {} CefValueImpl::CefValueImpl(CefRefPtr value) - : dictionary_value_(value) { -} + : dictionary_value_(value) {} CefValueImpl::CefValueImpl(CefRefPtr value) - : list_value_(value) { -} + : list_value_(value) {} -CefValueImpl::~CefValueImpl() { -} +CefValueImpl::~CefValueImpl() {} void CefValueImpl::SetValue(base::Value* value) { base::AutoLock lock_scope(lock_); @@ -77,27 +72,26 @@ base::Value* CefValueImpl::CopyOrDetachValue( base::AutoLock lock_scope(lock_); if (binary_value_) { - return static_cast(binary_value_.get())-> - CopyOrDetachValue(new_controller); + return static_cast(binary_value_.get()) + ->CopyOrDetachValue(new_controller); } if (dictionary_value_) { - return static_cast(dictionary_value_.get())-> - CopyOrDetachValue(new_controller); + return static_cast(dictionary_value_.get()) + ->CopyOrDetachValue(new_controller); } if (list_value_) { - return static_cast(list_value_.get())-> - CopyOrDetachValue(new_controller); + return static_cast(list_value_.get()) + ->CopyOrDetachValue(new_controller); } return value_->DeepCopy(); } -void CefValueImpl::SwapValue( - base::Value* new_value, - void* new_parent_value, - CefValueController* new_controller) { +void CefValueImpl::SwapValue(base::Value* new_value, + void* new_parent_value, + CefValueController* new_controller) { base::AutoLock lock_scope(lock_); if (binary_value_) { @@ -105,12 +99,12 @@ void CefValueImpl::SwapValue( new_value, new_parent_value, new_controller); } else if (dictionary_value_) { dictionary_value_ = CefDictionaryValueImpl::GetOrCreateRef( - static_cast(new_value), new_parent_value, - false, new_controller); + static_cast(new_value), new_parent_value, false, + new_controller); } else if (list_value_) { list_value_ = CefListValueImpl::GetOrCreateRef( - static_cast(new_value), new_parent_value, - false, new_controller); + static_cast(new_value), new_parent_value, false, + new_controller); } } @@ -360,8 +354,8 @@ void CefValueImpl::SetValueInternal(base::Value* value) { static_cast(value), true, false); return; case base::Value::Type::LIST: - list_value_ = new CefListValueImpl( - static_cast(value), true, false); + list_value_ = new CefListValueImpl(static_cast(value), + true, false); return; default: value_.reset(value); @@ -375,8 +369,8 @@ CefValueController* CefValueImpl::GetValueController() const { if (binary_value_) { return static_cast(binary_value_.get())->controller(); } else if (dictionary_value_) { - return static_cast(dictionary_value_.get())-> - controller(); + return static_cast(dictionary_value_.get()) + ->controller(); } else if (list_value_) { return static_cast(list_value_.get())->controller(); } @@ -406,11 +400,11 @@ base::Value* CefValueImpl::GetValueUnsafe() const { lock_.AssertAcquired(); if (binary_value_) { - return static_cast(binary_value_.get())-> - GetValueUnsafe(); + return static_cast(binary_value_.get()) + ->GetValueUnsafe(); } else if (dictionary_value_) { - return static_cast(dictionary_value_.get())-> - GetValueUnsafe(); + return static_cast(dictionary_value_.get()) + ->GetValueUnsafe(); } else if (list_value_) { return static_cast(list_value_.get())->GetValueUnsafe(); } @@ -418,7 +412,6 @@ base::Value* CefValueImpl::GetValueUnsafe() const { return value_.get(); } - // CefBinaryValueImpl implementation. CefRefPtr CefBinaryValue::Create(const void* data, @@ -429,14 +422,14 @@ CefRefPtr CefBinaryValue::Create(const void* data, return NULL; return new CefBinaryValueImpl(static_cast(const_cast(data)), - data_size); + data_size); } // static CefRefPtr CefBinaryValueImpl::GetOrCreateRef( - base::Value* value, - void* parent_value, - CefValueController* controller) { + base::Value* value, + void* parent_value, + CefValueController* controller) { DCHECK(value); DCHECK(parent_value); DCHECK(controller); @@ -446,22 +439,24 @@ CefRefPtr CefBinaryValueImpl::GetOrCreateRef( return static_cast(object); return new CefBinaryValueImpl(value, parent_value, - CefBinaryValueImpl::kReference, controller); + CefBinaryValueImpl::kReference, controller); } -CefBinaryValueImpl::CefBinaryValueImpl(base::Value* value, - bool will_delete) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - true, NULL) { -} +CefBinaryValueImpl::CefBinaryValueImpl(base::Value* value, bool will_delete) + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + true, + NULL) {} -CefBinaryValueImpl::CefBinaryValueImpl(char* data, - size_t data_size) - : CefValueBase( - new base::Value(std::vector(data, data + data_size)), - NULL, kOwnerWillDelete, true, NULL) { -} +CefBinaryValueImpl::CefBinaryValueImpl(char* data, size_t data_size) + : CefValueBase( + new base::Value(std::vector(data, data + data_size)), + NULL, + kOwnerWillDelete, + true, + NULL) {} base::Value* CefBinaryValueImpl::CopyValue() { CEF_VALUE_VERIFY_RETURN(false, NULL); @@ -516,8 +511,8 @@ bool CefBinaryValueImpl::IsSame(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsSameValue(&const_value()); + return static_cast(that.get()) + ->IsSameValue(&const_value()); } bool CefBinaryValueImpl::IsEqual(CefRefPtr that) { @@ -527,14 +522,14 @@ bool CefBinaryValueImpl::IsEqual(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsEqualValue(&const_value()); + return static_cast(that.get()) + ->IsEqualValue(&const_value()); } CefRefPtr CefBinaryValueImpl::Copy() { CEF_VALUE_VERIFY_RETURN(false, NULL); return new CefBinaryValueImpl(const_value().DeepCopy(), NULL, - CefBinaryValueImpl::kOwnerWillDelete, NULL); + CefBinaryValueImpl::kOwnerWillDelete, NULL); } size_t CefBinaryValueImpl::GetSize() { @@ -557,9 +552,9 @@ size_t CefBinaryValueImpl::GetData(void* buffer, if (data_offset >= size) return 0; - size = std::min(buffer_size, size-data_offset); + size = std::min(buffer_size, size - data_offset); const char* data = const_value().GetBuffer(); - memcpy(buffer, data+data_offset, size); + memcpy(buffer, data + data_offset, size); return size; } @@ -567,10 +562,11 @@ CefBinaryValueImpl::CefBinaryValueImpl(base::Value* value, void* parent_value, ValueMode value_mode, CefValueController* controller) - : CefValueBase( - value, parent_value, value_mode, true, controller) { -} - + : CefValueBase(value, + parent_value, + value_mode, + true, + controller) {} // CefDictionaryValueImpl implementation. @@ -590,16 +586,19 @@ CefRefPtr CefDictionaryValueImpl::GetOrCreateRef( return static_cast(object); return new CefDictionaryValueImpl(value, parent_value, - CefDictionaryValueImpl::kReference, read_only, controller); + CefDictionaryValueImpl::kReference, + read_only, controller); } CefDictionaryValueImpl::CefDictionaryValueImpl(base::DictionaryValue* value, bool will_delete, bool read_only) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - read_only, NULL) { -} + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + read_only, + NULL) {} base::DictionaryValue* CefDictionaryValueImpl::CopyValue() { CEF_VALUE_VERIFY_RETURN(false, NULL); @@ -658,8 +657,8 @@ bool CefDictionaryValueImpl::IsSame(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsSameValue(&const_value()); + return static_cast(that.get()) + ->IsSameValue(&const_value()); } bool CefDictionaryValueImpl::IsEqual(CefRefPtr that) { @@ -669,8 +668,8 @@ bool CefDictionaryValueImpl::IsEqual(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsEqualValue(&const_value()); + return static_cast(that.get()) + ->IsEqualValue(&const_value()); } CefRefPtr CefDictionaryValueImpl::Copy( @@ -679,14 +678,15 @@ CefRefPtr CefDictionaryValueImpl::Copy( base::DictionaryValue* value; if (exclude_empty_children) { - value = const_cast( - const_value()).DeepCopyWithoutEmptyChildren().release(); + value = const_cast(const_value()) + .DeepCopyWithoutEmptyChildren() + .release(); } else { value = const_value().DeepCopy(); } - return new CefDictionaryValueImpl(value, NULL, - CefDictionaryValueImpl::kOwnerWillDelete, false, NULL); + return new CefDictionaryValueImpl( + value, NULL, CefDictionaryValueImpl::kOwnerWillDelete, false, NULL); } size_t CefDictionaryValueImpl::GetSize() { @@ -712,8 +712,8 @@ bool CefDictionaryValueImpl::HasKey(const CefString& key) { bool CefDictionaryValueImpl::GetKeys(KeyList& keys) { CEF_VALUE_VERIFY_RETURN(false, 0); - for (base::DictionaryValue::Iterator i(const_value()); - !i.IsAtEnd(); i.Advance()) { + for (base::DictionaryValue::Iterator i(const_value()); !i.IsAtEnd(); + i.Advance()) { keys.push_back(i.key()); } @@ -762,8 +762,7 @@ CefRefPtr CefDictionaryValueImpl::GetValue(const CefString& key) { &out_value)) { return CefValueImpl::GetOrCreateRefOrCopy( const_cast(out_value), - const_cast(&const_value()), - read_only(), + const_cast(&const_value()), read_only(), controller()); } @@ -828,8 +827,9 @@ CefRefPtr CefDictionaryValueImpl::GetBinary( &out_value) && out_value->IsType(base::Value::Type::BINARY)) { base::Value* binary_value = const_cast(out_value); - return CefBinaryValueImpl::GetOrCreateRef(binary_value, - const_cast(&const_value()), controller()); + return CefBinaryValueImpl::GetOrCreateRef( + binary_value, const_cast(&const_value()), + controller()); } return NULL; @@ -844,14 +844,11 @@ CefRefPtr CefDictionaryValueImpl::GetDictionary( if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value) && out_value->IsType(base::Value::Type::DICTIONARY)) { - base::DictionaryValue* dict_value = - static_cast( - const_cast(out_value)); + base::DictionaryValue* dict_value = static_cast( + const_cast(out_value)); return CefDictionaryValueImpl::GetOrCreateRef( - dict_value, - const_cast(&const_value()), - read_only(), - controller()); + dict_value, const_cast(&const_value()), + read_only(), controller()); } return NULL; @@ -868,10 +865,8 @@ CefRefPtr CefDictionaryValueImpl::GetList(const CefString& key) { base::ListValue* list_value = static_cast(const_cast(out_value)); return CefListValueImpl::GetOrCreateRef( - list_value, - const_cast(&const_value()), - read_only(), - controller()); + list_value, const_cast(&const_value()), + read_only(), controller()); } return NULL; @@ -910,7 +905,7 @@ bool CefDictionaryValueImpl::SetInt(const CefString& key, int value) { bool CefDictionaryValueImpl::SetDouble(const CefString& key, double value) { CEF_VALUE_VERIFY_RETURN(true, false); - SetInternal(key, new base::Value(value)); + SetInternal(key, new base::Value(value)); return true; } @@ -933,7 +928,8 @@ bool CefDictionaryValueImpl::SetBinary(const CefString& key, } bool CefDictionaryValueImpl::SetDictionary( - const CefString& key, CefRefPtr value) { + const CefString& key, + CefRefPtr value) { CEF_VALUE_VERIFY_RETURN(true, false); CefDictionaryValueImpl* impl = @@ -982,16 +978,16 @@ base::Value* CefDictionaryValueImpl::SetInternal(const CefString& key, return value; } -CefDictionaryValueImpl::CefDictionaryValueImpl( - base::DictionaryValue* value, - void* parent_value, - ValueMode value_mode, - bool read_only, - CefValueController* controller) - : CefValueBase( - value, parent_value, value_mode, read_only, controller) { -} - +CefDictionaryValueImpl::CefDictionaryValueImpl(base::DictionaryValue* value, + void* parent_value, + ValueMode value_mode, + bool read_only, + CefValueController* controller) + : CefValueBase(value, + parent_value, + value_mode, + read_only, + controller) {} // CefListValueImpl implementation. @@ -1010,17 +1006,19 @@ CefRefPtr CefListValueImpl::GetOrCreateRef( if (object) return static_cast(object); - return new CefListValueImpl(value, parent_value, - CefListValueImpl::kReference, read_only, controller); + return new CefListValueImpl(value, parent_value, CefListValueImpl::kReference, + read_only, controller); } CefListValueImpl::CefListValueImpl(base::ListValue* value, bool will_delete, bool read_only) - : CefValueBase( - value, NULL, will_delete ? kOwnerWillDelete : kOwnerNoDelete, - read_only, NULL) { -} + : CefValueBase( + value, + NULL, + will_delete ? kOwnerWillDelete : kOwnerNoDelete, + read_only, + NULL) {} base::ListValue* CefListValueImpl::CopyValue() { CEF_VALUE_VERIFY_RETURN(false, NULL); @@ -1079,8 +1077,8 @@ bool CefListValueImpl::IsSame(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsSameValue(&const_value()); + return static_cast(that.get()) + ->IsSameValue(&const_value()); } bool CefListValueImpl::IsEqual(CefRefPtr that) { @@ -1090,15 +1088,15 @@ bool CefListValueImpl::IsEqual(CefRefPtr that) { return true; CEF_VALUE_VERIFY_RETURN(false, false); - return static_cast(that.get())-> - IsEqualValue(&const_value()); + return static_cast(that.get()) + ->IsEqualValue(&const_value()); } CefRefPtr CefListValueImpl::Copy() { CEF_VALUE_VERIFY_RETURN(false, NULL); return new CefListValueImpl(const_value().DeepCopy(), NULL, - CefListValueImpl::kOwnerWillDelete, false, NULL); + CefListValueImpl::kOwnerWillDelete, false, NULL); } bool CefListValueImpl::SetSize(size_t size) { @@ -1107,11 +1105,11 @@ bool CefListValueImpl::SetSize(size_t size) { size_t current_size = const_value().GetSize(); if (size < current_size) { // Clean up any values above the requested size. - for (size_t i = current_size-1; i >= size; --i) - RemoveInternal(i); + for (size_t i = current_size - 1; i >= size; --i) + RemoveInternal(i); } else if (size > 0) { // Expand the list size. - mutable_value()->Set(size-1, base::MakeUnique()); + mutable_value()->Set(size - 1, base::MakeUnique()); } return true; } @@ -1171,8 +1169,7 @@ CefRefPtr CefListValueImpl::GetValue(size_t index) { if (const_value().Get(index, &out_value)) { return CefValueImpl::GetOrCreateRefOrCopy( const_cast(out_value), - const_cast(&const_value()), - read_only(), + const_cast(&const_value()), read_only(), controller()); } @@ -1235,8 +1232,9 @@ CefRefPtr CefListValueImpl::GetBinary(size_t index) { if (const_value().Get(index, &out_value) && out_value->IsType(base::Value::Type::BINARY)) { base::Value* binary_value = const_cast(out_value); - return CefBinaryValueImpl::GetOrCreateRef(binary_value, - const_cast(&const_value()), controller()); + return CefBinaryValueImpl::GetOrCreateRef( + binary_value, const_cast(&const_value()), + controller()); } return NULL; @@ -1249,13 +1247,10 @@ CefRefPtr CefListValueImpl::GetDictionary(size_t index) { if (const_value().Get(index, &out_value) && out_value->IsType(base::Value::Type::DICTIONARY)) { - base::DictionaryValue* dict_value = - static_cast( - const_cast(out_value)); + base::DictionaryValue* dict_value = static_cast( + const_cast(out_value)); return CefDictionaryValueImpl::GetOrCreateRef( - dict_value, - const_cast(&const_value()), - read_only(), + dict_value, const_cast(&const_value()), read_only(), controller()); } @@ -1272,9 +1267,7 @@ CefRefPtr CefListValueImpl::GetList(size_t index) { base::ListValue* list_value = static_cast(const_cast(out_value)); return CefListValueImpl::GetOrCreateRef( - list_value, - const_cast(&const_value()), - read_only(), + list_value, const_cast(&const_value()), read_only(), controller()); } @@ -1323,7 +1316,8 @@ bool CefListValueImpl::SetString(size_t index, const CefString& value) { return true; } -bool CefListValueImpl::SetBinary(size_t index, CefRefPtr value) { +bool CefListValueImpl::SetBinary(size_t index, + CefRefPtr value) { CEF_VALUE_VERIFY_RETURN(true, false); CefBinaryValueImpl* impl = static_cast(value.get()); @@ -1404,12 +1398,13 @@ base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) { return const_cast(actual_value); } -CefListValueImpl::CefListValueImpl( - base::ListValue* value, - void* parent_value, - ValueMode value_mode, - bool read_only, - CefValueController* controller) - : CefValueBase( - value, parent_value, value_mode, read_only, controller) { -} +CefListValueImpl::CefListValueImpl(base::ListValue* value, + void* parent_value, + ValueMode value_mode, + bool read_only, + CefValueController* controller) + : CefValueBase(value, + parent_value, + value_mode, + read_only, + controller) {} diff --git a/libcef/common/values_impl.h b/libcef/common/values_impl.h index 6de24a715..42cacd34f 100644 --- a/libcef/common/values_impl.h +++ b/libcef/common/values_impl.h @@ -11,14 +11,13 @@ #include "include/cef_values.h" #include "libcef/common/value_base.h" -#include "base/values.h" #include "base/threading/platform_thread.h" - +#include "base/values.h" // CefValue implementation class CefValueImpl : public CefValue { public: - // Get or create a reference to a complex value or copy a simple value. + // Get or create a reference to a complex value or copy a simple value. static CefRefPtr GetOrCreateRefOrCopy( base::Value* value, void* parent_value, @@ -83,17 +82,12 @@ class CefValueImpl : public CefValue { // object. class ScopedLockedValue { public: - explicit ScopedLockedValue(CefRefPtr impl) - : impl_(impl) { + explicit ScopedLockedValue(CefRefPtr impl) : impl_(impl) { impl_->AcquireLock(); } - ~ScopedLockedValue() { - impl_->ReleaseLock(); - } + ~ScopedLockedValue() { impl_->ReleaseLock(); } - base::Value* value() const { - return impl_->GetValueUnsafe(); - } + base::Value* value() const { return impl_->GetValueUnsafe(); } private: CefRefPtr impl_; @@ -125,10 +119,8 @@ class CefValueImpl : public CefValue { DISALLOW_COPY_AND_ASSIGN(CefValueImpl); }; - // CefBinaryValue implementation -class CefBinaryValueImpl - : public CefValueBase { +class CefBinaryValueImpl : public CefValueBase { public: // Get or create a reference value. static CefRefPtr GetOrCreateRef( @@ -142,12 +134,10 @@ class CefBinaryValueImpl // longer valid. Use GetOrCreateRef instead of this constructor if |value| is // owned by some other object and you do not plan to explicitly call // Detach(NULL). - CefBinaryValueImpl(base::Value* value, - bool will_delete); + CefBinaryValueImpl(base::Value* value, bool will_delete); // The data will always be copied. - CefBinaryValueImpl(char* data, - size_t data_size); + CefBinaryValueImpl(char* data, size_t data_size); // Return a copy of the value. base::Value* CopyValue(); @@ -170,9 +160,7 @@ class CefBinaryValueImpl bool IsEqual(CefRefPtr that) override; CefRefPtr Copy() override; size_t GetSize() override; - size_t GetData(void* buffer, - size_t buffer_size, - size_t data_offset) override; + size_t GetData(void* buffer, size_t buffer_size, size_t data_offset) override; private: // See the CefValueBase constructor for usage. Binary values are always @@ -185,7 +173,6 @@ class CefBinaryValueImpl DISALLOW_COPY_AND_ASSIGN(CefBinaryValueImpl); }; - // CefDictionaryValue implementation class CefDictionaryValueImpl : public CefValueBase { @@ -227,8 +214,7 @@ class CefDictionaryValueImpl bool IsReadOnly() override; bool IsSame(CefRefPtr that) override; bool IsEqual(CefRefPtr that) override; - CefRefPtr Copy( - bool exclude_empty_children) override; + CefRefPtr Copy(bool exclude_empty_children) override; size_t GetSize() override; bool Clear() override; bool HasKey(const CefString& key) override; @@ -241,22 +227,19 @@ class CefDictionaryValueImpl double GetDouble(const CefString& key) override; CefString GetString(const CefString& key) override; CefRefPtr GetBinary(const CefString& key) override; - CefRefPtr GetDictionary( - const CefString& key) override; + CefRefPtr GetDictionary(const CefString& key) override; CefRefPtr GetList(const CefString& key) override; bool SetValue(const CefString& key, CefRefPtr value) override; bool SetNull(const CefString& key) override; bool SetBool(const CefString& key, bool value) override; bool SetInt(const CefString& key, int value) override; bool SetDouble(const CefString& key, double value) override; - bool SetString(const CefString& key, - const CefString& value) override; + bool SetString(const CefString& key, const CefString& value) override; bool SetBinary(const CefString& key, - CefRefPtr value) override; + CefRefPtr value) override; bool SetDictionary(const CefString& key, CefRefPtr value) override; - bool SetList(const CefString& key, - CefRefPtr value) override; + bool SetList(const CefString& key, CefRefPtr value) override; private: // See the CefValueBase constructor for usage. @@ -272,17 +255,14 @@ class CefDictionaryValueImpl DISALLOW_COPY_AND_ASSIGN(CefDictionaryValueImpl); }; - // CefListValue implementation -class CefListValueImpl - : public CefValueBase { +class CefListValueImpl : public CefValueBase { public: // Get or create a reference value. - static CefRefPtr GetOrCreateRef( - base::ListValue* value, - void* parent_value, - bool read_only, - CefValueController* controller); + static CefRefPtr GetOrCreateRef(base::ListValue* value, + void* parent_value, + bool read_only, + CefValueController* controller); // Reference an existing value (set |will_delete| to false) or take ownership // of an existing value (set |will_delete| to true). When referencing an @@ -290,9 +270,7 @@ class CefListValueImpl // longer valid. Use GetOrCreateRef instead of this constructor if |value| is // owned by some other object and you do not plan to explicitly call // Detach(NULL). - CefListValueImpl(base::ListValue* value, - bool will_delete, - bool read_only); + CefListValueImpl(base::ListValue* value, bool will_delete, bool read_only); // Return a copy of the value. base::ListValue* CopyValue(); @@ -353,5 +331,4 @@ class CefListValueImpl DISALLOW_COPY_AND_ASSIGN(CefListValueImpl); }; - #endif // CEF_LIBCEF_COMMON_VALUES_IMPL_H_ diff --git a/libcef/common/waitable_event_impl.cc b/libcef/common/waitable_event_impl.cc index b332a07c9..81217bb0a 100644 --- a/libcef/common/waitable_event_impl.cc +++ b/libcef/common/waitable_event_impl.cc @@ -29,11 +29,11 @@ CefRefPtr CefWaitableEvent::CreateWaitableEvent( CefWaitableEventImpl::CefWaitableEventImpl(bool automatic_reset, bool initially_signaled) - : event_(automatic_reset ? base::WaitableEvent::ResetPolicy::AUTOMATIC : - base::WaitableEvent::ResetPolicy::MANUAL, - initially_signaled ? base::WaitableEvent::InitialState::SIGNALED : - base::WaitableEvent::InitialState::NOT_SIGNALED) { -} + : event_(automatic_reset ? base::WaitableEvent::ResetPolicy::AUTOMATIC + : base::WaitableEvent::ResetPolicy::MANUAL, + initially_signaled + ? base::WaitableEvent::InitialState::SIGNALED + : base::WaitableEvent::InitialState::NOT_SIGNALED) {} void CefWaitableEventImpl::Reset() { event_.Reset(); diff --git a/libcef/common/waitable_event_impl.h b/libcef/common/waitable_event_impl.h index c88e9c48f..96908c151 100644 --- a/libcef/common/waitable_event_impl.h +++ b/libcef/common/waitable_event_impl.h @@ -2,17 +2,17 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef CEF_LIBCEF_COMMON_WAITABLE_EVENT_IMPL_H_ -#define CEF_LIBCEF_COMMON_WAITABLE_EVENT_IMPL_H_ +#ifndef CEF_LIBCEF_COMMON_WAITABLE_EVENT_IMPL_H_ +#define CEF_LIBCEF_COMMON_WAITABLE_EVENT_IMPL_H_ #pragma once #include "include/cef_waitable_event.h" + #include "base/synchronization/waitable_event.h" class CefWaitableEventImpl : public CefWaitableEvent { public: - CefWaitableEventImpl(bool automatic_reset, - bool initially_signaled); + CefWaitableEventImpl(bool automatic_reset, bool initially_signaled); // CefWaitableEvent methods: void Reset() override; diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index b4aa83d78..93ccd51e5 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -30,7 +30,6 @@ namespace { base::LazyInstance::Leaky g_widevine_loader = LAZY_INSTANCE_INITIALIZER; - // Based on chrome/browser/component_updater/widevine_cdm_component_installer.cc // Name of the Widevine CDM OS in the component manifest. @@ -140,8 +139,8 @@ bool CheckForCompatibleVersion(const base::DictionaryValue& manifest, } std::stringstream ss; - ss << "Manifest has no supported " << version_name << " in '" << - versions_string << "'"; + ss << "Manifest has no supported " << version_name << " in '" + << versions_string << "'"; *error_message = ss.str(); return false; } @@ -154,16 +153,13 @@ bool IsCompatibleWithChrome(const base::DictionaryValue& manifest, kWidevineCdmOs && GetManifestValue(manifest, kCdmArchName, error_message) == kWidevineCdmArch && - CheckForCompatibleVersion(manifest, - kCdmModuleVersionsName, + CheckForCompatibleVersion(manifest, kCdmModuleVersionsName, media::IsSupportedCdmModuleVersion, error_message) && - CheckForCompatibleVersion(manifest, - kCdmInterfaceVersionsName, + CheckForCompatibleVersion(manifest, kCdmInterfaceVersionsName, media::IsSupportedCdmInterfaceVersion, error_message) && - CheckForCompatibleVersion(manifest, - kCdmHostVersionsName, + CheckForCompatibleVersion(manifest, kCdmHostVersionsName, media::IsSupportedCdmHostVersion, error_message); } @@ -177,13 +173,11 @@ void GetPluginInfo(const base::FilePath& cdm_adapter_path, widevine_cdm->is_out_of_process = true; widevine_cdm->path = cdm_adapter_path; widevine_cdm->name = kWidevineCdmDisplayName; - widevine_cdm->description = kWidevineCdmDescription + - std::string(" (version: ") + - cdm_version + ")"; + widevine_cdm->description = + kWidevineCdmDescription + std::string(" (version: ") + cdm_version + ")"; widevine_cdm->version = cdm_version; content::WebPluginMimeType widevine_cdm_mime_type( - kWidevineCdmPluginMimeType, - kWidevineCdmPluginExtension, + kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension, kWidevineCdmPluginMimeTypeDescription); widevine_cdm_mime_type.additional_param_names.push_back( @@ -261,12 +255,11 @@ void DeliverWidevineCdmCallback(cef_cdm_registration_error_t result, callback->OnCdmRegistrationComplete(result, error_message); } -void RegisterWidevineCdmOnUIThread( - const base::FilePath& cdm_adapter_path, - const base::FilePath& cdm_path, - const std::string& cdm_version, - const std::string& cdm_codecs, - CefRefPtr callback) { +void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path, + const base::FilePath& cdm_path, + const std::string& cdm_version, + const std::string& cdm_codecs, + CefRefPtr callback) { CEF_REQUIRE_UIT(); content::PepperPluginInfo widevine_cdm; @@ -313,8 +306,8 @@ void LoadWidevineCdmInfoOnFileThread( // Continue execution on the UI thread. CEF_POST_TASK(CEF_UIT, - base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path, cdm_path, - cdm_version, cdm_codecs, callback)); + base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path, + cdm_path, cdm_version, cdm_codecs, callback)); } } // namespace @@ -337,7 +330,7 @@ void CefWidevineLoader::LoadWidevineCdm( // Continue execution on the FILE thread. CEF_POST_TASK(CEF_FILET, - base::Bind(LoadWidevineCdmInfoOnFileThread, path, callback)); + base::Bind(LoadWidevineCdmInfoOnFileThread, path, callback)); } void CefWidevineLoader::OnContextInitialized() { @@ -369,8 +362,8 @@ void CefWidevineLoader::AddPepperPlugins( // The Widevine CDM path is passed to the zygote process via // CefContentBrowserClient::AppendExtraCommandLineSwitches. - const base::FilePath& base_path = command_line.GetSwitchValuePath( - switches::kWidevineCdmPath); + const base::FilePath& base_path = + command_line.GetSwitchValuePath(switches::kWidevineCdmPath); if (base_path.empty()) return; @@ -397,10 +390,8 @@ void CefWidevineLoader::AddPepperPlugins( #endif // defined(OS_LINUX) -CefWidevineLoader::CefWidevineLoader() { -} +CefWidevineLoader::CefWidevineLoader() {} -CefWidevineLoader::~CefWidevineLoader() { -} +CefWidevineLoader::~CefWidevineLoader() {} #endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index ecc8fe088..7ff4204a1 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -61,7 +61,6 @@ CefRefPtr CefBrowserImpl::GetBrowserForMainFrame( return CefContentRendererClient::Get()->GetBrowserForMainFrame(frame); } - // CefBrowser methods. // ----------------------------------------------------------------------------- @@ -188,8 +187,8 @@ CefRefPtr CefBrowserImpl::GetFrame(const CefString& name) { if (web_view) { const blink::WebString& frame_name = blink::WebString::FromUTF16(name); // Search by assigned frame name (Frame::name). - WebFrame* frame = web_view->FindFrameByName(frame_name, - web_view->MainFrame()); + WebFrame* frame = + web_view->FindFrameByName(frame_name, web_view->MainFrame()); if (!frame) { // Search by unique frame name (Frame::uniqueName). const std::string& searchname = name; @@ -264,7 +263,6 @@ bool CefBrowserImpl::SendProcessMessage(CefProcessId target_process, return false; } - // CefBrowserImpl public methods. // ----------------------------------------------------------------------------- @@ -279,8 +277,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view, response_manager_.reset(new CefResponseManager); } -CefBrowserImpl::~CefBrowserImpl() { -} +CefBrowserImpl::~CefBrowserImpl() {} void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) { CefRefPtr framePtr = GetWebFrameImpl(params.frame_id); @@ -327,9 +324,9 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( CefRefPtr framePtr(new CefFrameImpl(this, frame)); frames_.insert(std::make_pair(frame_id, framePtr)); - const int64_t parent_id = frame->Parent() == NULL ? - webkit_glue::kInvalidFrameId : - webkit_glue::GetIdentifier(frame->Parent()); + const int64_t parent_id = frame->Parent() == NULL + ? webkit_glue::kInvalidFrameId + : webkit_glue::GetIdentifier(frame->Parent()); const base::string16& name = base::UTF8ToUTF16(webkit_glue::GetUniqueName(frame)); @@ -387,7 +384,6 @@ bool CefBrowserImpl::is_swapped_out() const { return (!render_view_impl || render_view_impl->is_swapped_out()); } - // RenderViewObserver methods. // ----------------------------------------------------------------------------- @@ -395,8 +391,7 @@ void CefBrowserImpl::OnDestruct() { // Notify that the browser window has been destroyed. CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) handler->OnBrowserDestroyed(this); } @@ -414,20 +409,17 @@ void CefBrowserImpl::DidStopLoading() { OnLoadingStateChange(false); } -void CefBrowserImpl::DidFailLoad( - blink::WebLocalFrame* frame, - const blink::WebURLError& error) { +void CefBrowserImpl::DidFailLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error) { OnLoadError(frame, error); OnLoadEnd(frame); } void CefBrowserImpl::DidFinishLoad(blink::WebLocalFrame* frame) { blink::WebDataSource* ds = frame->DataSource(); - Send(new CefHostMsg_DidFinishLoad(routing_id(), - webkit_glue::GetIdentifier(frame), - ds->GetRequest().Url(), - !frame->Parent(), - ds->GetResponse().HttpStatusCode())); + Send(new CefHostMsg_DidFinishLoad( + routing_id(), webkit_glue::GetIdentifier(frame), ds->GetRequest().Url(), + !frame->Parent(), ds->GetResponse().HttpStatusCode())); OnLoadEnd(frame); } @@ -436,9 +428,8 @@ void CefBrowserImpl::DidStartProvisionalLoad(blink::WebLocalFrame* frame) { GetWebFrameImpl(frame); } -void CefBrowserImpl::DidFailProvisionalLoad( - blink::WebLocalFrame* frame, - const blink::WebURLError& error) { +void CefBrowserImpl::DidFailProvisionalLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error) { OnLoadError(frame, error); } @@ -471,8 +462,7 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) { // Notify the handler. CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { if (node.IsNull()) { handler->OnFocusedNodeChanged(this, GetFocusedFrame(), NULL); @@ -482,9 +472,8 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) { blink::WebFrame* frame = document.GetFrame(); CefRefPtr documentImpl = new CefDOMDocumentImpl(this, frame); - handler->OnFocusedNodeChanged(this, - GetWebFrameImpl(frame).get(), - documentImpl->GetOrCreateNode(node)); + handler->OnFocusedNodeChanged(this, GetWebFrameImpl(frame).get(), + documentImpl->GetOrCreateNode(node)); documentImpl->Detach(); } } @@ -519,7 +508,6 @@ bool CefBrowserImpl::OnMessageReceived(const IPC::Message& message) { return handled; } - // RenderViewObserver::OnMessageReceived message handlers. // ----------------------------------------------------------------------------- @@ -528,9 +516,9 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { std::string response; bool expect_response_ack = false; - TRACE_EVENT2("libcef", "CefBrowserImpl::OnRequest", - "request_id", params.request_id, - "expect_response", params.expect_response ? 1 : 0); + TRACE_EVENT2("libcef", "CefBrowserImpl::OnRequest", "request_id", + params.request_id, "expect_response", + params.expect_response ? 1 : 0); if (params.user_initiated) { // Give the user a chance to handle the request. @@ -539,11 +527,10 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { - CefRefPtr message( - new CefProcessMessageImpl(const_cast(¶ms), - false, true)); - success = handler->OnProcessMessageReceived(this, PID_BROWSER, - message.get()); + CefRefPtr message(new CefProcessMessageImpl( + const_cast(¶ms), false, true)); + success = + handler->OnProcessMessageReceived(this, PID_BROWSER, message.get()); message->Detach(nullptr); } } @@ -569,8 +556,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { if (is_javascript) { web_frame->ExecuteScript( WebScriptSource(blink::WebString::FromUTF8(code), - GURL(script_url), - script_start_line)); + GURL(script_url), script_start_line)); success = true; } else { // TODO(cef): implement support for CSS code. @@ -594,7 +580,8 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { if (base::LowerCaseEqualsASCII(command, "getsource")) { if (web_frame->IsWebLocalFrame()) { response = blink::WebFrameContentDumper::DumpAsMarkup( - web_frame->ToWebLocalFrame()).Utf8(); + web_frame->ToWebLocalFrame()) + .Utf8(); success = true; } } else if (base::LowerCaseEqualsASCII(command, "gettext")) { @@ -602,7 +589,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { success = true; } else if (web_frame->IsWebLocalFrame() && web_frame->ToWebLocalFrame()->ExecuteCommand( - blink::WebString::FromUTF8(command))) { + blink::WebString::FromUTF8(command))) { success = true; } } @@ -657,8 +644,7 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) { CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { @@ -679,8 +665,7 @@ void CefBrowserImpl::OnLoadStart(blink::WebLocalFrame* frame) { CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { @@ -697,8 +682,7 @@ void CefBrowserImpl::OnLoadEnd(blink::WebLocalFrame* frame) { CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { @@ -718,8 +702,7 @@ void CefBrowserImpl::OnLoadError(blink::WebLocalFrame* frame, CefRefPtr app = CefContentClient::Get()->application(); if (app.get()) { - CefRefPtr handler = - app->GetRenderProcessHandler(); + CefRefPtr handler = app->GetRenderProcessHandler(); if (handler.get()) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { diff --git a/libcef/renderer/browser_impl.h b/libcef/renderer/browser_impl.h index d1addba6f..134d609cc 100644 --- a/libcef/renderer/browser_impl.h +++ b/libcef/renderer/browser_impl.h @@ -40,8 +40,7 @@ class ListValue; // RenderViewObserver implementation. IPC messages sent using // RenderViewObserver::Send() will be forwarded to the RenderView. Use // RenderViewObserver::routing_id() when sending IPC messages. -class CefBrowserImpl : public CefBrowser, - public content::RenderViewObserver { +class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver { public: // Returns the browser associated with the specified RenderView. static CefRefPtr GetBrowserForView(content::RenderView* view); @@ -70,9 +69,8 @@ class CefBrowserImpl : public CefBrowser, size_t GetFrameCount() override; void GetFrameIdentifiers(std::vector& identifiers) override; void GetFrameNames(std::vector& names) override; - bool SendProcessMessage( - CefProcessId target_process, - CefRefPtr message) override; + bool SendProcessMessage(CefProcessId target_process, + CefRefPtr message) override; CefBrowserImpl(content::RenderView* render_view, int browser_id, @@ -113,9 +111,8 @@ class CefBrowserImpl : public CefBrowser, const blink::WebURLError& error) override; void DidFinishLoad(blink::WebLocalFrame* frame) override; void DidStartProvisionalLoad(blink::WebLocalFrame* frame) override; - void DidFailProvisionalLoad( - blink::WebLocalFrame* frame, - const blink::WebURLError& error) override; + void DidFailProvisionalLoad(blink::WebLocalFrame* frame, + const blink::WebURLError& error) override; void DidCommitProvisionalLoad(blink::WebLocalFrame* frame, bool is_new_navigation) override; void FrameDetached(blink::WebFrame* frame) override; @@ -142,12 +139,12 @@ class CefBrowserImpl : public CefBrowser, bool is_windowless_; // Map of unique frame ids to CefFrameImpl references. - typedef std::map > FrameMap; + typedef std::map> FrameMap; FrameMap frames_; // Map of unique frame ids to CefTrackManager objects that need to be cleaned // up when the frame is deleted. - typedef std::map > FrameObjectMap; + typedef std::map> FrameObjectMap; FrameObjectMap frame_objects_; // Manages response registrations. diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index aa5b4e482..a444e9858 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -12,7 +12,7 @@ // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(push) -#pragma warning(default:4996) +#pragma warning(default : 4996) #endif #include "libcef/browser/context.h" @@ -123,9 +123,7 @@ class CefPrerendererClient : public content::RenderViewObserver, ~CefPrerendererClient() override {} // RenderViewObserver methods: - void OnDestruct() override { - delete this; - } + void OnDestruct() override { delete this; } // WebPrerendererClient methods: void WillAddPrerender(blink::WebPrerender* prerender) override {} @@ -166,8 +164,7 @@ void AppendParams(const std::vector& additional_names, class CefGuestView : public content::RenderViewObserver { public: explicit CefGuestView(content::RenderView* render_view) - : content::RenderViewObserver(render_view) { - } + : content::RenderViewObserver(render_view) {} private: // RenderViewObserver methods. @@ -192,8 +189,7 @@ CefContentRendererClient::CefContentRendererClient() printing::SetAgent(CefContentClient::Get()->GetUserAgent()); } -CefContentRendererClient::~CefContentRendererClient() { -} +CefContentRendererClient::~CefContentRendererClient() {} // static CefContentRendererClient* CefContentRendererClient::Get() { @@ -240,8 +236,7 @@ void CefContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) { NOTREACHED(); } -bool CefContentRendererClient::HasGuestViewForView( - content::RenderView* view) { +bool CefContentRendererClient::HasGuestViewForView(content::RenderView* view) { CEF_REQUIRE_RT_RETURN(false); GuestViewMap::const_iterator it = guest_views_.find(view); @@ -299,8 +294,7 @@ void CefContentRendererClient::WebKitInitialized() { cross_origin_whitelist_entries_[i]; GURL gurl = GURL(entry.source_origin); blink::WebSecurityPolicy::AddOriginAccessWhitelistEntry( - gurl, - blink::WebString::FromUTF8(entry.target_protocol), + gurl, blink::WebString::FromUTF8(entry.target_protocol), blink::WebString::FromUTF8(entry.target_domain), entry.allow_target_subdomains); } @@ -310,10 +304,9 @@ void CefContentRendererClient::WebKitInitialized() { // The number of stack trace frames to capture for uncaught exceptions. if (command_line->HasSwitch(switches::kUncaughtExceptionStackSize)) { int uncaught_exception_stack_size = 0; - base::StringToInt( - command_line->GetSwitchValueASCII( - switches::kUncaughtExceptionStackSize), - &uncaught_exception_stack_size); + base::StringToInt(command_line->GetSwitchValueASCII( + switches::kUncaughtExceptionStackSize), + &uncaught_exception_stack_size); if (uncaught_exception_stack_size > 0) { uncaught_exception_stack_size_ = uncaught_exception_stack_size; @@ -352,7 +345,7 @@ void CefContentRendererClient::DevToolsAgentDetached() { } scoped_refptr - CefContentRendererClient::GetCurrentTaskRunner() { +CefContentRendererClient::GetCurrentTaskRunner() { // Check if currently on the render thread. if (CEF_CURRENTLY_ON_RT()) return render_task_runner_; @@ -369,7 +362,8 @@ void CefContentRendererClient::RunSingleProcessCleanup() { if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { RunSingleProcessCleanupOnUIThread(); } else { - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, base::Bind(&CefContentRendererClient::RunSingleProcessCleanupOnUIThread, base::Unretained(this))); } @@ -452,7 +446,7 @@ void CefContentRendererClient::RenderThreadStarted() { application->GetRenderProcessHandler(); if (handler.get()) { CefRefPtr listValuePtr( - new CefListValueImpl(¶ms.extra_info, false, true)); + new CefListValueImpl(¶ms.extra_info, false, true)); handler->OnRenderThreadCreated(listValuePtr.get()); listValuePtr->Detach(NULL); } @@ -623,7 +617,8 @@ bool CefContentRendererClient::WillSendRequest( } unsigned long long CefContentRendererClient::VisitedLinkHash( - const char* canonical_url, size_t length) { + const char* canonical_url, + size_t length) { return observer_->visited_link_slave()->ComputeURLFingerprint(canonical_url, length); } @@ -639,7 +634,7 @@ CefContentRendererClient::CreateBrowserPluginDelegate( const GURL& original_url) { DCHECK(extensions::ExtensionsEnabled()); return extensions::CefExtensionsRendererClient::CreateBrowserPluginDelegate( - render_frame, mime_type, original_url); + render_frame, mime_type, original_url); } void CefContentRendererClient::AddSupportedKeySystems( @@ -711,13 +706,13 @@ blink::WebPlugin* CefContentRendererClient::CreatePlugin( params.mime_type = blink::WebString::FromUTF8(actual_mime_type); } - auto create_blocked_plugin = [&render_frame, &frame, ¶ms, &info, - &identifier, &group_name]( - int template_id, const base::string16& message) { - return CefPluginPlaceholder::CreateBlockedPlugin( - render_frame, frame, params, info, identifier, group_name, - template_id, message, PowerSaverInfo()); - }; + auto create_blocked_plugin = + [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( + int template_id, const base::string16& message) { + return CefPluginPlaceholder::CreateBlockedPlugin( + render_frame, frame, params, info, identifier, group_name, + template_id, message, PowerSaverInfo()); + }; switch (status) { case CefViewHostMsg_GetPluginInfo_Status::kNotFound: { NOTREACHED(); @@ -843,11 +838,8 @@ void CefContentRendererClient::BrowserCreated( // Retrieve the browser information synchronously. This will also register // the routing ids with the browser info object in the browser process. CefProcessHostMsg_GetNewBrowserInfo_Params params; - content::RenderThread::Get()->Send( - new CefProcessHostMsg_GetNewBrowserInfo( - render_view_routing_id, - render_frame_routing_id, - ¶ms)); + content::RenderThread::Get()->Send(new CefProcessHostMsg_GetNewBrowserInfo( + render_view_routing_id, render_frame_routing_id, ¶ms)); if (params.browser_id == 0) { // The popup may have been canceled during creation. return; @@ -855,9 +847,8 @@ void CefContentRendererClient::BrowserCreated( if (params.is_guest_view) { // Don't create a CefBrowser for guest views. - guest_views_.insert( - std::make_pair(render_view, - base::MakeUnique(render_view))); + guest_views_.insert(std::make_pair( + render_view, base::MakeUnique(render_view))); return; } @@ -870,9 +861,8 @@ void CefContentRendererClient::BrowserCreated( !params.is_windowless); #endif - CefRefPtr browser = - new CefBrowserImpl(render_view, params.browser_id, params.is_popup, - params.is_windowless); + CefRefPtr browser = new CefBrowserImpl( + render_view, params.browser_id, params.is_popup, params.is_windowless); browsers_.insert(std::make_pair(render_view, browser)); // Notify the render process handler. @@ -914,7 +904,6 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() { delete host; } - // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(pop) diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index 6ccf5865d..2b56e77a4 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -92,11 +92,10 @@ class CefContentRendererClient : public content::ContentRendererClient, void RenderThreadStarted() override; void RenderFrameCreated(content::RenderFrame* render_frame) override; void RenderViewCreated(content::RenderView* render_view) override; - bool OverrideCreatePlugin( - content::RenderFrame* render_frame, - blink::WebLocalFrame* frame, - const blink::WebPluginParams& params, - blink::WebPlugin** plugin) override; + bool OverrideCreatePlugin(content::RenderFrame* render_frame, + blink::WebLocalFrame* frame, + const blink::WebPluginParams& params, + blink::WebPlugin** plugin) override; bool HandleNavigation(content::RenderFrame* render_frame, bool is_content_initiated, bool render_view_was_created_by_renderer, @@ -151,11 +150,11 @@ class CefContentRendererClient : public content::ContentRendererClient, std::unique_ptr spellcheck_; // Map of RenderView pointers to CefBrowserImpl references. - typedef std::map > BrowserMap; + typedef std::map> BrowserMap; BrowserMap browsers_; // Map of RenderView poiners to CefGuestView implementations. - typedef std::map > + typedef std::map> GuestViewMap; GuestViewMap guest_views_; diff --git a/libcef/renderer/dom_document_impl.cc b/libcef/renderer/dom_document_impl.cc index f22557aff..95f9d21cd 100644 --- a/libcef/renderer/dom_document_impl.cc +++ b/libcef/renderer/dom_document_impl.cc @@ -24,11 +24,8 @@ using blink::WebRange; using blink::WebString; using blink::WebURL; - -CefDOMDocumentImpl::CefDOMDocumentImpl(CefBrowserImpl* browser, - WebFrame* frame) - : browser_(browser), - frame_(frame) { +CefDOMDocumentImpl::CefDOMDocumentImpl(CefBrowserImpl* browser, WebFrame* frame) + : browser_(browser), frame_(frame) { const WebDocument& document = frame_->GetDocument(); DCHECK(!document.IsNull()); } diff --git a/libcef/renderer/dom_document_impl.h b/libcef/renderer/dom_document_impl.h index b38b2ab86..9a6fc61d4 100644 --- a/libcef/renderer/dom_document_impl.h +++ b/libcef/renderer/dom_document_impl.h @@ -18,8 +18,7 @@ class CefBrowserImpl; class CefDOMDocumentImpl : public CefDOMDocument { public: - CefDOMDocumentImpl(CefBrowserImpl* browser, - blink::WebFrame* frame); + CefDOMDocumentImpl(CefBrowserImpl* browser, blink::WebFrame* frame); ~CefDOMDocumentImpl() override; // CefDOMDocument methods. diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index 1376dfd1b..9d09aa1bf 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -3,6 +3,7 @@ // can be found in the LICENSE file. #include "libcef/renderer/dom_node_impl.h" + #include "libcef/common/tracker.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/dom_document_impl.h" @@ -13,11 +14,11 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDOMEvent.h" +#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebFormControlElement.h" +#include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebInputElement.h" #include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebSelectElement.h" @@ -34,9 +35,7 @@ using blink::WebString; CefDOMNodeImpl::CefDOMNodeImpl(CefRefPtr document, const blink::WebNode& node) - : document_(document), - node_(node) { -} + : document_(document), node_(node) {} CefDOMNodeImpl::~CefDOMNodeImpl() { CEF_REQUIRE_RT(); diff --git a/libcef/renderer/extensions/extensions_dispatcher_delegate.cc b/libcef/renderer/extensions/extensions_dispatcher_delegate.cc index 5712332b5..71c425011 100644 --- a/libcef/renderer/extensions/extensions_dispatcher_delegate.cc +++ b/libcef/renderer/extensions/extensions_dispatcher_delegate.cc @@ -6,10 +6,8 @@ namespace extensions { -CefExtensionsDispatcherDelegate::CefExtensionsDispatcherDelegate() { -} +CefExtensionsDispatcherDelegate::CefExtensionsDispatcherDelegate() {} -CefExtensionsDispatcherDelegate::~CefExtensionsDispatcherDelegate() { -} +CefExtensionsDispatcherDelegate::~CefExtensionsDispatcherDelegate() {} } // namespace extensions diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 57e57293b..f136b7f7b 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -85,9 +85,9 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame, blink::WebDocument opener_document = opener_frame->GetDocument(); blink::WebSecurityOrigin opener_origin = opener_document.GetSecurityOrigin(); - bool opener_is_extension_url = !opener_origin.IsUnique() && - extension_registry->GetExtensionOrAppByURL( - opener_document.Url()) != nullptr; + bool opener_is_extension_url = + !opener_origin.IsUnique() && extension_registry->GetExtensionOrAppByURL( + opener_document.Url()) != nullptr; const extensions::Extension* opener_top_extension = extension_registry->GetExtensionOrAppByURL(old_url); bool opener_is_web_store = @@ -111,11 +111,9 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame, } // namespace -CefExtensionsRendererClient::CefExtensionsRendererClient() { -} +CefExtensionsRendererClient::CefExtensionsRendererClient() {} -CefExtensionsRendererClient::~CefExtensionsRendererClient() { -} +CefExtensionsRendererClient::~CefExtensionsRendererClient() {} bool CefExtensionsRendererClient::IsIncognitoProcess() const { return CefRenderThreadObserver::is_incognito_process(); @@ -135,7 +133,7 @@ void CefExtensionsRendererClient::RenderThreadStarted() { extension_dispatcher_.reset( new extensions::Dispatcher(extension_dispatcher_delegate_.get())); resource_request_policy_.reset( - new extensions::ResourceRequestPolicy(extension_dispatcher_.get())); + new extensions::ResourceRequestPolicy(extension_dispatcher_.get())); guest_view_container_dispatcher_.reset( new extensions::ExtensionsGuestViewContainerDispatcher()); @@ -238,7 +236,7 @@ bool CefExtensionsRendererClient::ShouldFork(blink::WebLocalFrame* frame, // for subframes, so this check only makes sense for top-level frames. // TODO(alexmos,nasko): Figure out how this check should work when reloading // subframes in --site-per-process mode. - if (!frame->Parent() && GURL(frame->GetDocument().Url()) == url) { + if (!frame->Parent() && GURL(frame->GetDocument().Url()) == url) { if (is_extension_url != IsStandaloneExtensionProcess()) return true; } diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 2cd157835..df2535eb2 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -68,7 +68,8 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { const GURL& original_url); private: - std::unique_ptr extension_dispatcher_delegate_; + std::unique_ptr + extension_dispatcher_delegate_; std::unique_ptr extension_dispatcher_; std::unique_ptr guest_view_container_dispatcher_; diff --git a/libcef/renderer/extensions/print_web_view_helper_delegate.cc b/libcef/renderer/extensions/print_web_view_helper_delegate.cc index 5b012b79e..8c398b07b 100644 --- a/libcef/renderer/extensions/print_web_view_helper_delegate.cc +++ b/libcef/renderer/extensions/print_web_view_helper_delegate.cc @@ -18,8 +18,7 @@ namespace extensions { -CefPrintWebViewHelperDelegate::~CefPrintWebViewHelperDelegate(){ -} +CefPrintWebViewHelperDelegate::~CefPrintWebViewHelperDelegate() {} bool CefPrintWebViewHelperDelegate::CancelPrerender( content::RenderFrame* render_frame) { @@ -28,7 +27,7 @@ bool CefPrintWebViewHelperDelegate::CancelPrerender( // Return the PDF object element if |frame| is the out of process PDF extension. blink::WebElement CefPrintWebViewHelperDelegate::GetPdfElement( - blink::WebLocalFrame* frame) { + blink::WebLocalFrame* frame) { GURL url = frame->GetDocument().Url(); if (url.SchemeIs(extensions::kExtensionScheme) && url.host() == extension_misc::kPdfExtensionId) { @@ -47,8 +46,7 @@ bool CefPrintWebViewHelperDelegate::IsPrintPreviewEnabled() { return false; } -bool CefPrintWebViewHelperDelegate::OverridePrint( - blink::WebLocalFrame* frame) { +bool CefPrintWebViewHelperDelegate::OverridePrint(blink::WebLocalFrame* frame) { if (!frame->GetDocument().IsPluginDocument()) return false; diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index b935367e3..dfff0543a 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -9,7 +9,7 @@ // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(push) -#pragma warning(default:4996) +#pragma warning(default : 4996) #endif #include "libcef/common/cef_messages.h" @@ -29,20 +29,17 @@ #include "third_party/WebKit/public/web/WebFrameContentDumper.h" #include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebScriptSource.h" +#include "third_party/WebKit/public/web/WebView.h" using blink::WebString; -CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, - blink::WebFrame* frame) - : browser_(browser), - frame_(frame), - frame_id_(webkit_glue::GetIdentifier(frame)) { -} +CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame) + : browser_(browser), + frame_(frame), + frame_id_(webkit_glue::GetIdentifier(frame)) {} -CefFrameImpl::~CefFrameImpl() { -} +CefFrameImpl::~CefFrameImpl() {} bool CefFrameImpl::IsValid() { CEF_REQUIRE_RT_RETURN(false); @@ -85,9 +82,9 @@ void CefFrameImpl::ViewSource() { void CefFrameImpl::GetSource(CefRefPtr visitor) { CEF_REQUIRE_RT_RETURN_VOID(); if (frame_ && frame_->IsWebLocalFrame()) { - const CefString& content = - std::string(blink::WebFrameContentDumper::DumpAsMarkup( - frame_->ToWebLocalFrame()).Utf8()); + const CefString& content = std::string( + blink::WebFrameContentDumper::DumpAsMarkup(frame_->ToWebLocalFrame()) + .Utf8()); visitor->Visit(content); } } @@ -141,12 +138,11 @@ void CefFrameImpl::LoadURL(const CefString& url) { params.url = GURL(url.ToString()); params.method = "GET"; params.frame_id = frame_id_; - + browser_->LoadRequest(params); } -void CefFrameImpl::LoadString(const CefString& string, - const CefString& url) { +void CefFrameImpl::LoadString(const CefString& string, const CefString& url) { CEF_REQUIRE_RT_RETURN_VOID(); if (frame_) { @@ -167,9 +163,8 @@ void CefFrameImpl::ExecuteJavaScript(const CefString& jsCode, if (frame_) { GURL gurl = GURL(scriptUrl.ToString()); - frame_->ExecuteScript( - blink::WebScriptSource(WebString::FromUTF16(jsCode.ToString16()), gurl, - startLine)); + frame_->ExecuteScript(blink::WebScriptSource( + WebString::FromUTF16(jsCode.ToString16()), gurl, startLine)); } } @@ -275,7 +270,6 @@ void CefFrameImpl::ExecuteCommand(const std::string& command) { frame_->ToWebLocalFrame()->ExecuteCommand(WebString::FromUTF8(command)); } - // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(pop) diff --git a/libcef/renderer/frame_impl.h b/libcef/renderer/frame_impl.h index b103f3392..586ae23eb 100644 --- a/libcef/renderer/frame_impl.h +++ b/libcef/renderer/frame_impl.h @@ -21,8 +21,7 @@ class WebFrame; // associated renderer WebFrame will close. class CefFrameImpl : public CefFrame { public: - CefFrameImpl(CefBrowserImpl* browser, - blink::WebFrame* frame); + CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame); ~CefFrameImpl() override; // CefFrame implementation. @@ -39,8 +38,7 @@ class CefFrameImpl : public CefFrame { void GetText(CefRefPtr visitor) override; void LoadRequest(CefRefPtr request) override; void LoadURL(const CefString& url) override; - void LoadString(const CefString& string, - const CefString& url) override; + void LoadString(const CefString& string, const CefString& url) override; void ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) override; diff --git a/libcef/renderer/media/cef_key_systems.cc b/libcef/renderer/media/cef_key_systems.cc index 3788c3d5f..ceef929cd 100644 --- a/libcef/renderer/media/cef_key_systems.cc +++ b/libcef/renderer/media/cef_key_systems.cc @@ -19,7 +19,7 @@ #include "media/media_features.h" #include "ppapi/features/features.h" -#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. // The following must be after widevine_cdm_version.h. @@ -41,9 +41,7 @@ bool IsPepperCdmAvailable( bool is_available = false; content::RenderThread::Get()->Send( new CefViewHostMsg_IsInternalPluginAvailableForMimeType( - pepper_type, - &is_available, - additional_param_names, + pepper_type, &is_available, additional_param_names, additional_param_values)); return is_available; @@ -64,8 +62,7 @@ void GetSupportedCodecsForPepperCdm( base::ASCIIToUTF16(kCdmSupportedCodecsParamName)) { const base::string16& codecs_string16 = additional_param_values[i]; std::string codecs_string; - if (!base::UTF16ToUTF8(codecs_string16.c_str(), - codecs_string16.length(), + if (!base::UTF16ToUTF8(codecs_string16.c_str(), codecs_string16.length(), &codecs_string)) { DLOG(WARNING) << "Non-UTF-8 codecs string."; // Continue using the best effort conversion. @@ -89,8 +86,7 @@ void AddPepperBasedWidevine( std::vector additional_param_names; std::vector additional_param_values; - if (!IsPepperCdmAvailable(kWidevineCdmPluginMimeType, - &additional_param_names, + if (!IsPepperCdmAvailable(kWidevineCdmPluginMimeType, &additional_param_names, &additional_param_values)) { DVLOG(1) << "Widevine CDM is not currently available."; return; @@ -98,8 +94,7 @@ void AddPepperBasedWidevine( std::vector codecs; GetSupportedCodecsForPepperCdm(additional_param_names, - additional_param_values, - &codecs); + additional_param_values, &codecs); SupportedCodecs supported_codecs = media::EME_CODEC_NONE; diff --git a/libcef/renderer/media/cef_key_systems.h b/libcef/renderer/media/cef_key_systems.h index 2e937ff5e..cf4b01f91 100644 --- a/libcef/renderer/media/cef_key_systems.h +++ b/libcef/renderer/media/cef_key_systems.h @@ -13,8 +13,7 @@ class KeySystemProperties; } // Register the key systems supported by populating |key_systems_properties|. -void AddCefKeySystems( - std::vector>* - key_systems_properties); +void AddCefKeySystems(std::vector>* + key_systems_properties); #endif // CEF_LIBCEF_RENDERER_MEDIA_CEF_KEY_SYSTEMS_H_ diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index 85ae0c004..2f07468da 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -45,15 +45,13 @@ namespace { const CefPluginPlaceholder* g_last_active_menu = NULL; } // namespace -gin::WrapperInfo CefPluginPlaceholder::kWrapperInfo = { - gin::kEmbedderNativeGin}; +gin::WrapperInfo CefPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin}; -CefPluginPlaceholder::CefPluginPlaceholder( - content::RenderFrame* render_frame, - blink::WebLocalFrame* frame, - const blink::WebPluginParams& params, - const std::string& html_data, - const base::string16& title) +CefPluginPlaceholder::CefPluginPlaceholder(content::RenderFrame* render_frame, + blink::WebLocalFrame* frame, + const blink::WebPluginParams& params, + const std::string& html_data, + const base::string16& title) : plugins::LoadablePluginPlaceholder(render_frame, frame, params, @@ -106,11 +104,12 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin( values.SetString("message", message); values.SetString("name", name); values.SetString("hide", l10n_util::GetStringUTF8(IDS_PLUGIN_HIDE)); - values.SetString("pluginType", - frame->View()->MainFrame()->IsWebLocalFrame() && - frame->View()->MainFrame()->GetDocument().IsPluginDocument() - ? "document" - : "embedded"); + values.SetString( + "pluginType", + frame->View()->MainFrame()->IsWebLocalFrame() && + frame->View()->MainFrame()->GetDocument().IsPluginDocument() + ? "document" + : "embedded"); if (!power_saver_info.poster_attribute.empty()) { values.SetString("poster", power_saver_info.poster_attribute); @@ -131,13 +130,13 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin( const base::StringPiece template_html( ResourceBundle::GetSharedInstance().GetRawDataResource(template_id)); - DCHECK(!template_html.empty()) << "unable to load template. ID: " - << template_id; + DCHECK(!template_html.empty()) + << "unable to load template. ID: " << template_id; std::string html_data = webui::GetI18nTemplateHtml(template_html, &values); // |blocked_plugin| will destroy itself when its WebViewPlugin is going away. - CefPluginPlaceholder* blocked_plugin = new CefPluginPlaceholder( - render_frame, frame, params, html_data, name); + CefPluginPlaceholder* blocked_plugin = + new CefPluginPlaceholder(render_frame, frame, params, html_data, name); if (!power_saver_info.poster_attribute.empty()) blocked_plugin->BlockForPowerSaverPoster(); @@ -183,8 +182,8 @@ void CefPluginPlaceholder::PluginListChanged() { std::string mime_type(GetPluginParams().mime_type.Utf8()); render_frame()->Send(new CefViewHostMsg_GetPluginInfo( routing_id(), GURL(GetPluginParams().url), - GetFrame()->Parent() == nullptr, - GetFrame()->Top()->GetSecurityOrigin(), mime_type, &output)); + GetFrame()->Parent() == nullptr, GetFrame()->Top()->GetSecurityOrigin(), + mime_type, &output)); if (output.status == status_) return; blink::WebPlugin* new_plugin = CefContentRendererClient::CreatePlugin( @@ -219,13 +218,11 @@ void CefPluginPlaceholder::OnMenuClosed(int request_id) { context_menu_request_id_ = 0; } -v8::Local CefPluginPlaceholder::GetV8Handle( - v8::Isolate* isolate) { +v8::Local CefPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) { return gin::CreateHandle(isolate, this).ToV8(); } -void CefPluginPlaceholder::ShowContextMenu( - const blink::WebMouseEvent& event) { +void CefPluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent& event) { if (context_menu_request_id_) return; // Don't allow nested context menu requests. @@ -279,8 +276,8 @@ blink::WebPlugin* CefPluginPlaceholder::CreatePlugin() { content::RenderFrame::DONT_RECORD_DECISION); // PluginPreroller manages its own lifetime. new CefPluginPreroller( - render_frame(), GetFrame(), GetPluginParams(), - GetPluginInfo(), GetIdentifier(), title_, + render_frame(), GetFrame(), GetPluginParams(), GetPluginInfo(), + GetIdentifier(), title_, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, title_), throttler.get()); } diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.h b/libcef/renderer/plugins/cef_plugin_placeholder.h index 6a7653eb0..50684ae4b 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.h +++ b/libcef/renderer/plugins/cef_plugin_placeholder.h @@ -15,11 +15,10 @@ enum class CefViewHostMsg_GetPluginInfo_Status; -class CefPluginPlaceholder final - : public plugins::LoadablePluginPlaceholder, - public content::RenderThreadObserver, - public content::ContextMenuClient, - public gin::Wrappable { +class CefPluginPlaceholder final : public plugins::LoadablePluginPlaceholder, + public content::RenderThreadObserver, + public content::ContextMenuClient, + public gin::Wrappable { public: static gin::WrapperInfo kWrapperInfo; diff --git a/libcef/renderer/plugins/plugin_preroller.cc b/libcef/renderer/plugins/plugin_preroller.cc index 9efd5446d..73a45b15b 100644 --- a/libcef/renderer/plugins/plugin_preroller.cc +++ b/libcef/renderer/plugins/plugin_preroller.cc @@ -67,10 +67,9 @@ void CefPluginPreroller::OnThrottleStateChange() { power_saver_info.poster_attribute = keyframe_data_url_.spec(); power_saver_info.custom_poster_size = throttler_->GetSize(); - CefPluginPlaceholder* placeholder = - CefPluginPlaceholder::CreateBlockedPlugin( - render_frame(), frame_, params_, info_, identifier_, name_, - IDR_PLUGIN_POSTER_HTML, message_, power_saver_info); + CefPluginPlaceholder* placeholder = CefPluginPlaceholder::CreateBlockedPlugin( + render_frame(), frame_, params_, info_, identifier_, name_, + IDR_PLUGIN_POSTER_HTML, message_, power_saver_info); placeholder->SetPremadePlugin(throttler_); placeholder->set_power_saver_enabled(true); placeholder->AllowLoading(); diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index dca6981c6..d6379ffd3 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. - #include "base/compiler_specific.h" MSVC_PUSH_WARNING_LEVEL(0); @@ -12,7 +11,7 @@ MSVC_POP_WARNING(); // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(push) -#pragma warning(default:4996) +#pragma warning(default : 4996) #endif #include "libcef/renderer/render_frame_observer.h" @@ -22,16 +21,14 @@ MSVC_POP_WARNING(); #include "libcef/renderer/v8_impl.h" #include "content/public/renderer/render_frame.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebKit.h" +#include "third_party/WebKit/public/web/WebLocalFrame.h" CefRenderFrameObserver::CefRenderFrameObserver( content::RenderFrame* render_frame) - : content::RenderFrameObserver(render_frame) { -} + : content::RenderFrameObserver(render_frame) {} -CefRenderFrameObserver::~CefRenderFrameObserver() { -} +CefRenderFrameObserver::~CefRenderFrameObserver() {} void CefRenderFrameObserver::DidCreateScriptContext( v8::Handle context, @@ -102,7 +99,6 @@ void CefRenderFrameObserver::OnDestruct() { delete this; } - // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(pop) diff --git a/libcef/renderer/render_message_filter.cc b/libcef/renderer/render_message_filter.cc index 60b5aa251..85d7f783c 100644 --- a/libcef/renderer/render_message_filter.cc +++ b/libcef/renderer/render_message_filter.cc @@ -4,8 +4,9 @@ // found in the LICENSE file. #include "libcef/renderer/render_message_filter.h" -#include "libcef/renderer/thread_util.h" + #include "libcef/common/cef_messages.h" +#include "libcef/renderer/thread_util.h" #include "base/bind.h" #include "base/message_loop/message_loop.h" @@ -20,12 +21,9 @@ using content::BrowserThread; -CefRenderMessageFilter::CefRenderMessageFilter() - : channel_(NULL) { -} +CefRenderMessageFilter::CefRenderMessageFilter() : channel_(NULL) {} -CefRenderMessageFilter::~CefRenderMessageFilter() { -} +CefRenderMessageFilter::~CefRenderMessageFilter() {} void CefRenderMessageFilter::OnFilterAdded(IPC::Channel* channel) { channel_ = channel; @@ -68,8 +66,7 @@ bool CefRenderMessageFilter::Send(IPC::Message* message) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, + BrowserThread::IO, FROM_HERE, base::Bind(base::IgnoreResult(&CefRenderMessageFilter::Send), this, message)); return true; @@ -82,16 +79,15 @@ bool CefRenderMessageFilter::Send(IPC::Message* message) { return false; } -void CefRenderMessageFilter::OnDevToolsAgentAttach( - const std::string& host_id, int session_id) { +void CefRenderMessageFilter::OnDevToolsAgentAttach(const std::string& host_id, + int session_id) { CEF_POST_TASK_RT( base::Bind(&CefRenderMessageFilter::OnDevToolsAgentAttach_RT, this)); } void CefRenderMessageFilter::OnDevToolsAgentDetach(int32_t routing_id) { - CEF_POST_TASK_RT( - base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, this, - routing_id)); + CEF_POST_TASK_RT(base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, + this, routing_id)); } void CefRenderMessageFilter::OnIsCrashReportingEnabled(bool* enabled) { @@ -117,10 +113,10 @@ void CefRenderMessageFilter::OnDevToolsAgentDetach_RT(int32_t routing_id) { // Try again in a bit. CEF_POST_DELAYED_TASK_RT( base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, this, - routing_id), 50); + routing_id), + 50); return; } CefContentRendererClient::Get()->DevToolsAgentDetached(); } - diff --git a/libcef/renderer/render_message_filter.h b/libcef/renderer/render_message_filter.h index ad12bb71f..0899171e2 100644 --- a/libcef/renderer/render_message_filter.h +++ b/libcef/renderer/render_message_filter.h @@ -40,5 +40,4 @@ class CefRenderMessageFilter : public IPC::MessageFilter { DISALLOW_COPY_AND_ASSIGN(CefRenderMessageFilter); }; - #endif // CEF_LIBCEF_RENDERER_RENDER_MESSAGE_FILTER_H_ diff --git a/libcef/renderer/render_thread_observer.cc b/libcef/renderer/render_thread_observer.cc index 2997d9bab..80f40ec02 100644 --- a/libcef/renderer/render_thread_observer.cc +++ b/libcef/renderer/render_thread_observer.cc @@ -4,6 +4,7 @@ // found in the LICENSE file. #include "libcef/renderer/render_thread_observer.h" + #include "libcef/common/cef_messages.h" #include "libcef/common/net/net_resource_provider.h" #include "libcef/renderer/content_renderer_client.h" @@ -19,7 +20,7 @@ bool CefRenderThreadObserver::is_incognito_process_ = false; CefRenderThreadObserver::CefRenderThreadObserver() - : visited_link_slave_(new visitedlink::VisitedLinkSlave) { + : visited_link_slave_(new visitedlink::VisitedLinkSlave) { net::NetModule::SetResourceProvider(NetResourceProvider); content::RenderThread* thread = content::RenderThread::Get(); @@ -27,8 +28,7 @@ CefRenderThreadObserver::CefRenderThreadObserver() visited_link_slave_->GetBindCallback()); } -CefRenderThreadObserver::~CefRenderThreadObserver() { -} +CefRenderThreadObserver::~CefRenderThreadObserver() {} bool CefRenderThreadObserver::OnControlMessageReceived( const IPC::Message& message) { @@ -61,14 +61,12 @@ void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry( GURL gurl = GURL(params.source_origin); if (add) { blink::WebSecurityPolicy::AddOriginAccessWhitelistEntry( - gurl, - blink::WebString::FromUTF8(params.target_protocol), + gurl, blink::WebString::FromUTF8(params.target_protocol), blink::WebString::FromUTF8(params.target_domain), params.allow_target_subdomains); } else { blink::WebSecurityPolicy::RemoveOriginAccessWhitelistEntry( - gurl, - blink::WebString::FromUTF8(params.target_protocol), + gurl, blink::WebString::FromUTF8(params.target_protocol), blink::WebString::FromUTF8(params.target_domain), params.allow_target_subdomains); } diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index a0826576d..a54445ba1 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -27,7 +27,6 @@ using blink::WebURLLoader; using blink::WebURLRequest; using blink::WebURLResponse; - namespace { class CefWebURLLoaderClient : public blink::WebURLLoaderClient { @@ -37,20 +36,14 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient { ~CefWebURLLoaderClient() override; // blink::WebURLLoaderClient methods. - bool WillFollowRedirect( - WebURLRequest& newRequest, - const WebURLResponse& redirectResponse) override; - void DidSendData( - unsigned long long bytesSent, - unsigned long long totalBytesToBeSent) override; - void DidReceiveResponse( - const WebURLResponse& response) override; - void DidDownloadData(int dataLength, - int encodedDataLength) override; - void DidReceiveData(const char* data, - int dataLength) override; - void DidReceiveCachedMetadata(const char* data, - int dataLength) override; + bool WillFollowRedirect(WebURLRequest& newRequest, + const WebURLResponse& redirectResponse) override; + void DidSendData(unsigned long long bytesSent, + unsigned long long totalBytesToBeSent) override; + void DidReceiveResponse(const WebURLResponse& response) override; + void DidDownloadData(int dataLength, int encodedDataLength) override; + void DidReceiveData(const char* data, int dataLength) override; + void DidReceiveCachedMetadata(const char* data, int dataLength) override; void DidFinishLoading(double finishTime, int64_t totalEncodedDataLength, int64_t totalEncodedBodyLength) override; @@ -66,7 +59,6 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient { } // namespace - // CefRenderURLRequest::Context ----------------------------------------------- class CefRenderURLRequest::Context @@ -75,16 +67,16 @@ class CefRenderURLRequest::Context Context(CefRefPtr url_request, CefRefPtr request, CefRefPtr client) - : url_request_(url_request), - request_(request), - client_(client), - task_runner_(base::MessageLoop::current()->task_runner()), - status_(UR_IO_PENDING), - error_code_(ERR_NONE), - upload_data_size_(0), - got_upload_progress_complete_(false), - download_data_received_(0), - download_data_total_(-1) { + : url_request_(url_request), + request_(request), + client_(client), + task_runner_(base::MessageLoop::current()->task_runner()), + status_(UR_IO_PENDING), + error_code_(ERR_NONE), + upload_data_size_(0), + got_upload_progress_complete_(false), + download_data_received_(0), + download_data_total_(-1) { // Mark the request as read-only. static_cast(request_.get())->SetReadOnly(true); } @@ -104,8 +96,8 @@ class CefRenderURLRequest::Context url_client_.reset(new CefWebURLLoaderClient(this, request_->GetFlags())); WebURLRequest urlRequest; - static_cast(request_.get())->Get(urlRequest, - upload_data_size_); + static_cast(request_.get()) + ->Get(urlRequest, upload_data_size_); loader_->LoadAsynchronously(urlRequest, url_client_.get()); return true; @@ -174,7 +166,7 @@ class CefRenderURLRequest::Context download_data_received_ += current; client_->OnDownloadProgress(url_request_.get(), download_data_received_, - download_data_total_); + download_data_total_); } void OnDownloadData(const char* data, int dataLength) { @@ -229,7 +221,6 @@ class CefRenderURLRequest::Context int64_t download_data_total_; }; - // CefWebURLLoaderClient -------------------------------------------------- namespace { @@ -237,12 +228,9 @@ namespace { CefWebURLLoaderClient::CefWebURLLoaderClient( CefRenderURLRequest::Context* context, int request_flags) - : context_(context), - request_flags_(request_flags) { -} + : context_(context), request_flags_(request_flags) {} -CefWebURLLoaderClient::~CefWebURLLoaderClient() { -} +CefWebURLLoaderClient::~CefWebURLLoaderClient() {} bool CefWebURLLoaderClient::WillFollowRedirect( WebURLRequest& newRequest, @@ -250,24 +238,20 @@ bool CefWebURLLoaderClient::WillFollowRedirect( return true; } -void CefWebURLLoaderClient::DidSendData( - unsigned long long bytesSent, - unsigned long long totalBytesToBeSent) { +void CefWebURLLoaderClient::DidSendData(unsigned long long bytesSent, + unsigned long long totalBytesToBeSent) { if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS) context_->OnUploadProgress(bytesSent, totalBytesToBeSent); } -void CefWebURLLoaderClient::DidReceiveResponse( - const WebURLResponse& response) { +void CefWebURLLoaderClient::DidReceiveResponse(const WebURLResponse& response) { context_->OnResponse(response); } void CefWebURLLoaderClient::DidDownloadData(int dataLength, - int encodedDataLength) { -} + int encodedDataLength) {} -void CefWebURLLoaderClient::DidReceiveData(const char* data, - int dataLength) { +void CefWebURLLoaderClient::DidReceiveData(const char* data, int dataLength) { context_->OnDownloadProgress(dataLength); if (!(request_flags_ & UR_FLAG_NO_DOWNLOAD_DATA)) @@ -275,8 +259,7 @@ void CefWebURLLoaderClient::DidReceiveData(const char* data, } void CefWebURLLoaderClient::DidReceiveCachedMetadata(const char* data, - int dataLength) { -} + int dataLength) {} void CefWebURLLoaderClient::DidFinishLoading(double finishTime, int64_t totalEncodedDataLength, @@ -290,10 +273,8 @@ void CefWebURLLoaderClient::DidFail(const WebURLError& error, context_->OnError(error); } - } // namespace - // CefRenderURLRequest -------------------------------------------------------- CefRenderURLRequest::CefRenderURLRequest( @@ -302,8 +283,7 @@ CefRenderURLRequest::CefRenderURLRequest( context_ = new Context(this, request, client); } -CefRenderURLRequest::~CefRenderURLRequest() { -} +CefRenderURLRequest::~CefRenderURLRequest() {} bool CefRenderURLRequest::Start() { if (!VerifyContext()) diff --git a/libcef/renderer/render_urlrequest_impl.h b/libcef/renderer/render_urlrequest_impl.h index 5db7e993b..fb8b8b009 100644 --- a/libcef/renderer/render_urlrequest_impl.h +++ b/libcef/renderer/render_urlrequest_impl.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_ #include "include/cef_urlrequest.h" + #include "base/memory/ref_counted.h" class CefRenderURLRequest : public CefURLRequest { diff --git a/libcef/renderer/thread_util.h b/libcef/renderer/thread_util.h index 1867ef607..7087b5e09 100644 --- a/libcef/renderer/thread_util.h +++ b/libcef/renderer/thread_util.h @@ -16,31 +16,30 @@ #define CEF_REQUIRE_RT() DCHECK(CEF_CURRENTLY_ON_RT()) -#define CEF_REQUIRE_RT_RETURN(var) \ - if (!CEF_CURRENTLY_ON_RT()) { \ +#define CEF_REQUIRE_RT_RETURN(var) \ + if (!CEF_CURRENTLY_ON_RT()) { \ NOTREACHED() << "called on invalid thread"; \ - return var; \ + return var; \ } -#define CEF_REQUIRE_RT_RETURN_VOID() \ - if (!CEF_CURRENTLY_ON_RT()) { \ +#define CEF_REQUIRE_RT_RETURN_VOID() \ + if (!CEF_CURRENTLY_ON_RT()) { \ NOTREACHED() << "called on invalid thread"; \ - return; \ + return; \ } #define CEF_RENDER_LOOP() \ - (CefContentRendererClient::Get()->render_task_runner()) + (CefContentRendererClient::Get()->render_task_runner()) -#define CEF_POST_TASK_RT(task) \ - CEF_RENDER_LOOP()->PostTask(FROM_HERE, task) +#define CEF_POST_TASK_RT(task) CEF_RENDER_LOOP()->PostTask(FROM_HERE, task) #define CEF_POST_DELAYED_TASK_RT(task, delay_ms) \ - CEF_RENDER_LOOP()->PostDelayedTask(FROM_HERE, task, \ - base::TimeDelta::FromMilliseconds(delay_ms)) + CEF_RENDER_LOOP()->PostDelayedTask( \ + FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms)) // Use this template in conjuction with RefCountedThreadSafe when you want to // ensure that an object is deleted on the render thread. struct CefDeleteOnRenderThread { - template + template static void Destruct(const T* x) { if (CEF_CURRENTLY_ON_RT()) { delete x; diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index e5e779f6b..660bea0a4 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -15,7 +15,7 @@ // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(push) -#pragma warning(default:4996) +#pragma warning(default : 4996) #endif #include "libcef/renderer/v8_impl.h" @@ -32,8 +32,8 @@ #include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_local.h" -#include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebFrame.h" +#include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "url/gurl.h" @@ -53,10 +53,10 @@ void SetPrivate(v8::Local context, const char* key, v8::Local value) { v8::Isolate* isolate = context->GetIsolate(); - obj->SetPrivate(context, - v8::Private::ForApi(isolate, - v8::String::NewFromUtf8(isolate, key)), - value) + obj->SetPrivate( + context, + v8::Private::ForApi(isolate, v8::String::NewFromUtf8(isolate, key)), + value) .FromJust(); } @@ -65,10 +65,9 @@ bool GetPrivate(v8::Local context, const char* key, v8::Local* result) { v8::Isolate* isolate = context->GetIsolate(); - return obj->GetPrivate(context, - v8::Private::ForApi( - isolate, - v8::String::NewFromUtf8(isolate, key))) + return obj + ->GetPrivate(context, v8::Private::ForApi( + isolate, v8::String::NewFromUtf8(isolate, key))) .ToLocal(result); } @@ -142,8 +141,8 @@ class CefV8IsolateManager { message_listener_registered_ = true; } - isolate_->SetCaptureStackTraceForUncaughtExceptions(true, - stack_size, v8::StackTrace::kDetailed); + isolate_->SetCaptureStackTraceForUncaughtExceptions( + true, stack_size, v8::StackTrace::kDetailed); } void SetWorkerAttributes(int worker_id, const GURL& worker_url) { @@ -156,19 +155,15 @@ class CefV8IsolateManager { return task_runner_; } - int worker_id() const { - return worker_id_; - } + int worker_id() const { return worker_id_; } - const GURL& worker_url() const { - return worker_url_; - } + const GURL& worker_url() const { return worker_url_; } private: v8::Isolate* isolate_; scoped_refptr task_runner_; - typedef std::map > ContextMap; + typedef std::map> ContextMap; ContextMap context_map_; // Used for globally tracked objects that are not associated with a particular @@ -189,9 +184,8 @@ class CefV8IsolateManager { // be re-worked (perhaps using a map keyed on v8::Isolate::GetCurrent()) if // in the future Chromium begins using the same Isolate across multiple threads. class CefV8StateManager { -public: - CefV8StateManager() { - } + public: + CefV8StateManager() {} void CreateIsolateManager() { DCHECK(!current_tls_.Get()); @@ -224,8 +218,7 @@ CefV8IsolateManager* GetIsolateManager() { class V8TrackObject : public CefTrackNode { public: explicit V8TrackObject(v8::Isolate* isolate) - : isolate_(isolate), - external_memory_(0) { + : isolate_(isolate), external_memory_(0) { DCHECK(isolate_); isolate_->AdjustAmountOfExternalAllocatedMemory( static_cast(sizeof(V8TrackObject))); @@ -235,9 +228,7 @@ class V8TrackObject : public CefTrackNode { -static_cast(sizeof(V8TrackObject)) - external_memory_); } - inline int GetExternallyAllocatedMemory() { - return external_memory_; - } + inline int GetExternallyAllocatedMemory() { return external_memory_; } int AdjustExternallyAllocatedMemory(int change_in_bytes) { int new_value = external_memory_ + change_in_bytes; @@ -258,37 +249,28 @@ class V8TrackObject : public CefTrackNode { accessor_ = accessor; } - inline CefRefPtr GetAccessor() { - return accessor_; - } + inline CefRefPtr GetAccessor() { return accessor_; } inline void SetInterceptor(CefRefPtr interceptor) { interceptor_ = interceptor; } - inline CefRefPtr GetInterceptor() { - return interceptor_; - } + inline CefRefPtr GetInterceptor() { return interceptor_; } inline void SetHandler(CefRefPtr handler) { handler_ = handler; } - inline CefRefPtr GetHandler() { - return handler_; - } + inline CefRefPtr GetHandler() { return handler_; } inline void SetUserData(CefRefPtr user_data) { user_data_ = user_data; } - inline CefRefPtr GetUserData() { - return user_data_; - } + inline CefRefPtr GetUserData() { return user_data_; } // Attach this track object to the specified V8 object. - void AttachTo(v8::Local context, - v8::Local object) { + void AttachTo(v8::Local context, v8::Local object) { SetPrivate(context, object, kCefTrackObject, v8::External::New(isolate_, this)); } @@ -321,7 +303,6 @@ class V8TrackString : public CefTrackNode { std::string string_; }; - // Object wrapped in a v8::External and passed as the Data argument to // v8::FunctionTemplate::New. class V8FunctionData { @@ -339,21 +320,15 @@ class V8FunctionData { return static_cast(v8::External::Cast(*data)->Value()); } - CefString function_name() const { - return function_name_; - } + CefString function_name() const { return function_name_; } - CefV8Handler* handler() const { - return handler_; - } + CefV8Handler* handler() const { return handler_; } private: V8FunctionData(v8::Isolate* isolate, const CefString& function_name, CefV8Handler* handler) - : isolate_(isolate), - function_name_(function_name), - handler_(handler) { + : isolate_(isolate), function_name_(function_name), handler_(handler) { DCHECK(isolate_); DCHECK(handler_); } @@ -394,41 +369,34 @@ class V8FunctionData { v8::Persistent handle_; }; - // Convert a CefString to a V8::String. -v8::Local GetV8String(v8::Isolate* isolate, - const CefString& str) { +v8::Local GetV8String(v8::Isolate* isolate, const CefString& str) { #if defined(CEF_STRING_TYPE_UTF16) // Already a UTF16 string. return v8::String::NewFromTwoByte( isolate, reinterpret_cast( const_cast(str.c_str())), - v8::String::kNormalString, - str.length()); + v8::String::kNormalString, str.length()); #elif defined(CEF_STRING_TYPE_UTF8) // Already a UTF8 string. - return v8::String::NewFromUtf8(isolate, - const_cast(str.c_str()), - v8::String::kNormalString, - str.length()); + return v8::String::NewFromUtf8(isolate, const_cast(str.c_str()), + v8::String::kNormalString, str.length()); #else // Convert the string to UTF8. std::string tmpStr = str; - return v8::String::NewFromUtf8(isolate, - tmpStr.c_str(), - v8::String::kNormalString, - tmpStr.length()); + return v8::String::NewFromUtf8(isolate, tmpStr.c_str(), + v8::String::kNormalString, tmpStr.length()); #endif } #if defined(CEF_STRING_TYPE_UTF16) void v8impl_string_dtor(char16* str) { - delete [] str; + delete[] str; } #elif defined(CEF_STRING_TYPE_UTF8) void v8impl_string_dtor(char* str) { - delete [] str; + delete[] str; } #endif @@ -449,7 +417,7 @@ void GetCefString(v8::Local str, CefString& out) { cef_string_t* retws = out.GetWritableStruct(); cef_string_utf8_to_wide(buf, len, retws); - delete [] buf; + delete[] buf; #else // !defined(CEF_STRING_TYPE_WIDE) #if defined(CEF_STRING_TYPE_UTF16) int len = str->Length(); @@ -494,9 +462,8 @@ void FunctionCallbackImpl(const v8::FunctionCallbackInfo& info) { if (data->handler()->Execute(data->function_name(), object, params, retval, exception)) { if (!exception.empty()) { - info.GetReturnValue().Set( - isolate->ThrowException( - v8::Exception::Error(GetV8String(isolate, exception)))); + info.GetReturnValue().Set(isolate->ThrowException( + v8::Exception::Error(GetV8String(isolate, exception)))); return; } else { CefV8ValueImpl* rv = static_cast(retval.get()); @@ -532,16 +499,15 @@ void AccessorNameGetterCallbackImpl( GetCefString(v8::Local::Cast(property), name); if (accessorPtr->Get(name, object, retval, exception)) { if (!exception.empty()) { - info.GetReturnValue().Set( - isolate->ThrowException( - v8::Exception::Error(GetV8String(isolate, exception)))); - return; + info.GetReturnValue().Set(isolate->ThrowException( + v8::Exception::Error(GetV8String(isolate, exception)))); + return; } else { - CefV8ValueImpl* rv = static_cast(retval.get()); - if (rv && rv->IsValid()) { - info.GetReturnValue().Set(rv->GetV8Value(true)); - return; - } + CefV8ValueImpl* rv = static_cast(retval.get()); + if (rv && rv->IsValid()) { + info.GetReturnValue().Set(rv->GetV8Value(true)); + return; + } } } } @@ -593,7 +559,7 @@ int PropertyToIndex(uint32_t index) { // V8 Interceptor callbacks. // T == v8::Local for named property handlers and // T == uint32_t for indexed property handlers -template +template void InterceptorGetterCallbackImpl( T property, const v8::PropertyCallbackInfo& info) { @@ -624,7 +590,7 @@ void InterceptorGetterCallbackImpl( } } -template +template void InterceptorSetterCallbackImpl( T property, v8::Local value, @@ -657,12 +623,11 @@ class ExtensionWrapper : public v8::Extension { ExtensionWrapper(const char* extension_name, const char* javascript_code, CefV8Handler* handler) - : v8::Extension(extension_name, javascript_code), handler_(handler) { - } + : v8::Extension(extension_name, javascript_code), handler_(handler) {} v8::Handle GetNativeFunctionTemplate( - v8::Isolate* isolate, - v8::Handle name) override { + v8::Isolate* isolate, + v8::Handle name) override { if (!handler_) return v8::Local(); @@ -672,8 +637,7 @@ class ExtensionWrapper : public v8::Extension { v8::Local function_data = V8FunctionData::Create(isolate, func_name, handler_); - return v8::FunctionTemplate::New(isolate, - FunctionCallbackImpl, + return v8::FunctionTemplate::New(isolate, FunctionCallbackImpl, function_data); } @@ -685,11 +649,11 @@ class CefV8ExceptionImpl : public CefV8Exception { public: CefV8ExceptionImpl(v8::Local context, v8::Local message) - : line_number_(0), - start_position_(0), - end_position_(0), - start_column_(0), - end_column_(0) { + : line_number_(0), + start_position_(0), + end_position_(0), + start_column_(0), + end_column_(0) { if (message.IsEmpty()) return; @@ -749,12 +713,11 @@ void MessageListenerCallbackImpl(v8::Handle message, static_cast(context.get())->GetV8Context(), message); handler->OnUncaughtException(context->GetBrowser(), context->GetFrame(), - context, exception, stackTrace); + context, exception, stackTrace); } } // namespace - // Global functions. void CefV8IsolateCreated() { @@ -797,55 +760,50 @@ bool CefRegisterExtension(const CefString& extension_name, isolate_manager->AddGlobalTrackObject(object); } - ExtensionWrapper* wrapper = new ExtensionWrapper( - name->GetString(), - code->GetString(), - handler.get()); + ExtensionWrapper* wrapper = + new ExtensionWrapper(name->GetString(), code->GetString(), handler.get()); content::RenderThread::Get()->RegisterExtension(wrapper); return true; } - // Helper macros #define CEF_V8_HAS_ISOLATE() (!!GetIsolateManager()) -#define CEF_V8_REQUIRE_ISOLATE_RETURN(var) \ - if (!CEF_V8_HAS_ISOLATE()) { \ +#define CEF_V8_REQUIRE_ISOLATE_RETURN(var) \ + if (!CEF_V8_HAS_ISOLATE()) { \ NOTREACHED() << "V8 isolate is not valid"; \ - return var; \ + return var; \ } #define CEF_V8_CURRENTLY_ON_MLT() \ - (!handle_.get() || handle_->BelongsToCurrentThread()) -#define CEF_V8_REQUIRE_MLT_RETURN(var) \ - CEF_V8_REQUIRE_ISOLATE_RETURN(var); \ - if (!CEF_V8_CURRENTLY_ON_MLT()) { \ + (!handle_.get() || handle_->BelongsToCurrentThread()) +#define CEF_V8_REQUIRE_MLT_RETURN(var) \ + CEF_V8_REQUIRE_ISOLATE_RETURN(var); \ + if (!CEF_V8_CURRENTLY_ON_MLT()) { \ NOTREACHED() << "called on incorrect thread"; \ - return var; \ + return var; \ } #define CEF_V8_HANDLE_IS_VALID() (handle_.get() && handle_->IsValid()) #define CEF_V8_REQUIRE_VALID_HANDLE_RETURN(ret) \ - CEF_V8_REQUIRE_MLT_RETURN(ret); \ - if (!CEF_V8_HANDLE_IS_VALID()) { \ - NOTREACHED() << "V8 handle is not valid"; \ - return ret; \ + CEF_V8_REQUIRE_MLT_RETURN(ret); \ + if (!CEF_V8_HANDLE_IS_VALID()) { \ + NOTREACHED() << "V8 handle is not valid"; \ + return ret; \ } -#define CEF_V8_IS_VALID() \ - (CEF_V8_HAS_ISOLATE() && \ - CEF_V8_CURRENTLY_ON_MLT() && \ +#define CEF_V8_IS_VALID() \ + (CEF_V8_HAS_ISOLATE() && CEF_V8_CURRENTLY_ON_MLT() && \ CEF_V8_HANDLE_IS_VALID()) -#define CEF_V8_REQUIRE_OBJECT_RETURN(ret) \ - CEF_V8_REQUIRE_VALID_HANDLE_RETURN(ret); \ - if (type_ != TYPE_OBJECT) { \ +#define CEF_V8_REQUIRE_OBJECT_RETURN(ret) \ + CEF_V8_REQUIRE_VALID_HANDLE_RETURN(ret); \ + if (type_ != TYPE_OBJECT) { \ NOTREACHED() << "V8 value is not an object"; \ - return ret; \ + return ret; \ } - // CefV8HandleBase CefV8HandleBase::~CefV8HandleBase() { @@ -869,7 +827,6 @@ CefV8HandleBase::CefV8HandleBase(v8::Isolate* isolate, context_state_ = manager->GetContextState(context); } - // CefV8Context // static @@ -903,14 +860,11 @@ bool CefV8Context::InContext() { return isolate->InContext(); } - // CefV8ContextImpl CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate, v8::Local context) - : handle_(new Handle(isolate, context, context)), - enter_count_(0) { -} + : handle_(new Handle(isolate, context, context)), enter_count_(0) {} CefV8ContextImpl::~CefV8ContextImpl() { DLOG_ASSERT(0 == enter_count_); @@ -1048,8 +1002,8 @@ bool CefV8ContextImpl::Eval(const CefString& code, try_catch.SetVerbose(true); v8::MaybeLocal func_rv = - webkit_glue::ExecuteV8ScriptAndReturnValue(source, source_url, start_line, - context, isolate, try_catch, + webkit_glue::ExecuteV8ScriptAndReturnValue( + source, source_url, start_line, context, isolate, try_catch, blink::AccessControlStatus::kNotSharableCrossOrigin); if (try_catch.HasCaught()) { @@ -1080,7 +1034,6 @@ blink::WebFrame* CefV8ContextImpl::GetWebFrame() { return blink::WebLocalFrame::FrameForContext(context); } - // CefV8ValueImpl::Handle CefV8ValueImpl::Handle::Handle(v8::Isolate* isolate, @@ -1091,8 +1044,7 @@ CefV8ValueImpl::Handle::Handle(v8::Isolate* isolate, handle_(isolate, v), tracker_(tracker), should_persist_(false), - is_set_weak_(false) { -} + is_set_weak_(false) {} CefV8ValueImpl::Handle::~Handle() { DCHECK(BelongsToCurrentThread()); @@ -1121,8 +1073,8 @@ CefV8ValueImpl::Handle::~Handle() { } } -CefV8ValueImpl::Handle::handleType -CefV8ValueImpl::Handle::GetNewV8Handle(bool should_persist) { +CefV8ValueImpl::Handle::handleType CefV8ValueImpl::Handle::GetNewV8Handle( + bool should_persist) { DCHECK(IsValid()); if (should_persist && !should_persist_) should_persist_ = true; @@ -1136,7 +1088,8 @@ CefV8ValueImpl::Handle::GetPersistentV8Handle() { void CefV8ValueImpl::Handle::SetWeakIfNecessary() { if (!BelongsToCurrentThread()) { - task_runner()->PostTask(FROM_HERE, + task_runner()->PostTask( + FROM_HERE, base::Bind(&CefV8ValueImpl::Handle::SetWeakIfNecessary, this)); return; } @@ -1187,7 +1140,6 @@ void CefV8ValueImpl::Handle::SecondWeakCallback( wrapper->Release(); } - // CefV8Value // static @@ -1284,8 +1236,8 @@ CefRefPtr CefV8Value::CreateObject( if (interceptor.get()) { v8::Local tmpl = v8::ObjectTemplate::New(isolate); tmpl->SetNamedPropertyHandler( - InterceptorGetterCallbackImpl>, - InterceptorSetterCallbackImpl>); + InterceptorGetterCallbackImpl>, + InterceptorSetterCallbackImpl>); tmpl->SetIndexedPropertyHandler(InterceptorGetterCallbackImpl, InterceptorSetterCallbackImpl); @@ -1362,9 +1314,7 @@ CefRefPtr CefV8Value::CreateFunction( // Create a new V8 function template. v8::Local tmpl = - v8::FunctionTemplate::New(isolate, - FunctionCallbackImpl, - function_data); + v8::FunctionTemplate::New(isolate, FunctionCallbackImpl, function_data); // Retrieve the function object and set the name. v8::Local func = tmpl->GetFunction(); @@ -1390,22 +1340,17 @@ CefRefPtr CefV8Value::CreateFunction( return impl.get(); } - // CefV8ValueImpl CefV8ValueImpl::CefV8ValueImpl(v8::Isolate* isolate) - : isolate_(isolate), - type_(TYPE_INVALID), - rethrow_exceptions_(false) { + : isolate_(isolate), type_(TYPE_INVALID), rethrow_exceptions_(false) { DCHECK(isolate_); } CefV8ValueImpl::CefV8ValueImpl(v8::Isolate* isolate, v8::Local context, v8::Local value) - : isolate_(isolate), - type_(TYPE_INVALID), - rethrow_exceptions_(false) { + : isolate_(isolate), type_(TYPE_INVALID), rethrow_exceptions_(false) { DCHECK(isolate_); InitFromV8Value(context, value); } @@ -1504,7 +1449,8 @@ void CefV8ValueImpl::InitString(CefString& value) { } } -void CefV8ValueImpl::InitObject(v8::Local value, CefTrackNode* tracker) { +void CefV8ValueImpl::InitObject(v8::Local value, + CefTrackNode* tracker) { DCHECK_EQ(type_, TYPE_INVALID); type_ = TYPE_OBJECT; handle_ = new Handle(isolate_, v8::Local(), value, tracker); @@ -1542,7 +1488,7 @@ v8::Local CefV8ValueImpl::GetV8Value(bool should_persist) { bool CefV8ValueImpl::IsValid() { if (!CEF_V8_HAS_ISOLATE() || type_ == TYPE_INVALID || (type_ == TYPE_OBJECT && - (!handle_->BelongsToCurrentThread() || !handle_->IsValid()))) { + (!handle_->BelongsToCurrentThread() || !handle_->IsValid()))) { return false; } return true; @@ -1910,15 +1856,12 @@ bool CefV8ValueImpl::SetValue(const CefString& key, // will not. It might be better to split this functionality into separate // methods. if (attribute == V8_PROPERTY_ATTRIBUTE_NONE) { - v8::Maybe set = obj->Set(context, - GetV8String(isolate, key), - impl->GetV8Value(true)); + v8::Maybe set = + obj->Set(context, GetV8String(isolate, key), impl->GetV8Value(true)); return (!HasCaught(context, try_catch) && set.FromJust()); } else { v8::Maybe set = obj->DefineOwnProperty( - context, - GetV8String(isolate, key), - impl->GetV8Value(true), + context, GetV8String(isolate, key), impl->GetV8Value(true), static_cast(attribute)); return (!HasCaught(context, try_catch) && set.FromJust()); } @@ -1960,7 +1903,8 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) { } } -bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, +bool CefV8ValueImpl::SetValue(const CefString& key, + AccessControl settings, PropertyAttribute attribute) { CEF_V8_REQUIRE_OBJECT_RETURN(false); @@ -1988,15 +1932,16 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, v8::AccessorNameGetterCallback getter = AccessorNameGetterCallbackImpl; v8::AccessorNameSetterCallback setter = - (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ? - NULL : AccessorNameSetterCallbackImpl; + (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) + ? NULL + : AccessorNameSetterCallbackImpl; v8::TryCatch try_catch(isolate); try_catch.SetVerbose(true); - v8::Maybe set = obj->SetAccessor( - context, GetV8String(isolate, key), getter, setter, obj, - static_cast(settings), - static_cast(attribute)); + v8::Maybe set = + obj->SetAccessor(context, GetV8String(isolate, key), getter, setter, obj, + static_cast(settings), + static_cast(attribute)); return (!HasCaught(context, try_catch) && set.FromJust()); } @@ -2168,17 +2113,17 @@ CefRefPtr CefV8ValueImpl::GetFunctionHandler() { } CefRefPtr CefV8ValueImpl::ExecuteFunction( - CefRefPtr object, - const CefV8ValueList& arguments) { + CefRefPtr object, + const CefV8ValueList& arguments) { // An empty context value defaults to the current context. CefRefPtr context; return ExecuteFunctionWithContext(context, object, arguments); } CefRefPtr CefV8ValueImpl::ExecuteFunctionWithContext( - CefRefPtr context, - CefRefPtr object, - const CefV8ValueList& arguments) { + CefRefPtr context, + CefRefPtr object, + const CefV8ValueList& arguments) { CEF_V8_REQUIRE_OBJECT_RETURN(NULL); v8::Isolate* isolate = handle_->isolate(); @@ -2231,7 +2176,7 @@ CefRefPtr CefV8ValueImpl::ExecuteFunctionWithContext( recv = context_local->Global(); } - v8::Local *argv = NULL; + v8::Local* argv = NULL; if (argc > 0) { argv = new v8::Local[argc]; for (int i = 0; i < argc; ++i) { @@ -2246,18 +2191,17 @@ CefRefPtr CefV8ValueImpl::ExecuteFunctionWithContext( v8::TryCatch try_catch(isolate); try_catch.SetVerbose(true); - v8::MaybeLocal func_rv = - webkit_glue::CallV8Function(context_local, func, recv, argc, argv, - handle_->isolate()); + v8::MaybeLocal func_rv = webkit_glue::CallV8Function( + context_local, func, recv, argc, argv, handle_->isolate()); if (!HasCaught(context_local, try_catch) && !func_rv.IsEmpty()) { - retval = new CefV8ValueImpl(isolate, context_local, - func_rv.ToLocalChecked()); + retval = + new CefV8ValueImpl(isolate, context_local, func_rv.ToLocalChecked()); } } if (argv) - delete [] argv; + delete[] argv; return retval; } @@ -2276,7 +2220,6 @@ bool CefV8ValueImpl::HasCaught(v8::Local context, } } - // CefV8StackTrace // static @@ -2285,21 +2228,18 @@ CefRefPtr CefV8StackTrace::GetCurrent(int frame_limit) { v8::Isolate* isolate = GetIsolateManager()->isolate(); v8::HandleScope handle_scope(isolate); - v8::Local stackTrace = - v8::StackTrace::CurrentStackTrace( - isolate, frame_limit, v8::StackTrace::kDetailed); + v8::Local stackTrace = v8::StackTrace::CurrentStackTrace( + isolate, frame_limit, v8::StackTrace::kDetailed); if (stackTrace.IsEmpty()) return NULL; return new CefV8StackTraceImpl(isolate, stackTrace); } - // CefV8StackTraceImpl -CefV8StackTraceImpl::CefV8StackTraceImpl( - v8::Isolate* isolate, - v8::Local handle) { - if (!handle.IsEmpty()) { +CefV8StackTraceImpl::CefV8StackTraceImpl(v8::Isolate* isolate, + v8::Local handle) { + if (!handle.IsEmpty()) { int frame_count = handle->GetFrameCount(); if (frame_count > 0) { frames_.reserve(frame_count); @@ -2310,8 +2250,7 @@ CefV8StackTraceImpl::CefV8StackTraceImpl( } } -CefV8StackTraceImpl::~CefV8StackTraceImpl() { -} +CefV8StackTraceImpl::~CefV8StackTraceImpl() {} bool CefV8StackTraceImpl::IsValid() { return true; @@ -2327,16 +2266,11 @@ CefRefPtr CefV8StackTraceImpl::GetFrame(int index) { return frames_[index]; } - // CefV8StackFrameImpl -CefV8StackFrameImpl::CefV8StackFrameImpl( - v8::Isolate* isolate, - v8::Local handle) - : line_number_(0), - column_(0), - is_eval_(false), - is_constructor_(false) { +CefV8StackFrameImpl::CefV8StackFrameImpl(v8::Isolate* isolate, + v8::Local handle) + : line_number_(0), column_(0), is_eval_(false), is_constructor_(false) { if (handle.IsEmpty()) return; GetCefString(handle->GetScriptName(), script_name_); @@ -2348,8 +2282,7 @@ CefV8StackFrameImpl::CefV8StackFrameImpl( is_constructor_ = handle->IsConstructor(); } -CefV8StackFrameImpl::~CefV8StackFrameImpl() { -} +CefV8StackFrameImpl::~CefV8StackFrameImpl() {} bool CefV8StackFrameImpl::IsValid() { return true; @@ -2383,7 +2316,6 @@ bool CefV8StackFrameImpl::IsConstructor() { return is_constructor_; } - // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) #pragma warning(pop) diff --git a/libcef/renderer/v8_impl.h b/libcef/renderer/v8_impl.h index b9f7746e4..2d9ac13b1 100644 --- a/libcef/renderer/v8_impl.h +++ b/libcef/renderer/v8_impl.h @@ -11,11 +11,11 @@ #include "include/cef_v8.h" #include "libcef/common/tracker.h" -#include "v8/include/v8.h" #include "base/location.h" #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/sequenced_task_runner.h" +#include "v8/include/v8.h" class CefTrackNode; class GURL; @@ -70,11 +70,10 @@ class CefV8ContextState : public base::RefCounted { CefTrackManager track_manager_; }; - // Use this template in conjuction with RefCountedThreadSafe to ensure that a // V8 object is deleted on the correct thread. struct CefV8DeleteOnMessageLoopThread { - template + template static void Destruct(const T* x) { if (x->task_runner()->RunsTasksOnCurrentThread()) { delete x; @@ -91,9 +90,9 @@ struct CefV8DeleteOnMessageLoopThread { }; // Base class for V8 Handle types. -class CefV8HandleBase : - public base::RefCountedThreadSafe { +class CefV8HandleBase + : public base::RefCountedThreadSafe { public: // Returns true if there is no underlying context or if the underlying context // is valid. @@ -116,8 +115,7 @@ class CefV8HandleBase : // |context| is the context that owns this handle. If empty the current // context will be used. - CefV8HandleBase(v8::Isolate* isolate, - v8::Local context); + CefV8HandleBase(v8::Isolate* isolate, v8::Local context); virtual ~CefV8HandleBase(); protected: @@ -137,23 +135,17 @@ class CefV8Handle : public CefV8HandleBase { CefV8Handle(v8::Isolate* isolate, v8::Local context, handleType v) - : CefV8HandleBase(isolate, context), - handle_(isolate, v) { - } + : CefV8HandleBase(isolate, context), handle_(isolate, v) {} handleType GetNewV8Handle() { DCHECK(IsValid()); return handleType::New(isolate(), handle_); } - persistentType& GetPersistentV8Handle() { - return handle_; - } + persistentType& GetPersistentV8Handle() { return handle_; } protected: - ~CefV8Handle() override { - handle_.Reset(); - } + ~CefV8Handle() override { handle_.Reset(); } persistentType handle_; @@ -163,14 +155,11 @@ class CefV8Handle : public CefV8HandleBase { // Specialization for v8::Value with empty implementation to avoid incorrect // usage. template <> -class CefV8Handle { -}; - +class CefV8Handle {}; class CefV8ContextImpl : public CefV8Context { public: - CefV8ContextImpl(v8::Isolate* isolate, - v8::Local context); + CefV8ContextImpl(v8::Isolate* isolate, v8::Local context); ~CefV8ContextImpl() override; CefRefPtr GetTaskRunner() override; @@ -258,10 +247,12 @@ class CefV8ValueImpl : public CefV8Value { bool DeleteValue(int index) override; CefRefPtr GetValue(const CefString& key) override; CefRefPtr GetValue(int index) override; - bool SetValue(const CefString& key, CefRefPtr value, + bool SetValue(const CefString& key, + CefRefPtr value, PropertyAttribute attribute) override; bool SetValue(int index, CefRefPtr value) override; - bool SetValue(const CefString& key, AccessControl settings, + bool SetValue(const CefString& key, + AccessControl settings, PropertyAttribute attribute) override; bool GetKeys(std::vector& keys) override; bool SetUserData(CefRefPtr user_data) override; @@ -323,7 +314,7 @@ class CefV8ValueImpl : public CefV8Value { }; v8::Isolate* isolate_; - + enum { TYPE_INVALID = 0, TYPE_UNDEFINED, @@ -358,8 +349,7 @@ class CefV8ValueImpl : public CefV8Value { class CefV8StackTraceImpl : public CefV8StackTrace { public: - CefV8StackTraceImpl(v8::Isolate* isolate, - v8::Local handle); + CefV8StackTraceImpl(v8::Isolate* isolate, v8::Local handle); ~CefV8StackTraceImpl() override; bool IsValid() override; @@ -367,7 +357,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace { CefRefPtr GetFrame(int index) override; private: - std::vector > frames_; + std::vector> frames_; IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl); DISALLOW_COPY_AND_ASSIGN(CefV8StackTraceImpl); @@ -375,8 +365,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace { class CefV8StackFrameImpl : public CefV8StackFrame { public: - CefV8StackFrameImpl(v8::Isolate* isolate, - v8::Local handle); + CefV8StackFrameImpl(v8::Isolate* isolate, v8::Local handle); ~CefV8StackFrameImpl() override; bool IsValid() override; diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 592156f9a..d83430221 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -188,12 +188,14 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( if (start_line < 1) start_line = 1; - const blink::KURL kurl = source_url.IsEmpty() ? - blink::KURL() : blink::KURL(blink::kParsedURLString, source_url); + const blink::KURL kurl = + source_url.IsEmpty() ? blink::KURL() + : blink::KURL(blink::kParsedURLString, source_url); - const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(source, kurl, + const blink::ScriptSourceCode ssc = blink::ScriptSourceCode( + source, kurl, WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), - WTF::OrdinalNumber::FromZeroBasedInt(0))); + WTF::OrdinalNumber::FromZeroBasedInt(0))); v8::MaybeLocal result; @@ -206,13 +208,14 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( v8CacheOptions = frame->GetSettings()->GetV8CacheOptions(); v8::Local script; - if (!blink::V8Call(blink::V8ScriptRunner::CompileScript(ssc, isolate, - accessControlStatus, v8CacheOptions), script, tryCatch)) { + if (!blink::V8Call(blink::V8ScriptRunner::CompileScript( + ssc, isolate, accessControlStatus, v8CacheOptions), + script, tryCatch)) { return result; } - result = blink::V8ScriptRunner::RunCompiledScript(isolate, script, - blink::ToExecutionContext(context)); + result = blink::V8ScriptRunner::RunCompiledScript( + isolate, script, blink::ToExecutionContext(context)); } return result; diff --git a/libcef/utility/content_utility_client.cc b/libcef/utility/content_utility_client.cc index 77e1fc265..c80c08d7f 100644 --- a/libcef/utility/content_utility_client.cc +++ b/libcef/utility/content_utility_client.cc @@ -34,11 +34,9 @@ CefContentUtilityClient::CefContentUtilityClient() { #endif } -CefContentUtilityClient::~CefContentUtilityClient() { -} +CefContentUtilityClient::~CefContentUtilityClient() {} -bool CefContentUtilityClient::OnMessageReceived( - const IPC::Message& message) { +bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) { bool handled = false; for (Handlers::iterator it = handlers_.begin(); diff --git a/libcef_dll/base/cef_atomicops_x86_gcc.cc b/libcef_dll/base/cef_atomicops_x86_gcc.cc index 4471eedaf..f3dff5ece 100644 --- a/libcef_dll/base/cef_atomicops_x86_gcc.cc +++ b/libcef_dll/base/cef_atomicops_x86_gcc.cc @@ -20,26 +20,28 @@ // of the global offset table. To avoid breaking such executables, this code // must preserve that register's value across cpuid instructions. #if defined(__i386__) -#define cpuid(a, b, c, d, inp) \ - asm("mov %%ebx, %%edi\n" \ - "cpuid\n" \ - "xchg %%edi, %%ebx\n" \ - : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp)) +#define cpuid(a, b, c, d, inp) \ + asm("mov %%ebx, %%edi\n" \ + "cpuid\n" \ + "xchg %%edi, %%ebx\n" \ + : "=a"(a), "=D"(b), "=c"(c), "=d"(d) \ + : "a"(inp)) #elif defined(__x86_64__) -#define cpuid(a, b, c, d, inp) \ - asm("mov %%rbx, %%rdi\n" \ - "cpuid\n" \ - "xchg %%rdi, %%rbx\n" \ - : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp)) +#define cpuid(a, b, c, d, inp) \ + asm("mov %%rbx, %%rdi\n" \ + "cpuid\n" \ + "xchg %%rdi, %%rbx\n" \ + : "=a"(a), "=D"(b), "=c"(c), "=d"(d) \ + : "a"(inp)) #endif -#if defined(cpuid) // initialize the struct only on x86 +#if defined(cpuid) // initialize the struct only on x86 // Set the flags so that code will run correctly and conservatively, so even // if we haven't been initialized yet, we're probably single threaded, and our // default values should hopefully be pretty safe. struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = { - false, // bug can't exist before process spawns multiple threads + false, // bug can't exist before process spawns multiple threads }; namespace { @@ -62,9 +64,9 @@ void AtomicOps_Internalx86CPUFeaturesInit() { // get feature flags in ecx/edx, and family/model in eax cpuid(eax, ebx, ecx, edx, 1); - int family = (eax >> 8) & 0xf; // family and model fields + int family = (eax >> 8) & 0xf; // family and model fields int model = (eax >> 4) & 0xf; - if (family == 0xf) { // use extended family and model fields + if (family == 0xf) { // use extended family and model fields family += (eax >> 20) & 0xff; model += ((eax >> 16) & 0xf) << 4; } @@ -74,9 +76,8 @@ void AtomicOps_Internalx86CPUFeaturesInit() { // non-locked read-modify-write instruction. Rev F has this bug in // pre-release versions, but not in versions released to customers, // so we test only for Rev E, which is family 15, model 32..63 inclusive. - if (strcmp(vendor, "AuthenticAMD") == 0 && // AMD - family == 15 && - 32 <= model && model <= 63) { + if (strcmp(vendor, "AuthenticAMD") == 0 && // AMD + family == 15 && 32 <= model && model <= 63) { AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true; } else { AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false; @@ -85,9 +86,7 @@ void AtomicOps_Internalx86CPUFeaturesInit() { class AtomicOpsx86Initializer { public: - AtomicOpsx86Initializer() { - AtomicOps_Internalx86CPUFeaturesInit(); - } + AtomicOpsx86Initializer() { AtomicOps_Internalx86CPUFeaturesInit(); } }; // A global to get use initialized on startup via static initialization :/ diff --git a/libcef_dll/base/cef_bind_helpers.cc b/libcef_dll/base/cef_bind_helpers.cc index b65f5f31f..73f48fc47 100644 --- a/libcef_dll/base/cef_bind_helpers.cc +++ b/libcef_dll/base/cef_bind_helpers.cc @@ -8,7 +8,6 @@ namespace base { -void DoNothing() { -} +void DoNothing() {} } // namespace base diff --git a/libcef_dll/base/cef_callback_helpers.cc b/libcef_dll/base/cef_callback_helpers.cc index 726104c7b..624e50933 100644 --- a/libcef_dll/base/cef_callback_helpers.cc +++ b/libcef_dll/base/cef_callback_helpers.cc @@ -8,12 +8,10 @@ namespace base { -ScopedClosureRunner::ScopedClosureRunner() { -} +ScopedClosureRunner::ScopedClosureRunner() {} ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) - : closure_(closure) { -} + : closure_(closure) {} ScopedClosureRunner::~ScopedClosureRunner() { if (!closure_.is_null()) diff --git a/libcef_dll/base/cef_callback_internal.cc b/libcef_dll/base/cef_callback_internal.cc index c1044f649..dead93f11 100644 --- a/libcef_dll/base/cef_callback_internal.cc +++ b/libcef_dll/base/cef_callback_internal.cc @@ -31,13 +31,11 @@ bool CallbackBase::Equals(const CallbackBase& other) const { } CallbackBase::CallbackBase(BindStateBase* bind_state) - : bind_state_(bind_state), - polymorphic_invoke_(NULL) { + : bind_state_(bind_state), polymorphic_invoke_(NULL) { DCHECK(!bind_state_.get() || bind_state_->ref_count_ == 1); } -CallbackBase::~CallbackBase() { -} +CallbackBase::~CallbackBase() {} } // namespace cef_internal } // namespace base diff --git a/libcef_dll/base/cef_lock.cc b/libcef_dll/base/cef_lock.cc index 85253f104..ea2ba3cfa 100644 --- a/libcef_dll/base/cef_lock.cc +++ b/libcef_dll/base/cef_lock.cc @@ -14,8 +14,7 @@ namespace base { namespace cef_internal { -Lock::Lock() : lock_() { -} +Lock::Lock() : lock_() {} Lock::~Lock() { DCHECK(owning_thread_ref_.is_null()); diff --git a/libcef_dll/base/cef_logging.cc b/libcef_dll/base/cef_logging.cc index 7dc37d1a4..2d4cf852b 100644 --- a/libcef_dll/base/cef_logging.cc +++ b/libcef_dll/base/cef_logging.cc @@ -44,13 +44,13 @@ namespace { // glibc has two strerror_r functions: a historical GNU-specific one that // returns type char *, and a POSIX.1-2001 compliant one available since 2.3.4 // that returns int. This wraps the GNU-specific one. -static void POSSIBLY_UNUSED wrap_posix_strerror_r( - char *(*strerror_r_ptr)(int, char *, size_t), - int err, - char *buf, - size_t len) { +static void POSSIBLY_UNUSED +wrap_posix_strerror_r(char* (*strerror_r_ptr)(int, char*, size_t), + int err, + char* buf, + size_t len) { // GNU version. - char *rc = (*strerror_r_ptr)(err, buf, len); + char* rc = (*strerror_r_ptr)(err, buf, len); if (rc != buf) { // glibc did not use buf and returned a static string instead. Copy it // into buf. @@ -67,11 +67,12 @@ static void POSSIBLY_UNUSED wrap_posix_strerror_r( // guarantee that they are handled. This is compiled on all POSIX platforms, but // it will only be used on Linux if the POSIX strerror_r implementation is // being used (see below). -static void POSSIBLY_UNUSED wrap_posix_strerror_r( - int (*strerror_r_ptr)(int, char *, size_t), - int err, - char *buf, - size_t len) { +static void POSSIBLY_UNUSED wrap_posix_strerror_r(int (*strerror_r_ptr)(int, + char*, + size_t), + int err, + char* buf, + size_t len) { int old_errno = errno; // Have to cast since otherwise we get an error if this is the GNU version // (but in such a scenario this function is never called). Sadly we can't use @@ -103,16 +104,13 @@ static void POSSIBLY_UNUSED wrap_posix_strerror_r( strerror_error = result; } // snprintf truncates and always null-terminates. - snprintf(buf, - len, - "Error %d while retrieving error %d", - strerror_error, + snprintf(buf, len, "Error %d while retrieving error %d", strerror_error, err); } errno = old_errno; } -void safe_strerror_r(int err, char *buf, size_t len) { +void safe_strerror_r(int err, char* buf, size_t len) { if (buf == NULL || len <= 0) { return; } @@ -136,21 +134,29 @@ std::string safe_strerror(int err) { // MSVC doesn't like complex extern templates and DLLs. #if !defined(COMPILER_MSVC) // Explicit instantiations for commonly used comparisons. -template std::string* MakeCheckOpString( - const int&, const int&, const char* names); +template std::string* MakeCheckOpString(const int&, + const int&, + const char* names); template std::string* MakeCheckOpString( - const unsigned long&, const unsigned long&, const char* names); + const unsigned long&, + const unsigned long&, + const char* names); template std::string* MakeCheckOpString( - const unsigned long&, const unsigned int&, const char* names); + const unsigned long&, + const unsigned int&, + const char* names); template std::string* MakeCheckOpString( - const unsigned int&, const unsigned long&, const char* names); + const unsigned int&, + const unsigned long&, + const char* names); template std::string* MakeCheckOpString( - const std::string&, const std::string&, const char* name); + const std::string&, + const std::string&, + const char* name); #endif #if defined(OS_WIN) -LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { -} +LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) {} LogMessage::SaveLastError::~SaveLastError() { ::SetLastError(last_error_); @@ -158,8 +164,7 @@ LogMessage::SaveLastError::~SaveLastError() { #endif // defined(OS_WIN) LogMessage::LogMessage(const char* file, int line, LogSeverity severity) - : severity_(severity), file_(file), line_(line) { -} + : severity_(severity), file_(file), line_(line) {} LogMessage::LogMessage(const char* file, int line, std::string* result) : severity_(LOG_FATAL), file_(file), line_(line) { @@ -167,7 +172,9 @@ LogMessage::LogMessage(const char* file, int line, std::string* result) delete result; } -LogMessage::LogMessage(const char* file, int line, LogSeverity severity, +LogMessage::LogMessage(const char* file, + int line, + LogSeverity severity, std::string* result) : severity_(severity), file_(file), line_(line) { stream_ << "Check failed: " << *result; @@ -211,8 +218,8 @@ std::string SystemErrorCodeToString(SystemErrorCode error_code) { s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end()); ss << s << " (0x" << std::hex << error_code << ")"; } else { - ss << "Error (0x" << std::hex << GetLastError() << - ") while retrieving error. (0x" << error_code << ")"; + ss << "Error (0x" << std::hex << GetLastError() + << ") while retrieving error. (0x" << error_code << ")"; } return ss.str(); } @@ -229,9 +236,7 @@ Win32ErrorLogMessage::Win32ErrorLogMessage(const char* file, int line, LogSeverity severity, SystemErrorCode err) - : err_(err), - log_message_(file, line, severity) { -} + : err_(err), log_message_(file, line, severity) {} Win32ErrorLogMessage::~Win32ErrorLogMessage() { stream() << ": " << SystemErrorCodeToString(err_); @@ -241,9 +246,7 @@ ErrnoLogMessage::ErrnoLogMessage(const char* file, int line, LogSeverity severity, SystemErrorCode err) - : err_(err), - log_message_(file, line, severity) { -} + : err_(err), log_message_(file, line, severity) {} ErrnoLogMessage::~ErrnoLogMessage() { stream() << ": " << SystemErrorCodeToString(err_); diff --git a/libcef_dll/base/cef_string16.cc b/libcef_dll/base/cef_string16.cc index 2e5f0b820..1a0c34e64 100644 --- a/libcef_dll/base/cef_string16.cc +++ b/libcef_dll/base/cef_string16.cc @@ -35,7 +35,7 @@ int c16memcmp(const char16* s1, const char16* s2, size_t n) { } size_t c16len(const char16* s) { - const char16 *s_orig = s; + const char16* s_orig = s; while (*s) { ++s; } @@ -61,7 +61,7 @@ char16* c16memcpy(char16* s1, const char16* s2, size_t n) { } char16* c16memset(char16* s, char16 c, size_t n) { - char16 *s_orig = s; + char16* s_orig = s; while (n-- > 0) { *s = c; ++s; diff --git a/libcef_dll/base/cef_thread_checker_impl.cc b/libcef_dll/base/cef_thread_checker_impl.cc index 65e884ef4..4f5a9b0d0 100644 --- a/libcef_dll/base/cef_thread_checker_impl.cc +++ b/libcef_dll/base/cef_thread_checker_impl.cc @@ -7,8 +7,7 @@ namespace base { namespace cef_internal { -ThreadCheckerImpl::ThreadCheckerImpl() - : valid_thread_id_() { +ThreadCheckerImpl::ThreadCheckerImpl() : valid_thread_id_() { EnsureThreadIdAssigned(); } diff --git a/libcef_dll/base/cef_thread_collision_warner.cc b/libcef_dll/base/cef_thread_collision_warner.cc index 794ab64a4..13d2341bb 100644 --- a/libcef_dll/base/cef_thread_collision_warner.cc +++ b/libcef_dll/base/cef_thread_collision_warner.cc @@ -31,9 +31,8 @@ void ThreadCollisionWarner::EnterSelf() { // write on valid_thread_id_ the current thread ID. subtle::Atomic32 current_thread_id = CurrentThread(); - int previous_value = subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, - 0, - current_thread_id); + int previous_value = + subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, 0, current_thread_id); if (previous_value != 0 && previous_value != current_thread_id) { // gotcha! a thread is trying to use the same class and that is // not current thread. @@ -46,8 +45,7 @@ void ThreadCollisionWarner::EnterSelf() { void ThreadCollisionWarner::Enter() { subtle::Atomic32 current_thread_id = CurrentThread(); - if (subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, - 0, + if (subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, 0, current_thread_id) != 0) { // gotcha! another thread is trying to use the same class. asserter_->warn(); diff --git a/libcef_dll/base/cef_weak_ptr.cc b/libcef_dll/base/cef_weak_ptr.cc index 3c83a490e..3e52831cd 100644 --- a/libcef_dll/base/cef_weak_ptr.cc +++ b/libcef_dll/base/cef_weak_ptr.cc @@ -28,22 +28,19 @@ bool WeakReference::Flag::IsValid() const { return is_valid_; } -WeakReference::Flag::~Flag() { +WeakReference::Flag::~Flag() {} + +WeakReference::WeakReference() {} + +WeakReference::WeakReference(const Flag* flag) : flag_(flag) {} + +WeakReference::~WeakReference() {} + +bool WeakReference::is_valid() const { + return flag_.get() && flag_->IsValid(); } -WeakReference::WeakReference() { -} - -WeakReference::WeakReference(const Flag* flag) : flag_(flag) { -} - -WeakReference::~WeakReference() { -} - -bool WeakReference::is_valid() const { return flag_.get() && flag_->IsValid(); } - -WeakReferenceOwner::WeakReferenceOwner() { -} +WeakReferenceOwner::WeakReferenceOwner() {} WeakReferenceOwner::~WeakReferenceOwner() { Invalidate(); @@ -64,14 +61,11 @@ void WeakReferenceOwner::Invalidate() { } } -WeakPtrBase::WeakPtrBase() { -} +WeakPtrBase::WeakPtrBase() {} -WeakPtrBase::~WeakPtrBase() { -} +WeakPtrBase::~WeakPtrBase() {} -WeakPtrBase::WeakPtrBase(const WeakReference& ref) : ref_(ref) { -} +WeakPtrBase::WeakPtrBase(const WeakReference& ref) : ref_(ref) {} } // namespace cef_internal } // namespace base diff --git a/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc b/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc index cacc01a70..4077908a6 100644 --- a/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fa03e8ba9a443a9028246fe21a8995d8a7bdb7d5$ +// #include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h" #include "libcef_dll/ctocpp/value_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK accessibility_handler_on_accessibility_tree_change( - struct _cef_accessibility_handler_t* self, struct _cef_value_t* value) { + struct _cef_accessibility_handler_t* self, + struct _cef_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -36,7 +38,8 @@ void CEF_CALLBACK accessibility_handler_on_accessibility_tree_change( } void CEF_CALLBACK accessibility_handler_on_accessibility_location_change( - struct _cef_accessibility_handler_t* self, struct _cef_value_t* value) { + struct _cef_accessibility_handler_t* self, + struct _cef_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -54,7 +57,6 @@ void CEF_CALLBACK accessibility_handler_on_accessibility_location_change( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefAccessibilityHandlerCppToC::CefAccessibilityHandlerCppToC() { @@ -64,18 +66,27 @@ CefAccessibilityHandlerCppToC::CefAccessibilityHandlerCppToC() { accessibility_handler_on_accessibility_location_change; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_accessibility_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefAccessibilityHandlerCppToC, + CefAccessibilityHandler, + cef_accessibility_handler_t>::UnwrapDerived(CefWrapperType type, + cef_accessibility_handler_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_ACCESSIBILITY_HANDLER; diff --git a/libcef_dll/cpptoc/accessibility_handler_cpptoc.h b/libcef_dll/cpptoc/accessibility_handler_cpptoc.h index 4ec8d228c..08a11d3f2 100644 --- a/libcef_dll/cpptoc/accessibility_handler_cpptoc.h +++ b/libcef_dll/cpptoc/accessibility_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a3b83c6f6147f67affbd076d6eb6cb65119a9159$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_ACCESSIBILITY_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_ACCESSIBILITY_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_accessibility_handler.h" #include "include/capi/cef_accessibility_handler_capi.h" +#include "include/cef_accessibility_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefAccessibilityHandlerCppToC : public CefCppToCRefCounted { + CefAccessibilityHandler, + cef_accessibility_handler_t> { public: CefAccessibilityHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc index cd786f5d7..0485f09e7 100644 --- a/libcef_dll/cpptoc/app_cpptoc.cc +++ b/libcef_dll/cpptoc/app_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9f5778bffbd8c25b6f4ee2e7ec06e9eca5f9f48d$ +// #include "libcef_dll/cpptoc/app_cpptoc.h" #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" @@ -17,12 +19,12 @@ #include "libcef_dll/ctocpp/command_line_ctocpp.h" #include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK app_on_before_command_line_processing(struct _cef_app_t* self, +void CEF_CALLBACK app_on_before_command_line_processing( + struct _cef_app_t* self, const cef_string_t* process_type, struct _cef_command_line_t* command_line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -38,12 +40,12 @@ void CEF_CALLBACK app_on_before_command_line_processing(struct _cef_app_t* self, // Execute CefAppCppToC::Get(self)->OnBeforeCommandLineProcessing( - CefString(process_type), - CefCommandLineCToCpp::Wrap(command_line)); + CefString(process_type), CefCommandLineCToCpp::Wrap(command_line)); } -void CEF_CALLBACK app_on_register_custom_schemes(struct _cef_app_t* self, - struct _cef_scheme_registrar_t* registrar) { +void CEF_CALLBACK +app_on_register_custom_schemes(struct _cef_app_t* self, + struct _cef_scheme_registrar_t* registrar) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -55,16 +57,15 @@ void CEF_CALLBACK app_on_register_custom_schemes(struct _cef_app_t* self, return; // Translate param: registrar; type: rawptr_diff - CefOwnPtr registrarPtr(CefSchemeRegistrarCToCpp::Wrap( - registrar)); + CefOwnPtr registrarPtr( + CefSchemeRegistrarCToCpp::Wrap(registrar)); // Execute - CefAppCppToC::Get(self)->OnRegisterCustomSchemes( - registrarPtr.get()); + CefAppCppToC::Get(self)->OnRegisterCustomSchemes(registrarPtr.get()); } -struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_handler( - struct _cef_app_t* self) { +struct _cef_resource_bundle_handler_t* CEF_CALLBACK +app_get_resource_bundle_handler(struct _cef_app_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -72,15 +73,15 @@ struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_hand return NULL; // Execute - CefRefPtr _retval = CefAppCppToC::Get( - self)->GetResourceBundleHandler(); + CefRefPtr _retval = + CefAppCppToC::Get(self)->GetResourceBundleHandler(); // Return type: refptr_same return CefResourceBundleHandlerCppToC::Wrap(_retval); } -struct _cef_browser_process_handler_t* CEF_CALLBACK app_get_browser_process_handler( - struct _cef_app_t* self) { +struct _cef_browser_process_handler_t* CEF_CALLBACK +app_get_browser_process_handler(struct _cef_app_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,15 +89,15 @@ struct _cef_browser_process_handler_t* CEF_CALLBACK app_get_browser_process_hand return NULL; // Execute - CefRefPtr _retval = CefAppCppToC::Get( - self)->GetBrowserProcessHandler(); + CefRefPtr _retval = + CefAppCppToC::Get(self)->GetBrowserProcessHandler(); // Return type: refptr_same return CefBrowserProcessHandlerCppToC::Wrap(_retval); } -struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handler( - struct _cef_app_t* self) { +struct _cef_render_process_handler_t* CEF_CALLBACK +app_get_render_process_handler(struct _cef_app_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,8 +105,8 @@ struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handle return NULL; // Execute - CefRefPtr _retval = CefAppCppToC::Get( - self)->GetRenderProcessHandler(); + CefRefPtr _retval = + CefAppCppToC::Get(self)->GetRenderProcessHandler(); // Return type: refptr_same return CefRenderProcessHandlerCppToC::Wrap(_retval); @@ -113,7 +114,6 @@ struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handle } // namespace - // CONSTRUCTOR - Do not edit by hand. CefAppCppToC::CefAppCppToC() { @@ -125,16 +125,21 @@ CefAppCppToC::CefAppCppToC() { GetStruct()->get_render_process_handler = app_get_render_process_handler; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_app_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_app_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_APP; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = WT_APP; diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h index 194308582..a635b8424 100644 --- a/libcef_dll/cpptoc/app_cpptoc.h +++ b/libcef_dll/cpptoc/app_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d584a988913aee077d1e99f919d02524133d299e$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_app.h" #include "include/capi/cef_app_capi.h" +#include "include/cef_app.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.cc b/libcef_dll/cpptoc/auth_callback_cpptoc.cc index 9ca31259a..64f546853 100644 --- a/libcef_dll/cpptoc/auth_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/auth_callback_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bffdd556dc95e464816b9aa0c8b46e7fadd89e5d$ +// #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK auth_callback_cont(struct _cef_auth_callback_t* self, - const cef_string_t* username, const cef_string_t* password) { + const cef_string_t* username, + const cef_string_t* password) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,9 +33,8 @@ void CEF_CALLBACK auth_callback_cont(struct _cef_auth_callback_t* self, // Unverified params: password // Execute - CefAuthCallbackCppToC::Get(self)->Continue( - CefString(username), - CefString(password)); + CefAuthCallbackCppToC::Get(self)->Continue(CefString(username), + CefString(password)); } void CEF_CALLBACK auth_callback_cancel(struct _cef_auth_callback_t* self) { @@ -49,7 +50,6 @@ void CEF_CALLBACK auth_callback_cancel(struct _cef_auth_callback_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefAuthCallbackCppToC::CefAuthCallbackCppToC() { @@ -57,17 +57,25 @@ CefAuthCallbackCppToC::CefAuthCallbackCppToC() { GetStruct()->cancel = auth_callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_auth_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefAuthCallbackCppToC, + CefAuthCallback, + cef_auth_callback_t>::UnwrapDerived(CefWrapperType type, + cef_auth_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_AUTH_CALLBACK; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_AUTH_CALLBACK; diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.h b/libcef_dll/cpptoc/auth_callback_cpptoc.h index f61b038c8..1b8b86b90 100644 --- a/libcef_dll/cpptoc/auth_callback_cpptoc.h +++ b/libcef_dll/cpptoc/auth_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e06b1addaaf2c8ddd13278a75ece4481e0f949c3$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_AUTH_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_AUTH_CALLBACK_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_auth_callback.h" #include "include/capi/cef_auth_callback_capi.h" +#include "include/cef_auth_callback.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefAuthCallbackCppToC - : public CefCppToCRefCounted { +class CefAuthCallbackCppToC : public CefCppToCRefCounted { public: CefAuthCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc b/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc index 8a528b344..aabeb80bd 100644 --- a/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc +++ b/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc @@ -4,21 +4,28 @@ #include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h" -CefBaseRefCountedCppToC::CefBaseRefCountedCppToC() { -} +CefBaseRefCountedCppToC::CefBaseRefCountedCppToC() {} -template<> CefRefPtr CefCppToCRefCounted< - CefBaseRefCountedCppToC, CefBaseRefCounted, cef_base_ref_counted_t>:: - UnwrapDerived(CefWrapperType type, cef_base_ref_counted_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefBaseRefCountedCppToC, + CefBaseRefCounted, + cef_base_ref_counted_t>::UnwrapDerived(CefWrapperType type, + cef_base_ref_counted_t* s) { NOTREACHED(); return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BASE_REF_COUNTED; diff --git a/libcef_dll/cpptoc/base_ref_counted_cpptoc.h b/libcef_dll/cpptoc/base_ref_counted_cpptoc.h index c3b845ec1..a8e1eb1ff 100644 --- a/libcef_dll/cpptoc/base_ref_counted_cpptoc.h +++ b/libcef_dll/cpptoc/base_ref_counted_cpptoc.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_DLL_CPPTOC_BASE_REF_COUNTED_CPPTOC_H_ #pragma once -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" #if !defined(WRAPPING_CEF_SHARED) @@ -16,7 +16,8 @@ // Wrap a C++ class with a C structure. class CefBaseRefCountedCppToC - : public CefCppToCRefCounted { public: CefBaseRefCountedCppToC(); diff --git a/libcef_dll/cpptoc/base_scoped_cpptoc.cc b/libcef_dll/cpptoc/base_scoped_cpptoc.cc index 7ae2d3303..fd46a1437 100644 --- a/libcef_dll/cpptoc/base_scoped_cpptoc.cc +++ b/libcef_dll/cpptoc/base_scoped_cpptoc.cc @@ -4,17 +4,18 @@ #include "libcef_dll/cpptoc/base_scoped_cpptoc.h" -CefBaseScopedCppToC::CefBaseScopedCppToC() { -} +CefBaseScopedCppToC::CefBaseScopedCppToC() {} -template<> CefOwnPtr +template <> +CefOwnPtr CefCppToCScoped:: UnwrapDerivedOwn(CefWrapperType type, cef_base_scoped_t* s) { NOTREACHED(); return CefOwnPtr(); } -template<> CefRawPtr +template <> +CefRawPtr CefCppToCScoped:: UnwrapDerivedRaw(CefWrapperType type, cef_base_scoped_t* s) { NOTREACHED(); @@ -22,9 +23,14 @@ CefCppToCScoped:: } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = WT_BASE_SCOPED; +template <> +CefWrapperType CefCppToCScoped::kWrapperType = + WT_BASE_SCOPED; diff --git a/libcef_dll/cpptoc/base_scoped_cpptoc.h b/libcef_dll/cpptoc/base_scoped_cpptoc.h index 4d72763ee..63a66883d 100644 --- a/libcef_dll/cpptoc/base_scoped_cpptoc.h +++ b/libcef_dll/cpptoc/base_scoped_cpptoc.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ #pragma once -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" #if !defined(WRAPPING_CEF_SHARED) @@ -15,9 +15,9 @@ #endif // Wrap a C++ class with a C structure. -class CefBaseScopedCppToC - : public CefCppToCScoped { +class CefBaseScopedCppToC : public CefCppToCScoped { public: CefBaseScopedCppToC(); }; diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc index 9ecc06dfa..9d9c2224d 100644 --- a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a904d37178d2bce73fdd6937cefa9f70dc352038$ +// #include "libcef_dll/cpptoc/before_download_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK before_download_callback_cont( - struct _cef_before_download_callback_t* self, - const cef_string_t* download_path, int show_dialog) { +void CEF_CALLBACK +before_download_callback_cont(struct _cef_before_download_callback_t* self, + const cef_string_t* download_path, + int show_dialog) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,32 +31,38 @@ void CEF_CALLBACK before_download_callback_cont( // Execute CefBeforeDownloadCallbackCppToC::Get(self)->Continue( - CefString(download_path), - show_dialog?true:false); + CefString(download_path), show_dialog ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBeforeDownloadCallbackCppToC::CefBeforeDownloadCallbackCppToC() { GetStruct()->cont = before_download_callback_cont; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_before_download_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_before_download_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_BEFORE_DOWNLOAD_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_BEFORE_DOWNLOAD_CALLBACK; diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.h b/libcef_dll/cpptoc/before_download_callback_cpptoc.h index 97ff7ad68..93299fc59 100644 --- a/libcef_dll/cpptoc/before_download_callback_cpptoc.h +++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=38489749c57028ee0c8989899826f866eab24aea$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_BEFORE_DOWNLOAD_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_BEFORE_DOWNLOAD_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefBeforeDownloadCallbackCppToC : public CefCppToCRefCounted { + CefBeforeDownloadCallback, + cef_before_download_callback_t> { public: CefBeforeDownloadCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.cc b/libcef_dll/cpptoc/binary_value_cpptoc.cc index 89c868dcb..4861391ac 100644 --- a/libcef_dll/cpptoc/binary_value_cpptoc.cc +++ b/libcef_dll/cpptoc/binary_value_cpptoc.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3bb896234f1b9fc0ee14f936f28b6585a82502db$ +// #include "libcef_dll/cpptoc/binary_value_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, - size_t data_size) { + size_t data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -25,15 +26,12 @@ CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, return NULL; // Execute - CefRefPtr _retval = CefBinaryValue::Create( - data, - data_size); + CefRefPtr _retval = CefBinaryValue::Create(data, data_size); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -67,7 +65,7 @@ int CEF_CALLBACK binary_value_is_owned(struct _cef_binary_value_t* self) { } int CEF_CALLBACK binary_value_is_same(struct _cef_binary_value_t* self, - struct _cef_binary_value_t* that) { + struct _cef_binary_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,7 +85,7 @@ int CEF_CALLBACK binary_value_is_same(struct _cef_binary_value_t* self, } int CEF_CALLBACK binary_value_is_equal(struct _cef_binary_value_t* self, - struct _cef_binary_value_t* that) { + struct _cef_binary_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -106,8 +104,8 @@ int CEF_CALLBACK binary_value_is_equal(struct _cef_binary_value_t* self, return _retval; } -struct _cef_binary_value_t* CEF_CALLBACK binary_value_copy( - struct _cef_binary_value_t* self) { +struct _cef_binary_value_t* CEF_CALLBACK +binary_value_copy(struct _cef_binary_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -136,7 +134,9 @@ size_t CEF_CALLBACK binary_value_get_size(struct _cef_binary_value_t* self) { } size_t CEF_CALLBACK binary_value_get_data(struct _cef_binary_value_t* self, - void* buffer, size_t buffer_size, size_t data_offset) { + void* buffer, + size_t buffer_size, + size_t data_offset) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,10 +148,8 @@ size_t CEF_CALLBACK binary_value_get_data(struct _cef_binary_value_t* self, return 0; // Execute - size_t _retval = CefBinaryValueCppToC::Get(self)->GetData( - buffer, - buffer_size, - data_offset); + size_t _retval = CefBinaryValueCppToC::Get(self)->GetData(buffer, buffer_size, + data_offset); // Return type: simple return _retval; @@ -159,7 +157,6 @@ size_t CEF_CALLBACK binary_value_get_data(struct _cef_binary_value_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBinaryValueCppToC::CefBinaryValueCppToC() { @@ -172,17 +169,23 @@ CefBinaryValueCppToC::CefBinaryValueCppToC() { GetStruct()->get_data = binary_value_get_data; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_binary_value_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_binary_value_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BINARY_VALUE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_BINARY_VALUE; diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.h b/libcef_dll/cpptoc/binary_value_cpptoc.h index 5d5081706..3abd96502 100644 --- a/libcef_dll/cpptoc/binary_value_cpptoc.h +++ b/libcef_dll/cpptoc/binary_value_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c97277909b83548acb27b8e1e2fafd99cb715d20$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_BINARY_VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_BINARY_VALUE_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefBinaryValueCppToC - : public CefCppToCRefCounted { +class CefBinaryValueCppToC : public CefCppToCRefCounted { public: CefBinaryValueCppToC(); }; diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index 4be108440..8bee68cea 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a5b87e4e7e656c8643febf4afb3d1bd3f06c7ac0$ +// #include #include "libcef_dll/cpptoc/browser_cpptoc.h" @@ -17,13 +19,12 @@ #include "libcef_dll/cpptoc/process_message_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -struct _cef_browser_host_t* CEF_CALLBACK browser_get_host( - struct _cef_browser_t* self) { +struct _cef_browser_host_t* CEF_CALLBACK +browser_get_host(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -149,7 +150,7 @@ int CEF_CALLBACK browser_get_identifier(struct _cef_browser_t* self) { } int CEF_CALLBACK browser_is_same(struct _cef_browser_t* self, - struct _cef_browser_t* that) { + struct _cef_browser_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -161,8 +162,8 @@ int CEF_CALLBACK browser_is_same(struct _cef_browser_t* self, return 0; // Execute - bool _retval = CefBrowserCppToC::Get(self)->IsSame( - CefBrowserCppToC::Unwrap(that)); + bool _retval = + CefBrowserCppToC::Get(self)->IsSame(CefBrowserCppToC::Unwrap(that)); // Return type: bool return _retval; @@ -196,8 +197,8 @@ int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) { return _retval; } -struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( - struct _cef_browser_t* self) { +struct _cef_frame_t* CEF_CALLBACK +browser_get_main_frame(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -211,8 +212,8 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( return CefFrameCppToC::Wrap(_retval); } -struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( - struct _cef_browser_t* self) { +struct _cef_frame_t* CEF_CALLBACK +browser_get_focused_frame(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -226,8 +227,8 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( return CefFrameCppToC::Wrap(_retval); } -struct _cef_frame_t* CEF_CALLBACK browser_get_frame_byident( - struct _cef_browser_t* self, int64 identifier) { +struct _cef_frame_t* CEF_CALLBACK +browser_get_frame_byident(struct _cef_browser_t* self, int64 identifier) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -235,15 +236,15 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame_byident( return NULL; // Execute - CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetFrame( - identifier); + CefRefPtr _retval = + CefBrowserCppToC::Get(self)->GetFrame(identifier); // Return type: refptr_same return CefFrameCppToC::Wrap(_retval); } struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -252,8 +253,8 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, // Unverified params: name // Execute - CefRefPtr _retval = CefBrowserCppToC::Get(self)->GetFrame( - CefString(name)); + CefRefPtr _retval = + CefBrowserCppToC::Get(self)->GetFrame(CefString(name)); // Return type: refptr_same return CefFrameCppToC::Wrap(_retval); @@ -274,7 +275,8 @@ size_t CEF_CALLBACK browser_get_frame_count(struct _cef_browser_t* self) { } void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, - size_t* identifiersCount, int64* identifiers) { + size_t* identifiersCount, + int64* identifiers) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -286,7 +288,7 @@ void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, return; // Translate param: identifiers; type: simple_vec_byref - std::vector identifiersList; + std::vector identifiersList; if (identifiersCount && *identifiersCount > 0 && identifiers) { for (size_t i = 0; i < *identifiersCount; ++i) { identifiersList.push_back(identifiers[i]); @@ -294,8 +296,7 @@ void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, } // Execute - CefBrowserCppToC::Get(self)->GetFrameIdentifiers( - identifiersList); + CefBrowserCppToC::Get(self)->GetFrameIdentifiers(identifiersList); // Restore param: identifiers; type: simple_vec_byref if (identifiersCount && identifiers) { @@ -309,7 +310,7 @@ void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, } void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, - cef_string_list_t names) { + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -325,16 +326,17 @@ void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, transfer_string_list_contents(names, namesList); // Execute - CefBrowserCppToC::Get(self)->GetFrameNames( - namesList); + CefBrowserCppToC::Get(self)->GetFrameNames(namesList); // Restore param: names; type: string_vec_byref cef_string_list_clear(names); transfer_string_list_contents(namesList, names); } -int CEF_CALLBACK browser_send_process_message(struct _cef_browser_t* self, - cef_process_id_t target_process, struct _cef_process_message_t* message) { +int CEF_CALLBACK +browser_send_process_message(struct _cef_browser_t* self, + cef_process_id_t target_process, + struct _cef_process_message_t* message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -347,8 +349,7 @@ int CEF_CALLBACK browser_send_process_message(struct _cef_browser_t* self, // Execute bool _retval = CefBrowserCppToC::Get(self)->SendProcessMessage( - target_process, - CefProcessMessageCppToC::Unwrap(message)); + target_process, CefProcessMessageCppToC::Unwrap(message)); // Return type: bool return _retval; @@ -356,7 +357,6 @@ int CEF_CALLBACK browser_send_process_message(struct _cef_browser_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBrowserCppToC::CefBrowserCppToC() { @@ -383,17 +383,23 @@ CefBrowserCppToC::CefBrowserCppToC() { GetStruct()->send_process_message = browser_send_process_message; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_browser_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER; diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h index 17c1a8717..61a98d8f2 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.h +++ b/libcef_dll/cpptoc/browser_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8c208aa0b90c19b4c8b4436af2ce19f27a94806c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ @@ -18,10 +20,10 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.cc b/libcef_dll/cpptoc/browser_host_cpptoc.cc index 450a92990..08d357cba 100644 --- a/libcef_dll/cpptoc/browser_host_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_host_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=63aa1967a233a66852969c1e72ecd0c12e69105b$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/browser_host_cpptoc.h" @@ -22,12 +24,13 @@ #include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT int cef_browser_host_create_browser( - const cef_window_info_t* windowInfo, struct _cef_client_t* client, - const cef_string_t* url, const struct _cef_browser_settings_t* settings, + const cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const cef_string_t* url, + const struct _cef_browser_settings_t* settings, struct _cef_request_context_t* request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -52,10 +55,7 @@ CEF_EXPORT int cef_browser_host_create_browser( // Execute bool _retval = CefBrowserHost::CreateBrowser( - windowInfoObj, - CefClientCToCpp::Wrap(client), - CefString(url), - settingsObj, + windowInfoObj, CefClientCToCpp::Wrap(client), CefString(url), settingsObj, CefRequestContextCppToC::Unwrap(request_context)); // Return type: bool @@ -63,8 +63,10 @@ CEF_EXPORT int cef_browser_host_create_browser( } CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( - const cef_window_info_t* windowInfo, struct _cef_client_t* client, - const cef_string_t* url, const struct _cef_browser_settings_t* settings, + const cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const cef_string_t* url, + const struct _cef_browser_settings_t* settings, struct _cef_request_context_t* request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -89,23 +91,19 @@ CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( // Execute CefRefPtr _retval = CefBrowserHost::CreateBrowserSync( - windowInfoObj, - CefClientCToCpp::Wrap(client), - CefString(url), - settingsObj, + windowInfoObj, CefClientCToCpp::Wrap(client), CefString(url), settingsObj, CefRequestContextCppToC::Unwrap(request_context)); // Return type: refptr_same return CefBrowserCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_browser_t* CEF_CALLBACK browser_host_get_browser( - struct _cef_browser_host_t* self) { +cef_browser_t* CEF_CALLBACK +browser_host_get_browser(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,7 +118,7 @@ cef_browser_t* CEF_CALLBACK browser_host_get_browser( } void CEF_CALLBACK browser_host_close_browser(struct _cef_browser_host_t* self, - int force_close) { + int force_close) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,12 +126,11 @@ void CEF_CALLBACK browser_host_close_browser(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->CloseBrowser( - force_close?true:false); + CefBrowserHostCppToC::Get(self)->CloseBrowser(force_close ? true : false); } -int CEF_CALLBACK browser_host_try_close_browser( - struct _cef_browser_host_t* self) { +int CEF_CALLBACK +browser_host_try_close_browser(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,7 +145,7 @@ int CEF_CALLBACK browser_host_try_close_browser( } void CEF_CALLBACK browser_host_set_focus(struct _cef_browser_host_t* self, - int focus) { + int focus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -156,12 +153,11 @@ void CEF_CALLBACK browser_host_set_focus(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->SetFocus( - focus?true:false); + CefBrowserHostCppToC::Get(self)->SetFocus(focus ? true : false); } -cef_window_handle_t CEF_CALLBACK browser_host_get_window_handle( - struct _cef_browser_host_t* self) { +cef_window_handle_t CEF_CALLBACK +browser_host_get_window_handle(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -169,15 +165,15 @@ cef_window_handle_t CEF_CALLBACK browser_host_get_window_handle( return kNullWindowHandle; // Execute - cef_window_handle_t _retval = CefBrowserHostCppToC::Get( - self)->GetWindowHandle(); + cef_window_handle_t _retval = + CefBrowserHostCppToC::Get(self)->GetWindowHandle(); // Return type: simple return _retval; } -cef_window_handle_t CEF_CALLBACK browser_host_get_opener_window_handle( - struct _cef_browser_host_t* self) { +cef_window_handle_t CEF_CALLBACK +browser_host_get_opener_window_handle(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,8 +181,8 @@ cef_window_handle_t CEF_CALLBACK browser_host_get_opener_window_handle( return kNullWindowHandle; // Execute - cef_window_handle_t _retval = CefBrowserHostCppToC::Get( - self)->GetOpenerWindowHandle(); + cef_window_handle_t _retval = + CefBrowserHostCppToC::Get(self)->GetOpenerWindowHandle(); // Return type: simple return _retval; @@ -206,8 +202,8 @@ int CEF_CALLBACK browser_host_has_view(struct _cef_browser_host_t* self) { return _retval; } -struct _cef_client_t* CEF_CALLBACK browser_host_get_client( - struct _cef_browser_host_t* self) { +struct _cef_client_t* CEF_CALLBACK +browser_host_get_client(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -221,8 +217,8 @@ struct _cef_client_t* CEF_CALLBACK browser_host_get_client( return CefClientCToCpp::Unwrap(_retval); } -struct _cef_request_context_t* CEF_CALLBACK browser_host_get_request_context( - struct _cef_browser_host_t* self) { +struct _cef_request_context_t* CEF_CALLBACK +browser_host_get_request_context(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -230,15 +226,15 @@ struct _cef_request_context_t* CEF_CALLBACK browser_host_get_request_context( return NULL; // Execute - CefRefPtr _retval = CefBrowserHostCppToC::Get( - self)->GetRequestContext(); + CefRefPtr _retval = + CefBrowserHostCppToC::Get(self)->GetRequestContext(); // Return type: refptr_same return CefRequestContextCppToC::Wrap(_retval); } -double CEF_CALLBACK browser_host_get_zoom_level( - struct _cef_browser_host_t* self) { +double CEF_CALLBACK +browser_host_get_zoom_level(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,7 +249,7 @@ double CEF_CALLBACK browser_host_get_zoom_level( } void CEF_CALLBACK browser_host_set_zoom_level(struct _cef_browser_host_t* self, - double zoomLevel) { + double zoomLevel) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -261,14 +257,17 @@ void CEF_CALLBACK browser_host_set_zoom_level(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->SetZoomLevel( - zoomLevel); + CefBrowserHostCppToC::Get(self)->SetZoomLevel(zoomLevel); } -void CEF_CALLBACK browser_host_run_file_dialog(struct _cef_browser_host_t* self, - cef_file_dialog_mode_t mode, const cef_string_t* title, - const cef_string_t* default_file_path, cef_string_list_t accept_filters, - int selected_accept_filter, cef_run_file_dialog_callback_t* callback) { +void CEF_CALLBACK +browser_host_run_file_dialog(struct _cef_browser_host_t* self, + cef_file_dialog_mode_t mode, + const cef_string_t* title, + const cef_string_t* default_file_path, + cef_string_list_t accept_filters, + int selected_accept_filter, + cef_run_file_dialog_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -290,16 +289,12 @@ void CEF_CALLBACK browser_host_run_file_dialog(struct _cef_browser_host_t* self, // Execute CefBrowserHostCppToC::Get(self)->RunFileDialog( - mode, - CefString(title), - CefString(default_file_path), - accept_filtersList, - selected_accept_filter, - CefRunFileDialogCallbackCToCpp::Wrap(callback)); + mode, CefString(title), CefString(default_file_path), accept_filtersList, + selected_accept_filter, CefRunFileDialogCallbackCToCpp::Wrap(callback)); } void CEF_CALLBACK browser_host_start_download(struct _cef_browser_host_t* self, - const cef_string_t* url) { + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -311,13 +306,16 @@ void CEF_CALLBACK browser_host_start_download(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->StartDownload( - CefString(url)); + CefBrowserHostCppToC::Get(self)->StartDownload(CefString(url)); } -void CEF_CALLBACK browser_host_download_image(struct _cef_browser_host_t* self, - const cef_string_t* image_url, int is_favicon, uint32 max_image_size, - int bypass_cache, cef_download_image_callback_t* callback) { +void CEF_CALLBACK +browser_host_download_image(struct _cef_browser_host_t* self, + const cef_string_t* image_url, + int is_favicon, + uint32 max_image_size, + int bypass_cache, + cef_download_image_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -334,10 +332,8 @@ void CEF_CALLBACK browser_host_download_image(struct _cef_browser_host_t* self, // Execute CefBrowserHostCppToC::Get(self)->DownloadImage( - CefString(image_url), - is_favicon?true:false, - max_image_size, - bypass_cache?true:false, + CefString(image_url), is_favicon ? true : false, max_image_size, + bypass_cache ? true : false, CefDownloadImageCallbackCToCpp::Wrap(callback)); } @@ -352,9 +348,11 @@ void CEF_CALLBACK browser_host_print(struct _cef_browser_host_t* self) { CefBrowserHostCppToC::Get(self)->Print(); } -void CEF_CALLBACK browser_host_print_to_pdf(struct _cef_browser_host_t* self, - const cef_string_t* path, const struct _cef_pdf_print_settings_t* settings, - cef_pdf_print_callback_t* callback) { +void CEF_CALLBACK +browser_host_print_to_pdf(struct _cef_browser_host_t* self, + const cef_string_t* path, + const struct _cef_pdf_print_settings_t* settings, + cef_pdf_print_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -377,14 +375,15 @@ void CEF_CALLBACK browser_host_print_to_pdf(struct _cef_browser_host_t* self, // Execute CefBrowserHostCppToC::Get(self)->PrintToPDF( - CefString(path), - settingsObj, - CefPdfPrintCallbackCToCpp::Wrap(callback)); + CefString(path), settingsObj, CefPdfPrintCallbackCToCpp::Wrap(callback)); } void CEF_CALLBACK browser_host_find(struct _cef_browser_host_t* self, - int identifier, const cef_string_t* searchText, int forward, int matchCase, - int findNext) { + int identifier, + const cef_string_t* searchText, + int forward, + int matchCase, + int findNext) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -397,15 +396,12 @@ void CEF_CALLBACK browser_host_find(struct _cef_browser_host_t* self, // Execute CefBrowserHostCppToC::Get(self)->Find( - identifier, - CefString(searchText), - forward?true:false, - matchCase?true:false, - findNext?true:false); + identifier, CefString(searchText), forward ? true : false, + matchCase ? true : false, findNext ? true : false); } void CEF_CALLBACK browser_host_stop_finding(struct _cef_browser_host_t* self, - int clearSelection) { + int clearSelection) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -413,14 +409,15 @@ void CEF_CALLBACK browser_host_stop_finding(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->StopFinding( - clearSelection?true:false); + CefBrowserHostCppToC::Get(self)->StopFinding(clearSelection ? true : false); } -void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self, - const cef_window_info_t* windowInfo, struct _cef_client_t* client, - const struct _cef_browser_settings_t* settings, - const cef_point_t* inspect_element_at) { +void CEF_CALLBACK +browser_host_show_dev_tools(struct _cef_browser_host_t* self, + const cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const struct _cef_browser_settings_t* settings, + const cef_point_t* inspect_element_at) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -438,18 +435,16 @@ void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self, settingsObj.Set(*settings, false); // Translate param: inspect_element_at; type: simple_byref_const CefPoint inspect_element_atVal = - inspect_element_at?*inspect_element_at:CefPoint(); + inspect_element_at ? *inspect_element_at : CefPoint(); // Execute CefBrowserHostCppToC::Get(self)->ShowDevTools( - windowInfoObj, - CefClientCToCpp::Wrap(client), - settingsObj, + windowInfoObj, CefClientCToCpp::Wrap(client), settingsObj, inspect_element_atVal); } -void CEF_CALLBACK browser_host_close_dev_tools( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_close_dev_tools(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -474,9 +469,10 @@ int CEF_CALLBACK browser_host_has_dev_tools(struct _cef_browser_host_t* self) { return _retval; } -void CEF_CALLBACK browser_host_get_navigation_entries( - struct _cef_browser_host_t* self, cef_navigation_entry_visitor_t* visitor, - int current_only) { +void CEF_CALLBACK +browser_host_get_navigation_entries(struct _cef_browser_host_t* self, + cef_navigation_entry_visitor_t* visitor, + int current_only) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -490,11 +486,12 @@ void CEF_CALLBACK browser_host_get_navigation_entries( // Execute CefBrowserHostCppToC::Get(self)->GetNavigationEntries( CefNavigationEntryVisitorCToCpp::Wrap(visitor), - current_only?true:false); + current_only ? true : false); } -void CEF_CALLBACK browser_host_set_mouse_cursor_change_disabled( - struct _cef_browser_host_t* self, int disabled) { +void CEF_CALLBACK +browser_host_set_mouse_cursor_change_disabled(struct _cef_browser_host_t* self, + int disabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -503,11 +500,11 @@ void CEF_CALLBACK browser_host_set_mouse_cursor_change_disabled( // Execute CefBrowserHostCppToC::Get(self)->SetMouseCursorChangeDisabled( - disabled?true:false); + disabled ? true : false); } -int CEF_CALLBACK browser_host_is_mouse_cursor_change_disabled( - struct _cef_browser_host_t* self) { +int CEF_CALLBACK +browser_host_is_mouse_cursor_change_disabled(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -521,8 +518,9 @@ int CEF_CALLBACK browser_host_is_mouse_cursor_change_disabled( return _retval; } -void CEF_CALLBACK browser_host_replace_misspelling( - struct _cef_browser_host_t* self, const cef_string_t* word) { +void CEF_CALLBACK +browser_host_replace_misspelling(struct _cef_browser_host_t* self, + const cef_string_t* word) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -534,12 +532,12 @@ void CEF_CALLBACK browser_host_replace_misspelling( return; // Execute - CefBrowserHostCppToC::Get(self)->ReplaceMisspelling( - CefString(word)); + CefBrowserHostCppToC::Get(self)->ReplaceMisspelling(CefString(word)); } -void CEF_CALLBACK browser_host_add_word_to_dictionary( - struct _cef_browser_host_t* self, const cef_string_t* word) { +void CEF_CALLBACK +browser_host_add_word_to_dictionary(struct _cef_browser_host_t* self, + const cef_string_t* word) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -551,12 +549,11 @@ void CEF_CALLBACK browser_host_add_word_to_dictionary( return; // Execute - CefBrowserHostCppToC::Get(self)->AddWordToDictionary( - CefString(word)); + CefBrowserHostCppToC::Get(self)->AddWordToDictionary(CefString(word)); } -int CEF_CALLBACK browser_host_is_window_rendering_disabled( - struct _cef_browser_host_t* self) { +int CEF_CALLBACK +browser_host_is_window_rendering_disabled(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -582,7 +579,7 @@ void CEF_CALLBACK browser_host_was_resized(struct _cef_browser_host_t* self) { } void CEF_CALLBACK browser_host_was_hidden(struct _cef_browser_host_t* self, - int hidden) { + int hidden) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -590,12 +587,11 @@ void CEF_CALLBACK browser_host_was_hidden(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->WasHidden( - hidden?true:false); + CefBrowserHostCppToC::Get(self)->WasHidden(hidden ? true : false); } -void CEF_CALLBACK browser_host_notify_screen_info_changed( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_notify_screen_info_changed(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -607,7 +603,7 @@ void CEF_CALLBACK browser_host_notify_screen_info_changed( } void CEF_CALLBACK browser_host_invalidate(struct _cef_browser_host_t* self, - cef_paint_element_type_t type) { + cef_paint_element_type_t type) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -615,12 +611,12 @@ void CEF_CALLBACK browser_host_invalidate(struct _cef_browser_host_t* self, return; // Execute - CefBrowserHostCppToC::Get(self)->Invalidate( - type); + CefBrowserHostCppToC::Get(self)->Invalidate(type); } -void CEF_CALLBACK browser_host_send_key_event(struct _cef_browser_host_t* self, - const struct _cef_key_event_t* event) { +void CEF_CALLBACK +browser_host_send_key_event(struct _cef_browser_host_t* self, + const struct _cef_key_event_t* event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -637,13 +633,15 @@ void CEF_CALLBACK browser_host_send_key_event(struct _cef_browser_host_t* self, eventObj.Set(*event, false); // Execute - CefBrowserHostCppToC::Get(self)->SendKeyEvent( - eventObj); + CefBrowserHostCppToC::Get(self)->SendKeyEvent(eventObj); } -void CEF_CALLBACK browser_host_send_mouse_click_event( - struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event, - cef_mouse_button_type_t type, int mouseUp, int clickCount) { +void CEF_CALLBACK +browser_host_send_mouse_click_event(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + cef_mouse_button_type_t type, + int mouseUp, + int clickCount) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -661,15 +659,13 @@ void CEF_CALLBACK browser_host_send_mouse_click_event( // Execute CefBrowserHostCppToC::Get(self)->SendMouseClickEvent( - eventObj, - type, - mouseUp?true:false, - clickCount); + eventObj, type, mouseUp ? true : false, clickCount); } -void CEF_CALLBACK browser_host_send_mouse_move_event( - struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event, - int mouseLeave) { +void CEF_CALLBACK +browser_host_send_mouse_move_event(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + int mouseLeave) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -687,13 +683,14 @@ void CEF_CALLBACK browser_host_send_mouse_move_event( // Execute CefBrowserHostCppToC::Get(self)->SendMouseMoveEvent( - eventObj, - mouseLeave?true:false); + eventObj, mouseLeave ? true : false); } -void CEF_CALLBACK browser_host_send_mouse_wheel_event( - struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event, - int deltaX, int deltaY) { +void CEF_CALLBACK +browser_host_send_mouse_wheel_event(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + int deltaX, + int deltaY) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -710,14 +707,12 @@ void CEF_CALLBACK browser_host_send_mouse_wheel_event( eventObj.Set(*event, false); // Execute - CefBrowserHostCppToC::Get(self)->SendMouseWheelEvent( - eventObj, - deltaX, - deltaY); + CefBrowserHostCppToC::Get(self)->SendMouseWheelEvent(eventObj, deltaX, + deltaY); } -void CEF_CALLBACK browser_host_send_focus_event( - struct _cef_browser_host_t* self, int setFocus) { +void CEF_CALLBACK +browser_host_send_focus_event(struct _cef_browser_host_t* self, int setFocus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -725,12 +720,11 @@ void CEF_CALLBACK browser_host_send_focus_event( return; // Execute - CefBrowserHostCppToC::Get(self)->SendFocusEvent( - setFocus?true:false); + CefBrowserHostCppToC::Get(self)->SendFocusEvent(setFocus ? true : false); } -void CEF_CALLBACK browser_host_send_capture_lost_event( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_send_capture_lost_event(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -741,8 +735,8 @@ void CEF_CALLBACK browser_host_send_capture_lost_event( CefBrowserHostCppToC::Get(self)->SendCaptureLostEvent(); } -void CEF_CALLBACK browser_host_notify_move_or_resize_started( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_notify_move_or_resize_started(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -753,8 +747,8 @@ void CEF_CALLBACK browser_host_notify_move_or_resize_started( CefBrowserHostCppToC::Get(self)->NotifyMoveOrResizeStarted(); } -int CEF_CALLBACK browser_host_get_windowless_frame_rate( - struct _cef_browser_host_t* self) { +int CEF_CALLBACK +browser_host_get_windowless_frame_rate(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -768,8 +762,9 @@ int CEF_CALLBACK browser_host_get_windowless_frame_rate( return _retval; } -void CEF_CALLBACK browser_host_set_windowless_frame_rate( - struct _cef_browser_host_t* self, int frame_rate) { +void CEF_CALLBACK +browser_host_set_windowless_frame_rate(struct _cef_browser_host_t* self, + int frame_rate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -777,15 +772,16 @@ void CEF_CALLBACK browser_host_set_windowless_frame_rate( return; // Execute - CefBrowserHostCppToC::Get(self)->SetWindowlessFrameRate( - frame_rate); + CefBrowserHostCppToC::Get(self)->SetWindowlessFrameRate(frame_rate); } -void CEF_CALLBACK browser_host_ime_set_composition( - struct _cef_browser_host_t* self, const cef_string_t* text, - size_t underlinesCount, cef_composition_underline_t const* underlines, - const cef_range_t* replacement_range, - const cef_range_t* selection_range) { +void CEF_CALLBACK +browser_host_ime_set_composition(struct _cef_browser_host_t* self, + const cef_string_t* text, + size_t underlinesCount, + cef_composition_underline_t const* underlines, + const cef_range_t* replacement_range, + const cef_range_t* selection_range) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -802,7 +798,7 @@ void CEF_CALLBACK browser_host_ime_set_composition( // Unverified params: text, underlines // Translate param: underlines; type: simple_vec_byref_const - std::vector underlinesList; + std::vector underlinesList; if (underlinesCount > 0) { for (size_t i = 0; i < underlinesCount; ++i) { CefCompositionUnderline underlinesVal = underlines[i]; @@ -810,22 +806,22 @@ void CEF_CALLBACK browser_host_ime_set_composition( } } // Translate param: replacement_range; type: simple_byref_const - CefRange replacement_rangeVal = replacement_range?*replacement_range:CefRange( - ); + CefRange replacement_rangeVal = + replacement_range ? *replacement_range : CefRange(); // Translate param: selection_range; type: simple_byref_const - CefRange selection_rangeVal = selection_range?*selection_range:CefRange(); + CefRange selection_rangeVal = selection_range ? *selection_range : CefRange(); // Execute CefBrowserHostCppToC::Get(self)->ImeSetComposition( - CefString(text), - underlinesList, - replacement_rangeVal, + CefString(text), underlinesList, replacement_rangeVal, selection_rangeVal); } -void CEF_CALLBACK browser_host_ime_commit_text(struct _cef_browser_host_t* self, - const cef_string_t* text, const cef_range_t* replacement_range, - int relative_cursor_pos) { +void CEF_CALLBACK +browser_host_ime_commit_text(struct _cef_browser_host_t* self, + const cef_string_t* text, + const cef_range_t* replacement_range, + int relative_cursor_pos) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -838,18 +834,17 @@ void CEF_CALLBACK browser_host_ime_commit_text(struct _cef_browser_host_t* self, // Unverified params: text // Translate param: replacement_range; type: simple_byref_const - CefRange replacement_rangeVal = replacement_range?*replacement_range:CefRange( - ); + CefRange replacement_rangeVal = + replacement_range ? *replacement_range : CefRange(); // Execute CefBrowserHostCppToC::Get(self)->ImeCommitText( - CefString(text), - replacement_rangeVal, - relative_cursor_pos); + CefString(text), replacement_rangeVal, relative_cursor_pos); } -void CEF_CALLBACK browser_host_ime_finish_composing_text( - struct _cef_browser_host_t* self, int keep_selection) { +void CEF_CALLBACK +browser_host_ime_finish_composing_text(struct _cef_browser_host_t* self, + int keep_selection) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -858,11 +853,11 @@ void CEF_CALLBACK browser_host_ime_finish_composing_text( // Execute CefBrowserHostCppToC::Get(self)->ImeFinishComposingText( - keep_selection?true:false); + keep_selection ? true : false); } -void CEF_CALLBACK browser_host_ime_cancel_composition( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_ime_cancel_composition(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -873,10 +868,11 @@ void CEF_CALLBACK browser_host_ime_cancel_composition( CefBrowserHostCppToC::Get(self)->ImeCancelComposition(); } -void CEF_CALLBACK browser_host_drag_target_drag_enter( - struct _cef_browser_host_t* self, struct _cef_drag_data_t* drag_data, - const struct _cef_mouse_event_t* event, - cef_drag_operations_mask_t allowed_ops) { +void CEF_CALLBACK +browser_host_drag_target_drag_enter(struct _cef_browser_host_t* self, + struct _cef_drag_data_t* drag_data, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -898,14 +894,13 @@ void CEF_CALLBACK browser_host_drag_target_drag_enter( // Execute CefBrowserHostCppToC::Get(self)->DragTargetDragEnter( - CefDragDataCppToC::Unwrap(drag_data), - eventObj, - allowed_ops); + CefDragDataCppToC::Unwrap(drag_data), eventObj, allowed_ops); } -void CEF_CALLBACK browser_host_drag_target_drag_over( - struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event, - cef_drag_operations_mask_t allowed_ops) { +void CEF_CALLBACK +browser_host_drag_target_drag_over(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -922,13 +917,11 @@ void CEF_CALLBACK browser_host_drag_target_drag_over( eventObj.Set(*event, false); // Execute - CefBrowserHostCppToC::Get(self)->DragTargetDragOver( - eventObj, - allowed_ops); + CefBrowserHostCppToC::Get(self)->DragTargetDragOver(eventObj, allowed_ops); } -void CEF_CALLBACK browser_host_drag_target_drag_leave( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_drag_target_drag_leave(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -939,8 +932,9 @@ void CEF_CALLBACK browser_host_drag_target_drag_leave( CefBrowserHostCppToC::Get(self)->DragTargetDragLeave(); } -void CEF_CALLBACK browser_host_drag_target_drop( - struct _cef_browser_host_t* self, const struct _cef_mouse_event_t* event) { +void CEF_CALLBACK +browser_host_drag_target_drop(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -957,13 +951,14 @@ void CEF_CALLBACK browser_host_drag_target_drop( eventObj.Set(*event, false); // Execute - CefBrowserHostCppToC::Get(self)->DragTargetDrop( - eventObj); + CefBrowserHostCppToC::Get(self)->DragTargetDrop(eventObj); } -void CEF_CALLBACK browser_host_drag_source_ended_at( - struct _cef_browser_host_t* self, int x, int y, - cef_drag_operations_mask_t op) { +void CEF_CALLBACK +browser_host_drag_source_ended_at(struct _cef_browser_host_t* self, + int x, + int y, + cef_drag_operations_mask_t op) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -971,14 +966,11 @@ void CEF_CALLBACK browser_host_drag_source_ended_at( return; // Execute - CefBrowserHostCppToC::Get(self)->DragSourceEndedAt( - x, - y, - op); + CefBrowserHostCppToC::Get(self)->DragSourceEndedAt(x, y, op); } -void CEF_CALLBACK browser_host_drag_source_system_drag_ended( - struct _cef_browser_host_t* self) { +void CEF_CALLBACK +browser_host_drag_source_system_drag_ended(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -989,8 +981,8 @@ void CEF_CALLBACK browser_host_drag_source_system_drag_ended( CefBrowserHostCppToC::Get(self)->DragSourceSystemDragEnded(); } -struct _cef_navigation_entry_t* CEF_CALLBACK browser_host_get_visible_navigation_entry( - struct _cef_browser_host_t* self) { +struct _cef_navigation_entry_t* CEF_CALLBACK +browser_host_get_visible_navigation_entry(struct _cef_browser_host_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -998,15 +990,16 @@ struct _cef_navigation_entry_t* CEF_CALLBACK browser_host_get_visible_navigation return NULL; // Execute - CefRefPtr _retval = CefBrowserHostCppToC::Get( - self)->GetVisibleNavigationEntry(); + CefRefPtr _retval = + CefBrowserHostCppToC::Get(self)->GetVisibleNavigationEntry(); // Return type: refptr_same return CefNavigationEntryCppToC::Wrap(_retval); } -void CEF_CALLBACK browser_host_set_accessibility_state( - struct _cef_browser_host_t* self, cef_state_t accessibility_state) { +void CEF_CALLBACK +browser_host_set_accessibility_state(struct _cef_browser_host_t* self, + cef_state_t accessibility_state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1014,13 +1007,11 @@ void CEF_CALLBACK browser_host_set_accessibility_state( return; // Execute - CefBrowserHostCppToC::Get(self)->SetAccessibilityState( - accessibility_state); + CefBrowserHostCppToC::Get(self)->SetAccessibilityState(accessibility_state); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBrowserHostCppToC::CefBrowserHostCppToC() { @@ -1088,17 +1079,23 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() { GetStruct()->set_accessibility_state = browser_host_set_accessibility_state; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_browser_host_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_browser_host_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER_HOST; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_BROWSER_HOST; diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.h b/libcef_dll/cpptoc/browser_host_cpptoc.h index 62d0bce31..7bed27387 100644 --- a/libcef_dll/cpptoc/browser_host_cpptoc.h +++ b/libcef_dll/cpptoc/browser_host_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a6ac38f2fd5622e382f6dbfc91d10f71c81f6ae9$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_HOST_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_BROWSER_HOST_CPPTOC_H_ @@ -18,17 +20,17 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefBrowserHostCppToC - : public CefCppToCRefCounted { +class CefBrowserHostCppToC : public CefCppToCRefCounted { public: CefBrowserHostCppToC(); }; diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc index 81261b974..ffe390578 100644 --- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=81332687e151af6933a729c1456dd4b3a64f82df$ +// #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" #include "libcef_dll/cpptoc/print_handler_cpptoc.h" #include "libcef_dll/ctocpp/command_line_ctocpp.h" #include "libcef_dll/ctocpp/list_value_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -68,7 +69,8 @@ void CEF_CALLBACK browser_process_handler_on_render_process_thread_created( CefListValueCToCpp::Wrap(extra_info)); } -struct _cef_print_handler_t* CEF_CALLBACK browser_process_handler_get_print_handler( +struct _cef_print_handler_t* CEF_CALLBACK +browser_process_handler_get_print_handler( struct _cef_browser_process_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -77,15 +79,16 @@ struct _cef_print_handler_t* CEF_CALLBACK browser_process_handler_get_print_hand return NULL; // Execute - CefRefPtr _retval = CefBrowserProcessHandlerCppToC::Get( - self)->GetPrintHandler(); + CefRefPtr _retval = + CefBrowserProcessHandlerCppToC::Get(self)->GetPrintHandler(); // Return type: refptr_same return CefPrintHandlerCppToC::Wrap(_retval); } void CEF_CALLBACK browser_process_handler_on_schedule_message_pump_work( - struct _cef_browser_process_handler_t* self, int64 delay_ms) { + struct _cef_browser_process_handler_t* self, + int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -99,7 +102,6 @@ void CEF_CALLBACK browser_process_handler_on_schedule_message_pump_work( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC() { @@ -114,18 +116,28 @@ CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC() { browser_process_handler_on_schedule_message_pump_work; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_browser_process_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefBrowserProcessHandlerCppToC, + CefBrowserProcessHandler, + cef_browser_process_handler_t>::UnwrapDerived(CefWrapperType type, + cef_browser_process_handler_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_BROWSER_PROCESS_HANDLER; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_BROWSER_PROCESS_HANDLER; diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h index ca1c8a8bb..8e367da58 100644 --- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h +++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c94cf8a41042d6b4fa77981ad89c2f687299d85d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_browser_process_handler.h" #include "include/capi/cef_browser_process_handler_capi.h" +#include "include/cef_browser_process_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefBrowserProcessHandlerCppToC : public CefCppToCRefCounted { + CefBrowserProcessHandler, + cef_browser_process_handler_t> { public: CefBrowserProcessHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/callback_cpptoc.cc b/libcef_dll/cpptoc/callback_cpptoc.cc index b0cb5458c..d063c16c6 100644 --- a/libcef_dll/cpptoc/callback_cpptoc.cc +++ b/libcef_dll/cpptoc/callback_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7d4c882910cd07c9659eefe6eb579e4096cd760c$ +// #include "libcef_dll/cpptoc/callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -41,7 +42,6 @@ void CEF_CALLBACK callback_cancel(struct _cef_callback_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefCallbackCppToC::CefCallbackCppToC() { @@ -49,17 +49,22 @@ CefCallbackCppToC::CefCallbackCppToC() { GetStruct()->cancel = callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CALLBACK; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CALLBACK; diff --git a/libcef_dll/cpptoc/callback_cpptoc.h b/libcef_dll/cpptoc/callback_cpptoc.h index c0b9670c8..222d6b062 100644 --- a/libcef_dll/cpptoc/callback_cpptoc.h +++ b/libcef_dll/cpptoc/callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c3961ec8754a1c7c24580d02dbf1c79942c2ad48$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_CALLBACK_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_callback.h" #include "include/capi/cef_callback_capi.h" +#include "include/cef_callback.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefCallbackCppToC - : public CefCppToCRefCounted { +class CefCallbackCppToC : public CefCppToCRefCounted { public: CefCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc index 5eb7b0452..2db75c657 100644 --- a/libcef_dll/cpptoc/client_cpptoc.cc +++ b/libcef_dll/cpptoc/client_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4ddb855e437a437ac87a894769d7e8c6cf208988$ +// #include "libcef_dll/cpptoc/client_cpptoc.h" #include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" @@ -28,13 +30,12 @@ #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/process_message_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -struct _cef_context_menu_handler_t* CEF_CALLBACK client_get_context_menu_handler( - struct _cef_client_t* self) { +struct _cef_context_menu_handler_t* CEF_CALLBACK +client_get_context_menu_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -42,15 +43,15 @@ struct _cef_context_menu_handler_t* CEF_CALLBACK client_get_context_menu_handler return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetContextMenuHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetContextMenuHandler(); // Return type: refptr_same return CefContextMenuHandlerCppToC::Wrap(_retval); } -struct _cef_dialog_handler_t* CEF_CALLBACK client_get_dialog_handler( - struct _cef_client_t* self) { +struct _cef_dialog_handler_t* CEF_CALLBACK +client_get_dialog_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -58,15 +59,15 @@ struct _cef_dialog_handler_t* CEF_CALLBACK client_get_dialog_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetDialogHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetDialogHandler(); // Return type: refptr_same return CefDialogHandlerCppToC::Wrap(_retval); } -struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( - struct _cef_client_t* self) { +struct _cef_display_handler_t* CEF_CALLBACK +client_get_display_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,15 +75,15 @@ struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetDisplayHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetDisplayHandler(); // Return type: refptr_same return CefDisplayHandlerCppToC::Wrap(_retval); } -struct _cef_download_handler_t* CEF_CALLBACK client_get_download_handler( - struct _cef_client_t* self) { +struct _cef_download_handler_t* CEF_CALLBACK +client_get_download_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -90,15 +91,15 @@ struct _cef_download_handler_t* CEF_CALLBACK client_get_download_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetDownloadHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetDownloadHandler(); // Return type: refptr_same return CefDownloadHandlerCppToC::Wrap(_retval); } -struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( - struct _cef_client_t* self) { +struct _cef_drag_handler_t* CEF_CALLBACK +client_get_drag_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -106,15 +107,15 @@ struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetDragHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetDragHandler(); // Return type: refptr_same return CefDragHandlerCppToC::Wrap(_retval); } -struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler( - struct _cef_client_t* self) { +struct _cef_find_handler_t* CEF_CALLBACK +client_get_find_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -122,15 +123,15 @@ struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetFindHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetFindHandler(); // Return type: refptr_same return CefFindHandlerCppToC::Wrap(_retval); } -struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( - struct _cef_client_t* self) { +struct _cef_focus_handler_t* CEF_CALLBACK +client_get_focus_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -138,15 +139,15 @@ struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetFocusHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetFocusHandler(); // Return type: refptr_same return CefFocusHandlerCppToC::Wrap(_retval); } -struct _cef_geolocation_handler_t* CEF_CALLBACK client_get_geolocation_handler( - struct _cef_client_t* self) { +struct _cef_geolocation_handler_t* CEF_CALLBACK +client_get_geolocation_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,15 +155,15 @@ struct _cef_geolocation_handler_t* CEF_CALLBACK client_get_geolocation_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetGeolocationHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetGeolocationHandler(); // Return type: refptr_same return CefGeolocationHandlerCppToC::Wrap(_retval); } -struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( - struct _cef_client_t* self) { +struct _cef_jsdialog_handler_t* CEF_CALLBACK +client_get_jsdialog_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -170,15 +171,15 @@ struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetJSDialogHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetJSDialogHandler(); // Return type: refptr_same return CefJSDialogHandlerCppToC::Wrap(_retval); } -struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( - struct _cef_client_t* self) { +struct _cef_keyboard_handler_t* CEF_CALLBACK +client_get_keyboard_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -186,15 +187,15 @@ struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetKeyboardHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetKeyboardHandler(); // Return type: refptr_same return CefKeyboardHandlerCppToC::Wrap(_retval); } -struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( - struct _cef_client_t* self) { +struct _cef_life_span_handler_t* CEF_CALLBACK +client_get_life_span_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,15 +203,15 @@ struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetLifeSpanHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetLifeSpanHandler(); // Return type: refptr_same return CefLifeSpanHandlerCppToC::Wrap(_retval); } -struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( - struct _cef_client_t* self) { +struct _cef_load_handler_t* CEF_CALLBACK +client_get_load_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -218,15 +219,15 @@ struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetLoadHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetLoadHandler(); // Return type: refptr_same return CefLoadHandlerCppToC::Wrap(_retval); } -struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( - struct _cef_client_t* self) { +struct _cef_render_handler_t* CEF_CALLBACK +client_get_render_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -234,15 +235,15 @@ struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetRenderHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetRenderHandler(); // Return type: refptr_same return CefRenderHandlerCppToC::Wrap(_retval); } -struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( - struct _cef_client_t* self) { +struct _cef_request_handler_t* CEF_CALLBACK +client_get_request_handler(struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -250,16 +251,18 @@ struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( return NULL; // Execute - CefRefPtr _retval = CefClientCppToC::Get( - self)->GetRequestHandler(); + CefRefPtr _retval = + CefClientCppToC::Get(self)->GetRequestHandler(); // Return type: refptr_same return CefRequestHandlerCppToC::Wrap(_retval); } -int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self, - cef_browser_t* browser, cef_process_id_t source_process, - struct _cef_process_message_t* message) { +int CEF_CALLBACK +client_on_process_message_received(struct _cef_client_t* self, + cef_browser_t* browser, + cef_process_id_t source_process, + struct _cef_process_message_t* message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -276,8 +279,7 @@ int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self, // Execute bool _retval = CefClientCppToC::Get(self)->OnProcessMessageReceived( - CefBrowserCToCpp::Wrap(browser), - source_process, + CefBrowserCToCpp::Wrap(browser), source_process, CefProcessMessageCToCpp::Wrap(message)); // Return type: bool @@ -286,7 +288,6 @@ int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefClientCppToC::CefClientCppToC() { @@ -307,16 +308,22 @@ CefClientCppToC::CefClientCppToC() { GetStruct()->on_process_message_received = client_on_process_message_received; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_client_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_client_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CLIENT; +template <> +CefWrapperType CefCppToCRefCounted:: + kWrapperType = WT_CLIENT; diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h index 4b529af01..7e8ce2df2 100644 --- a/libcef_dll/cpptoc/client_cpptoc.h +++ b/libcef_dll/cpptoc/client_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1e19eddff63d80ea1a80036e9bbfbf1011acf061$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc index 42e3d772b..df8f8d742 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.cc +++ b/libcef_dll/cpptoc/command_line_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b8f85a07998ec47d97910a04b0e68b34700a55ea$ +// #include "libcef_dll/cpptoc/command_line_cpptoc.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_command_line_t* cef_command_line_create() { @@ -36,7 +37,6 @@ CEF_EXPORT cef_command_line_t* cef_command_line_get_global() { return CefCommandLineCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -69,8 +69,8 @@ int CEF_CALLBACK command_line_is_read_only(struct _cef_command_line_t* self) { return _retval; } -struct _cef_command_line_t* CEF_CALLBACK command_line_copy( - struct _cef_command_line_t* self) { +struct _cef_command_line_t* CEF_CALLBACK +command_line_copy(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -85,7 +85,8 @@ struct _cef_command_line_t* CEF_CALLBACK command_line_copy( } void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, - int argc, const char* const* argv) { + int argc, + const char* const* argv) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -97,13 +98,12 @@ void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, return; // Execute - CefCommandLineCppToC::Get(self)->InitFromArgv( - argc, - argv); + CefCommandLineCppToC::Get(self)->InitFromArgv(argc, argv); } -void CEF_CALLBACK command_line_init_from_string( - struct _cef_command_line_t* self, const cef_string_t* command_line) { +void CEF_CALLBACK +command_line_init_from_string(struct _cef_command_line_t* self, + const cef_string_t* command_line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +115,7 @@ void CEF_CALLBACK command_line_init_from_string( return; // Execute - CefCommandLineCppToC::Get(self)->InitFromString( - CefString(command_line)); + CefCommandLineCppToC::Get(self)->InitFromString(CefString(command_line)); } void CEF_CALLBACK command_line_reset(struct _cef_command_line_t* self) { @@ -131,7 +130,7 @@ void CEF_CALLBACK command_line_reset(struct _cef_command_line_t* self) { } void CEF_CALLBACK command_line_get_argv(struct _cef_command_line_t* self, - cef_string_list_t argv) { + cef_string_list_t argv) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -147,16 +146,15 @@ void CEF_CALLBACK command_line_get_argv(struct _cef_command_line_t* self, transfer_string_list_contents(argv, argvList); // Execute - CefCommandLineCppToC::Get(self)->GetArgv( - argvList); + CefCommandLineCppToC::Get(self)->GetArgv(argvList); // Restore param: argv; type: string_vec_byref cef_string_list_clear(argv); transfer_string_list_contents(argvList, argv); } -cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( - struct _cef_command_line_t* self) { +cef_string_userfree_t CEF_CALLBACK +command_line_get_command_line_string(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -170,8 +168,8 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK command_line_get_program( - struct _cef_command_line_t* self) { +cef_string_userfree_t CEF_CALLBACK +command_line_get_program(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -186,7 +184,7 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_program( } void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, - const cef_string_t* program) { + const cef_string_t* program) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -198,8 +196,7 @@ void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, return; // Execute - CefCommandLineCppToC::Get(self)->SetProgram( - CefString(program)); + CefCommandLineCppToC::Get(self)->SetProgram(CefString(program)); } int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) { @@ -217,7 +214,7 @@ int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) { } int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -229,15 +226,15 @@ int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, return 0; // Execute - bool _retval = CefCommandLineCppToC::Get(self)->HasSwitch( - CefString(name)); + bool _retval = CefCommandLineCppToC::Get(self)->HasSwitch(CefString(name)); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( - struct _cef_command_line_t* self, const cef_string_t* name) { +cef_string_userfree_t CEF_CALLBACK +command_line_get_switch_value(struct _cef_command_line_t* self, + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -249,15 +246,15 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( return NULL; // Execute - CefString _retval = CefCommandLineCppToC::Get(self)->GetSwitchValue( - CefString(name)); + CefString _retval = + CefCommandLineCppToC::Get(self)->GetSwitchValue(CefString(name)); // Return type: string return _retval.DetachToUserFree(); } void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, - cef_string_map_t switches) { + cef_string_map_t switches) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -273,8 +270,7 @@ void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, transfer_string_map_contents(switches, switchesMap); // Execute - CefCommandLineCppToC::Get(self)->GetSwitches( - switchesMap); + CefCommandLineCppToC::Get(self)->GetSwitches(switchesMap); // Restore param: switches; type: string_map_single_byref cef_string_map_clear(switches); @@ -282,7 +278,7 @@ void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, } void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -294,13 +290,13 @@ void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, return; // Execute - CefCommandLineCppToC::Get(self)->AppendSwitch( - CefString(name)); + CefCommandLineCppToC::Get(self)->AppendSwitch(CefString(name)); } -void CEF_CALLBACK command_line_append_switch_with_value( - struct _cef_command_line_t* self, const cef_string_t* name, - const cef_string_t* value) { +void CEF_CALLBACK +command_line_append_switch_with_value(struct _cef_command_line_t* self, + const cef_string_t* name, + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -316,9 +312,8 @@ void CEF_CALLBACK command_line_append_switch_with_value( return; // Execute - CefCommandLineCppToC::Get(self)->AppendSwitchWithValue( - CefString(name), - CefString(value)); + CefCommandLineCppToC::Get(self)->AppendSwitchWithValue(CefString(name), + CefString(value)); } int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) { @@ -336,7 +331,7 @@ int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) { } void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, - cef_string_list_t arguments) { + cef_string_list_t arguments) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -352,8 +347,7 @@ void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, transfer_string_list_contents(arguments, argumentsList); // Execute - CefCommandLineCppToC::Get(self)->GetArguments( - argumentsList); + CefCommandLineCppToC::Get(self)->GetArguments(argumentsList); // Restore param: arguments; type: string_vec_byref cef_string_list_clear(arguments); @@ -361,7 +355,7 @@ void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, } void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, - const cef_string_t* argument) { + const cef_string_t* argument) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -373,12 +367,11 @@ void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, return; // Execute - CefCommandLineCppToC::Get(self)->AppendArgument( - CefString(argument)); + CefCommandLineCppToC::Get(self)->AppendArgument(CefString(argument)); } void CEF_CALLBACK command_line_prepend_wrapper(struct _cef_command_line_t* self, - const cef_string_t* wrapper) { + const cef_string_t* wrapper) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -390,13 +383,11 @@ void CEF_CALLBACK command_line_prepend_wrapper(struct _cef_command_line_t* self, return; // Execute - CefCommandLineCppToC::Get(self)->PrependWrapper( - CefString(wrapper)); + CefCommandLineCppToC::Get(self)->PrependWrapper(CefString(wrapper)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefCommandLineCppToC::CefCommandLineCppToC() { @@ -422,17 +413,23 @@ CefCommandLineCppToC::CefCommandLineCppToC() { GetStruct()->prepend_wrapper = command_line_prepend_wrapper; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_command_line_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_command_line_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COMMAND_LINE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_COMMAND_LINE; diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h index becee9935..57fcf7b13 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.h +++ b/libcef_dll/cpptoc/command_line_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=774d7a80d2c2d878e16319ed791472dfd49b5d1a$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_command_line.h" #include "include/capi/cef_command_line_capi.h" +#include "include/cef_command_line.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefCommandLineCppToC - : public CefCppToCRefCounted { +class CefCommandLineCppToC : public CefCppToCRefCounted { public: CefCommandLineCppToC(); }; diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.cc b/libcef_dll/cpptoc/completion_callback_cpptoc.cc index 1c1802c70..40a154c55 100644 --- a/libcef_dll/cpptoc/completion_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/completion_callback_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fa15c71d8a7710d8e1c326ede770c2359b790188$ +// #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK completion_callback_on_complete( - struct _cef_completion_callback_t* self) { +void CEF_CALLBACK +completion_callback_on_complete(struct _cef_completion_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,25 +32,32 @@ void CEF_CALLBACK completion_callback_on_complete( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefCompletionCallbackCppToC::CefCompletionCallbackCppToC() { GetStruct()->on_complete = completion_callback_on_complete; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_completion_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefCompletionCallbackCppToC, + CefCompletionCallback, + cef_completion_callback_t>::UnwrapDerived(CefWrapperType type, + cef_completion_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COMPLETION_CALLBACK; diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.h b/libcef_dll/cpptoc/completion_callback_cpptoc.h index 41fcaadff..f662be72b 100644 --- a/libcef_dll/cpptoc/completion_callback_cpptoc.h +++ b/libcef_dll/cpptoc/completion_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e34dbc70b1ad79757db547ae0d27f043db480ac9$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_callback.h" #include "include/capi/cef_callback_capi.h" +#include "include/cef_callback.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefCompletionCallbackCppToC : public CefCppToCRefCounted { + CefCompletionCallback, + cef_completion_callback_t> { public: CefCompletionCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc index 1c899fca7..ca4e4f410 100644 --- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=29e80c799b48d2d05117f502e4ab1a71e510b5e9$ +// #include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" @@ -17,14 +19,15 @@ #include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK context_menu_handler_on_before_context_menu( - struct _cef_context_menu_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + struct _cef_context_menu_handler_t* self, + cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_context_menu_params_t* params, struct _cef_menu_model_t* model) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -50,15 +53,16 @@ void CEF_CALLBACK context_menu_handler_on_before_context_menu( // Execute CefContextMenuHandlerCppToC::Get(self)->OnBeforeContextMenu( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), CefContextMenuParamsCToCpp::Wrap(params), CefMenuModelCToCpp::Wrap(model)); } int CEF_CALLBACK context_menu_handler_run_context_menu( - struct _cef_context_menu_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + struct _cef_context_menu_handler_t* self, + cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_context_menu_params_t* params, struct _cef_menu_model_t* model, cef_run_context_menu_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -89,10 +93,8 @@ int CEF_CALLBACK context_menu_handler_run_context_menu( // Execute bool _retval = CefContextMenuHandlerCppToC::Get(self)->RunContextMenu( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefContextMenuParamsCToCpp::Wrap(params), - CefMenuModelCToCpp::Wrap(model), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefContextMenuParamsCToCpp::Wrap(params), CefMenuModelCToCpp::Wrap(model), CefRunContextMenuCallbackCToCpp::Wrap(callback)); // Return type: bool @@ -100,9 +102,12 @@ int CEF_CALLBACK context_menu_handler_run_context_menu( } int CEF_CALLBACK context_menu_handler_on_context_menu_command( - struct _cef_context_menu_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, - int command_id, cef_event_flags_t event_flags) { + struct _cef_context_menu_handler_t* self, + cef_browser_t* browser, + struct _cef_frame_t* frame, + struct _cef_context_menu_params_t* params, + int command_id, + cef_event_flags_t event_flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,18 +128,16 @@ int CEF_CALLBACK context_menu_handler_on_context_menu_command( // Execute bool _retval = CefContextMenuHandlerCppToC::Get(self)->OnContextMenuCommand( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefContextMenuParamsCToCpp::Wrap(params), - command_id, - event_flags); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefContextMenuParamsCToCpp::Wrap(params), command_id, event_flags); // Return type: bool return _retval; } void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed( - struct _cef_context_menu_handler_t* self, cef_browser_t* browser, + struct _cef_context_menu_handler_t* self, + cef_browser_t* browser, struct _cef_frame_t* frame) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -152,13 +155,11 @@ void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed( // Execute CefContextMenuHandlerCppToC::Get(self)->OnContextMenuDismissed( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame)); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() { @@ -171,18 +172,26 @@ CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() { context_menu_handler_on_context_menu_dismissed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_context_menu_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefContextMenuHandlerCppToC, + CefContextMenuHandler, + cef_context_menu_handler_t>::UnwrapDerived(CefWrapperType type, + cef_context_menu_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CONTEXT_MENU_HANDLER; diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h index 65db9d771..42dacaf59 100644 --- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h +++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b60a8c9ed22835cc550c9d3487cf4c6f2f914e82$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefContextMenuHandlerCppToC : public CefCppToCRefCounted { + CefContextMenuHandler, + cef_context_menu_handler_t> { public: CefContextMenuHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc index 75f0b0f7b..7aae32892 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=18b1ac42fafd91952f9e5f88e765b2b7af85893e$ +// #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK context_menu_params_get_xcoord( - struct _cef_context_menu_params_t* self) { +int CEF_CALLBACK +context_menu_params_get_xcoord(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +34,8 @@ int CEF_CALLBACK context_menu_params_get_xcoord( return _retval; } -int CEF_CALLBACK context_menu_params_get_ycoord( - struct _cef_context_menu_params_t* self) { +int CEF_CALLBACK +context_menu_params_get_ycoord(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,8 +49,8 @@ int CEF_CALLBACK context_menu_params_get_ycoord( return _retval; } -cef_context_menu_type_flags_t CEF_CALLBACK context_menu_params_get_type_flags( - struct _cef_context_menu_params_t* self) { +cef_context_menu_type_flags_t CEF_CALLBACK +context_menu_params_get_type_flags(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -57,15 +58,15 @@ cef_context_menu_type_flags_t CEF_CALLBACK context_menu_params_get_type_flags( return CM_TYPEFLAG_NONE; // Execute - cef_context_menu_type_flags_t _retval = CefContextMenuParamsCppToC::Get( - self)->GetTypeFlags(); + cef_context_menu_type_flags_t _retval = + CefContextMenuParamsCppToC::Get(self)->GetTypeFlags(); // Return type: simple return _retval; } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_link_url( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_link_url(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,15 +89,15 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_unfiltered_link_url( return NULL; // Execute - CefString _retval = CefContextMenuParamsCppToC::Get( - self)->GetUnfilteredLinkUrl(); + CefString _retval = + CefContextMenuParamsCppToC::Get(self)->GetUnfilteredLinkUrl(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_source_url( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_source_url(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -125,8 +126,8 @@ int CEF_CALLBACK context_menu_params_has_image_contents( return _retval; } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_title_text( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_title_text(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -140,8 +141,8 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_title_text( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_page_url( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_page_url(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -155,8 +156,8 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_page_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_frame_url( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_frame_url(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -170,8 +171,8 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_frame_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK context_menu_params_get_frame_charset( - struct _cef_context_menu_params_t* self) { +cef_string_userfree_t CEF_CALLBACK +context_menu_params_get_frame_charset(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,8 +186,8 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_frame_charset( return _retval.DetachToUserFree(); } -cef_context_menu_media_type_t CEF_CALLBACK context_menu_params_get_media_type( - struct _cef_context_menu_params_t* self) { +cef_context_menu_media_type_t CEF_CALLBACK +context_menu_params_get_media_type(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -194,14 +195,15 @@ cef_context_menu_media_type_t CEF_CALLBACK context_menu_params_get_media_type( return CM_MEDIATYPE_NONE; // Execute - cef_context_menu_media_type_t _retval = CefContextMenuParamsCppToC::Get( - self)->GetMediaType(); + cef_context_menu_media_type_t _retval = + CefContextMenuParamsCppToC::Get(self)->GetMediaType(); // Return type: simple return _retval; } -cef_context_menu_media_state_flags_t CEF_CALLBACK context_menu_params_get_media_state_flags( +cef_context_menu_media_state_flags_t CEF_CALLBACK +context_menu_params_get_media_state_flags( struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -241,15 +243,16 @@ cef_string_userfree_t CEF_CALLBACK context_menu_params_get_misspelled_word( return NULL; // Execute - CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetMisspelledWord( - ); + CefString _retval = + CefContextMenuParamsCppToC::Get(self)->GetMisspelledWord(); // Return type: string return _retval.DetachToUserFree(); } int CEF_CALLBACK context_menu_params_get_dictionary_suggestions( - struct _cef_context_menu_params_t* self, cef_string_list_t suggestions) { + struct _cef_context_menu_params_t* self, + cef_string_list_t suggestions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -265,9 +268,9 @@ int CEF_CALLBACK context_menu_params_get_dictionary_suggestions( transfer_string_list_contents(suggestions, suggestionsList); // Execute - bool _retval = CefContextMenuParamsCppToC::Get( - self)->GetDictionarySuggestions( - suggestionsList); + bool _retval = + CefContextMenuParamsCppToC::Get(self)->GetDictionarySuggestions( + suggestionsList); // Restore param: suggestions; type: string_vec_byref cef_string_list_clear(suggestions); @@ -277,8 +280,8 @@ int CEF_CALLBACK context_menu_params_get_dictionary_suggestions( return _retval; } -int CEF_CALLBACK context_menu_params_is_editable( - struct _cef_context_menu_params_t* self) { +int CEF_CALLBACK +context_menu_params_is_editable(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -307,7 +310,8 @@ int CEF_CALLBACK context_menu_params_is_spell_check_enabled( return _retval; } -cef_context_menu_edit_state_flags_t CEF_CALLBACK context_menu_params_get_edit_state_flags( +cef_context_menu_edit_state_flags_t CEF_CALLBACK +context_menu_params_get_edit_state_flags( struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -316,15 +320,15 @@ cef_context_menu_edit_state_flags_t CEF_CALLBACK context_menu_params_get_edit_st return CM_EDITFLAG_NONE; // Execute - cef_context_menu_edit_state_flags_t _retval = CefContextMenuParamsCppToC::Get( - self)->GetEditStateFlags(); + cef_context_menu_edit_state_flags_t _retval = + CefContextMenuParamsCppToC::Get(self)->GetEditStateFlags(); // Return type: simple return _retval; } -int CEF_CALLBACK context_menu_params_is_custom_menu( - struct _cef_context_menu_params_t* self) { +int CEF_CALLBACK +context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -338,8 +342,8 @@ int CEF_CALLBACK context_menu_params_is_custom_menu( return _retval; } -int CEF_CALLBACK context_menu_params_is_pepper_menu( - struct _cef_context_menu_params_t* self) { +int CEF_CALLBACK +context_menu_params_is_pepper_menu(struct _cef_context_menu_params_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -355,7 +359,6 @@ int CEF_CALLBACK context_menu_params_is_pepper_menu( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() { @@ -386,18 +389,26 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() { GetStruct()->is_pepper_menu = context_menu_params_is_pepper_menu; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_context_menu_params_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefContextMenuParamsCppToC, + CefContextMenuParams, + cef_context_menu_params_t>::UnwrapDerived(CefWrapperType type, + cef_context_menu_params_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CONTEXT_MENU_PARAMS; diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.h b/libcef_dll/cpptoc/context_menu_params_cpptoc.h index 17eeda6a5..8d26b8a30 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.h +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=dd761b2db52b1daad0dd796ae1e46fe877ba1185$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_PARAMS_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_PARAMS_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefContextMenuParamsCppToC : public CefCppToCRefCounted { + CefContextMenuParams, + cef_context_menu_params_t> { public: CefContextMenuParamsCppToC(); }; diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc index 02f7233e0..dc7f6bc4e 100644 --- a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=decd4e8fc4ddfe8c55b7227842584974e2581739$ +// #include "libcef_dll/cpptoc/cookie_manager_cpptoc.h" #include "libcef_dll/ctocpp/completion_callback_ctocpp.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( @@ -35,7 +36,8 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( } CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( - const cef_string_t* path, int persist_session_cookies, + const cef_string_t* path, + int persist_session_cookies, cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -43,22 +45,21 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( // Execute CefRefPtr _retval = CefCookieManager::CreateManager( - CefString(path), - persist_session_cookies?true:false, + CefString(path), persist_session_cookies ? true : false, CefCompletionCallbackCToCpp::Wrap(callback)); // Return type: refptr_same return CefCookieManagerCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK cookie_manager_set_supported_schemes( - struct _cef_cookie_manager_t* self, cef_string_list_t schemes, - cef_completion_callback_t* callback) { +void CEF_CALLBACK +cookie_manager_set_supported_schemes(struct _cef_cookie_manager_t* self, + cef_string_list_t schemes, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -76,13 +77,12 @@ void CEF_CALLBACK cookie_manager_set_supported_schemes( // Execute CefCookieManagerCppToC::Get(self)->SetSupportedSchemes( - schemesList, - CefCompletionCallbackCToCpp::Wrap(callback)); + schemesList, CefCompletionCallbackCToCpp::Wrap(callback)); } -int CEF_CALLBACK cookie_manager_visit_all_cookies( - struct _cef_cookie_manager_t* self, - struct _cef_cookie_visitor_t* visitor) { +int CEF_CALLBACK +cookie_manager_visit_all_cookies(struct _cef_cookie_manager_t* self, + struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -101,9 +101,11 @@ int CEF_CALLBACK cookie_manager_visit_all_cookies( return _retval; } -int CEF_CALLBACK cookie_manager_visit_url_cookies( - struct _cef_cookie_manager_t* self, const cef_string_t* url, - int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) { +int CEF_CALLBACK +cookie_manager_visit_url_cookies(struct _cef_cookie_manager_t* self, + const cef_string_t* url, + int includeHttpOnly, + struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,17 +122,18 @@ int CEF_CALLBACK cookie_manager_visit_url_cookies( // Execute bool _retval = CefCookieManagerCppToC::Get(self)->VisitUrlCookies( - CefString(url), - includeHttpOnly?true:false, + CefString(url), includeHttpOnly ? true : false, CefCookieVisitorCToCpp::Wrap(visitor)); // Return type: bool return _retval; } -int CEF_CALLBACK cookie_manager_set_cookie(struct _cef_cookie_manager_t* self, - const cef_string_t* url, const struct _cef_cookie_t* cookie, - struct _cef_set_cookie_callback_t* callback) { +int CEF_CALLBACK +cookie_manager_set_cookie(struct _cef_cookie_manager_t* self, + const cef_string_t* url, + const struct _cef_cookie_t* cookie, + struct _cef_set_cookie_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -153,18 +156,17 @@ int CEF_CALLBACK cookie_manager_set_cookie(struct _cef_cookie_manager_t* self, // Execute bool _retval = CefCookieManagerCppToC::Get(self)->SetCookie( - CefString(url), - cookieObj, - CefSetCookieCallbackCToCpp::Wrap(callback)); + CefString(url), cookieObj, CefSetCookieCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -int CEF_CALLBACK cookie_manager_delete_cookies( - struct _cef_cookie_manager_t* self, const cef_string_t* url, - const cef_string_t* cookie_name, - struct _cef_delete_cookies_callback_t* callback) { +int CEF_CALLBACK +cookie_manager_delete_cookies(struct _cef_cookie_manager_t* self, + const cef_string_t* url, + const cef_string_t* cookie_name, + struct _cef_delete_cookies_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -174,17 +176,18 @@ int CEF_CALLBACK cookie_manager_delete_cookies( // Execute bool _retval = CefCookieManagerCppToC::Get(self)->DeleteCookies( - CefString(url), - CefString(cookie_name), + CefString(url), CefString(cookie_name), CefDeleteCookiesCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -int CEF_CALLBACK cookie_manager_set_storage_path( - struct _cef_cookie_manager_t* self, const cef_string_t* path, - int persist_session_cookies, cef_completion_callback_t* callback) { +int CEF_CALLBACK +cookie_manager_set_storage_path(struct _cef_cookie_manager_t* self, + const cef_string_t* path, + int persist_session_cookies, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -194,16 +197,16 @@ int CEF_CALLBACK cookie_manager_set_storage_path( // Execute bool _retval = CefCookieManagerCppToC::Get(self)->SetStoragePath( - CefString(path), - persist_session_cookies?true:false, + CefString(path), persist_session_cookies ? true : false, CefCompletionCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -int CEF_CALLBACK cookie_manager_flush_store(struct _cef_cookie_manager_t* self, - cef_completion_callback_t* callback) { +int CEF_CALLBACK +cookie_manager_flush_store(struct _cef_cookie_manager_t* self, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -221,7 +224,6 @@ int CEF_CALLBACK cookie_manager_flush_store(struct _cef_cookie_manager_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefCookieManagerCppToC::CefCookieManagerCppToC() { @@ -234,17 +236,25 @@ CefCookieManagerCppToC::CefCookieManagerCppToC() { GetStruct()->flush_store = cookie_manager_flush_store; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_cookie_manager_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefCookieManagerCppToC, + CefCookieManager, + cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type, + cef_cookie_manager_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COOKIE_MANAGER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_COOKIE_MANAGER; diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.h b/libcef_dll/cpptoc/cookie_manager_cpptoc.h index 5c4f0ed70..5c9b01307 100644 --- a/libcef_dll/cpptoc/cookie_manager_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9c3a4998e5d65d301465a3447f2777c000d78a2c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_MANAGER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_COOKIE_MANAGER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefCookieManagerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefCookieManagerCppToC(); }; diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc index 17fdebc7f..1a86f0f90 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -9,17 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f940c4ed56f4c6e6dbb2cefb49b81376bccbe3ff$ +// #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, - const struct _cef_cookie_t* cookie, int count, int total, - int* deleteCookie) { + const struct _cef_cookie_t* cookie, + int count, + int total, + int* deleteCookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,18 +42,15 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, if (cookie) cookieObj.Set(*cookie, false); // Translate param: deleteCookie; type: bool_byref - bool deleteCookieBool = (deleteCookie && *deleteCookie)?true:false; + bool deleteCookieBool = (deleteCookie && *deleteCookie) ? true : false; // Execute bool _retval = CefCookieVisitorCppToC::Get(self)->Visit( - cookieObj, - count, - total, - deleteCookieBool); + cookieObj, count, total, deleteCookieBool); // Restore param: deleteCookie; type: bool_byref if (deleteCookie) - *deleteCookie = deleteCookieBool?true:false; + *deleteCookie = deleteCookieBool ? true : false; // Return type: bool return _retval; @@ -58,24 +58,31 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefCookieVisitorCppToC::CefCookieVisitorCppToC() { GetStruct()->visit = cookie_visitor_visit; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_cookie_visitor_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefCookieVisitorCppToC, + CefCookieVisitor, + cef_cookie_visitor_t>::UnwrapDerived(CefWrapperType type, + cef_cookie_visitor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COOKIE_VISITOR; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_COOKIE_VISITOR; diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h index a9d775ddc..638d41b39 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=82784a784ccc1612bfae27d2a404db3301e36643$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefCookieVisitorCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefCookieVisitorCppToC(); }; diff --git a/libcef_dll/cpptoc/cpptoc_ref_counted.h b/libcef_dll/cpptoc/cpptoc_ref_counted.h index 41adf81e4..a728a2e61 100644 --- a/libcef_dll/cpptoc/cpptoc_ref_counted.h +++ b/libcef_dll/cpptoc/cpptoc_ref_counted.h @@ -8,8 +8,8 @@ #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/wrapper_types.h" // Wrap a C++ class with a C structure. This is used when the class @@ -91,7 +91,7 @@ class CefCppToCRefCounted : public CefBaseRefCounted { #if DCHECK_IS_ON() // Simple tracking of allocated objects. - static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) + static base::AtomicRefCount DebugObjCt; #endif protected: @@ -141,12 +141,8 @@ class CefCppToCRefCounted : public CefBaseRefCounted { static CefRefPtr UnwrapDerived(CefWrapperType type, StructName* s); // Increment/decrement reference counts on only the underlying class. - void UnderlyingAddRef() const { - wrapper_struct_.object_->AddRef(); - } - bool UnderlyingRelease() const { - return wrapper_struct_.object_->Release(); - } + void UnderlyingAddRef() const { wrapper_struct_.object_->AddRef(); } + bool UnderlyingRelease() const { return wrapper_struct_.object_->Release(); } bool UnderlyingHasOneRef() const { return wrapper_struct_.object_->HasOneRef(); } diff --git a/libcef_dll/cpptoc/cpptoc_scoped.h b/libcef_dll/cpptoc/cpptoc_scoped.h index 4230ef77f..8f328f06e 100644 --- a/libcef_dll/cpptoc/cpptoc_scoped.h +++ b/libcef_dll/cpptoc/cpptoc_scoped.h @@ -8,8 +8,8 @@ #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/ptr_util.h" #include "libcef_dll/wrapper_types.h" @@ -156,7 +156,7 @@ class CefCppToCScoped : public CefBaseScoped { #if DCHECK_IS_ON() // Simple tracking of allocated objects. - static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) + static base::AtomicRefCount DebugObjCt; #endif protected: diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc index 540fa8e5d..7ad4a2680 100644 --- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f17a9939eba29ab59060b3198e6041ff582a42a8$ +// #include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK delete_cookies_callback_on_complete( - struct _cef_delete_cookies_callback_t* self, int num_deleted) { +void CEF_CALLBACK +delete_cookies_callback_on_complete(struct _cef_delete_cookies_callback_t* self, + int num_deleted) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -26,31 +28,39 @@ void CEF_CALLBACK delete_cookies_callback_on_complete( return; // Execute - CefDeleteCookiesCallbackCppToC::Get(self)->OnComplete( - num_deleted); + CefDeleteCookiesCallbackCppToC::Get(self)->OnComplete(num_deleted); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDeleteCookiesCallbackCppToC::CefDeleteCookiesCallbackCppToC() { GetStruct()->on_complete = delete_cookies_callback_on_complete; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_delete_cookies_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDeleteCookiesCallbackCppToC, + CefDeleteCookiesCallback, + cef_delete_cookies_callback_t>::UnwrapDerived(CefWrapperType type, + cef_delete_cookies_callback_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_DELETE_COOKIES_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_DELETE_COOKIES_CALLBACK; diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h index 6b5fbc1a7..7268f497a 100644 --- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h +++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a6f3e6c01015b3e90a3ee9c33a0215f6b5c971aa$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DELETE_COOKIES_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DELETE_COOKIES_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDeleteCookiesCallbackCppToC : public CefCppToCRefCounted { + CefDeleteCookiesCallback, + cef_delete_cookies_callback_t> { public: CefDeleteCookiesCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc index 943099f71..e772a1a8b 100644 --- a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc @@ -9,22 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2905826a83c8afbda57e2a6868bb447f8f22b58b$ +// #include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK dialog_handler_on_file_dialog( - struct _cef_dialog_handler_t* self, cef_browser_t* browser, - cef_file_dialog_mode_t mode, const cef_string_t* title, - const cef_string_t* default_file_path, cef_string_list_t accept_filters, - int selected_accept_filter, cef_file_dialog_callback_t* callback) { +int CEF_CALLBACK +dialog_handler_on_file_dialog(struct _cef_dialog_handler_t* self, + cef_browser_t* browser, + cef_file_dialog_mode_t mode, + const cef_string_t* title, + const cef_string_t* default_file_path, + cef_string_list_t accept_filters, + int selected_accept_filter, + cef_file_dialog_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,12 +55,8 @@ int CEF_CALLBACK dialog_handler_on_file_dialog( // Execute bool _retval = CefDialogHandlerCppToC::Get(self)->OnFileDialog( - CefBrowserCToCpp::Wrap(browser), - mode, - CefString(title), - CefString(default_file_path), - accept_filtersList, - selected_accept_filter, + CefBrowserCToCpp::Wrap(browser), mode, CefString(title), + CefString(default_file_path), accept_filtersList, selected_accept_filter, CefFileDialogCallbackCToCpp::Wrap(callback)); // Return type: bool @@ -64,24 +65,31 @@ int CEF_CALLBACK dialog_handler_on_file_dialog( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDialogHandlerCppToC::CefDialogHandlerCppToC() { GetStruct()->on_file_dialog = dialog_handler_on_file_dialog; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_dialog_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDialogHandlerCppToC, + CefDialogHandler, + cef_dialog_handler_t>::UnwrapDerived(CefWrapperType type, + cef_dialog_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DIALOG_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DIALOG_HANDLER; diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.h b/libcef_dll/cpptoc/dialog_handler_cpptoc.h index f50500b50..bf7756d2d 100644 --- a/libcef_dll/cpptoc/dialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8802de8a4415791889f4b8ff4a9f3773ad06cf5c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_dialog_handler.h" #include "include/capi/cef_dialog_handler_capi.h" +#include "include/cef_dialog_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDialogHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefDialogHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc index 835e9370c..fed0ae25f 100644 --- a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc +++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a70d01195a3849949d5046432f91e572dd2570d0$ +// #include "libcef_dll/cpptoc/binary_value_cpptoc.h" #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" @@ -16,7 +18,6 @@ #include "libcef_dll/cpptoc/value_cpptoc.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create() { @@ -29,13 +30,12 @@ CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create() { return CefDictionaryValueCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK dictionary_value_is_valid( - struct _cef_dictionary_value_t* self) { +int CEF_CALLBACK +dictionary_value_is_valid(struct _cef_dictionary_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,8 +49,8 @@ int CEF_CALLBACK dictionary_value_is_valid( return _retval; } -int CEF_CALLBACK dictionary_value_is_owned( - struct _cef_dictionary_value_t* self) { +int CEF_CALLBACK +dictionary_value_is_owned(struct _cef_dictionary_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +64,8 @@ int CEF_CALLBACK dictionary_value_is_owned( return _retval; } -int CEF_CALLBACK dictionary_value_is_read_only( - struct _cef_dictionary_value_t* self) { +int CEF_CALLBACK +dictionary_value_is_read_only(struct _cef_dictionary_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,8 +79,9 @@ int CEF_CALLBACK dictionary_value_is_read_only( return _retval; } -int CEF_CALLBACK dictionary_value_is_same(struct _cef_dictionary_value_t* self, - struct _cef_dictionary_value_t* that) { +int CEF_CALLBACK +dictionary_value_is_same(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -99,8 +100,9 @@ int CEF_CALLBACK dictionary_value_is_same(struct _cef_dictionary_value_t* self, return _retval; } -int CEF_CALLBACK dictionary_value_is_equal(struct _cef_dictionary_value_t* self, - struct _cef_dictionary_value_t* that) { +int CEF_CALLBACK +dictionary_value_is_equal(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -119,8 +121,9 @@ int CEF_CALLBACK dictionary_value_is_equal(struct _cef_dictionary_value_t* self, return _retval; } -struct _cef_dictionary_value_t* CEF_CALLBACK dictionary_value_copy( - struct _cef_dictionary_value_t* self, int exclude_empty_children) { +struct _cef_dictionary_value_t* CEF_CALLBACK +dictionary_value_copy(struct _cef_dictionary_value_t* self, + int exclude_empty_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,16 +131,16 @@ struct _cef_dictionary_value_t* CEF_CALLBACK dictionary_value_copy( return NULL; // Execute - CefRefPtr _retval = CefDictionaryValueCppToC::Get( - self)->Copy( - exclude_empty_children?true:false); + CefRefPtr _retval = + CefDictionaryValueCppToC::Get(self)->Copy(exclude_empty_children ? true + : false); // Return type: refptr_same return CefDictionaryValueCppToC::Wrap(_retval); } -size_t CEF_CALLBACK dictionary_value_get_size( - struct _cef_dictionary_value_t* self) { +size_t CEF_CALLBACK +dictionary_value_get_size(struct _cef_dictionary_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -166,7 +169,7 @@ int CEF_CALLBACK dictionary_value_clear(struct _cef_dictionary_value_t* self) { } int CEF_CALLBACK dictionary_value_has_key(struct _cef_dictionary_value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -178,15 +181,14 @@ int CEF_CALLBACK dictionary_value_has_key(struct _cef_dictionary_value_t* self, return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->HasKey( - CefString(key)); + bool _retval = CefDictionaryValueCppToC::Get(self)->HasKey(CefString(key)); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_get_keys(struct _cef_dictionary_value_t* self, - cef_string_list_t keys) { + cef_string_list_t keys) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,8 +204,7 @@ int CEF_CALLBACK dictionary_value_get_keys(struct _cef_dictionary_value_t* self, transfer_string_list_contents(keys, keysList); // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->GetKeys( - keysList); + bool _retval = CefDictionaryValueCppToC::Get(self)->GetKeys(keysList); // Restore param: keys; type: string_vec_byref cef_string_list_clear(keys); @@ -214,7 +215,7 @@ int CEF_CALLBACK dictionary_value_get_keys(struct _cef_dictionary_value_t* self, } int CEF_CALLBACK dictionary_value_remove(struct _cef_dictionary_value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -226,15 +227,15 @@ int CEF_CALLBACK dictionary_value_remove(struct _cef_dictionary_value_t* self, return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->Remove( - CefString(key)); + bool _retval = CefDictionaryValueCppToC::Get(self)->Remove(CefString(key)); // Return type: bool return _retval; } -cef_value_type_t CEF_CALLBACK dictionary_value_get_type( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +cef_value_type_t CEF_CALLBACK +dictionary_value_get_type(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -246,15 +247,16 @@ cef_value_type_t CEF_CALLBACK dictionary_value_get_type( return VTYPE_INVALID; // Execute - cef_value_type_t _retval = CefDictionaryValueCppToC::Get(self)->GetType( - CefString(key)); + cef_value_type_t _retval = + CefDictionaryValueCppToC::Get(self)->GetType(CefString(key)); // Return type: simple return _retval; } -cef_value_t* CEF_CALLBACK dictionary_value_get_value( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +cef_value_t* CEF_CALLBACK +dictionary_value_get_value(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -266,15 +268,15 @@ cef_value_t* CEF_CALLBACK dictionary_value_get_value( return NULL; // Execute - CefRefPtr _retval = CefDictionaryValueCppToC::Get(self)->GetValue( - CefString(key)); + CefRefPtr _retval = + CefDictionaryValueCppToC::Get(self)->GetValue(CefString(key)); // Return type: refptr_same return CefValueCppToC::Wrap(_retval); } int CEF_CALLBACK dictionary_value_get_bool(struct _cef_dictionary_value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -286,15 +288,14 @@ int CEF_CALLBACK dictionary_value_get_bool(struct _cef_dictionary_value_t* self, return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->GetBool( - CefString(key)); + bool _retval = CefDictionaryValueCppToC::Get(self)->GetBool(CefString(key)); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_get_int(struct _cef_dictionary_value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -306,15 +307,15 @@ int CEF_CALLBACK dictionary_value_get_int(struct _cef_dictionary_value_t* self, return 0; // Execute - int _retval = CefDictionaryValueCppToC::Get(self)->GetInt( - CefString(key)); + int _retval = CefDictionaryValueCppToC::Get(self)->GetInt(CefString(key)); // Return type: simple return _retval; } -double CEF_CALLBACK dictionary_value_get_double( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +double CEF_CALLBACK +dictionary_value_get_double(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -326,15 +327,16 @@ double CEF_CALLBACK dictionary_value_get_double( return 0; // Execute - double _retval = CefDictionaryValueCppToC::Get(self)->GetDouble( - CefString(key)); + double _retval = + CefDictionaryValueCppToC::Get(self)->GetDouble(CefString(key)); // Return type: simple return _retval; } -cef_string_userfree_t CEF_CALLBACK dictionary_value_get_string( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +cef_string_userfree_t CEF_CALLBACK +dictionary_value_get_string(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -346,15 +348,16 @@ cef_string_userfree_t CEF_CALLBACK dictionary_value_get_string( return NULL; // Execute - CefString _retval = CefDictionaryValueCppToC::Get(self)->GetString( - CefString(key)); + CefString _retval = + CefDictionaryValueCppToC::Get(self)->GetString(CefString(key)); // Return type: string return _retval.DetachToUserFree(); } -cef_binary_value_t* CEF_CALLBACK dictionary_value_get_binary( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +cef_binary_value_t* CEF_CALLBACK +dictionary_value_get_binary(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -366,16 +369,16 @@ cef_binary_value_t* CEF_CALLBACK dictionary_value_get_binary( return NULL; // Execute - CefRefPtr _retval = CefDictionaryValueCppToC::Get( - self)->GetBinary( - CefString(key)); + CefRefPtr _retval = + CefDictionaryValueCppToC::Get(self)->GetBinary(CefString(key)); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } -struct _cef_dictionary_value_t* CEF_CALLBACK dictionary_value_get_dictionary( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +struct _cef_dictionary_value_t* CEF_CALLBACK +dictionary_value_get_dictionary(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -387,16 +390,16 @@ struct _cef_dictionary_value_t* CEF_CALLBACK dictionary_value_get_dictionary( return NULL; // Execute - CefRefPtr _retval = CefDictionaryValueCppToC::Get( - self)->GetDictionary( - CefString(key)); + CefRefPtr _retval = + CefDictionaryValueCppToC::Get(self)->GetDictionary(CefString(key)); // Return type: refptr_same return CefDictionaryValueCppToC::Wrap(_retval); } -struct _cef_list_value_t* CEF_CALLBACK dictionary_value_get_list( - struct _cef_dictionary_value_t* self, const cef_string_t* key) { +struct _cef_list_value_t* CEF_CALLBACK +dictionary_value_get_list(struct _cef_dictionary_value_t* self, + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -408,17 +411,17 @@ struct _cef_list_value_t* CEF_CALLBACK dictionary_value_get_list( return NULL; // Execute - CefRefPtr _retval = CefDictionaryValueCppToC::Get( - self)->GetList( - CefString(key)); + CefRefPtr _retval = + CefDictionaryValueCppToC::Get(self)->GetList(CefString(key)); // Return type: refptr_same return CefListValueCppToC::Wrap(_retval); } -int CEF_CALLBACK dictionary_value_set_value( - struct _cef_dictionary_value_t* self, const cef_string_t* key, - cef_value_t* value) { +int CEF_CALLBACK +dictionary_value_set_value(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + cef_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -435,15 +438,14 @@ int CEF_CALLBACK dictionary_value_set_value( // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetValue( - CefString(key), - CefValueCppToC::Unwrap(value)); + CefString(key), CefValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_set_null(struct _cef_dictionary_value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -455,15 +457,15 @@ int CEF_CALLBACK dictionary_value_set_null(struct _cef_dictionary_value_t* self, return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->SetNull( - CefString(key)); + bool _retval = CefDictionaryValueCppToC::Get(self)->SetNull(CefString(key)); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_set_bool(struct _cef_dictionary_value_t* self, - const cef_string_t* key, int value) { + const cef_string_t* key, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -476,15 +478,15 @@ int CEF_CALLBACK dictionary_value_set_bool(struct _cef_dictionary_value_t* self, // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetBool( - CefString(key), - value?true:false); + CefString(key), value ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_set_int(struct _cef_dictionary_value_t* self, - const cef_string_t* key, int value) { + const cef_string_t* key, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -496,17 +498,17 @@ int CEF_CALLBACK dictionary_value_set_int(struct _cef_dictionary_value_t* self, return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->SetInt( - CefString(key), - value); + bool _retval = + CefDictionaryValueCppToC::Get(self)->SetInt(CefString(key), value); // Return type: bool return _retval; } -int CEF_CALLBACK dictionary_value_set_double( - struct _cef_dictionary_value_t* self, const cef_string_t* key, - double value) { +int CEF_CALLBACK +dictionary_value_set_double(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -518,17 +520,17 @@ int CEF_CALLBACK dictionary_value_set_double( return 0; // Execute - bool _retval = CefDictionaryValueCppToC::Get(self)->SetDouble( - CefString(key), - value); + bool _retval = + CefDictionaryValueCppToC::Get(self)->SetDouble(CefString(key), value); // Return type: bool return _retval; } -int CEF_CALLBACK dictionary_value_set_string( - struct _cef_dictionary_value_t* self, const cef_string_t* key, - const cef_string_t* value) { +int CEF_CALLBACK +dictionary_value_set_string(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -542,16 +544,16 @@ int CEF_CALLBACK dictionary_value_set_string( // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetString( - CefString(key), - CefString(value)); + CefString(key), CefString(value)); // Return type: bool return _retval; } -int CEF_CALLBACK dictionary_value_set_binary( - struct _cef_dictionary_value_t* self, const cef_string_t* key, - cef_binary_value_t* value) { +int CEF_CALLBACK +dictionary_value_set_binary(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + cef_binary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -568,16 +570,16 @@ int CEF_CALLBACK dictionary_value_set_binary( // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetBinary( - CefString(key), - CefBinaryValueCppToC::Unwrap(value)); + CefString(key), CefBinaryValueCppToC::Unwrap(value)); // Return type: bool return _retval; } -int CEF_CALLBACK dictionary_value_set_dictionary( - struct _cef_dictionary_value_t* self, const cef_string_t* key, - struct _cef_dictionary_value_t* value) { +int CEF_CALLBACK +dictionary_value_set_dictionary(struct _cef_dictionary_value_t* self, + const cef_string_t* key, + struct _cef_dictionary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -594,15 +596,15 @@ int CEF_CALLBACK dictionary_value_set_dictionary( // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetDictionary( - CefString(key), - CefDictionaryValueCppToC::Unwrap(value)); + CefString(key), CefDictionaryValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK dictionary_value_set_list(struct _cef_dictionary_value_t* self, - const cef_string_t* key, struct _cef_list_value_t* value) { + const cef_string_t* key, + struct _cef_list_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -619,8 +621,7 @@ int CEF_CALLBACK dictionary_value_set_list(struct _cef_dictionary_value_t* self, // Execute bool _retval = CefDictionaryValueCppToC::Get(self)->SetList( - CefString(key), - CefListValueCppToC::Unwrap(value)); + CefString(key), CefListValueCppToC::Unwrap(value)); // Return type: bool return _retval; @@ -628,7 +629,6 @@ int CEF_CALLBACK dictionary_value_set_list(struct _cef_dictionary_value_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDictionaryValueCppToC::CefDictionaryValueCppToC() { @@ -663,18 +663,26 @@ CefDictionaryValueCppToC::CefDictionaryValueCppToC() { GetStruct()->set_list = dictionary_value_set_list; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_dictionary_value_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDictionaryValueCppToC, + CefDictionaryValue, + cef_dictionary_value_t>::UnwrapDerived(CefWrapperType type, + cef_dictionary_value_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DICTIONARY_VALUE; diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.h b/libcef_dll/cpptoc/dictionary_value_cpptoc.h index b939f493d..3a5b0868b 100644 --- a/libcef_dll/cpptoc/dictionary_value_cpptoc.h +++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b0a901bd2ae6396bc447587ed91f90b663159697$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DICTIONARY_VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DICTIONARY_VALUE_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDictionaryValueCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefDictionaryValueCppToC(); }; diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index 9d8618d54..cd699ba14 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -9,20 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=92456884efde30d533ac7761b12bb476b5856052$ +// #include "libcef_dll/cpptoc/display_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK display_handler_on_address_change( - struct _cef_display_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, const cef_string_t* url) { +void CEF_CALLBACK +display_handler_on_address_change(struct _cef_display_handler_t* self, + cef_browser_t* browser, + struct _cef_frame_t* frame, + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -43,14 +46,14 @@ void CEF_CALLBACK display_handler_on_address_change( // Execute CefDisplayHandlerCppToC::Get(self)->OnAddressChange( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), CefString(url)); } -void CEF_CALLBACK display_handler_on_title_change( - struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* title) { +void CEF_CALLBACK +display_handler_on_title_change(struct _cef_display_handler_t* self, + cef_browser_t* browser, + const cef_string_t* title) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,13 +67,13 @@ void CEF_CALLBACK display_handler_on_title_change( // Execute CefDisplayHandlerCppToC::Get(self)->OnTitleChange( - CefBrowserCToCpp::Wrap(browser), - CefString(title)); + CefBrowserCToCpp::Wrap(browser), CefString(title)); } -void CEF_CALLBACK display_handler_on_favicon_urlchange( - struct _cef_display_handler_t* self, cef_browser_t* browser, - cef_string_list_t icon_urls) { +void CEF_CALLBACK +display_handler_on_favicon_urlchange(struct _cef_display_handler_t* self, + cef_browser_t* browser, + cef_string_list_t icon_urls) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,13 +91,13 @@ void CEF_CALLBACK display_handler_on_favicon_urlchange( // Execute CefDisplayHandlerCppToC::Get(self)->OnFaviconURLChange( - CefBrowserCToCpp::Wrap(browser), - icon_urlsList); + CefBrowserCToCpp::Wrap(browser), icon_urlsList); } -void CEF_CALLBACK display_handler_on_fullscreen_mode_change( - struct _cef_display_handler_t* self, cef_browser_t* browser, - int fullscreen) { +void CEF_CALLBACK +display_handler_on_fullscreen_mode_change(struct _cef_display_handler_t* self, + cef_browser_t* browser, + int fullscreen) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,12 +110,12 @@ void CEF_CALLBACK display_handler_on_fullscreen_mode_change( // Execute CefDisplayHandlerCppToC::Get(self)->OnFullscreenModeChange( - CefBrowserCToCpp::Wrap(browser), - fullscreen?true:false); + CefBrowserCToCpp::Wrap(browser), fullscreen ? true : false); } int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, - cef_browser_t* browser, cef_string_t* text) { + cef_browser_t* browser, + cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -129,16 +132,16 @@ int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, // Execute bool _retval = CefDisplayHandlerCppToC::Get(self)->OnTooltip( - CefBrowserCToCpp::Wrap(browser), - textStr); + CefBrowserCToCpp::Wrap(browser), textStr); // Return type: bool return _retval; } -void CEF_CALLBACK display_handler_on_status_message( - struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* value) { +void CEF_CALLBACK +display_handler_on_status_message(struct _cef_display_handler_t* self, + cef_browser_t* browser, + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -152,13 +155,15 @@ void CEF_CALLBACK display_handler_on_status_message( // Execute CefDisplayHandlerCppToC::Get(self)->OnStatusMessage( - CefBrowserCToCpp::Wrap(browser), - CefString(value)); + CefBrowserCToCpp::Wrap(browser), CefString(value)); } -int CEF_CALLBACK display_handler_on_console_message( - struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* message, const cef_string_t* source, int line) { +int CEF_CALLBACK +display_handler_on_console_message(struct _cef_display_handler_t* self, + cef_browser_t* browser, + const cef_string_t* message, + const cef_string_t* source, + int line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -172,9 +177,7 @@ int CEF_CALLBACK display_handler_on_console_message( // Execute bool _retval = CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage( - CefBrowserCToCpp::Wrap(browser), - CefString(message), - CefString(source), + CefBrowserCToCpp::Wrap(browser), CefString(message), CefString(source), line); // Return type: bool @@ -183,7 +186,6 @@ int CEF_CALLBACK display_handler_on_console_message( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDisplayHandlerCppToC::CefDisplayHandlerCppToC() { @@ -197,18 +199,25 @@ CefDisplayHandlerCppToC::CefDisplayHandlerCppToC() { GetStruct()->on_console_message = display_handler_on_console_message; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_display_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDisplayHandlerCppToC, + CefDisplayHandler, + cef_display_handler_t>::UnwrapDerived(CefWrapperType type, + cef_display_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DISPLAY_HANDLER; diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h index f999d7733..4f10a0154 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.h +++ b/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=25d9fba9bd05e09d69e853e2ab02b3a187166b7f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_display_handler.h" #include "include/capi/cef_display_handler_capi.h" +#include "include/cef_display_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDisplayHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefDisplayHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc index 943e41100..0d967eb0c 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.cc +++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bf4251a1aeebda1ec6014743d22a9617852fe5cc$ +// #include "libcef_dll/cpptoc/domdocument_cpptoc.h" #include "libcef_dll/cpptoc/domnode_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( - struct _cef_domdocument_t* self) { +cef_dom_document_type_t CEF_CALLBACK +domdocument_get_type(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +34,8 @@ cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( return _retval; } -struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( - struct _cef_domdocument_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domdocument_get_document(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -42,15 +43,15 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( return NULL; // Execute - CefRefPtr _retval = CefDOMDocumentCppToC::Get(self)->GetDocument( - ); + CefRefPtr _retval = + CefDOMDocumentCppToC::Get(self)->GetDocument(); // Return type: refptr_same return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( - struct _cef_domdocument_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domdocument_get_body(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +65,8 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( - struct _cef_domdocument_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domdocument_get_head(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,8 +80,8 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( return CefDOMNodeCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK domdocument_get_title( - struct _cef_domdocument_t* self) { +cef_string_userfree_t CEF_CALLBACK +domdocument_get_title(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -94,8 +95,9 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_title( return _retval.DetachToUserFree(); } -struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( - struct _cef_domdocument_t* self, const cef_string_t* id) { +struct _cef_domnode_t* CEF_CALLBACK +domdocument_get_element_by_id(struct _cef_domdocument_t* self, + const cef_string_t* id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,16 +109,15 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( return NULL; // Execute - CefRefPtr _retval = CefDOMDocumentCppToC::Get( - self)->GetElementById( - CefString(id)); + CefRefPtr _retval = + CefDOMDocumentCppToC::Get(self)->GetElementById(CefString(id)); // Return type: refptr_same return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( - struct _cef_domdocument_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domdocument_get_focused_node(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,8 +125,8 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( return NULL; // Execute - CefRefPtr _retval = CefDOMDocumentCppToC::Get( - self)->GetFocusedNode(); + CefRefPtr _retval = + CefDOMDocumentCppToC::Get(self)->GetFocusedNode(); // Return type: refptr_same return CefDOMNodeCppToC::Wrap(_retval); @@ -145,8 +146,8 @@ int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) { return _retval; } -int CEF_CALLBACK domdocument_get_selection_start_offset( - struct _cef_domdocument_t* self) { +int CEF_CALLBACK +domdocument_get_selection_start_offset(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -160,8 +161,8 @@ int CEF_CALLBACK domdocument_get_selection_start_offset( return _retval; } -int CEF_CALLBACK domdocument_get_selection_end_offset( - struct _cef_domdocument_t* self) { +int CEF_CALLBACK +domdocument_get_selection_end_offset(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -175,8 +176,8 @@ int CEF_CALLBACK domdocument_get_selection_end_offset( return _retval; } -cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( - struct _cef_domdocument_t* self) { +cef_string_userfree_t CEF_CALLBACK +domdocument_get_selection_as_markup(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -190,8 +191,8 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( - struct _cef_domdocument_t* self) { +cef_string_userfree_t CEF_CALLBACK +domdocument_get_selection_as_text(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -205,8 +206,8 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( - struct _cef_domdocument_t* self) { +cef_string_userfree_t CEF_CALLBACK +domdocument_get_base_url(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -220,8 +221,9 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( - struct _cef_domdocument_t* self, const cef_string_t* partialURL) { +cef_string_userfree_t CEF_CALLBACK +domdocument_get_complete_url(struct _cef_domdocument_t* self, + const cef_string_t* partialURL) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -233,8 +235,8 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( return NULL; // Execute - CefString _retval = CefDOMDocumentCppToC::Get(self)->GetCompleteURL( - CefString(partialURL)); + CefString _retval = + CefDOMDocumentCppToC::Get(self)->GetCompleteURL(CefString(partialURL)); // Return type: string return _retval.DetachToUserFree(); @@ -242,7 +244,6 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDOMDocumentCppToC::CefDOMDocumentCppToC() { @@ -263,17 +264,23 @@ CefDOMDocumentCppToC::CefDOMDocumentCppToC() { GetStruct()->get_complete_url = domdocument_get_complete_url; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_domdocument_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_domdocument_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMDOCUMENT; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DOMDOCUMENT; diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h index 4b65bdeeb..b5115a46b 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.h +++ b/libcef_dll/cpptoc/domdocument_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=76d6347dea785e1309bcb918ac0d9dcb77fa9d24$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefDOMDocumentCppToC - : public CefCppToCRefCounted { +class CefDOMDocumentCppToC : public CefCppToCRefCounted { public: CefDOMDocumentCppToC(); }; diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc index 2eaf515b2..e2d7b103f 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.cc +++ b/libcef_dll/cpptoc/domnode_cpptoc.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=160a85714fa66da2e5e8ce95b0fd14daaabcbfdf$ +// #include "libcef_dll/cpptoc/domdocument_cpptoc.h" #include "libcef_dll/cpptoc/domnode_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -89,8 +90,8 @@ int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_form_control_element_type(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -105,7 +106,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( } int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, - struct _cef_domnode_t* that) { + struct _cef_domnode_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -117,15 +118,15 @@ int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, return 0; // Execute - bool _retval = CefDOMNodeCppToC::Get(self)->IsSame( - CefDOMNodeCppToC::Unwrap(that)); + bool _retval = + CefDOMNodeCppToC::Get(self)->IsSame(CefDOMNodeCppToC::Unwrap(that)); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_name( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_name(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +140,8 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK domnode_get_value( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_value(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -155,7 +156,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_value( } int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, - const cef_string_t* value) { + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -167,15 +168,14 @@ int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, return 0; // Execute - bool _retval = CefDOMNodeCppToC::Get(self)->SetValue( - CefString(value)); + bool _retval = CefDOMNodeCppToC::Get(self)->SetValue(CefString(value)); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_as_markup(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -189,8 +189,8 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( return _retval.DetachToUserFree(); } -cef_domdocument_t* CEF_CALLBACK domnode_get_document( - struct _cef_domnode_t* self) { +cef_domdocument_t* CEF_CALLBACK +domnode_get_document(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -198,15 +198,15 @@ cef_domdocument_t* CEF_CALLBACK domnode_get_document( return NULL; // Execute - CefRefPtr _retval = CefDOMNodeCppToC::Get(self)->GetDocument( - ); + CefRefPtr _retval = + CefDOMNodeCppToC::Get(self)->GetDocument(); // Return type: refptr_same return CefDOMDocumentCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( - struct _cef_domnode_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domnode_get_parent(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -220,8 +220,8 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( - struct _cef_domnode_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domnode_get_previous_sibling(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -229,15 +229,15 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( return NULL; // Execute - CefRefPtr _retval = CefDOMNodeCppToC::Get( - self)->GetPreviousSibling(); + CefRefPtr _retval = + CefDOMNodeCppToC::Get(self)->GetPreviousSibling(); // Return type: refptr_same return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( - struct _cef_domnode_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domnode_get_next_sibling(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -265,8 +265,8 @@ int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) { return _retval; } -struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( - struct _cef_domnode_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domnode_get_first_child(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -280,8 +280,8 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( return CefDOMNodeCppToC::Wrap(_retval); } -struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( - struct _cef_domnode_t* self) { +struct _cef_domnode_t* CEF_CALLBACK +domnode_get_last_child(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -295,8 +295,8 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( return CefDOMNodeCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_element_tag_name(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -325,7 +325,7 @@ int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) { } int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, - const cef_string_t* attrName) { + const cef_string_t* attrName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -337,15 +337,16 @@ int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, return 0; // Execute - bool _retval = CefDOMNodeCppToC::Get(self)->HasElementAttribute( - CefString(attrName)); + bool _retval = + CefDOMNodeCppToC::Get(self)->HasElementAttribute(CefString(attrName)); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( - struct _cef_domnode_t* self, const cef_string_t* attrName) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_element_attribute(struct _cef_domnode_t* self, + const cef_string_t* attrName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -357,15 +358,15 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( return NULL; // Execute - CefString _retval = CefDOMNodeCppToC::Get(self)->GetElementAttribute( - CefString(attrName)); + CefString _retval = + CefDOMNodeCppToC::Get(self)->GetElementAttribute(CefString(attrName)); // Return type: string return _retval.DetachToUserFree(); } void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, - cef_string_map_t attrMap) { + cef_string_map_t attrMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -381,8 +382,7 @@ void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, transfer_string_map_contents(attrMap, attrMapMap); // Execute - CefDOMNodeCppToC::Get(self)->GetElementAttributes( - attrMapMap); + CefDOMNodeCppToC::Get(self)->GetElementAttributes(attrMapMap); // Restore param: attrMap; type: string_map_single_byref cef_string_map_clear(attrMap); @@ -390,7 +390,8 @@ void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, } int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, - const cef_string_t* attrName, const cef_string_t* value) { + const cef_string_t* attrName, + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -407,15 +408,14 @@ int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, // Execute bool _retval = CefDOMNodeCppToC::Get(self)->SetElementAttribute( - CefString(attrName), - CefString(value)); + CefString(attrName), CefString(value)); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( - struct _cef_domnode_t* self) { +cef_string_userfree_t CEF_CALLBACK +domnode_get_element_inner_text(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -429,8 +429,8 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( return _retval.DetachToUserFree(); } -cef_rect_t CEF_CALLBACK domnode_get_element_bounds( - struct _cef_domnode_t* self) { +cef_rect_t CEF_CALLBACK +domnode_get_element_bounds(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -446,7 +446,6 @@ cef_rect_t CEF_CALLBACK domnode_get_element_bounds( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDOMNodeCppToC::CefDOMNodeCppToC() { @@ -479,17 +478,23 @@ CefDOMNodeCppToC::CefDOMNodeCppToC() { GetStruct()->get_element_bounds = domnode_get_element_bounds; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_domnode_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMNODE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMNODE; diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h index a5e6c2c69..03b26e461 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.h +++ b/libcef_dll/cpptoc/domnode_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=80408ad6108c3e99d477b1311fec25bb2eef8dc8$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc index fb803c4da..b0eb21cc9 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=de24c7c2b66d08aff8d9fc36cc35419345503840$ +// #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" #include "libcef_dll/ctocpp/domdocument_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, - struct _cef_domdocument_t* document) { + struct _cef_domdocument_t* document) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,30 +32,34 @@ void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, return; // Execute - CefDOMVisitorCppToC::Get(self)->Visit( - CefDOMDocumentCToCpp::Wrap(document)); + CefDOMVisitorCppToC::Get(self)->Visit(CefDOMDocumentCToCpp::Wrap(document)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDOMVisitorCppToC::CefDOMVisitorCppToC() { GetStruct()->visit = domvisitor_visit; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_domvisitor_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_domvisitor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMVISITOR; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DOMVISITOR; diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h index 520ed6f50..a0fb2ce81 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.h +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9bb7487a5f6db84031a7b3fbb62a1954f54cafee$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefDOMVisitorCppToC - : public CefCppToCRefCounted { +class CefDOMVisitorCppToC : public CefCppToCRefCounted { public: CefDOMVisitorCppToC(); }; diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc index 646fcde75..75d27451e 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -9,23 +9,25 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=34d34f4a980b476678152ac69842f7d0b3a95a36$ +// #include "libcef_dll/cpptoc/download_handler_cpptoc.h" #include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" -#include "libcef_dll/ctocpp/download_item_ctocpp.h" #include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" - +#include "libcef_dll/ctocpp/download_item_ctocpp.h" namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK download_handler_on_before_download( - struct _cef_download_handler_t* self, cef_browser_t* browser, - struct _cef_download_item_t* download_item, - const cef_string_t* suggested_name, - cef_before_download_callback_t* callback) { +void CEF_CALLBACK +download_handler_on_before_download(struct _cef_download_handler_t* self, + cef_browser_t* browser, + struct _cef_download_item_t* download_item, + const cef_string_t* suggested_name, + cef_before_download_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,15 +53,15 @@ void CEF_CALLBACK download_handler_on_before_download( // Execute CefDownloadHandlerCppToC::Get(self)->OnBeforeDownload( CefBrowserCToCpp::Wrap(browser), - CefDownloadItemCToCpp::Wrap(download_item), - CefString(suggested_name), + CefDownloadItemCToCpp::Wrap(download_item), CefString(suggested_name), CefBeforeDownloadCallbackCToCpp::Wrap(callback)); } -void CEF_CALLBACK download_handler_on_download_updated( - struct _cef_download_handler_t* self, cef_browser_t* browser, - struct _cef_download_item_t* download_item, - cef_download_item_callback_t* callback) { +void CEF_CALLBACK +download_handler_on_download_updated(struct _cef_download_handler_t* self, + cef_browser_t* browser, + struct _cef_download_item_t* download_item, + cef_download_item_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,7 +89,6 @@ void CEF_CALLBACK download_handler_on_download_updated( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDownloadHandlerCppToC::CefDownloadHandlerCppToC() { @@ -95,18 +96,26 @@ CefDownloadHandlerCppToC::CefDownloadHandlerCppToC() { GetStruct()->on_download_updated = download_handler_on_download_updated; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_download_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDownloadHandlerCppToC, + CefDownloadHandler, + cef_download_handler_t>::UnwrapDerived(CefWrapperType type, + cef_download_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOWNLOAD_HANDLER; diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h index 9af10db5a..6d6d39550 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.h +++ b/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ea474f115d17588ffd70398adbc70bea8f744949$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDownloadHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefDownloadHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/download_image_callback_cpptoc.cc b/libcef_dll/cpptoc/download_image_callback_cpptoc.cc index 85dc48c50..ba5a0c4fc 100644 --- a/libcef_dll/cpptoc/download_image_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/download_image_callback_cpptoc.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=14b41457d2b33e31d9be5815c704c28420ec6b24$ +// #include "libcef_dll/cpptoc/download_image_callback_cpptoc.h" #include "libcef_dll/ctocpp/image_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK download_image_callback_on_download_image_finished( - struct _cef_download_image_callback_t* self, const cef_string_t* image_url, - int http_status_code, struct _cef_image_t* image) { + struct _cef_download_image_callback_t* self, + const cef_string_t* image_url, + int http_status_code, + struct _cef_image_t* image) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,14 +37,11 @@ void CEF_CALLBACK download_image_callback_on_download_image_finished( // Execute CefDownloadImageCallbackCppToC::Get(self)->OnDownloadImageFinished( - CefString(image_url), - http_status_code, - CefImageCToCpp::Wrap(image)); + CefString(image_url), http_status_code, CefImageCToCpp::Wrap(image)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDownloadImageCallbackCppToC::CefDownloadImageCallbackCppToC() { @@ -49,18 +49,28 @@ CefDownloadImageCallbackCppToC::CefDownloadImageCallbackCppToC() { download_image_callback_on_download_image_finished; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_download_image_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDownloadImageCallbackCppToC, + CefDownloadImageCallback, + cef_download_image_callback_t>::UnwrapDerived(CefWrapperType type, + cef_download_image_callback_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_DOWNLOAD_IMAGE_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_DOWNLOAD_IMAGE_CALLBACK; diff --git a/libcef_dll/cpptoc/download_image_callback_cpptoc.h b/libcef_dll/cpptoc/download_image_callback_cpptoc.h index 6a5c27390..4ed9cf611 100644 --- a/libcef_dll/cpptoc/download_image_callback_cpptoc.h +++ b/libcef_dll/cpptoc/download_image_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9d3659cb00df64ef14776c0029357cbf06081a80$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_IMAGE_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_IMAGE_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDownloadImageCallbackCppToC : public CefCppToCRefCounted { + CefDownloadImageCallback, + cef_download_image_callback_t> { public: CefDownloadImageCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc index 1b5882427..6eddb5820 100644 --- a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=04aede4dd7d7d8ab90fa4d27537f1dd4c19501e7$ +// #include "libcef_dll/cpptoc/download_item_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK download_item_callback_cancel( - struct _cef_download_item_callback_t* self) { +void CEF_CALLBACK +download_item_callback_cancel(struct _cef_download_item_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,8 +30,8 @@ void CEF_CALLBACK download_item_callback_cancel( CefDownloadItemCallbackCppToC::Get(self)->Cancel(); } -void CEF_CALLBACK download_item_callback_pause( - struct _cef_download_item_callback_t* self) { +void CEF_CALLBACK +download_item_callback_pause(struct _cef_download_item_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -41,8 +42,8 @@ void CEF_CALLBACK download_item_callback_pause( CefDownloadItemCallbackCppToC::Get(self)->Pause(); } -void CEF_CALLBACK download_item_callback_resume( - struct _cef_download_item_callback_t* self) { +void CEF_CALLBACK +download_item_callback_resume(struct _cef_download_item_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -55,7 +56,6 @@ void CEF_CALLBACK download_item_callback_resume( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDownloadItemCallbackCppToC::CefDownloadItemCallbackCppToC() { @@ -64,18 +64,27 @@ CefDownloadItemCallbackCppToC::CefDownloadItemCallbackCppToC() { GetStruct()->resume = download_item_callback_resume; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_download_item_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDownloadItemCallbackCppToC, + CefDownloadItemCallback, + cef_download_item_callback_t>::UnwrapDerived(CefWrapperType type, + cef_download_item_callback_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOWNLOAD_ITEM_CALLBACK; diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.h b/libcef_dll/cpptoc/download_item_callback_cpptoc.h index e4b8ce5e1..652fb8580 100644 --- a/libcef_dll/cpptoc/download_item_callback_cpptoc.h +++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f24431dac500b3ce7b0f554340d8b96c7b84ff08$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDownloadItemCallbackCppToC : public CefCppToCRefCounted { + CefDownloadItemCallback, + cef_download_item_callback_t> { public: CefDownloadItemCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/download_item_cpptoc.cc b/libcef_dll/cpptoc/download_item_cpptoc.cc index 75d3a5bbb..afa5cd9d9 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8406edcb1d9c418e704ebbc3ccad44dc4ca84244$ +// #include "libcef_dll/cpptoc/download_item_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -31,8 +32,8 @@ int CEF_CALLBACK download_item_is_valid(struct _cef_download_item_t* self) { return _retval; } -int CEF_CALLBACK download_item_is_in_progress( - struct _cef_download_item_t* self) { +int CEF_CALLBACK +download_item_is_in_progress(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,8 +75,8 @@ int CEF_CALLBACK download_item_is_canceled(struct _cef_download_item_t* self) { return _retval; } -int64 CEF_CALLBACK download_item_get_current_speed( - struct _cef_download_item_t* self) { +int64 CEF_CALLBACK +download_item_get_current_speed(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -89,8 +90,8 @@ int64 CEF_CALLBACK download_item_get_current_speed( return _retval; } -int CEF_CALLBACK download_item_get_percent_complete( - struct _cef_download_item_t* self) { +int CEF_CALLBACK +download_item_get_percent_complete(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,8 +105,8 @@ int CEF_CALLBACK download_item_get_percent_complete( return _retval; } -int64 CEF_CALLBACK download_item_get_total_bytes( - struct _cef_download_item_t* self) { +int64 CEF_CALLBACK +download_item_get_total_bytes(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -119,8 +120,8 @@ int64 CEF_CALLBACK download_item_get_total_bytes( return _retval; } -int64 CEF_CALLBACK download_item_get_received_bytes( - struct _cef_download_item_t* self) { +int64 CEF_CALLBACK +download_item_get_received_bytes(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -134,8 +135,8 @@ int64 CEF_CALLBACK download_item_get_received_bytes( return _retval; } -cef_time_t CEF_CALLBACK download_item_get_start_time( - struct _cef_download_item_t* self) { +cef_time_t CEF_CALLBACK +download_item_get_start_time(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -149,8 +150,8 @@ cef_time_t CEF_CALLBACK download_item_get_start_time( return _retval; } -cef_time_t CEF_CALLBACK download_item_get_end_time( - struct _cef_download_item_t* self) { +cef_time_t CEF_CALLBACK +download_item_get_end_time(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -164,8 +165,8 @@ cef_time_t CEF_CALLBACK download_item_get_end_time( return _retval; } -cef_string_userfree_t CEF_CALLBACK download_item_get_full_path( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_full_path(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -193,8 +194,8 @@ uint32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK download_item_get_url( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_url(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -208,8 +209,8 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK download_item_get_original_url( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_original_url(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -223,8 +224,8 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_original_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK download_item_get_suggested_file_name( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_suggested_file_name(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -238,8 +239,8 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_suggested_file_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK download_item_get_content_disposition( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_content_disposition(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,8 +254,8 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_content_disposition( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK download_item_get_mime_type( - struct _cef_download_item_t* self) { +cef_string_userfree_t CEF_CALLBACK +download_item_get_mime_type(struct _cef_download_item_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -270,7 +271,6 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_mime_type( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDownloadItemCppToC::CefDownloadItemCppToC() { @@ -293,17 +293,25 @@ CefDownloadItemCppToC::CefDownloadItemCppToC() { GetStruct()->get_mime_type = download_item_get_mime_type; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_download_item_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefDownloadItemCppToC, + CefDownloadItem, + cef_download_item_t>::UnwrapDerived(CefWrapperType type, + cef_download_item_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOWNLOAD_ITEM; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DOWNLOAD_ITEM; diff --git a/libcef_dll/cpptoc/download_item_cpptoc.h b/libcef_dll/cpptoc/download_item_cpptoc.h index 83acbea17..bc73b87fc 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.h +++ b/libcef_dll/cpptoc/download_item_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4e5d46b2a6471130534f09cea30f7672761af5e1$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_download_item.h" #include "include/capi/cef_download_item_capi.h" +#include "include/cef_download_item.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefDownloadItemCppToC - : public CefCppToCRefCounted { +class CefDownloadItemCppToC : public CefCppToCRefCounted { public: CefDownloadItemCppToC(); }; diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc index 01a397932..0d5811a7d 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=99a670d8fc60380f091a97bc9e8bb35d0e1e9c02$ +// #include "libcef_dll/cpptoc/drag_data_cpptoc.h" #include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/stream_writer_cpptoc.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_drag_data_t* cef_drag_data_create() { @@ -28,13 +29,12 @@ CEF_EXPORT cef_drag_data_t* cef_drag_data_create() { return CefDragDataCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -struct _cef_drag_data_t* CEF_CALLBACK drag_data_clone( - struct _cef_drag_data_t* self) { +struct _cef_drag_data_t* CEF_CALLBACK +drag_data_clone(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,8 +104,8 @@ int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_link_url(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -119,8 +119,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_link_title(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -134,8 +134,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_link_metadata(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -149,8 +149,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_fragment_text(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -164,8 +164,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_fragment_html(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -179,8 +179,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_fragment_base_url(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -194,8 +194,8 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( - struct _cef_drag_data_t* self) { +cef_string_userfree_t CEF_CALLBACK +drag_data_get_file_name(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -209,8 +209,9 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( return _retval.DetachToUserFree(); } -size_t CEF_CALLBACK drag_data_get_file_contents(struct _cef_drag_data_t* self, - struct _cef_stream_writer_t* writer) { +size_t CEF_CALLBACK +drag_data_get_file_contents(struct _cef_drag_data_t* self, + struct _cef_stream_writer_t* writer) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -227,7 +228,7 @@ size_t CEF_CALLBACK drag_data_get_file_contents(struct _cef_drag_data_t* self, } int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, - cef_string_list_t names) { + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -243,8 +244,7 @@ int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, transfer_string_list_contents(names, namesList); // Execute - bool _retval = CefDragDataCppToC::Get(self)->GetFileNames( - namesList); + bool _retval = CefDragDataCppToC::Get(self)->GetFileNames(namesList); // Restore param: names; type: string_vec_byref cef_string_list_clear(names); @@ -255,7 +255,7 @@ int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, } void CEF_CALLBACK drag_data_set_link_url(struct _cef_drag_data_t* self, - const cef_string_t* url) { + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -264,12 +264,11 @@ void CEF_CALLBACK drag_data_set_link_url(struct _cef_drag_data_t* self, // Unverified params: url // Execute - CefDragDataCppToC::Get(self)->SetLinkURL( - CefString(url)); + CefDragDataCppToC::Get(self)->SetLinkURL(CefString(url)); } void CEF_CALLBACK drag_data_set_link_title(struct _cef_drag_data_t* self, - const cef_string_t* title) { + const cef_string_t* title) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -278,12 +277,11 @@ void CEF_CALLBACK drag_data_set_link_title(struct _cef_drag_data_t* self, // Unverified params: title // Execute - CefDragDataCppToC::Get(self)->SetLinkTitle( - CefString(title)); + CefDragDataCppToC::Get(self)->SetLinkTitle(CefString(title)); } void CEF_CALLBACK drag_data_set_link_metadata(struct _cef_drag_data_t* self, - const cef_string_t* data) { + const cef_string_t* data) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -292,12 +290,11 @@ void CEF_CALLBACK drag_data_set_link_metadata(struct _cef_drag_data_t* self, // Unverified params: data // Execute - CefDragDataCppToC::Get(self)->SetLinkMetadata( - CefString(data)); + CefDragDataCppToC::Get(self)->SetLinkMetadata(CefString(data)); } void CEF_CALLBACK drag_data_set_fragment_text(struct _cef_drag_data_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -306,12 +303,11 @@ void CEF_CALLBACK drag_data_set_fragment_text(struct _cef_drag_data_t* self, // Unverified params: text // Execute - CefDragDataCppToC::Get(self)->SetFragmentText( - CefString(text)); + CefDragDataCppToC::Get(self)->SetFragmentText(CefString(text)); } void CEF_CALLBACK drag_data_set_fragment_html(struct _cef_drag_data_t* self, - const cef_string_t* html) { + const cef_string_t* html) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -320,12 +316,12 @@ void CEF_CALLBACK drag_data_set_fragment_html(struct _cef_drag_data_t* self, // Unverified params: html // Execute - CefDragDataCppToC::Get(self)->SetFragmentHtml( - CefString(html)); + CefDragDataCppToC::Get(self)->SetFragmentHtml(CefString(html)); } -void CEF_CALLBACK drag_data_set_fragment_base_url(struct _cef_drag_data_t* self, - const cef_string_t* base_url) { +void CEF_CALLBACK +drag_data_set_fragment_base_url(struct _cef_drag_data_t* self, + const cef_string_t* base_url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -334,8 +330,7 @@ void CEF_CALLBACK drag_data_set_fragment_base_url(struct _cef_drag_data_t* self, // Unverified params: base_url // Execute - CefDragDataCppToC::Get(self)->SetFragmentBaseURL( - CefString(base_url)); + CefDragDataCppToC::Get(self)->SetFragmentBaseURL(CefString(base_url)); } void CEF_CALLBACK drag_data_reset_file_contents(struct _cef_drag_data_t* self) { @@ -350,7 +345,8 @@ void CEF_CALLBACK drag_data_reset_file_contents(struct _cef_drag_data_t* self) { } void CEF_CALLBACK drag_data_add_file(struct _cef_drag_data_t* self, - const cef_string_t* path, const cef_string_t* display_name) { + const cef_string_t* path, + const cef_string_t* display_name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -363,13 +359,12 @@ void CEF_CALLBACK drag_data_add_file(struct _cef_drag_data_t* self, // Unverified params: display_name // Execute - CefDragDataCppToC::Get(self)->AddFile( - CefString(path), - CefString(display_name)); + CefDragDataCppToC::Get(self)->AddFile(CefString(path), + CefString(display_name)); } -struct _cef_image_t* CEF_CALLBACK drag_data_get_image( - struct _cef_drag_data_t* self) { +struct _cef_image_t* CEF_CALLBACK +drag_data_get_image(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -383,8 +378,8 @@ struct _cef_image_t* CEF_CALLBACK drag_data_get_image( return CefImageCppToC::Wrap(_retval); } -cef_point_t CEF_CALLBACK drag_data_get_image_hotspot( - struct _cef_drag_data_t* self) { +cef_point_t CEF_CALLBACK +drag_data_get_image_hotspot(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -414,7 +409,6 @@ int CEF_CALLBACK drag_data_has_image(struct _cef_drag_data_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDragDataCppToC::CefDragDataCppToC() { @@ -445,17 +439,23 @@ CefDragDataCppToC::CefDragDataCppToC() { GetStruct()->has_image = drag_data_has_image; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_drag_data_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_drag_data_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DRAG_DATA; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DRAG_DATA; diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h index a21043703..00a60a65b 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.h +++ b/libcef_dll/cpptoc/drag_data_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6b2970a638285f00c7f4e8508ef012cd41fcdf34$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_drag_data.h" #include "include/capi/cef_drag_data_capi.h" +#include "include/cef_drag_data.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefDragDataCppToC - : public CefCppToCRefCounted { +class CefDragDataCppToC : public CefCppToCRefCounted { public: CefDragDataCppToC(); }; diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc index fd9f3adfb..8cbc6f54d 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -9,19 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f56cb888482bc594b34fb05729c0cab9577c306e$ +// #include "libcef_dll/cpptoc/drag_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/drag_data_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, - cef_browser_t* browser, cef_drag_data_t* dragData, - cef_drag_operations_mask_t mask) { + cef_browser_t* browser, + cef_drag_data_t* dragData, + cef_drag_operations_mask_t mask) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -38,17 +40,17 @@ int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, // Execute bool _retval = CefDragHandlerCppToC::Get(self)->OnDragEnter( - CefBrowserCToCpp::Wrap(browser), - CefDragDataCToCpp::Wrap(dragData), - mask); + CefBrowserCToCpp::Wrap(browser), CefDragDataCToCpp::Wrap(dragData), mask); // Return type: bool return _retval; } void CEF_CALLBACK drag_handler_on_draggable_regions_changed( - struct _cef_drag_handler_t* self, cef_browser_t* browser, - size_t regionsCount, cef_draggable_region_t const* regions) { + struct _cef_drag_handler_t* self, + cef_browser_t* browser, + size_t regionsCount, + cef_draggable_region_t const* regions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,7 +66,7 @@ void CEF_CALLBACK drag_handler_on_draggable_regions_changed( return; // Translate param: regions; type: simple_vec_byref_const - std::vector regionsList; + std::vector regionsList; if (regionsCount > 0) { for (size_t i = 0; i < regionsCount; ++i) { CefDraggableRegion regionsVal = regions[i]; @@ -74,13 +76,11 @@ void CEF_CALLBACK drag_handler_on_draggable_regions_changed( // Execute CefDragHandlerCppToC::Get(self)->OnDraggableRegionsChanged( - CefBrowserCToCpp::Wrap(browser), - regionsList); + CefBrowserCToCpp::Wrap(browser), regionsList); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDragHandlerCppToC::CefDragHandlerCppToC() { @@ -89,17 +89,23 @@ CefDragHandlerCppToC::CefDragHandlerCppToC() { drag_handler_on_draggable_regions_changed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_drag_handler_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_drag_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DRAG_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_DRAG_HANDLER; diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h index 3704d3acb..928c3d042 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.h +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3c820669b7702114ed93006a231a0f01422ed629$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_drag_handler.h" #include "include/capi/cef_drag_handler_capi.h" +#include "include/cef_drag_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefDragHandlerCppToC - : public CefCppToCRefCounted { +class CefDragHandlerCppToC : public CefCppToCRefCounted { public: CefDragHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc index b2931b567..4901bd4cc 100644 --- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9a1b77364fd21f18c0bdbdec1b7abca0f6867323$ +// #include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -37,7 +38,6 @@ void CEF_CALLBACK end_tracing_callback_on_end_tracing_complete( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC() { @@ -45,18 +45,26 @@ CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC() { end_tracing_callback_on_end_tracing_complete; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_end_tracing_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefEndTracingCallbackCppToC, + CefEndTracingCallback, + cef_end_tracing_callback_t>::UnwrapDerived(CefWrapperType type, + cef_end_tracing_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_END_TRACING_CALLBACK; diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h index 892547787..273384b21 100644 --- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h +++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a358f21b2b2c5923476110bf59aebd9f35f65184$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_trace.h" #include "include/capi/cef_trace_capi.h" +#include "include/cef_trace.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefEndTracingCallbackCppToC : public CefCppToCRefCounted { + CefEndTracingCallback, + cef_end_tracing_callback_t> { public: CefEndTracingCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc index 78173e430..f13ed799a 100644 --- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ab0b610cd180d3930cfcea8c97ce960b1c6cfe43$ +// #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK file_dialog_callback_cont( - struct _cef_file_dialog_callback_t* self, int selected_accept_filter, - cef_string_list_t file_paths) { +void CEF_CALLBACK +file_dialog_callback_cont(struct _cef_file_dialog_callback_t* self, + int selected_accept_filter, + cef_string_list_t file_paths) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -37,13 +39,12 @@ void CEF_CALLBACK file_dialog_callback_cont( transfer_string_list_contents(file_paths, file_pathsList); // Execute - CefFileDialogCallbackCppToC::Get(self)->Continue( - selected_accept_filter, - file_pathsList); + CefFileDialogCallbackCppToC::Get(self)->Continue(selected_accept_filter, + file_pathsList); } -void CEF_CALLBACK file_dialog_callback_cancel( - struct _cef_file_dialog_callback_t* self) { +void CEF_CALLBACK +file_dialog_callback_cancel(struct _cef_file_dialog_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,7 +57,6 @@ void CEF_CALLBACK file_dialog_callback_cancel( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC() { @@ -64,18 +64,26 @@ CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC() { GetStruct()->cancel = file_dialog_callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_file_dialog_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefFileDialogCallbackCppToC, + CefFileDialogCallback, + cef_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type, + cef_file_dialog_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h index 4322e8134..0aae2713f 100644 --- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9fe7fa4988fcebbb7ceee4d283c265fb069d5b7b$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_FILE_DIALOG_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_FILE_DIALOG_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_dialog_handler.h" #include "include/capi/cef_dialog_handler_capi.h" +#include "include/cef_dialog_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefFileDialogCallbackCppToC : public CefCppToCRefCounted { + CefFileDialogCallback, + cef_file_dialog_callback_t> { public: CefFileDialogCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc index 56702f2dc..a955d7545 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc @@ -9,19 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4c7bf04684310507e699c18a80c71d0c9a852ffc$ +// #include "libcef_dll/cpptoc/find_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, - cef_browser_t* browser, int identifier, int count, - const cef_rect_t* selectionRect, int activeMatchOrdinal, - int finalUpdate) { + cef_browser_t* browser, + int identifier, + int count, + const cef_rect_t* selectionRect, + int activeMatchOrdinal, + int finalUpdate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -37,38 +41,39 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, return; // Translate param: selectionRect; type: simple_byref_const - CefRect selectionRectVal = selectionRect?*selectionRect:CefRect(); + CefRect selectionRectVal = selectionRect ? *selectionRect : CefRect(); // Execute CefFindHandlerCppToC::Get(self)->OnFindResult( - CefBrowserCToCpp::Wrap(browser), - identifier, - count, - selectionRectVal, - activeMatchOrdinal, - finalUpdate?true:false); + CefBrowserCToCpp::Wrap(browser), identifier, count, selectionRectVal, + activeMatchOrdinal, finalUpdate ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefFindHandlerCppToC::CefFindHandlerCppToC() { GetStruct()->on_find_result = find_handler_on_find_result; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_find_handler_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_find_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FIND_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_FIND_HANDLER; diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h index c8f6168d6..ebb8ad869 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.h +++ b/libcef_dll/cpptoc/find_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e20d44370573b751fd6460540055ae74ce745729$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_find_handler.h" #include "include/capi/cef_find_handler_capi.h" +#include "include/cef_find_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefFindHandlerCppToC - : public CefCppToCRefCounted { +class CefFindHandlerCppToC : public CefCppToCRefCounted { public: CefFindHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc index 9d89e6801..59ab6c292 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d3d4fbf680412ca26d5803ffd269dea1e06ed388$ +// #include "libcef_dll/cpptoc/focus_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, - cef_browser_t* browser, int next) { + cef_browser_t* browser, + int next) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,13 +33,13 @@ void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, return; // Execute - CefFocusHandlerCppToC::Get(self)->OnTakeFocus( - CefBrowserCToCpp::Wrap(browser), - next?true:false); + CefFocusHandlerCppToC::Get(self)->OnTakeFocus(CefBrowserCToCpp::Wrap(browser), + next ? true : false); } int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, - cef_browser_t* browser, cef_focus_source_t source) { + cef_browser_t* browser, + cef_focus_source_t source) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,15 +52,14 @@ int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, // Execute bool _retval = CefFocusHandlerCppToC::Get(self)->OnSetFocus( - CefBrowserCToCpp::Wrap(browser), - source); + CefBrowserCToCpp::Wrap(browser), source); // Return type: bool return _retval; } void CEF_CALLBACK focus_handler_on_got_focus(struct _cef_focus_handler_t* self, - cef_browser_t* browser) { + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -70,13 +71,11 @@ void CEF_CALLBACK focus_handler_on_got_focus(struct _cef_focus_handler_t* self, return; // Execute - CefFocusHandlerCppToC::Get(self)->OnGotFocus( - CefBrowserCToCpp::Wrap(browser)); + CefFocusHandlerCppToC::Get(self)->OnGotFocus(CefBrowserCToCpp::Wrap(browser)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefFocusHandlerCppToC::CefFocusHandlerCppToC() { @@ -85,17 +84,25 @@ CefFocusHandlerCppToC::CefFocusHandlerCppToC() { GetStruct()->on_got_focus = focus_handler_on_got_focus; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_focus_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefFocusHandlerCppToC, + CefFocusHandler, + cef_focus_handler_t>::UnwrapDerived(CefWrapperType type, + cef_focus_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FOCUS_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_FOCUS_HANDLER; diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h index d559d2a8b..353124067 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.h +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5a037b794ef000b8644691e114b295daa78d908d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_focus_handler.h" #include "include/capi/cef_focus_handler_capi.h" +#include "include/cef_focus_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefFocusHandlerCppToC - : public CefCppToCRefCounted { +class CefFocusHandlerCppToC : public CefCppToCRefCounted { public: CefFocusHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index 978735c6a..311577c26 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=de121cd59bc925b4b2adb03d97965fe19a22223f$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/domvisitor_ctocpp.h" #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -125,7 +126,7 @@ void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) { } void CEF_CALLBACK frame_get_source(struct _cef_frame_t* self, - struct _cef_string_visitor_t* visitor) { + struct _cef_string_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -137,12 +138,11 @@ void CEF_CALLBACK frame_get_source(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->GetSource( - CefStringVisitorCToCpp::Wrap(visitor)); + CefFrameCppToC::Get(self)->GetSource(CefStringVisitorCToCpp::Wrap(visitor)); } void CEF_CALLBACK frame_get_text(struct _cef_frame_t* self, - struct _cef_string_visitor_t* visitor) { + struct _cef_string_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,12 +154,11 @@ void CEF_CALLBACK frame_get_text(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->GetText( - CefStringVisitorCToCpp::Wrap(visitor)); + CefFrameCppToC::Get(self)->GetText(CefStringVisitorCToCpp::Wrap(visitor)); } void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, - struct _cef_request_t* request) { + struct _cef_request_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,12 +170,11 @@ void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->LoadRequest( - CefRequestCppToC::Unwrap(request)); + CefFrameCppToC::Get(self)->LoadRequest(CefRequestCppToC::Unwrap(request)); } void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, - const cef_string_t* url) { + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -188,12 +186,12 @@ void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->LoadURL( - CefString(url)); + CefFrameCppToC::Get(self)->LoadURL(CefString(url)); } void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, - const cef_string_t* string_val, const cef_string_t* url) { + const cef_string_t* string_val, + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -209,14 +207,13 @@ void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->LoadString( - CefString(string_val), - CefString(url)); + CefFrameCppToC::Get(self)->LoadString(CefString(string_val), CefString(url)); } void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, - const cef_string_t* code, const cef_string_t* script_url, - int start_line) { + const cef_string_t* code, + const cef_string_t* script_url, + int start_line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -230,9 +227,7 @@ void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, // Execute CefFrameCppToC::Get(self)->ExecuteJavaScript( - CefString(code), - CefString(script_url), - start_line); + CefString(code), CefString(script_url), start_line); } int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) { @@ -333,8 +328,8 @@ cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) { return CefBrowserCppToC::Wrap(_retval); } -struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( - struct _cef_frame_t* self) { +struct _cef_v8context_t* CEF_CALLBACK +frame_get_v8context(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -349,7 +344,7 @@ struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( } void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, - cef_domvisitor_t* visitor) { + cef_domvisitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -361,13 +356,11 @@ void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, return; // Execute - CefFrameCppToC::Get(self)->VisitDOM( - CefDOMVisitorCToCpp::Wrap(visitor)); + CefFrameCppToC::Get(self)->VisitDOM(CefDOMVisitorCToCpp::Wrap(visitor)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefFrameCppToC::CefFrameCppToC() { @@ -397,16 +390,22 @@ CefFrameCppToC::CefFrameCppToC() { GetStruct()->visit_dom = frame_visit_dom; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_frame_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_frame_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FRAME; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_FRAME; diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h index 0a8cd199e..e2fbc41f8 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.h +++ b/libcef_dll/cpptoc/frame_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=30d020dca90e31d15279938d68e567dadb14c725$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ @@ -18,12 +20,12 @@ #error This file can be included DLL-side only #endif -#include "include/cef_frame.h" -#include "include/capi/cef_frame_capi.h" -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_v8.h" +#include "include/capi/cef_frame_capi.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc index 9c14de5d6..a5890f485 100644 --- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a85a5f77deefd5cab463110ab679d49f90bf7ab4$ +// #include "libcef_dll/cpptoc/geolocation_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK geolocation_callback_cont( - struct _cef_geolocation_callback_t* self, int allow) { +void CEF_CALLBACK +geolocation_callback_cont(struct _cef_geolocation_callback_t* self, int allow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -26,31 +27,37 @@ void CEF_CALLBACK geolocation_callback_cont( return; // Execute - CefGeolocationCallbackCppToC::Get(self)->Continue( - allow?true:false); + CefGeolocationCallbackCppToC::Get(self)->Continue(allow ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefGeolocationCallbackCppToC::CefGeolocationCallbackCppToC() { GetStruct()->cont = geolocation_callback_cont; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_geolocation_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefGeolocationCallbackCppToC, + CefGeolocationCallback, + cef_geolocation_callback_t>::UnwrapDerived(CefWrapperType type, + cef_geolocation_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h index ef869c5a0..13a927597 100644 --- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h +++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=63af8731a223066d8a4f2cc17366757dca66f7fd$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_geolocation_handler.h" #include "include/capi/cef_geolocation_handler_capi.h" +#include "include/cef_geolocation_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefGeolocationCallbackCppToC : public CefCppToCRefCounted { + CefGeolocationCallback, + cef_geolocation_callback_t> { public: CefGeolocationCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc index 0598b7b96..efc8c30a3 100644 --- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc @@ -9,19 +9,22 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8e37dbdeb9b4552a0c19c34e0ad7855a1c5ef709$ +// #include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK geolocation_handler_on_request_geolocation_permission( - struct _cef_geolocation_handler_t* self, cef_browser_t* browser, - const cef_string_t* requesting_url, int request_id, + struct _cef_geolocation_handler_t* self, + cef_browser_t* browser, + const cef_string_t* requesting_url, + int request_id, cef_geolocation_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -42,19 +45,18 @@ int CEF_CALLBACK geolocation_handler_on_request_geolocation_permission( return 0; // Execute - bool _retval = CefGeolocationHandlerCppToC::Get( - self)->OnRequestGeolocationPermission( - CefBrowserCToCpp::Wrap(browser), - CefString(requesting_url), - request_id, - CefGeolocationCallbackCToCpp::Wrap(callback)); + bool _retval = + CefGeolocationHandlerCppToC::Get(self)->OnRequestGeolocationPermission( + CefBrowserCToCpp::Wrap(browser), CefString(requesting_url), + request_id, CefGeolocationCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } void CEF_CALLBACK geolocation_handler_on_cancel_geolocation_permission( - struct _cef_geolocation_handler_t* self, cef_browser_t* browser, + struct _cef_geolocation_handler_t* self, + cef_browser_t* browser, int request_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -68,13 +70,11 @@ void CEF_CALLBACK geolocation_handler_on_cancel_geolocation_permission( // Execute CefGeolocationHandlerCppToC::Get(self)->OnCancelGeolocationPermission( - CefBrowserCToCpp::Wrap(browser), - request_id); + CefBrowserCToCpp::Wrap(browser), request_id); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC() { @@ -84,18 +84,26 @@ CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC() { geolocation_handler_on_cancel_geolocation_permission; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_geolocation_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefGeolocationHandlerCppToC, + CefGeolocationHandler, + cef_geolocation_handler_t>::UnwrapDerived(CefWrapperType type, + cef_geolocation_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_GEOLOCATION_HANDLER; diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h index 66a5ac4b1..7bf4d4683 100644 --- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h +++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e209b180959fdbeea0e85e47b72507240117b57d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_geolocation_handler.h" #include "include/capi/cef_geolocation_handler_capi.h" +#include "include/cef_geolocation_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefGeolocationHandlerCppToC : public CefCppToCRefCounted { + CefGeolocationHandler, + cef_geolocation_handler_t> { public: CefGeolocationHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc index bb1a0d05f..db87c441d 100644 --- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5609fad7a14bad55ece61758326b8fdb8a20ac2c$ +// #include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -36,32 +37,38 @@ void CEF_CALLBACK get_geolocation_callback_on_location_update( positionObj.Set(*position, false); // Execute - CefGetGeolocationCallbackCppToC::Get(self)->OnLocationUpdate( - positionObj); + CefGetGeolocationCallbackCppToC::Get(self)->OnLocationUpdate(positionObj); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefGetGeolocationCallbackCppToC::CefGetGeolocationCallbackCppToC() { GetStruct()->on_location_update = get_geolocation_callback_on_location_update; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_get_geolocation_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_get_geolocation_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_GET_GEOLOCATION_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_GET_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h index 594e0049f..f19985eb9 100644 --- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h +++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4e745a9adbce154512e5d81ce5f481e606a31551$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_geolocation.h" #include "include/capi/cef_geolocation_capi.h" +#include "include/cef_geolocation.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefGetGeolocationCallbackCppToC : public CefCppToCRefCounted { + CefGetGeolocationCallback, + cef_get_geolocation_callback_t> { public: CefGetGeolocationCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/image_cpptoc.cc b/libcef_dll/cpptoc/image_cpptoc.cc index f7d816c3f..45e2fb93b 100644 --- a/libcef_dll/cpptoc/image_cpptoc.cc +++ b/libcef_dll/cpptoc/image_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c5a593e30b9f8b61aeb4d07f38e471be0cc521c0$ +// #include "libcef_dll/cpptoc/binary_value_cpptoc.h" #include "libcef_dll/cpptoc/image_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_image_t* cef_image_create() { @@ -26,7 +27,6 @@ CEF_EXPORT cef_image_t* cef_image_create() { return CefImageCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -46,7 +46,7 @@ int CEF_CALLBACK image_is_empty(struct _cef_image_t* self) { } int CEF_CALLBACK image_is_same(struct _cef_image_t* self, - struct _cef_image_t* that) { + struct _cef_image_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -58,17 +58,21 @@ int CEF_CALLBACK image_is_same(struct _cef_image_t* self, return 0; // Execute - bool _retval = CefImageCppToC::Get(self)->IsSame( - CefImageCppToC::Unwrap(that)); + bool _retval = + CefImageCppToC::Get(self)->IsSame(CefImageCppToC::Unwrap(that)); // Return type: bool return _retval; } -int CEF_CALLBACK image_add_bitmap(struct _cef_image_t* self, float scale_factor, - int pixel_width, int pixel_height, cef_color_type_t color_type, - cef_alpha_type_t alpha_type, const void* pixel_data, - size_t pixel_data_size) { +int CEF_CALLBACK image_add_bitmap(struct _cef_image_t* self, + float scale_factor, + int pixel_width, + int pixel_height, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + const void* pixel_data, + size_t pixel_data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,20 +85,17 @@ int CEF_CALLBACK image_add_bitmap(struct _cef_image_t* self, float scale_factor, // Execute bool _retval = CefImageCppToC::Get(self)->AddBitmap( - scale_factor, - pixel_width, - pixel_height, - color_type, - alpha_type, - pixel_data, - pixel_data_size); + scale_factor, pixel_width, pixel_height, color_type, alpha_type, + pixel_data, pixel_data_size); // Return type: bool return _retval; } -int CEF_CALLBACK image_add_png(struct _cef_image_t* self, float scale_factor, - const void* png_data, size_t png_data_size) { +int CEF_CALLBACK image_add_png(struct _cef_image_t* self, + float scale_factor, + const void* png_data, + size_t png_data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -106,17 +107,17 @@ int CEF_CALLBACK image_add_png(struct _cef_image_t* self, float scale_factor, return 0; // Execute - bool _retval = CefImageCppToC::Get(self)->AddPNG( - scale_factor, - png_data, - png_data_size); + bool _retval = + CefImageCppToC::Get(self)->AddPNG(scale_factor, png_data, png_data_size); // Return type: bool return _retval; } -int CEF_CALLBACK image_add_jpeg(struct _cef_image_t* self, float scale_factor, - const void* jpeg_data, size_t jpeg_data_size) { +int CEF_CALLBACK image_add_jpeg(struct _cef_image_t* self, + float scale_factor, + const void* jpeg_data, + size_t jpeg_data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,10 +129,8 @@ int CEF_CALLBACK image_add_jpeg(struct _cef_image_t* self, float scale_factor, return 0; // Execute - bool _retval = CefImageCppToC::Get(self)->AddJPEG( - scale_factor, - jpeg_data, - jpeg_data_size); + bool _retval = CefImageCppToC::Get(self)->AddJPEG(scale_factor, jpeg_data, + jpeg_data_size); // Return type: bool return _retval; @@ -166,7 +165,7 @@ size_t CEF_CALLBACK image_get_height(struct _cef_image_t* self) { } int CEF_CALLBACK image_has_representation(struct _cef_image_t* self, - float scale_factor) { + float scale_factor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -174,15 +173,14 @@ int CEF_CALLBACK image_has_representation(struct _cef_image_t* self, return 0; // Execute - bool _retval = CefImageCppToC::Get(self)->HasRepresentation( - scale_factor); + bool _retval = CefImageCppToC::Get(self)->HasRepresentation(scale_factor); // Return type: bool return _retval; } int CEF_CALLBACK image_remove_representation(struct _cef_image_t* self, - float scale_factor) { + float scale_factor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -190,16 +188,17 @@ int CEF_CALLBACK image_remove_representation(struct _cef_image_t* self, return 0; // Execute - bool _retval = CefImageCppToC::Get(self)->RemoveRepresentation( - scale_factor); + bool _retval = CefImageCppToC::Get(self)->RemoveRepresentation(scale_factor); // Return type: bool return _retval; } int CEF_CALLBACK image_get_representation_info(struct _cef_image_t* self, - float scale_factor, float* actual_scale_factor, int* pixel_width, - int* pixel_height) { + float scale_factor, + float* actual_scale_factor, + int* pixel_width, + int* pixel_height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -219,18 +218,15 @@ int CEF_CALLBACK image_get_representation_info(struct _cef_image_t* self, return 0; // Translate param: actual_scale_factor; type: simple_byref - float actual_scale_factorVal = actual_scale_factor?*actual_scale_factor:0; + float actual_scale_factorVal = actual_scale_factor ? *actual_scale_factor : 0; // Translate param: pixel_width; type: simple_byref - int pixel_widthVal = pixel_width?*pixel_width:0; + int pixel_widthVal = pixel_width ? *pixel_width : 0; // Translate param: pixel_height; type: simple_byref - int pixel_heightVal = pixel_height?*pixel_height:0; + int pixel_heightVal = pixel_height ? *pixel_height : 0; // Execute bool _retval = CefImageCppToC::Get(self)->GetRepresentationInfo( - scale_factor, - actual_scale_factorVal, - pixel_widthVal, - pixel_heightVal); + scale_factor, actual_scale_factorVal, pixel_widthVal, pixel_heightVal); // Restore param: actual_scale_factor; type: simple_byref if (actual_scale_factor) @@ -246,9 +242,13 @@ int CEF_CALLBACK image_get_representation_info(struct _cef_image_t* self, return _retval; } -struct _cef_binary_value_t* CEF_CALLBACK image_get_as_bitmap( - struct _cef_image_t* self, float scale_factor, cef_color_type_t color_type, - cef_alpha_type_t alpha_type, int* pixel_width, int* pixel_height) { +struct _cef_binary_value_t* CEF_CALLBACK +image_get_as_bitmap(struct _cef_image_t* self, + float scale_factor, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + int* pixel_width, + int* pixel_height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -264,17 +264,13 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_bitmap( return NULL; // Translate param: pixel_width; type: simple_byref - int pixel_widthVal = pixel_width?*pixel_width:0; + int pixel_widthVal = pixel_width ? *pixel_width : 0; // Translate param: pixel_height; type: simple_byref - int pixel_heightVal = pixel_height?*pixel_height:0; + int pixel_heightVal = pixel_height ? *pixel_height : 0; // Execute CefRefPtr _retval = CefImageCppToC::Get(self)->GetAsBitmap( - scale_factor, - color_type, - alpha_type, - pixel_widthVal, - pixel_heightVal); + scale_factor, color_type, alpha_type, pixel_widthVal, pixel_heightVal); // Restore param: pixel_width; type: simple_byref if (pixel_width) @@ -287,9 +283,12 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_bitmap( return CefBinaryValueCppToC::Wrap(_retval); } -struct _cef_binary_value_t* CEF_CALLBACK image_get_as_png( - struct _cef_image_t* self, float scale_factor, int with_transparency, - int* pixel_width, int* pixel_height) { +struct _cef_binary_value_t* CEF_CALLBACK +image_get_as_png(struct _cef_image_t* self, + float scale_factor, + int with_transparency, + int* pixel_width, + int* pixel_height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -305,15 +304,13 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_png( return NULL; // Translate param: pixel_width; type: simple_byref - int pixel_widthVal = pixel_width?*pixel_width:0; + int pixel_widthVal = pixel_width ? *pixel_width : 0; // Translate param: pixel_height; type: simple_byref - int pixel_heightVal = pixel_height?*pixel_height:0; + int pixel_heightVal = pixel_height ? *pixel_height : 0; // Execute CefRefPtr _retval = CefImageCppToC::Get(self)->GetAsPNG( - scale_factor, - with_transparency?true:false, - pixel_widthVal, + scale_factor, with_transparency ? true : false, pixel_widthVal, pixel_heightVal); // Restore param: pixel_width; type: simple_byref @@ -327,9 +324,12 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_png( return CefBinaryValueCppToC::Wrap(_retval); } -struct _cef_binary_value_t* CEF_CALLBACK image_get_as_jpeg( - struct _cef_image_t* self, float scale_factor, int quality, - int* pixel_width, int* pixel_height) { +struct _cef_binary_value_t* CEF_CALLBACK +image_get_as_jpeg(struct _cef_image_t* self, + float scale_factor, + int quality, + int* pixel_width, + int* pixel_height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -345,16 +345,13 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_jpeg( return NULL; // Translate param: pixel_width; type: simple_byref - int pixel_widthVal = pixel_width?*pixel_width:0; + int pixel_widthVal = pixel_width ? *pixel_width : 0; // Translate param: pixel_height; type: simple_byref - int pixel_heightVal = pixel_height?*pixel_height:0; + int pixel_heightVal = pixel_height ? *pixel_height : 0; // Execute CefRefPtr _retval = CefImageCppToC::Get(self)->GetAsJPEG( - scale_factor, - quality, - pixel_widthVal, - pixel_heightVal); + scale_factor, quality, pixel_widthVal, pixel_heightVal); // Restore param: pixel_width; type: simple_byref if (pixel_width) @@ -369,7 +366,6 @@ struct _cef_binary_value_t* CEF_CALLBACK image_get_as_jpeg( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefImageCppToC::CefImageCppToC() { @@ -388,16 +384,22 @@ CefImageCppToC::CefImageCppToC() { GetStruct()->get_as_jpeg = image_get_as_jpeg; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_image_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_image_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_IMAGE; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_IMAGE; diff --git a/libcef_dll/cpptoc/image_cpptoc.h b/libcef_dll/cpptoc/image_cpptoc.h index 7871f47a6..dc2e1fcd1 100644 --- a/libcef_dll/cpptoc/image_cpptoc.h +++ b/libcef_dll/cpptoc/image_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3dc84fb386fb22b1b898206bfacb56909524c7b7$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_IMAGE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_IMAGE_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_image.h" #include "include/capi/cef_image_capi.h" +#include "include/cef_image.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc index 5ae872ba8..6a7ec3f83 100644 --- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=05be760ce7d3e0aaba329f7cfe3b83b7d6b94699$ +// #include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK jsdialog_callback_cont(struct _cef_jsdialog_callback_t* self, - int success, const cef_string_t* user_input) { + int success, + const cef_string_t* user_input) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -27,32 +29,38 @@ void CEF_CALLBACK jsdialog_callback_cont(struct _cef_jsdialog_callback_t* self, // Unverified params: user_input // Execute - CefJSDialogCallbackCppToC::Get(self)->Continue( - success?true:false, - CefString(user_input)); + CefJSDialogCallbackCppToC::Get(self)->Continue(success ? true : false, + CefString(user_input)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefJSDialogCallbackCppToC::CefJSDialogCallbackCppToC() { GetStruct()->cont = jsdialog_callback_cont; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_jsdialog_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefJSDialogCallbackCppToC, + CefJSDialogCallback, + cef_jsdialog_callback_t>::UnwrapDerived(CefWrapperType type, + cef_jsdialog_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_JSDIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h index 3cff8cbd3..f41ecec55 100644 --- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=09aca7f61ce1f0f62e68c1756db36eb5ee6824cd$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_jsdialog_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefJSDialogCallbackCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefJSDialogCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index 22e142990..06f53153c 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -9,21 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=04255b222eef72aeea67720233b7b0b7b9000365$ +// #include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK jsdialog_handler_on_jsdialog( - struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, - const cef_string_t* origin_url, cef_jsdialog_type_t dialog_type, - const cef_string_t* message_text, const cef_string_t* default_prompt_text, - cef_jsdialog_callback_t* callback, int* suppress_message) { +int CEF_CALLBACK +jsdialog_handler_on_jsdialog(struct _cef_jsdialog_handler_t* self, + cef_browser_t* browser, + const cef_string_t* origin_url, + cef_jsdialog_type_t dialog_type, + const cef_string_t* message_text, + const cef_string_t* default_prompt_text, + cef_jsdialog_callback_t* callback, + int* suppress_message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -44,31 +49,29 @@ int CEF_CALLBACK jsdialog_handler_on_jsdialog( // Unverified params: origin_url, message_text, default_prompt_text // Translate param: suppress_message; type: bool_byref - bool suppress_messageBool = ( - suppress_message && *suppress_message)?true:false; + bool suppress_messageBool = + (suppress_message && *suppress_message) ? true : false; // Execute bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSDialog( - CefBrowserCToCpp::Wrap(browser), - CefString(origin_url), - dialog_type, - CefString(message_text), - CefString(default_prompt_text), - CefJSDialogCallbackCToCpp::Wrap(callback), - suppress_messageBool); + CefBrowserCToCpp::Wrap(browser), CefString(origin_url), dialog_type, + CefString(message_text), CefString(default_prompt_text), + CefJSDialogCallbackCToCpp::Wrap(callback), suppress_messageBool); // Restore param: suppress_message; type: bool_byref if (suppress_message) - *suppress_message = suppress_messageBool?true:false; + *suppress_message = suppress_messageBool ? true : false; // Return type: bool return _retval; } -int CEF_CALLBACK jsdialog_handler_on_before_unload_dialog( - struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, - const cef_string_t* message_text, int is_reload, - cef_jsdialog_callback_t* callback) { +int CEF_CALLBACK +jsdialog_handler_on_before_unload_dialog(struct _cef_jsdialog_handler_t* self, + cef_browser_t* browser, + const cef_string_t* message_text, + int is_reload, + cef_jsdialog_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -86,17 +89,16 @@ int CEF_CALLBACK jsdialog_handler_on_before_unload_dialog( // Execute bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnBeforeUnloadDialog( - CefBrowserCToCpp::Wrap(browser), - CefString(message_text), - is_reload?true:false, - CefJSDialogCallbackCToCpp::Wrap(callback)); + CefBrowserCToCpp::Wrap(browser), CefString(message_text), + is_reload ? true : false, CefJSDialogCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -void CEF_CALLBACK jsdialog_handler_on_reset_dialog_state( - struct _cef_jsdialog_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +jsdialog_handler_on_reset_dialog_state(struct _cef_jsdialog_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -112,8 +114,9 @@ void CEF_CALLBACK jsdialog_handler_on_reset_dialog_state( CefBrowserCToCpp::Wrap(browser)); } -void CEF_CALLBACK jsdialog_handler_on_dialog_closed( - struct _cef_jsdialog_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +jsdialog_handler_on_dialog_closed(struct _cef_jsdialog_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,7 +134,6 @@ void CEF_CALLBACK jsdialog_handler_on_dialog_closed( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC() { @@ -142,18 +144,26 @@ CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC() { GetStruct()->on_dialog_closed = jsdialog_handler_on_dialog_closed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_jsdialog_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefJSDialogHandlerCppToC, + CefJSDialogHandler, + cef_jsdialog_handler_t>::UnwrapDerived(CefWrapperType type, + cef_jsdialog_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_JSDIALOG_HANDLER; diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h index 7a0cba550..4f5f3718f 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=09f43b6a8321305a1e9a8432dd3c7ac306c6d350$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_jsdialog_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefJSDialogHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefJSDialogHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc index 845d7fd6e..127f609cb 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -9,19 +9,22 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ab912d3ba520a44af12ce5d8a1c359c29f850c87$ +// #include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK keyboard_handler_on_pre_key_event( - struct _cef_keyboard_handler_t* self, cef_browser_t* browser, - const struct _cef_key_event_t* event, cef_event_handle_t os_event, - int* is_keyboard_shortcut) { +int CEF_CALLBACK +keyboard_handler_on_pre_key_event(struct _cef_keyboard_handler_t* self, + cef_browser_t* browser, + const struct _cef_key_event_t* event, + cef_event_handle_t os_event, + int* is_keyboard_shortcut) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -45,27 +48,27 @@ int CEF_CALLBACK keyboard_handler_on_pre_key_event( if (event) eventObj.Set(*event, false); // Translate param: is_keyboard_shortcut; type: bool_byaddr - bool is_keyboard_shortcutBool = ( - is_keyboard_shortcut && *is_keyboard_shortcut)?true:false; + bool is_keyboard_shortcutBool = + (is_keyboard_shortcut && *is_keyboard_shortcut) ? true : false; // Execute bool _retval = CefKeyboardHandlerCppToC::Get(self)->OnPreKeyEvent( - CefBrowserCToCpp::Wrap(browser), - eventObj, - os_event, + CefBrowserCToCpp::Wrap(browser), eventObj, os_event, &is_keyboard_shortcutBool); // Restore param: is_keyboard_shortcut; type: bool_byaddr if (is_keyboard_shortcut) - *is_keyboard_shortcut = is_keyboard_shortcutBool?true:false; + *is_keyboard_shortcut = is_keyboard_shortcutBool ? true : false; // Return type: bool return _retval; } -int CEF_CALLBACK keyboard_handler_on_key_event( - struct _cef_keyboard_handler_t* self, cef_browser_t* browser, - const struct _cef_key_event_t* event, cef_event_handle_t os_event) { +int CEF_CALLBACK +keyboard_handler_on_key_event(struct _cef_keyboard_handler_t* self, + cef_browser_t* browser, + const struct _cef_key_event_t* event, + cef_event_handle_t os_event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,9 +90,7 @@ int CEF_CALLBACK keyboard_handler_on_key_event( // Execute bool _retval = CefKeyboardHandlerCppToC::Get(self)->OnKeyEvent( - CefBrowserCToCpp::Wrap(browser), - eventObj, - os_event); + CefBrowserCToCpp::Wrap(browser), eventObj, os_event); // Return type: bool return _retval; @@ -97,7 +98,6 @@ int CEF_CALLBACK keyboard_handler_on_key_event( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC() { @@ -105,18 +105,26 @@ CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC() { GetStruct()->on_key_event = keyboard_handler_on_key_event; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_keyboard_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefKeyboardHandlerCppToC, + CefKeyboardHandler, + cef_keyboard_handler_t>::UnwrapDerived(CefWrapperType type, + cef_keyboard_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_KEYBOARD_HANDLER; diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h index 11f875cb1..14980d636 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7be4bd7c8fed9b68ef7094f15826bdbe7d98db40$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_keyboard_handler.h" #include "include/capi/cef_keyboard_handler_capi.h" +#include "include/cef_keyboard_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefKeyboardHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefKeyboardHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc index 33ad78765..95e2be43c 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -9,25 +9,31 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a2d97e44c5404e9694b436eb590979759cc84972$ +// #include "libcef_dll/cpptoc/client_cpptoc.h" #include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK life_span_handler_on_before_popup( - struct _cef_life_span_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* target_url, + struct _cef_life_span_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + const cef_string_t* target_url, const cef_string_t* target_frame_name, - cef_window_open_disposition_t target_disposition, int user_gesture, + cef_window_open_disposition_t target_disposition, + int user_gesture, const struct _cef_popup_features_t* popupFeatures, - cef_window_info_t* windowInfo, cef_client_t** client, - struct _cef_browser_settings_t* settings, int* no_javascript_access) { + cef_window_info_t* windowInfo, + cef_client_t** client, + struct _cef_browser_settings_t* settings, + int* no_javascript_access) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,22 +87,15 @@ int CEF_CALLBACK life_span_handler_on_before_popup( if (settings) settingsObj.AttachTo(*settings); // Translate param: no_javascript_access; type: bool_byaddr - bool no_javascript_accessBool = ( - no_javascript_access && *no_javascript_access)?true:false; + bool no_javascript_accessBool = + (no_javascript_access && *no_javascript_access) ? true : false; // Execute bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefString(target_url), - CefString(target_frame_name), - target_disposition, - user_gesture?true:false, - popupFeaturesObj, - windowInfoObj, - clientPtr, - settingsObj, - &no_javascript_accessBool); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefString(target_url), CefString(target_frame_name), target_disposition, + user_gesture ? true : false, popupFeaturesObj, windowInfoObj, clientPtr, + settingsObj, &no_javascript_accessBool); // Restore param: windowInfo; type: struct_byref if (windowInfo) @@ -116,14 +115,15 @@ int CEF_CALLBACK life_span_handler_on_before_popup( settingsObj.DetachTo(*settings); // Restore param: no_javascript_access; type: bool_byaddr if (no_javascript_access) - *no_javascript_access = no_javascript_accessBool?true:false; + *no_javascript_access = no_javascript_accessBool ? true : false; // Return type: bool return _retval; } -void CEF_CALLBACK life_span_handler_on_after_created( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +life_span_handler_on_after_created(struct _cef_life_span_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +139,9 @@ void CEF_CALLBACK life_span_handler_on_after_created( CefBrowserCToCpp::Wrap(browser)); } -int CEF_CALLBACK life_span_handler_do_close( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) { +int CEF_CALLBACK +life_span_handler_do_close(struct _cef_life_span_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,8 +160,9 @@ int CEF_CALLBACK life_span_handler_do_close( return _retval; } -void CEF_CALLBACK life_span_handler_on_before_close( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +life_span_handler_on_before_close(struct _cef_life_span_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -178,7 +180,6 @@ void CEF_CALLBACK life_span_handler_on_before_close( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC() { @@ -188,18 +189,26 @@ CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC() { GetStruct()->on_before_close = life_span_handler_on_before_close; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_life_span_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefLifeSpanHandlerCppToC, + CefLifeSpanHandler, + cef_life_span_handler_t>::UnwrapDerived(CefWrapperType type, + cef_life_span_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LIFE_SPAN_HANDLER; diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h index 35fa3b71d..d557b7c24 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7e5510914468cb8a93de0e297bf897ff8459340b$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_life_span_handler.h" +#include "include/capi/cef_client_capi.h" #include "include/capi/cef_life_span_handler_capi.h" #include "include/cef_client.h" -#include "include/capi/cef_client_capi.h" +#include "include/cef_life_span_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefLifeSpanHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefLifeSpanHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/list_value_cpptoc.cc b/libcef_dll/cpptoc/list_value_cpptoc.cc index c2473a2a0..83db93fd1 100644 --- a/libcef_dll/cpptoc/list_value_cpptoc.cc +++ b/libcef_dll/cpptoc/list_value_cpptoc.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=115f89a2489929f54c8cf1565dadbd2b470cf6a4$ +// #include "libcef_dll/cpptoc/binary_value_cpptoc.h" #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" #include "libcef_dll/cpptoc/list_value_cpptoc.h" #include "libcef_dll/cpptoc/value_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_list_value_t* cef_list_value_create() { @@ -28,7 +29,6 @@ CEF_EXPORT cef_list_value_t* cef_list_value_create() { return CefListValueCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -76,7 +76,7 @@ int CEF_CALLBACK list_value_is_read_only(struct _cef_list_value_t* self) { } int CEF_CALLBACK list_value_is_same(struct _cef_list_value_t* self, - struct _cef_list_value_t* that) { + struct _cef_list_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,15 +88,15 @@ int CEF_CALLBACK list_value_is_same(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->IsSame( - CefListValueCppToC::Unwrap(that)); + bool _retval = + CefListValueCppToC::Get(self)->IsSame(CefListValueCppToC::Unwrap(that)); // Return type: bool return _retval; } int CEF_CALLBACK list_value_is_equal(struct _cef_list_value_t* self, - struct _cef_list_value_t* that) { + struct _cef_list_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -108,15 +108,15 @@ int CEF_CALLBACK list_value_is_equal(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->IsEqual( - CefListValueCppToC::Unwrap(that)); + bool _retval = + CefListValueCppToC::Get(self)->IsEqual(CefListValueCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_list_value_t* CEF_CALLBACK list_value_copy( - struct _cef_list_value_t* self) { +struct _cef_list_value_t* CEF_CALLBACK +list_value_copy(struct _cef_list_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,7 +131,7 @@ struct _cef_list_value_t* CEF_CALLBACK list_value_copy( } int CEF_CALLBACK list_value_set_size(struct _cef_list_value_t* self, - size_t size) { + size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +139,7 @@ int CEF_CALLBACK list_value_set_size(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->SetSize( - size); + bool _retval = CefListValueCppToC::Get(self)->SetSize(size); // Return type: bool return _retval; @@ -175,7 +174,7 @@ int CEF_CALLBACK list_value_clear(struct _cef_list_value_t* self) { } int CEF_CALLBACK list_value_remove(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -183,15 +182,14 @@ int CEF_CALLBACK list_value_remove(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->Remove( - index); + bool _retval = CefListValueCppToC::Get(self)->Remove(index); // Return type: bool return _retval; } -cef_value_type_t CEF_CALLBACK list_value_get_type( - struct _cef_list_value_t* self, size_t index) { +cef_value_type_t CEF_CALLBACK +list_value_get_type(struct _cef_list_value_t* self, size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -199,15 +197,14 @@ cef_value_type_t CEF_CALLBACK list_value_get_type( return VTYPE_INVALID; // Execute - cef_value_type_t _retval = CefListValueCppToC::Get(self)->GetType( - index); + cef_value_type_t _retval = CefListValueCppToC::Get(self)->GetType(index); // Return type: simple return _retval; } cef_value_t* CEF_CALLBACK list_value_get_value(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -215,15 +212,14 @@ cef_value_t* CEF_CALLBACK list_value_get_value(struct _cef_list_value_t* self, return NULL; // Execute - CefRefPtr _retval = CefListValueCppToC::Get(self)->GetValue( - index); + CefRefPtr _retval = CefListValueCppToC::Get(self)->GetValue(index); // Return type: refptr_same return CefValueCppToC::Wrap(_retval); } int CEF_CALLBACK list_value_get_bool(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -231,15 +227,14 @@ int CEF_CALLBACK list_value_get_bool(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->GetBool( - index); + bool _retval = CefListValueCppToC::Get(self)->GetBool(index); // Return type: bool return _retval; } int CEF_CALLBACK list_value_get_int(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -247,15 +242,14 @@ int CEF_CALLBACK list_value_get_int(struct _cef_list_value_t* self, return 0; // Execute - int _retval = CefListValueCppToC::Get(self)->GetInt( - index); + int _retval = CefListValueCppToC::Get(self)->GetInt(index); // Return type: simple return _retval; } double CEF_CALLBACK list_value_get_double(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -263,15 +257,14 @@ double CEF_CALLBACK list_value_get_double(struct _cef_list_value_t* self, return 0; // Execute - double _retval = CefListValueCppToC::Get(self)->GetDouble( - index); + double _retval = CefListValueCppToC::Get(self)->GetDouble(index); // Return type: simple return _retval; } -cef_string_userfree_t CEF_CALLBACK list_value_get_string( - struct _cef_list_value_t* self, size_t index) { +cef_string_userfree_t CEF_CALLBACK +list_value_get_string(struct _cef_list_value_t* self, size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -279,15 +272,14 @@ cef_string_userfree_t CEF_CALLBACK list_value_get_string( return NULL; // Execute - CefString _retval = CefListValueCppToC::Get(self)->GetString( - index); + CefString _retval = CefListValueCppToC::Get(self)->GetString(index); // Return type: string return _retval.DetachToUserFree(); } -cef_binary_value_t* CEF_CALLBACK list_value_get_binary( - struct _cef_list_value_t* self, size_t index) { +cef_binary_value_t* CEF_CALLBACK +list_value_get_binary(struct _cef_list_value_t* self, size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -295,15 +287,15 @@ cef_binary_value_t* CEF_CALLBACK list_value_get_binary( return NULL; // Execute - CefRefPtr _retval = CefListValueCppToC::Get(self)->GetBinary( - index); + CefRefPtr _retval = + CefListValueCppToC::Get(self)->GetBinary(index); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } -cef_dictionary_value_t* CEF_CALLBACK list_value_get_dictionary( - struct _cef_list_value_t* self, size_t index) { +cef_dictionary_value_t* CEF_CALLBACK +list_value_get_dictionary(struct _cef_list_value_t* self, size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -311,16 +303,15 @@ cef_dictionary_value_t* CEF_CALLBACK list_value_get_dictionary( return NULL; // Execute - CefRefPtr _retval = CefListValueCppToC::Get( - self)->GetDictionary( - index); + CefRefPtr _retval = + CefListValueCppToC::Get(self)->GetDictionary(index); // Return type: refptr_same return CefDictionaryValueCppToC::Wrap(_retval); } -struct _cef_list_value_t* CEF_CALLBACK list_value_get_list( - struct _cef_list_value_t* self, size_t index) { +struct _cef_list_value_t* CEF_CALLBACK +list_value_get_list(struct _cef_list_value_t* self, size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -328,15 +319,16 @@ struct _cef_list_value_t* CEF_CALLBACK list_value_get_list( return NULL; // Execute - CefRefPtr _retval = CefListValueCppToC::Get(self)->GetList( - index); + CefRefPtr _retval = + CefListValueCppToC::Get(self)->GetList(index); // Return type: refptr_same return CefListValueCppToC::Wrap(_retval); } int CEF_CALLBACK list_value_set_value(struct _cef_list_value_t* self, - size_t index, cef_value_t* value) { + size_t index, + cef_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -349,15 +341,14 @@ int CEF_CALLBACK list_value_set_value(struct _cef_list_value_t* self, // Execute bool _retval = CefListValueCppToC::Get(self)->SetValue( - index, - CefValueCppToC::Unwrap(value)); + index, CefValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_null(struct _cef_list_value_t* self, - size_t index) { + size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -365,15 +356,15 @@ int CEF_CALLBACK list_value_set_null(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->SetNull( - index); + bool _retval = CefListValueCppToC::Get(self)->SetNull(index); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_bool(struct _cef_list_value_t* self, - size_t index, int value) { + size_t index, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -381,16 +372,16 @@ int CEF_CALLBACK list_value_set_bool(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->SetBool( - index, - value?true:false); + bool _retval = + CefListValueCppToC::Get(self)->SetBool(index, value ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_int(struct _cef_list_value_t* self, - size_t index, int value) { + size_t index, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -398,16 +389,15 @@ int CEF_CALLBACK list_value_set_int(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->SetInt( - index, - value); + bool _retval = CefListValueCppToC::Get(self)->SetInt(index, value); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_double(struct _cef_list_value_t* self, - size_t index, double value) { + size_t index, + double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -415,16 +405,15 @@ int CEF_CALLBACK list_value_set_double(struct _cef_list_value_t* self, return 0; // Execute - bool _retval = CefListValueCppToC::Get(self)->SetDouble( - index, - value); + bool _retval = CefListValueCppToC::Get(self)->SetDouble(index, value); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_string(struct _cef_list_value_t* self, - size_t index, const cef_string_t* value) { + size_t index, + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -433,16 +422,16 @@ int CEF_CALLBACK list_value_set_string(struct _cef_list_value_t* self, // Unverified params: value // Execute - bool _retval = CefListValueCppToC::Get(self)->SetString( - index, - CefString(value)); + bool _retval = + CefListValueCppToC::Get(self)->SetString(index, CefString(value)); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_binary(struct _cef_list_value_t* self, - size_t index, cef_binary_value_t* value) { + size_t index, + cef_binary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -455,15 +444,15 @@ int CEF_CALLBACK list_value_set_binary(struct _cef_list_value_t* self, // Execute bool _retval = CefListValueCppToC::Get(self)->SetBinary( - index, - CefBinaryValueCppToC::Unwrap(value)); + index, CefBinaryValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_dictionary(struct _cef_list_value_t* self, - size_t index, cef_dictionary_value_t* value) { + size_t index, + cef_dictionary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -476,15 +465,15 @@ int CEF_CALLBACK list_value_set_dictionary(struct _cef_list_value_t* self, // Execute bool _retval = CefListValueCppToC::Get(self)->SetDictionary( - index, - CefDictionaryValueCppToC::Unwrap(value)); + index, CefDictionaryValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK list_value_set_list(struct _cef_list_value_t* self, - size_t index, struct _cef_list_value_t* value) { + size_t index, + struct _cef_list_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -497,8 +486,7 @@ int CEF_CALLBACK list_value_set_list(struct _cef_list_value_t* self, // Execute bool _retval = CefListValueCppToC::Get(self)->SetList( - index, - CefListValueCppToC::Unwrap(value)); + index, CefListValueCppToC::Unwrap(value)); // Return type: bool return _retval; @@ -506,7 +494,6 @@ int CEF_CALLBACK list_value_set_list(struct _cef_list_value_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefListValueCppToC::CefListValueCppToC() { @@ -540,17 +527,23 @@ CefListValueCppToC::CefListValueCppToC() { GetStruct()->set_list = list_value_set_list; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_list_value_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_list_value_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LIST_VALUE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_LIST_VALUE; diff --git a/libcef_dll/cpptoc/list_value_cpptoc.h b/libcef_dll/cpptoc/list_value_cpptoc.h index 80b1a26cb..71f9de155 100644 --- a/libcef_dll/cpptoc/list_value_cpptoc.h +++ b/libcef_dll/cpptoc/list_value_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0964c097463bec4d9ef7e12fafda123e0535fd1b$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_LIST_VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_LIST_VALUE_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefListValueCppToC - : public CefCppToCRefCounted { +class CefListValueCppToC : public CefCppToCRefCounted { public: CefListValueCppToC(); }; diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc index c45758a28..fe9fafc66 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -9,19 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=48f3eb139316785cc31cb70a1af280f2355a228b$ +// #include "libcef_dll/cpptoc/load_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK load_handler_on_loading_state_change( - struct _cef_load_handler_t* self, cef_browser_t* browser, int isLoading, - int canGoBack, int canGoForward) { +void CEF_CALLBACK +load_handler_on_loading_state_change(struct _cef_load_handler_t* self, + cef_browser_t* browser, + int isLoading, + int canGoBack, + int canGoForward) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,15 +38,15 @@ void CEF_CALLBACK load_handler_on_loading_state_change( // Execute CefLoadHandlerCppToC::Get(self)->OnLoadingStateChange( - CefBrowserCToCpp::Wrap(browser), - isLoading?true:false, - canGoBack?true:false, - canGoForward?true:false); + CefBrowserCToCpp::Wrap(browser), isLoading ? true : false, + canGoBack ? true : false, canGoForward ? true : false); } -void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, - cef_browser_t* browser, cef_frame_t* frame, - cef_transition_type_t transition_type) { +void CEF_CALLBACK +load_handler_on_load_start(struct _cef_load_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_transition_type_t transition_type) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -58,14 +62,15 @@ void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, return; // Execute - CefLoadHandlerCppToC::Get(self)->OnLoadStart( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - transition_type); + CefLoadHandlerCppToC::Get(self)->OnLoadStart(CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + transition_type); } void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, - cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) { + cef_browser_t* browser, + cef_frame_t* frame, + int httpStatusCode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,15 +86,17 @@ void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, return; // Execute - CefLoadHandlerCppToC::Get(self)->OnLoadEnd( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - httpStatusCode); + CefLoadHandlerCppToC::Get(self)->OnLoadEnd(CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + httpStatusCode); } void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, - cef_browser_t* browser, cef_frame_t* frame, cef_errorcode_t errorCode, - const cef_string_t* errorText, const cef_string_t* failedUrl) { + cef_browser_t* browser, + cef_frame_t* frame, + cef_errorcode_t errorCode, + const cef_string_t* errorText, + const cef_string_t* failedUrl) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -111,16 +118,12 @@ void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, // Execute CefLoadHandlerCppToC::Get(self)->OnLoadError( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - errorCode, - CefString(errorText), - CefString(failedUrl)); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode, + CefString(errorText), CefString(failedUrl)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefLoadHandlerCppToC::CefLoadHandlerCppToC() { @@ -130,17 +133,23 @@ CefLoadHandlerCppToC::CefLoadHandlerCppToC() { GetStruct()->on_load_error = load_handler_on_load_error; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_load_handler_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_load_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LOAD_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_LOAD_HANDLER; diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h index 18865dd81..92772d2e6 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.h +++ b/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b3b3b51c5601ee1723a814723adde564a584f6c8$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_load_handler.h" #include "include/capi/cef_load_handler_capi.h" +#include "include/cef_load_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefLoadHandlerCppToC - : public CefCppToCRefCounted { +class CefLoadHandlerCppToC : public CefCppToCRefCounted { public: CefLoadHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.cc b/libcef_dll/cpptoc/menu_model_cpptoc.cc index 67f688690..aefa3b29f 100644 --- a/libcef_dll/cpptoc/menu_model_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_model_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9ebac77c8ad6c56ac04eb765884d9c192d2da10c$ +// #include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_menu_model_t* cef_menu_model_create( @@ -26,14 +27,13 @@ CEF_EXPORT cef_menu_model_t* cef_menu_model_create( return NULL; // Execute - CefRefPtr _retval = CefMenuModel::CreateMenuModel( - CefMenuModelDelegateCToCpp::Wrap(delegate)); + CefRefPtr _retval = + CefMenuModel::CreateMenuModel(CefMenuModelDelegateCToCpp::Wrap(delegate)); // Return type: refptr_same return CefMenuModelCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -95,7 +95,8 @@ int CEF_CALLBACK menu_model_add_separator(struct _cef_menu_model_t* self) { } int CEF_CALLBACK menu_model_add_item(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label) { + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,16 +108,16 @@ int CEF_CALLBACK menu_model_add_item(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->AddItem( - command_id, - CefString(label)); + bool _retval = + CefMenuModelCppToC::Get(self)->AddItem(command_id, CefString(label)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_add_check_item(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label) { + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,16 +129,17 @@ int CEF_CALLBACK menu_model_add_check_item(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->AddCheckItem( - command_id, - CefString(label)); + bool _retval = + CefMenuModelCppToC::Get(self)->AddCheckItem(command_id, CefString(label)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_add_radio_item(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label, int group_id) { + int command_id, + const cef_string_t* label, + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -150,17 +152,16 @@ int CEF_CALLBACK menu_model_add_radio_item(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->AddRadioItem( - command_id, - CefString(label), - group_id); + command_id, CefString(label), group_id); // Return type: bool return _retval; } -struct _cef_menu_model_t* CEF_CALLBACK menu_model_add_sub_menu( - struct _cef_menu_model_t* self, int command_id, - const cef_string_t* label) { +struct _cef_menu_model_t* CEF_CALLBACK +menu_model_add_sub_menu(struct _cef_menu_model_t* self, + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -172,16 +173,15 @@ struct _cef_menu_model_t* CEF_CALLBACK menu_model_add_sub_menu( return NULL; // Execute - CefRefPtr _retval = CefMenuModelCppToC::Get(self)->AddSubMenu( - command_id, - CefString(label)); + CefRefPtr _retval = + CefMenuModelCppToC::Get(self)->AddSubMenu(command_id, CefString(label)); // Return type: refptr_same return CefMenuModelCppToC::Wrap(_retval); } int CEF_CALLBACK menu_model_insert_separator_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -189,15 +189,16 @@ int CEF_CALLBACK menu_model_insert_separator_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->InsertSeparatorAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->InsertSeparatorAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_insert_item_at(struct _cef_menu_model_t* self, - int index, int command_id, const cef_string_t* label) { + int index, + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -209,17 +210,17 @@ int CEF_CALLBACK menu_model_insert_item_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->InsertItemAt( - index, - command_id, - CefString(label)); + bool _retval = CefMenuModelCppToC::Get(self)->InsertItemAt(index, command_id, + CefString(label)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_insert_check_item_at(struct _cef_menu_model_t* self, - int index, int command_id, const cef_string_t* label) { + int index, + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -232,16 +233,17 @@ int CEF_CALLBACK menu_model_insert_check_item_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->InsertCheckItemAt( - index, - command_id, - CefString(label)); + index, command_id, CefString(label)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_insert_radio_item_at(struct _cef_menu_model_t* self, - int index, int command_id, const cef_string_t* label, int group_id) { + int index, + int command_id, + const cef_string_t* label, + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -254,18 +256,17 @@ int CEF_CALLBACK menu_model_insert_radio_item_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->InsertRadioItemAt( - index, - command_id, - CefString(label), - group_id); + index, command_id, CefString(label), group_id); // Return type: bool return _retval; } -struct _cef_menu_model_t* CEF_CALLBACK menu_model_insert_sub_menu_at( - struct _cef_menu_model_t* self, int index, int command_id, - const cef_string_t* label) { +struct _cef_menu_model_t* CEF_CALLBACK +menu_model_insert_sub_menu_at(struct _cef_menu_model_t* self, + int index, + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -277,18 +278,16 @@ struct _cef_menu_model_t* CEF_CALLBACK menu_model_insert_sub_menu_at( return NULL; // Execute - CefRefPtr _retval = CefMenuModelCppToC::Get( - self)->InsertSubMenuAt( - index, - command_id, - CefString(label)); + CefRefPtr _retval = + CefMenuModelCppToC::Get(self)->InsertSubMenuAt(index, command_id, + CefString(label)); // Return type: refptr_same return CefMenuModelCppToC::Wrap(_retval); } int CEF_CALLBACK menu_model_remove(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -296,15 +295,14 @@ int CEF_CALLBACK menu_model_remove(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->Remove( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->Remove(command_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_remove_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -312,15 +310,14 @@ int CEF_CALLBACK menu_model_remove_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->RemoveAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->RemoveAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_get_index_of(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -328,15 +325,14 @@ int CEF_CALLBACK menu_model_get_index_of(struct _cef_menu_model_t* self, return 0; // Execute - int _retval = CefMenuModelCppToC::Get(self)->GetIndexOf( - command_id); + int _retval = CefMenuModelCppToC::Get(self)->GetIndexOf(command_id); // Return type: simple return _retval; } int CEF_CALLBACK menu_model_get_command_id_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -344,15 +340,15 @@ int CEF_CALLBACK menu_model_get_command_id_at(struct _cef_menu_model_t* self, return 0; // Execute - int _retval = CefMenuModelCppToC::Get(self)->GetCommandIdAt( - index); + int _retval = CefMenuModelCppToC::Get(self)->GetCommandIdAt(index); // Return type: simple return _retval; } int CEF_CALLBACK menu_model_set_command_id_at(struct _cef_menu_model_t* self, - int index, int command_id) { + int index, + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -360,16 +356,15 @@ int CEF_CALLBACK menu_model_set_command_id_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetCommandIdAt( - index, - command_id); + bool _retval = + CefMenuModelCppToC::Get(self)->SetCommandIdAt(index, command_id); // Return type: bool return _retval; } -cef_string_userfree_t CEF_CALLBACK menu_model_get_label( - struct _cef_menu_model_t* self, int command_id) { +cef_string_userfree_t CEF_CALLBACK +menu_model_get_label(struct _cef_menu_model_t* self, int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -377,15 +372,14 @@ cef_string_userfree_t CEF_CALLBACK menu_model_get_label( return NULL; // Execute - CefString _retval = CefMenuModelCppToC::Get(self)->GetLabel( - command_id); + CefString _retval = CefMenuModelCppToC::Get(self)->GetLabel(command_id); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK menu_model_get_label_at( - struct _cef_menu_model_t* self, int index) { +cef_string_userfree_t CEF_CALLBACK +menu_model_get_label_at(struct _cef_menu_model_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -393,15 +387,15 @@ cef_string_userfree_t CEF_CALLBACK menu_model_get_label_at( return NULL; // Execute - CefString _retval = CefMenuModelCppToC::Get(self)->GetLabelAt( - index); + CefString _retval = CefMenuModelCppToC::Get(self)->GetLabelAt(index); // Return type: string return _retval.DetachToUserFree(); } int CEF_CALLBACK menu_model_set_label(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* label) { + int command_id, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -413,16 +407,16 @@ int CEF_CALLBACK menu_model_set_label(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetLabel( - command_id, - CefString(label)); + bool _retval = + CefMenuModelCppToC::Get(self)->SetLabel(command_id, CefString(label)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_label_at(struct _cef_menu_model_t* self, - int index, const cef_string_t* label) { + int index, + const cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -434,16 +428,15 @@ int CEF_CALLBACK menu_model_set_label_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetLabelAt( - index, - CefString(label)); + bool _retval = + CefMenuModelCppToC::Get(self)->SetLabelAt(index, CefString(label)); // Return type: bool return _retval; } -cef_menu_item_type_t CEF_CALLBACK menu_model_get_type( - struct _cef_menu_model_t* self, int command_id) { +cef_menu_item_type_t CEF_CALLBACK +menu_model_get_type(struct _cef_menu_model_t* self, int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -451,15 +444,15 @@ cef_menu_item_type_t CEF_CALLBACK menu_model_get_type( return MENUITEMTYPE_NONE; // Execute - cef_menu_item_type_t _retval = CefMenuModelCppToC::Get(self)->GetType( - command_id); + cef_menu_item_type_t _retval = + CefMenuModelCppToC::Get(self)->GetType(command_id); // Return type: simple return _retval; } -cef_menu_item_type_t CEF_CALLBACK menu_model_get_type_at( - struct _cef_menu_model_t* self, int index) { +cef_menu_item_type_t CEF_CALLBACK +menu_model_get_type_at(struct _cef_menu_model_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -467,15 +460,15 @@ cef_menu_item_type_t CEF_CALLBACK menu_model_get_type_at( return MENUITEMTYPE_NONE; // Execute - cef_menu_item_type_t _retval = CefMenuModelCppToC::Get(self)->GetTypeAt( - index); + cef_menu_item_type_t _retval = + CefMenuModelCppToC::Get(self)->GetTypeAt(index); // Return type: simple return _retval; } int CEF_CALLBACK menu_model_get_group_id(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -483,15 +476,14 @@ int CEF_CALLBACK menu_model_get_group_id(struct _cef_menu_model_t* self, return 0; // Execute - int _retval = CefMenuModelCppToC::Get(self)->GetGroupId( - command_id); + int _retval = CefMenuModelCppToC::Get(self)->GetGroupId(command_id); // Return type: simple return _retval; } int CEF_CALLBACK menu_model_get_group_id_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -499,15 +491,15 @@ int CEF_CALLBACK menu_model_get_group_id_at(struct _cef_menu_model_t* self, return 0; // Execute - int _retval = CefMenuModelCppToC::Get(self)->GetGroupIdAt( - index); + int _retval = CefMenuModelCppToC::Get(self)->GetGroupIdAt(index); // Return type: simple return _retval; } int CEF_CALLBACK menu_model_set_group_id(struct _cef_menu_model_t* self, - int command_id, int group_id) { + int command_id, + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -515,16 +507,16 @@ int CEF_CALLBACK menu_model_set_group_id(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetGroupId( - command_id, - group_id); + bool _retval = + CefMenuModelCppToC::Get(self)->SetGroupId(command_id, group_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_group_id_at(struct _cef_menu_model_t* self, - int index, int group_id) { + int index, + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -532,16 +524,14 @@ int CEF_CALLBACK menu_model_set_group_id_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetGroupIdAt( - index, - group_id); + bool _retval = CefMenuModelCppToC::Get(self)->SetGroupIdAt(index, group_id); // Return type: bool return _retval; } -struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu( - struct _cef_menu_model_t* self, int command_id) { +struct _cef_menu_model_t* CEF_CALLBACK +menu_model_get_sub_menu(struct _cef_menu_model_t* self, int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -549,15 +539,15 @@ struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu( return NULL; // Execute - CefRefPtr _retval = CefMenuModelCppToC::Get(self)->GetSubMenu( - command_id); + CefRefPtr _retval = + CefMenuModelCppToC::Get(self)->GetSubMenu(command_id); // Return type: refptr_same return CefMenuModelCppToC::Wrap(_retval); } -struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu_at( - struct _cef_menu_model_t* self, int index) { +struct _cef_menu_model_t* CEF_CALLBACK +menu_model_get_sub_menu_at(struct _cef_menu_model_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -565,15 +555,15 @@ struct _cef_menu_model_t* CEF_CALLBACK menu_model_get_sub_menu_at( return NULL; // Execute - CefRefPtr _retval = CefMenuModelCppToC::Get(self)->GetSubMenuAt( - index); + CefRefPtr _retval = + CefMenuModelCppToC::Get(self)->GetSubMenuAt(index); // Return type: refptr_same return CefMenuModelCppToC::Wrap(_retval); } int CEF_CALLBACK menu_model_is_visible(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -581,15 +571,14 @@ int CEF_CALLBACK menu_model_is_visible(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsVisible( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->IsVisible(command_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_is_visible_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -597,15 +586,15 @@ int CEF_CALLBACK menu_model_is_visible_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsVisibleAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->IsVisibleAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_visible(struct _cef_menu_model_t* self, - int command_id, int visible) { + int command_id, + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -614,15 +603,15 @@ int CEF_CALLBACK menu_model_set_visible(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetVisible( - command_id, - visible?true:false); + command_id, visible ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_visible_at(struct _cef_menu_model_t* self, - int index, int visible) { + int index, + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -631,15 +620,14 @@ int CEF_CALLBACK menu_model_set_visible_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetVisibleAt( - index, - visible?true:false); + index, visible ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_is_enabled(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -647,15 +635,14 @@ int CEF_CALLBACK menu_model_is_enabled(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsEnabled( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->IsEnabled(command_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_is_enabled_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -663,15 +650,15 @@ int CEF_CALLBACK menu_model_is_enabled_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsEnabledAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->IsEnabledAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_enabled(struct _cef_menu_model_t* self, - int command_id, int enabled) { + int command_id, + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -680,15 +667,15 @@ int CEF_CALLBACK menu_model_set_enabled(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetEnabled( - command_id, - enabled?true:false); + command_id, enabled ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_enabled_at(struct _cef_menu_model_t* self, - int index, int enabled) { + int index, + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -697,15 +684,14 @@ int CEF_CALLBACK menu_model_set_enabled_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetEnabledAt( - index, - enabled?true:false); + index, enabled ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_is_checked(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -713,15 +699,14 @@ int CEF_CALLBACK menu_model_is_checked(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsChecked( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->IsChecked(command_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_is_checked_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -729,15 +714,15 @@ int CEF_CALLBACK menu_model_is_checked_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->IsCheckedAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->IsCheckedAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_checked(struct _cef_menu_model_t* self, - int command_id, int checked) { + int command_id, + int checked) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -746,15 +731,15 @@ int CEF_CALLBACK menu_model_set_checked(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetChecked( - command_id, - checked?true:false); + command_id, checked ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_checked_at(struct _cef_menu_model_t* self, - int index, int checked) { + int index, + int checked) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -763,15 +748,14 @@ int CEF_CALLBACK menu_model_set_checked_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetCheckedAt( - index, - checked?true:false); + index, checked ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_has_accelerator(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -779,15 +763,14 @@ int CEF_CALLBACK menu_model_has_accelerator(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->HasAccelerator( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->HasAccelerator(command_id); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_has_accelerator_at(struct _cef_menu_model_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -795,16 +778,18 @@ int CEF_CALLBACK menu_model_has_accelerator_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->HasAcceleratorAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->HasAcceleratorAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_accelerator(struct _cef_menu_model_t* self, - int command_id, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed) { + int command_id, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -813,19 +798,19 @@ int CEF_CALLBACK menu_model_set_accelerator(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetAccelerator( - command_id, - key_code, - shift_pressed?true:false, - ctrl_pressed?true:false, - alt_pressed?true:false); + command_id, key_code, shift_pressed ? true : false, + ctrl_pressed ? true : false, alt_pressed ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_accelerator_at(struct _cef_menu_model_t* self, - int index, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed) { + int index, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -834,18 +819,15 @@ int CEF_CALLBACK menu_model_set_accelerator_at(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetAcceleratorAt( - index, - key_code, - shift_pressed?true:false, - ctrl_pressed?true:false, - alt_pressed?true:false); + index, key_code, shift_pressed ? true : false, + ctrl_pressed ? true : false, alt_pressed ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_remove_accelerator(struct _cef_menu_model_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -853,15 +835,14 @@ int CEF_CALLBACK menu_model_remove_accelerator(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->RemoveAccelerator( - command_id); + bool _retval = CefMenuModelCppToC::Get(self)->RemoveAccelerator(command_id); // Return type: bool return _retval; } -int CEF_CALLBACK menu_model_remove_accelerator_at( - struct _cef_menu_model_t* self, int index) { +int CEF_CALLBACK +menu_model_remove_accelerator_at(struct _cef_menu_model_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -869,16 +850,18 @@ int CEF_CALLBACK menu_model_remove_accelerator_at( return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->RemoveAcceleratorAt( - index); + bool _retval = CefMenuModelCppToC::Get(self)->RemoveAcceleratorAt(index); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_get_accelerator(struct _cef_menu_model_t* self, - int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, - int* alt_pressed) { + int command_id, + int* key_code, + int* shift_pressed, + int* ctrl_pressed, + int* alt_pressed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -902,20 +885,17 @@ int CEF_CALLBACK menu_model_get_accelerator(struct _cef_menu_model_t* self, return 0; // Translate param: key_code; type: simple_byref - int key_codeVal = key_code?*key_code:0; + int key_codeVal = key_code ? *key_code : 0; // Translate param: shift_pressed; type: bool_byref - bool shift_pressedBool = (shift_pressed && *shift_pressed)?true:false; + bool shift_pressedBool = (shift_pressed && *shift_pressed) ? true : false; // Translate param: ctrl_pressed; type: bool_byref - bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed)?true:false; + bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed) ? true : false; // Translate param: alt_pressed; type: bool_byref - bool alt_pressedBool = (alt_pressed && *alt_pressed)?true:false; + bool alt_pressedBool = (alt_pressed && *alt_pressed) ? true : false; // Execute bool _retval = CefMenuModelCppToC::Get(self)->GetAccelerator( - command_id, - key_codeVal, - shift_pressedBool, - ctrl_pressedBool, + command_id, key_codeVal, shift_pressedBool, ctrl_pressedBool, alt_pressedBool); // Restore param: key_code; type: simple_byref @@ -923,21 +903,24 @@ int CEF_CALLBACK menu_model_get_accelerator(struct _cef_menu_model_t* self, *key_code = key_codeVal; // Restore param: shift_pressed; type: bool_byref if (shift_pressed) - *shift_pressed = shift_pressedBool?true:false; + *shift_pressed = shift_pressedBool ? true : false; // Restore param: ctrl_pressed; type: bool_byref if (ctrl_pressed) - *ctrl_pressed = ctrl_pressedBool?true:false; + *ctrl_pressed = ctrl_pressedBool ? true : false; // Restore param: alt_pressed; type: bool_byref if (alt_pressed) - *alt_pressed = alt_pressedBool?true:false; + *alt_pressed = alt_pressedBool ? true : false; // Return type: bool return _retval; } int CEF_CALLBACK menu_model_get_accelerator_at(struct _cef_menu_model_t* self, - int index, int* key_code, int* shift_pressed, int* ctrl_pressed, - int* alt_pressed) { + int index, + int* key_code, + int* shift_pressed, + int* ctrl_pressed, + int* alt_pressed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -961,41 +944,39 @@ int CEF_CALLBACK menu_model_get_accelerator_at(struct _cef_menu_model_t* self, return 0; // Translate param: key_code; type: simple_byref - int key_codeVal = key_code?*key_code:0; + int key_codeVal = key_code ? *key_code : 0; // Translate param: shift_pressed; type: bool_byref - bool shift_pressedBool = (shift_pressed && *shift_pressed)?true:false; + bool shift_pressedBool = (shift_pressed && *shift_pressed) ? true : false; // Translate param: ctrl_pressed; type: bool_byref - bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed)?true:false; + bool ctrl_pressedBool = (ctrl_pressed && *ctrl_pressed) ? true : false; // Translate param: alt_pressed; type: bool_byref - bool alt_pressedBool = (alt_pressed && *alt_pressed)?true:false; + bool alt_pressedBool = (alt_pressed && *alt_pressed) ? true : false; // Execute bool _retval = CefMenuModelCppToC::Get(self)->GetAcceleratorAt( - index, - key_codeVal, - shift_pressedBool, - ctrl_pressedBool, - alt_pressedBool); + index, key_codeVal, shift_pressedBool, ctrl_pressedBool, alt_pressedBool); // Restore param: key_code; type: simple_byref if (key_code) *key_code = key_codeVal; // Restore param: shift_pressed; type: bool_byref if (shift_pressed) - *shift_pressed = shift_pressedBool?true:false; + *shift_pressed = shift_pressedBool ? true : false; // Restore param: ctrl_pressed; type: bool_byref if (ctrl_pressed) - *ctrl_pressed = ctrl_pressedBool?true:false; + *ctrl_pressed = ctrl_pressedBool ? true : false; // Restore param: alt_pressed; type: bool_byref if (alt_pressed) - *alt_pressed = alt_pressedBool?true:false; + *alt_pressed = alt_pressedBool ? true : false; // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_color(struct _cef_menu_model_t* self, - int command_id, cef_menu_color_type_t color_type, cef_color_t color) { + int command_id, + cef_menu_color_type_t color_type, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1003,17 +984,17 @@ int CEF_CALLBACK menu_model_set_color(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetColor( - command_id, - color_type, - color); + bool _retval = + CefMenuModelCppToC::Get(self)->SetColor(command_id, color_type, color); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_color_at(struct _cef_menu_model_t* self, - int index, cef_menu_color_type_t color_type, cef_color_t color) { + int index, + cef_menu_color_type_t color_type, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1021,17 +1002,17 @@ int CEF_CALLBACK menu_model_set_color_at(struct _cef_menu_model_t* self, return 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetColorAt( - index, - color_type, - color); + bool _retval = + CefMenuModelCppToC::Get(self)->SetColorAt(index, color_type, color); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_get_color(struct _cef_menu_model_t* self, - int command_id, cef_menu_color_type_t color_type, cef_color_t* color) { + int command_id, + cef_menu_color_type_t color_type, + cef_color_t* color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1043,13 +1024,11 @@ int CEF_CALLBACK menu_model_get_color(struct _cef_menu_model_t* self, return 0; // Translate param: color; type: simple_byref - cef_color_t colorVal = color?*color:0; + cef_color_t colorVal = color ? *color : 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->GetColor( - command_id, - color_type, - colorVal); + bool _retval = + CefMenuModelCppToC::Get(self)->GetColor(command_id, color_type, colorVal); // Restore param: color; type: simple_byref if (color) @@ -1060,7 +1039,9 @@ int CEF_CALLBACK menu_model_get_color(struct _cef_menu_model_t* self, } int CEF_CALLBACK menu_model_get_color_at(struct _cef_menu_model_t* self, - int index, cef_menu_color_type_t color_type, cef_color_t* color) { + int index, + cef_menu_color_type_t color_type, + cef_color_t* color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1072,13 +1053,11 @@ int CEF_CALLBACK menu_model_get_color_at(struct _cef_menu_model_t* self, return 0; // Translate param: color; type: simple_byref - cef_color_t colorVal = color?*color:0; + cef_color_t colorVal = color ? *color : 0; // Execute - bool _retval = CefMenuModelCppToC::Get(self)->GetColorAt( - index, - color_type, - colorVal); + bool _retval = + CefMenuModelCppToC::Get(self)->GetColorAt(index, color_type, colorVal); // Restore param: color; type: simple_byref if (color) @@ -1089,7 +1068,8 @@ int CEF_CALLBACK menu_model_get_color_at(struct _cef_menu_model_t* self, } int CEF_CALLBACK menu_model_set_font_list(struct _cef_menu_model_t* self, - int command_id, const cef_string_t* font_list) { + int command_id, + const cef_string_t* font_list) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1099,15 +1079,15 @@ int CEF_CALLBACK menu_model_set_font_list(struct _cef_menu_model_t* self, // Execute bool _retval = CefMenuModelCppToC::Get(self)->SetFontList( - command_id, - CefString(font_list)); + command_id, CefString(font_list)); // Return type: bool return _retval; } int CEF_CALLBACK menu_model_set_font_list_at(struct _cef_menu_model_t* self, - int index, const cef_string_t* font_list) { + int index, + const cef_string_t* font_list) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1116,9 +1096,8 @@ int CEF_CALLBACK menu_model_set_font_list_at(struct _cef_menu_model_t* self, // Unverified params: font_list // Execute - bool _retval = CefMenuModelCppToC::Get(self)->SetFontListAt( - index, - CefString(font_list)); + bool _retval = + CefMenuModelCppToC::Get(self)->SetFontListAt(index, CefString(font_list)); // Return type: bool return _retval; @@ -1126,7 +1105,6 @@ int CEF_CALLBACK menu_model_set_font_list_at(struct _cef_menu_model_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefMenuModelCppToC::CefMenuModelCppToC() { @@ -1188,17 +1166,23 @@ CefMenuModelCppToC::CefMenuModelCppToC() { GetStruct()->set_font_list_at = menu_model_set_font_list_at; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_menu_model_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_menu_model_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_MODEL; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_MENU_MODEL; diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.h b/libcef_dll/cpptoc/menu_model_cpptoc.h index 9cadc6e1a..f7d62508b 100644 --- a/libcef_dll/cpptoc/menu_model_cpptoc.h +++ b/libcef_dll/cpptoc/menu_model_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=335b8e71be56de8f0b5e9788c787bf63a91d1e46$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_menu_model.h" #include "include/capi/cef_menu_model_capi.h" +#include "include/cef_menu_model.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefMenuModelCppToC - : public CefCppToCRefCounted { +class CefMenuModelCppToC : public CefCppToCRefCounted { public: CefMenuModelCppToC(); }; diff --git a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc index 439fa71fa..81f28eb4a 100644 --- a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8df90eb582df20061513fb80264da53b9d97849b$ +// #include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h" #include "libcef_dll/ctocpp/menu_model_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK menu_model_delegate_execute_command( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model, - int command_id, cef_event_flags_t event_flags) { +void CEF_CALLBACK +menu_model_delegate_execute_command(struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model, + int command_id, + cef_event_flags_t event_flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,14 +36,13 @@ void CEF_CALLBACK menu_model_delegate_execute_command( // Execute CefMenuModelDelegateCppToC::Get(self)->ExecuteCommand( - CefMenuModelCToCpp::Wrap(menu_model), - command_id, - event_flags); + CefMenuModelCToCpp::Wrap(menu_model), command_id, event_flags); } -void CEF_CALLBACK menu_model_delegate_mouse_outside_menu( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model, - const cef_point_t* screen_point) { +void CEF_CALLBACK +menu_model_delegate_mouse_outside_menu(struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model, + const cef_point_t* screen_point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,16 +58,16 @@ void CEF_CALLBACK menu_model_delegate_mouse_outside_menu( return; // Translate param: screen_point; type: simple_byref_const - CefPoint screen_pointVal = screen_point?*screen_point:CefPoint(); + CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint(); // Execute CefMenuModelDelegateCppToC::Get(self)->MouseOutsideMenu( - CefMenuModelCToCpp::Wrap(menu_model), - screen_pointVal); + CefMenuModelCToCpp::Wrap(menu_model), screen_pointVal); } void CEF_CALLBACK menu_model_delegate_unhandled_open_submenu( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model, + struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model, int is_rtl) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -79,12 +81,12 @@ void CEF_CALLBACK menu_model_delegate_unhandled_open_submenu( // Execute CefMenuModelDelegateCppToC::Get(self)->UnhandledOpenSubmenu( - CefMenuModelCToCpp::Wrap(menu_model), - is_rtl?true:false); + CefMenuModelCToCpp::Wrap(menu_model), is_rtl ? true : false); } void CEF_CALLBACK menu_model_delegate_unhandled_close_submenu( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model, + struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model, int is_rtl) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -98,12 +100,12 @@ void CEF_CALLBACK menu_model_delegate_unhandled_close_submenu( // Execute CefMenuModelDelegateCppToC::Get(self)->UnhandledCloseSubmenu( - CefMenuModelCToCpp::Wrap(menu_model), - is_rtl?true:false); + CefMenuModelCToCpp::Wrap(menu_model), is_rtl ? true : false); } -void CEF_CALLBACK menu_model_delegate_menu_will_show( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model) { +void CEF_CALLBACK +menu_model_delegate_menu_will_show(struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -119,8 +121,9 @@ void CEF_CALLBACK menu_model_delegate_menu_will_show( CefMenuModelCToCpp::Wrap(menu_model)); } -void CEF_CALLBACK menu_model_delegate_menu_closed( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model) { +void CEF_CALLBACK +menu_model_delegate_menu_closed(struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -136,9 +139,10 @@ void CEF_CALLBACK menu_model_delegate_menu_closed( CefMenuModelCToCpp::Wrap(menu_model)); } -int CEF_CALLBACK menu_model_delegate_format_label( - struct _cef_menu_model_delegate_t* self, cef_menu_model_t* menu_model, - cef_string_t* label) { +int CEF_CALLBACK +menu_model_delegate_format_label(struct _cef_menu_model_delegate_t* self, + cef_menu_model_t* menu_model, + cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -158,8 +162,7 @@ int CEF_CALLBACK menu_model_delegate_format_label( // Execute bool _retval = CefMenuModelDelegateCppToC::Get(self)->FormatLabel( - CefMenuModelCToCpp::Wrap(menu_model), - labelStr); + CefMenuModelCToCpp::Wrap(menu_model), labelStr); // Return type: bool return _retval; @@ -167,7 +170,6 @@ int CEF_CALLBACK menu_model_delegate_format_label( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() { @@ -182,18 +184,26 @@ CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() { GetStruct()->format_label = menu_model_delegate_format_label; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_menu_model_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefMenuModelDelegateCppToC, + CefMenuModelDelegate, + cef_menu_model_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_menu_model_delegate_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_MODEL_DELEGATE; diff --git a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h index 3ca65ad2e..1dad3f119 100644 --- a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f046a87603438be01105085cccbf6bb65838a495$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_DELEGATE_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_menu_model_delegate.h" +#include "include/capi/cef_menu_model_capi.h" #include "include/capi/cef_menu_model_delegate_capi.h" #include "include/cef_menu_model.h" -#include "include/capi/cef_menu_model_capi.h" +#include "include/cef_menu_model_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefMenuModelDelegateCppToC : public CefCppToCRefCounted { + CefMenuModelDelegate, + cef_menu_model_delegate_t> { public: CefMenuModelDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc index 212d65312..49fa94e5e 100644 --- a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc +++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=621ee97874f724bf57e27cfcfd4731c161d0b353$ +// #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" #include "libcef_dll/cpptoc/sslstatus_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK navigation_entry_is_valid( - struct _cef_navigation_entry_t* self) { +int CEF_CALLBACK +navigation_entry_is_valid(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +34,8 @@ int CEF_CALLBACK navigation_entry_is_valid( return _retval; } -cef_string_userfree_t CEF_CALLBACK navigation_entry_get_url( - struct _cef_navigation_entry_t* self) { +cef_string_userfree_t CEF_CALLBACK +navigation_entry_get_url(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,8 +49,8 @@ cef_string_userfree_t CEF_CALLBACK navigation_entry_get_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK navigation_entry_get_display_url( - struct _cef_navigation_entry_t* self) { +cef_string_userfree_t CEF_CALLBACK +navigation_entry_get_display_url(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -63,8 +64,8 @@ cef_string_userfree_t CEF_CALLBACK navigation_entry_get_display_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK navigation_entry_get_original_url( - struct _cef_navigation_entry_t* self) { +cef_string_userfree_t CEF_CALLBACK +navigation_entry_get_original_url(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,8 +79,8 @@ cef_string_userfree_t CEF_CALLBACK navigation_entry_get_original_url( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK navigation_entry_get_title( - struct _cef_navigation_entry_t* self) { +cef_string_userfree_t CEF_CALLBACK +navigation_entry_get_title(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +94,8 @@ cef_string_userfree_t CEF_CALLBACK navigation_entry_get_title( return _retval.DetachToUserFree(); } -cef_transition_type_t CEF_CALLBACK navigation_entry_get_transition_type( - struct _cef_navigation_entry_t* self) { +cef_transition_type_t CEF_CALLBACK +navigation_entry_get_transition_type(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -102,15 +103,15 @@ cef_transition_type_t CEF_CALLBACK navigation_entry_get_transition_type( return TT_EXPLICIT; // Execute - cef_transition_type_t _retval = CefNavigationEntryCppToC::Get( - self)->GetTransitionType(); + cef_transition_type_t _retval = + CefNavigationEntryCppToC::Get(self)->GetTransitionType(); // Return type: simple return _retval; } -int CEF_CALLBACK navigation_entry_has_post_data( - struct _cef_navigation_entry_t* self) { +int CEF_CALLBACK +navigation_entry_has_post_data(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,8 +125,8 @@ int CEF_CALLBACK navigation_entry_has_post_data( return _retval; } -cef_time_t CEF_CALLBACK navigation_entry_get_completion_time( - struct _cef_navigation_entry_t* self) { +cef_time_t CEF_CALLBACK +navigation_entry_get_completion_time(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +140,8 @@ cef_time_t CEF_CALLBACK navigation_entry_get_completion_time( return _retval; } -int CEF_CALLBACK navigation_entry_get_http_status_code( - struct _cef_navigation_entry_t* self) { +int CEF_CALLBACK +navigation_entry_get_http_status_code(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,8 +155,8 @@ int CEF_CALLBACK navigation_entry_get_http_status_code( return _retval; } -struct _cef_sslstatus_t* CEF_CALLBACK navigation_entry_get_sslstatus( - struct _cef_navigation_entry_t* self) { +struct _cef_sslstatus_t* CEF_CALLBACK +navigation_entry_get_sslstatus(struct _cef_navigation_entry_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -163,8 +164,8 @@ struct _cef_sslstatus_t* CEF_CALLBACK navigation_entry_get_sslstatus( return NULL; // Execute - CefRefPtr _retval = CefNavigationEntryCppToC::Get( - self)->GetSSLStatus(); + CefRefPtr _retval = + CefNavigationEntryCppToC::Get(self)->GetSSLStatus(); // Return type: refptr_same return CefSSLStatusCppToC::Wrap(_retval); @@ -172,7 +173,6 @@ struct _cef_sslstatus_t* CEF_CALLBACK navigation_entry_get_sslstatus( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefNavigationEntryCppToC::CefNavigationEntryCppToC() { @@ -188,18 +188,26 @@ CefNavigationEntryCppToC::CefNavigationEntryCppToC() { GetStruct()->get_sslstatus = navigation_entry_get_sslstatus; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_navigation_entry_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefNavigationEntryCppToC, + CefNavigationEntry, + cef_navigation_entry_t>::UnwrapDerived(CefWrapperType type, + cef_navigation_entry_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_NAVIGATION_ENTRY; diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_cpptoc.h index ec8dd605c..db743a1fb 100644 --- a/libcef_dll/cpptoc/navigation_entry_cpptoc.h +++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d94f81d5783a21213bb748ae7797705fabba46b5$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_navigation_entry.h" #include "include/capi/cef_navigation_entry_capi.h" +#include "include/cef_navigation_entry.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefNavigationEntryCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefNavigationEntryCppToC(); }; diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc index e288dace0..326bdae84 100644 --- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc @@ -9,19 +9,22 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=06ab08bb628eb7ec388604c9b393e9e9e1200435$ +// #include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK navigation_entry_visitor_visit( - struct _cef_navigation_entry_visitor_t* self, - struct _cef_navigation_entry_t* entry, int current, int index, - int total) { +int CEF_CALLBACK +navigation_entry_visitor_visit(struct _cef_navigation_entry_visitor_t* self, + struct _cef_navigation_entry_t* entry, + int current, + int index, + int total) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,9 +37,7 @@ int CEF_CALLBACK navigation_entry_visitor_visit( // Execute bool _retval = CefNavigationEntryVisitorCppToC::Get(self)->Visit( - CefNavigationEntryCToCpp::Wrap(entry), - current?true:false, - index, + CefNavigationEntryCToCpp::Wrap(entry), current ? true : false, index, total); // Return type: bool @@ -45,26 +46,33 @@ int CEF_CALLBACK navigation_entry_visitor_visit( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC() { GetStruct()->visit = navigation_entry_visitor_visit; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_navigation_entry_visitor_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_navigation_entry_visitor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_NAVIGATION_ENTRY_VISITOR; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_NAVIGATION_ENTRY_VISITOR; diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h index 9d54c47db..9444a5788 100644 --- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c17008976e7d41af34c2b4aebb9f0fe15b37cbf7$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefNavigationEntryVisitorCppToC : public CefCppToCRefCounted { + CefNavigationEntryVisitor, + cef_navigation_entry_visitor_t> { public: CefNavigationEntryVisitorCppToC(); }; diff --git a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc index 6a96785c0..a189038d7 100644 --- a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc @@ -9,16 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6f723c637ef687429368a60f58037a36e5a5ce89$ +// #include "libcef_dll/cpptoc/pdf_print_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK pdf_print_callback_on_pdf_print_finished( - struct _cef_pdf_print_callback_t* self, const cef_string_t* path, int ok) { +void CEF_CALLBACK +pdf_print_callback_on_pdf_print_finished(struct _cef_pdf_print_callback_t* self, + const cef_string_t* path, + int ok) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -30,32 +33,38 @@ void CEF_CALLBACK pdf_print_callback_on_pdf_print_finished( return; // Execute - CefPdfPrintCallbackCppToC::Get(self)->OnPdfPrintFinished( - CefString(path), - ok?true:false); + CefPdfPrintCallbackCppToC::Get(self)->OnPdfPrintFinished(CefString(path), + ok ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPdfPrintCallbackCppToC::CefPdfPrintCallbackCppToC() { GetStruct()->on_pdf_print_finished = pdf_print_callback_on_pdf_print_finished; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_pdf_print_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPdfPrintCallbackCppToC, + CefPdfPrintCallback, + cef_pdf_print_callback_t>::UnwrapDerived(CefWrapperType type, + cef_pdf_print_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PDF_PRINT_CALLBACK; diff --git a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h index 4ae264e16..929d1f333 100644 --- a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h +++ b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3102a69251d6de737ac43443955c3fb8ae73067c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PDF_PRINT_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PDF_PRINT_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefPdfPrintCallbackCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefPdfPrintCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc index 1ced479b5..f673b6fef 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_cpptoc.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c4a9a8f009c2ada8fb9756462e49f7f65f931056$ +// #include #include "libcef_dll/cpptoc/post_data_cpptoc.h" #include "libcef_dll/cpptoc/post_data_element_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_post_data_t* cef_post_data_create() { @@ -27,7 +28,6 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() { return CefPostDataCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -46,8 +46,8 @@ int CEF_CALLBACK post_data_is_read_only(struct _cef_post_data_t* self) { return _retval; } -int CEF_CALLBACK post_data_has_excluded_elements( - struct _cef_post_data_t* self) { +int CEF_CALLBACK +post_data_has_excluded_elements(struct _cef_post_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -75,8 +75,10 @@ size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) { return _retval; } -void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, - size_t* elementsCount, struct _cef_post_data_element_t** elements) { +void CEF_CALLBACK +post_data_get_elements(struct _cef_post_data_t* self, + size_t* elementsCount, + struct _cef_post_data_element_t** elements) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,7 +90,7 @@ void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, return; // Translate param: elements; type: refptr_vec_same_byref - std::vector > elementsList; + std::vector> elementsList; if (elementsCount && *elementsCount > 0 && elements) { for (size_t i = 0; i < *elementsCount; ++i) { elementsList.push_back(CefPostDataElementCppToC::Unwrap(elements[i])); @@ -96,8 +98,7 @@ void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, } // Execute - CefPostDataCppToC::Get(self)->GetElements( - elementsList); + CefPostDataCppToC::Get(self)->GetElements(elementsList); // Restore param: elements; type: refptr_vec_same_byref if (elementsCount && elements) { @@ -110,8 +111,9 @@ void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, } } -int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element) { +int CEF_CALLBACK +post_data_remove_element(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -130,8 +132,9 @@ int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, return _retval; } -int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element) { +int CEF_CALLBACK +post_data_add_element(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -163,7 +166,6 @@ void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPostDataCppToC::CefPostDataCppToC() { @@ -176,17 +178,23 @@ CefPostDataCppToC::CefPostDataCppToC() { GetStruct()->remove_elements = post_data_remove_elements; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_post_data_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_post_data_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_POST_DATA; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_POST_DATA; diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h index a4a2dd700..4563f2de2 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=15ed70a9e2f6397178411f1f4a1a3eaf54a47586$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefPostDataCppToC - : public CefCppToCRefCounted { +class CefPostDataCppToC : public CefCppToCRefCounted { public: CefPostDataCppToC(); }; diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc index 97a0a09a4..e934a6f4b 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=34bc8098c254fc94e374b5ff47f6ffc065c87336$ +// #include "libcef_dll/cpptoc/post_data_element_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() { @@ -25,13 +26,12 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() { return CefPostDataElementCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK post_data_element_is_read_only( - struct _cef_post_data_element_t* self) { +int CEF_CALLBACK +post_data_element_is_read_only(struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -45,8 +45,8 @@ int CEF_CALLBACK post_data_element_is_read_only( return _retval; } -void CEF_CALLBACK post_data_element_set_to_empty( - struct _cef_post_data_element_t* self) { +void CEF_CALLBACK +post_data_element_set_to_empty(struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -57,8 +57,9 @@ void CEF_CALLBACK post_data_element_set_to_empty( CefPostDataElementCppToC::Get(self)->SetToEmpty(); } -void CEF_CALLBACK post_data_element_set_to_file( - struct _cef_post_data_element_t* self, const cef_string_t* fileName) { +void CEF_CALLBACK +post_data_element_set_to_file(struct _cef_post_data_element_t* self, + const cef_string_t* fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -70,12 +71,13 @@ void CEF_CALLBACK post_data_element_set_to_file( return; // Execute - CefPostDataElementCppToC::Get(self)->SetToFile( - CefString(fileName)); + CefPostDataElementCppToC::Get(self)->SetToFile(CefString(fileName)); } -void CEF_CALLBACK post_data_element_set_to_bytes( - struct _cef_post_data_element_t* self, size_t size, const void* bytes) { +void CEF_CALLBACK +post_data_element_set_to_bytes(struct _cef_post_data_element_t* self, + size_t size, + const void* bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,13 +89,11 @@ void CEF_CALLBACK post_data_element_set_to_bytes( return; // Execute - CefPostDataElementCppToC::Get(self)->SetToBytes( - size, - bytes); + CefPostDataElementCppToC::Get(self)->SetToBytes(size, bytes); } -cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( - struct _cef_post_data_element_t* self) { +cef_postdataelement_type_t CEF_CALLBACK +post_data_element_get_type(struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -101,15 +101,15 @@ cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( return PDE_TYPE_EMPTY; // Execute - cef_postdataelement_type_t _retval = CefPostDataElementCppToC::Get( - self)->GetType(); + cef_postdataelement_type_t _retval = + CefPostDataElementCppToC::Get(self)->GetType(); // Return type: simple return _retval; } -cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( - struct _cef_post_data_element_t* self) { +cef_string_userfree_t CEF_CALLBACK +post_data_element_get_file(struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,8 +123,8 @@ cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( return _retval.DetachToUserFree(); } -size_t CEF_CALLBACK post_data_element_get_bytes_count( - struct _cef_post_data_element_t* self) { +size_t CEF_CALLBACK +post_data_element_get_bytes_count(struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -138,8 +138,10 @@ size_t CEF_CALLBACK post_data_element_get_bytes_count( return _retval; } -size_t CEF_CALLBACK post_data_element_get_bytes( - struct _cef_post_data_element_t* self, size_t size, void* bytes) { +size_t CEF_CALLBACK +post_data_element_get_bytes(struct _cef_post_data_element_t* self, + size_t size, + void* bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -151,9 +153,7 @@ size_t CEF_CALLBACK post_data_element_get_bytes( return 0; // Execute - size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytes( - size, - bytes); + size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytes(size, bytes); // Return type: simple return _retval; @@ -161,7 +161,6 @@ size_t CEF_CALLBACK post_data_element_get_bytes( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPostDataElementCppToC::CefPostDataElementCppToC() { @@ -175,18 +174,26 @@ CefPostDataElementCppToC::CefPostDataElementCppToC() { GetStruct()->get_bytes = post_data_element_get_bytes; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_post_data_element_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPostDataElementCppToC, + CefPostDataElement, + cef_post_data_element_t>::UnwrapDerived(CefWrapperType type, + cef_post_data_element_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_POST_DATA_ELEMENT; diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h index 0af30a495..d151a0142 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e35f3f38369fb0ee94c8eb120d8b5db04eda5e28$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefPostDataElementCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefPostDataElementCppToC(); }; diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc index 2f518617c..8999ecdb6 100644 --- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc @@ -9,18 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=12bfad16bf7ce5f2a54f06cb48fa49df496bf9a9$ +// #include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h" #include "libcef_dll/cpptoc/print_settings_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK print_dialog_callback_cont( - struct _cef_print_dialog_callback_t* self, - struct _cef_print_settings_t* settings) { +void CEF_CALLBACK +print_dialog_callback_cont(struct _cef_print_dialog_callback_t* self, + struct _cef_print_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -36,8 +37,8 @@ void CEF_CALLBACK print_dialog_callback_cont( CefPrintSettingsCppToC::Unwrap(settings)); } -void CEF_CALLBACK print_dialog_callback_cancel( - struct _cef_print_dialog_callback_t* self) { +void CEF_CALLBACK +print_dialog_callback_cancel(struct _cef_print_dialog_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,7 +51,6 @@ void CEF_CALLBACK print_dialog_callback_cancel( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC() { @@ -58,18 +58,27 @@ CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC() { GetStruct()->cancel = print_dialog_callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_print_dialog_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPrintDialogCallbackCppToC, + CefPrintDialogCallback, + cef_print_dialog_callback_t>::UnwrapDerived(CefWrapperType type, + cef_print_dialog_callback_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h index 63869885e..965f1277b 100644 --- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2226f122addf13cffaabae85c20db9b49f437129$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefPrintDialogCallbackCppToC : public CefCppToCRefCounted { + CefPrintDialogCallback, + cef_print_dialog_callback_t> { public: CefPrintDialogCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc index 71a830d11..48ecd71e2 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e2a9910119dcf81b74624588d222c7781e3fdc9a$ +// #include "libcef_dll/cpptoc/print_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" @@ -16,13 +18,13 @@ #include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" #include "libcef_dll/ctocpp/print_settings_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK print_handler_on_print_start( - struct _cef_print_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +print_handler_on_print_start(struct _cef_print_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -38,9 +40,10 @@ void CEF_CALLBACK print_handler_on_print_start( CefBrowserCToCpp::Wrap(browser)); } -void CEF_CALLBACK print_handler_on_print_settings( - struct _cef_print_handler_t* self, struct _cef_print_settings_t* settings, - int get_defaults) { +void CEF_CALLBACK +print_handler_on_print_settings(struct _cef_print_handler_t* self, + struct _cef_print_settings_t* settings, + int get_defaults) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,13 +56,13 @@ void CEF_CALLBACK print_handler_on_print_settings( // Execute CefPrintHandlerCppToC::Get(self)->OnPrintSettings( - CefPrintSettingsCToCpp::Wrap(settings), - get_defaults?true:false); + CefPrintSettingsCToCpp::Wrap(settings), get_defaults ? true : false); } -int CEF_CALLBACK print_handler_on_print_dialog( - struct _cef_print_handler_t* self, int has_selection, - cef_print_dialog_callback_t* callback) { +int CEF_CALLBACK +print_handler_on_print_dialog(struct _cef_print_handler_t* self, + int has_selection, + cef_print_dialog_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -72,16 +75,18 @@ int CEF_CALLBACK print_handler_on_print_dialog( // Execute bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintDialog( - has_selection?true:false, + has_selection ? true : false, CefPrintDialogCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -int CEF_CALLBACK print_handler_on_print_job(struct _cef_print_handler_t* self, - const cef_string_t* document_name, const cef_string_t* pdf_file_path, - cef_print_job_callback_t* callback) { +int CEF_CALLBACK +print_handler_on_print_job(struct _cef_print_handler_t* self, + const cef_string_t* document_name, + const cef_string_t* pdf_file_path, + cef_print_job_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -102,16 +107,15 @@ int CEF_CALLBACK print_handler_on_print_job(struct _cef_print_handler_t* self, // Execute bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintJob( - CefString(document_name), - CefString(pdf_file_path), + CefString(document_name), CefString(pdf_file_path), CefPrintJobCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -void CEF_CALLBACK print_handler_on_print_reset( - struct _cef_print_handler_t* self) { +void CEF_CALLBACK +print_handler_on_print_reset(struct _cef_print_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -122,8 +126,9 @@ void CEF_CALLBACK print_handler_on_print_reset( CefPrintHandlerCppToC::Get(self)->OnPrintReset(); } -cef_size_t CEF_CALLBACK print_handler_get_pdf_paper_size( - struct _cef_print_handler_t* self, int device_units_per_inch) { +cef_size_t CEF_CALLBACK +print_handler_get_pdf_paper_size(struct _cef_print_handler_t* self, + int device_units_per_inch) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,8 +136,8 @@ cef_size_t CEF_CALLBACK print_handler_get_pdf_paper_size( return CefSize(); // Execute - cef_size_t _retval = CefPrintHandlerCppToC::Get(self)->GetPdfPaperSize( - device_units_per_inch); + cef_size_t _retval = + CefPrintHandlerCppToC::Get(self)->GetPdfPaperSize(device_units_per_inch); // Return type: simple return _retval; @@ -140,7 +145,6 @@ cef_size_t CEF_CALLBACK print_handler_get_pdf_paper_size( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPrintHandlerCppToC::CefPrintHandlerCppToC() { @@ -152,17 +156,25 @@ CefPrintHandlerCppToC::CefPrintHandlerCppToC() { GetStruct()->get_pdf_paper_size = print_handler_get_pdf_paper_size; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_print_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPrintHandlerCppToC, + CefPrintHandler, + cef_print_handler_t>::UnwrapDerived(CefWrapperType type, + cef_print_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_PRINT_HANDLER; diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h index 02ec23ede..23f7a581f 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.h +++ b/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e4f28fcca959b4d8c39c7c8417e327cae7206acd$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefPrintHandlerCppToC - : public CefCppToCRefCounted { +class CefPrintHandlerCppToC : public CefCppToCRefCounted { public: CefPrintHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc index b1eb6f2b6..9c1a0d619 100644 --- a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a19e32f4c64b0b5f641fec8a31de96f91b7bd982$ +// #include "libcef_dll/cpptoc/print_job_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK print_job_callback_cont( - struct _cef_print_job_callback_t* self) { +void CEF_CALLBACK +print_job_callback_cont(struct _cef_print_job_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,25 +32,32 @@ void CEF_CALLBACK print_job_callback_cont( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPrintJobCallbackCppToC::CefPrintJobCallbackCppToC() { GetStruct()->cont = print_job_callback_cont; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_print_job_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPrintJobCallbackCppToC, + CefPrintJobCallback, + cef_print_job_callback_t>::UnwrapDerived(CefWrapperType type, + cef_print_job_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_JOB_CALLBACK; diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.h b/libcef_dll/cpptoc/print_job_callback_cpptoc.h index 75b32ae0e..5eb5dcca9 100644 --- a/libcef_dll/cpptoc/print_job_callback_cpptoc.h +++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=80e75773859acd98ba3a7fd2e8755f02936f89a8$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefPrintJobCallbackCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefPrintJobCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.cc b/libcef_dll/cpptoc/print_settings_cpptoc.cc index 80931bda6..bf1c85809 100644 --- a/libcef_dll/cpptoc/print_settings_cpptoc.cc +++ b/libcef_dll/cpptoc/print_settings_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4a7de54e64d113db827af72ab032fe3803773e1a$ +// #include #include "libcef_dll/cpptoc/print_settings_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_print_settings_t* cef_print_settings_create() { @@ -26,7 +27,6 @@ CEF_EXPORT cef_print_settings_t* cef_print_settings_create() { return CefPrintSettingsCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -45,8 +45,8 @@ int CEF_CALLBACK print_settings_is_valid(struct _cef_print_settings_t* self) { return _retval; } -int CEF_CALLBACK print_settings_is_read_only( - struct _cef_print_settings_t* self) { +int CEF_CALLBACK +print_settings_is_read_only(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,8 +60,8 @@ int CEF_CALLBACK print_settings_is_read_only( return _retval; } -struct _cef_print_settings_t* CEF_CALLBACK print_settings_copy( - struct _cef_print_settings_t* self) { +struct _cef_print_settings_t* CEF_CALLBACK +print_settings_copy(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -69,15 +69,16 @@ struct _cef_print_settings_t* CEF_CALLBACK print_settings_copy( return NULL; // Execute - CefRefPtr _retval = CefPrintSettingsCppToC::Get(self)->Copy( - ); + CefRefPtr _retval = + CefPrintSettingsCppToC::Get(self)->Copy(); // Return type: refptr_same return CefPrintSettingsCppToC::Wrap(_retval); } -void CEF_CALLBACK print_settings_set_orientation( - struct _cef_print_settings_t* self, int landscape) { +void CEF_CALLBACK +print_settings_set_orientation(struct _cef_print_settings_t* self, + int landscape) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -85,12 +86,11 @@ void CEF_CALLBACK print_settings_set_orientation( return; // Execute - CefPrintSettingsCppToC::Get(self)->SetOrientation( - landscape?true:false); + CefPrintSettingsCppToC::Get(self)->SetOrientation(landscape ? true : false); } -int CEF_CALLBACK print_settings_is_landscape( - struct _cef_print_settings_t* self) { +int CEF_CALLBACK +print_settings_is_landscape(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,7 +107,8 @@ int CEF_CALLBACK print_settings_is_landscape( void CEF_CALLBACK print_settings_set_printer_printable_area( struct _cef_print_settings_t* self, const cef_size_t* physical_size_device_units, - const cef_rect_t* printable_area_device_units, int landscape_needs_flip) { + const cef_rect_t* printable_area_device_units, + int landscape_needs_flip) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,20 +125,20 @@ void CEF_CALLBACK print_settings_set_printer_printable_area( // Translate param: physical_size_device_units; type: simple_byref_const CefSize physical_size_device_unitsVal = - physical_size_device_units?*physical_size_device_units:CefSize(); + physical_size_device_units ? *physical_size_device_units : CefSize(); // Translate param: printable_area_device_units; type: simple_byref_const CefRect printable_area_device_unitsVal = - printable_area_device_units?*printable_area_device_units:CefRect(); + printable_area_device_units ? *printable_area_device_units : CefRect(); // Execute CefPrintSettingsCppToC::Get(self)->SetPrinterPrintableArea( - physical_size_device_unitsVal, - printable_area_device_unitsVal, - landscape_needs_flip?true:false); + physical_size_device_unitsVal, printable_area_device_unitsVal, + landscape_needs_flip ? true : false); } -void CEF_CALLBACK print_settings_set_device_name( - struct _cef_print_settings_t* self, const cef_string_t* name) { +void CEF_CALLBACK +print_settings_set_device_name(struct _cef_print_settings_t* self, + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -146,12 +147,11 @@ void CEF_CALLBACK print_settings_set_device_name( // Unverified params: name // Execute - CefPrintSettingsCppToC::Get(self)->SetDeviceName( - CefString(name)); + CefPrintSettingsCppToC::Get(self)->SetDeviceName(CefString(name)); } -cef_string_userfree_t CEF_CALLBACK print_settings_get_device_name( - struct _cef_print_settings_t* self) { +cef_string_userfree_t CEF_CALLBACK +print_settings_get_device_name(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -166,7 +166,7 @@ cef_string_userfree_t CEF_CALLBACK print_settings_get_device_name( } void CEF_CALLBACK print_settings_set_dpi(struct _cef_print_settings_t* self, - int dpi) { + int dpi) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -174,8 +174,7 @@ void CEF_CALLBACK print_settings_set_dpi(struct _cef_print_settings_t* self, return; // Execute - CefPrintSettingsCppToC::Get(self)->SetDPI( - dpi); + CefPrintSettingsCppToC::Get(self)->SetDPI(dpi); } int CEF_CALLBACK print_settings_get_dpi(struct _cef_print_settings_t* self) { @@ -192,9 +191,10 @@ int CEF_CALLBACK print_settings_get_dpi(struct _cef_print_settings_t* self) { return _retval; } -void CEF_CALLBACK print_settings_set_page_ranges( - struct _cef_print_settings_t* self, size_t rangesCount, - cef_range_t const* ranges) { +void CEF_CALLBACK +print_settings_set_page_ranges(struct _cef_print_settings_t* self, + size_t rangesCount, + cef_range_t const* ranges) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -206,7 +206,7 @@ void CEF_CALLBACK print_settings_set_page_ranges( return; // Translate param: ranges; type: simple_vec_byref_const - std::vector rangesList; + std::vector rangesList; if (rangesCount > 0) { for (size_t i = 0; i < rangesCount; ++i) { CefRange rangesVal = ranges[i]; @@ -215,12 +215,11 @@ void CEF_CALLBACK print_settings_set_page_ranges( } // Execute - CefPrintSettingsCppToC::Get(self)->SetPageRanges( - rangesList); + CefPrintSettingsCppToC::Get(self)->SetPageRanges(rangesList); } -size_t CEF_CALLBACK print_settings_get_page_ranges_count( - struct _cef_print_settings_t* self) { +size_t CEF_CALLBACK +print_settings_get_page_ranges_count(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -234,9 +233,10 @@ size_t CEF_CALLBACK print_settings_get_page_ranges_count( return _retval; } -void CEF_CALLBACK print_settings_get_page_ranges( - struct _cef_print_settings_t* self, size_t* rangesCount, - cef_range_t* ranges) { +void CEF_CALLBACK +print_settings_get_page_ranges(struct _cef_print_settings_t* self, + size_t* rangesCount, + cef_range_t* ranges) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -248,7 +248,7 @@ void CEF_CALLBACK print_settings_get_page_ranges( return; // Translate param: ranges; type: simple_vec_byref - std::vector rangesList; + std::vector rangesList; if (rangesCount && *rangesCount > 0 && ranges) { for (size_t i = 0; i < *rangesCount; ++i) { rangesList.push_back(ranges[i]); @@ -256,8 +256,7 @@ void CEF_CALLBACK print_settings_get_page_ranges( } // Execute - CefPrintSettingsCppToC::Get(self)->GetPageRanges( - rangesList); + CefPrintSettingsCppToC::Get(self)->GetPageRanges(rangesList); // Restore param: ranges; type: simple_vec_byref if (rangesCount && ranges) { @@ -270,8 +269,9 @@ void CEF_CALLBACK print_settings_get_page_ranges( } } -void CEF_CALLBACK print_settings_set_selection_only( - struct _cef_print_settings_t* self, int selection_only) { +void CEF_CALLBACK +print_settings_set_selection_only(struct _cef_print_settings_t* self, + int selection_only) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -279,12 +279,12 @@ void CEF_CALLBACK print_settings_set_selection_only( return; // Execute - CefPrintSettingsCppToC::Get(self)->SetSelectionOnly( - selection_only?true:false); + CefPrintSettingsCppToC::Get(self)->SetSelectionOnly(selection_only ? true + : false); } -int CEF_CALLBACK print_settings_is_selection_only( - struct _cef_print_settings_t* self) { +int CEF_CALLBACK +print_settings_is_selection_only(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -299,7 +299,7 @@ int CEF_CALLBACK print_settings_is_selection_only( } void CEF_CALLBACK print_settings_set_collate(struct _cef_print_settings_t* self, - int collate) { + int collate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -307,12 +307,11 @@ void CEF_CALLBACK print_settings_set_collate(struct _cef_print_settings_t* self, return; // Execute - CefPrintSettingsCppToC::Get(self)->SetCollate( - collate?true:false); + CefPrintSettingsCppToC::Get(self)->SetCollate(collate ? true : false); } -int CEF_CALLBACK print_settings_will_collate( - struct _cef_print_settings_t* self) { +int CEF_CALLBACK +print_settings_will_collate(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -326,8 +325,9 @@ int CEF_CALLBACK print_settings_will_collate( return _retval; } -void CEF_CALLBACK print_settings_set_color_model( - struct _cef_print_settings_t* self, cef_color_model_t model) { +void CEF_CALLBACK +print_settings_set_color_model(struct _cef_print_settings_t* self, + cef_color_model_t model) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -335,12 +335,11 @@ void CEF_CALLBACK print_settings_set_color_model( return; // Execute - CefPrintSettingsCppToC::Get(self)->SetColorModel( - model); + CefPrintSettingsCppToC::Get(self)->SetColorModel(model); } -cef_color_model_t CEF_CALLBACK print_settings_get_color_model( - struct _cef_print_settings_t* self) { +cef_color_model_t CEF_CALLBACK +print_settings_get_color_model(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -348,15 +347,15 @@ cef_color_model_t CEF_CALLBACK print_settings_get_color_model( return COLOR_MODEL_UNKNOWN; // Execute - cef_color_model_t _retval = CefPrintSettingsCppToC::Get(self)->GetColorModel( - ); + cef_color_model_t _retval = + CefPrintSettingsCppToC::Get(self)->GetColorModel(); // Return type: simple return _retval; } void CEF_CALLBACK print_settings_set_copies(struct _cef_print_settings_t* self, - int copies) { + int copies) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -364,8 +363,7 @@ void CEF_CALLBACK print_settings_set_copies(struct _cef_print_settings_t* self, return; // Execute - CefPrintSettingsCppToC::Get(self)->SetCopies( - copies); + CefPrintSettingsCppToC::Get(self)->SetCopies(copies); } int CEF_CALLBACK print_settings_get_copies(struct _cef_print_settings_t* self) { @@ -382,8 +380,9 @@ int CEF_CALLBACK print_settings_get_copies(struct _cef_print_settings_t* self) { return _retval; } -void CEF_CALLBACK print_settings_set_duplex_mode( - struct _cef_print_settings_t* self, cef_duplex_mode_t mode) { +void CEF_CALLBACK +print_settings_set_duplex_mode(struct _cef_print_settings_t* self, + cef_duplex_mode_t mode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -391,12 +390,11 @@ void CEF_CALLBACK print_settings_set_duplex_mode( return; // Execute - CefPrintSettingsCppToC::Get(self)->SetDuplexMode( - mode); + CefPrintSettingsCppToC::Get(self)->SetDuplexMode(mode); } -cef_duplex_mode_t CEF_CALLBACK print_settings_get_duplex_mode( - struct _cef_print_settings_t* self) { +cef_duplex_mode_t CEF_CALLBACK +print_settings_get_duplex_mode(struct _cef_print_settings_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -404,8 +402,8 @@ cef_duplex_mode_t CEF_CALLBACK print_settings_get_duplex_mode( return DUPLEX_MODE_UNKNOWN; // Execute - cef_duplex_mode_t _retval = CefPrintSettingsCppToC::Get(self)->GetDuplexMode( - ); + cef_duplex_mode_t _retval = + CefPrintSettingsCppToC::Get(self)->GetDuplexMode(); // Return type: simple return _retval; @@ -413,7 +411,6 @@ cef_duplex_mode_t CEF_CALLBACK print_settings_get_duplex_mode( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPrintSettingsCppToC::CefPrintSettingsCppToC() { @@ -443,17 +440,25 @@ CefPrintSettingsCppToC::CefPrintSettingsCppToC() { GetStruct()->get_duplex_mode = print_settings_get_duplex_mode; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_print_settings_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPrintSettingsCppToC, + CefPrintSettings, + cef_print_settings_t>::UnwrapDerived(CefWrapperType type, + cef_print_settings_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_SETTINGS; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_PRINT_SETTINGS; diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.h b/libcef_dll/cpptoc/print_settings_cpptoc.h index 7eab31a32..361fa3d5e 100644 --- a/libcef_dll/cpptoc/print_settings_cpptoc.h +++ b/libcef_dll/cpptoc/print_settings_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c2d367550f84b283f161435785090c6b40d99678$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_print_settings.h" #include "include/capi/cef_print_settings_capi.h" +#include "include/cef_print_settings.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefPrintSettingsCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefPrintSettingsCppToC(); }; diff --git a/libcef_dll/cpptoc/process_message_cpptoc.cc b/libcef_dll/cpptoc/process_message_cpptoc.cc index a84ae1ec5..4d77a4cc0 100644 --- a/libcef_dll/cpptoc/process_message_cpptoc.cc +++ b/libcef_dll/cpptoc/process_message_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=665bb7026a3b2824cbb98a8904d85957b0cf3804$ +// #include "libcef_dll/cpptoc/list_value_cpptoc.h" #include "libcef_dll/cpptoc/process_message_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_process_message_t* cef_process_message_create( @@ -26,14 +27,13 @@ CEF_EXPORT cef_process_message_t* cef_process_message_create( return NULL; // Execute - CefRefPtr _retval = CefProcessMessage::Create( - CefString(name)); + CefRefPtr _retval = + CefProcessMessage::Create(CefString(name)); // Return type: refptr_same return CefProcessMessageCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -52,8 +52,8 @@ int CEF_CALLBACK process_message_is_valid(struct _cef_process_message_t* self) { return _retval; } -int CEF_CALLBACK process_message_is_read_only( - struct _cef_process_message_t* self) { +int CEF_CALLBACK +process_message_is_read_only(struct _cef_process_message_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -67,8 +67,8 @@ int CEF_CALLBACK process_message_is_read_only( return _retval; } -struct _cef_process_message_t* CEF_CALLBACK process_message_copy( - struct _cef_process_message_t* self) { +struct _cef_process_message_t* CEF_CALLBACK +process_message_copy(struct _cef_process_message_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -76,15 +76,15 @@ struct _cef_process_message_t* CEF_CALLBACK process_message_copy( return NULL; // Execute - CefRefPtr _retval = CefProcessMessageCppToC::Get( - self)->Copy(); + CefRefPtr _retval = + CefProcessMessageCppToC::Get(self)->Copy(); // Return type: refptr_same return CefProcessMessageCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK process_message_get_name( - struct _cef_process_message_t* self) { +cef_string_userfree_t CEF_CALLBACK +process_message_get_name(struct _cef_process_message_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +98,8 @@ cef_string_userfree_t CEF_CALLBACK process_message_get_name( return _retval.DetachToUserFree(); } -struct _cef_list_value_t* CEF_CALLBACK process_message_get_argument_list( - struct _cef_process_message_t* self) { +struct _cef_list_value_t* CEF_CALLBACK +process_message_get_argument_list(struct _cef_process_message_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,8 +107,8 @@ struct _cef_list_value_t* CEF_CALLBACK process_message_get_argument_list( return NULL; // Execute - CefRefPtr _retval = CefProcessMessageCppToC::Get( - self)->GetArgumentList(); + CefRefPtr _retval = + CefProcessMessageCppToC::Get(self)->GetArgumentList(); // Return type: refptr_same return CefListValueCppToC::Wrap(_retval); @@ -116,7 +116,6 @@ struct _cef_list_value_t* CEF_CALLBACK process_message_get_argument_list( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefProcessMessageCppToC::CefProcessMessageCppToC() { @@ -127,18 +126,25 @@ CefProcessMessageCppToC::CefProcessMessageCppToC() { GetStruct()->get_argument_list = process_message_get_argument_list; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_process_message_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefProcessMessageCppToC, + CefProcessMessage, + cef_process_message_t>::UnwrapDerived(CefWrapperType type, + cef_process_message_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PROCESS_MESSAGE; diff --git a/libcef_dll/cpptoc/process_message_cpptoc.h b/libcef_dll/cpptoc/process_message_cpptoc.h index 97369561f..218f004a3 100644 --- a/libcef_dll/cpptoc/process_message_cpptoc.h +++ b/libcef_dll/cpptoc/process_message_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cf208b7c561310d9a5092317085a52c39a15529a$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_PROCESS_MESSAGE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_PROCESS_MESSAGE_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_process_message.h" #include "include/capi/cef_process_message_capi.h" +#include "include/cef_process_message.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefProcessMessageCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefProcessMessageCppToC(); }; diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc index cad1820cf..2ac4be860 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -9,16 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f92e2d8dea0ebbb5d0e2bd31cd7e8322db6e95fc$ +// #include "libcef_dll/cpptoc/read_handler_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, - void* ptr, size_t size, size_t n) { + void* ptr, + size_t size, + size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -30,17 +33,15 @@ size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, return 0; // Execute - size_t _retval = CefReadHandlerCppToC::Get(self)->Read( - ptr, - size, - n); + size_t _retval = CefReadHandlerCppToC::Get(self)->Read(ptr, size, n); // Return type: simple return _retval; } int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, - int64 offset, int whence) { + int64 offset, + int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,9 +49,7 @@ int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, return 0; // Execute - int _retval = CefReadHandlerCppToC::Get(self)->Seek( - offset, - whence); + int _retval = CefReadHandlerCppToC::Get(self)->Seek(offset, whence); // Return type: simple return _retval; @@ -100,7 +99,6 @@ int CEF_CALLBACK read_handler_may_block(struct _cef_read_handler_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefReadHandlerCppToC::CefReadHandlerCppToC() { @@ -111,17 +109,23 @@ CefReadHandlerCppToC::CefReadHandlerCppToC() { GetStruct()->may_block = read_handler_may_block; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_read_handler_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_read_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_READ_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_READ_HANDLER; diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h index 4ffcf74dd..885f78d3c 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.h +++ b/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4d0908586f8101bdfd5fae36ee451789e650752d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefReadHandlerCppToC - : public CefCppToCRefCounted { +class CefReadHandlerCppToC : public CefCppToCRefCounted { public: CefReadHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc index 1fe8e4e3c..98e5c16f1 100644 --- a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=22598eaff6bdb3ebecc52d1161ed222203216963$ +// #include "libcef_dll/cpptoc/register_cdm_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK register_cdm_callback_on_cdm_registration_complete( struct _cef_register_cdm_callback_t* self, - cef_cdm_registration_error_t result, const cef_string_t* error_message) { + cef_cdm_registration_error_t result, + const cef_string_t* error_message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,13 +31,11 @@ void CEF_CALLBACK register_cdm_callback_on_cdm_registration_complete( // Execute CefRegisterCdmCallbackCppToC::Get(self)->OnCdmRegistrationComplete( - result, - CefString(error_message)); + result, CefString(error_message)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRegisterCdmCallbackCppToC::CefRegisterCdmCallbackCppToC() { @@ -43,18 +43,27 @@ CefRegisterCdmCallbackCppToC::CefRegisterCdmCallbackCppToC() { register_cdm_callback_on_cdm_registration_complete; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_register_cdm_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRegisterCdmCallbackCppToC, + CefRegisterCdmCallback, + cef_register_cdm_callback_t>::UnwrapDerived(CefWrapperType type, + cef_register_cdm_callback_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REGISTER_CDM_CALLBACK; diff --git a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h index 788b79c81..60220f043 100644 --- a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h +++ b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=61d87a325371d018c2c7c4edc2ff5cc361c78a35$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REGISTER_CDM_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REGISTER_CDM_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRegisterCdmCallbackCppToC : public CefCppToCRefCounted { + CefRegisterCdmCallback, + cef_register_cdm_callback_t> { public: CefRegisterCdmCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index a4a16413a..eac38a24a 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -9,19 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7d76e5dd6c0eccb57efb9a5202688705df7b5c16$ +// #include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h" #include "libcef_dll/cpptoc/render_handler_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/drag_data_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_accessibility_handler_t* CEF_CALLBACK render_handler_get_accessibility_handler( - struct _cef_render_handler_t* self) { +cef_accessibility_handler_t* CEF_CALLBACK +render_handler_get_accessibility_handler(struct _cef_render_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,16 +30,17 @@ cef_accessibility_handler_t* CEF_CALLBACK render_handler_get_accessibility_handl return NULL; // Execute - CefRefPtr _retval = CefRenderHandlerCppToC::Get( - self)->GetAccessibilityHandler(); + CefRefPtr _retval = + CefRenderHandlerCppToC::Get(self)->GetAccessibilityHandler(); // Return type: refptr_same return CefAccessibilityHandlerCppToC::Wrap(_retval); } -int CEF_CALLBACK render_handler_get_root_screen_rect( - struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_rect_t* rect) { +int CEF_CALLBACK +render_handler_get_root_screen_rect(struct _cef_render_handler_t* self, + cef_browser_t* browser, + cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -54,12 +56,11 @@ int CEF_CALLBACK render_handler_get_root_screen_rect( return 0; // Translate param: rect; type: simple_byref - CefRect rectVal = rect?*rect:CefRect(); + CefRect rectVal = rect ? *rect : CefRect(); // Execute bool _retval = CefRenderHandlerCppToC::Get(self)->GetRootScreenRect( - CefBrowserCToCpp::Wrap(browser), - rectVal); + CefBrowserCToCpp::Wrap(browser), rectVal); // Restore param: rect; type: simple_byref if (rect) @@ -69,9 +70,10 @@ int CEF_CALLBACK render_handler_get_root_screen_rect( return _retval; } -int CEF_CALLBACK render_handler_get_view_rect( - struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_rect_t* rect) { +int CEF_CALLBACK +render_handler_get_view_rect(struct _cef_render_handler_t* self, + cef_browser_t* browser, + cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,12 +89,11 @@ int CEF_CALLBACK render_handler_get_view_rect( return 0; // Translate param: rect; type: simple_byref - CefRect rectVal = rect?*rect:CefRect(); + CefRect rectVal = rect ? *rect : CefRect(); // Execute bool _retval = CefRenderHandlerCppToC::Get(self)->GetViewRect( - CefBrowserCToCpp::Wrap(browser), - rectVal); + CefBrowserCToCpp::Wrap(browser), rectVal); // Restore param: rect; type: simple_byref if (rect) @@ -102,9 +103,13 @@ int CEF_CALLBACK render_handler_get_view_rect( return _retval; } -int CEF_CALLBACK render_handler_get_screen_point( - struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX, - int viewY, int* screenX, int* screenY) { +int CEF_CALLBACK +render_handler_get_screen_point(struct _cef_render_handler_t* self, + cef_browser_t* browser, + int viewX, + int viewY, + int* screenX, + int* screenY) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,17 +129,13 @@ int CEF_CALLBACK render_handler_get_screen_point( return 0; // Translate param: screenX; type: simple_byref - int screenXVal = screenX?*screenX:0; + int screenXVal = screenX ? *screenX : 0; // Translate param: screenY; type: simple_byref - int screenYVal = screenY?*screenY:0; + int screenYVal = screenY ? *screenY : 0; // Execute bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenPoint( - CefBrowserCToCpp::Wrap(browser), - viewX, - viewY, - screenXVal, - screenYVal); + CefBrowserCToCpp::Wrap(browser), viewX, viewY, screenXVal, screenYVal); // Restore param: screenX; type: simple_byref if (screenX) @@ -147,9 +148,10 @@ int CEF_CALLBACK render_handler_get_screen_point( return _retval; } -int CEF_CALLBACK render_handler_get_screen_info( - struct _cef_render_handler_t* self, cef_browser_t* browser, - struct _cef_screen_info_t* screen_info) { +int CEF_CALLBACK +render_handler_get_screen_info(struct _cef_render_handler_t* self, + cef_browser_t* browser, + struct _cef_screen_info_t* screen_info) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,8 +173,7 @@ int CEF_CALLBACK render_handler_get_screen_info( // Execute bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenInfo( - CefBrowserCToCpp::Wrap(browser), - screen_infoObj); + CefBrowserCToCpp::Wrap(browser), screen_infoObj); // Restore param: screen_info; type: struct_byref if (screen_info) @@ -182,8 +183,10 @@ int CEF_CALLBACK render_handler_get_screen_info( return _retval; } -void CEF_CALLBACK render_handler_on_popup_show( - struct _cef_render_handler_t* self, cef_browser_t* browser, int show) { +void CEF_CALLBACK +render_handler_on_popup_show(struct _cef_render_handler_t* self, + cef_browser_t* browser, + int show) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -196,13 +199,13 @@ void CEF_CALLBACK render_handler_on_popup_show( // Execute CefRenderHandlerCppToC::Get(self)->OnPopupShow( - CefBrowserCToCpp::Wrap(browser), - show?true:false); + CefBrowserCToCpp::Wrap(browser), show ? true : false); } -void CEF_CALLBACK render_handler_on_popup_size( - struct _cef_render_handler_t* self, cef_browser_t* browser, - const cef_rect_t* rect) { +void CEF_CALLBACK +render_handler_on_popup_size(struct _cef_render_handler_t* self, + cef_browser_t* browser, + const cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -218,18 +221,21 @@ void CEF_CALLBACK render_handler_on_popup_size( return; // Translate param: rect; type: simple_byref_const - CefRect rectVal = rect?*rect:CefRect(); + CefRect rectVal = rect ? *rect : CefRect(); // Execute CefRenderHandlerCppToC::Get(self)->OnPopupSize( - CefBrowserCToCpp::Wrap(browser), - rectVal); + CefBrowserCToCpp::Wrap(browser), rectVal); } void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, - cef_browser_t* browser, cef_paint_element_type_t type, - size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer, - int width, int height) { + cef_browser_t* browser, + cef_paint_element_type_t type, + size_t dirtyRectsCount, + cef_rect_t const* dirtyRects, + const void* buffer, + int width, + int height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -249,7 +255,7 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, return; // Translate param: dirtyRects; type: simple_vec_byref_const - std::vector dirtyRectsList; + std::vector dirtyRectsList; if (dirtyRectsCount > 0) { for (size_t i = 0; i < dirtyRectsCount; ++i) { CefRect dirtyRectsVal = dirtyRects[i]; @@ -258,18 +264,16 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, } // Execute - CefRenderHandlerCppToC::Get(self)->OnPaint( - CefBrowserCToCpp::Wrap(browser), - type, - dirtyRectsList, - buffer, - width, - height); + CefRenderHandlerCppToC::Get(self)->OnPaint(CefBrowserCToCpp::Wrap(browser), + type, dirtyRectsList, buffer, + width, height); } void CEF_CALLBACK render_handler_on_cursor_change( - struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_cursor_handle_t cursor, cef_cursor_type_t type, + struct _cef_render_handler_t* self, + cef_browser_t* browser, + cef_cursor_handle_t cursor, + cef_cursor_type_t type, const struct _cef_cursor_info_t* custom_cursor_info) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -292,16 +296,16 @@ void CEF_CALLBACK render_handler_on_cursor_change( // Execute CefRenderHandlerCppToC::Get(self)->OnCursorChange( - CefBrowserCToCpp::Wrap(browser), - cursor, - type, - custom_cursor_infoObj); + CefBrowserCToCpp::Wrap(browser), cursor, type, custom_cursor_infoObj); } -int CEF_CALLBACK render_handler_start_dragging( - struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_drag_data_t* drag_data, cef_drag_operations_mask_t allowed_ops, int x, - int y) { +int CEF_CALLBACK +render_handler_start_dragging(struct _cef_render_handler_t* self, + cef_browser_t* browser, + cef_drag_data_t* drag_data, + cef_drag_operations_mask_t allowed_ops, + int x, + int y) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -318,19 +322,17 @@ int CEF_CALLBACK render_handler_start_dragging( // Execute bool _retval = CefRenderHandlerCppToC::Get(self)->StartDragging( - CefBrowserCToCpp::Wrap(browser), - CefDragDataCToCpp::Wrap(drag_data), - allowed_ops, - x, - y); + CefBrowserCToCpp::Wrap(browser), CefDragDataCToCpp::Wrap(drag_data), + allowed_ops, x, y); // Return type: bool return _retval; } -void CEF_CALLBACK render_handler_update_drag_cursor( - struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_drag_operations_mask_t operation) { +void CEF_CALLBACK +render_handler_update_drag_cursor(struct _cef_render_handler_t* self, + cef_browser_t* browser, + cef_drag_operations_mask_t operation) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -343,13 +345,14 @@ void CEF_CALLBACK render_handler_update_drag_cursor( // Execute CefRenderHandlerCppToC::Get(self)->UpdateDragCursor( - CefBrowserCToCpp::Wrap(browser), - operation); + CefBrowserCToCpp::Wrap(browser), operation); } -void CEF_CALLBACK render_handler_on_scroll_offset_changed( - struct _cef_render_handler_t* self, cef_browser_t* browser, double x, - double y) { +void CEF_CALLBACK +render_handler_on_scroll_offset_changed(struct _cef_render_handler_t* self, + cef_browser_t* browser, + double x, + double y) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -362,14 +365,14 @@ void CEF_CALLBACK render_handler_on_scroll_offset_changed( // Execute CefRenderHandlerCppToC::Get(self)->OnScrollOffsetChanged( - CefBrowserCToCpp::Wrap(browser), - x, - y); + CefBrowserCToCpp::Wrap(browser), x, y); } void CEF_CALLBACK render_handler_on_ime_composition_range_changed( - struct _cef_render_handler_t* self, cef_browser_t* browser, - const cef_range_t* selected_range, size_t character_boundsCount, + struct _cef_render_handler_t* self, + cef_browser_t* browser, + const cef_range_t* selected_range, + size_t character_boundsCount, cef_rect_t const* character_bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -390,9 +393,9 @@ void CEF_CALLBACK render_handler_on_ime_composition_range_changed( return; // Translate param: selected_range; type: simple_byref_const - CefRange selected_rangeVal = selected_range?*selected_range:CefRange(); + CefRange selected_rangeVal = selected_range ? *selected_range : CefRange(); // Translate param: character_bounds; type: simple_vec_byref_const - std::vector character_boundsList; + std::vector character_boundsList; if (character_boundsCount > 0) { for (size_t i = 0; i < character_boundsCount; ++i) { CefRect character_boundsVal = character_bounds[i]; @@ -402,14 +405,11 @@ void CEF_CALLBACK render_handler_on_ime_composition_range_changed( // Execute CefRenderHandlerCppToC::Get(self)->OnImeCompositionRangeChanged( - CefBrowserCToCpp::Wrap(browser), - selected_rangeVal, - character_boundsList); + CefBrowserCToCpp::Wrap(browser), selected_rangeVal, character_boundsList); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRenderHandlerCppToC::CefRenderHandlerCppToC() { @@ -431,17 +431,25 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC() { render_handler_on_ime_composition_range_changed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_render_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRenderHandlerCppToC, + CefRenderHandler, + cef_render_handler_t>::UnwrapDerived(CefWrapperType type, + cef_render_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RENDER_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_RENDER_HANDLER; diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h index 3c62d30f5..917cfda5e 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d05ad27ae5ca7a078684df56c525796d208dca18$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_render_handler.h" #include "include/capi/cef_render_handler_capi.h" +#include "include/cef_render_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRenderHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefRenderHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc index ec133b0af..14900f3c2 100644 --- a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=983c18727fdd4116f5b98eb9d1921d58f1511c76$ +// #include "libcef_dll/cpptoc/load_handler_cpptoc.h" #include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" @@ -22,7 +24,6 @@ #include "libcef_dll/ctocpp/v8exception_ctocpp.h" #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -58,7 +59,8 @@ void CEF_CALLBACK render_process_handler_on_web_kit_initialized( } void CEF_CALLBACK render_process_handler_on_browser_created( - struct _cef_render_process_handler_t* self, cef_browser_t* browser) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -75,7 +77,8 @@ void CEF_CALLBACK render_process_handler_on_browser_created( } void CEF_CALLBACK render_process_handler_on_browser_destroyed( - struct _cef_render_process_handler_t* self, cef_browser_t* browser) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -100,17 +103,20 @@ cef_load_handler_t* CEF_CALLBACK render_process_handler_get_load_handler( return NULL; // Execute - CefRefPtr _retval = CefRenderProcessHandlerCppToC::Get( - self)->GetLoadHandler(); + CefRefPtr _retval = + CefRenderProcessHandlerCppToC::Get(self)->GetLoadHandler(); // Return type: refptr_same return CefLoadHandlerCppToC::Wrap(_retval); } int CEF_CALLBACK render_process_handler_on_before_navigation( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_request_t* request, - cef_navigation_type_t navigation_type, int is_redirect) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + struct _cef_request_t* request, + cef_navigation_type_t navigation_type, + int is_redirect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,19 +137,19 @@ int CEF_CALLBACK render_process_handler_on_before_navigation( // Execute bool _retval = CefRenderProcessHandlerCppToC::Get(self)->OnBeforeNavigation( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - navigation_type, - is_redirect?true:false); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), navigation_type, + is_redirect ? true : false); // Return type: bool return _retval; } void CEF_CALLBACK render_process_handler_on_context_created( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_v8context_t* context) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + struct _cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -164,14 +170,15 @@ void CEF_CALLBACK render_process_handler_on_context_created( // Execute CefRenderProcessHandlerCppToC::Get(self)->OnContextCreated( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), CefV8ContextCToCpp::Wrap(context)); } void CEF_CALLBACK render_process_handler_on_context_released( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_v8context_t* context) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + struct _cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -192,14 +199,15 @@ void CEF_CALLBACK render_process_handler_on_context_released( // Execute CefRenderProcessHandlerCppToC::Get(self)->OnContextReleased( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), CefV8ContextCToCpp::Wrap(context)); } void CEF_CALLBACK render_process_handler_on_uncaught_exception( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, struct _cef_v8context_t* context, + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + struct _cef_v8context_t* context, struct _cef_v8exception_t* exception, struct _cef_v8stack_trace_t* stackTrace) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -230,16 +238,16 @@ void CEF_CALLBACK render_process_handler_on_uncaught_exception( // Execute CefRenderProcessHandlerCppToC::Get(self)->OnUncaughtException( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefV8ContextCToCpp::Wrap(context), - CefV8ExceptionCToCpp::Wrap(exception), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefV8ContextCToCpp::Wrap(context), CefV8ExceptionCToCpp::Wrap(exception), CefV8StackTraceCToCpp::Wrap(stackTrace)); } void CEF_CALLBACK render_process_handler_on_focused_node_changed( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_domnode_t* node) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_domnode_t* node) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,14 +261,15 @@ void CEF_CALLBACK render_process_handler_on_focused_node_changed( // Execute CefRenderProcessHandlerCppToC::Get(self)->OnFocusedNodeChanged( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), CefDOMNodeCToCpp::Wrap(node)); } int CEF_CALLBACK render_process_handler_on_process_message_received( - struct _cef_render_process_handler_t* self, cef_browser_t* browser, - cef_process_id_t source_process, cef_process_message_t* message) { + struct _cef_render_process_handler_t* self, + cef_browser_t* browser, + cef_process_id_t source_process, + cef_process_message_t* message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -276,11 +285,10 @@ int CEF_CALLBACK render_process_handler_on_process_message_received( return 0; // Execute - bool _retval = CefRenderProcessHandlerCppToC::Get( - self)->OnProcessMessageReceived( - CefBrowserCToCpp::Wrap(browser), - source_process, - CefProcessMessageCToCpp::Wrap(message)); + bool _retval = + CefRenderProcessHandlerCppToC::Get(self)->OnProcessMessageReceived( + CefBrowserCToCpp::Wrap(browser), source_process, + CefProcessMessageCToCpp::Wrap(message)); // Return type: bool return _retval; @@ -288,7 +296,6 @@ int CEF_CALLBACK render_process_handler_on_process_message_received( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() { @@ -312,18 +319,27 @@ CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() { render_process_handler_on_process_message_received; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_render_process_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRenderProcessHandlerCppToC, + CefRenderProcessHandler, + cef_render_process_handler_t>::UnwrapDerived(CefWrapperType type, + cef_render_process_handler_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RENDER_PROCESS_HANDLER; diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.h b/libcef_dll/cpptoc/render_process_handler_cpptoc.h index bad14ecb7..25d1ab10f 100644 --- a/libcef_dll/cpptoc/render_process_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=74a6f5349310ca62096c5abf5ecba45ae34604ae$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_render_process_handler.h" #include "include/capi/cef_render_process_handler_capi.h" +#include "include/cef_render_process_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRenderProcessHandlerCppToC : public CefCppToCRefCounted { + CefRenderProcessHandler, + cef_render_process_handler_t> { public: CefRenderProcessHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.cc b/libcef_dll/cpptoc/request_callback_cpptoc.cc index aa78ac70f..a8462a045 100644 --- a/libcef_dll/cpptoc/request_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/request_callback_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7f23d6a5af6381c210dad9505f4fd2b36bb27b9a$ +// #include "libcef_dll/cpptoc/request_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK request_callback_cont(struct _cef_request_callback_t* self, - int allow) { + int allow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -26,12 +27,11 @@ void CEF_CALLBACK request_callback_cont(struct _cef_request_callback_t* self, return; // Execute - CefRequestCallbackCppToC::Get(self)->Continue( - allow?true:false); + CefRequestCallbackCppToC::Get(self)->Continue(allow ? true : false); } -void CEF_CALLBACK request_callback_cancel( - struct _cef_request_callback_t* self) { +void CEF_CALLBACK +request_callback_cancel(struct _cef_request_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -44,7 +44,6 @@ void CEF_CALLBACK request_callback_cancel( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRequestCallbackCppToC::CefRequestCallbackCppToC() { @@ -52,18 +51,26 @@ CefRequestCallbackCppToC::CefRequestCallbackCppToC() { GetStruct()->cancel = request_callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_request_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRequestCallbackCppToC, + CefRequestCallback, + cef_request_callback_t>::UnwrapDerived(CefWrapperType type, + cef_request_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST_CALLBACK; diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.h b/libcef_dll/cpptoc/request_callback_cpptoc.h index ab48ecf34..6fcd0dac6 100644 --- a/libcef_dll/cpptoc/request_callback_cpptoc.h +++ b/libcef_dll/cpptoc/request_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5f5e75333da21c3aa5c8e13628001512efbb8174$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefRequestCallbackCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefRequestCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/request_context_cpptoc.cc b/libcef_dll/cpptoc/request_context_cpptoc.cc index 660aa06cb..0b1b11cda 100644 --- a/libcef_dll/cpptoc/request_context_cpptoc.cc +++ b/libcef_dll/cpptoc/request_context_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=247a6ee7f7477a1a6ebfc8702b0d13a51b5310c5$ +// #include "libcef_dll/cpptoc/cookie_manager_cpptoc.h" #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" @@ -20,7 +22,6 @@ #include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context() { @@ -51,8 +52,7 @@ CEF_EXPORT cef_request_context_t* cef_request_context_create_context( // Execute CefRefPtr _retval = CefRequestContext::CreateContext( - settingsObj, - CefRequestContextHandlerCToCpp::Wrap(handler)); + settingsObj, CefRequestContextHandlerCToCpp::Wrap(handler)); // Return type: refptr_same return CefRequestContextCppToC::Wrap(_retval); @@ -78,13 +78,12 @@ CEF_EXPORT cef_request_context_t* cef_create_context_shared( return CefRequestContextCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK request_context_is_same(struct _cef_request_context_t* self, - struct _cef_request_context_t* other) { + struct _cef_request_context_t* other) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -103,9 +102,9 @@ int CEF_CALLBACK request_context_is_same(struct _cef_request_context_t* self, return _retval; } -int CEF_CALLBACK request_context_is_sharing_with( - struct _cef_request_context_t* self, - struct _cef_request_context_t* other) { +int CEF_CALLBACK +request_context_is_sharing_with(struct _cef_request_context_t* self, + struct _cef_request_context_t* other) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,8 +123,8 @@ int CEF_CALLBACK request_context_is_sharing_with( return _retval; } -int CEF_CALLBACK request_context_is_global( - struct _cef_request_context_t* self) { +int CEF_CALLBACK +request_context_is_global(struct _cef_request_context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +138,8 @@ int CEF_CALLBACK request_context_is_global( return _retval; } -struct _cef_request_context_handler_t* CEF_CALLBACK request_context_get_handler( - struct _cef_request_context_t* self) { +struct _cef_request_context_handler_t* CEF_CALLBACK +request_context_get_handler(struct _cef_request_context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,15 +147,15 @@ struct _cef_request_context_handler_t* CEF_CALLBACK request_context_get_handler( return NULL; // Execute - CefRefPtr _retval = CefRequestContextCppToC::Get( - self)->GetHandler(); + CefRefPtr _retval = + CefRequestContextCppToC::Get(self)->GetHandler(); // Return type: refptr_diff return CefRequestContextHandlerCToCpp::Unwrap(_retval); } -cef_string_userfree_t CEF_CALLBACK request_context_get_cache_path( - struct _cef_request_context_t* self) { +cef_string_userfree_t CEF_CALLBACK +request_context_get_cache_path(struct _cef_request_context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,7 +170,8 @@ cef_string_userfree_t CEF_CALLBACK request_context_get_cache_path( } cef_cookie_manager_t* CEF_CALLBACK request_context_get_default_cookie_manager( - struct _cef_request_context_t* self, cef_completion_callback_t* callback) { + struct _cef_request_context_t* self, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -180,16 +180,17 @@ cef_cookie_manager_t* CEF_CALLBACK request_context_get_default_cookie_manager( // Unverified params: callback // Execute - CefRefPtr _retval = CefRequestContextCppToC::Get( - self)->GetDefaultCookieManager( - CefCompletionCallbackCToCpp::Wrap(callback)); + CefRefPtr _retval = + CefRequestContextCppToC::Get(self)->GetDefaultCookieManager( + CefCompletionCallbackCToCpp::Wrap(callback)); // Return type: refptr_same return CefCookieManagerCppToC::Wrap(_retval); } int CEF_CALLBACK request_context_register_scheme_handler_factory( - struct _cef_request_context_t* self, const cef_string_t* scheme_name, + struct _cef_request_context_t* self, + const cef_string_t* scheme_name, const cef_string_t* domain_name, struct _cef_scheme_handler_factory_t* factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -204,11 +205,10 @@ int CEF_CALLBACK request_context_register_scheme_handler_factory( // Unverified params: domain_name, factory // Execute - bool _retval = CefRequestContextCppToC::Get( - self)->RegisterSchemeHandlerFactory( - CefString(scheme_name), - CefString(domain_name), - CefSchemeHandlerFactoryCToCpp::Wrap(factory)); + bool _retval = + CefRequestContextCppToC::Get(self)->RegisterSchemeHandlerFactory( + CefString(scheme_name), CefString(domain_name), + CefSchemeHandlerFactoryCToCpp::Wrap(factory)); // Return type: bool return _retval; @@ -223,15 +223,16 @@ int CEF_CALLBACK request_context_clear_scheme_handler_factories( return 0; // Execute - bool _retval = CefRequestContextCppToC::Get( - self)->ClearSchemeHandlerFactories(); + bool _retval = + CefRequestContextCppToC::Get(self)->ClearSchemeHandlerFactories(); // Return type: bool return _retval; } -void CEF_CALLBACK request_context_purge_plugin_list_cache( - struct _cef_request_context_t* self, int reload_pages) { +void CEF_CALLBACK +request_context_purge_plugin_list_cache(struct _cef_request_context_t* self, + int reload_pages) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -240,11 +241,12 @@ void CEF_CALLBACK request_context_purge_plugin_list_cache( // Execute CefRequestContextCppToC::Get(self)->PurgePluginListCache( - reload_pages?true:false); + reload_pages ? true : false); } -int CEF_CALLBACK request_context_has_preference( - struct _cef_request_context_t* self, const cef_string_t* name) { +int CEF_CALLBACK +request_context_has_preference(struct _cef_request_context_t* self, + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -256,15 +258,16 @@ int CEF_CALLBACK request_context_has_preference( return 0; // Execute - bool _retval = CefRequestContextCppToC::Get(self)->HasPreference( - CefString(name)); + bool _retval = + CefRequestContextCppToC::Get(self)->HasPreference(CefString(name)); // Return type: bool return _retval; } -struct _cef_value_t* CEF_CALLBACK request_context_get_preference( - struct _cef_request_context_t* self, const cef_string_t* name) { +struct _cef_value_t* CEF_CALLBACK +request_context_get_preference(struct _cef_request_context_t* self, + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -276,16 +279,16 @@ struct _cef_value_t* CEF_CALLBACK request_context_get_preference( return NULL; // Execute - CefRefPtr _retval = CefRequestContextCppToC::Get( - self)->GetPreference( - CefString(name)); + CefRefPtr _retval = + CefRequestContextCppToC::Get(self)->GetPreference(CefString(name)); // Return type: refptr_same return CefValueCppToC::Wrap(_retval); } -struct _cef_dictionary_value_t* CEF_CALLBACK request_context_get_all_preferences( - struct _cef_request_context_t* self, int include_defaults) { +struct _cef_dictionary_value_t* CEF_CALLBACK +request_context_get_all_preferences(struct _cef_request_context_t* self, + int include_defaults) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -293,16 +296,17 @@ struct _cef_dictionary_value_t* CEF_CALLBACK request_context_get_all_preferences return NULL; // Execute - CefRefPtr _retval = CefRequestContextCppToC::Get( - self)->GetAllPreferences( - include_defaults?true:false); + CefRefPtr _retval = + CefRequestContextCppToC::Get(self)->GetAllPreferences( + include_defaults ? true : false); // Return type: refptr_same return CefDictionaryValueCppToC::Wrap(_retval); } -int CEF_CALLBACK request_context_can_set_preference( - struct _cef_request_context_t* self, const cef_string_t* name) { +int CEF_CALLBACK +request_context_can_set_preference(struct _cef_request_context_t* self, + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -314,16 +318,18 @@ int CEF_CALLBACK request_context_can_set_preference( return 0; // Execute - bool _retval = CefRequestContextCppToC::Get(self)->CanSetPreference( - CefString(name)); + bool _retval = + CefRequestContextCppToC::Get(self)->CanSetPreference(CefString(name)); // Return type: bool return _retval; } -int CEF_CALLBACK request_context_set_preference( - struct _cef_request_context_t* self, const cef_string_t* name, - struct _cef_value_t* value, cef_string_t* error) { +int CEF_CALLBACK +request_context_set_preference(struct _cef_request_context_t* self, + const cef_string_t* name, + struct _cef_value_t* value, + cef_string_t* error) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -344,16 +350,15 @@ int CEF_CALLBACK request_context_set_preference( // Execute bool _retval = CefRequestContextCppToC::Get(self)->SetPreference( - CefString(name), - CefValueCppToC::Unwrap(value), - errorStr); + CefString(name), CefValueCppToC::Unwrap(value), errorStr); // Return type: bool return _retval; } void CEF_CALLBACK request_context_clear_certificate_exceptions( - struct _cef_request_context_t* self, cef_completion_callback_t* callback) { + struct _cef_request_context_t* self, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -366,8 +371,9 @@ void CEF_CALLBACK request_context_clear_certificate_exceptions( CefCompletionCallbackCToCpp::Wrap(callback)); } -void CEF_CALLBACK request_context_close_all_connections( - struct _cef_request_context_t* self, cef_completion_callback_t* callback) { +void CEF_CALLBACK +request_context_close_all_connections(struct _cef_request_context_t* self, + cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -380,9 +386,10 @@ void CEF_CALLBACK request_context_close_all_connections( CefCompletionCallbackCToCpp::Wrap(callback)); } -void CEF_CALLBACK request_context_resolve_host( - struct _cef_request_context_t* self, const cef_string_t* origin, - cef_resolve_callback_t* callback) { +void CEF_CALLBACK +request_context_resolve_host(struct _cef_request_context_t* self, + const cef_string_t* origin, + cef_resolve_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -399,13 +406,13 @@ void CEF_CALLBACK request_context_resolve_host( // Execute CefRequestContextCppToC::Get(self)->ResolveHost( - CefString(origin), - CefResolveCallbackCToCpp::Wrap(callback)); + CefString(origin), CefResolveCallbackCToCpp::Wrap(callback)); } -cef_errorcode_t CEF_CALLBACK request_context_resolve_host_cached( - struct _cef_request_context_t* self, const cef_string_t* origin, - cef_string_list_t resolved_ips) { +cef_errorcode_t CEF_CALLBACK +request_context_resolve_host_cached(struct _cef_request_context_t* self, + const cef_string_t* origin, + cef_string_list_t resolved_ips) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -425,10 +432,9 @@ cef_errorcode_t CEF_CALLBACK request_context_resolve_host_cached( transfer_string_list_contents(resolved_ips, resolved_ipsList); // Execute - cef_errorcode_t _retval = CefRequestContextCppToC::Get( - self)->ResolveHostCached( - CefString(origin), - resolved_ipsList); + cef_errorcode_t _retval = + CefRequestContextCppToC::Get(self)->ResolveHostCached(CefString(origin), + resolved_ipsList); // Restore param: resolved_ips; type: string_vec_byref cef_string_list_clear(resolved_ips); @@ -440,7 +446,6 @@ cef_errorcode_t CEF_CALLBACK request_context_resolve_host_cached( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRequestContextCppToC::CefRequestContextCppToC() { @@ -469,18 +474,25 @@ CefRequestContextCppToC::CefRequestContextCppToC() { GetStruct()->resolve_host_cached = request_context_resolve_host_cached; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_request_context_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRequestContextCppToC, + CefRequestContext, + cef_request_context_t>::UnwrapDerived(CefWrapperType type, + cef_request_context_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST_CONTEXT; diff --git a/libcef_dll/cpptoc/request_context_cpptoc.h b/libcef_dll/cpptoc/request_context_cpptoc.h index d0ced02d8..4d1e1736f 100644 --- a/libcef_dll/cpptoc/request_context_cpptoc.h +++ b/libcef_dll/cpptoc/request_context_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0f63b31ff1f742b3cbe34ea3971df87f95829dfb$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request_context.h" #include "include/capi/cef_request_context_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_request_context.h" +#include "include/cef_scheme.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefRequestContextCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefRequestContextCppToC(); }; diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc index 308afff13..9cb22e3f2 100644 --- a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2bc0696da2c14f967c6b16e3f78e1e4479ed50d1$ +// #include "libcef_dll/cpptoc/request_context_handler_cpptoc.h" #include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -28,16 +29,18 @@ cef_cookie_manager_t* CEF_CALLBACK request_context_handler_get_cookie_manager( return NULL; // Execute - CefRefPtr _retval = CefRequestContextHandlerCppToC::Get( - self)->GetCookieManager(); + CefRefPtr _retval = + CefRequestContextHandlerCppToC::Get(self)->GetCookieManager(); // Return type: refptr_diff return CefCookieManagerCToCpp::Unwrap(_retval); } int CEF_CALLBACK request_context_handler_on_before_plugin_load( - struct _cef_request_context_handler_t* self, const cef_string_t* mime_type, - const cef_string_t* plugin_url, int is_main_frame, + struct _cef_request_context_handler_t* self, + const cef_string_t* mime_type, + const cef_string_t* plugin_url, + int is_main_frame, const cef_string_t* top_origin_url, struct _cef_web_plugin_info_t* plugin_info, cef_plugin_policy_t* plugin_policy) { @@ -62,11 +65,8 @@ int CEF_CALLBACK request_context_handler_on_before_plugin_load( // Execute bool _retval = CefRequestContextHandlerCppToC::Get(self)->OnBeforePluginLoad( - CefString(mime_type), - CefString(plugin_url), - is_main_frame?true:false, - CefString(top_origin_url), - CefWebPluginInfoCToCpp::Wrap(plugin_info), + CefString(mime_type), CefString(plugin_url), is_main_frame ? true : false, + CefString(top_origin_url), CefWebPluginInfoCToCpp::Wrap(plugin_info), plugin_policy); // Return type: bool @@ -75,7 +75,6 @@ int CEF_CALLBACK request_context_handler_on_before_plugin_load( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() { @@ -84,18 +83,28 @@ CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() { request_context_handler_on_before_plugin_load; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_request_context_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRequestContextHandlerCppToC, + CefRequestContextHandler, + cef_request_context_handler_t>::UnwrapDerived(CefWrapperType type, + cef_request_context_handler_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_REQUEST_CONTEXT_HANDLER; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_REQUEST_CONTEXT_HANDLER; diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.h b/libcef_dll/cpptoc/request_context_handler_cpptoc.h index 9c111a594..f810712cb 100644 --- a/libcef_dll/cpptoc/request_context_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2ccdc811cf83c44925c3600c0dda1e98b869690f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request_context_handler.h" #include "include/capi/cef_request_context_handler_capi.h" +#include "include/cef_request_context_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRequestContextHandlerCppToC : public CefCppToCRefCounted { + CefRequestContextHandler, + cef_request_context_handler_t> { public: CefRequestContextHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc index 7e797ab74..7364421d4 100644 --- a/libcef_dll/cpptoc/request_cpptoc.cc +++ b/libcef_dll/cpptoc/request_cpptoc.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ec22bd815e23e3643d6ffb3db5573d6b24ea275c$ +// #include "libcef_dll/cpptoc/post_data_cpptoc.h" #include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_request_t* cef_request_create() { @@ -27,7 +28,6 @@ CEF_EXPORT cef_request_t* cef_request_create() { return CefRequestCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -46,8 +46,8 @@ int CEF_CALLBACK request_is_read_only(struct _cef_request_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK request_get_url( - struct _cef_request_t* self) { +cef_string_userfree_t CEF_CALLBACK +request_get_url(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -62,7 +62,7 @@ cef_string_userfree_t CEF_CALLBACK request_get_url( } void CEF_CALLBACK request_set_url(struct _cef_request_t* self, - const cef_string_t* url) { + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,12 +74,11 @@ void CEF_CALLBACK request_set_url(struct _cef_request_t* self, return; // Execute - CefRequestCppToC::Get(self)->SetURL( - CefString(url)); + CefRequestCppToC::Get(self)->SetURL(CefString(url)); } -cef_string_userfree_t CEF_CALLBACK request_get_method( - struct _cef_request_t* self) { +cef_string_userfree_t CEF_CALLBACK +request_get_method(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -94,7 +93,7 @@ cef_string_userfree_t CEF_CALLBACK request_get_method( } void CEF_CALLBACK request_set_method(struct _cef_request_t* self, - const cef_string_t* method) { + const cef_string_t* method) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -106,12 +105,12 @@ void CEF_CALLBACK request_set_method(struct _cef_request_t* self, return; // Execute - CefRequestCppToC::Get(self)->SetMethod( - CefString(method)); + CefRequestCppToC::Get(self)->SetMethod(CefString(method)); } void CEF_CALLBACK request_set_referrer(struct _cef_request_t* self, - const cef_string_t* referrer_url, cef_referrer_policy_t policy) { + const cef_string_t* referrer_url, + cef_referrer_policy_t policy) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,13 +122,11 @@ void CEF_CALLBACK request_set_referrer(struct _cef_request_t* self, return; // Execute - CefRequestCppToC::Get(self)->SetReferrer( - CefString(referrer_url), - policy); + CefRequestCppToC::Get(self)->SetReferrer(CefString(referrer_url), policy); } -cef_string_userfree_t CEF_CALLBACK request_get_referrer_url( - struct _cef_request_t* self) { +cef_string_userfree_t CEF_CALLBACK +request_get_referrer_url(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -143,8 +140,8 @@ cef_string_userfree_t CEF_CALLBACK request_get_referrer_url( return _retval.DetachToUserFree(); } -cef_referrer_policy_t CEF_CALLBACK request_get_referrer_policy( - struct _cef_request_t* self) { +cef_referrer_policy_t CEF_CALLBACK +request_get_referrer_policy(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -152,15 +149,15 @@ cef_referrer_policy_t CEF_CALLBACK request_get_referrer_policy( return REFERRER_POLICY_DEFAULT; // Execute - cef_referrer_policy_t _retval = CefRequestCppToC::Get( - self)->GetReferrerPolicy(); + cef_referrer_policy_t _retval = + CefRequestCppToC::Get(self)->GetReferrerPolicy(); // Return type: simple return _retval; } -struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( - struct _cef_request_t* self) { +struct _cef_post_data_t* CEF_CALLBACK +request_get_post_data(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -175,7 +172,7 @@ struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( } void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, - struct _cef_post_data_t* postData) { + struct _cef_post_data_t* postData) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -187,12 +184,11 @@ void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, return; // Execute - CefRequestCppToC::Get(self)->SetPostData( - CefPostDataCppToC::Unwrap(postData)); + CefRequestCppToC::Get(self)->SetPostData(CefPostDataCppToC::Unwrap(postData)); } void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, - cef_string_multimap_t headerMap) { + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -208,8 +204,7 @@ void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - CefRequestCppToC::Get(self)->GetHeaderMap( - headerMapMultimap); + CefRequestCppToC::Get(self)->GetHeaderMap(headerMapMultimap); // Restore param: headerMap; type: string_map_multi_byref cef_string_multimap_clear(headerMap); @@ -217,7 +212,7 @@ void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, } void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, - cef_string_multimap_t headerMap) { + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -233,13 +228,14 @@ void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - CefRequestCppToC::Get(self)->SetHeaderMap( - headerMapMultimap); + CefRequestCppToC::Get(self)->SetHeaderMap(headerMapMultimap); } void CEF_CALLBACK request_set(struct _cef_request_t* self, - const cef_string_t* url, const cef_string_t* method, - struct _cef_post_data_t* postData, cef_string_multimap_t headerMap) { + const cef_string_t* url, + const cef_string_t* method, + struct _cef_post_data_t* postData, + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -264,11 +260,9 @@ void CEF_CALLBACK request_set(struct _cef_request_t* self, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - CefRequestCppToC::Get(self)->Set( - CefString(url), - CefString(method), - CefPostDataCppToC::Unwrap(postData), - headerMapMultimap); + CefRequestCppToC::Get(self)->Set(CefString(url), CefString(method), + CefPostDataCppToC::Unwrap(postData), + headerMapMultimap); } int CEF_CALLBACK request_get_flags(struct _cef_request_t* self) { @@ -293,12 +287,11 @@ void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, int flags) { return; // Execute - CefRequestCppToC::Get(self)->SetFlags( - flags); + CefRequestCppToC::Get(self)->SetFlags(flags); } -cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( - struct _cef_request_t* self) { +cef_string_userfree_t CEF_CALLBACK +request_get_first_party_for_cookies(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -312,8 +305,9 @@ cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( return _retval.DetachToUserFree(); } -void CEF_CALLBACK request_set_first_party_for_cookies( - struct _cef_request_t* self, const cef_string_t* url) { +void CEF_CALLBACK +request_set_first_party_for_cookies(struct _cef_request_t* self, + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -325,12 +319,11 @@ void CEF_CALLBACK request_set_first_party_for_cookies( return; // Execute - CefRequestCppToC::Get(self)->SetFirstPartyForCookies( - CefString(url)); + CefRequestCppToC::Get(self)->SetFirstPartyForCookies(CefString(url)); } -cef_resource_type_t CEF_CALLBACK request_get_resource_type( - struct _cef_request_t* self) { +cef_resource_type_t CEF_CALLBACK +request_get_resource_type(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -344,8 +337,8 @@ cef_resource_type_t CEF_CALLBACK request_get_resource_type( return _retval; } -cef_transition_type_t CEF_CALLBACK request_get_transition_type( - struct _cef_request_t* self) { +cef_transition_type_t CEF_CALLBACK +request_get_transition_type(struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -353,8 +346,8 @@ cef_transition_type_t CEF_CALLBACK request_get_transition_type( return TT_EXPLICIT; // Execute - cef_transition_type_t _retval = CefRequestCppToC::Get( - self)->GetTransitionType(); + cef_transition_type_t _retval = + CefRequestCppToC::Get(self)->GetTransitionType(); // Return type: simple return _retval; @@ -376,7 +369,6 @@ uint64 CEF_CALLBACK request_get_identifier(struct _cef_request_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRequestCppToC::CefRequestCppToC() { @@ -404,17 +396,23 @@ CefRequestCppToC::CefRequestCppToC() { GetStruct()->get_identifier = request_get_identifier; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_request_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST; diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h index 9f53f8113..28ba8a146 100644 --- a/libcef_dll/cpptoc/request_cpptoc.h +++ b/libcef_dll/cpptoc/request_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=35a29e0f83ca38db4f2bcf58fc3a48560cac21da$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc index 5115ac275..be03b1aa7 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=debd32c1e6bb7d1caca659f93e1a6fbb0e5018a9$ +// #include "libcef_dll/cpptoc/request_handler_cpptoc.h" #include "libcef_dll/cpptoc/resource_handler_cpptoc.h" @@ -16,21 +18,23 @@ #include "libcef_dll/ctocpp/auth_callback_ctocpp.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" -#include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/request_callback_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/response_ctocpp.h" -#include "libcef_dll/ctocpp/sslinfo_ctocpp.h" #include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h" +#include "libcef_dll/ctocpp/sslinfo_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK request_handler_on_before_browse( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, int is_redirect) { +int CEF_CALLBACK +request_handler_on_before_browse(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, + int is_redirect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,19 +55,20 @@ int CEF_CALLBACK request_handler_on_before_browse( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - is_redirect?true:false); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), is_redirect ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK request_handler_on_open_urlfrom_tab( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* target_url, - cef_window_open_disposition_t target_disposition, int user_gesture) { + struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + const cef_string_t* target_url, + cef_window_open_disposition_t target_disposition, + int user_gesture) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -84,20 +89,19 @@ int CEF_CALLBACK request_handler_on_open_urlfrom_tab( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnOpenURLFromTab( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefString(target_url), - target_disposition, - user_gesture?true:false); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefString(target_url), target_disposition, user_gesture ? true : false); // Return type: bool return _retval; } -cef_return_value_t CEF_CALLBACK request_handler_on_before_resource_load( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, - cef_request_callback_t* callback) { +cef_return_value_t CEF_CALLBACK +request_handler_on_before_resource_load(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, + cef_request_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -121,20 +125,21 @@ cef_return_value_t CEF_CALLBACK request_handler_on_before_resource_load( return RV_CONTINUE; // Execute - cef_return_value_t _retval = CefRequestHandlerCppToC::Get( - self)->OnBeforeResourceLoad( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - CefRequestCallbackCToCpp::Wrap(callback)); + cef_return_value_t _retval = + CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad( + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), + CefRequestCallbackCToCpp::Wrap(callback)); // Return type: simple return _retval; } -struct _cef_resource_handler_t* CEF_CALLBACK request_handler_get_resource_handler( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request) { +struct _cef_resource_handler_t* CEF_CALLBACK +request_handler_get_resource_handler(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,20 +159,22 @@ struct _cef_resource_handler_t* CEF_CALLBACK request_handler_get_resource_handle return NULL; // Execute - CefRefPtr _retval = CefRequestHandlerCppToC::Get( - self)->GetResourceHandler( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request)); + CefRefPtr _retval = + CefRequestHandlerCppToC::Get(self)->GetResourceHandler( + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request)); // Return type: refptr_same return CefResourceHandlerCppToC::Wrap(_retval); } -void CEF_CALLBACK request_handler_on_resource_redirect( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, - struct _cef_response_t* response, cef_string_t* new_url) { +void CEF_CALLBACK +request_handler_on_resource_redirect(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, + struct _cef_response_t* response, + cef_string_t* new_url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -199,17 +206,17 @@ void CEF_CALLBACK request_handler_on_resource_redirect( // Execute CefRequestHandlerCppToC::Get(self)->OnResourceRedirect( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - CefResponseCToCpp::Wrap(response), + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response), new_urlStr); } -int CEF_CALLBACK request_handler_on_resource_response( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, - struct _cef_response_t* response) { +int CEF_CALLBACK +request_handler_on_resource_response(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, + struct _cef_response_t* response) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -234,18 +241,19 @@ int CEF_CALLBACK request_handler_on_resource_response( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnResourceResponse( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - CefResponseCToCpp::Wrap(response)); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response)); // Return type: bool return _retval; } -struct _cef_response_filter_t* CEF_CALLBACK request_handler_get_resource_response_filter( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, +struct _cef_response_filter_t* CEF_CALLBACK +request_handler_get_resource_response_filter( + struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, struct _cef_response_t* response) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -270,22 +278,23 @@ struct _cef_response_filter_t* CEF_CALLBACK request_handler_get_resource_respons return NULL; // Execute - CefRefPtr _retval = CefRequestHandlerCppToC::Get( - self)->GetResourceResponseFilter( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - CefResponseCToCpp::Wrap(response)); + CefRefPtr _retval = + CefRequestHandlerCppToC::Get(self)->GetResourceResponseFilter( + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response)); // Return type: refptr_same return CefResponseFilterCppToC::Wrap(_retval); } -void CEF_CALLBACK request_handler_on_resource_load_complete( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_request_t* request, - struct _cef_response_t* response, cef_urlrequest_status_t status, - int64 received_content_length) { +void CEF_CALLBACK +request_handler_on_resource_load_complete(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + cef_request_t* request, + struct _cef_response_t* response, + cef_urlrequest_status_t status, + int64 received_content_length) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -310,19 +319,21 @@ void CEF_CALLBACK request_handler_on_resource_load_complete( // Execute CefRequestHandlerCppToC::Get(self)->OnResourceLoadComplete( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefRequestCToCpp::Wrap(request), - CefResponseCToCpp::Wrap(response), - status, - received_content_length); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response), + status, received_content_length); } -int CEF_CALLBACK request_handler_get_auth_credentials( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, int isProxy, const cef_string_t* host, int port, - const cef_string_t* realm, const cef_string_t* scheme, - cef_auth_callback_t* callback) { +int CEF_CALLBACK +request_handler_get_auth_credentials(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + int isProxy, + const cef_string_t* host, + int port, + const cef_string_t* realm, + const cef_string_t* scheme, + cef_auth_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -348,23 +359,20 @@ int CEF_CALLBACK request_handler_get_auth_credentials( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->GetAuthCredentials( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - isProxy?true:false, - CefString(host), - port, - CefString(realm), - CefString(scheme), - CefAuthCallbackCToCpp::Wrap(callback)); + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + isProxy ? true : false, CefString(host), port, CefString(realm), + CefString(scheme), CefAuthCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -int CEF_CALLBACK request_handler_on_quota_request( - struct _cef_request_handler_t* self, cef_browser_t* browser, - const cef_string_t* origin_url, int64 new_size, - cef_request_callback_t* callback) { +int CEF_CALLBACK +request_handler_on_quota_request(struct _cef_request_handler_t* self, + cef_browser_t* browser, + const cef_string_t* origin_url, + int64 new_size, + cef_request_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -385,18 +393,18 @@ int CEF_CALLBACK request_handler_on_quota_request( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnQuotaRequest( - CefBrowserCToCpp::Wrap(browser), - CefString(origin_url), - new_size, + CefBrowserCToCpp::Wrap(browser), CefString(origin_url), new_size, CefRequestCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -void CEF_CALLBACK request_handler_on_protocol_execution( - struct _cef_request_handler_t* self, cef_browser_t* browser, - const cef_string_t* url, int* allow_os_execution) { +void CEF_CALLBACK +request_handler_on_protocol_execution(struct _cef_request_handler_t* self, + cef_browser_t* browser, + const cef_string_t* url, + int* allow_os_execution) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -416,24 +424,25 @@ void CEF_CALLBACK request_handler_on_protocol_execution( return; // Translate param: allow_os_execution; type: bool_byref - bool allow_os_executionBool = ( - allow_os_execution && *allow_os_execution)?true:false; + bool allow_os_executionBool = + (allow_os_execution && *allow_os_execution) ? true : false; // Execute CefRequestHandlerCppToC::Get(self)->OnProtocolExecution( - CefBrowserCToCpp::Wrap(browser), - CefString(url), - allow_os_executionBool); + CefBrowserCToCpp::Wrap(browser), CefString(url), allow_os_executionBool); // Restore param: allow_os_execution; type: bool_byref if (allow_os_execution) - *allow_os_execution = allow_os_executionBool?true:false; + *allow_os_execution = allow_os_executionBool ? true : false; } -int CEF_CALLBACK request_handler_on_certificate_error( - struct _cef_request_handler_t* self, cef_browser_t* browser, - cef_errorcode_t cert_error, const cef_string_t* request_url, - struct _cef_sslinfo_t* ssl_info, cef_request_callback_t* callback) { +int CEF_CALLBACK +request_handler_on_certificate_error(struct _cef_request_handler_t* self, + cef_browser_t* browser, + cef_errorcode_t cert_error, + const cef_string_t* request_url, + struct _cef_sslinfo_t* ssl_info, + cef_request_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -458,9 +467,7 @@ int CEF_CALLBACK request_handler_on_certificate_error( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError( - CefBrowserCToCpp::Wrap(browser), - cert_error, - CefString(request_url), + CefBrowserCToCpp::Wrap(browser), cert_error, CefString(request_url), CefSSLInfoCToCpp::Wrap(ssl_info), CefRequestCallbackCToCpp::Wrap(callback)); @@ -469,8 +476,12 @@ int CEF_CALLBACK request_handler_on_certificate_error( } int CEF_CALLBACK request_handler_on_select_client_certificate( - struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy, - const cef_string_t* host, int port, size_t certificatesCount, + struct _cef_request_handler_t* self, + cef_browser_t* browser, + int isProxy, + const cef_string_t* host, + int port, + size_t certificatesCount, struct _cef_x509certificate_t* const* certificates, cef_select_client_certificate_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -496,7 +507,7 @@ int CEF_CALLBACK request_handler_on_select_client_certificate( return 0; // Translate param: certificates; type: refptr_vec_diff_byref_const - std::vector > certificatesList; + std::vector> certificatesList; if (certificatesCount > 0) { for (size_t i = 0; i < certificatesCount; ++i) { CefRefPtr certificatesVal = @@ -507,20 +518,18 @@ int CEF_CALLBACK request_handler_on_select_client_certificate( // Execute bool _retval = CefRequestHandlerCppToC::Get(self)->OnSelectClientCertificate( - CefBrowserCToCpp::Wrap(browser), - isProxy?true:false, - CefString(host), - port, - certificatesList, + CefBrowserCToCpp::Wrap(browser), isProxy ? true : false, CefString(host), + port, certificatesList, CefSelectClientCertificateCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -void CEF_CALLBACK request_handler_on_plugin_crashed( - struct _cef_request_handler_t* self, cef_browser_t* browser, - const cef_string_t* plugin_path) { +void CEF_CALLBACK +request_handler_on_plugin_crashed(struct _cef_request_handler_t* self, + cef_browser_t* browser, + const cef_string_t* plugin_path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -537,12 +546,12 @@ void CEF_CALLBACK request_handler_on_plugin_crashed( // Execute CefRequestHandlerCppToC::Get(self)->OnPluginCrashed( - CefBrowserCToCpp::Wrap(browser), - CefString(plugin_path)); + CefBrowserCToCpp::Wrap(browser), CefString(plugin_path)); } -void CEF_CALLBACK request_handler_on_render_view_ready( - struct _cef_request_handler_t* self, cef_browser_t* browser) { +void CEF_CALLBACK +request_handler_on_render_view_ready(struct _cef_request_handler_t* self, + cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -559,7 +568,8 @@ void CEF_CALLBACK request_handler_on_render_view_ready( } void CEF_CALLBACK request_handler_on_render_process_terminated( - struct _cef_request_handler_t* self, cef_browser_t* browser, + struct _cef_request_handler_t* self, + cef_browser_t* browser, cef_termination_status_t status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -573,13 +583,11 @@ void CEF_CALLBACK request_handler_on_render_process_terminated( // Execute CefRequestHandlerCppToC::Get(self)->OnRenderProcessTerminated( - CefBrowserCToCpp::Wrap(browser), - status); + CefBrowserCToCpp::Wrap(browser), status); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRequestHandlerCppToC::CefRequestHandlerCppToC() { @@ -606,18 +614,25 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC() { request_handler_on_render_process_terminated; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_request_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefRequestHandlerCppToC, + CefRequestHandler, + cef_request_handler_t>::UnwrapDerived(CefWrapperType type, + cef_request_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST_HANDLER; diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h index f5654c2a2..d798220ee 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cef2f6957e8e95cdbad3055cc48852be2b88ad78$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRequestHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefRequestHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/resolve_callback_cpptoc.cc b/libcef_dll/cpptoc/resolve_callback_cpptoc.cc index 38f060a64..88325fb53 100644 --- a/libcef_dll/cpptoc/resolve_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/resolve_callback_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2055b8206165fb8583b6d7659366d438913f3c25$ +// #include "libcef_dll/cpptoc/resolve_callback_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK resolve_callback_on_resolve_completed( - struct _cef_resolve_callback_t* self, cef_errorcode_t result, - cef_string_list_t resolved_ips) { +void CEF_CALLBACK +resolve_callback_on_resolve_completed(struct _cef_resolve_callback_t* self, + cef_errorcode_t result, + cef_string_list_t resolved_ips) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,32 +35,38 @@ void CEF_CALLBACK resolve_callback_on_resolve_completed( transfer_string_list_contents(resolved_ips, resolved_ipsList); // Execute - CefResolveCallbackCppToC::Get(self)->OnResolveCompleted( - result, - resolved_ipsList); + CefResolveCallbackCppToC::Get(self)->OnResolveCompleted(result, + resolved_ipsList); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResolveCallbackCppToC::CefResolveCallbackCppToC() { GetStruct()->on_resolve_completed = resolve_callback_on_resolve_completed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_resolve_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefResolveCallbackCppToC, + CefResolveCallback, + cef_resolve_callback_t>::UnwrapDerived(CefWrapperType type, + cef_resolve_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESOLVE_CALLBACK; diff --git a/libcef_dll/cpptoc/resolve_callback_cpptoc.h b/libcef_dll/cpptoc/resolve_callback_cpptoc.h index 5a700d3d7..30a1c72ab 100644 --- a/libcef_dll/cpptoc/resolve_callback_cpptoc.h +++ b/libcef_dll/cpptoc/resolve_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=46749f3da032d1c3197dd996aea65a25dfc80bf5$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOLVE_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESOLVE_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request_context.h" #include "include/capi/cef_request_context_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_request_context.h" +#include "include/cef_scheme.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefResolveCallbackCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefResolveCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/resource_bundle_cpptoc.cc b/libcef_dll/cpptoc/resource_bundle_cpptoc.cc index 9951f9df4..07a8d2741 100644 --- a/libcef_dll/cpptoc/resource_bundle_cpptoc.cc +++ b/libcef_dll/cpptoc/resource_bundle_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cad0f658e2f2c93fefbe5abd77135a94cf57f7d9$ +// #include "libcef_dll/cpptoc/resource_bundle_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global() { @@ -25,13 +26,13 @@ CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global() { return CefResourceBundleCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_string_userfree_t CEF_CALLBACK resource_bundle_get_localized_string( - struct _cef_resource_bundle_t* self, int string_id) { +cef_string_userfree_t CEF_CALLBACK +resource_bundle_get_localized_string(struct _cef_resource_bundle_t* self, + int string_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,16 +40,18 @@ cef_string_userfree_t CEF_CALLBACK resource_bundle_get_localized_string( return NULL; // Execute - CefString _retval = CefResourceBundleCppToC::Get(self)->GetLocalizedString( - string_id); + CefString _retval = + CefResourceBundleCppToC::Get(self)->GetLocalizedString(string_id); // Return type: string return _retval.DetachToUserFree(); } -int CEF_CALLBACK resource_bundle_get_data_resource( - struct _cef_resource_bundle_t* self, int resource_id, void** data, - size_t* data_size) { +int CEF_CALLBACK +resource_bundle_get_data_resource(struct _cef_resource_bundle_t* self, + int resource_id, + void** data, + size_t* data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,15 +67,13 @@ int CEF_CALLBACK resource_bundle_get_data_resource( return 0; // Translate param: data; type: simple_byref - void* dataVal = data?*data:NULL; + void* dataVal = data ? *data : NULL; // Translate param: data_size; type: simple_byref - size_t data_sizeVal = data_size?*data_size:0; + size_t data_sizeVal = data_size ? *data_size : 0; // Execute bool _retval = CefResourceBundleCppToC::Get(self)->GetDataResource( - resource_id, - dataVal, - data_sizeVal); + resource_id, dataVal, data_sizeVal); // Restore param: data; type: simple_byref if (data) @@ -85,9 +86,12 @@ int CEF_CALLBACK resource_bundle_get_data_resource( return _retval; } -int CEF_CALLBACK resource_bundle_get_data_resource_for_scale( - struct _cef_resource_bundle_t* self, int resource_id, - cef_scale_factor_t scale_factor, void** data, size_t* data_size) { +int CEF_CALLBACK +resource_bundle_get_data_resource_for_scale(struct _cef_resource_bundle_t* self, + int resource_id, + cef_scale_factor_t scale_factor, + void** data, + size_t* data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -103,16 +107,13 @@ int CEF_CALLBACK resource_bundle_get_data_resource_for_scale( return 0; // Translate param: data; type: simple_byref - void* dataVal = data?*data:NULL; + void* dataVal = data ? *data : NULL; // Translate param: data_size; type: simple_byref - size_t data_sizeVal = data_size?*data_size:0; + size_t data_sizeVal = data_size ? *data_size : 0; // Execute bool _retval = CefResourceBundleCppToC::Get(self)->GetDataResourceForScale( - resource_id, - scale_factor, - dataVal, - data_sizeVal); + resource_id, scale_factor, dataVal, data_sizeVal); // Restore param: data; type: simple_byref if (data) @@ -127,7 +128,6 @@ int CEF_CALLBACK resource_bundle_get_data_resource_for_scale( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResourceBundleCppToC::CefResourceBundleCppToC() { @@ -137,18 +137,25 @@ CefResourceBundleCppToC::CefResourceBundleCppToC() { resource_bundle_get_data_resource_for_scale; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_resource_bundle_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefResourceBundleCppToC, + CefResourceBundle, + cef_resource_bundle_t>::UnwrapDerived(CefWrapperType type, + cef_resource_bundle_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESOURCE_BUNDLE; diff --git a/libcef_dll/cpptoc/resource_bundle_cpptoc.h b/libcef_dll/cpptoc/resource_bundle_cpptoc.h index a8625bb79..8e2769f5d 100644 --- a/libcef_dll/cpptoc/resource_bundle_cpptoc.h +++ b/libcef_dll/cpptoc/resource_bundle_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4819a51abe05d509c83daffb61da2e0313c89222$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_resource_bundle.h" #include "include/capi/cef_resource_bundle_capi.h" +#include "include/cef_resource_bundle.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefResourceBundleCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefResourceBundleCppToC(); }; diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc index 92939822c..2a286fd2d 100644 --- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=47339f94c600cd510238e5994ac25684fe82fc14$ +// #include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK resource_bundle_handler_get_localized_string( - struct _cef_resource_bundle_handler_t* self, int string_id, + struct _cef_resource_bundle_handler_t* self, + int string_id, cef_string_t* string) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -35,15 +37,16 @@ int CEF_CALLBACK resource_bundle_handler_get_localized_string( // Execute bool _retval = CefResourceBundleHandlerCppToC::Get(self)->GetLocalizedString( - string_id, - stringStr); + string_id, stringStr); // Return type: bool return _retval; } int CEF_CALLBACK resource_bundle_handler_get_data_resource( - struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, + struct _cef_resource_bundle_handler_t* self, + int resource_id, + void** data, size_t* data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -60,15 +63,13 @@ int CEF_CALLBACK resource_bundle_handler_get_data_resource( return 0; // Translate param: data; type: simple_byref - void* dataVal = data?*data:NULL; + void* dataVal = data ? *data : NULL; // Translate param: data_size; type: simple_byref - size_t data_sizeVal = data_size?*data_size:0; + size_t data_sizeVal = data_size ? *data_size : 0; // Execute bool _retval = CefResourceBundleHandlerCppToC::Get(self)->GetDataResource( - resource_id, - dataVal, - data_sizeVal); + resource_id, dataVal, data_sizeVal); // Restore param: data; type: simple_byref if (data) @@ -82,8 +83,11 @@ int CEF_CALLBACK resource_bundle_handler_get_data_resource( } int CEF_CALLBACK resource_bundle_handler_get_data_resource_for_scale( - struct _cef_resource_bundle_handler_t* self, int resource_id, - cef_scale_factor_t scale_factor, void** data, size_t* data_size) { + struct _cef_resource_bundle_handler_t* self, + int resource_id, + cef_scale_factor_t scale_factor, + void** data, + size_t* data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -99,17 +103,14 @@ int CEF_CALLBACK resource_bundle_handler_get_data_resource_for_scale( return 0; // Translate param: data; type: simple_byref - void* dataVal = data?*data:NULL; + void* dataVal = data ? *data : NULL; // Translate param: data_size; type: simple_byref - size_t data_sizeVal = data_size?*data_size:0; + size_t data_sizeVal = data_size ? *data_size : 0; // Execute - bool _retval = CefResourceBundleHandlerCppToC::Get( - self)->GetDataResourceForScale( - resource_id, - scale_factor, - dataVal, - data_sizeVal); + bool _retval = + CefResourceBundleHandlerCppToC::Get(self)->GetDataResourceForScale( + resource_id, scale_factor, dataVal, data_sizeVal); // Restore param: data; type: simple_byref if (data) @@ -124,7 +125,6 @@ int CEF_CALLBACK resource_bundle_handler_get_data_resource_for_scale( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC() { @@ -135,18 +135,28 @@ CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC() { resource_bundle_handler_get_data_resource_for_scale; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_resource_bundle_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefResourceBundleHandlerCppToC, + CefResourceBundleHandler, + cef_resource_bundle_handler_t>::UnwrapDerived(CefWrapperType type, + cef_resource_bundle_handler_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_RESOURCE_BUNDLE_HANDLER; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_RESOURCE_BUNDLE_HANDLER; diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h index 31fc05d14..cba598ea4 100644 --- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h +++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e14c4bceb6a99d091f2e248d0ec05086f1ddc9bf$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_resource_bundle_handler.h" #include "include/capi/cef_resource_bundle_handler_capi.h" +#include "include/cef_resource_bundle_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefResourceBundleHandlerCppToC : public CefCppToCRefCounted { + CefResourceBundleHandler, + cef_resource_bundle_handler_t> { public: CefResourceBundleHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_handler_cpptoc.cc index 9ed9356c8..a07681153 100644 --- a/libcef_dll/cpptoc/resource_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/resource_handler_cpptoc.cc @@ -9,20 +9,22 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=71288eacf082e55ff7e9f827abacd855c20460e4$ +// #include "libcef_dll/cpptoc/resource_handler_cpptoc.h" #include "libcef_dll/ctocpp/callback_ctocpp.h" #include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/response_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK resource_handler_process_request( - struct _cef_resource_handler_t* self, cef_request_t* request, - cef_callback_t* callback) { +int CEF_CALLBACK +resource_handler_process_request(struct _cef_resource_handler_t* self, + cef_request_t* request, + cef_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,16 +41,17 @@ int CEF_CALLBACK resource_handler_process_request( // Execute bool _retval = CefResourceHandlerCppToC::Get(self)->ProcessRequest( - CefRequestCToCpp::Wrap(request), - CefCallbackCToCpp::Wrap(callback)); + CefRequestCToCpp::Wrap(request), CefCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } -void CEF_CALLBACK resource_handler_get_response_headers( - struct _cef_resource_handler_t* self, struct _cef_response_t* response, - int64* response_length, cef_string_t* redirectUrl) { +void CEF_CALLBACK +resource_handler_get_response_headers(struct _cef_resource_handler_t* self, + struct _cef_response_t* response, + int64* response_length, + cef_string_t* redirectUrl) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,24 +71,25 @@ void CEF_CALLBACK resource_handler_get_response_headers( return; // Translate param: response_length; type: simple_byref - int64 response_lengthVal = response_length?*response_length:0; + int64 response_lengthVal = response_length ? *response_length : 0; // Translate param: redirectUrl; type: string_byref CefString redirectUrlStr(redirectUrl); // Execute CefResourceHandlerCppToC::Get(self)->GetResponseHeaders( - CefResponseCToCpp::Wrap(response), - response_lengthVal, - redirectUrlStr); + CefResponseCToCpp::Wrap(response), response_lengthVal, redirectUrlStr); // Restore param: response_length; type: simple_byref if (response_length) *response_length = response_lengthVal; } -int CEF_CALLBACK resource_handler_read_response( - struct _cef_resource_handler_t* self, void* data_out, int bytes_to_read, - int* bytes_read, cef_callback_t* callback) { +int CEF_CALLBACK +resource_handler_read_response(struct _cef_resource_handler_t* self, + void* data_out, + int bytes_to_read, + int* bytes_read, + cef_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -105,13 +109,11 @@ int CEF_CALLBACK resource_handler_read_response( return 0; // Translate param: bytes_read; type: simple_byref - int bytes_readVal = bytes_read?*bytes_read:0; + int bytes_readVal = bytes_read ? *bytes_read : 0; // Execute bool _retval = CefResourceHandlerCppToC::Get(self)->ReadResponse( - data_out, - bytes_to_read, - bytes_readVal, + data_out, bytes_to_read, bytes_readVal, CefCallbackCToCpp::Wrap(callback)); // Restore param: bytes_read; type: simple_byref @@ -122,8 +124,9 @@ int CEF_CALLBACK resource_handler_read_response( return _retval; } -int CEF_CALLBACK resource_handler_can_get_cookie( - struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) { +int CEF_CALLBACK +resource_handler_can_get_cookie(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -140,15 +143,15 @@ int CEF_CALLBACK resource_handler_can_get_cookie( cookieObj.Set(*cookie, false); // Execute - bool _retval = CefResourceHandlerCppToC::Get(self)->CanGetCookie( - cookieObj); + bool _retval = CefResourceHandlerCppToC::Get(self)->CanGetCookie(cookieObj); // Return type: bool return _retval; } -int CEF_CALLBACK resource_handler_can_set_cookie( - struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) { +int CEF_CALLBACK +resource_handler_can_set_cookie(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -165,15 +168,14 @@ int CEF_CALLBACK resource_handler_can_set_cookie( cookieObj.Set(*cookie, false); // Execute - bool _retval = CefResourceHandlerCppToC::Get(self)->CanSetCookie( - cookieObj); + bool _retval = CefResourceHandlerCppToC::Get(self)->CanSetCookie(cookieObj); // Return type: bool return _retval; } -void CEF_CALLBACK resource_handler_cancel( - struct _cef_resource_handler_t* self) { +void CEF_CALLBACK +resource_handler_cancel(struct _cef_resource_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -186,7 +188,6 @@ void CEF_CALLBACK resource_handler_cancel( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResourceHandlerCppToC::CefResourceHandlerCppToC() { @@ -198,18 +199,26 @@ CefResourceHandlerCppToC::CefResourceHandlerCppToC() { GetStruct()->cancel = resource_handler_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_resource_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefResourceHandlerCppToC, + CefResourceHandler, + cef_resource_handler_t>::UnwrapDerived(CefWrapperType type, + cef_resource_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESOURCE_HANDLER; diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.h b/libcef_dll/cpptoc/resource_handler_cpptoc.h index e4a42ee7f..53f96d91c 100644 --- a/libcef_dll/cpptoc/resource_handler_cpptoc.h +++ b/libcef_dll/cpptoc/resource_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=909e905692875dcd39fc3ffdf819b0ac2c014435$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_resource_handler.h" #include "include/capi/cef_resource_handler_capi.h" +#include "include/cef_resource_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefResourceHandlerCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefResourceHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc index bccc75590..a1e6dd6d7 100644 --- a/libcef_dll/cpptoc/response_cpptoc.cc +++ b/libcef_dll/cpptoc/response_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8c78d1549f74bf28ef06fdfa0d4b0d897788f927$ +// #include "libcef_dll/cpptoc/response_cpptoc.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_response_t* cef_response_create() { @@ -26,7 +27,6 @@ CEF_EXPORT cef_response_t* cef_response_create() { return CefResponseCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -60,7 +60,7 @@ cef_errorcode_t CEF_CALLBACK response_get_error(struct _cef_response_t* self) { } void CEF_CALLBACK response_set_error(struct _cef_response_t* self, - cef_errorcode_t error) { + cef_errorcode_t error) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,8 +68,7 @@ void CEF_CALLBACK response_set_error(struct _cef_response_t* self, return; // Execute - CefResponseCppToC::Get(self)->SetError( - error); + CefResponseCppToC::Get(self)->SetError(error); } int CEF_CALLBACK response_get_status(struct _cef_response_t* self) { @@ -87,7 +86,7 @@ int CEF_CALLBACK response_get_status(struct _cef_response_t* self) { } void CEF_CALLBACK response_set_status(struct _cef_response_t* self, - int status) { + int status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,12 +94,11 @@ void CEF_CALLBACK response_set_status(struct _cef_response_t* self, return; // Execute - CefResponseCppToC::Get(self)->SetStatus( - status); + CefResponseCppToC::Get(self)->SetStatus(status); } -cef_string_userfree_t CEF_CALLBACK response_get_status_text( - struct _cef_response_t* self) { +cef_string_userfree_t CEF_CALLBACK +response_get_status_text(struct _cef_response_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,7 +113,7 @@ cef_string_userfree_t CEF_CALLBACK response_get_status_text( } void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, - const cef_string_t* statusText) { + const cef_string_t* statusText) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -127,12 +125,11 @@ void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, return; // Execute - CefResponseCppToC::Get(self)->SetStatusText( - CefString(statusText)); + CefResponseCppToC::Get(self)->SetStatusText(CefString(statusText)); } -cef_string_userfree_t CEF_CALLBACK response_get_mime_type( - struct _cef_response_t* self) { +cef_string_userfree_t CEF_CALLBACK +response_get_mime_type(struct _cef_response_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -147,7 +144,7 @@ cef_string_userfree_t CEF_CALLBACK response_get_mime_type( } void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, - const cef_string_t* mimeType) { + const cef_string_t* mimeType) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,12 +156,11 @@ void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, return; // Execute - CefResponseCppToC::Get(self)->SetMimeType( - CefString(mimeType)); + CefResponseCppToC::Get(self)->SetMimeType(CefString(mimeType)); } -cef_string_userfree_t CEF_CALLBACK response_get_header( - struct _cef_response_t* self, const cef_string_t* name) { +cef_string_userfree_t CEF_CALLBACK +response_get_header(struct _cef_response_t* self, const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -176,15 +172,14 @@ cef_string_userfree_t CEF_CALLBACK response_get_header( return NULL; // Execute - CefString _retval = CefResponseCppToC::Get(self)->GetHeader( - CefString(name)); + CefString _retval = CefResponseCppToC::Get(self)->GetHeader(CefString(name)); // Return type: string return _retval.DetachToUserFree(); } void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, - cef_string_multimap_t headerMap) { + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -200,8 +195,7 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - CefResponseCppToC::Get(self)->GetHeaderMap( - headerMapMultimap); + CefResponseCppToC::Get(self)->GetHeaderMap(headerMapMultimap); // Restore param: headerMap; type: string_map_multi_byref cef_string_multimap_clear(headerMap); @@ -209,7 +203,7 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, } void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, - cef_string_multimap_t headerMap) { + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -225,13 +219,11 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - CefResponseCppToC::Get(self)->SetHeaderMap( - headerMapMultimap); + CefResponseCppToC::Get(self)->SetHeaderMap(headerMapMultimap); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResponseCppToC::CefResponseCppToC() { @@ -249,17 +241,22 @@ CefResponseCppToC::CefResponseCppToC() { GetStruct()->set_header_map = response_set_header_map; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_response_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_response_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESPONSE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESPONSE; diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h index 8eb7b281d..9c848c676 100644 --- a/libcef_dll/cpptoc/response_cpptoc.h +++ b/libcef_dll/cpptoc/response_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0c8527c876d7caae4612f5793dd2386dced3b642$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_response.h" #include "include/capi/cef_response_capi.h" +#include "include/cef_response.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefResponseCppToC - : public CefCppToCRefCounted { +class CefResponseCppToC : public CefCppToCRefCounted { public: CefResponseCppToC(); }; diff --git a/libcef_dll/cpptoc/response_filter_cpptoc.cc b/libcef_dll/cpptoc/response_filter_cpptoc.cc index 9f4dbcfe9..a700f5df1 100644 --- a/libcef_dll/cpptoc/response_filter_cpptoc.cc +++ b/libcef_dll/cpptoc/response_filter_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=86e0b6a1e669437f51917386ce57d4111178fe59$ +// #include "libcef_dll/cpptoc/response_filter_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK response_filter_init_filter( - struct _cef_response_filter_t* self) { +int CEF_CALLBACK +response_filter_init_filter(struct _cef_response_filter_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,10 +33,14 @@ int CEF_CALLBACK response_filter_init_filter( return _retval; } -cef_response_filter_status_t CEF_CALLBACK response_filter_filter( - struct _cef_response_filter_t* self, void* data_in, size_t data_in_size, - size_t* data_in_read, void* data_out, size_t data_out_size, - size_t* data_out_written) { +cef_response_filter_status_t CEF_CALLBACK +response_filter_filter(struct _cef_response_filter_t* self, + void* data_in, + size_t data_in_size, + size_t* data_in_read, + void* data_out, + size_t data_out_size, + size_t* data_out_written) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,19 +61,15 @@ cef_response_filter_status_t CEF_CALLBACK response_filter_filter( // Unverified params: data_in // Translate param: data_in_read; type: simple_byref - size_t data_in_readVal = data_in_read?*data_in_read:0; + size_t data_in_readVal = data_in_read ? *data_in_read : 0; // Translate param: data_out_written; type: simple_byref - size_t data_out_writtenVal = data_out_written?*data_out_written:0; + size_t data_out_writtenVal = data_out_written ? *data_out_written : 0; // Execute - cef_response_filter_status_t _retval = CefResponseFilterCppToC::Get( - self)->Filter( - data_in, - data_in_size, - data_in_readVal, - data_out, - data_out_size, - data_out_writtenVal); + cef_response_filter_status_t _retval = + CefResponseFilterCppToC::Get(self)->Filter( + data_in, data_in_size, data_in_readVal, data_out, data_out_size, + data_out_writtenVal); // Restore param: data_in_read; type: simple_byref if (data_in_read) @@ -83,7 +84,6 @@ cef_response_filter_status_t CEF_CALLBACK response_filter_filter( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefResponseFilterCppToC::CefResponseFilterCppToC() { @@ -91,18 +91,25 @@ CefResponseFilterCppToC::CefResponseFilterCppToC() { GetStruct()->filter = response_filter_filter; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_response_filter_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefResponseFilterCppToC, + CefResponseFilter, + cef_response_filter_t>::UnwrapDerived(CefWrapperType type, + cef_response_filter_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESPONSE_FILTER; diff --git a/libcef_dll/cpptoc/response_filter_cpptoc.h b/libcef_dll/cpptoc/response_filter_cpptoc.h index 4a3cd1e63..b5d0312e6 100644 --- a/libcef_dll/cpptoc/response_filter_cpptoc.h +++ b/libcef_dll/cpptoc/response_filter_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9e25b052224f89beee11a725d8d89840dd710bbf$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_FILTER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RESPONSE_FILTER_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_response_filter.h" #include "include/capi/cef_response_filter_capi.h" +#include "include/cef_response_filter.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefResponseFilterCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefResponseFilterCppToC(); }; diff --git a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc index d357f6b5b..3972f5492 100644 --- a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=11b53a9b52b929cc12d29ed4b73108b2ebab3628$ +// #include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK run_context_menu_callback_cont( - struct _cef_run_context_menu_callback_t* self, int command_id, - cef_event_flags_t event_flags) { +void CEF_CALLBACK +run_context_menu_callback_cont(struct _cef_run_context_menu_callback_t* self, + int command_id, + cef_event_flags_t event_flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -27,9 +29,7 @@ void CEF_CALLBACK run_context_menu_callback_cont( return; // Execute - CefRunContextMenuCallbackCppToC::Get(self)->Continue( - command_id, - event_flags); + CefRunContextMenuCallbackCppToC::Get(self)->Continue(command_id, event_flags); } void CEF_CALLBACK run_context_menu_callback_cancel( @@ -46,7 +46,6 @@ void CEF_CALLBACK run_context_menu_callback_cancel( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRunContextMenuCallbackCppToC::CefRunContextMenuCallbackCppToC() { @@ -54,19 +53,27 @@ CefRunContextMenuCallbackCppToC::CefRunContextMenuCallbackCppToC() { GetStruct()->cancel = run_context_menu_callback_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_run_context_menu_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_run_context_menu_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_RUN_CONTEXT_MENU_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_RUN_CONTEXT_MENU_CALLBACK; diff --git a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h index 9141baeec..09beb7a7c 100644 --- a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h +++ b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=dc07b145cd56559b5eefb0781271f00ce82ab36f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_CONTEXT_MENU_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RUN_CONTEXT_MENU_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefRunContextMenuCallbackCppToC : public CefCppToCRefCounted { + CefRunContextMenuCallback, + cef_run_context_menu_callback_t> { public: CefRunContextMenuCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc index af47f3f26..e286f080c 100644 --- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1522ca444b68114d64bc346d784639544f400f8f$ +// #include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK run_file_dialog_callback_on_file_dialog_dismissed( - struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter, + struct _cef_run_file_dialog_callback_t* self, + int selected_accept_filter, cef_string_list_t file_paths) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -38,13 +40,11 @@ void CEF_CALLBACK run_file_dialog_callback_on_file_dialog_dismissed( // Execute CefRunFileDialogCallbackCppToC::Get(self)->OnFileDialogDismissed( - selected_accept_filter, - file_pathsList); + selected_accept_filter, file_pathsList); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC() { @@ -52,18 +52,27 @@ CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC() { run_file_dialog_callback_on_file_dialog_dismissed; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_run_file_dialog_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_run_file_dialog_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_RUN_FILE_DIALOG_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_RUN_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h index d88f2ed82..80d87cbe0 100644 --- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a8275d81a28c774f86b7abdce522f3ea0b3d62d6$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefRunFileDialogCallbackCppToC : public CefCppToCRefCounted { + CefRunFileDialogCallback, + cef_run_file_dialog_callback_t> { public: CefRunFileDialogCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc index c86ea120a..b7818c8b9 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=815287a25120b02a67c6a04cd84132cf7f746f92$ +// #include "libcef_dll/cpptoc/resource_handler_cpptoc.h" #include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" @@ -16,15 +18,16 @@ #include "libcef_dll/ctocpp/frame_ctocpp.h" #include "libcef_dll/ctocpp/request_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( - struct _cef_scheme_handler_factory_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* scheme_name, - cef_request_t* request) { +cef_resource_handler_t* CEF_CALLBACK +scheme_handler_factory_create(struct _cef_scheme_handler_factory_t* self, + cef_browser_t* browser, + cef_frame_t* frame, + const cef_string_t* scheme_name, + cef_request_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -41,12 +44,10 @@ cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( // Unverified params: browser, frame // Execute - CefRefPtr _retval = CefSchemeHandlerFactoryCppToC::Get( - self)->Create( - CefBrowserCToCpp::Wrap(browser), - CefFrameCToCpp::Wrap(frame), - CefString(scheme_name), - CefRequestCToCpp::Wrap(request)); + CefRefPtr _retval = + CefSchemeHandlerFactoryCppToC::Get(self)->Create( + CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), + CefString(scheme_name), CefRequestCToCpp::Wrap(request)); // Return type: refptr_same return CefResourceHandlerCppToC::Wrap(_retval); @@ -54,25 +55,33 @@ cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC() { GetStruct()->create = scheme_handler_factory_create; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_scheme_handler_factory_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefSchemeHandlerFactoryCppToC, + CefSchemeHandlerFactory, + cef_scheme_handler_factory_t>::UnwrapDerived(CefWrapperType type, + cef_scheme_handler_factory_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SCHEME_HANDLER_FACTORY; diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h index b239a78b4..f5261f616 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=04d3cebedde95e80191f08348cface44761aaee1$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_scheme.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefSchemeHandlerFactoryCppToC : public CefCppToCRefCounted { + CefSchemeHandlerFactory, + cef_scheme_handler_factory_t> { public: CefSchemeHandlerFactoryCppToC(); }; diff --git a/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc b/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc index 465c62dec..219d2831c 100644 --- a/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc @@ -9,18 +9,24 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0eb1f2d2f28463f3ca3b38b4bdfea425c2a1d4c9$ +// #include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK scheme_registrar_add_custom_scheme( - struct _cef_scheme_registrar_t* self, const cef_string_t* scheme_name, - int is_standard, int is_local, int is_display_isolated, int is_secure, - int is_cors_enabled, int is_csp_bypassing) { +int CEF_CALLBACK +scheme_registrar_add_custom_scheme(struct _cef_scheme_registrar_t* self, + const cef_string_t* scheme_name, + int is_standard, + int is_local, + int is_display_isolated, + int is_secure, + int is_cors_enabled, + int is_csp_bypassing) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,13 +39,10 @@ int CEF_CALLBACK scheme_registrar_add_custom_scheme( // Execute bool _retval = CefSchemeRegistrarCppToC::Get(self)->AddCustomScheme( - CefString(scheme_name), - is_standard?true:false, - is_local?true:false, - is_display_isolated?true:false, - is_secure?true:false, - is_cors_enabled?true:false, - is_csp_bypassing?true:false); + CefString(scheme_name), is_standard ? true : false, + is_local ? true : false, is_display_isolated ? true : false, + is_secure ? true : false, is_cors_enabled ? true : false, + is_csp_bypassing ? true : false); // Return type: bool return _retval; @@ -47,32 +50,41 @@ int CEF_CALLBACK scheme_registrar_add_custom_scheme( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefSchemeRegistrarCppToC::CefSchemeRegistrarCppToC() { GetStruct()->add_custom_scheme = scheme_registrar_add_custom_scheme; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn( - CefWrapperType type, cef_scheme_registrar_t* s) { +template <> +CefOwnPtr CefCppToCScoped< + CefSchemeRegistrarCppToC, + CefSchemeRegistrar, + cef_scheme_registrar_t>::UnwrapDerivedOwn(CefWrapperType type, + cef_scheme_registrar_t* s) { NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw( - CefWrapperType type, cef_scheme_registrar_t* s) { +template <> +CefRawPtr CefCppToCScoped< + CefSchemeRegistrarCppToC, + CefSchemeRegistrar, + cef_scheme_registrar_t>::UnwrapDerivedRaw(CefWrapperType type, + cef_scheme_registrar_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = +template <> +CefWrapperType CefCppToCScoped::kWrapperType = WT_SCHEME_REGISTRAR; diff --git a/libcef_dll/cpptoc/scheme_registrar_cpptoc.h b/libcef_dll/cpptoc/scheme_registrar_cpptoc.h index 857293142..c850df2df 100644 --- a/libcef_dll/cpptoc/scheme_registrar_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_registrar_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bd7eac923225a2adc32bcd7e73a8269233fc15a7$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_REGISTRAR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SCHEME_REGISTRAR_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_scheme.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefSchemeRegistrarCppToC - : public CefCppToCScoped { + : public CefCppToCScoped { public: CefSchemeRegistrarCppToC(); }; diff --git a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc index 4c309f2a7..a5461145f 100644 --- a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=71428694b408ac2be29fd0c14aff9339a01cf3bf$ +// #include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -35,29 +36,36 @@ void CEF_CALLBACK select_client_certificate_callback_select( } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefSelectClientCertificateCallbackCppToC::CefSelectClientCertificateCallbackCppToC( - ) { +CefSelectClientCertificateCallbackCppToC:: + CefSelectClientCertificateCallbackCppToC() { GetStruct()->select = select_client_certificate_callback_select; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_select_client_certificate_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_select_client_certificate_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted +CefWrapperType CefCppToCRefCounted< + CefSelectClientCertificateCallbackCppToC, CefSelectClientCertificateCallback, cef_select_client_certificate_callback_t>::kWrapperType = WT_SELECT_CLIENT_CERTIFICATE_CALLBACK; diff --git a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h index b76c34432..d881f3c94 100644 --- a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h +++ b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=19eb1914f8b358311d05fe5b17ec53610bc76171$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefSelectClientCertificateCallbackCppToC : public CefCppToCRefCounted { + CefSelectClientCertificateCallback, + cef_select_client_certificate_callback_t> { public: CefSelectClientCertificateCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc index 92ab99989..b83f94814 100644 --- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4a2ec304178530684d11e8b97ea2cfbd209d2f1e$ +// #include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK set_cookie_callback_on_complete( - struct _cef_set_cookie_callback_t* self, int success) { +void CEF_CALLBACK +set_cookie_callback_on_complete(struct _cef_set_cookie_callback_t* self, + int success) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -26,31 +28,37 @@ void CEF_CALLBACK set_cookie_callback_on_complete( return; // Execute - CefSetCookieCallbackCppToC::Get(self)->OnComplete( - success?true:false); + CefSetCookieCallbackCppToC::Get(self)->OnComplete(success ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefSetCookieCallbackCppToC::CefSetCookieCallbackCppToC() { GetStruct()->on_complete = set_cookie_callback_on_complete; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_set_cookie_callback_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefSetCookieCallbackCppToC, + CefSetCookieCallback, + cef_set_cookie_callback_t>::UnwrapDerived(CefWrapperType type, + cef_set_cookie_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SET_COOKIE_CALLBACK; diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h index 62e583dee..9ce96071c 100644 --- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h +++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=02649b81e534fbc3ce974bad0b39077dc2611936$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SET_COOKIE_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SET_COOKIE_CALLBACK_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefSetCookieCallbackCppToC : public CefCppToCRefCounted { + CefSetCookieCallback, + cef_set_cookie_callback_t> { public: CefSetCookieCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.cc b/libcef_dll/cpptoc/sslinfo_cpptoc.cc index 98ddba1b0..b1df51019 100644 --- a/libcef_dll/cpptoc/sslinfo_cpptoc.cc +++ b/libcef_dll/cpptoc/sslinfo_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6b0126f9d5fcea34f38d780abeb1fe16659731b8$ +// #include "libcef_dll/cpptoc/sslinfo_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_cert_status_t CEF_CALLBACK sslinfo_get_cert_status( - struct _cef_sslinfo_t* self) { +cef_cert_status_t CEF_CALLBACK +sslinfo_get_cert_status(struct _cef_sslinfo_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +34,8 @@ cef_cert_status_t CEF_CALLBACK sslinfo_get_cert_status( return _retval; } -struct _cef_x509certificate_t* CEF_CALLBACK sslinfo_get_x509certificate( - struct _cef_sslinfo_t* self) { +struct _cef_x509certificate_t* CEF_CALLBACK +sslinfo_get_x509certificate(struct _cef_sslinfo_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -42,8 +43,8 @@ struct _cef_x509certificate_t* CEF_CALLBACK sslinfo_get_x509certificate( return NULL; // Execute - CefRefPtr _retval = CefSSLInfoCppToC::Get( - self)->GetX509Certificate(); + CefRefPtr _retval = + CefSSLInfoCppToC::Get(self)->GetX509Certificate(); // Return type: refptr_same return CefX509CertificateCppToC::Wrap(_retval); @@ -51,7 +52,6 @@ struct _cef_x509certificate_t* CEF_CALLBACK sslinfo_get_x509certificate( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefSSLInfoCppToC::CefSSLInfoCppToC() { @@ -59,17 +59,23 @@ CefSSLInfoCppToC::CefSSLInfoCppToC() { GetStruct()->get_x509certificate = sslinfo_get_x509certificate; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_sslinfo_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SSLINFO; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SSLINFO; diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.h b/libcef_dll/cpptoc/sslinfo_cpptoc.h index dae2ccb34..fffba8d71 100644 --- a/libcef_dll/cpptoc/sslinfo_cpptoc.h +++ b/libcef_dll/cpptoc/sslinfo_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e6aabe532f5bcb460c20a9651f0b6727cbddfd9f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SSLINFO_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SSLINFO_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_ssl_info.h" #include "include/capi/cef_ssl_info_capi.h" +#include "include/cef_ssl_info.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/sslstatus_cpptoc.cc b/libcef_dll/cpptoc/sslstatus_cpptoc.cc index 488342ae4..aef2662ec 100644 --- a/libcef_dll/cpptoc/sslstatus_cpptoc.cc +++ b/libcef_dll/cpptoc/sslstatus_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5aef2343a86b6a3b67386998a68c9729b5c0eaed$ +// #include "libcef_dll/cpptoc/sslstatus_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -32,8 +33,8 @@ int CEF_CALLBACK sslstatus_is_secure_connection(struct _cef_sslstatus_t* self) { return _retval; } -cef_cert_status_t CEF_CALLBACK sslstatus_get_cert_status( - struct _cef_sslstatus_t* self) { +cef_cert_status_t CEF_CALLBACK +sslstatus_get_cert_status(struct _cef_sslstatus_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +48,8 @@ cef_cert_status_t CEF_CALLBACK sslstatus_get_cert_status( return _retval; } -cef_ssl_version_t CEF_CALLBACK sslstatus_get_sslversion( - struct _cef_sslstatus_t* self) { +cef_ssl_version_t CEF_CALLBACK +sslstatus_get_sslversion(struct _cef_sslstatus_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -62,8 +63,8 @@ cef_ssl_version_t CEF_CALLBACK sslstatus_get_sslversion( return _retval; } -cef_ssl_content_status_t CEF_CALLBACK sslstatus_get_content_status( - struct _cef_sslstatus_t* self) { +cef_ssl_content_status_t CEF_CALLBACK +sslstatus_get_content_status(struct _cef_sslstatus_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -71,15 +72,15 @@ cef_ssl_content_status_t CEF_CALLBACK sslstatus_get_content_status( return SSL_CONTENT_NORMAL_CONTENT; // Execute - cef_ssl_content_status_t _retval = CefSSLStatusCppToC::Get( - self)->GetContentStatus(); + cef_ssl_content_status_t _retval = + CefSSLStatusCppToC::Get(self)->GetContentStatus(); // Return type: simple return _retval; } -struct _cef_x509certificate_t* CEF_CALLBACK sslstatus_get_x509certificate( - struct _cef_sslstatus_t* self) { +struct _cef_x509certificate_t* CEF_CALLBACK +sslstatus_get_x509certificate(struct _cef_sslstatus_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,8 +88,8 @@ struct _cef_x509certificate_t* CEF_CALLBACK sslstatus_get_x509certificate( return NULL; // Execute - CefRefPtr _retval = CefSSLStatusCppToC::Get( - self)->GetX509Certificate(); + CefRefPtr _retval = + CefSSLStatusCppToC::Get(self)->GetX509Certificate(); // Return type: refptr_same return CefX509CertificateCppToC::Wrap(_retval); @@ -96,7 +97,6 @@ struct _cef_x509certificate_t* CEF_CALLBACK sslstatus_get_x509certificate( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefSSLStatusCppToC::CefSSLStatusCppToC() { @@ -107,17 +107,23 @@ CefSSLStatusCppToC::CefSSLStatusCppToC() { GetStruct()->get_x509certificate = sslstatus_get_x509certificate; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_sslstatus_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_sslstatus_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SSLSTATUS; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_SSLSTATUS; diff --git a/libcef_dll/cpptoc/sslstatus_cpptoc.h b/libcef_dll/cpptoc/sslstatus_cpptoc.h index 028dd1361..45bc4e02a 100644 --- a/libcef_dll/cpptoc/sslstatus_cpptoc.h +++ b/libcef_dll/cpptoc/sslstatus_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2eb2423b4cf050773de24e379228b05c258dd803$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_ssl_status.h" #include "include/capi/cef_ssl_status_capi.h" +#include "include/cef_ssl_status.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefSSLStatusCppToC - : public CefCppToCRefCounted { +class CefSSLStatusCppToC : public CefCppToCRefCounted { public: CefSSLStatusCppToC(); }; diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc index 01480f89d..c8302cf72 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=47935fef33a2eb69943e8ff9d26a76f1c25861c0$ +// #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" #include "libcef_dll/ctocpp/read_handler_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( @@ -26,15 +27,15 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( return NULL; // Execute - CefRefPtr _retval = CefStreamReader::CreateForFile( - CefString(fileName)); + CefRefPtr _retval = + CefStreamReader::CreateForFile(CefString(fileName)); // Return type: refptr_same return CefStreamReaderCppToC::Wrap(_retval); } CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, - size_t size) { + size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -43,9 +44,8 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, return NULL; // Execute - CefRefPtr _retval = CefStreamReader::CreateForData( - data, - size); + CefRefPtr _retval = + CefStreamReader::CreateForData(data, size); // Return type: refptr_same return CefStreamReaderCppToC::Wrap(_retval); @@ -61,20 +61,21 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( return NULL; // Execute - CefRefPtr _retval = CefStreamReader::CreateForHandler( - CefReadHandlerCToCpp::Wrap(handler)); + CefRefPtr _retval = + CefStreamReader::CreateForHandler(CefReadHandlerCToCpp::Wrap(handler)); // Return type: refptr_same return CefStreamReaderCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, - void* ptr, size_t size, size_t n) { + void* ptr, + size_t size, + size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -86,17 +87,15 @@ size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, return 0; // Execute - size_t _retval = CefStreamReaderCppToC::Get(self)->Read( - ptr, - size, - n); + size_t _retval = CefStreamReaderCppToC::Get(self)->Read(ptr, size, n); // Return type: simple return _retval; } int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, - int64 offset, int whence) { + int64 offset, + int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,9 +103,7 @@ int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, return 0; // Execute - int _retval = CefStreamReaderCppToC::Get(self)->Seek( - offset, - whence); + int _retval = CefStreamReaderCppToC::Get(self)->Seek(offset, whence); // Return type: simple return _retval; @@ -156,7 +153,6 @@ int CEF_CALLBACK stream_reader_may_block(struct _cef_stream_reader_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefStreamReaderCppToC::CefStreamReaderCppToC() { @@ -167,17 +163,25 @@ CefStreamReaderCppToC::CefStreamReaderCppToC() { GetStruct()->may_block = stream_reader_may_block; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_stream_reader_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefStreamReaderCppToC, + CefStreamReader, + cef_stream_reader_t>::UnwrapDerived(CefWrapperType type, + cef_stream_reader_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STREAM_READER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_STREAM_READER; diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h index 4bdbc5247..5923e81c5 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.h +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=296620df3e1cd051dc1e4eb4175c54d0321b4fc9$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefStreamReaderCppToC - : public CefCppToCRefCounted { +class CefStreamReaderCppToC : public CefCppToCRefCounted { public: CefStreamReaderCppToC(); }; diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc index e090332d5..d4e912ec6 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=17030768bc7b301f326cfd2a9c4b065408c8fd63$ +// #include "libcef_dll/cpptoc/stream_writer_cpptoc.h" #include "libcef_dll/ctocpp/write_handler_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( @@ -26,8 +27,8 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( return NULL; // Execute - CefRefPtr _retval = CefStreamWriter::CreateForFile( - CefString(fileName)); + CefRefPtr _retval = + CefStreamWriter::CreateForFile(CefString(fileName)); // Return type: refptr_same return CefStreamWriterCppToC::Wrap(_retval); @@ -43,20 +44,21 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( return NULL; // Execute - CefRefPtr _retval = CefStreamWriter::CreateForHandler( - CefWriteHandlerCToCpp::Wrap(handler)); + CefRefPtr _retval = + CefStreamWriter::CreateForHandler(CefWriteHandlerCToCpp::Wrap(handler)); // Return type: refptr_same return CefStreamWriterCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, - const void* ptr, size_t size, size_t n) { + const void* ptr, + size_t size, + size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,17 +70,15 @@ size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, return 0; // Execute - size_t _retval = CefStreamWriterCppToC::Get(self)->Write( - ptr, - size, - n); + size_t _retval = CefStreamWriterCppToC::Get(self)->Write(ptr, size, n); // Return type: simple return _retval; } int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, - int64 offset, int whence) { + int64 offset, + int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -86,9 +86,7 @@ int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, return 0; // Execute - int _retval = CefStreamWriterCppToC::Get(self)->Seek( - offset, - whence); + int _retval = CefStreamWriterCppToC::Get(self)->Seek(offset, whence); // Return type: simple return _retval; @@ -138,7 +136,6 @@ int CEF_CALLBACK stream_writer_may_block(struct _cef_stream_writer_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefStreamWriterCppToC::CefStreamWriterCppToC() { @@ -149,17 +146,25 @@ CefStreamWriterCppToC::CefStreamWriterCppToC() { GetStruct()->may_block = stream_writer_may_block; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_stream_writer_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefStreamWriterCppToC, + CefStreamWriter, + cef_stream_writer_t>::UnwrapDerived(CefWrapperType type, + cef_stream_writer_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STREAM_WRITER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_STREAM_WRITER; diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h index 71711898c..3875d5ab6 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.h +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=35eada18cb6104f9aeb9d3d428e1de79596987df$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefStreamWriterCppToC - : public CefCppToCRefCounted { +class CefStreamWriterCppToC : public CefCppToCRefCounted { public: CefStreamWriterCppToC(); }; diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.cc b/libcef_dll/cpptoc/string_visitor_cpptoc.cc index d15dbece8..6a9bc918b 100644 --- a/libcef_dll/cpptoc/string_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/string_visitor_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c778771a654d82fde17dd52d7885f647945dba8f$ +// #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK string_visitor_visit(struct _cef_string_visitor_t* self, - const cef_string_t* string) { + const cef_string_t* string) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -27,30 +28,36 @@ void CEF_CALLBACK string_visitor_visit(struct _cef_string_visitor_t* self, // Unverified params: string // Execute - CefStringVisitorCppToC::Get(self)->Visit( - CefString(string)); + CefStringVisitorCppToC::Get(self)->Visit(CefString(string)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefStringVisitorCppToC::CefStringVisitorCppToC() { GetStruct()->visit = string_visitor_visit; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_string_visitor_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefStringVisitorCppToC, + CefStringVisitor, + cef_string_visitor_t>::UnwrapDerived(CefWrapperType type, + cef_string_visitor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STRING_VISITOR; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_STRING_VISITOR; diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.h b/libcef_dll/cpptoc/string_visitor_cpptoc.h index 9aa85c199..1c4041092 100644 --- a/libcef_dll/cpptoc/string_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/string_visitor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=715a5ff2dbe3aabd134a7b649daec25601ec693e$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_string_visitor.h" #include "include/capi/cef_string_visitor_capi.h" +#include "include/cef_string_visitor.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefStringVisitorCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefStringVisitorCppToC(); }; diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc index 0ee203ea3..d0b130e1b 100644 --- a/libcef_dll/cpptoc/task_cpptoc.cc +++ b/libcef_dll/cpptoc/task_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=208bb3fedcf86b782a03fd64c527abcf05f7b297$ +// #include "libcef_dll/cpptoc/task_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -30,23 +31,28 @@ void CEF_CALLBACK task_execute(struct _cef_task_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTaskCppToC::CefTaskCppToC() { GetStruct()->execute = task_execute; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_task_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_task_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TASK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_TASK; diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h index d0f657568..05a076fe5 100644 --- a/libcef_dll/cpptoc/task_cpptoc.h +++ b/libcef_dll/cpptoc/task_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=faaa34108352c85e424453c47507189335c2df8b$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" +#include "include/cef_task.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.cc b/libcef_dll/cpptoc/task_runner_cpptoc.cc index 3600f6682..549de4059 100644 --- a/libcef_dll/cpptoc/task_runner_cpptoc.cc +++ b/libcef_dll/cpptoc/task_runner_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f5305fa3abe2638b3a079e76ab9f8c0a4d2a259d$ +// #include "libcef_dll/cpptoc/task_runner_cpptoc.h" #include "libcef_dll/ctocpp/task_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread() { @@ -31,20 +32,18 @@ CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefTaskRunner::GetForThread( - threadId); + CefRefPtr _retval = CefTaskRunner::GetForThread(threadId); // Return type: refptr_same return CefTaskRunnerCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK task_runner_is_same(struct _cef_task_runner_t* self, - struct _cef_task_runner_t* that) { + struct _cef_task_runner_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,15 +55,15 @@ int CEF_CALLBACK task_runner_is_same(struct _cef_task_runner_t* self, return 0; // Execute - bool _retval = CefTaskRunnerCppToC::Get(self)->IsSame( - CefTaskRunnerCppToC::Unwrap(that)); + bool _retval = + CefTaskRunnerCppToC::Get(self)->IsSame(CefTaskRunnerCppToC::Unwrap(that)); // Return type: bool return _retval; } -int CEF_CALLBACK task_runner_belongs_to_current_thread( - struct _cef_task_runner_t* self) { +int CEF_CALLBACK +task_runner_belongs_to_current_thread(struct _cef_task_runner_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,7 +78,7 @@ int CEF_CALLBACK task_runner_belongs_to_current_thread( } int CEF_CALLBACK task_runner_belongs_to_thread(struct _cef_task_runner_t* self, - cef_thread_id_t threadId) { + cef_thread_id_t threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -87,15 +86,14 @@ int CEF_CALLBACK task_runner_belongs_to_thread(struct _cef_task_runner_t* self, return 0; // Execute - bool _retval = CefTaskRunnerCppToC::Get(self)->BelongsToThread( - threadId); + bool _retval = CefTaskRunnerCppToC::Get(self)->BelongsToThread(threadId); // Return type: bool return _retval; } int CEF_CALLBACK task_runner_post_task(struct _cef_task_runner_t* self, - cef_task_t* task) { + cef_task_t* task) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,15 +105,16 @@ int CEF_CALLBACK task_runner_post_task(struct _cef_task_runner_t* self, return 0; // Execute - bool _retval = CefTaskRunnerCppToC::Get(self)->PostTask( - CefTaskCToCpp::Wrap(task)); + bool _retval = + CefTaskRunnerCppToC::Get(self)->PostTask(CefTaskCToCpp::Wrap(task)); // Return type: bool return _retval; } int CEF_CALLBACK task_runner_post_delayed_task(struct _cef_task_runner_t* self, - cef_task_t* task, int64 delay_ms) { + cef_task_t* task, + int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,8 +127,7 @@ int CEF_CALLBACK task_runner_post_delayed_task(struct _cef_task_runner_t* self, // Execute bool _retval = CefTaskRunnerCppToC::Get(self)->PostDelayedTask( - CefTaskCToCpp::Wrap(task), - delay_ms); + CefTaskCToCpp::Wrap(task), delay_ms); // Return type: bool return _retval; @@ -137,7 +135,6 @@ int CEF_CALLBACK task_runner_post_delayed_task(struct _cef_task_runner_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTaskRunnerCppToC::CefTaskRunnerCppToC() { @@ -149,17 +146,23 @@ CefTaskRunnerCppToC::CefTaskRunnerCppToC() { GetStruct()->post_delayed_task = task_runner_post_delayed_task; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_task_runner_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_task_runner_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TASK_RUNNER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_TASK_RUNNER; diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.h b/libcef_dll/cpptoc/task_runner_cpptoc.h index a46a30e11..a92f8bef5 100644 --- a/libcef_dll/cpptoc/task_runner_cpptoc.h +++ b/libcef_dll/cpptoc/task_runner_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=eb5db2997ff6eedafefd536da970974b9789391a$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_RUNNER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TASK_RUNNER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" +#include "include/cef_task.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefTaskRunnerCppToC - : public CefCppToCRefCounted { +class CefTaskRunnerCppToC : public CefCppToCRefCounted { public: CefTaskRunnerCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc index e966b06b0..0266c519f 100644 --- a/libcef_dll/cpptoc/test/translator_test_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc @@ -9,20 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=dd909074a7d2032d5fbc4a700dfaecf00a198f42$ +// #include #include "libcef_dll/cpptoc/test/translator_test_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_translator_test_t* cef_translator_test_create() { @@ -35,13 +36,12 @@ CEF_EXPORT cef_translator_test_t* cef_translator_test_create() { return CefTranslatorTestCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK translator_test_get_void( - struct _cef_translator_test_t* self) { +void CEF_CALLBACK +translator_test_get_void(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -80,8 +80,8 @@ int CEF_CALLBACK translator_test_get_int(struct _cef_translator_test_t* self) { return _retval; } -double CEF_CALLBACK translator_test_get_double( - struct _cef_translator_test_t* self) { +double CEF_CALLBACK +translator_test_get_double(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,8 +95,8 @@ double CEF_CALLBACK translator_test_get_double( return _retval; } -long CEF_CALLBACK translator_test_get_long( - struct _cef_translator_test_t* self) { +long CEF_CALLBACK +translator_test_get_long(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -110,8 +110,8 @@ long CEF_CALLBACK translator_test_get_long( return _retval; } -size_t CEF_CALLBACK translator_test_get_sizet( - struct _cef_translator_test_t* self) { +size_t CEF_CALLBACK +translator_test_get_sizet(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -140,7 +140,7 @@ int CEF_CALLBACK translator_test_set_void(struct _cef_translator_test_t* self) { } int CEF_CALLBACK translator_test_set_bool(struct _cef_translator_test_t* self, - int val) { + int val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,15 +148,15 @@ int CEF_CALLBACK translator_test_set_bool(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetBool( - val?true:false); + bool _retval = + CefTranslatorTestCppToC::Get(self)->SetBool(val ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_set_int(struct _cef_translator_test_t* self, - int val) { + int val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -164,15 +164,14 @@ int CEF_CALLBACK translator_test_set_int(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetInt( - val); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetInt(val); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_set_double(struct _cef_translator_test_t* self, - double val) { + double val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -180,15 +179,14 @@ int CEF_CALLBACK translator_test_set_double(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetDouble( - val); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetDouble(val); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_set_long(struct _cef_translator_test_t* self, - long val) { + long val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -196,15 +194,14 @@ int CEF_CALLBACK translator_test_set_long(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetLong( - val); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetLong(val); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_set_sizet(struct _cef_translator_test_t* self, - size_t val) { + size_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -212,15 +209,16 @@ int CEF_CALLBACK translator_test_set_sizet(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetSizet( - val); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetSizet(val); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_set_int_list( - struct _cef_translator_test_t* self, size_t valCount, int const* val) { +int CEF_CALLBACK +translator_test_set_int_list(struct _cef_translator_test_t* self, + size_t valCount, + int const* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -232,7 +230,7 @@ int CEF_CALLBACK translator_test_set_int_list( return 0; // Translate param: val; type: simple_vec_byref_const - std::vector valList; + std::vector valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { int valVal = val[i]; @@ -241,15 +239,16 @@ int CEF_CALLBACK translator_test_set_int_list( } // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetIntList( - valList); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetIntList(valList); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_get_int_list_by_ref( - struct _cef_translator_test_t* self, size_t* valCount, int* val) { +int CEF_CALLBACK +translator_test_get_int_list_by_ref(struct _cef_translator_test_t* self, + size_t* valCount, + int* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -261,7 +260,7 @@ int CEF_CALLBACK translator_test_get_int_list_by_ref( return 0; // Translate param: val; type: simple_vec_byref - std::vector valList; + std::vector valList; if (valCount && *valCount > 0 && val) { for (size_t i = 0; i < *valCount; ++i) { valList.push_back(val[i]); @@ -269,8 +268,7 @@ int CEF_CALLBACK translator_test_get_int_list_by_ref( } // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->GetIntListByRef( - valList); + bool _retval = CefTranslatorTestCppToC::Get(self)->GetIntListByRef(valList); // Restore param: val; type: simple_vec_byref if (valCount && val) { @@ -286,8 +284,8 @@ int CEF_CALLBACK translator_test_get_int_list_by_ref( return _retval; } -size_t CEF_CALLBACK translator_test_get_int_list_size( - struct _cef_translator_test_t* self) { +size_t CEF_CALLBACK +translator_test_get_int_list_size(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -301,8 +299,8 @@ size_t CEF_CALLBACK translator_test_get_int_list_size( return _retval; } -cef_string_userfree_t CEF_CALLBACK translator_test_get_string( - struct _cef_translator_test_t* self) { +cef_string_userfree_t CEF_CALLBACK +translator_test_get_string(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -317,7 +315,7 @@ cef_string_userfree_t CEF_CALLBACK translator_test_get_string( } int CEF_CALLBACK translator_test_set_string(struct _cef_translator_test_t* self, - const cef_string_t* val) { + const cef_string_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -329,15 +327,15 @@ int CEF_CALLBACK translator_test_set_string(struct _cef_translator_test_t* self, return 0; // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetString( - CefString(val)); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetString(CefString(val)); // Return type: bool return _retval; } -void CEF_CALLBACK translator_test_get_string_by_ref( - struct _cef_translator_test_t* self, cef_string_t* val) { +void CEF_CALLBACK +translator_test_get_string_by_ref(struct _cef_translator_test_t* self, + cef_string_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -352,12 +350,12 @@ void CEF_CALLBACK translator_test_get_string_by_ref( CefString valStr(val); // Execute - CefTranslatorTestCppToC::Get(self)->GetStringByRef( - valStr); + CefTranslatorTestCppToC::Get(self)->GetStringByRef(valStr); } -int CEF_CALLBACK translator_test_set_string_list( - struct _cef_translator_test_t* self, cef_string_list_t val) { +int CEF_CALLBACK +translator_test_set_string_list(struct _cef_translator_test_t* self, + cef_string_list_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -373,15 +371,15 @@ int CEF_CALLBACK translator_test_set_string_list( transfer_string_list_contents(val, valList); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringList( - valList); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringList(valList); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_get_string_list_by_ref( - struct _cef_translator_test_t* self, cef_string_list_t val) { +int CEF_CALLBACK +translator_test_get_string_list_by_ref(struct _cef_translator_test_t* self, + cef_string_list_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -397,8 +395,8 @@ int CEF_CALLBACK translator_test_get_string_list_by_ref( transfer_string_list_contents(val, valList); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringListByRef( - valList); + bool _retval = + CefTranslatorTestCppToC::Get(self)->GetStringListByRef(valList); // Restore param: val; type: string_vec_byref cef_string_list_clear(val); @@ -408,8 +406,9 @@ int CEF_CALLBACK translator_test_get_string_list_by_ref( return _retval; } -int CEF_CALLBACK translator_test_set_string_map( - struct _cef_translator_test_t* self, cef_string_map_t val) { +int CEF_CALLBACK +translator_test_set_string_map(struct _cef_translator_test_t* self, + cef_string_map_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -425,15 +424,15 @@ int CEF_CALLBACK translator_test_set_string_map( transfer_string_map_contents(val, valMap); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringMap( - valMap); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringMap(valMap); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_get_string_map_by_ref( - struct _cef_translator_test_t* self, cef_string_map_t val) { +int CEF_CALLBACK +translator_test_get_string_map_by_ref(struct _cef_translator_test_t* self, + cef_string_map_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -449,8 +448,7 @@ int CEF_CALLBACK translator_test_get_string_map_by_ref( transfer_string_map_contents(val, valMap); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringMapByRef( - valMap); + bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringMapByRef(valMap); // Restore param: val; type: string_map_single_byref cef_string_map_clear(val); @@ -460,8 +458,9 @@ int CEF_CALLBACK translator_test_get_string_map_by_ref( return _retval; } -int CEF_CALLBACK translator_test_set_string_multimap( - struct _cef_translator_test_t* self, cef_string_multimap_t val) { +int CEF_CALLBACK +translator_test_set_string_multimap(struct _cef_translator_test_t* self, + cef_string_multimap_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -477,15 +476,16 @@ int CEF_CALLBACK translator_test_set_string_multimap( transfer_string_multimap_contents(val, valMultimap); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringMultimap( - valMultimap); + bool _retval = + CefTranslatorTestCppToC::Get(self)->SetStringMultimap(valMultimap); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_get_string_multimap_by_ref( - struct _cef_translator_test_t* self, cef_string_multimap_t val) { +int CEF_CALLBACK +translator_test_get_string_multimap_by_ref(struct _cef_translator_test_t* self, + cef_string_multimap_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -501,8 +501,8 @@ int CEF_CALLBACK translator_test_get_string_multimap_by_ref( transfer_string_multimap_contents(val, valMultimap); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringMultimapByRef( - valMultimap); + bool _retval = + CefTranslatorTestCppToC::Get(self)->GetStringMultimapByRef(valMultimap); // Restore param: val; type: string_map_multi_byref cef_string_multimap_clear(val); @@ -512,8 +512,8 @@ int CEF_CALLBACK translator_test_get_string_multimap_by_ref( return _retval; } -cef_point_t CEF_CALLBACK translator_test_get_point( - struct _cef_translator_test_t* self) { +cef_point_t CEF_CALLBACK +translator_test_get_point(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -528,7 +528,7 @@ cef_point_t CEF_CALLBACK translator_test_get_point( } int CEF_CALLBACK translator_test_set_point(struct _cef_translator_test_t* self, - const cef_point_t* val) { + const cef_point_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -540,18 +540,18 @@ int CEF_CALLBACK translator_test_set_point(struct _cef_translator_test_t* self, return 0; // Translate param: val; type: simple_byref_const - CefPoint valVal = val?*val:CefPoint(); + CefPoint valVal = val ? *val : CefPoint(); // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetPoint( - valVal); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetPoint(valVal); // Return type: bool return _retval; } -void CEF_CALLBACK translator_test_get_point_by_ref( - struct _cef_translator_test_t* self, cef_point_t* val) { +void CEF_CALLBACK +translator_test_get_point_by_ref(struct _cef_translator_test_t* self, + cef_point_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -563,20 +563,20 @@ void CEF_CALLBACK translator_test_get_point_by_ref( return; // Translate param: val; type: simple_byref - CefPoint valVal = val?*val:CefPoint(); + CefPoint valVal = val ? *val : CefPoint(); // Execute - CefTranslatorTestCppToC::Get(self)->GetPointByRef( - valVal); + CefTranslatorTestCppToC::Get(self)->GetPointByRef(valVal); // Restore param: val; type: simple_byref if (val) *val = valVal; } -int CEF_CALLBACK translator_test_set_point_list( - struct _cef_translator_test_t* self, size_t valCount, - cef_point_t const* val) { +int CEF_CALLBACK +translator_test_set_point_list(struct _cef_translator_test_t* self, + size_t valCount, + cef_point_t const* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -588,7 +588,7 @@ int CEF_CALLBACK translator_test_set_point_list( return 0; // Translate param: val; type: simple_vec_byref_const - std::vector valList; + std::vector valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { CefPoint valVal = val[i]; @@ -597,15 +597,16 @@ int CEF_CALLBACK translator_test_set_point_list( } // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->SetPointList( - valList); + bool _retval = CefTranslatorTestCppToC::Get(self)->SetPointList(valList); // Return type: bool return _retval; } -int CEF_CALLBACK translator_test_get_point_list_by_ref( - struct _cef_translator_test_t* self, size_t* valCount, cef_point_t* val) { +int CEF_CALLBACK +translator_test_get_point_list_by_ref(struct _cef_translator_test_t* self, + size_t* valCount, + cef_point_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -617,7 +618,7 @@ int CEF_CALLBACK translator_test_get_point_list_by_ref( return 0; // Translate param: val; type: simple_vec_byref - std::vector valList; + std::vector valList; if (valCount && *valCount > 0 && val) { for (size_t i = 0; i < *valCount; ++i) { valList.push_back(val[i]); @@ -625,8 +626,7 @@ int CEF_CALLBACK translator_test_get_point_list_by_ref( } // Execute - bool _retval = CefTranslatorTestCppToC::Get(self)->GetPointListByRef( - valList); + bool _retval = CefTranslatorTestCppToC::Get(self)->GetPointListByRef(valList); // Restore param: val; type: simple_vec_byref if (valCount && val) { @@ -642,8 +642,8 @@ int CEF_CALLBACK translator_test_get_point_list_by_ref( return _retval; } -size_t CEF_CALLBACK translator_test_get_point_list_size( - struct _cef_translator_test_t* self) { +size_t CEF_CALLBACK +translator_test_get_point_list_size(struct _cef_translator_test_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -657,8 +657,9 @@ size_t CEF_CALLBACK translator_test_get_point_list_size( return _retval; } -struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_get_ref_ptr_library( - struct _cef_translator_test_t* self, int val) { +struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK +translator_test_get_ref_ptr_library(struct _cef_translator_test_t* self, + int val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -667,8 +668,7 @@ struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_get_ // Execute CefRefPtr _retval = - CefTranslatorTestCppToC::Get(self)->GetRefPtrLibrary( - val); + CefTranslatorTestCppToC::Get(self)->GetRefPtrLibrary(val); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval); @@ -695,7 +695,8 @@ int CEF_CALLBACK translator_test_set_ref_ptr_library( return _retval; } -struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_ref_ptr_library_and_return( +struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK +translator_test_set_ref_ptr_library_and_return( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -711,7 +712,7 @@ struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_ // Execute CefRefPtr _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrLibraryAndReturn( - CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val)); + CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval); @@ -738,7 +739,8 @@ int CEF_CALLBACK translator_test_set_child_ref_ptr_library( return _retval; } -struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_child_ref_ptr_library_and_return_parent( +struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK +translator_test_set_child_ref_ptr_library_and_return_parent( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_library_child_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -754,15 +756,17 @@ struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_ // Execute CefRefPtr _retval = CefTranslatorTestCppToC::Get(self)->SetChildRefPtrLibraryAndReturnParent( - CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap(val)); + CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval); } int CEF_CALLBACK translator_test_set_ref_ptr_library_list( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_ref_ptr_library_t* const* val, int val1, + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_ref_ptr_library_t* const* val, + int val1, int val2) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -775,7 +779,7 @@ int CEF_CALLBACK translator_test_set_ref_ptr_library_list( return 0; // Translate param: val; type: refptr_vec_same_byref_const - std::vector > valList; + std::vector> valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { CefRefPtr valVal = @@ -786,17 +790,18 @@ int CEF_CALLBACK translator_test_set_ref_ptr_library_list( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrLibraryList( - valList, - val1, - val2); + valList, val1, val2); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_get_ref_ptr_library_list_by_ref( - struct _cef_translator_test_t* self, size_t* valCount, - struct _cef_translator_test_ref_ptr_library_t** val, int val1, int val2) { + struct _cef_translator_test_t* self, + size_t* valCount, + struct _cef_translator_test_ref_ptr_library_t** val, + int val1, + int val2) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -808,7 +813,7 @@ int CEF_CALLBACK translator_test_get_ref_ptr_library_list_by_ref( return 0; // Translate param: val; type: refptr_vec_same_byref - std::vector > valList; + std::vector> valList; if (valCount && *valCount > 0 && val) { for (size_t i = 0; i < *valCount; ++i) { valList.push_back(CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val[i])); @@ -817,9 +822,7 @@ int CEF_CALLBACK translator_test_get_ref_ptr_library_list_by_ref( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrLibraryListByRef( - valList, - val1, - val2); + valList, val1, val2); // Restore param: val; type: refptr_vec_same_byref if (valCount && val) { @@ -844,8 +847,8 @@ size_t CEF_CALLBACK translator_test_get_ref_ptr_library_list_size( return 0; // Execute - size_t _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrLibraryListSize( - ); + size_t _retval = + CefTranslatorTestCppToC::Get(self)->GetRefPtrLibraryListSize(); // Return type: simple return _retval; @@ -872,7 +875,8 @@ int CEF_CALLBACK translator_test_set_ref_ptr_client( return _retval; } -struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_ref_ptr_client_and_return( +struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK +translator_test_set_ref_ptr_client_and_return( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -888,7 +892,7 @@ struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_r // Execute CefRefPtr _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrClientAndReturn( - CefTranslatorTestRefPtrClientCToCpp::Wrap(val)); + CefTranslatorTestRefPtrClientCToCpp::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCToCpp::Unwrap(_retval); @@ -915,7 +919,8 @@ int CEF_CALLBACK translator_test_set_child_ref_ptr_client( return _retval; } -struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_child_ref_ptr_client_and_return_parent( +struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK +translator_test_set_child_ref_ptr_client_and_return_parent( struct _cef_translator_test_t* self, struct _cef_translator_test_ref_ptr_client_child_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -931,15 +936,17 @@ struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_c // Execute CefRefPtr _retval = CefTranslatorTestCppToC::Get(self)->SetChildRefPtrClientAndReturnParent( - CefTranslatorTestRefPtrClientChildCToCpp::Wrap(val)); + CefTranslatorTestRefPtrClientChildCToCpp::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCToCpp::Unwrap(_retval); } int CEF_CALLBACK translator_test_set_ref_ptr_client_list( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_ref_ptr_client_t* const* val, int val1, + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_ref_ptr_client_t* const* val, + int val1, int val2) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -952,7 +959,7 @@ int CEF_CALLBACK translator_test_set_ref_ptr_client_list( return 0; // Translate param: val; type: refptr_vec_diff_byref_const - std::vector > valList; + std::vector> valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { CefRefPtr valVal = @@ -963,16 +970,15 @@ int CEF_CALLBACK translator_test_set_ref_ptr_client_list( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrClientList( - valList, - val1, - val2); + valList, val1, val2); // Return type: bool return _retval; } int CEF_CALLBACK translator_test_get_ref_ptr_client_list_by_ref( - struct _cef_translator_test_t* self, size_t* valCount, + struct _cef_translator_test_t* self, + size_t* valCount, struct _cef_translator_test_ref_ptr_client_t** val, struct _cef_translator_test_ref_ptr_client_t* val1, struct _cef_translator_test_ref_ptr_client_t* val2) { @@ -995,7 +1001,7 @@ int CEF_CALLBACK translator_test_get_ref_ptr_client_list_by_ref( return 0; // Translate param: val; type: refptr_vec_diff_byref - std::vector > valList; + std::vector> valList; if (valCount && *valCount > 0 && val) { for (size_t i = 0; i < *valCount; ++i) { valList.push_back(CefTranslatorTestRefPtrClientCToCpp::Wrap(val[i])); @@ -1004,8 +1010,7 @@ int CEF_CALLBACK translator_test_get_ref_ptr_client_list_by_ref( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrClientListByRef( - valList, - CefTranslatorTestRefPtrClientCToCpp::Wrap(val1), + valList, CefTranslatorTestRefPtrClientCToCpp::Wrap(val1), CefTranslatorTestRefPtrClientCToCpp::Wrap(val2)); // Restore param: val; type: refptr_vec_diff_byref @@ -1031,15 +1036,16 @@ size_t CEF_CALLBACK translator_test_get_ref_ptr_client_list_size( return 0; // Execute - size_t _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrClientListSize( - ); + size_t _retval = + CefTranslatorTestCppToC::Get(self)->GetRefPtrClientListSize(); // Return type: simple return _retval; } -struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_get_own_ptr_library( - struct _cef_translator_test_t* self, int val) { +struct _cef_translator_test_scoped_library_t* CEF_CALLBACK +translator_test_get_own_ptr_library(struct _cef_translator_test_t* self, + int val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1048,8 +1054,7 @@ struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_get_o // Execute CefOwnPtr _retval = - CefTranslatorTestCppToC::Get(self)->GetOwnPtrLibrary( - val); + CefTranslatorTestCppToC::Get(self)->GetOwnPtrLibrary(val); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval)); @@ -1076,7 +1081,8 @@ int CEF_CALLBACK translator_test_set_own_ptr_library( return _retval; } -struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_own_ptr_library_and_return( +struct _cef_translator_test_scoped_library_t* CEF_CALLBACK +translator_test_set_own_ptr_library_and_return( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1092,7 +1098,7 @@ struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_o // Execute CefOwnPtr _retval = CefTranslatorTestCppToC::Get(self)->SetOwnPtrLibraryAndReturn( - CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val)); + CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val)); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval)); @@ -1119,7 +1125,8 @@ int CEF_CALLBACK translator_test_set_child_own_ptr_library( return _retval; } -struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_child_own_ptr_library_and_return_parent( +struct _cef_translator_test_scoped_library_t* CEF_CALLBACK +translator_test_set_child_own_ptr_library_and_return_parent( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_library_child_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1135,7 +1142,7 @@ struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_c // Execute CefOwnPtr _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrLibraryAndReturnParent( - CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val)); + CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val)); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval)); @@ -1159,14 +1166,15 @@ int CEF_CALLBACK translator_test_set_own_ptr_client( CefTranslatorTestScopedClientCToCpp::Wrap(val)); // Execute - int _retval = CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient( - OWN_PASS(valPtr)); + int _retval = + CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(OWN_PASS(valPtr)); // Return type: simple return _retval; } -struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_own_ptr_client_and_return( +struct _cef_translator_test_scoped_client_t* CEF_CALLBACK +translator_test_set_own_ptr_client_and_return( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1186,7 +1194,7 @@ struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_ow // Execute CefOwnPtr _retval = CefTranslatorTestCppToC::Get(self)->SetOwnPtrClientAndReturn( - OWN_PASS(valPtr)); + OWN_PASS(valPtr)); // Return type: ownptr_diff return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval)); @@ -1217,7 +1225,8 @@ int CEF_CALLBACK translator_test_set_child_own_ptr_client( return _retval; } -struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_child_own_ptr_client_and_return_parent( +struct _cef_translator_test_scoped_client_t* CEF_CALLBACK +translator_test_set_child_own_ptr_client_and_return_parent( struct _cef_translator_test_t* self, struct _cef_translator_test_scoped_client_child_t* val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1237,7 +1246,7 @@ struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_ch // Execute CefOwnPtr _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClientAndReturnParent( - OWN_PASS(valPtr)); + OWN_PASS(valPtr)); // Return type: ownptr_diff return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval)); @@ -1286,8 +1295,10 @@ int CEF_CALLBACK translator_test_set_child_raw_ptr_library( } int CEF_CALLBACK translator_test_set_raw_ptr_library_list( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_scoped_library_t* const* val, int val1, + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_scoped_library_t* const* val, + int val1, int val2) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1300,7 +1311,7 @@ int CEF_CALLBACK translator_test_set_raw_ptr_library_list( return 0; // Translate param: val; type: rawptr_vec_same_byref_const - std::vector > valList; + std::vector> valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { CefRawPtr valVal = @@ -1311,9 +1322,7 @@ int CEF_CALLBACK translator_test_set_raw_ptr_library_list( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrLibraryList( - valList, - val1, - val2); + valList, val1, val2); // Return type: bool return _retval; @@ -1337,8 +1346,8 @@ int CEF_CALLBACK translator_test_set_raw_ptr_client( CefTranslatorTestScopedClientCToCpp::Wrap(val)); // Execute - int _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrClient( - valPtr.get()); + int _retval = + CefTranslatorTestCppToC::Get(self)->SetRawPtrClient(valPtr.get()); // Return type: simple return _retval; @@ -1362,16 +1371,18 @@ int CEF_CALLBACK translator_test_set_child_raw_ptr_client( CefTranslatorTestScopedClientChildCToCpp::Wrap(val)); // Execute - int _retval = CefTranslatorTestCppToC::Get(self)->SetChildRawPtrClient( - valPtr.get()); + int _retval = + CefTranslatorTestCppToC::Get(self)->SetChildRawPtrClient(valPtr.get()); // Return type: simple return _retval; } int CEF_CALLBACK translator_test_set_raw_ptr_client_list( - struct _cef_translator_test_t* self, size_t valCount, - struct _cef_translator_test_scoped_client_t* const* val, int val1, + struct _cef_translator_test_t* self, + size_t valCount, + struct _cef_translator_test_scoped_client_t* const* val, + int val1, int val2) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1384,7 +1395,7 @@ int CEF_CALLBACK translator_test_set_raw_ptr_client_list( return 0; // Translate param: val; type: rawptr_vec_diff_byref_const - std::vector > valList; + std::vector> valList; if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { CefRawPtr valVal = @@ -1395,9 +1406,7 @@ int CEF_CALLBACK translator_test_set_raw_ptr_client_list( // Execute bool _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrClientList( - valList, - val1, - val2); + valList, val1, val2); // Restore param: val; type: rawptr_vec_diff_byref_const if (valCount > 0) { @@ -1412,7 +1421,6 @@ int CEF_CALLBACK translator_test_set_raw_ptr_client_list( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestCppToC::CefTranslatorTestCppToC() { @@ -1501,18 +1509,25 @@ CefTranslatorTestCppToC::CefTranslatorTestCppToC() { translator_test_set_raw_ptr_client_list; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_translator_test_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefTranslatorTestCppToC, + CefTranslatorTest, + cef_translator_test_t>::UnwrapDerived(CefWrapperType type, + cef_translator_test_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TRANSLATOR_TEST; diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_cpptoc.h index 1f6f4c095..524751372 100644 --- a/libcef_dll/cpptoc/test/translator_test_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=463e1b14cb01fd52e1b20e3fcb3d9e055c90ff93$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefTranslatorTestCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc index 68e748e88..7b578df60 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2d4f7b4eba0e67faa616e91a591872d7ca5c9902$ +// #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -26,8 +27,8 @@ int CEF_CALLBACK translator_test_ref_ptr_client_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrClientChildCppToC::Get( - self)->GetOtherValue(); + int _retval = + CefTranslatorTestRefPtrClientChildCppToC::Get(self)->GetOtherValue(); // Return type: simple return _retval; @@ -42,9 +43,10 @@ int CEF_CALLBACK translator_test_ref_ptr_client_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrClientChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestRefPtrClientChildCppToC::Get( + reinterpret_cast(self)) + ->GetValue(); // Return type: simple return _retval; @@ -52,31 +54,37 @@ int CEF_CALLBACK translator_test_ref_ptr_client_child_get_value( } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrClientChildCppToC::CefTranslatorTestRefPtrClientChildCppToC( - ) { +CefTranslatorTestRefPtrClientChildCppToC:: + CefTranslatorTestRefPtrClientChildCppToC() { GetStruct()->get_other_value = translator_test_ref_ptr_client_child_get_other_value; GetStruct()->base.get_value = translator_test_ref_ptr_client_child_get_value; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_translator_test_ref_ptr_client_child_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_translator_test_ref_ptr_client_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted +base::AtomicRefCount CefCppToCRefCounted< + CefTranslatorTestRefPtrClientChildCppToC, CefTranslatorTestRefPtrClientChild, cef_translator_test_ref_ptr_client_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted +CefWrapperType CefCppToCRefCounted< + CefTranslatorTestRefPtrClientChildCppToC, CefTranslatorTestRefPtrClientChild, cef_translator_test_ref_ptr_client_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h index 510e27249..03bc315dd 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=26f33d930fc831a3a87a4bb5e176d6f68d543557$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestRefPtrClientChildCppToC : public CefCppToCRefCounted { + CefTranslatorTestRefPtrClientChild, + cef_translator_test_ref_ptr_client_child_t> { public: CefTranslatorTestRefPtrClientChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc index 6982bf1bc..7c611e8e3 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b04a2cadf7325090a53b435cf777173216802ec1$ +// -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" namespace { @@ -35,17 +36,19 @@ int CEF_CALLBACK translator_test_ref_ptr_client_get_value( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestRefPtrClientCppToC::CefTranslatorTestRefPtrClientCppToC() { GetStruct()->get_value = translator_test_ref_ptr_client_get_value; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_translator_test_ref_ptr_client_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_translator_test_ref_ptr_client_t* s) { if (type == WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD) { return CefTranslatorTestRefPtrClientChildCppToC::Unwrap( reinterpret_cast(s)); @@ -55,12 +58,16 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_TRANSLATOR_TEST_REF_PTR_CLIENT; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_TRANSLATOR_TEST_REF_PTR_CLIENT; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h index 906b62049..b2f0e3e71 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ba8f806e20f52adb5558d5f84e590e94e32a1dfd$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestRefPtrClientCppToC : public CefCppToCRefCounted { + CefTranslatorTestRefPtrClient, + cef_translator_test_ref_ptr_client_t> { public: CefTranslatorTestRefPtrClientCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc index a86357ab0..40bf9b6e3 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc @@ -9,33 +9,34 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c56ee9df7fe88c830a7e0280908e1c56d450c974$ +// #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create( - int value, int other_value, int other_other_value) { +CEF_EXPORT cef_translator_test_ref_ptr_library_child_child_t* +cef_translator_test_ref_ptr_library_child_child_create(int value, + int other_value, + int other_other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefRefPtr _retval = - CefTranslatorTestRefPtrLibraryChildChild::Create( - value, - other_value, - other_other_value); + CefTranslatorTestRefPtrLibraryChildChild::Create(value, other_value, + other_other_value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryChildChildCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_other_other_value( +int CEF_CALLBACK +translator_test_ref_ptr_library_child_child_get_other_other_value( struct _cef_translator_test_ref_ptr_library_child_child_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -44,14 +45,15 @@ int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_other_other_val return 0; // Execute - int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( - self)->GetOtherOtherValue(); + int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(self) + ->GetOtherOtherValue(); // Return type: simple return _retval; } -void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_other_other_value( +void CEF_CALLBACK +translator_test_ref_ptr_library_child_child_set_other_other_value( struct _cef_translator_test_ref_ptr_library_child_child_t* self, int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -74,16 +76,19 @@ int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->GetOtherValue(); + int _retval = + CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( + reinterpret_cast( + self)) + ->GetOtherValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_other_value( - struct _cef_translator_test_ref_ptr_library_child_t* self, int value) { + struct _cef_translator_test_ref_ptr_library_child_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +98,8 @@ void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_other_value( // Execute CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( reinterpret_cast( - self))->SetOtherValue( - value); + self)) + ->SetOtherValue(value); } int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_value( @@ -106,16 +111,19 @@ int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( + reinterpret_cast( + self)) + ->GetValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_value( - struct _cef_translator_test_ref_ptr_library_t* self, int value) { + struct _cef_translator_test_ref_ptr_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -125,17 +133,16 @@ void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_value( // Execute CefTranslatorTestRefPtrLibraryChildChildCppToC::Get( reinterpret_cast( - self))->SetValue( - value); + self)) + ->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrLibraryChildChildCppToC::CefTranslatorTestRefPtrLibraryChildChildCppToC( - ) { +CefTranslatorTestRefPtrLibraryChildChildCppToC:: + CefTranslatorTestRefPtrLibraryChildChildCppToC() { GetStruct()->get_other_other_value = translator_test_ref_ptr_library_child_child_get_other_other_value; GetStruct()->set_other_other_value = @@ -150,22 +157,28 @@ CefTranslatorTestRefPtrLibraryChildChildCppToC::CefTranslatorTestRefPtrLibraryCh translator_test_ref_ptr_library_child_child_set_value; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, - cef_translator_test_ref_ptr_library_child_child_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_translator_test_ref_ptr_library_child_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted +base::AtomicRefCount CefCppToCRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCppToC, CefTranslatorTestRefPtrLibraryChildChild, cef_translator_test_ref_ptr_library_child_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted +CefWrapperType CefCppToCRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCppToC, CefTranslatorTestRefPtrLibraryChildChild, cef_translator_test_ref_ptr_library_child_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h index ed1e1cb39..3802793db 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9c39bcebe88be5d6292c396812567cd786f85d29$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_ @@ -18,16 +20,17 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestRefPtrLibraryChildChildCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCppToC, + CefTranslatorTestRefPtrLibraryChildChild, + cef_translator_test_ref_ptr_library_child_child_t> { public: CefTranslatorTestRefPtrLibraryChildChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc index c226081cc..74b24f4fd 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc @@ -9,28 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ddb7af27ed3901230f51b510f706e1c38e9c18b5$ +// -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create( - int value, int other_value) { +CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* +cef_translator_test_ref_ptr_library_child_create(int value, int other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefRefPtr _retval = - CefTranslatorTestRefPtrLibraryChild::Create( - value, - other_value); + CefTranslatorTestRefPtrLibraryChild::Create(value, other_value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryChildCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -44,15 +42,16 @@ int CEF_CALLBACK translator_test_ref_ptr_library_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrLibraryChildCppToC::Get( - self)->GetOtherValue(); + int _retval = + CefTranslatorTestRefPtrLibraryChildCppToC::Get(self)->GetOtherValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_ref_ptr_library_child_set_other_value( - struct _cef_translator_test_ref_ptr_library_child_t* self, int value) { + struct _cef_translator_test_ref_ptr_library_child_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,8 +59,7 @@ void CEF_CALLBACK translator_test_ref_ptr_library_child_set_other_value( return; // Execute - CefTranslatorTestRefPtrLibraryChildCppToC::Get(self)->SetOtherValue( - value); + CefTranslatorTestRefPtrLibraryChildCppToC::Get(self)->SetOtherValue(value); } int CEF_CALLBACK translator_test_ref_ptr_library_child_get_value( @@ -73,16 +71,18 @@ int CEF_CALLBACK translator_test_ref_ptr_library_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestRefPtrLibraryChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestRefPtrLibraryChildCppToC::Get( + reinterpret_cast(self)) + ->GetValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_ref_ptr_library_child_set_value( - struct _cef_translator_test_ref_ptr_library_t* self, int value) { + struct _cef_translator_test_ref_ptr_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -91,18 +91,16 @@ void CEF_CALLBACK translator_test_ref_ptr_library_child_set_value( // Execute CefTranslatorTestRefPtrLibraryChildCppToC::Get( - reinterpret_cast( - self))->SetValue( - value); + reinterpret_cast(self)) + ->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrLibraryChildCppToC::CefTranslatorTestRefPtrLibraryChildCppToC( - ) { +CefTranslatorTestRefPtrLibraryChildCppToC:: + CefTranslatorTestRefPtrLibraryChildCppToC() { GetStruct()->get_other_value = translator_test_ref_ptr_library_child_get_other_value; GetStruct()->set_other_value = @@ -111,26 +109,33 @@ CefTranslatorTestRefPtrLibraryChildCppToC::CefTranslatorTestRefPtrLibraryChildCp GetStruct()->base.set_value = translator_test_ref_ptr_library_child_set_value; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_translator_test_ref_ptr_library_child_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_translator_test_ref_ptr_library_child_t* s) { if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) { return CefTranslatorTestRefPtrLibraryChildChildCppToC::Unwrap( reinterpret_cast( - s)); + s)); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted +base::AtomicRefCount CefCppToCRefCounted< + CefTranslatorTestRefPtrLibraryChildCppToC, CefTranslatorTestRefPtrLibraryChild, cef_translator_test_ref_ptr_library_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted +CefWrapperType CefCppToCRefCounted< + CefTranslatorTestRefPtrLibraryChildCppToC, CefTranslatorTestRefPtrLibraryChild, cef_translator_test_ref_ptr_library_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h index 33e3cab95..57ce8b7fe 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ab2e5c419d32dd5486971cb81421af85d26301d9$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestRefPtrLibraryChildCppToC : public CefCppToCRefCounted { + CefTranslatorTestRefPtrLibraryChild, + cef_translator_test_ref_ptr_library_child_t> { public: CefTranslatorTestRefPtrLibraryChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc index 62274e04c..e5ff47b81 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc @@ -9,28 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4d312527991e076c9fceef16ba645c103b074d80$ +// -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create( - int value) { +CEF_EXPORT cef_translator_test_ref_ptr_library_t* +cef_translator_test_ref_ptr_library_create(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefRefPtr _retval = - CefTranslatorTestRefPtrLibrary::Create( - value); + CefTranslatorTestRefPtrLibrary::Create(value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -51,7 +50,8 @@ int CEF_CALLBACK translator_test_ref_ptr_library_get_value( } void CEF_CALLBACK translator_test_ref_ptr_library_set_value( - struct _cef_translator_test_ref_ptr_library_t* self, int value) { + struct _cef_translator_test_ref_ptr_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -59,13 +59,11 @@ void CEF_CALLBACK translator_test_ref_ptr_library_set_value( return; // Execute - CefTranslatorTestRefPtrLibraryCppToC::Get(self)->SetValue( - value); + CefTranslatorTestRefPtrLibraryCppToC::Get(self)->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestRefPtrLibraryCppToC::CefTranslatorTestRefPtrLibraryCppToC() { @@ -73,10 +71,13 @@ CefTranslatorTestRefPtrLibraryCppToC::CefTranslatorTestRefPtrLibraryCppToC() { GetStruct()->set_value = translator_test_ref_ptr_library_set_value; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_translator_test_ref_ptr_library_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, + cef_translator_test_ref_ptr_library_t* s) { if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) { return CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap( reinterpret_cast(s)); @@ -84,19 +85,23 @@ template<> CefRefPtr CefCppToCRefCounted( - s)); + s)); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_TRANSLATOR_TEST_REF_PTR_LIBRARY; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_TRANSLATOR_TEST_REF_PTR_LIBRARY; diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h index e3a7e3478..973c8b719 100644 --- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ae5e7ee72f250a7b8445f6a190c4df782bb9293a$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestRefPtrLibraryCppToC : public CefCppToCRefCounted { + CefTranslatorTestRefPtrLibrary, + cef_translator_test_ref_ptr_library_t> { public: CefTranslatorTestRefPtrLibraryCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc index 255a08b51..62c5a7d11 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=34501f81cbf83f221b8a0ce0a4ccdc68e5aa1450$ +// #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -26,8 +27,8 @@ int CEF_CALLBACK translator_test_scoped_client_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestScopedClientChildCppToC::Get( - self)->GetOtherValue(); + int _retval = + CefTranslatorTestScopedClientChildCppToC::Get(self)->GetOtherValue(); // Return type: simple return _retval; @@ -42,9 +43,10 @@ int CEF_CALLBACK translator_test_scoped_client_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestScopedClientChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestScopedClientChildCppToC::Get( + reinterpret_cast(self)) + ->GetValue(); // Return type: simple return _retval; @@ -52,39 +54,48 @@ int CEF_CALLBACK translator_test_scoped_client_child_get_value( } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedClientChildCppToC::CefTranslatorTestScopedClientChildCppToC( - ) { +CefTranslatorTestScopedClientChildCppToC:: + CefTranslatorTestScopedClientChildCppToC() { GetStruct()->get_other_value = translator_test_scoped_client_child_get_other_value; GetStruct()->base.get_value = translator_test_scoped_client_child_get_value; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn( - CefWrapperType type, cef_translator_test_scoped_client_child_t* s) { +template <> +CefOwnPtr +CefCppToCScoped:: + UnwrapDerivedOwn(CefWrapperType type, + cef_translator_test_scoped_client_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw( - CefWrapperType type, cef_translator_test_scoped_client_child_t* s) { +template <> +CefRawPtr +CefCppToCScoped:: + UnwrapDerivedRaw(CefWrapperType type, + cef_translator_test_scoped_client_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD; +template <> +CefWrapperType + CefCppToCScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h index 87a73ba79..31b5df473 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2cc37369b97dcd34cc0e1a0574526230a5a6ab39$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestScopedClientChildCppToC : public CefCppToCScoped { + CefTranslatorTestScopedClientChild, + cef_translator_test_scoped_client_child_t> { public: CefTranslatorTestScopedClientChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc index c34f9ff12..03542363b 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=92dd8bbaed61f94cb42dd4eddcd5345b0d619dc7$ +// -#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" namespace { @@ -35,30 +36,36 @@ int CEF_CALLBACK translator_test_scoped_client_get_value( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestScopedClientCppToC::CefTranslatorTestScopedClientCppToC() { GetStruct()->get_value = translator_test_scoped_client_get_value; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn(CefWrapperType type, - cef_translator_test_scoped_client_t* s) { +template <> +CefOwnPtr +CefCppToCScoped:: + UnwrapDerivedOwn(CefWrapperType type, + cef_translator_test_scoped_client_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) { - return OWN_RETURN_AS(CefTranslatorTestScopedClientChildCppToC::UnwrapOwn( - reinterpret_cast(s)), + return OWN_RETURN_AS( + CefTranslatorTestScopedClientChildCppToC::UnwrapOwn( + reinterpret_cast(s)), CefTranslatorTestScopedClient); } NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw(CefWrapperType type, - cef_translator_test_scoped_client_t* s) { +template <> +CefRawPtr +CefCppToCScoped:: + UnwrapDerivedRaw(CefWrapperType type, + cef_translator_test_scoped_client_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) { return CefTranslatorTestScopedClientChildCppToC::UnwrapRaw( reinterpret_cast(s)); @@ -68,12 +75,16 @@ template<> CefRawPtr CefCppToCScoped base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_CLIENT; +template <> +CefWrapperType + CefCppToCScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_CLIENT; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h index be91cd6eb..69137915c 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2ba29232c78f44ec672d78ced0edde92ee87c6af$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestScopedClientCppToC : public CefCppToCScoped { + CefTranslatorTestScopedClient, + cef_translator_test_scoped_client_t> { public: CefTranslatorTestScopedClientCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc index 5e9f7e1d2..0ccb09749 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc @@ -9,34 +9,35 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5c83a33a42a843767e80850f18908237db7754ce$ +// #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create( - int value, int other_value, int other_other_value) { +CEF_EXPORT cef_translator_test_scoped_library_child_child_t* +cef_translator_test_scoped_library_child_child_create(int value, + int other_value, + int other_other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefOwnPtr _retval = - CefTranslatorTestScopedLibraryChildChild::Create( - value, - other_value, - other_other_value); + CefTranslatorTestScopedLibraryChildChild::Create(value, other_value, + other_other_value); // Return type: ownptr_same - return CefTranslatorTestScopedLibraryChildChildCppToC::WrapOwn(OWN_PASS( - _retval)); + return CefTranslatorTestScopedLibraryChildChildCppToC::WrapOwn( + OWN_PASS(_retval)); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK translator_test_scoped_library_child_child_get_other_other_value( +int CEF_CALLBACK +translator_test_scoped_library_child_child_get_other_other_value( struct _cef_translator_test_scoped_library_child_child_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,14 +46,15 @@ int CEF_CALLBACK translator_test_scoped_library_child_child_get_other_other_valu return 0; // Execute - int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get( - self)->GetOtherOtherValue(); + int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get(self) + ->GetOtherOtherValue(); // Return type: simple return _retval; } -void CEF_CALLBACK translator_test_scoped_library_child_child_set_other_other_value( +void CEF_CALLBACK +translator_test_scoped_library_child_child_set_other_other_value( struct _cef_translator_test_scoped_library_child_child_t* self, int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -75,16 +77,19 @@ int CEF_CALLBACK translator_test_scoped_library_child_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->GetOtherValue(); + int _retval = + CefTranslatorTestScopedLibraryChildChildCppToC::Get( + reinterpret_cast( + self)) + ->GetOtherValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_scoped_library_child_child_set_other_value( - struct _cef_translator_test_scoped_library_child_t* self, int value) { + struct _cef_translator_test_scoped_library_child_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,9 +98,8 @@ void CEF_CALLBACK translator_test_scoped_library_child_child_set_other_value( // Execute CefTranslatorTestScopedLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->SetOtherValue( - value); + reinterpret_cast(self)) + ->SetOtherValue(value); } int CEF_CALLBACK translator_test_scoped_library_child_child_get_value( @@ -107,16 +111,19 @@ int CEF_CALLBACK translator_test_scoped_library_child_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestScopedLibraryChildChildCppToC::Get( + reinterpret_cast( + self)) + ->GetValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_scoped_library_child_child_set_value( - struct _cef_translator_test_scoped_library_t* self, int value) { + struct _cef_translator_test_scoped_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -125,18 +132,16 @@ void CEF_CALLBACK translator_test_scoped_library_child_child_set_value( // Execute CefTranslatorTestScopedLibraryChildChildCppToC::Get( - reinterpret_cast( - self))->SetValue( - value); + reinterpret_cast(self)) + ->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedLibraryChildChildCppToC::CefTranslatorTestScopedLibraryChildChildCppToC( - ) { +CefTranslatorTestScopedLibraryChildChildCppToC:: + CefTranslatorTestScopedLibraryChildChildCppToC() { GetStruct()->get_other_other_value = translator_test_scoped_library_child_child_get_other_other_value; GetStruct()->set_other_other_value = @@ -151,29 +156,39 @@ CefTranslatorTestScopedLibraryChildChildCppToC::CefTranslatorTestScopedLibraryCh translator_test_scoped_library_child_child_set_value; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn( - CefWrapperType type, cef_translator_test_scoped_library_child_child_t* s) { +template <> +CefOwnPtr +CefCppToCScoped:: + UnwrapDerivedOwn(CefWrapperType type, + cef_translator_test_scoped_library_child_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw( - CefWrapperType type, cef_translator_test_scoped_library_child_child_t* s) { +template <> +CefRawPtr +CefCppToCScoped:: + UnwrapDerivedRaw(CefWrapperType type, + cef_translator_test_scoped_library_child_child_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped +base::AtomicRefCount CefCppToCScoped< + CefTranslatorTestScopedLibraryChildChildCppToC, CefTranslatorTestScopedLibraryChildChild, cef_translator_test_scoped_library_child_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped +CefWrapperType CefCppToCScoped< + CefTranslatorTestScopedLibraryChildChildCppToC, CefTranslatorTestScopedLibraryChildChild, cef_translator_test_scoped_library_child_child_t>::kWrapperType = WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h index d0d2ed71c..ee65c3ec1 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d7909de22aa6b29cea2cc8accfbb0dec9b21d821$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestScopedLibraryChildChildCppToC : public CefCppToCScoped { + CefTranslatorTestScopedLibraryChildChild, + cef_translator_test_scoped_library_child_child_t> { public: CefTranslatorTestScopedLibraryChildChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc index 13195b90c..9c91f4aec 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc @@ -9,28 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=40623df7ec62d989294f7c575e50bc3cd78285d7$ +// -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create( - int value, int other_value) { +CEF_EXPORT cef_translator_test_scoped_library_child_t* +cef_translator_test_scoped_library_child_create(int value, int other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefOwnPtr _retval = - CefTranslatorTestScopedLibraryChild::Create( - value, - other_value); + CefTranslatorTestScopedLibraryChild::Create(value, other_value); // Return type: ownptr_same return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(OWN_PASS(_retval)); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -44,15 +42,16 @@ int CEF_CALLBACK translator_test_scoped_library_child_get_other_value( return 0; // Execute - int _retval = CefTranslatorTestScopedLibraryChildCppToC::Get( - self)->GetOtherValue(); + int _retval = + CefTranslatorTestScopedLibraryChildCppToC::Get(self)->GetOtherValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_scoped_library_child_set_other_value( - struct _cef_translator_test_scoped_library_child_t* self, int value) { + struct _cef_translator_test_scoped_library_child_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,8 +59,7 @@ void CEF_CALLBACK translator_test_scoped_library_child_set_other_value( return; // Execute - CefTranslatorTestScopedLibraryChildCppToC::Get(self)->SetOtherValue( - value); + CefTranslatorTestScopedLibraryChildCppToC::Get(self)->SetOtherValue(value); } int CEF_CALLBACK translator_test_scoped_library_child_get_value( @@ -73,16 +71,18 @@ int CEF_CALLBACK translator_test_scoped_library_child_get_value( return 0; // Execute - int _retval = CefTranslatorTestScopedLibraryChildCppToC::Get( - reinterpret_cast( - self))->GetValue(); + int _retval = + CefTranslatorTestScopedLibraryChildCppToC::Get( + reinterpret_cast(self)) + ->GetValue(); // Return type: simple return _retval; } void CEF_CALLBACK translator_test_scoped_library_child_set_value( - struct _cef_translator_test_scoped_library_t* self, int value) { + struct _cef_translator_test_scoped_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -91,18 +91,16 @@ void CEF_CALLBACK translator_test_scoped_library_child_set_value( // Execute CefTranslatorTestScopedLibraryChildCppToC::Get( - reinterpret_cast( - self))->SetValue( - value); + reinterpret_cast(self)) + ->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedLibraryChildCppToC::CefTranslatorTestScopedLibraryChildCppToC( - ) { +CefTranslatorTestScopedLibraryChildCppToC:: + CefTranslatorTestScopedLibraryChildCppToC() { GetStruct()->get_other_value = translator_test_scoped_library_child_get_other_value; GetStruct()->set_other_value = @@ -111,40 +109,50 @@ CefTranslatorTestScopedLibraryChildCppToC::CefTranslatorTestScopedLibraryChildCp GetStruct()->base.set_value = translator_test_scoped_library_child_set_value; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn( - CefWrapperType type, cef_translator_test_scoped_library_child_t* s) { +template <> +CefOwnPtr +CefCppToCScoped:: + UnwrapDerivedOwn(CefWrapperType type, + cef_translator_test_scoped_library_child_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return OWN_RETURN_AS( CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn( - reinterpret_cast(s)), + reinterpret_cast( + s)), CefTranslatorTestScopedLibraryChild); } NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw( - CefWrapperType type, cef_translator_test_scoped_library_child_t* s) { +template <> +CefRawPtr +CefCppToCScoped:: + UnwrapDerivedRaw(CefWrapperType type, + cef_translator_test_scoped_library_child_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw( - reinterpret_cast( - s)); + reinterpret_cast(s)); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD; +template <> +CefWrapperType + CefCppToCScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h index 63a83d881..ce9c14394 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6d426e05965adc35312b0232862373d07804464d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestScopedLibraryChildCppToC : public CefCppToCScoped { + CefTranslatorTestScopedLibraryChild, + cef_translator_test_scoped_library_child_t> { public: CefTranslatorTestScopedLibraryChildCppToC(); }; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc index 6864677af..4ff2185ba 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc @@ -9,28 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=33161851f6d712f15b49b70bb0fc0f06afda83bc$ +// -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h" - +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create( - int value) { +CEF_EXPORT cef_translator_test_scoped_library_t* +cef_translator_test_scoped_library_create(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefOwnPtr _retval = - CefTranslatorTestScopedLibrary::Create( - value); + CefTranslatorTestScopedLibrary::Create(value); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval)); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -51,7 +50,8 @@ int CEF_CALLBACK translator_test_scoped_library_get_value( } void CEF_CALLBACK translator_test_scoped_library_set_value( - struct _cef_translator_test_scoped_library_t* self, int value) { + struct _cef_translator_test_scoped_library_t* self, + int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -59,13 +59,11 @@ void CEF_CALLBACK translator_test_scoped_library_set_value( return; // Execute - CefTranslatorTestScopedLibraryCppToC::Get(self)->SetValue( - value); + CefTranslatorTestScopedLibraryCppToC::Get(self)->SetValue(value); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestScopedLibraryCppToC::CefTranslatorTestScopedLibraryCppToC() { @@ -73,49 +71,60 @@ CefTranslatorTestScopedLibraryCppToC::CefTranslatorTestScopedLibraryCppToC() { GetStruct()->set_value = translator_test_scoped_library_set_value; } -template<> CefOwnPtr CefCppToCScoped::UnwrapDerivedOwn( - CefWrapperType type, cef_translator_test_scoped_library_t* s) { +template <> +CefOwnPtr +CefCppToCScoped:: + UnwrapDerivedOwn(CefWrapperType type, + cef_translator_test_scoped_library_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) { - return OWN_RETURN_AS(CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn( - reinterpret_cast(s)), + return OWN_RETURN_AS( + CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn( + reinterpret_cast(s)), CefTranslatorTestScopedLibrary); } if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return OWN_RETURN_AS( CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn( - reinterpret_cast(s)), + reinterpret_cast( + s)), CefTranslatorTestScopedLibrary); } NOTREACHED() << "Unexpected class type: " << type; return CefOwnPtr(); } -template<> CefRawPtr CefCppToCScoped::UnwrapDerivedRaw( - CefWrapperType type, cef_translator_test_scoped_library_t* s) { +template <> +CefRawPtr +CefCppToCScoped:: + UnwrapDerivedRaw(CefWrapperType type, + cef_translator_test_scoped_library_t* s) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) { return CefTranslatorTestScopedLibraryChildCppToC::UnwrapRaw( reinterpret_cast(s)); } if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw( - reinterpret_cast( - s)); + reinterpret_cast(s)); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_LIBRARY; +template <> +CefWrapperType + CefCppToCScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_LIBRARY; diff --git a/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h index 4b023f7fe..3592043ff 100644 --- a/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h +++ b/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=94a390a96a5901df76395e3e279603a6c27d0e28$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/cpptoc/cpptoc_scoped.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestScopedLibraryCppToC : public CefCppToCScoped { + CefTranslatorTestScopedLibrary, + cef_translator_test_scoped_library_t> { public: CefTranslatorTestScopedLibraryCppToC(); }; diff --git a/libcef_dll/cpptoc/thread_cpptoc.cc b/libcef_dll/cpptoc/thread_cpptoc.cc index 3bc39d242..4a03634e8 100644 --- a/libcef_dll/cpptoc/thread_cpptoc.cc +++ b/libcef_dll/cpptoc/thread_cpptoc.cc @@ -9,39 +9,39 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f1b350a92e8fe8cd6d8b81d807e0da11691b3167$ +// #include "libcef_dll/cpptoc/task_runner_cpptoc.h" #include "libcef_dll/cpptoc/thread_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_thread_t* cef_thread_create(const cef_string_t* display_name, - cef_thread_priority_t priority, cef_message_loop_type_t message_loop_type, - int stoppable, cef_com_init_mode_t com_init_mode) { +CEF_EXPORT cef_thread_t* cef_thread_create( + const cef_string_t* display_name, + cef_thread_priority_t priority, + cef_message_loop_type_t message_loop_type, + int stoppable, + cef_com_init_mode_t com_init_mode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: display_name // Execute CefRefPtr _retval = CefThread::CreateThread( - CefString(display_name), - priority, - message_loop_type, - stoppable?true:false, - com_init_mode); + CefString(display_name), priority, message_loop_type, + stoppable ? true : false, com_init_mode); // Return type: refptr_same return CefThreadCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_task_runner_t* CEF_CALLBACK thread_get_task_runner( - struct _cef_thread_t* self) { +cef_task_runner_t* CEF_CALLBACK +thread_get_task_runner(struct _cef_thread_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,15 +49,15 @@ cef_task_runner_t* CEF_CALLBACK thread_get_task_runner( return NULL; // Execute - CefRefPtr _retval = CefThreadCppToC::Get(self)->GetTaskRunner( - ); + CefRefPtr _retval = + CefThreadCppToC::Get(self)->GetTaskRunner(); // Return type: refptr_same return CefTaskRunnerCppToC::Wrap(_retval); } -cef_platform_thread_id_t CEF_CALLBACK thread_get_platform_thread_id( - struct _cef_thread_t* self) { +cef_platform_thread_id_t CEF_CALLBACK +thread_get_platform_thread_id(struct _cef_thread_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -65,8 +65,8 @@ cef_platform_thread_id_t CEF_CALLBACK thread_get_platform_thread_id( return kInvalidPlatformThreadId; // Execute - cef_platform_thread_id_t _retval = CefThreadCppToC::Get( - self)->GetPlatformThreadId(); + cef_platform_thread_id_t _retval = + CefThreadCppToC::Get(self)->GetPlatformThreadId(); // Return type: simple return _retval; @@ -99,7 +99,6 @@ int CEF_CALLBACK thread_is_running(struct _cef_thread_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefThreadCppToC::CefThreadCppToC() { @@ -109,16 +108,22 @@ CefThreadCppToC::CefThreadCppToC() { GetStruct()->is_running = thread_is_running; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_thread_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_thread_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_THREAD; +template <> +CefWrapperType CefCppToCRefCounted:: + kWrapperType = WT_THREAD; diff --git a/libcef_dll/cpptoc/thread_cpptoc.h b/libcef_dll/cpptoc/thread_cpptoc.h index 5ab89ba90..5bb5d3cf8 100644 --- a/libcef_dll/cpptoc/thread_cpptoc.h +++ b/libcef_dll/cpptoc/thread_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e114f96964be05fee175e5ab51b4bcf5c3d8bc4b$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_THREAD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_THREAD_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_thread.h" #include "include/capi/cef_thread_capi.h" +#include "include/cef_thread.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc index 0b9122b31..a5a45a898 100644 --- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc +++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3e172d59ae9f9743527b0bce8c29dc7e14c48033$ +// #include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" #include "libcef_dll/ctocpp/auth_callback_ctocpp.h" #include "libcef_dll/ctocpp/urlrequest_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK urlrequest_client_on_request_complete( - struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request) { +void CEF_CALLBACK +urlrequest_client_on_request_complete(struct _cef_urlrequest_client_t* self, + cef_urlrequest_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -36,9 +38,11 @@ void CEF_CALLBACK urlrequest_client_on_request_complete( CefURLRequestCToCpp::Wrap(request)); } -void CEF_CALLBACK urlrequest_client_on_upload_progress( - struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, - int64 current, int64 total) { +void CEF_CALLBACK +urlrequest_client_on_upload_progress(struct _cef_urlrequest_client_t* self, + cef_urlrequest_t* request, + int64 current, + int64 total) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,14 +55,14 @@ void CEF_CALLBACK urlrequest_client_on_upload_progress( // Execute CefURLRequestClientCppToC::Get(self)->OnUploadProgress( - CefURLRequestCToCpp::Wrap(request), - current, - total); + CefURLRequestCToCpp::Wrap(request), current, total); } -void CEF_CALLBACK urlrequest_client_on_download_progress( - struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, - int64 current, int64 total) { +void CEF_CALLBACK +urlrequest_client_on_download_progress(struct _cef_urlrequest_client_t* self, + cef_urlrequest_t* request, + int64 current, + int64 total) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -71,14 +75,14 @@ void CEF_CALLBACK urlrequest_client_on_download_progress( // Execute CefURLRequestClientCppToC::Get(self)->OnDownloadProgress( - CefURLRequestCToCpp::Wrap(request), - current, - total); + CefURLRequestCToCpp::Wrap(request), current, total); } -void CEF_CALLBACK urlrequest_client_on_download_data( - struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, - const void* data, size_t data_length) { +void CEF_CALLBACK +urlrequest_client_on_download_data(struct _cef_urlrequest_client_t* self, + cef_urlrequest_t* request, + const void* data, + size_t data_length) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,15 +99,17 @@ void CEF_CALLBACK urlrequest_client_on_download_data( // Execute CefURLRequestClientCppToC::Get(self)->OnDownloadData( - CefURLRequestCToCpp::Wrap(request), - data, - data_length); + CefURLRequestCToCpp::Wrap(request), data, data_length); } -int CEF_CALLBACK urlrequest_client_get_auth_credentials( - struct _cef_urlrequest_client_t* self, int isProxy, - const cef_string_t* host, int port, const cef_string_t* realm, - const cef_string_t* scheme, cef_auth_callback_t* callback) { +int CEF_CALLBACK +urlrequest_client_get_auth_credentials(struct _cef_urlrequest_client_t* self, + int isProxy, + const cef_string_t* host, + int port, + const cef_string_t* realm, + const cef_string_t* scheme, + cef_auth_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -125,12 +131,8 @@ int CEF_CALLBACK urlrequest_client_get_auth_credentials( // Execute bool _retval = CefURLRequestClientCppToC::Get(self)->GetAuthCredentials( - isProxy?true:false, - CefString(host), - port, - CefString(realm), - CefString(scheme), - CefAuthCallbackCToCpp::Wrap(callback)); + isProxy ? true : false, CefString(host), port, CefString(realm), + CefString(scheme), CefAuthCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; @@ -138,7 +140,6 @@ int CEF_CALLBACK urlrequest_client_get_auth_credentials( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefURLRequestClientCppToC::CefURLRequestClientCppToC() { @@ -149,18 +150,26 @@ CefURLRequestClientCppToC::CefURLRequestClientCppToC() { GetStruct()->get_auth_credentials = urlrequest_client_get_auth_credentials; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_urlrequest_client_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefURLRequestClientCppToC, + CefURLRequestClient, + cef_urlrequest_client_t>::UnwrapDerived(CefWrapperType type, + cef_urlrequest_client_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_URLREQUEST_CLIENT; diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h index 9949caedb..e43601119 100644 --- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h +++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=492d538a7a457a7191828c935e4b972dc5ce2c6f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_urlrequest.h" #include "include/capi/cef_urlrequest_capi.h" +#include "include/cef_urlrequest.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefURLRequestClientCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefURLRequestClientCppToC(); }; diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_cpptoc.cc index 38064333c..30e6588a6 100644 --- a/libcef_dll/cpptoc/urlrequest_cpptoc.cc +++ b/libcef_dll/cpptoc/urlrequest_cpptoc.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9bdfd72adaed935c73827e45dfd62af8457fe73f$ +// -#include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/cpptoc/request_context_cpptoc.h" +#include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/cpptoc/response_cpptoc.h" #include "libcef_dll/cpptoc/urlrequest_cpptoc.h" #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create(cef_request_t* request, +CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create( + cef_request_t* request, struct _cef_urlrequest_client_t* client, cef_request_context_t* request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -35,22 +37,21 @@ CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create(cef_request_t* request, // Unverified params: request_context // Execute - CefRefPtr _retval = CefURLRequest::Create( - CefRequestCppToC::Unwrap(request), - CefURLRequestClientCToCpp::Wrap(client), - CefRequestContextCppToC::Unwrap(request_context)); + CefRefPtr _retval = + CefURLRequest::Create(CefRequestCppToC::Unwrap(request), + CefURLRequestClientCToCpp::Wrap(client), + CefRequestContextCppToC::Unwrap(request_context)); // Return type: refptr_same return CefURLRequestCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_request_t* CEF_CALLBACK urlrequest_get_request( - struct _cef_urlrequest_t* self) { +cef_request_t* CEF_CALLBACK +urlrequest_get_request(struct _cef_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +65,8 @@ cef_request_t* CEF_CALLBACK urlrequest_get_request( return CefRequestCppToC::Wrap(_retval); } -struct _cef_urlrequest_client_t* CEF_CALLBACK urlrequest_get_client( - struct _cef_urlrequest_t* self) { +struct _cef_urlrequest_client_t* CEF_CALLBACK +urlrequest_get_client(struct _cef_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -73,15 +74,15 @@ struct _cef_urlrequest_client_t* CEF_CALLBACK urlrequest_get_client( return NULL; // Execute - CefRefPtr _retval = CefURLRequestCppToC::Get( - self)->GetClient(); + CefRefPtr _retval = + CefURLRequestCppToC::Get(self)->GetClient(); // Return type: refptr_diff return CefURLRequestClientCToCpp::Unwrap(_retval); } -cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status( - struct _cef_urlrequest_t* self) { +cef_urlrequest_status_t CEF_CALLBACK +urlrequest_get_request_status(struct _cef_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -89,15 +90,15 @@ cef_urlrequest_status_t CEF_CALLBACK urlrequest_get_request_status( return UR_UNKNOWN; // Execute - cef_urlrequest_status_t _retval = CefURLRequestCppToC::Get( - self)->GetRequestStatus(); + cef_urlrequest_status_t _retval = + CefURLRequestCppToC::Get(self)->GetRequestStatus(); // Return type: simple return _retval; } -cef_errorcode_t CEF_CALLBACK urlrequest_get_request_error( - struct _cef_urlrequest_t* self) { +cef_errorcode_t CEF_CALLBACK +urlrequest_get_request_error(struct _cef_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -111,8 +112,8 @@ cef_errorcode_t CEF_CALLBACK urlrequest_get_request_error( return _retval; } -cef_response_t* CEF_CALLBACK urlrequest_get_response( - struct _cef_urlrequest_t* self) { +cef_response_t* CEF_CALLBACK +urlrequest_get_response(struct _cef_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,8 +121,8 @@ cef_response_t* CEF_CALLBACK urlrequest_get_response( return NULL; // Execute - CefRefPtr _retval = CefURLRequestCppToC::Get(self)->GetResponse( - ); + CefRefPtr _retval = + CefURLRequestCppToC::Get(self)->GetResponse(); // Return type: refptr_same return CefResponseCppToC::Wrap(_retval); @@ -140,7 +141,6 @@ void CEF_CALLBACK urlrequest_cancel(struct _cef_urlrequest_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefURLRequestCppToC::CefURLRequestCppToC() { @@ -152,17 +152,23 @@ CefURLRequestCppToC::CefURLRequestCppToC() { GetStruct()->cancel = urlrequest_cancel; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_urlrequest_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_urlrequest_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_URLREQUEST; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_URLREQUEST; diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.h b/libcef_dll/cpptoc/urlrequest_cpptoc.h index 7fd5617a8..f7b2d1d66 100644 --- a/libcef_dll/cpptoc/urlrequest_cpptoc.h +++ b/libcef_dll/cpptoc/urlrequest_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2afed9701ec6418e3162142e022b5dfce8fece17$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_urlrequest.h" #include "include/capi/cef_urlrequest_capi.h" +#include "include/cef_urlrequest.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefURLRequestCppToC - : public CefCppToCRefCounted { +class CefURLRequestCppToC : public CefCppToCRefCounted { public: CefURLRequestCppToC(); }; diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc index d7a465238..f201195a8 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a2504c28284997e735a95538b98931c6bece1e38$ +// #include "libcef_dll/cpptoc/v8accessor_cpptoc.h" #include "libcef_dll/ctocpp/v8value_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t** retval, cef_string_t* exception) { + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,10 +56,7 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, // Execute bool _retval = CefV8AccessorCppToC::Get(self)->Get( - CefString(name), - CefV8ValueCToCpp::Wrap(object), - retvalPtr, - exceptionStr); + CefString(name), CefV8ValueCToCpp::Wrap(object), retvalPtr, exceptionStr); // Restore param: retval; type: refptr_diff_byref if (retval) { @@ -74,8 +74,10 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, } int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t* value, cef_string_t* exception) { + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -103,10 +105,8 @@ int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, // Execute bool _retval = CefV8AccessorCppToC::Get(self)->Set( - CefString(name), - CefV8ValueCToCpp::Wrap(object), - CefV8ValueCToCpp::Wrap(value), - exceptionStr); + CefString(name), CefV8ValueCToCpp::Wrap(object), + CefV8ValueCToCpp::Wrap(value), exceptionStr); // Return type: bool return _retval; @@ -114,7 +114,6 @@ int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8AccessorCppToC::CefV8AccessorCppToC() { @@ -122,17 +121,23 @@ CefV8AccessorCppToC::CefV8AccessorCppToC() { GetStruct()->set = v8accessor_set; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8accessor_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_v8accessor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8ACCESSOR; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8ACCESSOR; diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h index b840dca41..be894c133 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.h +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5ae69a4f690dd9a04d63d799eb9ed1b5e4980c04$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefV8AccessorCppToC - : public CefCppToCRefCounted { +class CefV8AccessorCppToC : public CefCppToCRefCounted { public: CefV8AccessorCppToC(); }; diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc index 2dd8de226..fbce5380d 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cc6dd68800da221cf4bbed462aaec34d6f20c8f5$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" @@ -17,7 +19,6 @@ #include "libcef_dll/cpptoc/v8exception_cpptoc.h" #include "libcef_dll/cpptoc/v8value_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() { @@ -50,13 +51,12 @@ CEF_EXPORT int cef_v8context_in_context() { return _retval; } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_task_runner_t* CEF_CALLBACK v8context_get_task_runner( - struct _cef_v8context_t* self) { +cef_task_runner_t* CEF_CALLBACK +v8context_get_task_runner(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +64,8 @@ cef_task_runner_t* CEF_CALLBACK v8context_get_task_runner( return NULL; // Execute - CefRefPtr _retval = CefV8ContextCppToC::Get( - self)->GetTaskRunner(); + CefRefPtr _retval = + CefV8ContextCppToC::Get(self)->GetTaskRunner(); // Return type: refptr_same return CefTaskRunnerCppToC::Wrap(_retval); @@ -85,8 +85,8 @@ int CEF_CALLBACK v8context_is_valid(struct _cef_v8context_t* self) { return _retval; } -cef_browser_t* CEF_CALLBACK v8context_get_browser( - struct _cef_v8context_t* self) { +cef_browser_t* CEF_CALLBACK +v8context_get_browser(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -114,8 +114,8 @@ cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) { return CefFrameCppToC::Wrap(_retval); } -struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( - struct _cef_v8context_t* self) { +struct _cef_v8value_t* CEF_CALLBACK +v8context_get_global(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -158,7 +158,7 @@ int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) { } int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, - struct _cef_v8context_t* that) { + struct _cef_v8context_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -170,16 +170,19 @@ int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, return 0; // Execute - bool _retval = CefV8ContextCppToC::Get(self)->IsSame( - CefV8ContextCppToC::Unwrap(that)); + bool _retval = + CefV8ContextCppToC::Get(self)->IsSame(CefV8ContextCppToC::Unwrap(that)); // Return type: bool return _retval; } int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self, - const cef_string_t* code, const cef_string_t* script_url, int start_line, - struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception) { + const cef_string_t* code, + const cef_string_t* script_url, + int start_line, + struct _cef_v8value_t** retval, + struct _cef_v8exception_t** exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -212,10 +215,7 @@ int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self, // Execute bool _retval = CefV8ContextCppToC::Get(self)->Eval( - CefString(code), - CefString(script_url), - start_line, - retvalPtr, + CefString(code), CefString(script_url), start_line, retvalPtr, exceptionPtr); // Restore param: retval; type: refptr_same_byref @@ -245,7 +245,6 @@ int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8ContextCppToC::CefV8ContextCppToC() { @@ -260,17 +259,23 @@ CefV8ContextCppToC::CefV8ContextCppToC() { GetStruct()->eval = v8context_eval; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8context_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_v8context_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8CONTEXT; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8CONTEXT; diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h index 053ac0343..c8229e5b3 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cbf6d10b1f82fede05d550aff8ff6dc6d4169d13$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefV8ContextCppToC - : public CefCppToCRefCounted { +class CefV8ContextCppToC : public CefCppToCRefCounted { public: CefV8ContextCppToC(); }; diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc index c7c882765..24952854a 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.cc +++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b7e861d09ab59b636e98e56a191e68a0869b5412$ +// #include "libcef_dll/cpptoc/v8exception_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_string_userfree_t CEF_CALLBACK v8exception_get_message( - struct _cef_v8exception_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8exception_get_message(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,8 +33,8 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_message( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( - struct _cef_v8exception_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8exception_get_source_line(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +48,8 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( - struct _cef_v8exception_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8exception_get_script_resource_name(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -76,8 +77,8 @@ int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) { return _retval; } -int CEF_CALLBACK v8exception_get_start_position( - struct _cef_v8exception_t* self) { +int CEF_CALLBACK +v8exception_get_start_position(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -135,7 +136,6 @@ int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8ExceptionCppToC::CefV8ExceptionCppToC() { @@ -149,17 +149,23 @@ CefV8ExceptionCppToC::CefV8ExceptionCppToC() { GetStruct()->get_end_column = v8exception_get_end_column; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8exception_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_v8exception_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8EXCEPTION; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8EXCEPTION; diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h index a7aef090a..9646a0517 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.h +++ b/libcef_dll/cpptoc/v8exception_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a4f504f4eed426b2d27f8a2f64ed40978c901ac4$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefV8ExceptionCppToC - : public CefCppToCRefCounted { +class CefV8ExceptionCppToC : public CefCppToCRefCounted { public: CefV8ExceptionCppToC(); }; diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc index 1092fe5c8..d1cdeda9c 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -9,19 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a6567a72d78089a0a9784dcc94c6af30af98189b$ +// #include "libcef_dll/cpptoc/v8handler_cpptoc.h" #include "libcef_dll/ctocpp/v8value_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - size_t argumentsCount, struct _cef_v8value_t* const* arguments, - struct _cef_v8value_t** retval, cef_string_t* exception) { + const cef_string_t* name, + struct _cef_v8value_t* object, + size_t argumentsCount, + struct _cef_v8value_t* const* arguments, + struct _cef_v8value_t** retval, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,7 +53,7 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, return 0; // Translate param: arguments; type: refptr_vec_diff_byref_const - std::vector > argumentsList; + std::vector> argumentsList; if (argumentsCount > 0) { for (size_t i = 0; i < argumentsCount; ++i) { CefRefPtr argumentsVal = CefV8ValueCToCpp::Wrap(arguments[i]); @@ -66,10 +70,7 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, // Execute bool _retval = CefV8HandlerCppToC::Get(self)->Execute( - CefString(name), - CefV8ValueCToCpp::Wrap(object), - argumentsList, - retvalPtr, + CefString(name), CefV8ValueCToCpp::Wrap(object), argumentsList, retvalPtr, exceptionStr); // Restore param: retval; type: refptr_diff_byref @@ -89,24 +90,29 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8HandlerCppToC::CefV8HandlerCppToC() { GetStruct()->execute = v8handler_execute; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8handler_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_v8handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8HANDLER; diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h index ccc9dd6eb..80b6e58a5 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bc7d12635ad04ecf9ee8a19c75fe4601f1f98c37$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefV8HandlerCppToC - : public CefCppToCRefCounted { +class CefV8HandlerCppToC : public CefCppToCRefCounted { public: CefV8HandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/v8interceptor_cpptoc.cc b/libcef_dll/cpptoc/v8interceptor_cpptoc.cc index 28d962237..ccccb8252 100644 --- a/libcef_dll/cpptoc/v8interceptor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8interceptor_cpptoc.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b77922c7e347a9371ebdba47213b23fcd62d98a8$ +// #include "libcef_dll/cpptoc/v8interceptor_cpptoc.h" #include "libcef_dll/ctocpp/v8value_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8interceptor_get_byname(struct _cef_v8interceptor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t** retval, cef_string_t* exception) { + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,10 +56,7 @@ int CEF_CALLBACK v8interceptor_get_byname(struct _cef_v8interceptor_t* self, // Execute bool _retval = CefV8InterceptorCppToC::Get(self)->Get( - CefString(name), - CefV8ValueCToCpp::Wrap(object), - retvalPtr, - exceptionStr); + CefString(name), CefV8ValueCToCpp::Wrap(object), retvalPtr, exceptionStr); // Restore param: retval; type: refptr_diff_byref if (retval) { @@ -74,8 +74,10 @@ int CEF_CALLBACK v8interceptor_get_byname(struct _cef_v8interceptor_t* self, } int CEF_CALLBACK v8interceptor_get_byindex(struct _cef_v8interceptor_t* self, - int index, struct _cef_v8value_t* object, struct _cef_v8value_t** retval, - cef_string_t* exception) { + int index, + struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -108,10 +110,7 @@ int CEF_CALLBACK v8interceptor_get_byindex(struct _cef_v8interceptor_t* self, // Execute bool _retval = CefV8InterceptorCppToC::Get(self)->Get( - index, - CefV8ValueCToCpp::Wrap(object), - retvalPtr, - exceptionStr); + index, CefV8ValueCToCpp::Wrap(object), retvalPtr, exceptionStr); // Restore param: retval; type: refptr_diff_byref if (retval) { @@ -129,8 +128,10 @@ int CEF_CALLBACK v8interceptor_get_byindex(struct _cef_v8interceptor_t* self, } int CEF_CALLBACK v8interceptor_set_byname(struct _cef_v8interceptor_t* self, - const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t* value, cef_string_t* exception) { + const cef_string_t* name, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -158,18 +159,18 @@ int CEF_CALLBACK v8interceptor_set_byname(struct _cef_v8interceptor_t* self, // Execute bool _retval = CefV8InterceptorCppToC::Get(self)->Set( - CefString(name), - CefV8ValueCToCpp::Wrap(object), - CefV8ValueCToCpp::Wrap(value), - exceptionStr); + CefString(name), CefV8ValueCToCpp::Wrap(object), + CefV8ValueCToCpp::Wrap(value), exceptionStr); // Return type: bool return _retval; } int CEF_CALLBACK v8interceptor_set_byindex(struct _cef_v8interceptor_t* self, - int index, struct _cef_v8value_t* object, struct _cef_v8value_t* value, - cef_string_t* exception) { + int index, + struct _cef_v8value_t* object, + struct _cef_v8value_t* value, + cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -197,9 +198,7 @@ int CEF_CALLBACK v8interceptor_set_byindex(struct _cef_v8interceptor_t* self, // Execute bool _retval = CefV8InterceptorCppToC::Get(self)->Set( - index, - CefV8ValueCToCpp::Wrap(object), - CefV8ValueCToCpp::Wrap(value), + index, CefV8ValueCToCpp::Wrap(object), CefV8ValueCToCpp::Wrap(value), exceptionStr); // Return type: bool @@ -208,7 +207,6 @@ int CEF_CALLBACK v8interceptor_set_byindex(struct _cef_v8interceptor_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8InterceptorCppToC::CefV8InterceptorCppToC() { @@ -218,17 +216,25 @@ CefV8InterceptorCppToC::CefV8InterceptorCppToC() { GetStruct()->set_byindex = v8interceptor_set_byindex; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8interceptor_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefV8InterceptorCppToC, + CefV8Interceptor, + cef_v8interceptor_t>::UnwrapDerived(CefWrapperType type, + cef_v8interceptor_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8INTERCEPTOR; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8INTERCEPTOR; diff --git a/libcef_dll/cpptoc/v8interceptor_cpptoc.h b/libcef_dll/cpptoc/v8interceptor_cpptoc.h index f2fbcbcae..de94341ac 100644 --- a/libcef_dll/cpptoc/v8interceptor_cpptoc.h +++ b/libcef_dll/cpptoc/v8interceptor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=248c96d294c4c35ac2310d1231202e0d6f12d133$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefV8InterceptorCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefV8InterceptorCppToC(); }; diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc index 7ec0f27d7..648a3e45e 100644 --- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc +++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=86438f3cde8e41dc13fc150496886715b8896c22$ +// #include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -31,8 +32,8 @@ int CEF_CALLBACK v8stack_frame_is_valid(struct _cef_v8stack_frame_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_script_name( - struct _cef_v8stack_frame_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8stack_frame_get_script_name(struct _cef_v8stack_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -46,8 +47,8 @@ cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_script_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_script_name_or_source_url( - struct _cef_v8stack_frame_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8stack_frame_get_script_name_or_source_url(struct _cef_v8stack_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -55,15 +56,15 @@ cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_script_name_or_source_url( return NULL; // Execute - CefString _retval = CefV8StackFrameCppToC::Get( - self)->GetScriptNameOrSourceURL(); + CefString _retval = + CefV8StackFrameCppToC::Get(self)->GetScriptNameOrSourceURL(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_function_name( - struct _cef_v8stack_frame_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8stack_frame_get_function_name(struct _cef_v8stack_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -77,8 +78,8 @@ cef_string_userfree_t CEF_CALLBACK v8stack_frame_get_function_name( return _retval.DetachToUserFree(); } -int CEF_CALLBACK v8stack_frame_get_line_number( - struct _cef_v8stack_frame_t* self) { +int CEF_CALLBACK +v8stack_frame_get_line_number(struct _cef_v8stack_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,8 +121,8 @@ int CEF_CALLBACK v8stack_frame_is_eval(struct _cef_v8stack_frame_t* self) { return _retval; } -int CEF_CALLBACK v8stack_frame_is_constructor( - struct _cef_v8stack_frame_t* self) { +int CEF_CALLBACK +v8stack_frame_is_constructor(struct _cef_v8stack_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -137,7 +138,6 @@ int CEF_CALLBACK v8stack_frame_is_constructor( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8StackFrameCppToC::CefV8StackFrameCppToC() { @@ -152,17 +152,25 @@ CefV8StackFrameCppToC::CefV8StackFrameCppToC() { GetStruct()->is_constructor = v8stack_frame_is_constructor; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8stack_frame_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefV8StackFrameCppToC, + CefV8StackFrame, + cef_v8stack_frame_t>::UnwrapDerived(CefWrapperType type, + cef_v8stack_frame_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8STACK_FRAME; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8STACK_FRAME; diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h index a9dc2fefc..31134a8d0 100644 --- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h +++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=637f47473f17518d8ecf6dfe8f4114fb4f1fe388$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_FRAME_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8STACK_FRAME_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefV8StackFrameCppToC - : public CefCppToCRefCounted { +class CefV8StackFrameCppToC : public CefCppToCRefCounted { public: CefV8StackFrameCppToC(); }; diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc index b8d89bd2d..cdbb3c185 100644 --- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc +++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc @@ -9,25 +9,24 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=349630df161107399c7de224db24d618df00e49d$ +// #include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h" #include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8StackTrace::GetCurrent( - frame_limit); + CefRefPtr _retval = CefV8StackTrace::GetCurrent(frame_limit); // Return type: refptr_same return CefV8StackTraceCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -46,8 +45,8 @@ int CEF_CALLBACK v8stack_trace_is_valid(struct _cef_v8stack_trace_t* self) { return _retval; } -int CEF_CALLBACK v8stack_trace_get_frame_count( - struct _cef_v8stack_trace_t* self) { +int CEF_CALLBACK +v8stack_trace_get_frame_count(struct _cef_v8stack_trace_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,8 +60,8 @@ int CEF_CALLBACK v8stack_trace_get_frame_count( return _retval; } -struct _cef_v8stack_frame_t* CEF_CALLBACK v8stack_trace_get_frame( - struct _cef_v8stack_trace_t* self, int index) { +struct _cef_v8stack_frame_t* CEF_CALLBACK +v8stack_trace_get_frame(struct _cef_v8stack_trace_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -70,9 +69,8 @@ struct _cef_v8stack_frame_t* CEF_CALLBACK v8stack_trace_get_frame( return NULL; // Execute - CefRefPtr _retval = CefV8StackTraceCppToC::Get( - self)->GetFrame( - index); + CefRefPtr _retval = + CefV8StackTraceCppToC::Get(self)->GetFrame(index); // Return type: refptr_same return CefV8StackFrameCppToC::Wrap(_retval); @@ -80,7 +78,6 @@ struct _cef_v8stack_frame_t* CEF_CALLBACK v8stack_trace_get_frame( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8StackTraceCppToC::CefV8StackTraceCppToC() { @@ -89,17 +86,25 @@ CefV8StackTraceCppToC::CefV8StackTraceCppToC() { GetStruct()->get_frame = v8stack_trace_get_frame; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_v8stack_trace_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefV8StackTraceCppToC, + CefV8StackTrace, + cef_v8stack_trace_t>::UnwrapDerived(CefWrapperType type, + cef_v8stack_trace_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8STACK_TRACE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_V8STACK_TRACE; diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h index 946de7448..dd8003b36 100644 --- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h +++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a1a5923d045dcb33cd33b2402b8856695b2249b6$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_TRACE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8STACK_TRACE_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefV8StackTraceCppToC - : public CefCppToCRefCounted { +class CefV8StackTraceCppToC : public CefCppToCRefCounted { public: CefV8StackTraceCppToC(); }; diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc index 379294eae..1f1955d9e 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.cc +++ b/libcef_dll/cpptoc/v8value_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2677f4fd7af9a5ab8ed8cb675a7cce84c7c18414$ +// #include "libcef_dll/cpptoc/v8context_cpptoc.h" #include "libcef_dll/cpptoc/v8exception_cpptoc.h" @@ -19,7 +21,6 @@ #include "libcef_dll/ctocpp/v8interceptor_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() { @@ -46,8 +47,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8Value::CreateBool( - value?true:false); + CefRefPtr _retval = CefV8Value::CreateBool(value ? true : false); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -57,8 +57,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32 value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8Value::CreateInt( - value); + CefRefPtr _retval = CefV8Value::CreateInt(value); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -68,8 +67,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32 value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8Value::CreateUInt( - value); + CefRefPtr _retval = CefV8Value::CreateUInt(value); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -79,8 +77,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8Value::CreateDouble( - value); + CefRefPtr _retval = CefV8Value::CreateDouble(value); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -95,11 +92,10 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) { return NULL; // Translate param: date; type: simple_byref_const - CefTime dateVal = date?*date:CefTime(); + CefTime dateVal = date ? *date : CefTime(); // Execute - CefRefPtr _retval = CefV8Value::CreateDate( - dateVal); + CefRefPtr _retval = CefV8Value::CreateDate(dateVal); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -111,23 +107,23 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) { // Unverified params: value // Execute - CefRefPtr _retval = CefV8Value::CreateString( - CefString(value)); + CefRefPtr _retval = CefV8Value::CreateString(CefString(value)); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor, +CEF_EXPORT cef_v8value_t* cef_v8value_create_object( + cef_v8accessor_t* accessor, cef_v8interceptor_t* interceptor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: accessor, interceptor // Execute - CefRefPtr _retval = CefV8Value::CreateObject( - CefV8AccessorCToCpp::Wrap(accessor), - CefV8InterceptorCToCpp::Wrap(interceptor)); + CefRefPtr _retval = + CefV8Value::CreateObject(CefV8AccessorCToCpp::Wrap(accessor), + CefV8InterceptorCToCpp::Wrap(interceptor)); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -137,14 +133,14 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefRefPtr _retval = CefV8Value::CreateArray( - length); + CefRefPtr _retval = CefV8Value::CreateArray(length); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, +CEF_EXPORT cef_v8value_t* cef_v8value_create_function( + const cef_string_t* name, cef_v8handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -159,14 +155,12 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, // Execute CefRefPtr _retval = CefV8Value::CreateFunction( - CefString(name), - CefV8HandlerCToCpp::Wrap(handler)); + CefString(name), CefV8HandlerCToCpp::Wrap(handler)); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -340,7 +334,7 @@ int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) { } int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, - struct _cef_v8value_t* that) { + struct _cef_v8value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -352,8 +346,8 @@ int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, return 0; // Execute - bool _retval = CefV8ValueCppToC::Get(self)->IsSame( - CefV8ValueCppToC::Unwrap(that)); + bool _retval = + CefV8ValueCppToC::Get(self)->IsSame(CefV8ValueCppToC::Unwrap(that)); // Return type: bool return _retval; @@ -429,8 +423,8 @@ cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( - struct _cef_v8value_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8value_get_string_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -472,8 +466,8 @@ int CEF_CALLBACK v8value_has_exception(struct _cef_v8value_t* self) { return _retval; } -cef_v8exception_t* CEF_CALLBACK v8value_get_exception( - struct _cef_v8value_t* self) { +cef_v8exception_t* CEF_CALLBACK +v8value_get_exception(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -481,8 +475,8 @@ cef_v8exception_t* CEF_CALLBACK v8value_get_exception( return NULL; // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetException( - ); + CefRefPtr _retval = + CefV8ValueCppToC::Get(self)->GetException(); // Return type: refptr_same return CefV8ExceptionCppToC::Wrap(_retval); @@ -517,7 +511,7 @@ int CEF_CALLBACK v8value_will_rethrow_exceptions(struct _cef_v8value_t* self) { } int CEF_CALLBACK v8value_set_rethrow_exceptions(struct _cef_v8value_t* self, - int rethrow) { + int rethrow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -525,15 +519,15 @@ int CEF_CALLBACK v8value_set_rethrow_exceptions(struct _cef_v8value_t* self, return 0; // Execute - bool _retval = CefV8ValueCppToC::Get(self)->SetRethrowExceptions( - rethrow?true:false); + bool _retval = + CefV8ValueCppToC::Get(self)->SetRethrowExceptions(rethrow ? true : false); // Return type: bool return _retval; } int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -542,15 +536,14 @@ int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, // Unverified params: key // Execute - bool _retval = CefV8ValueCppToC::Get(self)->HasValue( - CefString(key)); + bool _retval = CefV8ValueCppToC::Get(self)->HasValue(CefString(key)); // Return type: bool return _retval; } int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -562,15 +555,14 @@ int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, return 0; // Execute - bool _retval = CefV8ValueCppToC::Get(self)->HasValue( - index); + bool _retval = CefV8ValueCppToC::Get(self)->HasValue(index); // Return type: bool return _retval; } int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, - const cef_string_t* key) { + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -579,15 +571,14 @@ int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, // Unverified params: key // Execute - bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue( - CefString(key)); + bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue(CefString(key)); // Return type: bool return _retval; } int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -599,15 +590,14 @@ int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, return 0; // Execute - bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue( - index); + bool _retval = CefV8ValueCppToC::Get(self)->DeleteValue(index); // Return type: bool return _retval; } -struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( - struct _cef_v8value_t* self, const cef_string_t* key) { +struct _cef_v8value_t* CEF_CALLBACK +v8value_get_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -616,15 +606,15 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( // Unverified params: key // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetValue( - CefString(key)); + CefRefPtr _retval = + CefV8ValueCppToC::Get(self)->GetValue(CefString(key)); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } -struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( - struct _cef_v8value_t* self, int index) { +struct _cef_v8value_t* CEF_CALLBACK +v8value_get_value_byindex(struct _cef_v8value_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -636,16 +626,16 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( return NULL; // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetValue( - index); + CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetValue(index); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, - const cef_string_t* key, struct _cef_v8value_t* value, - cef_v8_propertyattribute_t attribute) { + const cef_string_t* key, + struct _cef_v8value_t* value, + cef_v8_propertyattribute_t attribute) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -659,16 +649,15 @@ int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, // Execute bool _retval = CefV8ValueCppToC::Get(self)->SetValue( - CefString(key), - CefV8ValueCppToC::Unwrap(value), - attribute); + CefString(key), CefV8ValueCppToC::Unwrap(value), attribute); // Return type: bool return _retval; } int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, - int index, struct _cef_v8value_t* value) { + int index, + struct _cef_v8value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -685,16 +674,17 @@ int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, // Execute bool _retval = CefV8ValueCppToC::Get(self)->SetValue( - index, - CefV8ValueCppToC::Unwrap(value)); + index, CefV8ValueCppToC::Unwrap(value)); // Return type: bool return _retval; } -int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, - const cef_string_t* key, cef_v8_accesscontrol_t settings, - cef_v8_propertyattribute_t attribute) { +int CEF_CALLBACK +v8value_set_value_byaccessor(struct _cef_v8value_t* self, + const cef_string_t* key, + cef_v8_accesscontrol_t settings, + cef_v8_propertyattribute_t attribute) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -703,17 +693,15 @@ int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, // Unverified params: key // Execute - bool _retval = CefV8ValueCppToC::Get(self)->SetValue( - CefString(key), - settings, - attribute); + bool _retval = CefV8ValueCppToC::Get(self)->SetValue(CefString(key), settings, + attribute); // Return type: bool return _retval; } int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, - cef_string_list_t keys) { + cef_string_list_t keys) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -729,8 +717,7 @@ int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, transfer_string_list_contents(keys, keysList); // Execute - bool _retval = CefV8ValueCppToC::Get(self)->GetKeys( - keysList); + bool _retval = CefV8ValueCppToC::Get(self)->GetKeys(keysList); // Restore param: keys; type: string_vec_byref cef_string_list_clear(keys); @@ -741,7 +728,7 @@ int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_set_user_data(struct _cef_v8value_t* self, - cef_base_ref_counted_t* user_data) { + cef_base_ref_counted_t* user_data) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -757,8 +744,8 @@ int CEF_CALLBACK v8value_set_user_data(struct _cef_v8value_t* self, return _retval; } -cef_base_ref_counted_t* CEF_CALLBACK v8value_get_user_data( - struct _cef_v8value_t* self) { +cef_base_ref_counted_t* CEF_CALLBACK +v8value_get_user_data(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -766,15 +753,15 @@ cef_base_ref_counted_t* CEF_CALLBACK v8value_get_user_data( return NULL; // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get( - self)->GetUserData(); + CefRefPtr _retval = + CefV8ValueCppToC::Get(self)->GetUserData(); // Return type: refptr_diff return CefBaseRefCountedCToCpp::Unwrap(_retval); } -int CEF_CALLBACK v8value_get_externally_allocated_memory( - struct _cef_v8value_t* self) { +int CEF_CALLBACK +v8value_get_externally_allocated_memory(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -788,8 +775,9 @@ int CEF_CALLBACK v8value_get_externally_allocated_memory( return _retval; } -int CEF_CALLBACK v8value_adjust_externally_allocated_memory( - struct _cef_v8value_t* self, int change_in_bytes) { +int CEF_CALLBACK +v8value_adjust_externally_allocated_memory(struct _cef_v8value_t* self, + int change_in_bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -818,8 +806,8 @@ int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( - struct _cef_v8value_t* self) { +cef_string_userfree_t CEF_CALLBACK +v8value_get_function_name(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -833,8 +821,8 @@ cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( return _retval.DetachToUserFree(); } -cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( - struct _cef_v8value_t* self) { +cef_v8handler_t* CEF_CALLBACK +v8value_get_function_handler(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -842,16 +830,18 @@ cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( return NULL; // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get( - self)->GetFunctionHandler(); + CefRefPtr _retval = + CefV8ValueCppToC::Get(self)->GetFunctionHandler(); // Return type: refptr_diff return CefV8HandlerCToCpp::Unwrap(_retval); } -struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function( - struct _cef_v8value_t* self, struct _cef_v8value_t* object, - size_t argumentsCount, struct _cef_v8value_t* const* arguments) { +struct _cef_v8value_t* CEF_CALLBACK +v8value_execute_function(struct _cef_v8value_t* self, + struct _cef_v8value_t* object, + size_t argumentsCount, + struct _cef_v8value_t* const* arguments) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -864,28 +854,29 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function( // Unverified params: object // Translate param: arguments; type: refptr_vec_same_byref_const - std::vector > argumentsList; + std::vector> argumentsList; if (argumentsCount > 0) { for (size_t i = 0; i < argumentsCount; ++i) { - CefRefPtr argumentsVal = CefV8ValueCppToC::Unwrap( - arguments[i]); + CefRefPtr argumentsVal = + CefV8ValueCppToC::Unwrap(arguments[i]); argumentsList.push_back(argumentsVal); } } // Execute CefRefPtr _retval = CefV8ValueCppToC::Get(self)->ExecuteFunction( - CefV8ValueCppToC::Unwrap(object), - argumentsList); + CefV8ValueCppToC::Unwrap(object), argumentsList); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); } -struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function_with_context( - struct _cef_v8value_t* self, cef_v8context_t* context, - struct _cef_v8value_t* object, size_t argumentsCount, - struct _cef_v8value_t* const* arguments) { +struct _cef_v8value_t* CEF_CALLBACK +v8value_execute_function_with_context(struct _cef_v8value_t* self, + cef_v8context_t* context, + struct _cef_v8value_t* object, + size_t argumentsCount, + struct _cef_v8value_t* const* arguments) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -902,21 +893,20 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function_with_context( // Unverified params: object // Translate param: arguments; type: refptr_vec_same_byref_const - std::vector > argumentsList; + std::vector> argumentsList; if (argumentsCount > 0) { for (size_t i = 0; i < argumentsCount; ++i) { - CefRefPtr argumentsVal = CefV8ValueCppToC::Unwrap( - arguments[i]); + CefRefPtr argumentsVal = + CefV8ValueCppToC::Unwrap(arguments[i]); argumentsList.push_back(argumentsVal); } } // Execute - CefRefPtr _retval = CefV8ValueCppToC::Get( - self)->ExecuteFunctionWithContext( - CefV8ContextCppToC::Unwrap(context), - CefV8ValueCppToC::Unwrap(object), - argumentsList); + CefRefPtr _retval = + CefV8ValueCppToC::Get(self)->ExecuteFunctionWithContext( + CefV8ContextCppToC::Unwrap(context), CefV8ValueCppToC::Unwrap(object), + argumentsList); // Return type: refptr_same return CefV8ValueCppToC::Wrap(_retval); @@ -924,7 +914,6 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function_with_context( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefV8ValueCppToC::CefV8ValueCppToC() { @@ -977,17 +966,23 @@ CefV8ValueCppToC::CefV8ValueCppToC() { v8value_execute_function_with_context; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_v8value_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8VALUE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8VALUE; diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h index 9a01b4704..6f5c3b16c 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.h +++ b/libcef_dll/cpptoc/v8value_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8b0c588fb267815b90db83d4dac88bb87808cc97$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/value_cpptoc.cc b/libcef_dll/cpptoc/value_cpptoc.cc index 2e65b608e..c7ce9f897 100644 --- a/libcef_dll/cpptoc/value_cpptoc.cc +++ b/libcef_dll/cpptoc/value_cpptoc.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=06fc95c6ffcd865041be1579f7392bc4b36a65eb$ +// #include "libcef_dll/cpptoc/binary_value_cpptoc.h" #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" #include "libcef_dll/cpptoc/list_value_cpptoc.h" #include "libcef_dll/cpptoc/value_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_value_t* cef_value_create() { @@ -28,7 +29,6 @@ CEF_EXPORT cef_value_t* cef_value_create() { return CefValueCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -76,7 +76,7 @@ int CEF_CALLBACK value_is_read_only(struct _cef_value_t* self) { } int CEF_CALLBACK value_is_same(struct _cef_value_t* self, - struct _cef_value_t* that) { + struct _cef_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,15 +88,15 @@ int CEF_CALLBACK value_is_same(struct _cef_value_t* self, return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->IsSame( - CefValueCppToC::Unwrap(that)); + bool _retval = + CefValueCppToC::Get(self)->IsSame(CefValueCppToC::Unwrap(that)); // Return type: bool return _retval; } int CEF_CALLBACK value_is_equal(struct _cef_value_t* self, - struct _cef_value_t* that) { + struct _cef_value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -108,8 +108,8 @@ int CEF_CALLBACK value_is_equal(struct _cef_value_t* self, return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->IsEqual( - CefValueCppToC::Unwrap(that)); + bool _retval = + CefValueCppToC::Get(self)->IsEqual(CefValueCppToC::Unwrap(that)); // Return type: bool return _retval; @@ -199,8 +199,8 @@ cef_string_userfree_t CEF_CALLBACK value_get_string(struct _cef_value_t* self) { return _retval.DetachToUserFree(); } -struct _cef_binary_value_t* CEF_CALLBACK value_get_binary( - struct _cef_value_t* self) { +struct _cef_binary_value_t* CEF_CALLBACK +value_get_binary(struct _cef_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -214,8 +214,8 @@ struct _cef_binary_value_t* CEF_CALLBACK value_get_binary( return CefBinaryValueCppToC::Wrap(_retval); } -struct _cef_dictionary_value_t* CEF_CALLBACK value_get_dictionary( - struct _cef_value_t* self) { +struct _cef_dictionary_value_t* CEF_CALLBACK +value_get_dictionary(struct _cef_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -223,15 +223,15 @@ struct _cef_dictionary_value_t* CEF_CALLBACK value_get_dictionary( return NULL; // Execute - CefRefPtr _retval = CefValueCppToC::Get( - self)->GetDictionary(); + CefRefPtr _retval = + CefValueCppToC::Get(self)->GetDictionary(); // Return type: refptr_same return CefDictionaryValueCppToC::Wrap(_retval); } -struct _cef_list_value_t* CEF_CALLBACK value_get_list( - struct _cef_value_t* self) { +struct _cef_list_value_t* CEF_CALLBACK +value_get_list(struct _cef_value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -267,8 +267,7 @@ int CEF_CALLBACK value_set_bool(struct _cef_value_t* self, int value) { return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->SetBool( - value?true:false); + bool _retval = CefValueCppToC::Get(self)->SetBool(value ? true : false); // Return type: bool return _retval; @@ -282,8 +281,7 @@ int CEF_CALLBACK value_set_int(struct _cef_value_t* self, int value) { return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->SetInt( - value); + bool _retval = CefValueCppToC::Get(self)->SetInt(value); // Return type: bool return _retval; @@ -297,15 +295,14 @@ int CEF_CALLBACK value_set_double(struct _cef_value_t* self, double value) { return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->SetDouble( - value); + bool _retval = CefValueCppToC::Get(self)->SetDouble(value); // Return type: bool return _retval; } int CEF_CALLBACK value_set_string(struct _cef_value_t* self, - const cef_string_t* value) { + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -314,15 +311,14 @@ int CEF_CALLBACK value_set_string(struct _cef_value_t* self, // Unverified params: value // Execute - bool _retval = CefValueCppToC::Get(self)->SetString( - CefString(value)); + bool _retval = CefValueCppToC::Get(self)->SetString(CefString(value)); // Return type: bool return _retval; } int CEF_CALLBACK value_set_binary(struct _cef_value_t* self, - struct _cef_binary_value_t* value) { + struct _cef_binary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -334,15 +330,15 @@ int CEF_CALLBACK value_set_binary(struct _cef_value_t* self, return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->SetBinary( - CefBinaryValueCppToC::Unwrap(value)); + bool _retval = + CefValueCppToC::Get(self)->SetBinary(CefBinaryValueCppToC::Unwrap(value)); // Return type: bool return _retval; } int CEF_CALLBACK value_set_dictionary(struct _cef_value_t* self, - struct _cef_dictionary_value_t* value) { + struct _cef_dictionary_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -362,7 +358,7 @@ int CEF_CALLBACK value_set_dictionary(struct _cef_value_t* self, } int CEF_CALLBACK value_set_list(struct _cef_value_t* self, - struct _cef_list_value_t* value) { + struct _cef_list_value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -374,8 +370,8 @@ int CEF_CALLBACK value_set_list(struct _cef_value_t* self, return 0; // Execute - bool _retval = CefValueCppToC::Get(self)->SetList( - CefListValueCppToC::Unwrap(value)); + bool _retval = + CefValueCppToC::Get(self)->SetList(CefListValueCppToC::Unwrap(value)); // Return type: bool return _retval; @@ -383,7 +379,6 @@ int CEF_CALLBACK value_set_list(struct _cef_value_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefValueCppToC::CefValueCppToC() { @@ -411,16 +406,22 @@ CefValueCppToC::CefValueCppToC() { GetStruct()->set_list = value_set_list; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_value_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_value_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VALUE; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_VALUE; diff --git a/libcef_dll/cpptoc/value_cpptoc.h b/libcef_dll/cpptoc/value_cpptoc.h index 0704da724..c9a982073 100644 --- a/libcef_dll/cpptoc/value_cpptoc.h +++ b/libcef_dll/cpptoc/value_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4d04923e24cbed79bf8ed3b9a7e8945a2a8f23d2$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VALUE_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/box_layout_cpptoc.cc b/libcef_dll/cpptoc/views/box_layout_cpptoc.cc index aaf01e3a6..c5679e1fa 100644 --- a/libcef_dll/cpptoc/views/box_layout_cpptoc.cc +++ b/libcef_dll/cpptoc/views/box_layout_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7af9db791a4b3c2a6f93326731c9959e891148ed$ +// #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK box_layout_set_flex_for_view(struct _cef_box_layout_t* self, - struct _cef_view_t* view, int flex) { + struct _cef_view_t* view, + int flex) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,13 +34,12 @@ void CEF_CALLBACK box_layout_set_flex_for_view(struct _cef_box_layout_t* self, return; // Execute - CefBoxLayoutCppToC::Get(self)->SetFlexForView( - CefViewCppToC::Unwrap(view), - flex); + CefBoxLayoutCppToC::Get(self)->SetFlexForView(CefViewCppToC::Unwrap(view), + flex); } void CEF_CALLBACK box_layout_clear_flex_for_view(struct _cef_box_layout_t* self, - struct _cef_view_t* view) { + struct _cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,12 +51,11 @@ void CEF_CALLBACK box_layout_clear_flex_for_view(struct _cef_box_layout_t* self, return; // Execute - CefBoxLayoutCppToC::Get(self)->ClearFlexForView( - CefViewCppToC::Unwrap(view)); + CefBoxLayoutCppToC::Get(self)->ClearFlexForView(CefViewCppToC::Unwrap(view)); } -cef_box_layout_t* CEF_CALLBACK box_layout_as_box_layout( - struct _cef_layout_t* self) { +cef_box_layout_t* CEF_CALLBACK +box_layout_as_box_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -63,15 +63,16 @@ cef_box_layout_t* CEF_CALLBACK box_layout_as_box_layout( return NULL; // Execute - CefRefPtr _retval = CefBoxLayoutCppToC::Get( - reinterpret_cast(self))->AsBoxLayout(); + CefRefPtr _retval = + CefBoxLayoutCppToC::Get(reinterpret_cast(self)) + ->AsBoxLayout(); // Return type: refptr_same return CefBoxLayoutCppToC::Wrap(_retval); } -cef_fill_layout_t* CEF_CALLBACK box_layout_as_fill_layout( - struct _cef_layout_t* self) { +cef_fill_layout_t* CEF_CALLBACK +box_layout_as_fill_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,8 +80,9 @@ cef_fill_layout_t* CEF_CALLBACK box_layout_as_fill_layout( return NULL; // Execute - CefRefPtr _retval = CefBoxLayoutCppToC::Get( - reinterpret_cast(self))->AsFillLayout(); + CefRefPtr _retval = + CefBoxLayoutCppToC::Get(reinterpret_cast(self)) + ->AsFillLayout(); // Return type: refptr_same return CefFillLayoutCppToC::Wrap(_retval); @@ -94,8 +96,9 @@ int CEF_CALLBACK box_layout_is_valid(struct _cef_layout_t* self) { return 0; // Execute - bool _retval = CefBoxLayoutCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefBoxLayoutCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -103,7 +106,6 @@ int CEF_CALLBACK box_layout_is_valid(struct _cef_layout_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBoxLayoutCppToC::CefBoxLayoutCppToC() { @@ -114,17 +116,23 @@ CefBoxLayoutCppToC::CefBoxLayoutCppToC() { GetStruct()->base.is_valid = box_layout_is_valid; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_box_layout_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_box_layout_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BOX_LAYOUT; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_BOX_LAYOUT; diff --git a/libcef_dll/cpptoc/views/box_layout_cpptoc.h b/libcef_dll/cpptoc/views/box_layout_cpptoc.h index 1de9e7840..b7066d049 100644 --- a/libcef_dll/cpptoc/views/box_layout_cpptoc.h +++ b/libcef_dll/cpptoc/views/box_layout_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=85078c8660e652f2063ead3252b0f3d114aa587c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BOX_LAYOUT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_BOX_LAYOUT_CPPTOC_H_ @@ -18,17 +20,17 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_box_layout.h" #include "include/capi/views/cef_box_layout_capi.h" -#include "include/views/cef_view.h" #include "include/capi/views/cef_view_capi.h" +#include "include/views/cef_box_layout.h" +#include "include/views/cef_view.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefBoxLayoutCppToC - : public CefCppToCRefCounted { +class CefBoxLayoutCppToC : public CefCppToCRefCounted { public: CefBoxLayoutCppToC(); }; diff --git a/libcef_dll/cpptoc/views/browser_view_cpptoc.cc b/libcef_dll/cpptoc/views/browser_view_cpptoc.cc index 9d84f8adc..4045abf1a 100644 --- a/libcef_dll/cpptoc/views/browser_view_cpptoc.cc +++ b/libcef_dll/cpptoc/views/browser_view_cpptoc.cc @@ -9,25 +9,28 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8d879b5ba21a991aa60cdde72667473158676056$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" +#include "libcef_dll/cpptoc/request_context_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" #include "libcef_dll/cpptoc/views/panel_cpptoc.h" -#include "libcef_dll/cpptoc/request_context_cpptoc.h" #include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" #include "libcef_dll/cpptoc/views/textfield_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/cpptoc/views/window_cpptoc.h" -#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" #include "libcef_dll/ctocpp/client_ctocpp.h" +#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_browser_view_t* cef_browser_view_create(cef_client_t* client, - const cef_string_t* url, const struct _cef_browser_settings_t* settings, +CEF_EXPORT cef_browser_view_t* cef_browser_view_create( + cef_client_t* client, + const cef_string_t* url, + const struct _cef_browser_settings_t* settings, cef_request_context_t* request_context, cef_browser_view_delegate_t* delegate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,9 +48,7 @@ CEF_EXPORT cef_browser_view_t* cef_browser_view_create(cef_client_t* client, // Execute CefRefPtr _retval = CefBrowserView::CreateBrowserView( - CefClientCToCpp::Wrap(client), - CefString(url), - settingsObj, + CefClientCToCpp::Wrap(client), CefString(url), settingsObj, CefRequestContextCppToC::Unwrap(request_context), CefBrowserViewDelegateCToCpp::Wrap(delegate)); @@ -65,20 +66,19 @@ CEF_EXPORT cef_browser_view_t* cef_browser_view_get_for_browser( return NULL; // Execute - CefRefPtr _retval = CefBrowserView::GetForBrowser( - CefBrowserCppToC::Unwrap(browser)); + CefRefPtr _retval = + CefBrowserView::GetForBrowser(CefBrowserCppToC::Unwrap(browser)); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_browser_t* CEF_CALLBACK browser_view_get_browser( - struct _cef_browser_view_t* self) { +cef_browser_t* CEF_CALLBACK +browser_view_get_browser(struct _cef_browser_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -92,8 +92,9 @@ cef_browser_t* CEF_CALLBACK browser_view_get_browser( return CefBrowserCppToC::Wrap(_retval); } -void CEF_CALLBACK browser_view_set_prefer_accelerators( - struct _cef_browser_view_t* self, int prefer_accelerators) { +void CEF_CALLBACK +browser_view_set_prefer_accelerators(struct _cef_browser_view_t* self, + int prefer_accelerators) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -102,11 +103,11 @@ void CEF_CALLBACK browser_view_set_prefer_accelerators( // Execute CefBrowserViewCppToC::Get(self)->SetPreferAccelerators( - prefer_accelerators?true:false); + prefer_accelerators ? true : false); } -cef_browser_view_t* CEF_CALLBACK browser_view_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +browser_view_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -114,8 +115,9 @@ cef_browser_view_t* CEF_CALLBACK browser_view_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -129,8 +131,9 @@ cef_button_t* CEF_CALLBACK browser_view_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -144,15 +147,16 @@ cef_panel_t* CEF_CALLBACK browser_view_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK browser_view_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +browser_view_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -160,15 +164,16 @@ cef_scroll_view_t* CEF_CALLBACK browser_view_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); } -cef_textfield_t* CEF_CALLBACK browser_view_as_textfield( - struct _cef_view_t* self) { +cef_textfield_t* CEF_CALLBACK +browser_view_as_textfield(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -176,15 +181,16 @@ cef_textfield_t* CEF_CALLBACK browser_view_as_textfield( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK browser_view_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +browser_view_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -192,15 +198,16 @@ cef_string_userfree_t CEF_CALLBACK browser_view_get_type_string( return NULL; // Execute - CefString _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetTypeString(); + CefString _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK browser_view_to_string( - struct _cef_view_t* self, int include_children) { +cef_string_userfree_t CEF_CALLBACK +browser_view_to_string(struct _cef_view_t* self, int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -208,9 +215,9 @@ cef_string_userfree_t CEF_CALLBACK browser_view_to_string( return NULL; // Execute - CefString _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ToString( - include_children?true:false); + CefString _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -224,8 +231,9 @@ int CEF_CALLBACK browser_view_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsValid(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -239,15 +247,16 @@ int CEF_CALLBACK browser_view_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsAttached(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK browser_view_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -259,16 +268,16 @@ int CEF_CALLBACK browser_view_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK browser_view_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +browser_view_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -276,15 +285,16 @@ struct _cef_view_delegate_t* CEF_CALLBACK browser_view_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); } -struct _cef_window_t* CEF_CALLBACK browser_view_get_window( - struct _cef_view_t* self) { +struct _cef_window_t* CEF_CALLBACK +browser_view_get_window(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -292,8 +302,9 @@ struct _cef_window_t* CEF_CALLBACK browser_view_get_window( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -307,8 +318,9 @@ int CEF_CALLBACK browser_view_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefBrowserViewCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetID(); // Return type: simple return _retval; @@ -322,8 +334,8 @@ void CEF_CALLBACK browser_view_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetID(id); } int CEF_CALLBACK browser_view_get_group_id(struct _cef_view_t* self) { @@ -334,15 +346,16 @@ int CEF_CALLBACK browser_view_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefBrowserViewCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetGroupID(); // Return type: simple return _retval; } void CEF_CALLBACK browser_view_set_group_id(struct _cef_view_t* self, - int group_id) { + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -350,13 +363,12 @@ void CEF_CALLBACK browser_view_set_group_id(struct _cef_view_t* self, return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetGroupID( - group_id); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK browser_view_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +browser_view_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -364,15 +376,16 @@ struct _cef_view_t* CEF_CALLBACK browser_view_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK browser_view_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +browser_view_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -380,16 +393,16 @@ struct _cef_view_t* CEF_CALLBACK browser_view_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK browser_view_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -401,12 +414,11 @@ void CEF_CALLBACK browser_view_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetBounds( - boundsVal); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK browser_view_get_bounds(struct _cef_view_t* self) { @@ -417,15 +429,16 @@ cef_rect_t CEF_CALLBACK browser_view_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetBounds(); + cef_rect_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetBounds(); // Return type: simple return _retval; } -cef_rect_t CEF_CALLBACK browser_view_get_bounds_in_screen( - struct _cef_view_t* self) { +cef_rect_t CEF_CALLBACK +browser_view_get_bounds_in_screen(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -433,15 +446,16 @@ cef_rect_t CEF_CALLBACK browser_view_get_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK browser_view_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -453,12 +467,11 @@ void CEF_CALLBACK browser_view_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetSize( - sizeVal); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetSize(sizeVal); } cef_size_t CEF_CALLBACK browser_view_get_size(struct _cef_view_t* self) { @@ -469,15 +482,16 @@ cef_size_t CEF_CALLBACK browser_view_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetSize(); + cef_size_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK browser_view_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -489,12 +503,11 @@ void CEF_CALLBACK browser_view_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetPosition( - positionVal); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK browser_view_get_position(struct _cef_view_t* self) { @@ -505,15 +518,16 @@ cef_point_t CEF_CALLBACK browser_view_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetPosition(); + cef_point_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK browser_view_get_preferred_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +browser_view_get_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -521,15 +535,16 @@ cef_size_t CEF_CALLBACK browser_view_get_preferred_size( return CefSize(); // Execute - cef_size_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetPreferredSize(); + cef_size_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; } -void CEF_CALLBACK browser_view_size_to_preferred_size( - struct _cef_view_t* self) { +void CEF_CALLBACK +browser_view_size_to_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -537,12 +552,12 @@ void CEF_CALLBACK browser_view_size_to_preferred_size( return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } -cef_size_t CEF_CALLBACK browser_view_get_minimum_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +browser_view_get_minimum_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -550,15 +565,16 @@ cef_size_t CEF_CALLBACK browser_view_get_minimum_size( return CefSize(); // Execute - cef_size_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetMinimumSize(); + cef_size_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK browser_view_get_maximum_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +browser_view_get_maximum_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -566,15 +582,16 @@ cef_size_t CEF_CALLBACK browser_view_get_maximum_size( return CefSize(); // Execute - cef_size_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetMaximumSize(); + cef_size_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK browser_view_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -582,9 +599,9 @@ int CEF_CALLBACK browser_view_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefBrowserViewCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -598,12 +615,12 @@ void CEF_CALLBACK browser_view_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->InvalidateLayout(); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK browser_view_set_visible(struct _cef_view_t* self, - int visible) { + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -611,9 +628,8 @@ void CEF_CALLBACK browser_view_set_visible(struct _cef_view_t* self, return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetVisible( - visible?true:false); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK browser_view_is_visible(struct _cef_view_t* self) { @@ -624,8 +640,9 @@ int CEF_CALLBACK browser_view_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsVisible(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsVisible(); // Return type: bool return _retval; @@ -639,15 +656,16 @@ int CEF_CALLBACK browser_view_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsDrawn(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsDrawn(); // Return type: bool return _retval; } void CEF_CALLBACK browser_view_set_enabled(struct _cef_view_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -655,9 +673,8 @@ void CEF_CALLBACK browser_view_set_enabled(struct _cef_view_t* self, return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetEnabled( - enabled?true:false); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK browser_view_is_enabled(struct _cef_view_t* self) { @@ -668,15 +685,16 @@ int CEF_CALLBACK browser_view_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsEnabled(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK browser_view_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -684,9 +702,8 @@ void CEF_CALLBACK browser_view_set_focusable(struct _cef_view_t* self, return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetFocusable( - focusable?true:false); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK browser_view_is_focusable(struct _cef_view_t* self) { @@ -697,15 +714,16 @@ int CEF_CALLBACK browser_view_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsFocusable(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; } -int CEF_CALLBACK browser_view_is_accessibility_focusable( - struct _cef_view_t* self) { +int CEF_CALLBACK +browser_view_is_accessibility_focusable(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -713,8 +731,9 @@ int CEF_CALLBACK browser_view_is_accessibility_focusable( return 0; // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->IsAccessibilityFocusable(); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -728,12 +747,12 @@ void CEF_CALLBACK browser_view_request_focus(struct _cef_view_t* self) { return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->RequestFocus(); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->RequestFocus(); } void CEF_CALLBACK browser_view_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -741,13 +760,12 @@ void CEF_CALLBACK browser_view_set_background_color(struct _cef_view_t* self, return; // Execute - CefBrowserViewCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } -cef_color_t CEF_CALLBACK browser_view_get_background_color( - struct _cef_view_t* self) { +cef_color_t CEF_CALLBACK +browser_view_get_background_color(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -755,15 +773,16 @@ cef_color_t CEF_CALLBACK browser_view_get_background_color( return 0; // Execute - cef_color_t _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->GetBackgroundColor(); + cef_color_t _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK browser_view_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -775,12 +794,12 @@ int CEF_CALLBACK browser_view_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointToScreen( - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -790,8 +809,9 @@ int CEF_CALLBACK browser_view_convert_point_to_screen(struct _cef_view_t* self, return _retval; } -int CEF_CALLBACK browser_view_convert_point_from_screen( - struct _cef_view_t* self, cef_point_t* point) { +int CEF_CALLBACK +browser_view_convert_point_from_screen(struct _cef_view_t* self, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -803,12 +823,12 @@ int CEF_CALLBACK browser_view_convert_point_from_screen( return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointFromScreen( - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -819,7 +839,7 @@ int CEF_CALLBACK browser_view_convert_point_from_screen( } int CEF_CALLBACK browser_view_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -831,12 +851,12 @@ int CEF_CALLBACK browser_view_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointToWindow( - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -846,8 +866,9 @@ int CEF_CALLBACK browser_view_convert_point_to_window(struct _cef_view_t* self, return _retval; } -int CEF_CALLBACK browser_view_convert_point_from_window( - struct _cef_view_t* self, cef_point_t* point) { +int CEF_CALLBACK +browser_view_convert_point_from_window(struct _cef_view_t* self, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -859,12 +880,12 @@ int CEF_CALLBACK browser_view_convert_point_from_window( return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointFromWindow( - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -875,7 +896,8 @@ int CEF_CALLBACK browser_view_convert_point_from_window( } int CEF_CALLBACK browser_view_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -891,13 +913,12 @@ int CEF_CALLBACK browser_view_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -908,7 +929,8 @@ int CEF_CALLBACK browser_view_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK browser_view_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -924,13 +946,12 @@ int CEF_CALLBACK browser_view_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefBrowserViewCppToC::Get( - reinterpret_cast(self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefBrowserViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -942,7 +963,6 @@ int CEF_CALLBACK browser_view_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBrowserViewCppToC::CefBrowserViewCppToC() { @@ -1005,17 +1025,23 @@ CefBrowserViewCppToC::CefBrowserViewCppToC() { browser_view_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_browser_view_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_browser_view_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER_VIEW; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_BROWSER_VIEW; diff --git a/libcef_dll/cpptoc/views/browser_view_cpptoc.h b/libcef_dll/cpptoc/views/browser_view_cpptoc.h index 0afb58c3a..7ebb61145 100644 --- a/libcef_dll/cpptoc/views/browser_view_cpptoc.h +++ b/libcef_dll/cpptoc/views/browser_view_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=83e50496f673ccae0b62729d3ef80272c317b49c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_browser_view.h" #include "include/capi/views/cef_browser_view_capi.h" +#include "include/views/cef_browser_view.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefBrowserViewCppToC - : public CefCppToCRefCounted { +class CefBrowserViewCppToC : public CefCppToCRefCounted { public: CefBrowserViewCppToC(); }; diff --git a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc index d58fc04ad..6fdde274b 100644 --- a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc @@ -9,20 +9,22 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9a19ca77c7dad9e0c8ddd5a1f3f2c1a2073fdd84$ +// -#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" #include "libcef_dll/cpptoc/client_cpptoc.h" +#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK browser_view_delegate_on_browser_created( - struct _cef_browser_view_delegate_t* self, cef_browser_view_t* browser_view, + struct _cef_browser_view_delegate_t* self, + cef_browser_view_t* browser_view, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,7 +47,8 @@ void CEF_CALLBACK browser_view_delegate_on_browser_created( } void CEF_CALLBACK browser_view_delegate_on_browser_destroyed( - struct _cef_browser_view_delegate_t* self, cef_browser_view_t* browser_view, + struct _cef_browser_view_delegate_t* self, + cef_browser_view_t* browser_view, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -67,9 +70,12 @@ void CEF_CALLBACK browser_view_delegate_on_browser_destroyed( CefBrowserCToCpp::Wrap(browser)); } -cef_browser_view_delegate_t* CEF_CALLBACK browser_view_delegate_get_delegate_for_popup_browser_view( - struct _cef_browser_view_delegate_t* self, cef_browser_view_t* browser_view, - const struct _cef_browser_settings_t* settings, cef_client_t* client, +cef_browser_view_delegate_t* CEF_CALLBACK +browser_view_delegate_get_delegate_for_popup_browser_view( + struct _cef_browser_view_delegate_t* self, + cef_browser_view_t* browser_view, + const struct _cef_browser_settings_t* settings, + cef_client_t* client, int is_devtools) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -95,20 +101,20 @@ cef_browser_view_delegate_t* CEF_CALLBACK browser_view_delegate_get_delegate_for settingsObj.Set(*settings, false); // Execute - CefRefPtr _retval = CefBrowserViewDelegateCppToC::Get( - self)->GetDelegateForPopupBrowserView( - CefBrowserViewCToCpp::Wrap(browser_view), - settingsObj, - CefClientCppToC::Unwrap(client), - is_devtools?true:false); + CefRefPtr _retval = + CefBrowserViewDelegateCppToC::Get(self)->GetDelegateForPopupBrowserView( + CefBrowserViewCToCpp::Wrap(browser_view), settingsObj, + CefClientCppToC::Unwrap(client), is_devtools ? true : false); // Return type: refptr_same return CefBrowserViewDelegateCppToC::Wrap(_retval); } int CEF_CALLBACK browser_view_delegate_on_popup_browser_view_created( - struct _cef_browser_view_delegate_t* self, cef_browser_view_t* browser_view, - cef_browser_view_t* popup_browser_view, int is_devtools) { + struct _cef_browser_view_delegate_t* self, + cef_browser_view_t* browser_view, + cef_browser_view_t* popup_browser_view, + int is_devtools) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,18 +130,19 @@ int CEF_CALLBACK browser_view_delegate_on_popup_browser_view_created( return 0; // Execute - bool _retval = CefBrowserViewDelegateCppToC::Get( - self)->OnPopupBrowserViewCreated( - CefBrowserViewCToCpp::Wrap(browser_view), - CefBrowserViewCToCpp::Wrap(popup_browser_view), - is_devtools?true:false); + bool _retval = + CefBrowserViewDelegateCppToC::Get(self)->OnPopupBrowserViewCreated( + CefBrowserViewCToCpp::Wrap(browser_view), + CefBrowserViewCToCpp::Wrap(popup_browser_view), + is_devtools ? true : false); // Return type: bool return _retval; } -cef_size_t CEF_CALLBACK browser_view_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +browser_view_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,15 +155,16 @@ cef_size_t CEF_CALLBACK browser_view_delegate_get_preferred_size( // Execute cef_size_t _retval = CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK browser_view_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +browser_view_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -169,15 +177,16 @@ cef_size_t CEF_CALLBACK browser_view_delegate_get_minimum_size( // Execute cef_size_t _retval = CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK browser_view_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +browser_view_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -190,15 +199,17 @@ cef_size_t CEF_CALLBACK browser_view_delegate_get_maximum_size( // Execute cef_size_t _retval = CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK browser_view_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +browser_view_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -211,17 +222,18 @@ int CEF_CALLBACK browser_view_delegate_get_height_for_width( // Execute int _retval = CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK browser_view_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +browser_view_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -238,16 +250,16 @@ void CEF_CALLBACK browser_view_delegate_on_parent_view_changed( // Execute CefBrowserViewDelegateCppToC::Get( - reinterpret_cast( - self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK browser_view_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +browser_view_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -264,14 +276,14 @@ void CEF_CALLBACK browser_view_delegate_on_child_view_changed( // Execute CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } -void CEF_CALLBACK browser_view_delegate_on_focus( - struct _cef_view_delegate_t* self, cef_view_t* view) { +void CEF_CALLBACK +browser_view_delegate_on_focus(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -284,12 +296,13 @@ void CEF_CALLBACK browser_view_delegate_on_focus( // Execute CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->OnFocus( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } -void CEF_CALLBACK browser_view_delegate_on_blur( - struct _cef_view_delegate_t* self, cef_view_t* view) { +void CEF_CALLBACK +browser_view_delegate_on_blur(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -302,13 +315,12 @@ void CEF_CALLBACK browser_view_delegate_on_blur( // Execute CefBrowserViewDelegateCppToC::Get( - reinterpret_cast(self))->OnBlur( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefBrowserViewDelegateCppToC::CefBrowserViewDelegateCppToC() { @@ -333,18 +345,27 @@ CefBrowserViewDelegateCppToC::CefBrowserViewDelegateCppToC() { GetStruct()->base.on_blur = browser_view_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_browser_view_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefBrowserViewDelegateCppToC, + CefBrowserViewDelegate, + cef_browser_view_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_browser_view_delegate_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER_VIEW_DELEGATE; diff --git a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h index 15799a91c..d5940df0d 100644 --- a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1f4deb7e04581129aac9e6a0461bc1e7772a875c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_DELEGATE_CPPTOC_H_ @@ -18,19 +20,20 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_browser_view_delegate.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/views/cef_browser_view_capi.h" #include "include/capi/views/cef_browser_view_delegate_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" #include "include/views/cef_browser_view.h" -#include "include/capi/views/cef_browser_view_capi.h" +#include "include/views/cef_browser_view_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefBrowserViewDelegateCppToC : public CefCppToCRefCounted { + CefBrowserViewDelegate, + cef_browser_view_delegate_t> { public: CefBrowserViewDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/button_cpptoc.cc b/libcef_dll/cpptoc/views/button_cpptoc.cc index 48f29445f..d02d60911 100644 --- a/libcef_dll/cpptoc/views/button_cpptoc.cc +++ b/libcef_dll/cpptoc/views/button_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6537359783dd7ee8c7dbacaffad85eb5f73c77aa$ +// #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" @@ -21,13 +23,12 @@ #include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_label_button_t* CEF_CALLBACK button_as_label_button( - struct _cef_button_t* self) { +cef_label_button_t* CEF_CALLBACK +button_as_label_button(struct _cef_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -35,15 +36,15 @@ cef_label_button_t* CEF_CALLBACK button_as_label_button( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get(self)->AsLabelButton( - ); + CefRefPtr _retval = + CefButtonCppToC::Get(self)->AsLabelButton(); // Return type: refptr_same return CefLabelButtonCppToC::Wrap(_retval); } void CEF_CALLBACK button_set_state(struct _cef_button_t* self, - cef_button_state_t state) { + cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +52,7 @@ void CEF_CALLBACK button_set_state(struct _cef_button_t* self, return; // Execute - CefButtonCppToC::Get(self)->SetState( - state); + CefButtonCppToC::Get(self)->SetState(state); } cef_button_state_t CEF_CALLBACK button_get_state(struct _cef_button_t* self) { @@ -70,7 +70,7 @@ cef_button_state_t CEF_CALLBACK button_get_state(struct _cef_button_t* self) { } void CEF_CALLBACK button_set_ink_drop_enabled(struct _cef_button_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,12 +78,11 @@ void CEF_CALLBACK button_set_ink_drop_enabled(struct _cef_button_t* self, return; // Execute - CefButtonCppToC::Get(self)->SetInkDropEnabled( - enabled?true:false); + CefButtonCppToC::Get(self)->SetInkDropEnabled(enabled ? true : false); } void CEF_CALLBACK button_set_tooltip_text(struct _cef_button_t* self, - const cef_string_t* tooltip_text) { + const cef_string_t* tooltip_text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,12 +94,11 @@ void CEF_CALLBACK button_set_tooltip_text(struct _cef_button_t* self, return; // Execute - CefButtonCppToC::Get(self)->SetTooltipText( - CefString(tooltip_text)); + CefButtonCppToC::Get(self)->SetTooltipText(CefString(tooltip_text)); } void CEF_CALLBACK button_set_accessible_name(struct _cef_button_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -112,12 +110,11 @@ void CEF_CALLBACK button_set_accessible_name(struct _cef_button_t* self, return; // Execute - CefButtonCppToC::Get(self)->SetAccessibleName( - CefString(name)); + CefButtonCppToC::Get(self)->SetAccessibleName(CefString(name)); } -cef_browser_view_t* CEF_CALLBACK button_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +button_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -125,8 +122,9 @@ cef_browser_view_t* CEF_CALLBACK button_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -140,8 +138,8 @@ cef_button_t* CEF_CALLBACK button_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -155,15 +153,15 @@ cef_panel_t* CEF_CALLBACK button_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK button_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +button_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,8 +169,9 @@ cef_scroll_view_t* CEF_CALLBACK button_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); @@ -186,15 +185,16 @@ cef_textfield_t* CEF_CALLBACK button_as_textfield(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK button_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +button_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,15 +202,16 @@ cef_string_userfree_t CEF_CALLBACK button_get_type_string( return NULL; // Execute - CefString _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetTypeString(); + CefString _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } cef_string_userfree_t CEF_CALLBACK button_to_string(struct _cef_view_t* self, - int include_children) { + int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -218,9 +219,9 @@ cef_string_userfree_t CEF_CALLBACK button_to_string(struct _cef_view_t* self, return NULL; // Execute - CefString _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ToString( - include_children?true:false); + CefString _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -234,8 +235,8 @@ int CEF_CALLBACK button_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->IsValid(); // Return type: bool return _retval; @@ -249,15 +250,15 @@ int CEF_CALLBACK button_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK button_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -269,16 +270,15 @@ int CEF_CALLBACK button_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK button_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +button_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -286,8 +286,9 @@ struct _cef_view_delegate_t* CEF_CALLBACK button_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); @@ -301,8 +302,8 @@ struct _cef_window_t* CEF_CALLBACK button_get_window(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -316,8 +317,8 @@ int CEF_CALLBACK button_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->GetID(); // Return type: simple return _retval; @@ -331,8 +332,7 @@ void CEF_CALLBACK button_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefButtonCppToC::Get(reinterpret_cast(self))->SetID(id); } int CEF_CALLBACK button_get_group_id(struct _cef_view_t* self) { @@ -343,8 +343,8 @@ int CEF_CALLBACK button_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->GetGroupID(); // Return type: simple return _retval; @@ -358,12 +358,12 @@ void CEF_CALLBACK button_set_group_id(struct _cef_view_t* self, int group_id) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetGroupID( - group_id); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK button_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +button_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -371,15 +371,16 @@ struct _cef_view_t* CEF_CALLBACK button_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK button_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +button_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -387,16 +388,16 @@ struct _cef_view_t* CEF_CALLBACK button_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefButtonCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK button_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -408,11 +409,11 @@ void CEF_CALLBACK button_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetBounds( - boundsVal); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK button_get_bounds(struct _cef_view_t* self) { @@ -423,8 +424,8 @@ cef_rect_t CEF_CALLBACK button_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetBounds(); + cef_rect_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->GetBounds(); // Return type: simple return _retval; @@ -438,15 +439,16 @@ cef_rect_t CEF_CALLBACK button_get_bounds_in_screen(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK button_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -458,11 +460,10 @@ void CEF_CALLBACK button_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefButtonCppToC::Get(reinterpret_cast(self))->SetSize(sizeVal); } cef_size_t CEF_CALLBACK button_get_size(struct _cef_view_t* self) { @@ -473,15 +474,15 @@ cef_size_t CEF_CALLBACK button_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetSize(); + cef_size_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK button_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -493,11 +494,11 @@ void CEF_CALLBACK button_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetPosition( - positionVal); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK button_get_position(struct _cef_view_t* self) { @@ -508,8 +509,9 @@ cef_point_t CEF_CALLBACK button_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetPosition(); + cef_point_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; @@ -523,8 +525,9 @@ cef_size_t CEF_CALLBACK button_get_preferred_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetPreferredSize(); + cef_size_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -538,8 +541,8 @@ void CEF_CALLBACK button_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK button_get_minimum_size(struct _cef_view_t* self) { @@ -550,8 +553,9 @@ cef_size_t CEF_CALLBACK button_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetMinimumSize(); + cef_size_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -565,15 +569,16 @@ cef_size_t CEF_CALLBACK button_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetMaximumSize(); + cef_size_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK button_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -581,9 +586,8 @@ int CEF_CALLBACK button_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -597,8 +601,8 @@ void CEF_CALLBACK button_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->InvalidateLayout( - ); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK button_set_visible(struct _cef_view_t* self, int visible) { @@ -609,8 +613,8 @@ void CEF_CALLBACK button_set_visible(struct _cef_view_t* self, int visible) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetVisible( - visible?true:false); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK button_is_visible(struct _cef_view_t* self) { @@ -621,8 +625,8 @@ int CEF_CALLBACK button_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->IsVisible(); // Return type: bool return _retval; @@ -636,8 +640,8 @@ int CEF_CALLBACK button_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->IsDrawn(); // Return type: bool return _retval; @@ -651,8 +655,8 @@ void CEF_CALLBACK button_set_enabled(struct _cef_view_t* self, int enabled) { return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetEnabled( - enabled?true:false); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK button_is_enabled(struct _cef_view_t* self) { @@ -663,15 +667,15 @@ int CEF_CALLBACK button_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self))->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK button_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -679,8 +683,8 @@ void CEF_CALLBACK button_set_focusable(struct _cef_view_t* self, return; // Execute - CefButtonCppToC::Get(reinterpret_cast(self))->SetFocusable( - focusable?true:false); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK button_is_focusable(struct _cef_view_t* self) { @@ -691,8 +695,8 @@ int CEF_CALLBACK button_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; @@ -706,8 +710,8 @@ int CEF_CALLBACK button_is_accessibility_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -725,7 +729,7 @@ void CEF_CALLBACK button_request_focus(struct _cef_view_t* self) { } void CEF_CALLBACK button_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -733,9 +737,8 @@ void CEF_CALLBACK button_set_background_color(struct _cef_view_t* self, return; // Execute - CefButtonCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefButtonCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } cef_color_t CEF_CALLBACK button_get_background_color(struct _cef_view_t* self) { @@ -746,15 +749,16 @@ cef_color_t CEF_CALLBACK button_get_background_color(struct _cef_view_t* self) { return 0; // Execute - cef_color_t _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->GetBackgroundColor(); + cef_color_t _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK button_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -766,12 +770,11 @@ int CEF_CALLBACK button_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -782,7 +785,7 @@ int CEF_CALLBACK button_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK button_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -794,12 +797,11 @@ int CEF_CALLBACK button_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -810,7 +812,7 @@ int CEF_CALLBACK button_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK button_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -822,12 +824,11 @@ int CEF_CALLBACK button_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -838,7 +839,7 @@ int CEF_CALLBACK button_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK button_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -850,12 +851,11 @@ int CEF_CALLBACK button_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -866,7 +866,8 @@ int CEF_CALLBACK button_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK button_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -882,13 +883,12 @@ int CEF_CALLBACK button_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -899,7 +899,8 @@ int CEF_CALLBACK button_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK button_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -915,13 +916,12 @@ int CEF_CALLBACK button_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -933,7 +933,6 @@ int CEF_CALLBACK button_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefButtonCppToC::CefButtonCppToC() { @@ -996,11 +995,14 @@ CefButtonCppToC::CefButtonCppToC() { GetStruct()->base.convert_point_from_view = button_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_button_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_button_t* s) { if (type == WT_LABEL_BUTTON) { - return CefLabelButtonCppToC::Unwrap(reinterpret_cast( - s)); + return CefLabelButtonCppToC::Unwrap( + reinterpret_cast(s)); } if (type == WT_MENU_BUTTON) { return CefMenuButtonCppToC::Unwrap(reinterpret_cast(s)); @@ -1010,9 +1012,12 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BUTTON; +template <> +CefWrapperType CefCppToCRefCounted:: + kWrapperType = WT_BUTTON; diff --git a/libcef_dll/cpptoc/views/button_cpptoc.h b/libcef_dll/cpptoc/views/button_cpptoc.h index 3ce365002..fe01fd6fa 100644 --- a/libcef_dll/cpptoc/views/button_cpptoc.h +++ b/libcef_dll/cpptoc/views/button_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4b8c8e3c2dda9ef0f51b5b05a5046cafdcd933fb$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_CPPTOC_H_ @@ -18,10 +20,10 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_button.h" #include "include/capi/views/cef_button_capi.h" -#include "include/views/cef_label_button.h" #include "include/capi/views/cef_label_button_capi.h" +#include "include/views/cef_button.h" +#include "include/views/cef_label_button.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc index 930bd1ab8..1cffad820 100644 --- a/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc @@ -9,19 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7e07045e8a886e123572c3063aadd61d8a9624e8$ +// #include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK button_delegate_on_button_pressed( - struct _cef_button_delegate_t* self, cef_button_t* button) { +void CEF_CALLBACK +button_delegate_on_button_pressed(struct _cef_button_delegate_t* self, + cef_button_t* button) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -37,8 +39,9 @@ void CEF_CALLBACK button_delegate_on_button_pressed( CefButtonCToCpp::Wrap(button)); } -void CEF_CALLBACK button_delegate_on_button_state_changed( - struct _cef_button_delegate_t* self, cef_button_t* button) { +void CEF_CALLBACK +button_delegate_on_button_state_changed(struct _cef_button_delegate_t* self, + cef_button_t* button) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -54,8 +57,9 @@ void CEF_CALLBACK button_delegate_on_button_state_changed( CefButtonCToCpp::Wrap(button)); } -cef_size_t CEF_CALLBACK button_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +button_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,15 +72,16 @@ cef_size_t CEF_CALLBACK button_delegate_get_preferred_size( // Execute cef_size_t _retval = CefButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK button_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +button_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -89,15 +94,16 @@ cef_size_t CEF_CALLBACK button_delegate_get_minimum_size( // Execute cef_size_t _retval = CefButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK button_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +button_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -110,15 +116,17 @@ cef_size_t CEF_CALLBACK button_delegate_get_maximum_size( // Execute cef_size_t _retval = CefButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK button_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +button_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,17 +139,18 @@ int CEF_CALLBACK button_delegate_get_height_for_width( // Execute int _retval = CefButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK button_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +button_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -157,16 +166,16 @@ void CEF_CALLBACK button_delegate_on_parent_view_changed( return; // Execute - CefButtonDelegateCppToC::Get(reinterpret_cast( - self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + CefButtonDelegateCppToC::Get(reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK button_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +button_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -182,15 +191,13 @@ void CEF_CALLBACK button_delegate_on_child_view_changed( return; // Execute - CefButtonDelegateCppToC::Get(reinterpret_cast( - self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + CefButtonDelegateCppToC::Get(reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } void CEF_CALLBACK button_delegate_on_focus(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,13 +209,12 @@ void CEF_CALLBACK button_delegate_on_focus(struct _cef_view_delegate_t* self, return; // Execute - CefButtonDelegateCppToC::Get(reinterpret_cast( - self))->OnFocus( - CefViewCToCpp::Wrap(view)); + CefButtonDelegateCppToC::Get(reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } void CEF_CALLBACK button_delegate_on_blur(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -220,14 +226,12 @@ void CEF_CALLBACK button_delegate_on_blur(struct _cef_view_delegate_t* self, return; // Execute - CefButtonDelegateCppToC::Get(reinterpret_cast( - self))->OnBlur( - CefViewCToCpp::Wrap(view)); + CefButtonDelegateCppToC::Get(reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefButtonDelegateCppToC::CefButtonDelegateCppToC() { @@ -246,9 +250,12 @@ CefButtonDelegateCppToC::CefButtonDelegateCppToC() { GetStruct()->base.on_blur = button_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_button_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefButtonDelegateCppToC, + CefButtonDelegate, + cef_button_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_button_delegate_t* s) { if (type == WT_MENU_BUTTON_DELEGATE) { return CefMenuButtonDelegateCppToC::Unwrap( reinterpret_cast(s)); @@ -258,10 +265,14 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BUTTON_DELEGATE; diff --git a/libcef_dll/cpptoc/views/button_delegate_cpptoc.h b/libcef_dll/cpptoc/views/button_delegate_cpptoc.h index add0ecf89..abad75a1a 100644 --- a/libcef_dll/cpptoc/views/button_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/button_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a541f3cf1af9fd7de2a481ca44dbcc2c4237b0d2$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_DELEGATE_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_button_delegate.h" +#include "include/capi/views/cef_button_capi.h" #include "include/capi/views/cef_button_delegate_capi.h" #include "include/views/cef_button.h" -#include "include/capi/views/cef_button_capi.h" +#include "include/views/cef_button_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefButtonDelegateCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefButtonDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/display_cpptoc.cc b/libcef_dll/cpptoc/views/display_cpptoc.cc index 760a08ebc..7e4240670 100644 --- a/libcef_dll/cpptoc/views/display_cpptoc.cc +++ b/libcef_dll/cpptoc/views/display_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=419a1382826b28236d1489946915172ab944e081$ +// #include #include "libcef_dll/cpptoc/views/display_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_display_t* cef_display_get_primary() { @@ -27,7 +28,8 @@ CEF_EXPORT cef_display_t* cef_display_get_primary() { } CEF_EXPORT cef_display_t* cef_display_get_nearest_point( - const cef_point_t* point, int input_pixel_coords) { + const cef_point_t* point, + int input_pixel_coords) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: point; type: simple_byref_const @@ -36,19 +38,19 @@ CEF_EXPORT cef_display_t* cef_display_get_nearest_point( return NULL; // Translate param: point; type: simple_byref_const - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute CefRefPtr _retval = CefDisplay::GetDisplayNearestPoint( - pointVal, - input_pixel_coords?true:false); + pointVal, input_pixel_coords ? true : false); // Return type: refptr_same return CefDisplayCppToC::Wrap(_retval); } CEF_EXPORT cef_display_t* cef_display_get_matching_bounds( - const cef_rect_t* bounds, int input_pixel_coords) { + const cef_rect_t* bounds, + int input_pixel_coords) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: bounds; type: simple_byref_const @@ -57,12 +59,11 @@ CEF_EXPORT cef_display_t* cef_display_get_matching_bounds( return NULL; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute CefRefPtr _retval = CefDisplay::GetDisplayMatchingBounds( - boundsVal, - input_pixel_coords?true:false); + boundsVal, input_pixel_coords ? true : false); // Return type: refptr_same return CefDisplayCppToC::Wrap(_retval); @@ -79,7 +80,7 @@ CEF_EXPORT size_t cef_display_get_count() { } CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, - cef_display_t** displays) { + cef_display_t** displays) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: displays; type: refptr_vec_same_byref @@ -88,7 +89,7 @@ CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, return; // Translate param: displays; type: refptr_vec_same_byref - std::vector > displaysList; + std::vector> displaysList; if (displaysCount && *displaysCount > 0 && displays) { for (size_t i = 0; i < *displaysCount; ++i) { displaysList.push_back(CefDisplayCppToC::Unwrap(displays[i])); @@ -96,8 +97,7 @@ CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, } // Execute - CefDisplay::GetAllDisplays( - displaysList); + CefDisplay::GetAllDisplays(displaysList); // Restore param: displays; type: refptr_vec_same_byref if (displaysCount && displays) { @@ -110,7 +110,6 @@ CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, } } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -129,8 +128,8 @@ int64 CEF_CALLBACK display_get_id(struct _cef_display_t* self) { return _retval; } -float CEF_CALLBACK display_get_device_scale_factor( - struct _cef_display_t* self) { +float CEF_CALLBACK +display_get_device_scale_factor(struct _cef_display_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -145,7 +144,7 @@ float CEF_CALLBACK display_get_device_scale_factor( } void CEF_CALLBACK display_convert_point_to_pixels(struct _cef_display_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -157,11 +156,10 @@ void CEF_CALLBACK display_convert_point_to_pixels(struct _cef_display_t* self, return; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - CefDisplayCppToC::Get(self)->ConvertPointToPixels( - pointVal); + CefDisplayCppToC::Get(self)->ConvertPointToPixels(pointVal); // Restore param: point; type: simple_byref if (point) @@ -169,7 +167,7 @@ void CEF_CALLBACK display_convert_point_to_pixels(struct _cef_display_t* self, } void CEF_CALLBACK display_convert_point_from_pixels(struct _cef_display_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -181,11 +179,10 @@ void CEF_CALLBACK display_convert_point_from_pixels(struct _cef_display_t* self, return; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - CefDisplayCppToC::Get(self)->ConvertPointFromPixels( - pointVal); + CefDisplayCppToC::Get(self)->ConvertPointFromPixels(pointVal); // Restore param: point; type: simple_byref if (point) @@ -236,7 +233,6 @@ int CEF_CALLBACK display_get_rotation(struct _cef_display_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefDisplayCppToC::CefDisplayCppToC() { @@ -249,17 +245,23 @@ CefDisplayCppToC::CefDisplayCppToC() { GetStruct()->get_rotation = display_get_rotation; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, cef_display_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DISPLAY; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DISPLAY; diff --git a/libcef_dll/cpptoc/views/display_cpptoc.h b/libcef_dll/cpptoc/views/display_cpptoc.h index 6faa6a1ad..14cd48124 100644 --- a/libcef_dll/cpptoc/views/display_cpptoc.h +++ b/libcef_dll/cpptoc/views/display_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=52e62629e88cc653226bf66f1628dbdff607b3c9$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_DISPLAY_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_DISPLAY_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_display.h" #include "include/capi/views/cef_display_capi.h" +#include "include/views/cef_display.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc b/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc index 08aa865ad..f97007e4f 100644 --- a/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc +++ b/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f780dd085b13ba188b549770e8a2d00cbe2d5c91$ +// #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_box_layout_t* CEF_CALLBACK fill_layout_as_box_layout( - struct _cef_layout_t* self) { +cef_box_layout_t* CEF_CALLBACK +fill_layout_as_box_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -27,15 +28,16 @@ cef_box_layout_t* CEF_CALLBACK fill_layout_as_box_layout( return NULL; // Execute - CefRefPtr _retval = CefFillLayoutCppToC::Get( - reinterpret_cast(self))->AsBoxLayout(); + CefRefPtr _retval = + CefFillLayoutCppToC::Get(reinterpret_cast(self)) + ->AsBoxLayout(); // Return type: refptr_same return CefBoxLayoutCppToC::Wrap(_retval); } -cef_fill_layout_t* CEF_CALLBACK fill_layout_as_fill_layout( - struct _cef_layout_t* self) { +cef_fill_layout_t* CEF_CALLBACK +fill_layout_as_fill_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -43,8 +45,9 @@ cef_fill_layout_t* CEF_CALLBACK fill_layout_as_fill_layout( return NULL; // Execute - CefRefPtr _retval = CefFillLayoutCppToC::Get( - reinterpret_cast(self))->AsFillLayout(); + CefRefPtr _retval = + CefFillLayoutCppToC::Get(reinterpret_cast(self)) + ->AsFillLayout(); // Return type: refptr_same return CefFillLayoutCppToC::Wrap(_retval); @@ -58,8 +61,9 @@ int CEF_CALLBACK fill_layout_is_valid(struct _cef_layout_t* self) { return 0; // Execute - bool _retval = CefFillLayoutCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefFillLayoutCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -67,7 +71,6 @@ int CEF_CALLBACK fill_layout_is_valid(struct _cef_layout_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefFillLayoutCppToC::CefFillLayoutCppToC() { @@ -76,17 +79,23 @@ CefFillLayoutCppToC::CefFillLayoutCppToC() { GetStruct()->base.is_valid = fill_layout_is_valid; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_fill_layout_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_fill_layout_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FILL_LAYOUT; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_FILL_LAYOUT; diff --git a/libcef_dll/cpptoc/views/fill_layout_cpptoc.h b/libcef_dll/cpptoc/views/fill_layout_cpptoc.h index 60c25c6a5..3f607ff16 100644 --- a/libcef_dll/cpptoc/views/fill_layout_cpptoc.h +++ b/libcef_dll/cpptoc/views/fill_layout_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a427b96b052be5219c47d3e3a27dacf15ad8a02f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_FILL_LAYOUT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_FILL_LAYOUT_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_fill_layout.h" #include "include/capi/views/cef_fill_layout_capi.h" +#include "include/views/cef_fill_layout.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefFillLayoutCppToC - : public CefCppToCRefCounted { +class CefFillLayoutCppToC : public CefCppToCRefCounted { public: CefFillLayoutCppToC(); }; diff --git a/libcef_dll/cpptoc/views/label_button_cpptoc.cc b/libcef_dll/cpptoc/views/label_button_cpptoc.cc index c300a3896..ca18a1502 100644 --- a/libcef_dll/cpptoc/views/label_button_cpptoc.cc +++ b/libcef_dll/cpptoc/views/label_button_cpptoc.cc @@ -9,10 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=855d24c5bb0627952e9a7549e98d023488d5fcd5$ +// +#include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" -#include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/views/label_button_cpptoc.h" #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" #include "libcef_dll/cpptoc/views/panel_cpptoc.h" @@ -23,11 +25,11 @@ #include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_label_button_t* cef_label_button_create( - cef_button_delegate_t* delegate, const cef_string_t* text, + cef_button_delegate_t* delegate, + const cef_string_t* text, int with_frame) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -39,21 +41,19 @@ CEF_EXPORT cef_label_button_t* cef_label_button_create( // Execute CefRefPtr _retval = CefLabelButton::CreateLabelButton( - CefButtonDelegateCToCpp::Wrap(delegate), - CefString(text), - with_frame?true:false); + CefButtonDelegateCToCpp::Wrap(delegate), CefString(text), + with_frame ? true : false); // Return type: refptr_same return CefLabelButtonCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_menu_button_t* CEF_CALLBACK label_button_as_menu_button( - struct _cef_label_button_t* self) { +cef_menu_button_t* CEF_CALLBACK +label_button_as_menu_button(struct _cef_label_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,15 +61,15 @@ cef_menu_button_t* CEF_CALLBACK label_button_as_menu_button( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - self)->AsMenuButton(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(self)->AsMenuButton(); // Return type: refptr_same return CefMenuButtonCppToC::Wrap(_retval); } void CEF_CALLBACK label_button_set_text(struct _cef_label_button_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,12 +81,11 @@ void CEF_CALLBACK label_button_set_text(struct _cef_label_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(self)->SetText( - CefString(text)); + CefLabelButtonCppToC::Get(self)->SetText(CefString(text)); } -cef_string_userfree_t CEF_CALLBACK label_button_get_text( - struct _cef_label_button_t* self) { +cef_string_userfree_t CEF_CALLBACK +label_button_get_text(struct _cef_label_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -101,7 +100,8 @@ cef_string_userfree_t CEF_CALLBACK label_button_get_text( } void CEF_CALLBACK label_button_set_image(struct _cef_label_button_t* self, - cef_button_state_t button_state, cef_image_t* image) { + cef_button_state_t button_state, + cef_image_t* image) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -110,13 +110,13 @@ void CEF_CALLBACK label_button_set_image(struct _cef_label_button_t* self, // Unverified params: image // Execute - CefLabelButtonCppToC::Get(self)->SetImage( - button_state, - CefImageCppToC::Unwrap(image)); + CefLabelButtonCppToC::Get(self)->SetImage(button_state, + CefImageCppToC::Unwrap(image)); } -cef_image_t* CEF_CALLBACK label_button_get_image( - struct _cef_label_button_t* self, cef_button_state_t button_state) { +cef_image_t* CEF_CALLBACK +label_button_get_image(struct _cef_label_button_t* self, + cef_button_state_t button_state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,15 +124,16 @@ cef_image_t* CEF_CALLBACK label_button_get_image( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get(self)->GetImage( - button_state); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(self)->GetImage(button_state); // Return type: refptr_same return CefImageCppToC::Wrap(_retval); } void CEF_CALLBACK label_button_set_text_color(struct _cef_label_button_t* self, - cef_button_state_t for_state, cef_color_t color) { + cef_button_state_t for_state, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -140,13 +141,12 @@ void CEF_CALLBACK label_button_set_text_color(struct _cef_label_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(self)->SetTextColor( - for_state, - color); + CefLabelButtonCppToC::Get(self)->SetTextColor(for_state, color); } -void CEF_CALLBACK label_button_set_enabled_text_colors( - struct _cef_label_button_t* self, cef_color_t color) { +void CEF_CALLBACK +label_button_set_enabled_text_colors(struct _cef_label_button_t* self, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,12 +154,11 @@ void CEF_CALLBACK label_button_set_enabled_text_colors( return; // Execute - CefLabelButtonCppToC::Get(self)->SetEnabledTextColors( - color); + CefLabelButtonCppToC::Get(self)->SetEnabledTextColors(color); } void CEF_CALLBACK label_button_set_font_list(struct _cef_label_button_t* self, - const cef_string_t* font_list) { + const cef_string_t* font_list) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,12 +170,12 @@ void CEF_CALLBACK label_button_set_font_list(struct _cef_label_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(self)->SetFontList( - CefString(font_list)); + CefLabelButtonCppToC::Get(self)->SetFontList(CefString(font_list)); } -void CEF_CALLBACK label_button_set_horizontal_alignment( - struct _cef_label_button_t* self, cef_horizontal_alignment_t alignment) { +void CEF_CALLBACK +label_button_set_horizontal_alignment(struct _cef_label_button_t* self, + cef_horizontal_alignment_t alignment) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -184,12 +183,12 @@ void CEF_CALLBACK label_button_set_horizontal_alignment( return; // Execute - CefLabelButtonCppToC::Get(self)->SetHorizontalAlignment( - alignment); + CefLabelButtonCppToC::Get(self)->SetHorizontalAlignment(alignment); } -void CEF_CALLBACK label_button_set_minimum_size( - struct _cef_label_button_t* self, const cef_size_t* size) { +void CEF_CALLBACK +label_button_set_minimum_size(struct _cef_label_button_t* self, + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -201,15 +200,15 @@ void CEF_CALLBACK label_button_set_minimum_size( return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefLabelButtonCppToC::Get(self)->SetMinimumSize( - sizeVal); + CefLabelButtonCppToC::Get(self)->SetMinimumSize(sizeVal); } -void CEF_CALLBACK label_button_set_maximum_size( - struct _cef_label_button_t* self, const cef_size_t* size) { +void CEF_CALLBACK +label_button_set_maximum_size(struct _cef_label_button_t* self, + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -221,15 +220,14 @@ void CEF_CALLBACK label_button_set_maximum_size( return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefLabelButtonCppToC::Get(self)->SetMaximumSize( - sizeVal); + CefLabelButtonCppToC::Get(self)->SetMaximumSize(sizeVal); } -cef_label_button_t* CEF_CALLBACK label_button_as_label_button( - struct _cef_button_t* self) { +cef_label_button_t* CEF_CALLBACK +label_button_as_label_button(struct _cef_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -237,15 +235,16 @@ cef_label_button_t* CEF_CALLBACK label_button_as_label_button( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsLabelButton(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsLabelButton(); // Return type: refptr_same return CefLabelButtonCppToC::Wrap(_retval); } void CEF_CALLBACK label_button_set_state(struct _cef_button_t* self, - cef_button_state_t state) { + cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,13 +252,12 @@ void CEF_CALLBACK label_button_set_state(struct _cef_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetState( - state); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetState(state); } -cef_button_state_t CEF_CALLBACK label_button_get_state( - struct _cef_button_t* self) { +cef_button_state_t CEF_CALLBACK +label_button_get_state(struct _cef_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -267,15 +265,16 @@ cef_button_state_t CEF_CALLBACK label_button_get_state( return CEF_BUTTON_STATE_NORMAL; // Execute - cef_button_state_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetState(); + cef_button_state_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetState(); // Return type: simple return _retval; } void CEF_CALLBACK label_button_set_ink_drop_enabled(struct _cef_button_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -283,13 +282,13 @@ void CEF_CALLBACK label_button_set_ink_drop_enabled(struct _cef_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetInkDropEnabled( - enabled?true:false); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetInkDropEnabled(enabled ? true : false); } -void CEF_CALLBACK label_button_set_tooltip_text(struct _cef_button_t* self, - const cef_string_t* tooltip_text) { +void CEF_CALLBACK +label_button_set_tooltip_text(struct _cef_button_t* self, + const cef_string_t* tooltip_text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -301,13 +300,12 @@ void CEF_CALLBACK label_button_set_tooltip_text(struct _cef_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetTooltipText( - CefString(tooltip_text)); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetTooltipText(CefString(tooltip_text)); } void CEF_CALLBACK label_button_set_accessible_name(struct _cef_button_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -319,13 +317,12 @@ void CEF_CALLBACK label_button_set_accessible_name(struct _cef_button_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetAccessibleName( - CefString(name)); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetAccessibleName(CefString(name)); } -cef_browser_view_t* CEF_CALLBACK label_button_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +label_button_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -333,8 +330,9 @@ cef_browser_view_t* CEF_CALLBACK label_button_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -348,8 +346,9 @@ cef_button_t* CEF_CALLBACK label_button_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -363,15 +362,16 @@ cef_panel_t* CEF_CALLBACK label_button_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK label_button_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +label_button_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -379,15 +379,16 @@ cef_scroll_view_t* CEF_CALLBACK label_button_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); } -cef_textfield_t* CEF_CALLBACK label_button_as_textfield( - struct _cef_view_t* self) { +cef_textfield_t* CEF_CALLBACK +label_button_as_textfield(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -395,15 +396,16 @@ cef_textfield_t* CEF_CALLBACK label_button_as_textfield( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK label_button_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +label_button_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -411,15 +413,16 @@ cef_string_userfree_t CEF_CALLBACK label_button_get_type_string( return NULL; // Execute - CefString _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetTypeString(); + CefString _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK label_button_to_string( - struct _cef_view_t* self, int include_children) { +cef_string_userfree_t CEF_CALLBACK +label_button_to_string(struct _cef_view_t* self, int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -427,9 +430,9 @@ cef_string_userfree_t CEF_CALLBACK label_button_to_string( return NULL; // Execute - CefString _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ToString( - include_children?true:false); + CefString _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -443,8 +446,9 @@ int CEF_CALLBACK label_button_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsValid(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -458,15 +462,16 @@ int CEF_CALLBACK label_button_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsAttached(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK label_button_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -478,16 +483,16 @@ int CEF_CALLBACK label_button_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK label_button_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +label_button_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -495,15 +500,16 @@ struct _cef_view_delegate_t* CEF_CALLBACK label_button_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); } -struct _cef_window_t* CEF_CALLBACK label_button_get_window( - struct _cef_view_t* self) { +struct _cef_window_t* CEF_CALLBACK +label_button_get_window(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -511,8 +517,9 @@ struct _cef_window_t* CEF_CALLBACK label_button_get_window( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -526,8 +533,9 @@ int CEF_CALLBACK label_button_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefLabelButtonCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetID(); // Return type: simple return _retval; @@ -541,8 +549,8 @@ void CEF_CALLBACK label_button_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetID(id); } int CEF_CALLBACK label_button_get_group_id(struct _cef_view_t* self) { @@ -553,15 +561,16 @@ int CEF_CALLBACK label_button_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefLabelButtonCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetGroupID(); // Return type: simple return _retval; } void CEF_CALLBACK label_button_set_group_id(struct _cef_view_t* self, - int group_id) { + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -569,13 +578,12 @@ void CEF_CALLBACK label_button_set_group_id(struct _cef_view_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetGroupID( - group_id); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK label_button_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +label_button_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -583,15 +591,16 @@ struct _cef_view_t* CEF_CALLBACK label_button_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK label_button_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +label_button_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -599,16 +608,16 @@ struct _cef_view_t* CEF_CALLBACK label_button_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK label_button_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -620,12 +629,11 @@ void CEF_CALLBACK label_button_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetBounds( - boundsVal); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK label_button_get_bounds(struct _cef_view_t* self) { @@ -636,15 +644,16 @@ cef_rect_t CEF_CALLBACK label_button_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetBounds(); + cef_rect_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetBounds(); // Return type: simple return _retval; } -cef_rect_t CEF_CALLBACK label_button_get_bounds_in_screen( - struct _cef_view_t* self) { +cef_rect_t CEF_CALLBACK +label_button_get_bounds_in_screen(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -652,15 +661,16 @@ cef_rect_t CEF_CALLBACK label_button_get_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK label_button_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -672,12 +682,11 @@ void CEF_CALLBACK label_button_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetSize( - sizeVal); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetSize(sizeVal); } cef_size_t CEF_CALLBACK label_button_get_size(struct _cef_view_t* self) { @@ -688,15 +697,16 @@ cef_size_t CEF_CALLBACK label_button_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetSize(); + cef_size_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK label_button_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -708,12 +718,11 @@ void CEF_CALLBACK label_button_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetPosition( - positionVal); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK label_button_get_position(struct _cef_view_t* self) { @@ -724,15 +733,16 @@ cef_point_t CEF_CALLBACK label_button_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetPosition(); + cef_point_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK label_button_get_preferred_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +label_button_get_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -740,15 +750,16 @@ cef_size_t CEF_CALLBACK label_button_get_preferred_size( return CefSize(); // Execute - cef_size_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetPreferredSize(); + cef_size_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; } -void CEF_CALLBACK label_button_size_to_preferred_size( - struct _cef_view_t* self) { +void CEF_CALLBACK +label_button_size_to_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -756,12 +767,12 @@ void CEF_CALLBACK label_button_size_to_preferred_size( return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } -cef_size_t CEF_CALLBACK label_button_get_minimum_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +label_button_get_minimum_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -769,15 +780,16 @@ cef_size_t CEF_CALLBACK label_button_get_minimum_size( return CefSize(); // Execute - cef_size_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetMinimumSize(); + cef_size_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK label_button_get_maximum_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +label_button_get_maximum_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -785,15 +797,16 @@ cef_size_t CEF_CALLBACK label_button_get_maximum_size( return CefSize(); // Execute - cef_size_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetMaximumSize(); + cef_size_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK label_button_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -801,9 +814,9 @@ int CEF_CALLBACK label_button_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefLabelButtonCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -817,12 +830,12 @@ void CEF_CALLBACK label_button_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->InvalidateLayout(); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK label_button_set_visible(struct _cef_view_t* self, - int visible) { + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -830,9 +843,8 @@ void CEF_CALLBACK label_button_set_visible(struct _cef_view_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetVisible( - visible?true:false); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK label_button_is_visible(struct _cef_view_t* self) { @@ -843,8 +855,9 @@ int CEF_CALLBACK label_button_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsVisible(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsVisible(); // Return type: bool return _retval; @@ -858,15 +871,16 @@ int CEF_CALLBACK label_button_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsDrawn(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsDrawn(); // Return type: bool return _retval; } void CEF_CALLBACK label_button_set_enabled(struct _cef_view_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -874,9 +888,8 @@ void CEF_CALLBACK label_button_set_enabled(struct _cef_view_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetEnabled( - enabled?true:false); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK label_button_is_enabled(struct _cef_view_t* self) { @@ -887,15 +900,16 @@ int CEF_CALLBACK label_button_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsEnabled(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK label_button_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -903,9 +917,8 @@ void CEF_CALLBACK label_button_set_focusable(struct _cef_view_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetFocusable( - focusable?true:false); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK label_button_is_focusable(struct _cef_view_t* self) { @@ -916,15 +929,16 @@ int CEF_CALLBACK label_button_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsFocusable(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; } -int CEF_CALLBACK label_button_is_accessibility_focusable( - struct _cef_view_t* self) { +int CEF_CALLBACK +label_button_is_accessibility_focusable(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -932,8 +946,9 @@ int CEF_CALLBACK label_button_is_accessibility_focusable( return 0; // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->IsAccessibilityFocusable(); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -947,12 +962,12 @@ void CEF_CALLBACK label_button_request_focus(struct _cef_view_t* self) { return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->RequestFocus(); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->RequestFocus(); } void CEF_CALLBACK label_button_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -960,13 +975,12 @@ void CEF_CALLBACK label_button_set_background_color(struct _cef_view_t* self, return; // Execute - CefLabelButtonCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } -cef_color_t CEF_CALLBACK label_button_get_background_color( - struct _cef_view_t* self) { +cef_color_t CEF_CALLBACK +label_button_get_background_color(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -974,15 +988,16 @@ cef_color_t CEF_CALLBACK label_button_get_background_color( return 0; // Execute - cef_color_t _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->GetBackgroundColor(); + cef_color_t _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK label_button_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -994,12 +1009,12 @@ int CEF_CALLBACK label_button_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointToScreen( - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1009,8 +1024,9 @@ int CEF_CALLBACK label_button_convert_point_to_screen(struct _cef_view_t* self, return _retval; } -int CEF_CALLBACK label_button_convert_point_from_screen( - struct _cef_view_t* self, cef_point_t* point) { +int CEF_CALLBACK +label_button_convert_point_from_screen(struct _cef_view_t* self, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1022,12 +1038,12 @@ int CEF_CALLBACK label_button_convert_point_from_screen( return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointFromScreen( - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1038,7 +1054,7 @@ int CEF_CALLBACK label_button_convert_point_from_screen( } int CEF_CALLBACK label_button_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1050,12 +1066,12 @@ int CEF_CALLBACK label_button_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointToWindow( - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1065,8 +1081,9 @@ int CEF_CALLBACK label_button_convert_point_to_window(struct _cef_view_t* self, return _retval; } -int CEF_CALLBACK label_button_convert_point_from_window( - struct _cef_view_t* self, cef_point_t* point) { +int CEF_CALLBACK +label_button_convert_point_from_window(struct _cef_view_t* self, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1078,12 +1095,12 @@ int CEF_CALLBACK label_button_convert_point_from_window( return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointFromWindow( - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1094,7 +1111,8 @@ int CEF_CALLBACK label_button_convert_point_from_window( } int CEF_CALLBACK label_button_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1110,13 +1128,12 @@ int CEF_CALLBACK label_button_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1127,7 +1144,8 @@ int CEF_CALLBACK label_button_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK label_button_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1143,13 +1161,12 @@ int CEF_CALLBACK label_button_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefLabelButtonCppToC::Get( - reinterpret_cast(self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefLabelButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1161,7 +1178,6 @@ int CEF_CALLBACK label_button_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefLabelButtonCppToC::CefLabelButtonCppToC() { @@ -1244,9 +1260,10 @@ CefLabelButtonCppToC::CefLabelButtonCppToC() { label_button_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_label_button_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_label_button_t* s) { if (type == WT_MENU_BUTTON) { return CefMenuButtonCppToC::Unwrap(reinterpret_cast(s)); } @@ -1255,9 +1272,14 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LABEL_BUTTON; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_LABEL_BUTTON; diff --git a/libcef_dll/cpptoc/views/label_button_cpptoc.h b/libcef_dll/cpptoc/views/label_button_cpptoc.h index d3a0ca2e3..79599aa88 100644 --- a/libcef_dll/cpptoc/views/label_button_cpptoc.h +++ b/libcef_dll/cpptoc/views/label_button_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d7fa3b055397a7b033b2342d1c57b0b62bb185a7$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LABEL_BUTTON_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_LABEL_BUTTON_CPPTOC_H_ @@ -18,17 +20,17 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_label_button.h" #include "include/capi/views/cef_label_button_capi.h" -#include "include/views/cef_menu_button.h" #include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_label_button.h" +#include "include/views/cef_menu_button.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefLabelButtonCppToC - : public CefCppToCRefCounted { +class CefLabelButtonCppToC : public CefCppToCRefCounted { public: CefLabelButtonCppToC(); }; diff --git a/libcef_dll/cpptoc/views/layout_cpptoc.cc b/libcef_dll/cpptoc/views/layout_cpptoc.cc index 1ec3283fa..c84f9c45a 100644 --- a/libcef_dll/cpptoc/views/layout_cpptoc.cc +++ b/libcef_dll/cpptoc/views/layout_cpptoc.cc @@ -9,18 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b6e3efc1fe708d14feafbc283fc33e6acef2cca9$ +// #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/layout_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_box_layout_t* CEF_CALLBACK layout_as_box_layout( - struct _cef_layout_t* self) { +cef_box_layout_t* CEF_CALLBACK +layout_as_box_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,8 +35,8 @@ cef_box_layout_t* CEF_CALLBACK layout_as_box_layout( return CefBoxLayoutCppToC::Wrap(_retval); } -cef_fill_layout_t* CEF_CALLBACK layout_as_fill_layout( - struct _cef_layout_t* self) { +cef_fill_layout_t* CEF_CALLBACK +layout_as_fill_layout(struct _cef_layout_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -65,7 +66,6 @@ int CEF_CALLBACK layout_is_valid(struct _cef_layout_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefLayoutCppToC::CefLayoutCppToC() { @@ -74,8 +74,11 @@ CefLayoutCppToC::CefLayoutCppToC() { GetStruct()->is_valid = layout_is_valid; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_layout_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_layout_t* s) { if (type == WT_BOX_LAYOUT) { return CefBoxLayoutCppToC::Unwrap(reinterpret_cast(s)); } @@ -87,9 +90,12 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LAYOUT; +template <> +CefWrapperType CefCppToCRefCounted:: + kWrapperType = WT_LAYOUT; diff --git a/libcef_dll/cpptoc/views/layout_cpptoc.h b/libcef_dll/cpptoc/views/layout_cpptoc.h index bb8347afa..c68e8b90b 100644 --- a/libcef_dll/cpptoc/views/layout_cpptoc.h +++ b/libcef_dll/cpptoc/views/layout_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=709b97b7a0681318066ea81342a04e3b61859930$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LAYOUT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_LAYOUT_CPPTOC_H_ @@ -18,12 +20,12 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_layout.h" +#include "include/capi/views/cef_box_layout_capi.h" +#include "include/capi/views/cef_fill_layout_capi.h" #include "include/capi/views/cef_layout_capi.h" #include "include/views/cef_box_layout.h" -#include "include/capi/views/cef_box_layout_capi.h" #include "include/views/cef_fill_layout.h" -#include "include/capi/views/cef_fill_layout_capi.h" +#include "include/views/cef_layout.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/menu_button_cpptoc.cc b/libcef_dll/cpptoc/views/menu_button_cpptoc.cc index 2ab91ffa1..7f746a2c1 100644 --- a/libcef_dll/cpptoc/views/menu_button_cpptoc.cc +++ b/libcef_dll/cpptoc/views/menu_button_cpptoc.cc @@ -9,13 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f1689b3276c5e026ab2c6fa9ee5c272fd82ef476$ +// +#include "libcef_dll/cpptoc/image_cpptoc.h" +#include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" -#include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/views/label_button_cpptoc.h" #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" -#include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/cpptoc/views/panel_cpptoc.h" #include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" #include "libcef_dll/cpptoc/views/textfield_cpptoc.h" @@ -24,12 +26,13 @@ #include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_menu_button_t* cef_menu_button_create( - cef_menu_button_delegate_t* delegate, const cef_string_t* text, - int with_frame, int with_menu_marker) { + cef_menu_button_delegate_t* delegate, + const cef_string_t* text, + int with_frame, + int with_menu_marker) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: delegate; type: refptr_diff @@ -40,23 +43,22 @@ CEF_EXPORT cef_menu_button_t* cef_menu_button_create( // Execute CefRefPtr _retval = CefMenuButton::CreateMenuButton( - CefMenuButtonDelegateCToCpp::Wrap(delegate), - CefString(text), - with_frame?true:false, - with_menu_marker?true:false); + CefMenuButtonDelegateCToCpp::Wrap(delegate), CefString(text), + with_frame ? true : false, with_menu_marker ? true : false); // Return type: refptr_same return CefMenuButtonCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK menu_button_show_menu(struct _cef_menu_button_t* self, - cef_menu_model_t* menu_model, const cef_point_t* screen_point, - cef_menu_anchor_position_t anchor_position) { +void CEF_CALLBACK +menu_button_show_menu(struct _cef_menu_button_t* self, + cef_menu_model_t* menu_model, + const cef_point_t* screen_point, + cef_menu_anchor_position_t anchor_position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -72,13 +74,11 @@ void CEF_CALLBACK menu_button_show_menu(struct _cef_menu_button_t* self, return; // Translate param: screen_point; type: simple_byref_const - CefPoint screen_pointVal = screen_point?*screen_point:CefPoint(); + CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint(); // Execute CefMenuButtonCppToC::Get(self)->ShowMenu( - CefMenuModelCppToC::Unwrap(menu_model), - screen_pointVal, - anchor_position); + CefMenuModelCppToC::Unwrap(menu_model), screen_pointVal, anchor_position); } void CEF_CALLBACK menu_button_trigger_menu(struct _cef_menu_button_t* self) { @@ -92,8 +92,8 @@ void CEF_CALLBACK menu_button_trigger_menu(struct _cef_menu_button_t* self) { CefMenuButtonCppToC::Get(self)->TriggerMenu(); } -cef_menu_button_t* CEF_CALLBACK menu_button_as_menu_button( - struct _cef_label_button_t* self) { +cef_menu_button_t* CEF_CALLBACK +menu_button_as_menu_button(struct _cef_label_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -101,15 +101,16 @@ cef_menu_button_t* CEF_CALLBACK menu_button_as_menu_button( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsMenuButton(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsMenuButton(); // Return type: refptr_same return CefMenuButtonCppToC::Wrap(_retval); } void CEF_CALLBACK menu_button_set_text(struct _cef_label_button_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -121,12 +122,12 @@ void CEF_CALLBACK menu_button_set_text(struct _cef_label_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast(self))->SetText( - CefString(text)); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetText(CefString(text)); } -cef_string_userfree_t CEF_CALLBACK menu_button_get_text( - struct _cef_label_button_t* self) { +cef_string_userfree_t CEF_CALLBACK +menu_button_get_text(struct _cef_label_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -134,15 +135,17 @@ cef_string_userfree_t CEF_CALLBACK menu_button_get_text( return NULL; // Execute - CefString _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetText(); + CefString _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetText(); // Return type: string return _retval.DetachToUserFree(); } void CEF_CALLBACK menu_button_set_image(struct _cef_label_button_t* self, - cef_button_state_t button_state, cef_image_t* image) { + cef_button_state_t button_state, + cef_image_t* image) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -151,14 +154,13 @@ void CEF_CALLBACK menu_button_set_image(struct _cef_label_button_t* self, // Unverified params: image // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetImage( - button_state, - CefImageCppToC::Unwrap(image)); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetImage(button_state, CefImageCppToC::Unwrap(image)); } -cef_image_t* CEF_CALLBACK menu_button_get_image( - struct _cef_label_button_t* self, cef_button_state_t button_state) { +cef_image_t* CEF_CALLBACK +menu_button_get_image(struct _cef_label_button_t* self, + cef_button_state_t button_state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -166,16 +168,17 @@ cef_image_t* CEF_CALLBACK menu_button_get_image( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetImage( - button_state); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetImage(button_state); // Return type: refptr_same return CefImageCppToC::Wrap(_retval); } void CEF_CALLBACK menu_button_set_text_color(struct _cef_label_button_t* self, - cef_button_state_t for_state, cef_color_t color) { + cef_button_state_t for_state, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -183,14 +186,13 @@ void CEF_CALLBACK menu_button_set_text_color(struct _cef_label_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetTextColor( - for_state, - color); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetTextColor(for_state, color); } -void CEF_CALLBACK menu_button_set_enabled_text_colors( - struct _cef_label_button_t* self, cef_color_t color) { +void CEF_CALLBACK +menu_button_set_enabled_text_colors(struct _cef_label_button_t* self, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -198,13 +200,12 @@ void CEF_CALLBACK menu_button_set_enabled_text_colors( return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetEnabledTextColors( - color); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetEnabledTextColors(color); } void CEF_CALLBACK menu_button_set_font_list(struct _cef_label_button_t* self, - const cef_string_t* font_list) { + const cef_string_t* font_list) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -216,13 +217,13 @@ void CEF_CALLBACK menu_button_set_font_list(struct _cef_label_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetFontList( - CefString(font_list)); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetFontList(CefString(font_list)); } -void CEF_CALLBACK menu_button_set_horizontal_alignment( - struct _cef_label_button_t* self, cef_horizontal_alignment_t alignment) { +void CEF_CALLBACK +menu_button_set_horizontal_alignment(struct _cef_label_button_t* self, + cef_horizontal_alignment_t alignment) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -230,13 +231,12 @@ void CEF_CALLBACK menu_button_set_horizontal_alignment( return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetHorizontalAlignment( - alignment); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetHorizontalAlignment(alignment); } void CEF_CALLBACK menu_button_set_minimum_size(struct _cef_label_button_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -248,16 +248,15 @@ void CEF_CALLBACK menu_button_set_minimum_size(struct _cef_label_button_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetMinimumSize( - sizeVal); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetMinimumSize(sizeVal); } void CEF_CALLBACK menu_button_set_maximum_size(struct _cef_label_button_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -269,16 +268,15 @@ void CEF_CALLBACK menu_button_set_maximum_size(struct _cef_label_button_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetMaximumSize( - sizeVal); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetMaximumSize(sizeVal); } -cef_label_button_t* CEF_CALLBACK menu_button_as_label_button( - struct _cef_button_t* self) { +cef_label_button_t* CEF_CALLBACK +menu_button_as_label_button(struct _cef_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -286,15 +284,16 @@ cef_label_button_t* CEF_CALLBACK menu_button_as_label_button( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsLabelButton(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsLabelButton(); // Return type: refptr_same return CefLabelButtonCppToC::Wrap(_retval); } void CEF_CALLBACK menu_button_set_state(struct _cef_button_t* self, - cef_button_state_t state) { + cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -302,13 +301,12 @@ void CEF_CALLBACK menu_button_set_state(struct _cef_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetState( - state); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetState(state); } -cef_button_state_t CEF_CALLBACK menu_button_get_state( - struct _cef_button_t* self) { +cef_button_state_t CEF_CALLBACK +menu_button_get_state(struct _cef_button_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -316,15 +314,16 @@ cef_button_state_t CEF_CALLBACK menu_button_get_state( return CEF_BUTTON_STATE_NORMAL; // Execute - cef_button_state_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetState(); + cef_button_state_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetState(); // Return type: simple return _retval; } void CEF_CALLBACK menu_button_set_ink_drop_enabled(struct _cef_button_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -332,13 +331,13 @@ void CEF_CALLBACK menu_button_set_ink_drop_enabled(struct _cef_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetInkDropEnabled( - enabled?true:false); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetInkDropEnabled(enabled ? true : false); } -void CEF_CALLBACK menu_button_set_tooltip_text(struct _cef_button_t* self, - const cef_string_t* tooltip_text) { +void CEF_CALLBACK +menu_button_set_tooltip_text(struct _cef_button_t* self, + const cef_string_t* tooltip_text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -350,13 +349,12 @@ void CEF_CALLBACK menu_button_set_tooltip_text(struct _cef_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetTooltipText( - CefString(tooltip_text)); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetTooltipText(CefString(tooltip_text)); } void CEF_CALLBACK menu_button_set_accessible_name(struct _cef_button_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -368,13 +366,12 @@ void CEF_CALLBACK menu_button_set_accessible_name(struct _cef_button_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetAccessibleName( - CefString(name)); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetAccessibleName(CefString(name)); } -cef_browser_view_t* CEF_CALLBACK menu_button_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +menu_button_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -382,8 +379,9 @@ cef_browser_view_t* CEF_CALLBACK menu_button_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -397,8 +395,9 @@ cef_button_t* CEF_CALLBACK menu_button_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -412,15 +411,16 @@ cef_panel_t* CEF_CALLBACK menu_button_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK menu_button_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +menu_button_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -428,15 +428,16 @@ cef_scroll_view_t* CEF_CALLBACK menu_button_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); } -cef_textfield_t* CEF_CALLBACK menu_button_as_textfield( - struct _cef_view_t* self) { +cef_textfield_t* CEF_CALLBACK +menu_button_as_textfield(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -444,15 +445,16 @@ cef_textfield_t* CEF_CALLBACK menu_button_as_textfield( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK menu_button_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +menu_button_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -460,15 +462,16 @@ cef_string_userfree_t CEF_CALLBACK menu_button_get_type_string( return NULL; // Execute - CefString _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetTypeString(); + CefString _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK menu_button_to_string( - struct _cef_view_t* self, int include_children) { +cef_string_userfree_t CEF_CALLBACK +menu_button_to_string(struct _cef_view_t* self, int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -476,9 +479,9 @@ cef_string_userfree_t CEF_CALLBACK menu_button_to_string( return NULL; // Execute - CefString _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->ToString( - include_children?true:false); + CefString _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -492,8 +495,9 @@ int CEF_CALLBACK menu_button_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -507,15 +511,16 @@ int CEF_CALLBACK menu_button_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK menu_button_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -527,16 +532,16 @@ int CEF_CALLBACK menu_button_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK menu_button_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +menu_button_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -544,15 +549,16 @@ struct _cef_view_delegate_t* CEF_CALLBACK menu_button_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); } -struct _cef_window_t* CEF_CALLBACK menu_button_get_window( - struct _cef_view_t* self) { +struct _cef_window_t* CEF_CALLBACK +menu_button_get_window(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -560,8 +566,9 @@ struct _cef_window_t* CEF_CALLBACK menu_button_get_window( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -575,8 +582,9 @@ int CEF_CALLBACK menu_button_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetID(); // Return type: simple return _retval; @@ -590,8 +598,8 @@ void CEF_CALLBACK menu_button_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetID(id); } int CEF_CALLBACK menu_button_get_group_id(struct _cef_view_t* self) { @@ -602,15 +610,16 @@ int CEF_CALLBACK menu_button_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetGroupID(); // Return type: simple return _retval; } void CEF_CALLBACK menu_button_set_group_id(struct _cef_view_t* self, - int group_id) { + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -618,13 +627,12 @@ void CEF_CALLBACK menu_button_set_group_id(struct _cef_view_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetGroupID( - group_id); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK menu_button_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +menu_button_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -632,15 +640,16 @@ struct _cef_view_t* CEF_CALLBACK menu_button_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK menu_button_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +menu_button_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -648,16 +657,16 @@ struct _cef_view_t* CEF_CALLBACK menu_button_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK menu_button_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -669,12 +678,11 @@ void CEF_CALLBACK menu_button_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetBounds( - boundsVal); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK menu_button_get_bounds(struct _cef_view_t* self) { @@ -685,15 +693,16 @@ cef_rect_t CEF_CALLBACK menu_button_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetBounds(); + cef_rect_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetBounds(); // Return type: simple return _retval; } -cef_rect_t CEF_CALLBACK menu_button_get_bounds_in_screen( - struct _cef_view_t* self) { +cef_rect_t CEF_CALLBACK +menu_button_get_bounds_in_screen(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -701,15 +710,16 @@ cef_rect_t CEF_CALLBACK menu_button_get_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK menu_button_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -721,11 +731,11 @@ void CEF_CALLBACK menu_button_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefMenuButtonCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetSize(sizeVal); } cef_size_t CEF_CALLBACK menu_button_get_size(struct _cef_view_t* self) { @@ -736,15 +746,16 @@ cef_size_t CEF_CALLBACK menu_button_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetSize(); + cef_size_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK menu_button_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -756,12 +767,11 @@ void CEF_CALLBACK menu_button_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetPosition( - positionVal); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK menu_button_get_position(struct _cef_view_t* self) { @@ -772,15 +782,16 @@ cef_point_t CEF_CALLBACK menu_button_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetPosition(); + cef_point_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK menu_button_get_preferred_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +menu_button_get_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -788,8 +799,9 @@ cef_size_t CEF_CALLBACK menu_button_get_preferred_size( return CefSize(); // Execute - cef_size_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetPreferredSize(); + cef_size_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -803,8 +815,8 @@ void CEF_CALLBACK menu_button_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK menu_button_get_minimum_size(struct _cef_view_t* self) { @@ -815,8 +827,9 @@ cef_size_t CEF_CALLBACK menu_button_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetMinimumSize(); + cef_size_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -830,15 +843,16 @@ cef_size_t CEF_CALLBACK menu_button_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetMaximumSize(); + cef_size_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK menu_button_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -846,9 +860,9 @@ int CEF_CALLBACK menu_button_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -862,12 +876,12 @@ void CEF_CALLBACK menu_button_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->InvalidateLayout(); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK menu_button_set_visible(struct _cef_view_t* self, - int visible) { + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -875,9 +889,8 @@ void CEF_CALLBACK menu_button_set_visible(struct _cef_view_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetVisible( - visible?true:false); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK menu_button_is_visible(struct _cef_view_t* self) { @@ -888,8 +901,9 @@ int CEF_CALLBACK menu_button_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsVisible(); // Return type: bool return _retval; @@ -903,15 +917,16 @@ int CEF_CALLBACK menu_button_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsDrawn(); // Return type: bool return _retval; } void CEF_CALLBACK menu_button_set_enabled(struct _cef_view_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -919,9 +934,8 @@ void CEF_CALLBACK menu_button_set_enabled(struct _cef_view_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetEnabled( - enabled?true:false); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK menu_button_is_enabled(struct _cef_view_t* self) { @@ -932,15 +946,16 @@ int CEF_CALLBACK menu_button_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK menu_button_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -948,9 +963,8 @@ void CEF_CALLBACK menu_button_set_focusable(struct _cef_view_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetFocusable( - focusable?true:false); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK menu_button_is_focusable(struct _cef_view_t* self) { @@ -961,15 +975,16 @@ int CEF_CALLBACK menu_button_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; } -int CEF_CALLBACK menu_button_is_accessibility_focusable( - struct _cef_view_t* self) { +int CEF_CALLBACK +menu_button_is_accessibility_focusable(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -977,8 +992,9 @@ int CEF_CALLBACK menu_button_is_accessibility_focusable( return 0; // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -992,12 +1008,12 @@ void CEF_CALLBACK menu_button_request_focus(struct _cef_view_t* self) { return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->RequestFocus(); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->RequestFocus(); } void CEF_CALLBACK menu_button_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1005,13 +1021,12 @@ void CEF_CALLBACK menu_button_set_background_color(struct _cef_view_t* self, return; // Execute - CefMenuButtonCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } -cef_color_t CEF_CALLBACK menu_button_get_background_color( - struct _cef_view_t* self) { +cef_color_t CEF_CALLBACK +menu_button_get_background_color(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1019,15 +1034,16 @@ cef_color_t CEF_CALLBACK menu_button_get_background_color( return 0; // Execute - cef_color_t _retval = CefMenuButtonCppToC::Get( - reinterpret_cast(self))->GetBackgroundColor(); + cef_color_t _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK menu_button_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1039,12 +1055,12 @@ int CEF_CALLBACK menu_button_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1055,7 +1071,7 @@ int CEF_CALLBACK menu_button_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK menu_button_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1067,12 +1083,12 @@ int CEF_CALLBACK menu_button_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1083,7 +1099,7 @@ int CEF_CALLBACK menu_button_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK menu_button_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1095,12 +1111,12 @@ int CEF_CALLBACK menu_button_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1111,7 +1127,7 @@ int CEF_CALLBACK menu_button_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK menu_button_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1123,12 +1139,12 @@ int CEF_CALLBACK menu_button_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1139,7 +1155,8 @@ int CEF_CALLBACK menu_button_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK menu_button_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1155,13 +1172,12 @@ int CEF_CALLBACK menu_button_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1172,7 +1188,8 @@ int CEF_CALLBACK menu_button_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK menu_button_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1188,13 +1205,12 @@ int CEF_CALLBACK menu_button_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefMenuButtonCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefMenuButtonCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1206,7 +1222,6 @@ int CEF_CALLBACK menu_button_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefMenuButtonCppToC::CefMenuButtonCppToC() { @@ -1295,17 +1310,23 @@ CefMenuButtonCppToC::CefMenuButtonCppToC() { menu_button_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_menu_button_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_menu_button_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_BUTTON; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_MENU_BUTTON; diff --git a/libcef_dll/cpptoc/views/menu_button_cpptoc.h b/libcef_dll/cpptoc/views/menu_button_cpptoc.h index d45ea6aa4..4c5822783 100644 --- a/libcef_dll/cpptoc/views/menu_button_cpptoc.h +++ b/libcef_dll/cpptoc/views/menu_button_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d630dbad95607fbb076035ba1760e959016f4867$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_menu_button.h" #include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_menu_button.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefMenuButtonCppToC - : public CefCppToCRefCounted { +class CefMenuButtonCppToC : public CefCppToCRefCounted { public: CefMenuButtonCppToC(); }; diff --git a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc index f86c6b4b8..16cfcfdba 100644 --- a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc @@ -9,19 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5fb2df4d0f1e5e3eae470c6808edee2a9cf1d52a$ +// #include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" #include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK menu_button_delegate_on_menu_button_pressed( - struct _cef_menu_button_delegate_t* self, cef_menu_button_t* menu_button, + struct _cef_menu_button_delegate_t* self, + cef_menu_button_t* menu_button, const cef_point_t* screen_point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -38,16 +40,16 @@ void CEF_CALLBACK menu_button_delegate_on_menu_button_pressed( return; // Translate param: screen_point; type: simple_byref_const - CefPoint screen_pointVal = screen_point?*screen_point:CefPoint(); + CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint(); // Execute CefMenuButtonDelegateCppToC::Get(self)->OnMenuButtonPressed( - CefMenuButtonCToCpp::Wrap(menu_button), - screen_pointVal); + CefMenuButtonCToCpp::Wrap(menu_button), screen_pointVal); } -void CEF_CALLBACK menu_button_delegate_on_button_pressed( - struct _cef_button_delegate_t* self, cef_button_t* button) { +void CEF_CALLBACK +menu_button_delegate_on_button_pressed(struct _cef_button_delegate_t* self, + cef_button_t* button) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,12 +62,13 @@ void CEF_CALLBACK menu_button_delegate_on_button_pressed( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->OnButtonPressed( - CefButtonCToCpp::Wrap(button)); + reinterpret_cast(self)) + ->OnButtonPressed(CefButtonCToCpp::Wrap(button)); } void CEF_CALLBACK menu_button_delegate_on_button_state_changed( - struct _cef_button_delegate_t* self, cef_button_t* button) { + struct _cef_button_delegate_t* self, + cef_button_t* button) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,13 +81,13 @@ void CEF_CALLBACK menu_button_delegate_on_button_state_changed( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast( - self))->OnButtonStateChanged( - CefButtonCToCpp::Wrap(button)); + reinterpret_cast(self)) + ->OnButtonStateChanged(CefButtonCToCpp::Wrap(button)); } -cef_size_t CEF_CALLBACK menu_button_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +menu_button_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -97,15 +100,16 @@ cef_size_t CEF_CALLBACK menu_button_delegate_get_preferred_size( // Execute cef_size_t _retval = CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK menu_button_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +menu_button_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -118,15 +122,16 @@ cef_size_t CEF_CALLBACK menu_button_delegate_get_minimum_size( // Execute cef_size_t _retval = CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK menu_button_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +menu_button_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,15 +144,17 @@ cef_size_t CEF_CALLBACK menu_button_delegate_get_maximum_size( // Execute cef_size_t _retval = CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK menu_button_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +menu_button_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -160,17 +167,18 @@ int CEF_CALLBACK menu_button_delegate_get_height_for_width( // Execute int _retval = CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK menu_button_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +menu_button_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -187,15 +195,16 @@ void CEF_CALLBACK menu_button_delegate_on_parent_view_changed( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK menu_button_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +menu_button_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -212,14 +221,14 @@ void CEF_CALLBACK menu_button_delegate_on_child_view_changed( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } -void CEF_CALLBACK menu_button_delegate_on_focus( - struct _cef_view_delegate_t* self, cef_view_t* view) { +void CEF_CALLBACK +menu_button_delegate_on_focus(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -232,12 +241,13 @@ void CEF_CALLBACK menu_button_delegate_on_focus( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->OnFocus( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } -void CEF_CALLBACK menu_button_delegate_on_blur( - struct _cef_view_delegate_t* self, cef_view_t* view) { +void CEF_CALLBACK +menu_button_delegate_on_blur(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -250,13 +260,12 @@ void CEF_CALLBACK menu_button_delegate_on_blur( // Execute CefMenuButtonDelegateCppToC::Get( - reinterpret_cast(self))->OnBlur( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefMenuButtonDelegateCppToC::CefMenuButtonDelegateCppToC() { @@ -281,18 +290,26 @@ CefMenuButtonDelegateCppToC::CefMenuButtonDelegateCppToC() { GetStruct()->base.base.on_blur = menu_button_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_menu_button_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefMenuButtonDelegateCppToC, + CefMenuButtonDelegate, + cef_menu_button_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_menu_button_delegate_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_BUTTON_DELEGATE; diff --git a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h index 339320471..12de1c013 100644 --- a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bb001eb3753ab4ab8e4fb10ae1aadea6e5db0ffb$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_DELEGATE_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_menu_button_delegate.h" +#include "include/capi/views/cef_menu_button_capi.h" #include "include/capi/views/cef_menu_button_delegate_capi.h" #include "include/views/cef_menu_button.h" -#include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_menu_button_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefMenuButtonDelegateCppToC : public CefCppToCRefCounted { + CefMenuButtonDelegate, + cef_menu_button_delegate_t> { public: CefMenuButtonDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/panel_cpptoc.cc b/libcef_dll/cpptoc/views/panel_cpptoc.cc index 633800797..5da20a38a 100644 --- a/libcef_dll/cpptoc/views/panel_cpptoc.cc +++ b/libcef_dll/cpptoc/views/panel_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2d4b60447f6e9e1ccc04b5e76f1635ffd3484075$ +// #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" @@ -23,7 +25,6 @@ #include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_panel_t* cef_panel_create(cef_panel_delegate_t* delegate) { @@ -32,14 +33,13 @@ CEF_EXPORT cef_panel_t* cef_panel_create(cef_panel_delegate_t* delegate) { // Unverified params: delegate // Execute - CefRefPtr _retval = CefPanel::CreatePanel( - CefPanelDelegateCToCpp::Wrap(delegate)); + CefRefPtr _retval = + CefPanel::CreatePanel(CefPanelDelegateCToCpp::Wrap(delegate)); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -58,8 +58,8 @@ struct _cef_window_t* CEF_CALLBACK panel_as_window(struct _cef_panel_t* self) { return CefWindowCppToC::Wrap(_retval); } -cef_fill_layout_t* CEF_CALLBACK panel_set_to_fill_layout( - struct _cef_panel_t* self) { +cef_fill_layout_t* CEF_CALLBACK +panel_set_to_fill_layout(struct _cef_panel_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -67,16 +67,16 @@ cef_fill_layout_t* CEF_CALLBACK panel_set_to_fill_layout( return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get(self)->SetToFillLayout( - ); + CefRefPtr _retval = + CefPanelCppToC::Get(self)->SetToFillLayout(); // Return type: refptr_same return CefFillLayoutCppToC::Wrap(_retval); } -cef_box_layout_t* CEF_CALLBACK panel_set_to_box_layout( - struct _cef_panel_t* self, - const struct _cef_box_layout_settings_t* settings) { +cef_box_layout_t* CEF_CALLBACK +panel_set_to_box_layout(struct _cef_panel_t* self, + const struct _cef_box_layout_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +93,8 @@ cef_box_layout_t* CEF_CALLBACK panel_set_to_box_layout( settingsObj.Set(*settings, false); // Execute - CefRefPtr _retval = CefPanelCppToC::Get(self)->SetToBoxLayout( - settingsObj); + CefRefPtr _retval = + CefPanelCppToC::Get(self)->SetToBoxLayout(settingsObj); // Return type: refptr_same return CefBoxLayoutCppToC::Wrap(_retval); @@ -126,7 +126,7 @@ void CEF_CALLBACK panel_layout(struct _cef_panel_t* self) { } void CEF_CALLBACK panel_add_child_view(struct _cef_panel_t* self, - struct _cef_view_t* view) { + struct _cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -138,12 +138,12 @@ void CEF_CALLBACK panel_add_child_view(struct _cef_panel_t* self, return; // Execute - CefPanelCppToC::Get(self)->AddChildView( - CefViewCppToC::Unwrap(view)); + CefPanelCppToC::Get(self)->AddChildView(CefViewCppToC::Unwrap(view)); } void CEF_CALLBACK panel_add_child_view_at(struct _cef_panel_t* self, - struct _cef_view_t* view, int index) { + struct _cef_view_t* view, + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,13 +159,12 @@ void CEF_CALLBACK panel_add_child_view_at(struct _cef_panel_t* self, return; // Execute - CefPanelCppToC::Get(self)->AddChildViewAt( - CefViewCppToC::Unwrap(view), - index); + CefPanelCppToC::Get(self)->AddChildViewAt(CefViewCppToC::Unwrap(view), index); } void CEF_CALLBACK panel_reorder_child_view(struct _cef_panel_t* self, - struct _cef_view_t* view, int index) { + struct _cef_view_t* view, + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -177,13 +176,12 @@ void CEF_CALLBACK panel_reorder_child_view(struct _cef_panel_t* self, return; // Execute - CefPanelCppToC::Get(self)->ReorderChildView( - CefViewCppToC::Unwrap(view), - index); + CefPanelCppToC::Get(self)->ReorderChildView(CefViewCppToC::Unwrap(view), + index); } void CEF_CALLBACK panel_remove_child_view(struct _cef_panel_t* self, - struct _cef_view_t* view) { + struct _cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -195,8 +193,7 @@ void CEF_CALLBACK panel_remove_child_view(struct _cef_panel_t* self, return; // Execute - CefPanelCppToC::Get(self)->RemoveChildView( - CefViewCppToC::Unwrap(view)); + CefPanelCppToC::Get(self)->RemoveChildView(CefViewCppToC::Unwrap(view)); } void CEF_CALLBACK panel_remove_all_child_views(struct _cef_panel_t* self) { @@ -224,8 +221,8 @@ size_t CEF_CALLBACK panel_get_child_view_count(struct _cef_panel_t* self) { return _retval; } -struct _cef_view_t* CEF_CALLBACK panel_get_child_view_at( - struct _cef_panel_t* self, int index) { +struct _cef_view_t* CEF_CALLBACK +panel_get_child_view_at(struct _cef_panel_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -237,15 +234,14 @@ struct _cef_view_t* CEF_CALLBACK panel_get_child_view_at( return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get(self)->GetChildViewAt( - index); + CefRefPtr _retval = CefPanelCppToC::Get(self)->GetChildViewAt(index); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -cef_browser_view_t* CEF_CALLBACK panel_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +panel_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,8 +249,9 @@ cef_browser_view_t* CEF_CALLBACK panel_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -268,8 +265,8 @@ cef_button_t* CEF_CALLBACK panel_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -283,8 +280,8 @@ cef_panel_t* CEF_CALLBACK panel_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); @@ -298,8 +295,8 @@ cef_scroll_view_t* CEF_CALLBACK panel_as_scroll_view(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); @@ -313,15 +310,15 @@ cef_textfield_t* CEF_CALLBACK panel_as_textfield(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK panel_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +panel_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -329,15 +326,15 @@ cef_string_userfree_t CEF_CALLBACK panel_get_type_string( return NULL; // Execute - CefString _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetTypeString(); + CefString _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } cef_string_userfree_t CEF_CALLBACK panel_to_string(struct _cef_view_t* self, - int include_children) { + int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -345,9 +342,8 @@ cef_string_userfree_t CEF_CALLBACK panel_to_string(struct _cef_view_t* self, return NULL; // Execute - CefString _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ToString( - include_children?true:false); + CefString _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -361,8 +357,8 @@ int CEF_CALLBACK panel_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsValid(); // Return type: bool return _retval; @@ -376,15 +372,15 @@ int CEF_CALLBACK panel_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK panel_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -396,16 +392,15 @@ int CEF_CALLBACK panel_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK panel_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +panel_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -413,8 +408,8 @@ struct _cef_view_delegate_t* CEF_CALLBACK panel_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); @@ -428,8 +423,8 @@ struct _cef_window_t* CEF_CALLBACK panel_get_window(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -443,8 +438,8 @@ int CEF_CALLBACK panel_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetID(); // Return type: simple return _retval; @@ -458,8 +453,7 @@ void CEF_CALLBACK panel_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefPanelCppToC::Get(reinterpret_cast(self))->SetID(id); } int CEF_CALLBACK panel_get_group_id(struct _cef_view_t* self) { @@ -470,8 +464,8 @@ int CEF_CALLBACK panel_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetGroupID(); // Return type: simple return _retval; @@ -485,12 +479,12 @@ void CEF_CALLBACK panel_set_group_id(struct _cef_view_t* self, int group_id) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetGroupID( - group_id); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK panel_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +panel_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -498,15 +492,16 @@ struct _cef_view_t* CEF_CALLBACK panel_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } struct _cef_view_t* CEF_CALLBACK panel_get_view_for_id(struct _cef_view_t* self, - int id) { + int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -514,16 +509,16 @@ struct _cef_view_t* CEF_CALLBACK panel_get_view_for_id(struct _cef_view_t* self, return NULL; // Execute - CefRefPtr _retval = CefPanelCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK panel_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -535,11 +530,11 @@ void CEF_CALLBACK panel_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetBounds( - boundsVal); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK panel_get_bounds(struct _cef_view_t* self) { @@ -550,8 +545,8 @@ cef_rect_t CEF_CALLBACK panel_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetBounds(); + cef_rect_t _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetBounds(); // Return type: simple return _retval; @@ -565,15 +560,15 @@ cef_rect_t CEF_CALLBACK panel_get_bounds_in_screen(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetBoundsInScreen(); + cef_rect_t _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK panel_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -585,11 +580,10 @@ void CEF_CALLBACK panel_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefPanelCppToC::Get(reinterpret_cast(self))->SetSize(sizeVal); } cef_size_t CEF_CALLBACK panel_get_size(struct _cef_view_t* self) { @@ -600,15 +594,15 @@ cef_size_t CEF_CALLBACK panel_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetSize(); + cef_size_t _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK panel_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -620,11 +614,11 @@ void CEF_CALLBACK panel_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetPosition( - positionVal); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK panel_get_position(struct _cef_view_t* self) { @@ -635,8 +629,8 @@ cef_point_t CEF_CALLBACK panel_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetPosition(); + cef_point_t _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->GetPosition(); // Return type: simple return _retval; @@ -650,8 +644,8 @@ cef_size_t CEF_CALLBACK panel_get_preferred_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetPreferredSize(); + cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -665,8 +659,8 @@ void CEF_CALLBACK panel_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK panel_get_minimum_size(struct _cef_view_t* self) { @@ -677,8 +671,8 @@ cef_size_t CEF_CALLBACK panel_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetMinimumSize(); + cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -692,15 +686,15 @@ cef_size_t CEF_CALLBACK panel_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetMaximumSize(); + cef_size_t _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK panel_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -708,9 +702,8 @@ int CEF_CALLBACK panel_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -735,8 +728,8 @@ void CEF_CALLBACK panel_set_visible(struct _cef_view_t* self, int visible) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetVisible( - visible?true:false); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK panel_is_visible(struct _cef_view_t* self) { @@ -747,8 +740,8 @@ int CEF_CALLBACK panel_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsVisible(); // Return type: bool return _retval; @@ -762,8 +755,8 @@ int CEF_CALLBACK panel_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsDrawn(); // Return type: bool return _retval; @@ -777,8 +770,8 @@ void CEF_CALLBACK panel_set_enabled(struct _cef_view_t* self, int enabled) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetEnabled( - enabled?true:false); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK panel_is_enabled(struct _cef_view_t* self) { @@ -789,8 +782,8 @@ int CEF_CALLBACK panel_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsEnabled(); // Return type: bool return _retval; @@ -804,8 +797,8 @@ void CEF_CALLBACK panel_set_focusable(struct _cef_view_t* self, int focusable) { return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetFocusable( - focusable?true:false); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK panel_is_focusable(struct _cef_view_t* self) { @@ -816,8 +809,8 @@ int CEF_CALLBACK panel_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self))->IsFocusable(); // Return type: bool return _retval; @@ -831,8 +824,8 @@ int CEF_CALLBACK panel_is_accessibility_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -850,7 +843,7 @@ void CEF_CALLBACK panel_request_focus(struct _cef_view_t* self) { } void CEF_CALLBACK panel_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -858,8 +851,8 @@ void CEF_CALLBACK panel_set_background_color(struct _cef_view_t* self, return; // Execute - CefPanelCppToC::Get(reinterpret_cast(self))->SetBackgroundColor( - color); + CefPanelCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } cef_color_t CEF_CALLBACK panel_get_background_color(struct _cef_view_t* self) { @@ -870,15 +863,16 @@ cef_color_t CEF_CALLBACK panel_get_background_color(struct _cef_view_t* self) { return 0; // Execute - cef_color_t _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->GetBackgroundColor(); + cef_color_t _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK panel_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -890,12 +884,11 @@ int CEF_CALLBACK panel_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -906,7 +899,7 @@ int CEF_CALLBACK panel_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK panel_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -918,12 +911,11 @@ int CEF_CALLBACK panel_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -934,7 +926,7 @@ int CEF_CALLBACK panel_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK panel_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -946,12 +938,11 @@ int CEF_CALLBACK panel_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -962,7 +953,7 @@ int CEF_CALLBACK panel_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK panel_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -974,12 +965,11 @@ int CEF_CALLBACK panel_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -990,7 +980,8 @@ int CEF_CALLBACK panel_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK panel_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1006,13 +997,12 @@ int CEF_CALLBACK panel_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1023,7 +1013,8 @@ int CEF_CALLBACK panel_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK panel_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1039,13 +1030,12 @@ int CEF_CALLBACK panel_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefPanelCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefPanelCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1057,7 +1047,6 @@ int CEF_CALLBACK panel_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPanelCppToC::CefPanelCppToC() { @@ -1124,8 +1113,11 @@ CefPanelCppToC::CefPanelCppToC() { GetStruct()->base.convert_point_from_view = panel_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_panel_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_panel_t* s) { if (type == WT_WINDOW) { return CefWindowCppToC::Unwrap(reinterpret_cast(s)); } @@ -1134,9 +1126,12 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PANEL; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_PANEL; diff --git a/libcef_dll/cpptoc/views/panel_cpptoc.h b/libcef_dll/cpptoc/views/panel_cpptoc.h index 0bf452265..2dc50f3a8 100644 --- a/libcef_dll/cpptoc/views/panel_cpptoc.h +++ b/libcef_dll/cpptoc/views/panel_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c6eb4bd13fab27f265a692432a8f17de2b9ac471$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_CPPTOC_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_panel.h" -#include "include/capi/views/cef_panel_capi.h" -#include "include/views/cef_box_layout.h" #include "include/capi/views/cef_box_layout_capi.h" -#include "include/views/cef_fill_layout.h" #include "include/capi/views/cef_fill_layout_capi.h" -#include "include/views/cef_layout.h" #include "include/capi/views/cef_layout_capi.h" -#include "include/views/cef_window.h" +#include "include/capi/views/cef_panel_capi.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_box_layout.h" +#include "include/views/cef_fill_layout.h" +#include "include/views/cef_layout.h" +#include "include/views/cef_panel.h" +#include "include/views/cef_window.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc index 443ab7aa6..e2e7796d1 100644 --- a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c918146a8bbbc5f3e93e6471f9dbab9ca74785a9$ +// #include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_size_t CEF_CALLBACK panel_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +panel_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,16 +34,17 @@ cef_size_t CEF_CALLBACK panel_delegate_get_preferred_size( return CefSize(); // Execute - cef_size_t _retval = CefPanelDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + cef_size_t _retval = + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK panel_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +panel_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,16 +56,17 @@ cef_size_t CEF_CALLBACK panel_delegate_get_minimum_size( return CefSize(); // Execute - cef_size_t _retval = CefPanelDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + cef_size_t _retval = + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK panel_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +panel_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,16 +78,18 @@ cef_size_t CEF_CALLBACK panel_delegate_get_maximum_size( return CefSize(); // Execute - cef_size_t _retval = CefPanelDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + cef_size_t _retval = + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK panel_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +panel_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,18 +101,19 @@ int CEF_CALLBACK panel_delegate_get_height_for_width( return 0; // Execute - int _retval = CefPanelDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + int _retval = + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK panel_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +panel_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -122,16 +129,16 @@ void CEF_CALLBACK panel_delegate_on_parent_view_changed( return; // Execute - CefPanelDelegateCppToC::Get(reinterpret_cast( - self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK panel_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +panel_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -147,15 +154,13 @@ void CEF_CALLBACK panel_delegate_on_child_view_changed( return; // Execute - CefPanelDelegateCppToC::Get(reinterpret_cast( - self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } void CEF_CALLBACK panel_delegate_on_focus(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -167,13 +172,12 @@ void CEF_CALLBACK panel_delegate_on_focus(struct _cef_view_delegate_t* self, return; // Execute - CefPanelDelegateCppToC::Get(reinterpret_cast( - self))->OnFocus( - CefViewCToCpp::Wrap(view)); + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } void CEF_CALLBACK panel_delegate_on_blur(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,14 +189,12 @@ void CEF_CALLBACK panel_delegate_on_blur(struct _cef_view_delegate_t* self, return; // Execute - CefPanelDelegateCppToC::Get(reinterpret_cast( - self))->OnBlur( - CefViewCToCpp::Wrap(view)); + CefPanelDelegateCppToC::Get(reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefPanelDelegateCppToC::CefPanelDelegateCppToC() { @@ -208,9 +210,12 @@ CefPanelDelegateCppToC::CefPanelDelegateCppToC() { GetStruct()->base.on_blur = panel_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_panel_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefPanelDelegateCppToC, + CefPanelDelegate, + cef_panel_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_panel_delegate_t* s) { if (type == WT_WINDOW_DELEGATE) { return CefWindowDelegateCppToC::Unwrap( reinterpret_cast(s)); @@ -220,9 +225,14 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PANEL_DELEGATE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_PANEL_DELEGATE; diff --git a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h index 562dacf1f..55ab43034 100644 --- a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9d5bf927058637f4aca443730b31acadff656c09$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_DELEGATE_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_panel_delegate.h" #include "include/capi/views/cef_panel_delegate_capi.h" +#include "include/views/cef_panel_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefPanelDelegateCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefPanelDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc b/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc index 72011d048..ed300c0c8 100644 --- a/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc +++ b/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2babe5bd3069d25994beb6d122d59b0038c5a2bb$ +// #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" @@ -19,7 +21,6 @@ #include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_scroll_view_t* cef_scroll_view_create( @@ -29,20 +30,19 @@ CEF_EXPORT cef_scroll_view_t* cef_scroll_view_create( // Unverified params: delegate // Execute - CefRefPtr _retval = CefScrollView::CreateScrollView( - CefViewDelegateCToCpp::Wrap(delegate)); + CefRefPtr _retval = + CefScrollView::CreateScrollView(CefViewDelegateCToCpp::Wrap(delegate)); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK scroll_view_set_content_view(struct _cef_scroll_view_t* self, - struct _cef_view_t* view) { + struct _cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -54,12 +54,11 @@ void CEF_CALLBACK scroll_view_set_content_view(struct _cef_scroll_view_t* self, return; // Execute - CefScrollViewCppToC::Get(self)->SetContentView( - CefViewCppToC::Unwrap(view)); + CefScrollViewCppToC::Get(self)->SetContentView(CefViewCppToC::Unwrap(view)); } -struct _cef_view_t* CEF_CALLBACK scroll_view_get_content_view( - struct _cef_scroll_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +scroll_view_get_content_view(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -73,8 +72,8 @@ struct _cef_view_t* CEF_CALLBACK scroll_view_get_content_view( return CefViewCppToC::Wrap(_retval); } -cef_rect_t CEF_CALLBACK scroll_view_get_visible_content_rect( - struct _cef_scroll_view_t* self) { +cef_rect_t CEF_CALLBACK +scroll_view_get_visible_content_rect(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,8 +87,8 @@ cef_rect_t CEF_CALLBACK scroll_view_get_visible_content_rect( return _retval; } -int CEF_CALLBACK scroll_view_has_horizontal_scrollbar( - struct _cef_scroll_view_t* self) { +int CEF_CALLBACK +scroll_view_has_horizontal_scrollbar(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -103,8 +102,8 @@ int CEF_CALLBACK scroll_view_has_horizontal_scrollbar( return _retval; } -int CEF_CALLBACK scroll_view_get_horizontal_scrollbar_height( - struct _cef_scroll_view_t* self) { +int CEF_CALLBACK +scroll_view_get_horizontal_scrollbar_height(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -118,8 +117,8 @@ int CEF_CALLBACK scroll_view_get_horizontal_scrollbar_height( return _retval; } -int CEF_CALLBACK scroll_view_has_vertical_scrollbar( - struct _cef_scroll_view_t* self) { +int CEF_CALLBACK +scroll_view_has_vertical_scrollbar(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -133,8 +132,8 @@ int CEF_CALLBACK scroll_view_has_vertical_scrollbar( return _retval; } -int CEF_CALLBACK scroll_view_get_vertical_scrollbar_width( - struct _cef_scroll_view_t* self) { +int CEF_CALLBACK +scroll_view_get_vertical_scrollbar_width(struct _cef_scroll_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,8 +147,8 @@ int CEF_CALLBACK scroll_view_get_vertical_scrollbar_width( return _retval; } -cef_browser_view_t* CEF_CALLBACK scroll_view_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +scroll_view_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -157,8 +156,9 @@ cef_browser_view_t* CEF_CALLBACK scroll_view_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -172,8 +172,9 @@ cef_button_t* CEF_CALLBACK scroll_view_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -187,15 +188,16 @@ cef_panel_t* CEF_CALLBACK scroll_view_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK scroll_view_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +scroll_view_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -203,15 +205,16 @@ cef_scroll_view_t* CEF_CALLBACK scroll_view_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); } -cef_textfield_t* CEF_CALLBACK scroll_view_as_textfield( - struct _cef_view_t* self) { +cef_textfield_t* CEF_CALLBACK +scroll_view_as_textfield(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -219,15 +222,16 @@ cef_textfield_t* CEF_CALLBACK scroll_view_as_textfield( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK scroll_view_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +scroll_view_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -235,15 +239,16 @@ cef_string_userfree_t CEF_CALLBACK scroll_view_get_type_string( return NULL; // Execute - CefString _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetTypeString(); + CefString _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK scroll_view_to_string( - struct _cef_view_t* self, int include_children) { +cef_string_userfree_t CEF_CALLBACK +scroll_view_to_string(struct _cef_view_t* self, int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -251,9 +256,9 @@ cef_string_userfree_t CEF_CALLBACK scroll_view_to_string( return NULL; // Execute - CefString _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->ToString( - include_children?true:false); + CefString _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -267,8 +272,9 @@ int CEF_CALLBACK scroll_view_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -282,15 +288,16 @@ int CEF_CALLBACK scroll_view_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK scroll_view_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -302,16 +309,16 @@ int CEF_CALLBACK scroll_view_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK scroll_view_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +scroll_view_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -319,15 +326,16 @@ struct _cef_view_delegate_t* CEF_CALLBACK scroll_view_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); } -struct _cef_window_t* CEF_CALLBACK scroll_view_get_window( - struct _cef_view_t* self) { +struct _cef_window_t* CEF_CALLBACK +scroll_view_get_window(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -335,8 +343,9 @@ struct _cef_window_t* CEF_CALLBACK scroll_view_get_window( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -350,8 +359,9 @@ int CEF_CALLBACK scroll_view_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetID(); // Return type: simple return _retval; @@ -365,8 +375,8 @@ void CEF_CALLBACK scroll_view_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetID(id); } int CEF_CALLBACK scroll_view_get_group_id(struct _cef_view_t* self) { @@ -377,15 +387,16 @@ int CEF_CALLBACK scroll_view_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetGroupID(); // Return type: simple return _retval; } void CEF_CALLBACK scroll_view_set_group_id(struct _cef_view_t* self, - int group_id) { + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -393,13 +404,12 @@ void CEF_CALLBACK scroll_view_set_group_id(struct _cef_view_t* self, return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetGroupID( - group_id); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK scroll_view_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +scroll_view_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -407,15 +417,16 @@ struct _cef_view_t* CEF_CALLBACK scroll_view_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK scroll_view_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +scroll_view_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -423,16 +434,16 @@ struct _cef_view_t* CEF_CALLBACK scroll_view_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK scroll_view_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -444,12 +455,11 @@ void CEF_CALLBACK scroll_view_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetBounds( - boundsVal); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK scroll_view_get_bounds(struct _cef_view_t* self) { @@ -460,15 +470,16 @@ cef_rect_t CEF_CALLBACK scroll_view_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetBounds(); + cef_rect_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetBounds(); // Return type: simple return _retval; } -cef_rect_t CEF_CALLBACK scroll_view_get_bounds_in_screen( - struct _cef_view_t* self) { +cef_rect_t CEF_CALLBACK +scroll_view_get_bounds_in_screen(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -476,15 +487,16 @@ cef_rect_t CEF_CALLBACK scroll_view_get_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK scroll_view_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -496,11 +508,11 @@ void CEF_CALLBACK scroll_view_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefScrollViewCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetSize(sizeVal); } cef_size_t CEF_CALLBACK scroll_view_get_size(struct _cef_view_t* self) { @@ -511,15 +523,16 @@ cef_size_t CEF_CALLBACK scroll_view_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetSize(); + cef_size_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK scroll_view_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -531,12 +544,11 @@ void CEF_CALLBACK scroll_view_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetPosition( - positionVal); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK scroll_view_get_position(struct _cef_view_t* self) { @@ -547,15 +559,16 @@ cef_point_t CEF_CALLBACK scroll_view_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetPosition(); + cef_point_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK scroll_view_get_preferred_size( - struct _cef_view_t* self) { +cef_size_t CEF_CALLBACK +scroll_view_get_preferred_size(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -563,8 +576,9 @@ cef_size_t CEF_CALLBACK scroll_view_get_preferred_size( return CefSize(); // Execute - cef_size_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetPreferredSize(); + cef_size_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -578,8 +592,8 @@ void CEF_CALLBACK scroll_view_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK scroll_view_get_minimum_size(struct _cef_view_t* self) { @@ -590,8 +604,9 @@ cef_size_t CEF_CALLBACK scroll_view_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetMinimumSize(); + cef_size_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -605,15 +620,16 @@ cef_size_t CEF_CALLBACK scroll_view_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetMaximumSize(); + cef_size_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK scroll_view_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -621,9 +637,9 @@ int CEF_CALLBACK scroll_view_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -637,12 +653,12 @@ void CEF_CALLBACK scroll_view_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->InvalidateLayout(); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK scroll_view_set_visible(struct _cef_view_t* self, - int visible) { + int visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -650,9 +666,8 @@ void CEF_CALLBACK scroll_view_set_visible(struct _cef_view_t* self, return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetVisible( - visible?true:false); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK scroll_view_is_visible(struct _cef_view_t* self) { @@ -663,8 +678,9 @@ int CEF_CALLBACK scroll_view_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsVisible(); // Return type: bool return _retval; @@ -678,15 +694,16 @@ int CEF_CALLBACK scroll_view_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsDrawn(); // Return type: bool return _retval; } void CEF_CALLBACK scroll_view_set_enabled(struct _cef_view_t* self, - int enabled) { + int enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -694,9 +711,8 @@ void CEF_CALLBACK scroll_view_set_enabled(struct _cef_view_t* self, return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetEnabled( - enabled?true:false); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK scroll_view_is_enabled(struct _cef_view_t* self) { @@ -707,15 +723,16 @@ int CEF_CALLBACK scroll_view_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK scroll_view_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -723,9 +740,8 @@ void CEF_CALLBACK scroll_view_set_focusable(struct _cef_view_t* self, return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetFocusable( - focusable?true:false); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK scroll_view_is_focusable(struct _cef_view_t* self) { @@ -736,15 +752,16 @@ int CEF_CALLBACK scroll_view_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; } -int CEF_CALLBACK scroll_view_is_accessibility_focusable( - struct _cef_view_t* self) { +int CEF_CALLBACK +scroll_view_is_accessibility_focusable(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -752,8 +769,9 @@ int CEF_CALLBACK scroll_view_is_accessibility_focusable( return 0; // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -767,12 +785,12 @@ void CEF_CALLBACK scroll_view_request_focus(struct _cef_view_t* self) { return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->RequestFocus(); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->RequestFocus(); } void CEF_CALLBACK scroll_view_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -780,13 +798,12 @@ void CEF_CALLBACK scroll_view_set_background_color(struct _cef_view_t* self, return; // Execute - CefScrollViewCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } -cef_color_t CEF_CALLBACK scroll_view_get_background_color( - struct _cef_view_t* self) { +cef_color_t CEF_CALLBACK +scroll_view_get_background_color(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -794,15 +811,16 @@ cef_color_t CEF_CALLBACK scroll_view_get_background_color( return 0; // Execute - cef_color_t _retval = CefScrollViewCppToC::Get( - reinterpret_cast(self))->GetBackgroundColor(); + cef_color_t _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK scroll_view_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -814,12 +832,12 @@ int CEF_CALLBACK scroll_view_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -830,7 +848,7 @@ int CEF_CALLBACK scroll_view_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK scroll_view_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -842,12 +860,12 @@ int CEF_CALLBACK scroll_view_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -858,7 +876,7 @@ int CEF_CALLBACK scroll_view_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK scroll_view_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -870,12 +888,12 @@ int CEF_CALLBACK scroll_view_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -886,7 +904,7 @@ int CEF_CALLBACK scroll_view_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK scroll_view_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -898,12 +916,12 @@ int CEF_CALLBACK scroll_view_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -914,7 +932,8 @@ int CEF_CALLBACK scroll_view_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK scroll_view_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -930,13 +949,12 @@ int CEF_CALLBACK scroll_view_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -947,7 +965,8 @@ int CEF_CALLBACK scroll_view_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK scroll_view_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -963,13 +982,12 @@ int CEF_CALLBACK scroll_view_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefScrollViewCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefScrollViewCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -981,7 +999,6 @@ int CEF_CALLBACK scroll_view_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefScrollViewCppToC::CefScrollViewCppToC() { @@ -1050,17 +1067,23 @@ CefScrollViewCppToC::CefScrollViewCppToC() { scroll_view_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_scroll_view_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_scroll_view_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SCROLL_VIEW; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_SCROLL_VIEW; diff --git a/libcef_dll/cpptoc/views/scroll_view_cpptoc.h b/libcef_dll/cpptoc/views/scroll_view_cpptoc.h index 64a126b27..8feab43e2 100644 --- a/libcef_dll/cpptoc/views/scroll_view_cpptoc.h +++ b/libcef_dll/cpptoc/views/scroll_view_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f5dc83615127caab80e5406ef6b38b042b2e4ae8$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_SCROLL_VIEW_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_SCROLL_VIEW_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_scroll_view.h" #include "include/capi/views/cef_scroll_view_capi.h" +#include "include/views/cef_scroll_view.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefScrollViewCppToC - : public CefCppToCRefCounted { +class CefScrollViewCppToC : public CefCppToCRefCounted { public: CefScrollViewCppToC(); }; diff --git a/libcef_dll/cpptoc/views/textfield_cpptoc.cc b/libcef_dll/cpptoc/views/textfield_cpptoc.cc index 425df515c..d8b2f11a1 100644 --- a/libcef_dll/cpptoc/views/textfield_cpptoc.cc +++ b/libcef_dll/cpptoc/views/textfield_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6fb57aee9c6bdbdfbbb93fd99d1ffb5c95675cfc$ +// #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" @@ -20,7 +22,6 @@ #include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_textfield_t* cef_textfield_create( @@ -30,20 +31,19 @@ CEF_EXPORT cef_textfield_t* cef_textfield_create( // Unverified params: delegate // Execute - CefRefPtr _retval = CefTextfield::CreateTextfield( - CefTextfieldDelegateCToCpp::Wrap(delegate)); + CefRefPtr _retval = + CefTextfield::CreateTextfield(CefTextfieldDelegateCToCpp::Wrap(delegate)); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK textfield_set_password_input(struct _cef_textfield_t* self, - int password_input) { + int password_input) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +51,8 @@ void CEF_CALLBACK textfield_set_password_input(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetPasswordInput( - password_input?true:false); + CefTextfieldCppToC::Get(self)->SetPasswordInput(password_input ? true + : false); } int CEF_CALLBACK textfield_is_password_input(struct _cef_textfield_t* self) { @@ -70,7 +70,7 @@ int CEF_CALLBACK textfield_is_password_input(struct _cef_textfield_t* self) { } void CEF_CALLBACK textfield_set_read_only(struct _cef_textfield_t* self, - int read_only) { + int read_only) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,8 +78,7 @@ void CEF_CALLBACK textfield_set_read_only(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetReadOnly( - read_only?true:false); + CefTextfieldCppToC::Get(self)->SetReadOnly(read_only ? true : false); } int CEF_CALLBACK textfield_is_read_only(struct _cef_textfield_t* self) { @@ -96,8 +95,8 @@ int CEF_CALLBACK textfield_is_read_only(struct _cef_textfield_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK textfield_get_text( - struct _cef_textfield_t* self) { +cef_string_userfree_t CEF_CALLBACK +textfield_get_text(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -112,7 +111,7 @@ cef_string_userfree_t CEF_CALLBACK textfield_get_text( } void CEF_CALLBACK textfield_set_text(struct _cef_textfield_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,12 +123,11 @@ void CEF_CALLBACK textfield_set_text(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetText( - CefString(text)); + CefTextfieldCppToC::Get(self)->SetText(CefString(text)); } void CEF_CALLBACK textfield_append_text(struct _cef_textfield_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -141,12 +139,12 @@ void CEF_CALLBACK textfield_append_text(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->AppendText( - CefString(text)); + CefTextfieldCppToC::Get(self)->AppendText(CefString(text)); } -void CEF_CALLBACK textfield_insert_or_replace_text( - struct _cef_textfield_t* self, const cef_string_t* text) { +void CEF_CALLBACK +textfield_insert_or_replace_text(struct _cef_textfield_t* self, + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -158,8 +156,7 @@ void CEF_CALLBACK textfield_insert_or_replace_text( return; // Execute - CefTextfieldCppToC::Get(self)->InsertOrReplaceText( - CefString(text)); + CefTextfieldCppToC::Get(self)->InsertOrReplaceText(CefString(text)); } int CEF_CALLBACK textfield_has_selection(struct _cef_textfield_t* self) { @@ -176,8 +173,8 @@ int CEF_CALLBACK textfield_has_selection(struct _cef_textfield_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK textfield_get_selected_text( - struct _cef_textfield_t* self) { +cef_string_userfree_t CEF_CALLBACK +textfield_get_selected_text(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -192,7 +189,7 @@ cef_string_userfree_t CEF_CALLBACK textfield_get_selected_text( } void CEF_CALLBACK textfield_select_all(struct _cef_textfield_t* self, - int reversed) { + int reversed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -200,8 +197,7 @@ void CEF_CALLBACK textfield_select_all(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SelectAll( - reversed?true:false); + CefTextfieldCppToC::Get(self)->SelectAll(reversed ? true : false); } void CEF_CALLBACK textfield_clear_selection(struct _cef_textfield_t* self) { @@ -215,8 +211,8 @@ void CEF_CALLBACK textfield_clear_selection(struct _cef_textfield_t* self) { CefTextfieldCppToC::Get(self)->ClearSelection(); } -cef_range_t CEF_CALLBACK textfield_get_selected_range( - struct _cef_textfield_t* self) { +cef_range_t CEF_CALLBACK +textfield_get_selected_range(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -231,7 +227,7 @@ cef_range_t CEF_CALLBACK textfield_get_selected_range( } void CEF_CALLBACK textfield_select_range(struct _cef_textfield_t* self, - const cef_range_t* range) { + const cef_range_t* range) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -243,15 +239,14 @@ void CEF_CALLBACK textfield_select_range(struct _cef_textfield_t* self, return; // Translate param: range; type: simple_byref_const - CefRange rangeVal = range?*range:CefRange(); + CefRange rangeVal = range ? *range : CefRange(); // Execute - CefTextfieldCppToC::Get(self)->SelectRange( - rangeVal); + CefTextfieldCppToC::Get(self)->SelectRange(rangeVal); } -size_t CEF_CALLBACK textfield_get_cursor_position( - struct _cef_textfield_t* self) { +size_t CEF_CALLBACK +textfield_get_cursor_position(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -266,7 +261,7 @@ size_t CEF_CALLBACK textfield_get_cursor_position( } void CEF_CALLBACK textfield_set_text_color(struct _cef_textfield_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -274,12 +269,11 @@ void CEF_CALLBACK textfield_set_text_color(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetTextColor( - color); + CefTextfieldCppToC::Get(self)->SetTextColor(color); } -cef_color_t CEF_CALLBACK textfield_get_text_color( - struct _cef_textfield_t* self) { +cef_color_t CEF_CALLBACK +textfield_get_text_color(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -293,8 +287,9 @@ cef_color_t CEF_CALLBACK textfield_get_text_color( return _retval; } -void CEF_CALLBACK textfield_set_selection_text_color( - struct _cef_textfield_t* self, cef_color_t color) { +void CEF_CALLBACK +textfield_set_selection_text_color(struct _cef_textfield_t* self, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -302,12 +297,11 @@ void CEF_CALLBACK textfield_set_selection_text_color( return; // Execute - CefTextfieldCppToC::Get(self)->SetSelectionTextColor( - color); + CefTextfieldCppToC::Get(self)->SetSelectionTextColor(color); } -cef_color_t CEF_CALLBACK textfield_get_selection_text_color( - struct _cef_textfield_t* self) { +cef_color_t CEF_CALLBACK +textfield_get_selection_text_color(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -321,8 +315,9 @@ cef_color_t CEF_CALLBACK textfield_get_selection_text_color( return _retval; } -void CEF_CALLBACK textfield_set_selection_background_color( - struct _cef_textfield_t* self, cef_color_t color) { +void CEF_CALLBACK +textfield_set_selection_background_color(struct _cef_textfield_t* self, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -330,12 +325,11 @@ void CEF_CALLBACK textfield_set_selection_background_color( return; // Execute - CefTextfieldCppToC::Get(self)->SetSelectionBackgroundColor( - color); + CefTextfieldCppToC::Get(self)->SetSelectionBackgroundColor(color); } -cef_color_t CEF_CALLBACK textfield_get_selection_background_color( - struct _cef_textfield_t* self) { +cef_color_t CEF_CALLBACK +textfield_get_selection_background_color(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -343,15 +337,15 @@ cef_color_t CEF_CALLBACK textfield_get_selection_background_color( return 0; // Execute - cef_color_t _retval = CefTextfieldCppToC::Get( - self)->GetSelectionBackgroundColor(); + cef_color_t _retval = + CefTextfieldCppToC::Get(self)->GetSelectionBackgroundColor(); // Return type: simple return _retval; } void CEF_CALLBACK textfield_set_font_list(struct _cef_textfield_t* self, - const cef_string_t* font_list) { + const cef_string_t* font_list) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -363,12 +357,12 @@ void CEF_CALLBACK textfield_set_font_list(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetFontList( - CefString(font_list)); + CefTextfieldCppToC::Get(self)->SetFontList(CefString(font_list)); } void CEF_CALLBACK textfield_apply_text_color(struct _cef_textfield_t* self, - cef_color_t color, const cef_range_t* range) { + cef_color_t color, + const cef_range_t* range) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -380,16 +374,16 @@ void CEF_CALLBACK textfield_apply_text_color(struct _cef_textfield_t* self, return; // Translate param: range; type: simple_byref_const - CefRange rangeVal = range?*range:CefRange(); + CefRange rangeVal = range ? *range : CefRange(); // Execute - CefTextfieldCppToC::Get(self)->ApplyTextColor( - color, - rangeVal); + CefTextfieldCppToC::Get(self)->ApplyTextColor(color, rangeVal); } void CEF_CALLBACK textfield_apply_text_style(struct _cef_textfield_t* self, - cef_text_style_t style, int add, const cef_range_t* range) { + cef_text_style_t style, + int add, + const cef_range_t* range) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -401,17 +395,15 @@ void CEF_CALLBACK textfield_apply_text_style(struct _cef_textfield_t* self, return; // Translate param: range; type: simple_byref_const - CefRange rangeVal = range?*range:CefRange(); + CefRange rangeVal = range ? *range : CefRange(); // Execute - CefTextfieldCppToC::Get(self)->ApplyTextStyle( - style, - add?true:false, - rangeVal); + CefTextfieldCppToC::Get(self)->ApplyTextStyle(style, add ? true : false, + rangeVal); } int CEF_CALLBACK textfield_is_command_enabled(struct _cef_textfield_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -419,15 +411,14 @@ int CEF_CALLBACK textfield_is_command_enabled(struct _cef_textfield_t* self, return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(self)->IsCommandEnabled( - command_id); + bool _retval = CefTextfieldCppToC::Get(self)->IsCommandEnabled(command_id); // Return type: bool return _retval; } void CEF_CALLBACK textfield_execute_command(struct _cef_textfield_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -435,8 +426,7 @@ void CEF_CALLBACK textfield_execute_command(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->ExecuteCommand( - command_id); + CefTextfieldCppToC::Get(self)->ExecuteCommand(command_id); } void CEF_CALLBACK textfield_clear_edit_history(struct _cef_textfield_t* self) { @@ -451,7 +441,7 @@ void CEF_CALLBACK textfield_clear_edit_history(struct _cef_textfield_t* self) { } void CEF_CALLBACK textfield_set_placeholder_text(struct _cef_textfield_t* self, - const cef_string_t* text) { + const cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -463,12 +453,11 @@ void CEF_CALLBACK textfield_set_placeholder_text(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetPlaceholderText( - CefString(text)); + CefTextfieldCppToC::Get(self)->SetPlaceholderText(CefString(text)); } -cef_string_userfree_t CEF_CALLBACK textfield_get_placeholder_text( - struct _cef_textfield_t* self) { +cef_string_userfree_t CEF_CALLBACK +textfield_get_placeholder_text(struct _cef_textfield_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -482,8 +471,9 @@ cef_string_userfree_t CEF_CALLBACK textfield_get_placeholder_text( return _retval.DetachToUserFree(); } -void CEF_CALLBACK textfield_set_placeholder_text_color( - struct _cef_textfield_t* self, cef_color_t color) { +void CEF_CALLBACK +textfield_set_placeholder_text_color(struct _cef_textfield_t* self, + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -491,12 +481,11 @@ void CEF_CALLBACK textfield_set_placeholder_text_color( return; // Execute - CefTextfieldCppToC::Get(self)->SetPlaceholderTextColor( - color); + CefTextfieldCppToC::Get(self)->SetPlaceholderTextColor(color); } void CEF_CALLBACK textfield_set_accessible_name(struct _cef_textfield_t* self, - const cef_string_t* name) { + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -508,12 +497,11 @@ void CEF_CALLBACK textfield_set_accessible_name(struct _cef_textfield_t* self, return; // Execute - CefTextfieldCppToC::Get(self)->SetAccessibleName( - CefString(name)); + CefTextfieldCppToC::Get(self)->SetAccessibleName(CefString(name)); } -cef_browser_view_t* CEF_CALLBACK textfield_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +textfield_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -521,8 +509,9 @@ cef_browser_view_t* CEF_CALLBACK textfield_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -536,8 +525,9 @@ cef_button_t* CEF_CALLBACK textfield_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -551,15 +541,16 @@ cef_panel_t* CEF_CALLBACK textfield_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK textfield_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +textfield_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -567,8 +558,9 @@ cef_scroll_view_t* CEF_CALLBACK textfield_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); @@ -582,15 +574,16 @@ cef_textfield_t* CEF_CALLBACK textfield_as_textfield(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK textfield_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +textfield_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -598,15 +591,16 @@ cef_string_userfree_t CEF_CALLBACK textfield_get_type_string( return NULL; // Execute - CefString _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetTypeString(); + CefString _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } cef_string_userfree_t CEF_CALLBACK textfield_to_string(struct _cef_view_t* self, - int include_children) { + int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -614,9 +608,9 @@ cef_string_userfree_t CEF_CALLBACK textfield_to_string(struct _cef_view_t* self, return NULL; // Execute - CefString _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->ToString( - include_children?true:false); + CefString _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -630,8 +624,9 @@ int CEF_CALLBACK textfield_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsValid(); // Return type: bool return _retval; @@ -645,15 +640,16 @@ int CEF_CALLBACK textfield_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsAttached(); // Return type: bool return _retval; } int CEF_CALLBACK textfield_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -665,16 +661,16 @@ int CEF_CALLBACK textfield_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK textfield_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +textfield_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -682,15 +678,16 @@ struct _cef_view_delegate_t* CEF_CALLBACK textfield_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); } -struct _cef_window_t* CEF_CALLBACK textfield_get_window( - struct _cef_view_t* self) { +struct _cef_window_t* CEF_CALLBACK +textfield_get_window(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -698,8 +695,9 @@ struct _cef_window_t* CEF_CALLBACK textfield_get_window( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -713,8 +711,9 @@ int CEF_CALLBACK textfield_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetID(); // Return type: simple return _retval; @@ -728,8 +727,7 @@ void CEF_CALLBACK textfield_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefTextfieldCppToC::Get(reinterpret_cast(self))->SetID(id); } int CEF_CALLBACK textfield_get_group_id(struct _cef_view_t* self) { @@ -740,15 +738,16 @@ int CEF_CALLBACK textfield_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetGroupID(); // Return type: simple return _retval; } void CEF_CALLBACK textfield_set_group_id(struct _cef_view_t* self, - int group_id) { + int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -756,12 +755,12 @@ void CEF_CALLBACK textfield_set_group_id(struct _cef_view_t* self, return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetGroupID( - group_id); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK textfield_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +textfield_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -769,15 +768,16 @@ struct _cef_view_t* CEF_CALLBACK textfield_get_parent_view( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -struct _cef_view_t* CEF_CALLBACK textfield_get_view_for_id( - struct _cef_view_t* self, int id) { +struct _cef_view_t* CEF_CALLBACK +textfield_get_view_for_id(struct _cef_view_t* self, int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -785,16 +785,16 @@ struct _cef_view_t* CEF_CALLBACK textfield_get_view_for_id( return NULL; // Execute - CefRefPtr _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK textfield_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -806,11 +806,11 @@ void CEF_CALLBACK textfield_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetBounds( - boundsVal); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK textfield_get_bounds(struct _cef_view_t* self) { @@ -821,15 +821,16 @@ cef_rect_t CEF_CALLBACK textfield_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetBounds(); + cef_rect_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetBounds(); // Return type: simple return _retval; } -cef_rect_t CEF_CALLBACK textfield_get_bounds_in_screen( - struct _cef_view_t* self) { +cef_rect_t CEF_CALLBACK +textfield_get_bounds_in_screen(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -837,15 +838,16 @@ cef_rect_t CEF_CALLBACK textfield_get_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK textfield_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -857,11 +859,11 @@ void CEF_CALLBACK textfield_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetSize(sizeVal); } cef_size_t CEF_CALLBACK textfield_get_size(struct _cef_view_t* self) { @@ -872,15 +874,16 @@ cef_size_t CEF_CALLBACK textfield_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetSize(); + cef_size_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK textfield_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -892,12 +895,11 @@ void CEF_CALLBACK textfield_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->SetPosition( - positionVal); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK textfield_get_position(struct _cef_view_t* self) { @@ -908,8 +910,9 @@ cef_point_t CEF_CALLBACK textfield_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetPosition(); + cef_point_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; @@ -923,8 +926,9 @@ cef_size_t CEF_CALLBACK textfield_get_preferred_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetPreferredSize(); + cef_size_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -938,8 +942,8 @@ void CEF_CALLBACK textfield_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK textfield_get_minimum_size(struct _cef_view_t* self) { @@ -950,8 +954,9 @@ cef_size_t CEF_CALLBACK textfield_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetMinimumSize(); + cef_size_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -965,15 +970,16 @@ cef_size_t CEF_CALLBACK textfield_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetMaximumSize(); + cef_size_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK textfield_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -981,9 +987,9 @@ int CEF_CALLBACK textfield_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -997,8 +1003,8 @@ void CEF_CALLBACK textfield_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->InvalidateLayout(); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK textfield_set_visible(struct _cef_view_t* self, int visible) { @@ -1009,8 +1015,8 @@ void CEF_CALLBACK textfield_set_visible(struct _cef_view_t* self, int visible) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetVisible( - visible?true:false); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK textfield_is_visible(struct _cef_view_t* self) { @@ -1021,8 +1027,9 @@ int CEF_CALLBACK textfield_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsVisible(); // Return type: bool return _retval; @@ -1036,8 +1043,9 @@ int CEF_CALLBACK textfield_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsDrawn(); // Return type: bool return _retval; @@ -1051,8 +1059,8 @@ void CEF_CALLBACK textfield_set_enabled(struct _cef_view_t* self, int enabled) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast(self))->SetEnabled( - enabled?true:false); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK textfield_is_enabled(struct _cef_view_t* self) { @@ -1063,15 +1071,16 @@ int CEF_CALLBACK textfield_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK textfield_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1079,9 +1088,8 @@ void CEF_CALLBACK textfield_set_focusable(struct _cef_view_t* self, return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->SetFocusable( - focusable?true:false); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK textfield_is_focusable(struct _cef_view_t* self) { @@ -1092,15 +1100,16 @@ int CEF_CALLBACK textfield_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; } -int CEF_CALLBACK textfield_is_accessibility_focusable( - struct _cef_view_t* self) { +int CEF_CALLBACK +textfield_is_accessibility_focusable(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1108,8 +1117,9 @@ int CEF_CALLBACK textfield_is_accessibility_focusable( return 0; // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -1123,12 +1133,12 @@ void CEF_CALLBACK textfield_request_focus(struct _cef_view_t* self) { return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->RequestFocus(); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->RequestFocus(); } void CEF_CALLBACK textfield_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1136,13 +1146,12 @@ void CEF_CALLBACK textfield_set_background_color(struct _cef_view_t* self, return; // Execute - CefTextfieldCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } -cef_color_t CEF_CALLBACK textfield_get_background_color( - struct _cef_view_t* self) { +cef_color_t CEF_CALLBACK +textfield_get_background_color(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1150,15 +1159,16 @@ cef_color_t CEF_CALLBACK textfield_get_background_color( return 0; // Execute - cef_color_t _retval = CefTextfieldCppToC::Get( - reinterpret_cast(self))->GetBackgroundColor(); + cef_color_t _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK textfield_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1170,12 +1180,12 @@ int CEF_CALLBACK textfield_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1186,7 +1196,7 @@ int CEF_CALLBACK textfield_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK textfield_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1198,12 +1208,12 @@ int CEF_CALLBACK textfield_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1214,7 +1224,7 @@ int CEF_CALLBACK textfield_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK textfield_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1226,12 +1236,12 @@ int CEF_CALLBACK textfield_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1242,7 +1252,7 @@ int CEF_CALLBACK textfield_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK textfield_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1254,12 +1264,12 @@ int CEF_CALLBACK textfield_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1270,7 +1280,8 @@ int CEF_CALLBACK textfield_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK textfield_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1286,13 +1297,12 @@ int CEF_CALLBACK textfield_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1303,7 +1313,8 @@ int CEF_CALLBACK textfield_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK textfield_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1319,13 +1330,12 @@ int CEF_CALLBACK textfield_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefTextfieldCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefTextfieldCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1337,7 +1347,6 @@ int CEF_CALLBACK textfield_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTextfieldCppToC::CefTextfieldCppToC() { @@ -1428,17 +1437,23 @@ CefTextfieldCppToC::CefTextfieldCppToC() { GetStruct()->base.convert_point_from_view = textfield_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_textfield_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_textfield_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TEXTFIELD; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_TEXTFIELD; diff --git a/libcef_dll/cpptoc/views/textfield_cpptoc.h b/libcef_dll/cpptoc/views/textfield_cpptoc.h index 69c55eaaf..b6d42e34e 100644 --- a/libcef_dll/cpptoc/views/textfield_cpptoc.h +++ b/libcef_dll/cpptoc/views/textfield_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0f231714ec7d08370d93b5b88d08cdcd7ef929f6$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_textfield.h" #include "include/capi/views/cef_textfield_capi.h" +#include "include/views/cef_textfield.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefTextfieldCppToC - : public CefCppToCRefCounted { +class CefTextfieldCppToC : public CefCppToCRefCounted { public: CefTextfieldCppToC(); }; diff --git a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc index 293a80f6f..8f8513dd0 100644 --- a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc @@ -9,19 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c4a791057449122f888535d07ccd6ac32757de8b$ +// #include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/textfield_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK textfield_delegate_on_key_event( - struct _cef_textfield_delegate_t* self, cef_textfield_t* textfield, - const struct _cef_key_event_t* event) { +int CEF_CALLBACK +textfield_delegate_on_key_event(struct _cef_textfield_delegate_t* self, + cef_textfield_t* textfield, + const struct _cef_key_event_t* event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -43,15 +45,15 @@ int CEF_CALLBACK textfield_delegate_on_key_event( // Execute bool _retval = CefTextfieldDelegateCppToC::Get(self)->OnKeyEvent( - CefTextfieldCToCpp::Wrap(textfield), - eventObj); + CefTextfieldCToCpp::Wrap(textfield), eventObj); // Return type: bool return _retval; } -void CEF_CALLBACK textfield_delegate_on_after_user_action( - struct _cef_textfield_delegate_t* self, cef_textfield_t* textfield) { +void CEF_CALLBACK +textfield_delegate_on_after_user_action(struct _cef_textfield_delegate_t* self, + cef_textfield_t* textfield) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -67,8 +69,9 @@ void CEF_CALLBACK textfield_delegate_on_after_user_action( CefTextfieldCToCpp::Wrap(textfield)); } -cef_size_t CEF_CALLBACK textfield_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +textfield_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,15 +84,16 @@ cef_size_t CEF_CALLBACK textfield_delegate_get_preferred_size( // Execute cef_size_t _retval = CefTextfieldDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK textfield_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +textfield_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -102,15 +106,16 @@ cef_size_t CEF_CALLBACK textfield_delegate_get_minimum_size( // Execute cef_size_t _retval = CefTextfieldDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK textfield_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +textfield_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,15 +128,17 @@ cef_size_t CEF_CALLBACK textfield_delegate_get_maximum_size( // Execute cef_size_t _retval = CefTextfieldDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK textfield_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +textfield_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -144,17 +151,18 @@ int CEF_CALLBACK textfield_delegate_get_height_for_width( // Execute int _retval = CefTextfieldDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK textfield_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +textfield_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -170,16 +178,17 @@ void CEF_CALLBACK textfield_delegate_on_parent_view_changed( return; // Execute - CefTextfieldDelegateCppToC::Get(reinterpret_cast( - self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + CefTextfieldDelegateCppToC::Get( + reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK textfield_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +textfield_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -195,15 +204,14 @@ void CEF_CALLBACK textfield_delegate_on_child_view_changed( return; // Execute - CefTextfieldDelegateCppToC::Get(reinterpret_cast( - self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + CefTextfieldDelegateCppToC::Get( + reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } void CEF_CALLBACK textfield_delegate_on_focus(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -215,13 +223,13 @@ void CEF_CALLBACK textfield_delegate_on_focus(struct _cef_view_delegate_t* self, return; // Execute - CefTextfieldDelegateCppToC::Get(reinterpret_cast( - self))->OnFocus( - CefViewCToCpp::Wrap(view)); + CefTextfieldDelegateCppToC::Get( + reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } void CEF_CALLBACK textfield_delegate_on_blur(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -233,14 +241,13 @@ void CEF_CALLBACK textfield_delegate_on_blur(struct _cef_view_delegate_t* self, return; // Execute - CefTextfieldDelegateCppToC::Get(reinterpret_cast( - self))->OnBlur( - CefViewCToCpp::Wrap(view)); + CefTextfieldDelegateCppToC::Get( + reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefTextfieldDelegateCppToC::CefTextfieldDelegateCppToC() { @@ -259,18 +266,26 @@ CefTextfieldDelegateCppToC::CefTextfieldDelegateCppToC() { GetStruct()->base.on_blur = textfield_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_textfield_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefTextfieldDelegateCppToC, + CefTextfieldDelegate, + cef_textfield_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_textfield_delegate_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TEXTFIELD_DELEGATE; diff --git a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h index 6fcf88934..ea140e9b5 100644 --- a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=aa068445cd816a13b8f6dcc92814f1e4a784ec6a$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_DELEGATE_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_textfield_delegate.h" +#include "include/capi/views/cef_textfield_capi.h" #include "include/capi/views/cef_textfield_delegate_capi.h" #include "include/views/cef_textfield.h" -#include "include/capi/views/cef_textfield_capi.h" +#include "include/views/cef_textfield_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTextfieldDelegateCppToC : public CefCppToCRefCounted { + CefTextfieldDelegate, + cef_textfield_delegate_t> { public: CefTextfieldDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/view_cpptoc.cc b/libcef_dll/cpptoc/views/view_cpptoc.cc index 307c6cbff..8ad2eaa05 100644 --- a/libcef_dll/cpptoc/views/view_cpptoc.cc +++ b/libcef_dll/cpptoc/views/view_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=84ab086050d93dfdca7f82f454f833a7e73ab7e0$ +// #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" @@ -21,13 +23,12 @@ #include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_browser_view_t* CEF_CALLBACK view_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +view_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -97,8 +98,8 @@ cef_textfield_t* CEF_CALLBACK view_as_textfield(struct _cef_view_t* self) { return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK view_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +view_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -113,7 +114,7 @@ cef_string_userfree_t CEF_CALLBACK view_get_type_string( } cef_string_userfree_t CEF_CALLBACK view_to_string(struct _cef_view_t* self, - int include_children) { + int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -121,8 +122,8 @@ cef_string_userfree_t CEF_CALLBACK view_to_string(struct _cef_view_t* self, return NULL; // Execute - CefString _retval = CefViewCppToC::Get(self)->ToString( - include_children?true:false); + CefString _retval = + CefViewCppToC::Get(self)->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -157,7 +158,7 @@ int CEF_CALLBACK view_is_attached(struct _cef_view_t* self) { } int CEF_CALLBACK view_is_same(struct _cef_view_t* self, - struct _cef_view_t* that) { + struct _cef_view_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -169,15 +170,14 @@ int CEF_CALLBACK view_is_same(struct _cef_view_t* self, return 0; // Execute - bool _retval = CefViewCppToC::Get(self)->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = CefViewCppToC::Get(self)->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -struct _cef_view_delegate_t* CEF_CALLBACK view_get_delegate( - struct _cef_view_t* self) { +struct _cef_view_delegate_t* CEF_CALLBACK +view_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -227,8 +227,7 @@ void CEF_CALLBACK view_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefViewCppToC::Get(self)->SetID( - id); + CefViewCppToC::Get(self)->SetID(id); } int CEF_CALLBACK view_get_group_id(struct _cef_view_t* self) { @@ -253,12 +252,11 @@ void CEF_CALLBACK view_set_group_id(struct _cef_view_t* self, int group_id) { return; // Execute - CefViewCppToC::Get(self)->SetGroupID( - group_id); + CefViewCppToC::Get(self)->SetGroupID(group_id); } -struct _cef_view_t* CEF_CALLBACK view_get_parent_view( - struct _cef_view_t* self) { +struct _cef_view_t* CEF_CALLBACK +view_get_parent_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -273,7 +271,7 @@ struct _cef_view_t* CEF_CALLBACK view_get_parent_view( } struct _cef_view_t* CEF_CALLBACK view_get_view_for_id(struct _cef_view_t* self, - int id) { + int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -281,15 +279,14 @@ struct _cef_view_t* CEF_CALLBACK view_get_view_for_id(struct _cef_view_t* self, return NULL; // Execute - CefRefPtr _retval = CefViewCppToC::Get(self)->GetViewForID( - id); + CefRefPtr _retval = CefViewCppToC::Get(self)->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK view_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -301,11 +298,10 @@ void CEF_CALLBACK view_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefViewCppToC::Get(self)->SetBounds( - boundsVal); + CefViewCppToC::Get(self)->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK view_get_bounds(struct _cef_view_t* self) { @@ -337,7 +333,7 @@ cef_rect_t CEF_CALLBACK view_get_bounds_in_screen(struct _cef_view_t* self) { } void CEF_CALLBACK view_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -349,11 +345,10 @@ void CEF_CALLBACK view_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefViewCppToC::Get(self)->SetSize( - sizeVal); + CefViewCppToC::Get(self)->SetSize(sizeVal); } cef_size_t CEF_CALLBACK view_get_size(struct _cef_view_t* self) { @@ -371,7 +366,7 @@ cef_size_t CEF_CALLBACK view_get_size(struct _cef_view_t* self) { } void CEF_CALLBACK view_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -383,11 +378,10 @@ void CEF_CALLBACK view_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefViewCppToC::Get(self)->SetPosition( - positionVal); + CefViewCppToC::Get(self)->SetPosition(positionVal); } cef_point_t CEF_CALLBACK view_get_position(struct _cef_view_t* self) { @@ -458,7 +452,7 @@ cef_size_t CEF_CALLBACK view_get_maximum_size(struct _cef_view_t* self) { } int CEF_CALLBACK view_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -466,8 +460,7 @@ int CEF_CALLBACK view_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefViewCppToC::Get(self)->GetHeightForWidth( - width); + int _retval = CefViewCppToC::Get(self)->GetHeightForWidth(width); // Return type: simple return _retval; @@ -492,8 +485,7 @@ void CEF_CALLBACK view_set_visible(struct _cef_view_t* self, int visible) { return; // Execute - CefViewCppToC::Get(self)->SetVisible( - visible?true:false); + CefViewCppToC::Get(self)->SetVisible(visible ? true : false); } int CEF_CALLBACK view_is_visible(struct _cef_view_t* self) { @@ -532,8 +524,7 @@ void CEF_CALLBACK view_set_enabled(struct _cef_view_t* self, int enabled) { return; // Execute - CefViewCppToC::Get(self)->SetEnabled( - enabled?true:false); + CefViewCppToC::Get(self)->SetEnabled(enabled ? true : false); } int CEF_CALLBACK view_is_enabled(struct _cef_view_t* self) { @@ -558,8 +549,7 @@ void CEF_CALLBACK view_set_focusable(struct _cef_view_t* self, int focusable) { return; // Execute - CefViewCppToC::Get(self)->SetFocusable( - focusable?true:false); + CefViewCppToC::Get(self)->SetFocusable(focusable ? true : false); } int CEF_CALLBACK view_is_focusable(struct _cef_view_t* self) { @@ -602,7 +592,7 @@ void CEF_CALLBACK view_request_focus(struct _cef_view_t* self) { } void CEF_CALLBACK view_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -610,8 +600,7 @@ void CEF_CALLBACK view_set_background_color(struct _cef_view_t* self, return; // Execute - CefViewCppToC::Get(self)->SetBackgroundColor( - color); + CefViewCppToC::Get(self)->SetBackgroundColor(color); } cef_color_t CEF_CALLBACK view_get_background_color(struct _cef_view_t* self) { @@ -629,7 +618,7 @@ cef_color_t CEF_CALLBACK view_get_background_color(struct _cef_view_t* self) { } int CEF_CALLBACK view_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -641,11 +630,10 @@ int CEF_CALLBACK view_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefViewCppToC::Get(self)->ConvertPointToScreen( - pointVal); + bool _retval = CefViewCppToC::Get(self)->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -656,7 +644,7 @@ int CEF_CALLBACK view_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK view_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -668,11 +656,10 @@ int CEF_CALLBACK view_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefViewCppToC::Get(self)->ConvertPointFromScreen( - pointVal); + bool _retval = CefViewCppToC::Get(self)->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -683,7 +670,7 @@ int CEF_CALLBACK view_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK view_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -695,11 +682,10 @@ int CEF_CALLBACK view_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefViewCppToC::Get(self)->ConvertPointToWindow( - pointVal); + bool _retval = CefViewCppToC::Get(self)->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -710,7 +696,7 @@ int CEF_CALLBACK view_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK view_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -722,11 +708,10 @@ int CEF_CALLBACK view_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefViewCppToC::Get(self)->ConvertPointFromWindow( - pointVal); + bool _retval = CefViewCppToC::Get(self)->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -737,7 +722,8 @@ int CEF_CALLBACK view_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK view_convert_point_to_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -753,12 +739,11 @@ int CEF_CALLBACK view_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute bool _retval = CefViewCppToC::Get(self)->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -769,7 +754,8 @@ int CEF_CALLBACK view_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK view_convert_point_from_view(struct _cef_view_t* self, - struct _cef_view_t* view, cef_point_t* point) { + struct _cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -785,12 +771,11 @@ int CEF_CALLBACK view_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute bool _retval = CefViewCppToC::Get(self)->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -802,7 +787,6 @@ int CEF_CALLBACK view_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefViewCppToC::CefViewCppToC() { @@ -856,18 +840,21 @@ CefViewCppToC::CefViewCppToC() { GetStruct()->convert_point_from_view = view_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_view_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_view_t* s) { if (type == WT_BROWSER_VIEW) { - return CefBrowserViewCppToC::Unwrap(reinterpret_cast( - s)); + return CefBrowserViewCppToC::Unwrap( + reinterpret_cast(s)); } if (type == WT_BUTTON) { return CefButtonCppToC::Unwrap(reinterpret_cast(s)); } if (type == WT_LABEL_BUTTON) { - return CefLabelButtonCppToC::Unwrap(reinterpret_cast( - s)); + return CefLabelButtonCppToC::Unwrap( + reinterpret_cast(s)); } if (type == WT_MENU_BUTTON) { return CefMenuButtonCppToC::Unwrap(reinterpret_cast(s)); @@ -889,9 +876,12 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VIEW; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_VIEW; diff --git a/libcef_dll/cpptoc/views/view_cpptoc.h b/libcef_dll/cpptoc/views/view_cpptoc.h index ca36f9f7f..ea2cd078c 100644 --- a/libcef_dll/cpptoc/views/view_cpptoc.h +++ b/libcef_dll/cpptoc/views/view_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=216d5a271bd5a8df2c5d8db3f44c4b66c98c5c4e$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_CPPTOC_H_ @@ -18,20 +20,20 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_view.h" -#include "include/capi/views/cef_view_capi.h" -#include "include/views/cef_browser_view.h" #include "include/capi/views/cef_browser_view_capi.h" -#include "include/views/cef_button.h" #include "include/capi/views/cef_button_capi.h" -#include "include/views/cef_panel.h" #include "include/capi/views/cef_panel_capi.h" -#include "include/views/cef_scroll_view.h" #include "include/capi/views/cef_scroll_view_capi.h" -#include "include/views/cef_textfield.h" #include "include/capi/views/cef_textfield_capi.h" -#include "include/views/cef_window.h" +#include "include/capi/views/cef_view_capi.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_browser_view.h" +#include "include/views/cef_button.h" +#include "include/views/cef_panel.h" +#include "include/views/cef_scroll_view.h" +#include "include/views/cef_textfield.h" +#include "include/views/cef_view.h" +#include "include/views/cef_window.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc index 959a1f736..bf100671d 100644 --- a/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e678eaa0ebf2a590701353fd8bc75f55002ca4b2$ +// #include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" @@ -19,13 +21,13 @@ #include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_size_t CEF_CALLBACK view_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +view_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -44,8 +46,9 @@ cef_size_t CEF_CALLBACK view_delegate_get_preferred_size( return _retval; } -cef_size_t CEF_CALLBACK view_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +view_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +67,9 @@ cef_size_t CEF_CALLBACK view_delegate_get_minimum_size( return _retval; } -cef_size_t CEF_CALLBACK view_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +view_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -84,8 +88,10 @@ cef_size_t CEF_CALLBACK view_delegate_get_maximum_size( return _retval; } -int CEF_CALLBACK view_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +view_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,16 +104,17 @@ int CEF_CALLBACK view_delegate_get_height_for_width( // Execute int _retval = CefViewDelegateCppToC::Get(self)->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK view_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +view_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,14 +131,15 @@ void CEF_CALLBACK view_delegate_on_parent_view_changed( // Execute CefViewDelegateCppToC::Get(self)->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, + CefViewCToCpp::Wrap(view), added ? true : false, CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK view_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +view_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,13 +156,12 @@ void CEF_CALLBACK view_delegate_on_child_view_changed( // Execute CefViewDelegateCppToC::Get(self)->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, + CefViewCToCpp::Wrap(view), added ? true : false, CefViewCToCpp::Wrap(child)); } void CEF_CALLBACK view_delegate_on_focus(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -166,12 +173,11 @@ void CEF_CALLBACK view_delegate_on_focus(struct _cef_view_delegate_t* self, return; // Execute - CefViewDelegateCppToC::Get(self)->OnFocus( - CefViewCToCpp::Wrap(view)); + CefViewDelegateCppToC::Get(self)->OnFocus(CefViewCToCpp::Wrap(view)); } void CEF_CALLBACK view_delegate_on_blur(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -183,13 +189,11 @@ void CEF_CALLBACK view_delegate_on_blur(struct _cef_view_delegate_t* self, return; // Execute - CefViewDelegateCppToC::Get(self)->OnBlur( - CefViewCToCpp::Wrap(view)); + CefViewDelegateCppToC::Get(self)->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefViewDelegateCppToC::CefViewDelegateCppToC() { @@ -203,9 +207,12 @@ CefViewDelegateCppToC::CefViewDelegateCppToC() { GetStruct()->on_blur = view_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_view_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefViewDelegateCppToC, + CefViewDelegate, + cef_view_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_view_delegate_t* s) { if (type == WT_BROWSER_VIEW_DELEGATE) { return CefBrowserViewDelegateCppToC::Unwrap( reinterpret_cast(s)); @@ -235,9 +242,14 @@ template<> CefRefPtr CefCppToCRefCounted base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VIEW_DELEGATE; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_VIEW_DELEGATE; diff --git a/libcef_dll/cpptoc/views/view_delegate_cpptoc.h b/libcef_dll/cpptoc/views/view_delegate_cpptoc.h index 38011f155..ef9e542b6 100644 --- a/libcef_dll/cpptoc/views/view_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/view_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=52ff851dd3f66acdab5a61d7eb87be29ba59e1ca$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_DELEGATE_CPPTOC_H_ @@ -18,17 +20,17 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_view_delegate.h" +#include "include/capi/views/cef_view_capi.h" #include "include/capi/views/cef_view_delegate_capi.h" #include "include/views/cef_view.h" -#include "include/capi/views/cef_view_capi.h" +#include "include/views/cef_view_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefViewDelegateCppToC - : public CefCppToCRefCounted { +class CefViewDelegateCppToC : public CefCppToCRefCounted { public: CefViewDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/views/window_cpptoc.cc b/libcef_dll/cpptoc/views/window_cpptoc.cc index 2389595d0..2b072eafb 100644 --- a/libcef_dll/cpptoc/views/window_cpptoc.cc +++ b/libcef_dll/cpptoc/views/window_cpptoc.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1e38a9d2747c2f2d38371e544a3daf8117612480$ +// +#include "libcef_dll/cpptoc/image_cpptoc.h" +#include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/button_cpptoc.h" #include "libcef_dll/cpptoc/views/display_cpptoc.h" #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" -#include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/views/layout_cpptoc.h" -#include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/cpptoc/views/panel_cpptoc.h" #include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" #include "libcef_dll/cpptoc/views/textfield_cpptoc.h" @@ -26,7 +28,6 @@ #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_window_t* cef_window_create_top_level( @@ -36,14 +37,13 @@ CEF_EXPORT cef_window_t* cef_window_create_top_level( // Unverified params: delegate // Execute - CefRefPtr _retval = CefWindow::CreateTopLevelWindow( - CefWindowDelegateCToCpp::Wrap(delegate)); + CefRefPtr _retval = + CefWindow::CreateTopLevelWindow(CefWindowDelegateCToCpp::Wrap(delegate)); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -71,7 +71,7 @@ void CEF_CALLBACK window_hide(struct _cef_window_t* self) { } void CEF_CALLBACK window_center_window(struct _cef_window_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -83,11 +83,10 @@ void CEF_CALLBACK window_center_window(struct _cef_window_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefWindowCppToC::Get(self)->CenterWindow( - sizeVal); + CefWindowCppToC::Get(self)->CenterWindow(sizeVal); } void CEF_CALLBACK window_close(struct _cef_window_t* self) { @@ -163,7 +162,7 @@ void CEF_CALLBACK window_bring_to_top(struct _cef_window_t* self) { } void CEF_CALLBACK window_set_always_on_top(struct _cef_window_t* self, - int on_top) { + int on_top) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -171,8 +170,7 @@ void CEF_CALLBACK window_set_always_on_top(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SetAlwaysOnTop( - on_top?true:false); + CefWindowCppToC::Get(self)->SetAlwaysOnTop(on_top ? true : false); } int CEF_CALLBACK window_is_always_on_top(struct _cef_window_t* self) { @@ -223,7 +221,7 @@ void CEF_CALLBACK window_restore(struct _cef_window_t* self) { } void CEF_CALLBACK window_set_fullscreen(struct _cef_window_t* self, - int fullscreen) { + int fullscreen) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -231,8 +229,7 @@ void CEF_CALLBACK window_set_fullscreen(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SetFullscreen( - fullscreen?true:false); + CefWindowCppToC::Get(self)->SetFullscreen(fullscreen ? true : false); } int CEF_CALLBACK window_is_maximized(struct _cef_window_t* self) { @@ -278,7 +275,7 @@ int CEF_CALLBACK window_is_fullscreen(struct _cef_window_t* self) { } void CEF_CALLBACK window_set_title(struct _cef_window_t* self, - const cef_string_t* title) { + const cef_string_t* title) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -287,12 +284,11 @@ void CEF_CALLBACK window_set_title(struct _cef_window_t* self, // Unverified params: title // Execute - CefWindowCppToC::Get(self)->SetTitle( - CefString(title)); + CefWindowCppToC::Get(self)->SetTitle(CefString(title)); } -cef_string_userfree_t CEF_CALLBACK window_get_title( - struct _cef_window_t* self) { +cef_string_userfree_t CEF_CALLBACK +window_get_title(struct _cef_window_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -307,7 +303,7 @@ cef_string_userfree_t CEF_CALLBACK window_get_title( } void CEF_CALLBACK window_set_window_icon(struct _cef_window_t* self, - cef_image_t* image) { + cef_image_t* image) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -319,8 +315,7 @@ void CEF_CALLBACK window_set_window_icon(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SetWindowIcon( - CefImageCppToC::Unwrap(image)); + CefWindowCppToC::Get(self)->SetWindowIcon(CefImageCppToC::Unwrap(image)); } cef_image_t* CEF_CALLBACK window_get_window_icon(struct _cef_window_t* self) { @@ -338,7 +333,7 @@ cef_image_t* CEF_CALLBACK window_get_window_icon(struct _cef_window_t* self) { } void CEF_CALLBACK window_set_window_app_icon(struct _cef_window_t* self, - cef_image_t* image) { + cef_image_t* image) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -350,12 +345,11 @@ void CEF_CALLBACK window_set_window_app_icon(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SetWindowAppIcon( - CefImageCppToC::Unwrap(image)); + CefWindowCppToC::Get(self)->SetWindowAppIcon(CefImageCppToC::Unwrap(image)); } -cef_image_t* CEF_CALLBACK window_get_window_app_icon( - struct _cef_window_t* self) { +cef_image_t* CEF_CALLBACK +window_get_window_app_icon(struct _cef_window_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -370,8 +364,9 @@ cef_image_t* CEF_CALLBACK window_get_window_app_icon( } void CEF_CALLBACK window_show_menu(struct _cef_window_t* self, - cef_menu_model_t* menu_model, const cef_point_t* screen_point, - cef_menu_anchor_position_t anchor_position) { + cef_menu_model_t* menu_model, + const cef_point_t* screen_point, + cef_menu_anchor_position_t anchor_position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -387,13 +382,11 @@ void CEF_CALLBACK window_show_menu(struct _cef_window_t* self, return; // Translate param: screen_point; type: simple_byref_const - CefPoint screen_pointVal = screen_point?*screen_point:CefPoint(); + CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint(); // Execute - CefWindowCppToC::Get(self)->ShowMenu( - CefMenuModelCppToC::Unwrap(menu_model), - screen_pointVal, - anchor_position); + CefWindowCppToC::Get(self)->ShowMenu(CefMenuModelCppToC::Unwrap(menu_model), + screen_pointVal, anchor_position); } void CEF_CALLBACK window_cancel_menu(struct _cef_window_t* self) { @@ -421,8 +414,8 @@ cef_display_t* CEF_CALLBACK window_get_display(struct _cef_window_t* self) { return CefDisplayCppToC::Wrap(_retval); } -cef_rect_t CEF_CALLBACK window_get_client_area_bounds_in_screen( - struct _cef_window_t* self) { +cef_rect_t CEF_CALLBACK +window_get_client_area_bounds_in_screen(struct _cef_window_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -430,15 +423,17 @@ cef_rect_t CEF_CALLBACK window_get_client_area_bounds_in_screen( return CefRect(); // Execute - cef_rect_t _retval = CefWindowCppToC::Get(self)->GetClientAreaBoundsInScreen( - ); + cef_rect_t _retval = + CefWindowCppToC::Get(self)->GetClientAreaBoundsInScreen(); // Return type: simple return _retval; } -void CEF_CALLBACK window_set_draggable_regions(struct _cef_window_t* self, - size_t regionsCount, cef_draggable_region_t const* regions) { +void CEF_CALLBACK +window_set_draggable_regions(struct _cef_window_t* self, + size_t regionsCount, + cef_draggable_region_t const* regions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -447,7 +442,7 @@ void CEF_CALLBACK window_set_draggable_regions(struct _cef_window_t* self, // Unverified params: regions // Translate param: regions; type: simple_vec_byref_const - std::vector regionsList; + std::vector regionsList; if (regionsCount > 0) { for (size_t i = 0; i < regionsCount; ++i) { CefDraggableRegion regionsVal = regions[i]; @@ -456,12 +451,11 @@ void CEF_CALLBACK window_set_draggable_regions(struct _cef_window_t* self, } // Execute - CefWindowCppToC::Get(self)->SetDraggableRegions( - regionsList); + CefWindowCppToC::Get(self)->SetDraggableRegions(regionsList); } -cef_window_handle_t CEF_CALLBACK window_get_window_handle( - struct _cef_window_t* self) { +cef_window_handle_t CEF_CALLBACK +window_get_window_handle(struct _cef_window_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -476,7 +470,8 @@ cef_window_handle_t CEF_CALLBACK window_get_window_handle( } void CEF_CALLBACK window_send_key_press(struct _cef_window_t* self, - int key_code, uint32 event_flags) { + int key_code, + uint32 event_flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -484,13 +479,12 @@ void CEF_CALLBACK window_send_key_press(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SendKeyPress( - key_code, - event_flags); + CefWindowCppToC::Get(self)->SendKeyPress(key_code, event_flags); } void CEF_CALLBACK window_send_mouse_move(struct _cef_window_t* self, - int screen_x, int screen_y) { + int screen_x, + int screen_y) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -498,13 +492,13 @@ void CEF_CALLBACK window_send_mouse_move(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SendMouseMove( - screen_x, - screen_y); + CefWindowCppToC::Get(self)->SendMouseMove(screen_x, screen_y); } void CEF_CALLBACK window_send_mouse_events(struct _cef_window_t* self, - cef_mouse_button_type_t button, int mouse_down, int mouse_up) { + cef_mouse_button_type_t button, + int mouse_down, + int mouse_up) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -512,15 +506,16 @@ void CEF_CALLBACK window_send_mouse_events(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->SendMouseEvents( - button, - mouse_down?true:false, - mouse_up?true:false); + CefWindowCppToC::Get(self)->SendMouseEvents(button, mouse_down ? true : false, + mouse_up ? true : false); } void CEF_CALLBACK window_set_accelerator(struct _cef_window_t* self, - int command_id, int key_code, int shift_pressed, int ctrl_pressed, - int alt_pressed) { + int command_id, + int key_code, + int shift_pressed, + int ctrl_pressed, + int alt_pressed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -529,15 +524,12 @@ void CEF_CALLBACK window_set_accelerator(struct _cef_window_t* self, // Execute CefWindowCppToC::Get(self)->SetAccelerator( - command_id, - key_code, - shift_pressed?true:false, - ctrl_pressed?true:false, - alt_pressed?true:false); + command_id, key_code, shift_pressed ? true : false, + ctrl_pressed ? true : false, alt_pressed ? true : false); } void CEF_CALLBACK window_remove_accelerator(struct _cef_window_t* self, - int command_id) { + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -545,8 +537,7 @@ void CEF_CALLBACK window_remove_accelerator(struct _cef_window_t* self, return; // Execute - CefWindowCppToC::Get(self)->RemoveAccelerator( - command_id); + CefWindowCppToC::Get(self)->RemoveAccelerator(command_id); } void CEF_CALLBACK window_remove_all_accelerators(struct _cef_window_t* self) { @@ -568,15 +559,15 @@ struct _cef_window_t* CEF_CALLBACK window_as_window(struct _cef_panel_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsWindow(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->AsWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); } -cef_fill_layout_t* CEF_CALLBACK window_set_to_fill_layout( - struct _cef_panel_t* self) { +cef_fill_layout_t* CEF_CALLBACK +window_set_to_fill_layout(struct _cef_panel_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -584,16 +575,17 @@ cef_fill_layout_t* CEF_CALLBACK window_set_to_fill_layout( return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->SetToFillLayout(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetToFillLayout(); // Return type: refptr_same return CefFillLayoutCppToC::Wrap(_retval); } -cef_box_layout_t* CEF_CALLBACK window_set_to_box_layout( - struct _cef_panel_t* self, - const struct _cef_box_layout_settings_t* settings) { +cef_box_layout_t* CEF_CALLBACK +window_set_to_box_layout(struct _cef_panel_t* self, + const struct _cef_box_layout_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -610,9 +602,9 @@ cef_box_layout_t* CEF_CALLBACK window_set_to_box_layout( settingsObj.Set(*settings, false); // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->SetToBoxLayout( - settingsObj); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetToBoxLayout(settingsObj); // Return type: refptr_same return CefBoxLayoutCppToC::Wrap(_retval); @@ -626,8 +618,8 @@ cef_layout_t* CEF_CALLBACK window_get_layout(struct _cef_panel_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetLayout(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetLayout(); // Return type: refptr_same return CefLayoutCppToC::Wrap(_retval); @@ -645,7 +637,7 @@ void CEF_CALLBACK window_layout(struct _cef_panel_t* self) { } void CEF_CALLBACK window_add_child_view(struct _cef_panel_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -657,12 +649,13 @@ void CEF_CALLBACK window_add_child_view(struct _cef_panel_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->AddChildView( - CefViewCppToC::Unwrap(view)); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->AddChildView(CefViewCppToC::Unwrap(view)); } void CEF_CALLBACK window_add_child_view_at(struct _cef_panel_t* self, - cef_view_t* view, int index) { + cef_view_t* view, + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -678,13 +671,13 @@ void CEF_CALLBACK window_add_child_view_at(struct _cef_panel_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->AddChildViewAt( - CefViewCppToC::Unwrap(view), - index); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->AddChildViewAt(CefViewCppToC::Unwrap(view), index); } void CEF_CALLBACK window_reorder_child_view(struct _cef_panel_t* self, - cef_view_t* view, int index) { + cef_view_t* view, + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -696,13 +689,12 @@ void CEF_CALLBACK window_reorder_child_view(struct _cef_panel_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->ReorderChildView( - CefViewCppToC::Unwrap(view), - index); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->ReorderChildView(CefViewCppToC::Unwrap(view), index); } void CEF_CALLBACK window_remove_child_view(struct _cef_panel_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -714,8 +706,8 @@ void CEF_CALLBACK window_remove_child_view(struct _cef_panel_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->RemoveChildView( - CefViewCppToC::Unwrap(view)); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->RemoveChildView(CefViewCppToC::Unwrap(view)); } void CEF_CALLBACK window_remove_all_child_views(struct _cef_panel_t* self) { @@ -726,8 +718,8 @@ void CEF_CALLBACK window_remove_all_child_views(struct _cef_panel_t* self) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast( - self))->RemoveAllChildViews(); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->RemoveAllChildViews(); } size_t CEF_CALLBACK window_get_child_view_count(struct _cef_panel_t* self) { @@ -738,15 +730,15 @@ size_t CEF_CALLBACK window_get_child_view_count(struct _cef_panel_t* self) { return 0; // Execute - size_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetChildViewCount(); + size_t _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetChildViewCount(); // Return type: simple return _retval; } cef_view_t* CEF_CALLBACK window_get_child_view_at(struct _cef_panel_t* self, - int index) { + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -758,16 +750,16 @@ cef_view_t* CEF_CALLBACK window_get_child_view_at(struct _cef_panel_t* self, return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetChildViewAt( - index); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetChildViewAt(index); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } -cef_browser_view_t* CEF_CALLBACK window_as_browser_view( - struct _cef_view_t* self) { +cef_browser_view_t* CEF_CALLBACK +window_as_browser_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -775,8 +767,9 @@ cef_browser_view_t* CEF_CALLBACK window_as_browser_view( return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsBrowserView(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->AsBrowserView(); // Return type: refptr_same return CefBrowserViewCppToC::Wrap(_retval); @@ -790,8 +783,8 @@ cef_button_t* CEF_CALLBACK window_as_button(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsButton(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->AsButton(); // Return type: refptr_same return CefButtonCppToC::Wrap(_retval); @@ -805,15 +798,15 @@ cef_panel_t* CEF_CALLBACK window_as_panel(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsPanel(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->AsPanel(); // Return type: refptr_same return CefPanelCppToC::Wrap(_retval); } -cef_scroll_view_t* CEF_CALLBACK window_as_scroll_view( - struct _cef_view_t* self) { +cef_scroll_view_t* CEF_CALLBACK +window_as_scroll_view(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -821,8 +814,9 @@ cef_scroll_view_t* CEF_CALLBACK window_as_scroll_view( return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsScrollView(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->AsScrollView(); // Return type: refptr_same return CefScrollViewCppToC::Wrap(_retval); @@ -836,15 +830,16 @@ cef_textfield_t* CEF_CALLBACK window_as_textfield(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->AsTextfield(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->AsTextfield(); // Return type: refptr_same return CefTextfieldCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK window_get_type_string( - struct _cef_view_t* self) { +cef_string_userfree_t CEF_CALLBACK +window_get_type_string(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -852,15 +847,16 @@ cef_string_userfree_t CEF_CALLBACK window_get_type_string( return NULL; // Execute - CefString _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetTypeString(); + CefString _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetTypeString(); // Return type: string return _retval.DetachToUserFree(); } cef_string_userfree_t CEF_CALLBACK window_to_string(struct _cef_view_t* self, - int include_children) { + int include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -868,9 +864,9 @@ cef_string_userfree_t CEF_CALLBACK window_to_string(struct _cef_view_t* self, return NULL; // Execute - CefString _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ToString( - include_children?true:false); + CefString _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->ToString(include_children ? true : false); // Return type: string return _retval.DetachToUserFree(); @@ -884,8 +880,8 @@ int CEF_CALLBACK window_is_valid(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsValid(); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->IsValid(); // Return type: bool return _retval; @@ -899,8 +895,8 @@ int CEF_CALLBACK window_is_attached(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsAttached(); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->IsAttached(); // Return type: bool return _retval; @@ -918,16 +914,15 @@ int CEF_CALLBACK window_is_same(struct _cef_view_t* self, cef_view_t* that) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsSame( - CefViewCppToC::Unwrap(that)); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->IsSame(CefViewCppToC::Unwrap(that)); // Return type: bool return _retval; } -cef_view_delegate_t* CEF_CALLBACK window_get_delegate( - struct _cef_view_t* self) { +cef_view_delegate_t* CEF_CALLBACK +window_get_delegate(struct _cef_view_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -935,8 +930,9 @@ cef_view_delegate_t* CEF_CALLBACK window_get_delegate( return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetDelegate(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetDelegate(); // Return type: refptr_diff return CefViewDelegateCToCpp::Unwrap(_retval); @@ -950,8 +946,8 @@ struct _cef_window_t* CEF_CALLBACK window_get_window(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetWindow(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetWindow(); // Return type: refptr_same return CefWindowCppToC::Wrap(_retval); @@ -965,8 +961,8 @@ int CEF_CALLBACK window_get_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetID(); + int _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetID(); // Return type: simple return _retval; @@ -980,8 +976,7 @@ void CEF_CALLBACK window_set_id(struct _cef_view_t* self, int id) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetID( - id); + CefWindowCppToC::Get(reinterpret_cast(self))->SetID(id); } int CEF_CALLBACK window_get_group_id(struct _cef_view_t* self) { @@ -992,8 +987,8 @@ int CEF_CALLBACK window_get_group_id(struct _cef_view_t* self) { return 0; // Execute - int _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetGroupID(); + int _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetGroupID(); // Return type: simple return _retval; @@ -1007,8 +1002,8 @@ void CEF_CALLBACK window_set_group_id(struct _cef_view_t* self, int group_id) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetGroupID( - group_id); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetGroupID(group_id); } cef_view_t* CEF_CALLBACK window_get_parent_view(struct _cef_view_t* self) { @@ -1019,15 +1014,16 @@ cef_view_t* CEF_CALLBACK window_get_parent_view(struct _cef_view_t* self) { return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetParentView(); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetParentView(); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } cef_view_t* CEF_CALLBACK window_get_view_for_id(struct _cef_view_t* self, - int id) { + int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1035,16 +1031,16 @@ cef_view_t* CEF_CALLBACK window_get_view_for_id(struct _cef_view_t* self, return NULL; // Execute - CefRefPtr _retval = CefWindowCppToC::Get( - reinterpret_cast(self))->GetViewForID( - id); + CefRefPtr _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetViewForID(id); // Return type: refptr_same return CefViewCppToC::Wrap(_retval); } void CEF_CALLBACK window_set_bounds(struct _cef_view_t* self, - const cef_rect_t* bounds) { + const cef_rect_t* bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1056,11 +1052,11 @@ void CEF_CALLBACK window_set_bounds(struct _cef_view_t* self, return; // Translate param: bounds; type: simple_byref_const - CefRect boundsVal = bounds?*bounds:CefRect(); + CefRect boundsVal = bounds ? *bounds : CefRect(); // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetBounds( - boundsVal); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetBounds(boundsVal); } cef_rect_t CEF_CALLBACK window_get_bounds(struct _cef_view_t* self) { @@ -1071,8 +1067,8 @@ cef_rect_t CEF_CALLBACK window_get_bounds(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetBounds(); + cef_rect_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetBounds(); // Return type: simple return _retval; @@ -1086,15 +1082,16 @@ cef_rect_t CEF_CALLBACK window_get_bounds_in_screen(struct _cef_view_t* self) { return CefRect(); // Execute - cef_rect_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetBoundsInScreen(); + cef_rect_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetBoundsInScreen(); // Return type: simple return _retval; } void CEF_CALLBACK window_set_size(struct _cef_view_t* self, - const cef_size_t* size) { + const cef_size_t* size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1106,11 +1103,10 @@ void CEF_CALLBACK window_set_size(struct _cef_view_t* self, return; // Translate param: size; type: simple_byref_const - CefSize sizeVal = size?*size:CefSize(); + CefSize sizeVal = size ? *size : CefSize(); // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetSize( - sizeVal); + CefWindowCppToC::Get(reinterpret_cast(self))->SetSize(sizeVal); } cef_size_t CEF_CALLBACK window_get_size(struct _cef_view_t* self) { @@ -1121,15 +1117,15 @@ cef_size_t CEF_CALLBACK window_get_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetSize(); + cef_size_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->GetSize(); // Return type: simple return _retval; } void CEF_CALLBACK window_set_position(struct _cef_view_t* self, - const cef_point_t* position) { + const cef_point_t* position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1141,11 +1137,11 @@ void CEF_CALLBACK window_set_position(struct _cef_view_t* self, return; // Translate param: position; type: simple_byref_const - CefPoint positionVal = position?*position:CefPoint(); + CefPoint positionVal = position ? *position : CefPoint(); // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetPosition( - positionVal); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetPosition(positionVal); } cef_point_t CEF_CALLBACK window_get_position(struct _cef_view_t* self) { @@ -1156,8 +1152,9 @@ cef_point_t CEF_CALLBACK window_get_position(struct _cef_view_t* self) { return CefPoint(); // Execute - cef_point_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetPosition(); + cef_point_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetPosition(); // Return type: simple return _retval; @@ -1171,8 +1168,9 @@ cef_size_t CEF_CALLBACK window_get_preferred_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetPreferredSize(); + cef_size_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetPreferredSize(); // Return type: simple return _retval; @@ -1186,8 +1184,8 @@ void CEF_CALLBACK window_size_to_preferred_size(struct _cef_view_t* self) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast( - self))->SizeToPreferredSize(); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SizeToPreferredSize(); } cef_size_t CEF_CALLBACK window_get_minimum_size(struct _cef_view_t* self) { @@ -1198,8 +1196,9 @@ cef_size_t CEF_CALLBACK window_get_minimum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetMinimumSize(); + cef_size_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetMinimumSize(); // Return type: simple return _retval; @@ -1213,15 +1212,16 @@ cef_size_t CEF_CALLBACK window_get_maximum_size(struct _cef_view_t* self) { return CefSize(); // Execute - cef_size_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetMaximumSize(); + cef_size_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetMaximumSize(); // Return type: simple return _retval; } int CEF_CALLBACK window_get_height_for_width(struct _cef_view_t* self, - int width) { + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1229,9 +1229,8 @@ int CEF_CALLBACK window_get_height_for_width(struct _cef_view_t* self, return 0; // Execute - int _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetHeightForWidth( - width); + int _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetHeightForWidth(width); // Return type: simple return _retval; @@ -1245,8 +1244,8 @@ void CEF_CALLBACK window_invalidate_layout(struct _cef_view_t* self) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->InvalidateLayout( - ); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->InvalidateLayout(); } void CEF_CALLBACK window_set_visible(struct _cef_view_t* self, int visible) { @@ -1257,8 +1256,8 @@ void CEF_CALLBACK window_set_visible(struct _cef_view_t* self, int visible) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetVisible( - visible?true:false); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetVisible(visible ? true : false); } int CEF_CALLBACK window_is_visible(struct _cef_view_t* self) { @@ -1269,8 +1268,8 @@ int CEF_CALLBACK window_is_visible(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsVisible(); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->IsVisible(); // Return type: bool return _retval; @@ -1284,8 +1283,8 @@ int CEF_CALLBACK window_is_drawn(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsDrawn(); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->IsDrawn(); // Return type: bool return _retval; @@ -1299,8 +1298,8 @@ void CEF_CALLBACK window_set_enabled(struct _cef_view_t* self, int enabled) { return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetEnabled( - enabled?true:false); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetEnabled(enabled ? true : false); } int CEF_CALLBACK window_is_enabled(struct _cef_view_t* self) { @@ -1311,15 +1310,15 @@ int CEF_CALLBACK window_is_enabled(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsEnabled(); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self))->IsEnabled(); // Return type: bool return _retval; } void CEF_CALLBACK window_set_focusable(struct _cef_view_t* self, - int focusable) { + int focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1327,8 +1326,8 @@ void CEF_CALLBACK window_set_focusable(struct _cef_view_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast(self))->SetFocusable( - focusable?true:false); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetFocusable(focusable ? true : false); } int CEF_CALLBACK window_is_focusable(struct _cef_view_t* self) { @@ -1339,8 +1338,8 @@ int CEF_CALLBACK window_is_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsFocusable(); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->IsFocusable(); // Return type: bool return _retval; @@ -1354,8 +1353,8 @@ int CEF_CALLBACK window_is_accessibility_focusable(struct _cef_view_t* self) { return 0; // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->IsAccessibilityFocusable(); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->IsAccessibilityFocusable(); // Return type: bool return _retval; @@ -1373,7 +1372,7 @@ void CEF_CALLBACK window_request_focus(struct _cef_view_t* self) { } void CEF_CALLBACK window_set_background_color(struct _cef_view_t* self, - cef_color_t color) { + cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1381,9 +1380,8 @@ void CEF_CALLBACK window_set_background_color(struct _cef_view_t* self, return; // Execute - CefWindowCppToC::Get(reinterpret_cast( - self))->SetBackgroundColor( - color); + CefWindowCppToC::Get(reinterpret_cast(self)) + ->SetBackgroundColor(color); } cef_color_t CEF_CALLBACK window_get_background_color(struct _cef_view_t* self) { @@ -1394,15 +1392,16 @@ cef_color_t CEF_CALLBACK window_get_background_color(struct _cef_view_t* self) { return 0; // Execute - cef_color_t _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->GetBackgroundColor(); + cef_color_t _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->GetBackgroundColor(); // Return type: simple return _retval; } int CEF_CALLBACK window_convert_point_to_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1414,12 +1413,11 @@ int CEF_CALLBACK window_convert_point_to_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointToScreen( - pointVal); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1430,7 +1428,7 @@ int CEF_CALLBACK window_convert_point_to_screen(struct _cef_view_t* self, } int CEF_CALLBACK window_convert_point_from_screen(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1442,12 +1440,11 @@ int CEF_CALLBACK window_convert_point_from_screen(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointFromScreen( - pointVal); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromScreen(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1458,7 +1455,7 @@ int CEF_CALLBACK window_convert_point_from_screen(struct _cef_view_t* self, } int CEF_CALLBACK window_convert_point_to_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1470,12 +1467,11 @@ int CEF_CALLBACK window_convert_point_to_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointToWindow( - pointVal); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1486,7 +1482,7 @@ int CEF_CALLBACK window_convert_point_to_window(struct _cef_view_t* self, } int CEF_CALLBACK window_convert_point_from_window(struct _cef_view_t* self, - cef_point_t* point) { + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1498,12 +1494,11 @@ int CEF_CALLBACK window_convert_point_from_window(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointFromWindow( - pointVal); + bool _retval = CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromWindow(pointVal); // Restore param: point; type: simple_byref if (point) @@ -1514,7 +1509,8 @@ int CEF_CALLBACK window_convert_point_from_window(struct _cef_view_t* self, } int CEF_CALLBACK window_convert_point_to_view(struct _cef_view_t* self, - cef_view_t* view, cef_point_t* point) { + cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1530,13 +1526,12 @@ int CEF_CALLBACK window_convert_point_to_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointToView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointToView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1547,7 +1542,8 @@ int CEF_CALLBACK window_convert_point_to_view(struct _cef_view_t* self, } int CEF_CALLBACK window_convert_point_from_view(struct _cef_view_t* self, - cef_view_t* view, cef_point_t* point) { + cef_view_t* view, + cef_point_t* point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -1563,13 +1559,12 @@ int CEF_CALLBACK window_convert_point_from_view(struct _cef_view_t* self, return 0; // Translate param: point; type: simple_byref - CefPoint pointVal = point?*point:CefPoint(); + CefPoint pointVal = point ? *point : CefPoint(); // Execute - bool _retval = CefWindowCppToC::Get(reinterpret_cast( - self))->ConvertPointFromView( - CefViewCppToC::Unwrap(view), - pointVal); + bool _retval = + CefWindowCppToC::Get(reinterpret_cast(self)) + ->ConvertPointFromView(CefViewCppToC::Unwrap(view), pointVal); // Restore param: point; type: simple_byref if (point) @@ -1581,7 +1576,6 @@ int CEF_CALLBACK window_convert_point_from_view(struct _cef_view_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWindowCppToC::CefWindowCppToC() { @@ -1690,16 +1684,22 @@ CefWindowCppToC::CefWindowCppToC() { window_convert_point_from_view; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_window_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted::UnwrapDerived( + CefWrapperType type, + cef_window_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WINDOW; +template <> +CefWrapperType CefCppToCRefCounted:: + kWrapperType = WT_WINDOW; diff --git a/libcef_dll/cpptoc/views/window_cpptoc.h b/libcef_dll/cpptoc/views/window_cpptoc.h index 3af127f6c..e583310f5 100644 --- a/libcef_dll/cpptoc/views/window_cpptoc.h +++ b/libcef_dll/cpptoc/views/window_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c71caf1cf4f00cced60efec26cb58fb60ed8bf86$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_CPPTOC_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_window.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_window.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. diff --git a/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc index b8d018b89..de4d92761 100644 --- a/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc +++ b/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fad9939546ba7289df656386ae77e4d8b60f58de$ +// #include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK window_delegate_on_window_created( - struct _cef_window_delegate_t* self, cef_window_t* window) { +void CEF_CALLBACK +window_delegate_on_window_created(struct _cef_window_delegate_t* self, + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -36,8 +38,9 @@ void CEF_CALLBACK window_delegate_on_window_created( CefWindowCToCpp::Wrap(window)); } -void CEF_CALLBACK window_delegate_on_window_destroyed( - struct _cef_window_delegate_t* self, cef_window_t* window) { +void CEF_CALLBACK +window_delegate_on_window_destroyed(struct _cef_window_delegate_t* self, + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,8 +56,9 @@ void CEF_CALLBACK window_delegate_on_window_destroyed( CefWindowCToCpp::Wrap(window)); } -int CEF_CALLBACK window_delegate_is_frameless( - struct _cef_window_delegate_t* self, cef_window_t* window) { +int CEF_CALLBACK +window_delegate_is_frameless(struct _cef_window_delegate_t* self, + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,7 +78,7 @@ int CEF_CALLBACK window_delegate_is_frameless( } int CEF_CALLBACK window_delegate_can_resize(struct _cef_window_delegate_t* self, - cef_window_t* window) { + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +97,9 @@ int CEF_CALLBACK window_delegate_can_resize(struct _cef_window_delegate_t* self, return _retval; } -int CEF_CALLBACK window_delegate_can_maximize( - struct _cef_window_delegate_t* self, cef_window_t* window) { +int CEF_CALLBACK +window_delegate_can_maximize(struct _cef_window_delegate_t* self, + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -113,8 +118,9 @@ int CEF_CALLBACK window_delegate_can_maximize( return _retval; } -int CEF_CALLBACK window_delegate_can_minimize( - struct _cef_window_delegate_t* self, cef_window_t* window) { +int CEF_CALLBACK +window_delegate_can_minimize(struct _cef_window_delegate_t* self, + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -134,7 +140,7 @@ int CEF_CALLBACK window_delegate_can_minimize( } int CEF_CALLBACK window_delegate_can_close(struct _cef_window_delegate_t* self, - cef_window_t* window) { + cef_window_t* window) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -153,9 +159,10 @@ int CEF_CALLBACK window_delegate_can_close(struct _cef_window_delegate_t* self, return _retval; } -int CEF_CALLBACK window_delegate_on_accelerator( - struct _cef_window_delegate_t* self, cef_window_t* window, - int command_id) { +int CEF_CALLBACK +window_delegate_on_accelerator(struct _cef_window_delegate_t* self, + cef_window_t* window, + int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -168,16 +175,16 @@ int CEF_CALLBACK window_delegate_on_accelerator( // Execute bool _retval = CefWindowDelegateCppToC::Get(self)->OnAccelerator( - CefWindowCToCpp::Wrap(window), - command_id); + CefWindowCToCpp::Wrap(window), command_id); // Return type: bool return _retval; } -int CEF_CALLBACK window_delegate_on_key_event( - struct _cef_window_delegate_t* self, cef_window_t* window, - const struct _cef_key_event_t* event) { +int CEF_CALLBACK +window_delegate_on_key_event(struct _cef_window_delegate_t* self, + cef_window_t* window, + const struct _cef_key_event_t* event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -199,15 +206,15 @@ int CEF_CALLBACK window_delegate_on_key_event( // Execute bool _retval = CefWindowDelegateCppToC::Get(self)->OnKeyEvent( - CefWindowCToCpp::Wrap(window), - eventObj); + CefWindowCToCpp::Wrap(window), eventObj); // Return type: bool return _retval; } -cef_size_t CEF_CALLBACK window_delegate_get_preferred_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +window_delegate_get_preferred_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -220,15 +227,16 @@ cef_size_t CEF_CALLBACK window_delegate_get_preferred_size( // Execute cef_size_t _retval = CefWindowDelegateCppToC::Get( - reinterpret_cast(self))->GetPreferredSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetPreferredSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK window_delegate_get_minimum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +window_delegate_get_minimum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -241,15 +249,16 @@ cef_size_t CEF_CALLBACK window_delegate_get_minimum_size( // Execute cef_size_t _retval = CefWindowDelegateCppToC::Get( - reinterpret_cast(self))->GetMinimumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMinimumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -cef_size_t CEF_CALLBACK window_delegate_get_maximum_size( - struct _cef_view_delegate_t* self, cef_view_t* view) { +cef_size_t CEF_CALLBACK +window_delegate_get_maximum_size(struct _cef_view_delegate_t* self, + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -262,15 +271,17 @@ cef_size_t CEF_CALLBACK window_delegate_get_maximum_size( // Execute cef_size_t _retval = CefWindowDelegateCppToC::Get( - reinterpret_cast(self))->GetMaximumSize( - CefViewCToCpp::Wrap(view)); + reinterpret_cast(self)) + ->GetMaximumSize(CefViewCToCpp::Wrap(view)); // Return type: simple return _retval; } -int CEF_CALLBACK window_delegate_get_height_for_width( - struct _cef_view_delegate_t* self, cef_view_t* view, int width) { +int CEF_CALLBACK +window_delegate_get_height_for_width(struct _cef_view_delegate_t* self, + cef_view_t* view, + int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -283,17 +294,18 @@ int CEF_CALLBACK window_delegate_get_height_for_width( // Execute int _retval = CefWindowDelegateCppToC::Get( - reinterpret_cast(self))->GetHeightForWidth( - CefViewCToCpp::Wrap(view), - width); + reinterpret_cast(self)) + ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width); // Return type: simple return _retval; } -void CEF_CALLBACK window_delegate_on_parent_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* parent) { +void CEF_CALLBACK +window_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* parent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -309,16 +321,16 @@ void CEF_CALLBACK window_delegate_on_parent_view_changed( return; // Execute - CefWindowDelegateCppToC::Get(reinterpret_cast( - self))->OnParentViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(parent)); + CefWindowDelegateCppToC::Get(reinterpret_cast(self)) + ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(parent)); } -void CEF_CALLBACK window_delegate_on_child_view_changed( - struct _cef_view_delegate_t* self, cef_view_t* view, int added, - cef_view_t* child) { +void CEF_CALLBACK +window_delegate_on_child_view_changed(struct _cef_view_delegate_t* self, + cef_view_t* view, + int added, + cef_view_t* child) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -334,15 +346,13 @@ void CEF_CALLBACK window_delegate_on_child_view_changed( return; // Execute - CefWindowDelegateCppToC::Get(reinterpret_cast( - self))->OnChildViewChanged( - CefViewCToCpp::Wrap(view), - added?true:false, - CefViewCToCpp::Wrap(child)); + CefWindowDelegateCppToC::Get(reinterpret_cast(self)) + ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false, + CefViewCToCpp::Wrap(child)); } void CEF_CALLBACK window_delegate_on_focus(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -354,13 +364,12 @@ void CEF_CALLBACK window_delegate_on_focus(struct _cef_view_delegate_t* self, return; // Execute - CefWindowDelegateCppToC::Get(reinterpret_cast( - self))->OnFocus( - CefViewCToCpp::Wrap(view)); + CefWindowDelegateCppToC::Get(reinterpret_cast(self)) + ->OnFocus(CefViewCToCpp::Wrap(view)); } void CEF_CALLBACK window_delegate_on_blur(struct _cef_view_delegate_t* self, - cef_view_t* view) { + cef_view_t* view) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -372,14 +381,12 @@ void CEF_CALLBACK window_delegate_on_blur(struct _cef_view_delegate_t* self, return; // Execute - CefWindowDelegateCppToC::Get(reinterpret_cast( - self))->OnBlur( - CefViewCToCpp::Wrap(view)); + CefWindowDelegateCppToC::Get(reinterpret_cast(self)) + ->OnBlur(CefViewCToCpp::Wrap(view)); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWindowDelegateCppToC::CefWindowDelegateCppToC() { @@ -406,18 +413,25 @@ CefWindowDelegateCppToC::CefWindowDelegateCppToC() { GetStruct()->base.base.on_blur = window_delegate_on_blur; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_window_delegate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefWindowDelegateCppToC, + CefWindowDelegate, + cef_window_delegate_t>::UnwrapDerived(CefWrapperType type, + cef_window_delegate_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WINDOW_DELEGATE; diff --git a/libcef_dll/cpptoc/views/window_delegate_cpptoc.h b/libcef_dll/cpptoc/views/window_delegate_cpptoc.h index f37db11ec..9e3b1739a 100644 --- a/libcef_dll/cpptoc/views/window_delegate_cpptoc.h +++ b/libcef_dll/cpptoc/views/window_delegate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a14838405e10fae96702de855491a18dc1958bc6$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_DELEGATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_DELEGATE_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_window_delegate.h" +#include "include/capi/views/cef_window_capi.h" #include "include/capi/views/cef_window_delegate_capi.h" #include "include/views/cef_window.h" -#include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_window_delegate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefWindowDelegateCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefWindowDelegateCppToC(); }; diff --git a/libcef_dll/cpptoc/waitable_event_cpptoc.cc b/libcef_dll/cpptoc/waitable_event_cpptoc.cc index d51973710..6936c1f03 100644 --- a/libcef_dll/cpptoc/waitable_event_cpptoc.cc +++ b/libcef_dll/cpptoc/waitable_event_cpptoc.cc @@ -9,26 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4fd428371bfadec9dd68d9b95f1b0bfe2599b681$ +// #include "libcef_dll/cpptoc/waitable_event_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create(int automatic_reset, +CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create( + int automatic_reset, int initially_signaled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefRefPtr _retval = CefWaitableEvent::CreateWaitableEvent( - automatic_reset?true:false, - initially_signaled?true:false); + automatic_reset ? true : false, initially_signaled ? true : false); // Return type: refptr_same return CefWaitableEventCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -55,8 +55,8 @@ void CEF_CALLBACK waitable_event_signal(struct _cef_waitable_event_t* self) { CefWaitableEventCppToC::Get(self)->Signal(); } -int CEF_CALLBACK waitable_event_is_signaled( - struct _cef_waitable_event_t* self) { +int CEF_CALLBACK +waitable_event_is_signaled(struct _cef_waitable_event_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -82,7 +82,7 @@ void CEF_CALLBACK waitable_event_wait(struct _cef_waitable_event_t* self) { } int CEF_CALLBACK waitable_event_timed_wait(struct _cef_waitable_event_t* self, - int64 max_ms) { + int64 max_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -90,8 +90,7 @@ int CEF_CALLBACK waitable_event_timed_wait(struct _cef_waitable_event_t* self, return 0; // Execute - bool _retval = CefWaitableEventCppToC::Get(self)->TimedWait( - max_ms); + bool _retval = CefWaitableEventCppToC::Get(self)->TimedWait(max_ms); // Return type: bool return _retval; @@ -99,7 +98,6 @@ int CEF_CALLBACK waitable_event_timed_wait(struct _cef_waitable_event_t* self, } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWaitableEventCppToC::CefWaitableEventCppToC() { @@ -110,17 +108,25 @@ CefWaitableEventCppToC::CefWaitableEventCppToC() { GetStruct()->timed_wait = waitable_event_timed_wait; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_waitable_event_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefWaitableEventCppToC, + CefWaitableEvent, + cef_waitable_event_t>::UnwrapDerived(CefWrapperType type, + cef_waitable_event_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WAITABLE_EVENT; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_WAITABLE_EVENT; diff --git a/libcef_dll/cpptoc/waitable_event_cpptoc.h b/libcef_dll/cpptoc/waitable_event_cpptoc.h index 947196852..8cc8c516e 100644 --- a/libcef_dll/cpptoc/waitable_event_cpptoc.h +++ b/libcef_dll/cpptoc/waitable_event_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d402d9e109017d1b3abe5a119eb713db750f50ab$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_WAITABLE_EVENT_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_WAITABLE_EVENT_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_waitable_event.h" #include "include/capi/cef_waitable_event_capi.h" +#include "include/cef_waitable_event.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefWaitableEventCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefWaitableEventCppToC(); }; diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc index 26dad803e..ad98b3eb8 100644 --- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6e7fee65b06841fd683275211fd2091a08e43473$ +// #include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_name( - struct _cef_web_plugin_info_t* self) { +cef_string_userfree_t CEF_CALLBACK +web_plugin_info_get_name(struct _cef_web_plugin_info_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,8 +33,8 @@ cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_path( - struct _cef_web_plugin_info_t* self) { +cef_string_userfree_t CEF_CALLBACK +web_plugin_info_get_path(struct _cef_web_plugin_info_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +48,8 @@ cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_path( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_version( - struct _cef_web_plugin_info_t* self) { +cef_string_userfree_t CEF_CALLBACK +web_plugin_info_get_version(struct _cef_web_plugin_info_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -62,8 +63,8 @@ cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_version( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_description( - struct _cef_web_plugin_info_t* self) { +cef_string_userfree_t CEF_CALLBACK +web_plugin_info_get_description(struct _cef_web_plugin_info_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,7 +80,6 @@ cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_description( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWebPluginInfoCppToC::CefWebPluginInfoCppToC() { @@ -89,18 +89,25 @@ CefWebPluginInfoCppToC::CefWebPluginInfoCppToC() { GetStruct()->get_description = web_plugin_info_get_description; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_web_plugin_info_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefWebPluginInfoCppToC, + CefWebPluginInfo, + cef_web_plugin_info_t>::UnwrapDerived(CefWrapperType type, + cef_web_plugin_info_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WEB_PLUGIN_INFO; diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h index 2016dd56c..5206cddb7 100644 --- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cfb39aa7ef3fdfc92f7dd273cef2007ca8a3c2b8$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefWebPluginInfoCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefWebPluginInfoCppToC(); }; diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc index 020f18073..40f98e9bb 100644 --- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=816066f7dd4898066b737cc6a990a8b384d3ae9a$ +// #include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h" #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK web_plugin_info_visitor_visit( - struct _cef_web_plugin_info_visitor_t* self, cef_web_plugin_info_t* info, - int count, int total) { +int CEF_CALLBACK +web_plugin_info_visitor_visit(struct _cef_web_plugin_info_visitor_t* self, + cef_web_plugin_info_t* info, + int count, + int total) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,9 +36,7 @@ int CEF_CALLBACK web_plugin_info_visitor_visit( // Execute bool _retval = CefWebPluginInfoVisitorCppToC::Get(self)->Visit( - CefWebPluginInfoCToCpp::Wrap(info), - count, - total); + CefWebPluginInfoCToCpp::Wrap(info), count, total); // Return type: bool return _retval; @@ -43,25 +44,34 @@ int CEF_CALLBACK web_plugin_info_visitor_visit( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWebPluginInfoVisitorCppToC::CefWebPluginInfoVisitorCppToC() { GetStruct()->visit = web_plugin_info_visitor_visit; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_web_plugin_info_visitor_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefWebPluginInfoVisitorCppToC, + CefWebPluginInfoVisitor, + cef_web_plugin_info_visitor_t>::UnwrapDerived(CefWrapperType type, + cef_web_plugin_info_visitor_t* + s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_WEB_PLUGIN_INFO_VISITOR; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_WEB_PLUGIN_INFO_VISITOR; diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h index d0891731a..9ed4d7be2 100644 --- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=89c5f96f547bcb4d721e63e583579d5ac343c26f$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefWebPluginInfoVisitorCppToC : public CefCppToCRefCounted { + CefWebPluginInfoVisitor, + cef_web_plugin_info_visitor_t> { public: CefWebPluginInfoVisitorCppToC(); }; diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc index bf8cc7698..5636d707b 100644 --- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=52bc768586692e9e780fefc07e789f3cfdc032fa$ +// #include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK web_plugin_unstable_callback_is_unstable( - struct _cef_web_plugin_unstable_callback_t* self, const cef_string_t* path, + struct _cef_web_plugin_unstable_callback_t* self, + const cef_string_t* path, int unstable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -32,34 +34,38 @@ void CEF_CALLBACK web_plugin_unstable_callback_is_unstable( // Execute CefWebPluginUnstableCallbackCppToC::Get(self)->IsUnstable( - CefString(path), - unstable?true:false); + CefString(path), unstable ? true : false); } } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWebPluginUnstableCallbackCppToC::CefWebPluginUnstableCallbackCppToC() { GetStruct()->is_unstable = web_plugin_unstable_callback_is_unstable; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_web_plugin_unstable_callback_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_web_plugin_unstable_callback_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = - WT_WEB_PLUGIN_UNSTABLE_CALLBACK; +template <> +CefWrapperType + CefCppToCRefCounted::kWrapperType = + WT_WEB_PLUGIN_UNSTABLE_CALLBACK; diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h index 08ad2373f..5010bda1b 100644 --- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=31fe8c2d8fe2d46080061e5f84f6abc4c600195e$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefWebPluginUnstableCallbackCppToC : public CefCppToCRefCounted { + CefWebPluginUnstableCallback, + cef_web_plugin_unstable_callback_t> { public: CefWebPluginUnstableCallbackCppToC(); }; diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc index 270f3beb3..dc55d01d9 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -9,16 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0474e29257b82b777a1f7d2ba4a8fcdb5297d9a6$ +// #include "libcef_dll/cpptoc/write_handler_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, - const void* ptr, size_t size, size_t n) { + const void* ptr, + size_t size, + size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -30,17 +33,15 @@ size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, return 0; // Execute - size_t _retval = CefWriteHandlerCppToC::Get(self)->Write( - ptr, - size, - n); + size_t _retval = CefWriteHandlerCppToC::Get(self)->Write(ptr, size, n); // Return type: simple return _retval; } int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, - int64 offset, int whence) { + int64 offset, + int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,9 +49,7 @@ int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, return 0; // Execute - int _retval = CefWriteHandlerCppToC::Get(self)->Seek( - offset, - whence); + int _retval = CefWriteHandlerCppToC::Get(self)->Seek(offset, whence); // Return type: simple return _retval; @@ -100,7 +99,6 @@ int CEF_CALLBACK write_handler_may_block(struct _cef_write_handler_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefWriteHandlerCppToC::CefWriteHandlerCppToC() { @@ -111,17 +109,25 @@ CefWriteHandlerCppToC::CefWriteHandlerCppToC() { GetStruct()->may_block = write_handler_may_block; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_write_handler_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefWriteHandlerCppToC, + CefWriteHandler, + cef_write_handler_t>::UnwrapDerived(CefWrapperType type, + cef_write_handler_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WRITE_HANDLER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_WRITE_HANDLER; diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h index 68bb56b30..f7a3a522e 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.h +++ b/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=16bac72f91f24b935ad7a3dde2e2cbcaa318a989$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. -class CefWriteHandlerCppToC - : public CefCppToCRefCounted { +class CefWriteHandlerCppToC : public CefCppToCRefCounted { public: CefWriteHandlerCppToC(); }; diff --git a/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc b/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc index b5bdcc899..36da3f29b 100644 --- a/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc +++ b/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8e46f821396e176418b12eea00f98c94a7af9bbb$ +// #include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h" #include "libcef_dll/transfer_util.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_display_name( - struct _cef_x509cert_principal_t* self) { +cef_string_userfree_t CEF_CALLBACK +x509cert_principal_get_display_name(struct _cef_x509cert_principal_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +34,8 @@ cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_display_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_common_name( - struct _cef_x509cert_principal_t* self) { +cef_string_userfree_t CEF_CALLBACK +x509cert_principal_get_common_name(struct _cef_x509cert_principal_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,8 +49,8 @@ cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_common_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_locality_name( - struct _cef_x509cert_principal_t* self) { +cef_string_userfree_t CEF_CALLBACK +x509cert_principal_get_locality_name(struct _cef_x509cert_principal_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -63,7 +64,8 @@ cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_locality_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_state_or_province_name( +cef_string_userfree_t CEF_CALLBACK +x509cert_principal_get_state_or_province_name( struct _cef_x509cert_principal_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -72,15 +74,15 @@ cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_state_or_province_name return NULL; // Execute - CefString _retval = CefX509CertPrincipalCppToC::Get( - self)->GetStateOrProvinceName(); + CefString _retval = + CefX509CertPrincipalCppToC::Get(self)->GetStateOrProvinceName(); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_country_name( - struct _cef_x509cert_principal_t* self) { +cef_string_userfree_t CEF_CALLBACK +x509cert_principal_get_country_name(struct _cef_x509cert_principal_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -94,8 +96,9 @@ cef_string_userfree_t CEF_CALLBACK x509cert_principal_get_country_name( return _retval.DetachToUserFree(); } -void CEF_CALLBACK x509cert_principal_get_street_addresses( - struct _cef_x509cert_principal_t* self, cef_string_list_t addresses) { +void CEF_CALLBACK +x509cert_principal_get_street_addresses(struct _cef_x509cert_principal_t* self, + cef_string_list_t addresses) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -111,8 +114,7 @@ void CEF_CALLBACK x509cert_principal_get_street_addresses( transfer_string_list_contents(addresses, addressesList); // Execute - CefX509CertPrincipalCppToC::Get(self)->GetStreetAddresses( - addressesList); + CefX509CertPrincipalCppToC::Get(self)->GetStreetAddresses(addressesList); // Restore param: addresses; type: string_vec_byref cef_string_list_clear(addresses); @@ -120,7 +122,8 @@ void CEF_CALLBACK x509cert_principal_get_street_addresses( } void CEF_CALLBACK x509cert_principal_get_organization_names( - struct _cef_x509cert_principal_t* self, cef_string_list_t names) { + struct _cef_x509cert_principal_t* self, + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -136,8 +139,7 @@ void CEF_CALLBACK x509cert_principal_get_organization_names( transfer_string_list_contents(names, namesList); // Execute - CefX509CertPrincipalCppToC::Get(self)->GetOrganizationNames( - namesList); + CefX509CertPrincipalCppToC::Get(self)->GetOrganizationNames(namesList); // Restore param: names; type: string_vec_byref cef_string_list_clear(names); @@ -145,7 +147,8 @@ void CEF_CALLBACK x509cert_principal_get_organization_names( } void CEF_CALLBACK x509cert_principal_get_organization_unit_names( - struct _cef_x509cert_principal_t* self, cef_string_list_t names) { + struct _cef_x509cert_principal_t* self, + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -161,16 +164,16 @@ void CEF_CALLBACK x509cert_principal_get_organization_unit_names( transfer_string_list_contents(names, namesList); // Execute - CefX509CertPrincipalCppToC::Get(self)->GetOrganizationUnitNames( - namesList); + CefX509CertPrincipalCppToC::Get(self)->GetOrganizationUnitNames(namesList); // Restore param: names; type: string_vec_byref cef_string_list_clear(names); transfer_string_list_contents(namesList, names); } -void CEF_CALLBACK x509cert_principal_get_domain_components( - struct _cef_x509cert_principal_t* self, cef_string_list_t components) { +void CEF_CALLBACK +x509cert_principal_get_domain_components(struct _cef_x509cert_principal_t* self, + cef_string_list_t components) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -186,8 +189,7 @@ void CEF_CALLBACK x509cert_principal_get_domain_components( transfer_string_list_contents(components, componentsList); // Execute - CefX509CertPrincipalCppToC::Get(self)->GetDomainComponents( - componentsList); + CefX509CertPrincipalCppToC::Get(self)->GetDomainComponents(componentsList); // Restore param: components; type: string_vec_byref cef_string_list_clear(components); @@ -196,7 +198,6 @@ void CEF_CALLBACK x509cert_principal_get_domain_components( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefX509CertPrincipalCppToC::CefX509CertPrincipalCppToC() { @@ -214,18 +215,26 @@ CefX509CertPrincipalCppToC::CefX509CertPrincipalCppToC() { GetStruct()->get_domain_components = x509cert_principal_get_domain_components; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_x509cert_principal_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefX509CertPrincipalCppToC, + CefX509CertPrincipal, + cef_x509cert_principal_t>::UnwrapDerived(CefWrapperType type, + cef_x509cert_principal_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_X509CERT_PRINCIPAL; diff --git a/libcef_dll/cpptoc/x509cert_principal_cpptoc.h b/libcef_dll/cpptoc/x509cert_principal_cpptoc.h index a586206fe..25e2a5f77 100644 --- a/libcef_dll/cpptoc/x509cert_principal_cpptoc.h +++ b/libcef_dll/cpptoc/x509cert_principal_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=621d1e734fa7b1e6be754588f3e53de4a5a7f882$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_x509_certificate.h" #include "include/capi/cef_x509_certificate_capi.h" +#include "include/cef_x509_certificate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefX509CertPrincipalCppToC : public CefCppToCRefCounted { + CefX509CertPrincipal, + cef_x509cert_principal_t> { public: CefX509CertPrincipalCppToC(); }; diff --git a/libcef_dll/cpptoc/x509certificate_cpptoc.cc b/libcef_dll/cpptoc/x509certificate_cpptoc.cc index 16405fd46..ccd0b541d 100644 --- a/libcef_dll/cpptoc/x509certificate_cpptoc.cc +++ b/libcef_dll/cpptoc/x509certificate_cpptoc.cc @@ -9,19 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ecc954784a8061eb04b71933bb657368ef120dfa$ +// #include #include "libcef_dll/cpptoc/binary_value_cpptoc.h" #include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. -cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_subject( - struct _cef_x509certificate_t* self) { +cef_x509cert_principal_t* CEF_CALLBACK +x509certificate_get_subject(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,15 +30,15 @@ cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_subject( return NULL; // Execute - CefRefPtr _retval = CefX509CertificateCppToC::Get( - self)->GetSubject(); + CefRefPtr _retval = + CefX509CertificateCppToC::Get(self)->GetSubject(); // Return type: refptr_same return CefX509CertPrincipalCppToC::Wrap(_retval); } -cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_issuer( - struct _cef_x509certificate_t* self) { +cef_x509cert_principal_t* CEF_CALLBACK +x509certificate_get_issuer(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -45,15 +46,15 @@ cef_x509cert_principal_t* CEF_CALLBACK x509certificate_get_issuer( return NULL; // Execute - CefRefPtr _retval = CefX509CertificateCppToC::Get( - self)->GetIssuer(); + CefRefPtr _retval = + CefX509CertificateCppToC::Get(self)->GetIssuer(); // Return type: refptr_same return CefX509CertPrincipalCppToC::Wrap(_retval); } -cef_binary_value_t* CEF_CALLBACK x509certificate_get_serial_number( - struct _cef_x509certificate_t* self) { +cef_binary_value_t* CEF_CALLBACK +x509certificate_get_serial_number(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,15 +62,15 @@ cef_binary_value_t* CEF_CALLBACK x509certificate_get_serial_number( return NULL; // Execute - CefRefPtr _retval = CefX509CertificateCppToC::Get( - self)->GetSerialNumber(); + CefRefPtr _retval = + CefX509CertificateCppToC::Get(self)->GetSerialNumber(); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } -cef_time_t CEF_CALLBACK x509certificate_get_valid_start( - struct _cef_x509certificate_t* self) { +cef_time_t CEF_CALLBACK +x509certificate_get_valid_start(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -83,8 +84,8 @@ cef_time_t CEF_CALLBACK x509certificate_get_valid_start( return _retval; } -cef_time_t CEF_CALLBACK x509certificate_get_valid_expiry( - struct _cef_x509certificate_t* self) { +cef_time_t CEF_CALLBACK +x509certificate_get_valid_expiry(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +99,8 @@ cef_time_t CEF_CALLBACK x509certificate_get_valid_expiry( return _retval; } -cef_binary_value_t* CEF_CALLBACK x509certificate_get_derencoded( - struct _cef_x509certificate_t* self) { +cef_binary_value_t* CEF_CALLBACK +x509certificate_get_derencoded(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -107,15 +108,15 @@ cef_binary_value_t* CEF_CALLBACK x509certificate_get_derencoded( return NULL; // Execute - CefRefPtr _retval = CefX509CertificateCppToC::Get( - self)->GetDEREncoded(); + CefRefPtr _retval = + CefX509CertificateCppToC::Get(self)->GetDEREncoded(); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } -cef_binary_value_t* CEF_CALLBACK x509certificate_get_pemencoded( - struct _cef_x509certificate_t* self) { +cef_binary_value_t* CEF_CALLBACK +x509certificate_get_pemencoded(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,15 +124,15 @@ cef_binary_value_t* CEF_CALLBACK x509certificate_get_pemencoded( return NULL; // Execute - CefRefPtr _retval = CefX509CertificateCppToC::Get( - self)->GetPEMEncoded(); + CefRefPtr _retval = + CefX509CertificateCppToC::Get(self)->GetPEMEncoded(); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } -size_t CEF_CALLBACK x509certificate_get_issuer_chain_size( - struct _cef_x509certificate_t* self) { +size_t CEF_CALLBACK +x509certificate_get_issuer_chain_size(struct _cef_x509certificate_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -145,9 +146,10 @@ size_t CEF_CALLBACK x509certificate_get_issuer_chain_size( return _retval; } -void CEF_CALLBACK x509certificate_get_derencoded_issuer_chain( - struct _cef_x509certificate_t* self, size_t* chainCount, - cef_binary_value_t** chain) { +void CEF_CALLBACK +x509certificate_get_derencoded_issuer_chain(struct _cef_x509certificate_t* self, + size_t* chainCount, + cef_binary_value_t** chain) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,7 +161,7 @@ void CEF_CALLBACK x509certificate_get_derencoded_issuer_chain( return; // Translate param: chain; type: refptr_vec_same_byref - std::vector > chainList; + std::vector> chainList; if (chainCount && *chainCount > 0 && chain) { for (size_t i = 0; i < *chainCount; ++i) { chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i])); @@ -167,8 +169,7 @@ void CEF_CALLBACK x509certificate_get_derencoded_issuer_chain( } // Execute - CefX509CertificateCppToC::Get(self)->GetDEREncodedIssuerChain( - chainList); + CefX509CertificateCppToC::Get(self)->GetDEREncodedIssuerChain(chainList); // Restore param: chain; type: refptr_vec_same_byref if (chainCount && chain) { @@ -181,9 +182,10 @@ void CEF_CALLBACK x509certificate_get_derencoded_issuer_chain( } } -void CEF_CALLBACK x509certificate_get_pemencoded_issuer_chain( - struct _cef_x509certificate_t* self, size_t* chainCount, - cef_binary_value_t** chain) { +void CEF_CALLBACK +x509certificate_get_pemencoded_issuer_chain(struct _cef_x509certificate_t* self, + size_t* chainCount, + cef_binary_value_t** chain) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -195,7 +197,7 @@ void CEF_CALLBACK x509certificate_get_pemencoded_issuer_chain( return; // Translate param: chain; type: refptr_vec_same_byref - std::vector > chainList; + std::vector> chainList; if (chainCount && *chainCount > 0 && chain) { for (size_t i = 0; i < *chainCount; ++i) { chainList.push_back(CefBinaryValueCppToC::Unwrap(chain[i])); @@ -203,8 +205,7 @@ void CEF_CALLBACK x509certificate_get_pemencoded_issuer_chain( } // Execute - CefX509CertificateCppToC::Get(self)->GetPEMEncodedIssuerChain( - chainList); + CefX509CertificateCppToC::Get(self)->GetPEMEncodedIssuerChain(chainList); // Restore param: chain; type: refptr_vec_same_byref if (chainCount && chain) { @@ -219,7 +220,6 @@ void CEF_CALLBACK x509certificate_get_pemencoded_issuer_chain( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefX509CertificateCppToC::CefX509CertificateCppToC() { @@ -237,18 +237,25 @@ CefX509CertificateCppToC::CefX509CertificateCppToC() { x509certificate_get_pemencoded_issuer_chain; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived( - CefWrapperType type, cef_x509certificate_t* s) { +template <> +CefRefPtr CefCppToCRefCounted< + CefX509CertificateCppToC, + CefX509Certificate, + cef_x509certificate_t>::UnwrapDerived(CefWrapperType type, + cef_x509certificate_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = WT_X509CERTIFICATE; diff --git a/libcef_dll/cpptoc/x509certificate_cpptoc.h b/libcef_dll/cpptoc/x509certificate_cpptoc.h index 76f9b04d6..b2b5c93b9 100644 --- a/libcef_dll/cpptoc/x509certificate_cpptoc.h +++ b/libcef_dll/cpptoc/x509certificate_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c81df43e809135d955d8420be549362053cce12c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERTIFICATE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_X509CERTIFICATE_CPPTOC_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_x509_certificate.h" #include "include/capi/cef_x509_certificate_capi.h" +#include "include/cef_x509_certificate.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefX509CertificateCppToC - : public CefCppToCRefCounted { + : public CefCppToCRefCounted { public: CefX509CertificateCppToC(); }; diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc index a640e24c7..b4e652cd8 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc @@ -9,15 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=55a9aa1a0d6cf32067a80b6885c7c79b9289eea1$ +// #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" #include "libcef_dll/cpptoc/xml_reader_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, - cef_xml_encoding_type_t encodingType, const cef_string_t* URI) { +CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create( + cef_stream_reader_t* stream, + cef_xml_encoding_type_t encodingType, + const cef_string_t* URI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -31,15 +34,12 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, // Execute CefRefPtr _retval = CefXmlReader::Create( - CefStreamReaderCppToC::Unwrap(stream), - encodingType, - CefString(URI)); + CefStreamReaderCppToC::Unwrap(stream), encodingType, CefString(URI)); // Return type: refptr_same return CefXmlReaderCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -86,8 +86,8 @@ int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_error(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -101,8 +101,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( return _retval.DetachToUserFree(); } -cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( - struct _cef_xml_reader_t* self) { +cef_xml_node_type_t CEF_CALLBACK +xml_reader_get_type(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -130,8 +130,8 @@ int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_local_name(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -145,8 +145,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_prefix(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -160,8 +160,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_qualified_name(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -175,8 +175,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_namespace_uri(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -190,8 +190,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_base_uri(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -205,8 +205,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_xml_lang(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -248,8 +248,8 @@ int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_value(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -277,8 +277,8 @@ int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) { return _retval; } -size_t CEF_CALLBACK xml_reader_get_attribute_count( - struct _cef_xml_reader_t* self) { +size_t CEF_CALLBACK +xml_reader_get_attribute_count(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -292,8 +292,8 @@ size_t CEF_CALLBACK xml_reader_get_attribute_count( return _retval; } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( - struct _cef_xml_reader_t* self, int index) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_attribute_byindex(struct _cef_xml_reader_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -305,15 +305,15 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( return NULL; // Execute - CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( - index); + CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute(index); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( - struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_attribute_byqname(struct _cef_xml_reader_t* self, + const cef_string_t* qualifiedName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -325,16 +325,17 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( return NULL; // Execute - CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( - CefString(qualifiedName)); + CefString _retval = + CefXmlReaderCppToC::Get(self)->GetAttribute(CefString(qualifiedName)); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( - struct _cef_xml_reader_t* self, const cef_string_t* localName, - const cef_string_t* namespaceURI) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_attribute_bylname(struct _cef_xml_reader_t* self, + const cef_string_t* localName, + const cef_string_t* namespaceURI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -351,15 +352,14 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( // Execute CefString _retval = CefXmlReaderCppToC::Get(self)->GetAttribute( - CefString(localName), - CefString(namespaceURI)); + CefString(localName), CefString(namespaceURI)); // Return type: string return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_inner_xml(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -373,8 +373,8 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( - struct _cef_xml_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +xml_reader_get_outer_xml(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -402,8 +402,9 @@ int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) { return _retval; } -int CEF_CALLBACK xml_reader_move_to_attribute_byindex( - struct _cef_xml_reader_t* self, int index) { +int CEF_CALLBACK +xml_reader_move_to_attribute_byindex(struct _cef_xml_reader_t* self, + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -415,15 +416,15 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byindex( return 0; // Execute - bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( - index); + bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute(index); // Return type: bool return _retval; } -int CEF_CALLBACK xml_reader_move_to_attribute_byqname( - struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { +int CEF_CALLBACK +xml_reader_move_to_attribute_byqname(struct _cef_xml_reader_t* self, + const cef_string_t* qualifiedName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -435,16 +436,17 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byqname( return 0; // Execute - bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( - CefString(qualifiedName)); + bool _retval = + CefXmlReaderCppToC::Get(self)->MoveToAttribute(CefString(qualifiedName)); // Return type: bool return _retval; } -int CEF_CALLBACK xml_reader_move_to_attribute_bylname( - struct _cef_xml_reader_t* self, const cef_string_t* localName, - const cef_string_t* namespaceURI) { +int CEF_CALLBACK +xml_reader_move_to_attribute_bylname(struct _cef_xml_reader_t* self, + const cef_string_t* localName, + const cef_string_t* namespaceURI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -461,15 +463,14 @@ int CEF_CALLBACK xml_reader_move_to_attribute_bylname( // Execute bool _retval = CefXmlReaderCppToC::Get(self)->MoveToAttribute( - CefString(localName), - CefString(namespaceURI)); + CefString(localName), CefString(namespaceURI)); // Return type: bool return _retval; } -int CEF_CALLBACK xml_reader_move_to_first_attribute( - struct _cef_xml_reader_t* self) { +int CEF_CALLBACK +xml_reader_move_to_first_attribute(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -483,8 +484,8 @@ int CEF_CALLBACK xml_reader_move_to_first_attribute( return _retval; } -int CEF_CALLBACK xml_reader_move_to_next_attribute( - struct _cef_xml_reader_t* self) { +int CEF_CALLBACK +xml_reader_move_to_next_attribute(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -498,8 +499,8 @@ int CEF_CALLBACK xml_reader_move_to_next_attribute( return _retval; } -int CEF_CALLBACK xml_reader_move_to_carrying_element( - struct _cef_xml_reader_t* self) { +int CEF_CALLBACK +xml_reader_move_to_carrying_element(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -515,7 +516,6 @@ int CEF_CALLBACK xml_reader_move_to_carrying_element( } // namespace - // CONSTRUCTOR - Do not edit by hand. CefXmlReaderCppToC::CefXmlReaderCppToC() { @@ -550,17 +550,23 @@ CefXmlReaderCppToC::CefXmlReaderCppToC() { GetStruct()->move_to_carrying_element = xml_reader_move_to_carrying_element; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_xml_reader_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_xml_reader_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_XML_READER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_XML_READER; diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h index b119cb86b..d16f5be69 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.h +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4e622cda92108041bec60e51a2337bb3a844542c$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_xml_reader.h" #include "include/capi/cef_xml_reader_capi.h" +#include "include/cef_xml_reader.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefXmlReaderCppToC - : public CefCppToCRefCounted { +class CefXmlReaderCppToC : public CefCppToCRefCounted { public: CefXmlReaderCppToC(); }; diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc index c6ae74e63..ff43fa96d 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a5cfbfd7e733f9874caf3bff213719d3267d3287$ +// #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" #include "libcef_dll/cpptoc/zip_reader_cpptoc.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( @@ -26,14 +27,13 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( return NULL; // Execute - CefRefPtr _retval = CefZipReader::Create( - CefStreamReaderCppToC::Unwrap(stream)); + CefRefPtr _retval = + CefZipReader::Create(CefStreamReaderCppToC::Unwrap(stream)); // Return type: refptr_same return CefZipReaderCppToC::Wrap(_retval); } - namespace { // MEMBER FUNCTIONS - Body may be edited by hand. @@ -67,7 +67,8 @@ int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) { } int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, - const cef_string_t* fileName, int caseSensitive) { + const cef_string_t* fileName, + int caseSensitive) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -80,8 +81,7 @@ int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, // Execute bool _retval = CefZipReaderCppToC::Get(self)->MoveToFile( - CefString(fileName), - caseSensitive?true:false); + CefString(fileName), caseSensitive ? true : false); // Return type: bool return _retval; @@ -101,8 +101,8 @@ int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) { return _retval; } -cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( - struct _cef_zip_reader_t* self) { +cef_string_userfree_t CEF_CALLBACK +zip_reader_get_file_name(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -130,8 +130,8 @@ int64 CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) { return _retval; } -cef_time_t CEF_CALLBACK zip_reader_get_file_last_modified( - struct _cef_zip_reader_t* self) { +cef_time_t CEF_CALLBACK +zip_reader_get_file_last_modified(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -146,7 +146,7 @@ cef_time_t CEF_CALLBACK zip_reader_get_file_last_modified( } int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, - const cef_string_t* password) { + const cef_string_t* password) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -155,8 +155,7 @@ int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, // Unverified params: password // Execute - bool _retval = CefZipReaderCppToC::Get(self)->OpenFile( - CefString(password)); + bool _retval = CefZipReaderCppToC::Get(self)->OpenFile(CefString(password)); // Return type: bool return _retval; @@ -177,7 +176,8 @@ int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) { } int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, - void* buffer, size_t bufferSize) { + void* buffer, + size_t bufferSize) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -189,9 +189,7 @@ int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, return 0; // Execute - int _retval = CefZipReaderCppToC::Get(self)->ReadFile( - buffer, - bufferSize); + int _retval = CefZipReaderCppToC::Get(self)->ReadFile(buffer, bufferSize); // Return type: simple return _retval; @@ -227,7 +225,6 @@ int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) { } // namespace - // CONSTRUCTOR - Do not edit by hand. CefZipReaderCppToC::CefZipReaderCppToC() { @@ -245,17 +242,23 @@ CefZipReaderCppToC::CefZipReaderCppToC() { GetStruct()->eof = zip_reader_eof; } -template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, - cef_zip_reader_t* s) { +template <> +CefRefPtr +CefCppToCRefCounted:: + UnwrapDerived(CefWrapperType type, cef_zip_reader_t* s) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_ZIP_READER; +template <> +CefWrapperType CefCppToCRefCounted::kWrapperType = + WT_ZIP_READER; diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h index 6e01bd3c6..3f910f4f4 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.h +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=088a4ab41b38a966febedea0fee2aadb3fcfa30d$ +// #ifndef CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_zip_reader.h" #include "include/capi/cef_zip_reader_capi.h" +#include "include/cef_zip_reader.h" #include "libcef_dll/cpptoc/cpptoc_ref_counted.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. -class CefZipReaderCppToC - : public CefCppToCRefCounted { +class CefZipReaderCppToC : public CefCppToCRefCounted { public: CefZipReaderCppToC(); }; diff --git a/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc b/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc index 415dc0485..1d03ae1f9 100644 --- a/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=419693bf94c043b9c88231dbe321dcefab80e83c$ +// #include "libcef_dll/cpptoc/value_cpptoc.h" #include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefAccessibilityHandlerCToCpp::OnAccessibilityTreeChange( @@ -30,8 +31,7 @@ void CefAccessibilityHandlerCToCpp::OnAccessibilityTreeChange( return; // Execute - _struct->on_accessibility_tree_change(_struct, - CefValueCppToC::Wrap(value)); + _struct->on_accessibility_tree_change(_struct, CefValueCppToC::Wrap(value)); } void CefAccessibilityHandlerCToCpp::OnAccessibilityLocationChange( @@ -49,27 +49,33 @@ void CefAccessibilityHandlerCToCpp::OnAccessibilityLocationChange( // Execute _struct->on_accessibility_location_change(_struct, - CefValueCppToC::Wrap(value)); + CefValueCppToC::Wrap(value)); } - // CONSTRUCTOR - Do not edit by hand. -CefAccessibilityHandlerCToCpp::CefAccessibilityHandlerCToCpp() { -} +CefAccessibilityHandlerCToCpp::CefAccessibilityHandlerCToCpp() {} -template<> cef_accessibility_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefAccessibilityHandler* c) { +template <> +cef_accessibility_handler_t* CefCToCppRefCounted< + CefAccessibilityHandlerCToCpp, + CefAccessibilityHandler, + cef_accessibility_handler_t>::UnwrapDerived(CefWrapperType type, + CefAccessibilityHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_ACCESSIBILITY_HANDLER; diff --git a/libcef_dll/ctocpp/accessibility_handler_ctocpp.h b/libcef_dll/ctocpp/accessibility_handler_ctocpp.h index e1567ea2b..1373b1348 100644 --- a/libcef_dll/ctocpp/accessibility_handler_ctocpp.h +++ b/libcef_dll/ctocpp/accessibility_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f691657aef87b80b100610ea4875280241a6d716$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_ACCESSIBILITY_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_ACCESSIBILITY_HANDLER_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_accessibility_handler.h" #include "include/capi/cef_accessibility_handler_capi.h" +#include "include/cef_accessibility_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefAccessibilityHandlerCToCpp : public CefCToCppRefCounted { + CefAccessibilityHandler, + cef_accessibility_handler_t> { public: CefAccessibilityHandlerCToCpp(); diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc index 0e840f0d8..009a1c9b0 100644 --- a/libcef_dll/ctocpp/app_ctocpp.cc +++ b/libcef_dll/ctocpp/app_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=96b7f6c626b0153930f9687c6cb5845ac4af2443$ +// #include "libcef_dll/cpptoc/command_line_cpptoc.h" #include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" @@ -17,10 +19,10 @@ #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h" #include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -void CefAppCToCpp::OnBeforeCommandLineProcessing(const CefString& process_type, +void CefAppCToCpp::OnBeforeCommandLineProcessing( + const CefString& process_type, CefRefPtr command_line) { cef_app_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_command_line_processing)) @@ -35,8 +37,8 @@ void CefAppCToCpp::OnBeforeCommandLineProcessing(const CefString& process_type, // Unverified params: process_type // Execute - _struct->on_before_command_line_processing(_struct, - process_type.GetStruct(), + _struct->on_before_command_line_processing( + _struct, process_type.GetStruct(), CefCommandLineCppToC::Wrap(command_line)); } @@ -58,8 +60,7 @@ void CefAppCToCpp::OnRegisterCustomSchemes( CefSchemeRegistrarCppToC::WrapRaw(registrar)); // Execute - _struct->on_register_custom_schemes(_struct, - registrarPtr->GetStruct()); + _struct->on_register_custom_schemes(_struct, registrarPtr->GetStruct()); } CefRefPtr CefAppCToCpp::GetResourceBundleHandler() { @@ -70,8 +71,8 @@ CefRefPtr CefAppCToCpp::GetResourceBundleHandler() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_resource_bundle_handler_t* _retval = _struct->get_resource_bundle_handler( - _struct); + cef_resource_bundle_handler_t* _retval = + _struct->get_resource_bundle_handler(_struct); // Return type: refptr_same return CefResourceBundleHandlerCToCpp::Wrap(_retval); @@ -85,8 +86,8 @@ CefRefPtr CefAppCToCpp::GetBrowserProcessHandler() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_process_handler_t* _retval = _struct->get_browser_process_handler( - _struct); + cef_browser_process_handler_t* _retval = + _struct->get_browser_process_handler(_struct); // Return type: refptr_same return CefBrowserProcessHandlerCToCpp::Wrap(_retval); @@ -100,29 +101,31 @@ CefRefPtr CefAppCToCpp::GetRenderProcessHandler() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_render_process_handler_t* _retval = _struct->get_render_process_handler( - _struct); + cef_render_process_handler_t* _retval = + _struct->get_render_process_handler(_struct); // Return type: refptr_same return CefRenderProcessHandlerCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefAppCToCpp::CefAppCToCpp() { -} +CefAppCToCpp::CefAppCToCpp() {} -template<> cef_app_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefApp* c) { +template <> +cef_app_t* CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefApp* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_APP; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = WT_APP; diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h index 287dfa2f9..b9a403cdf 100644 --- a/libcef_dll/ctocpp/app_ctocpp.h +++ b/libcef_dll/ctocpp/app_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b1936f48acc13afee39f0b8c5b147a6e828f83b7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_app.h" #include "include/capi/cef_app_capi.h" +#include "include/cef_app.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -30,7 +32,8 @@ class CefAppCToCpp CefAppCToCpp(); // CefApp methods. - void OnBeforeCommandLineProcessing(const CefString& process_type, + void OnBeforeCommandLineProcessing( + const CefString& process_type, CefRefPtr command_line) override; void OnRegisterCustomSchemes( CefRawPtr registrar) override; diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.cc b/libcef_dll/ctocpp/auth_callback_ctocpp.cc index 11dd7ff9e..1587ca8e4 100644 --- a/libcef_dll/ctocpp/auth_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/auth_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4eadd6cf6e4016537a2dbb9a041f6189801d085a$ +// #include "libcef_dll/ctocpp/auth_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefAuthCallbackCToCpp::Continue(const CefString& username, - const CefString& password) { + const CefString& password) { cef_auth_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, cont)) return; @@ -30,9 +31,7 @@ void CefAuthCallbackCToCpp::Continue(const CefString& username, // Unverified params: password // Execute - _struct->cont(_struct, - username.GetStruct(), - password.GetStruct()); + _struct->cont(_struct, username.GetStruct(), password.GetStruct()); } void CefAuthCallbackCToCpp::Cancel() { @@ -46,23 +45,29 @@ void CefAuthCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefAuthCallbackCToCpp::CefAuthCallbackCToCpp() { -} +CefAuthCallbackCToCpp::CefAuthCallbackCToCpp() {} -template<> cef_auth_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefAuthCallback* c) { +template <> +cef_auth_callback_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefAuthCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_AUTH_CALLBACK; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_AUTH_CALLBACK; diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.h b/libcef_dll/ctocpp/auth_callback_ctocpp.h index 69ce967dc..bfd3c4227 100644 --- a/libcef_dll/ctocpp/auth_callback_ctocpp.h +++ b/libcef_dll/ctocpp/auth_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4c48e5bee2bd177f01d0ae484eba308344c3f822$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_auth_callback.h" #include "include/capi/cef_auth_callback_capi.h" +#include "include/cef_auth_callback.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefAuthCallbackCToCpp - : public CefCToCppRefCounted { +class CefAuthCallbackCToCpp : public CefCToCppRefCounted { public: CefAuthCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc b/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc index 90b8377bb..33e2cd844 100644 --- a/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc +++ b/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc @@ -4,21 +4,28 @@ #include "libcef_dll/ctocpp/base_ref_counted_ctocpp.h" -CefBaseRefCountedCToCpp::CefBaseRefCountedCToCpp() { -} +CefBaseRefCountedCToCpp::CefBaseRefCountedCToCpp() {} -template<> cef_base_ref_counted_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefBaseRefCounted* c) { +template <> +cef_base_ref_counted_t* CefCToCppRefCounted< + CefBaseRefCountedCToCpp, + CefBaseRefCounted, + cef_base_ref_counted_t>::UnwrapDerived(CefWrapperType type, + CefBaseRefCounted* c) { NOTREACHED(); return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BASE_REF_COUNTED; diff --git a/libcef_dll/ctocpp/base_ref_counted_ctocpp.h b/libcef_dll/ctocpp/base_ref_counted_ctocpp.h index fce82f05d..dfff39e26 100644 --- a/libcef_dll/ctocpp/base_ref_counted_ctocpp.h +++ b/libcef_dll/ctocpp/base_ref_counted_ctocpp.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_DLL_CTOCPP_BASE_REF_COUNTED_CTOCPP_H_ #pragma once -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" #if !defined(BUILDING_CEF_SHARED) @@ -16,7 +16,8 @@ // Wrap a C structure with a C++ class. class CefBaseRefCountedCToCpp - : public CefCToCppRefCounted { public: CefBaseRefCountedCToCpp(); diff --git a/libcef_dll/ctocpp/base_scoped_ctocpp.cc b/libcef_dll/ctocpp/base_scoped_ctocpp.cc index 40d94e56d..cb1d100ff 100644 --- a/libcef_dll/ctocpp/base_scoped_ctocpp.cc +++ b/libcef_dll/ctocpp/base_scoped_ctocpp.cc @@ -4,17 +4,18 @@ #include "libcef_dll/ctocpp/base_scoped_ctocpp.h" -CefBaseScopedCToCpp::CefBaseScopedCToCpp() { -} +CefBaseScopedCToCpp::CefBaseScopedCToCpp() {} -template<> cef_base_scoped_t* +template <> +cef_base_scoped_t* CefCToCppScoped:: UnwrapDerivedOwn(CefWrapperType type, CefOwnPtr c) { NOTREACHED(); return NULL; } -template<> cef_base_scoped_t* +template <> +cef_base_scoped_t* CefCToCppScoped:: UnwrapDerivedRaw(CefWrapperType type, CefRawPtr c) { NOTREACHED(); @@ -22,9 +23,14 @@ CefCToCppScoped:: } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = WT_BASE_SCOPED; +template <> +CefWrapperType CefCToCppScoped::kWrapperType = + WT_BASE_SCOPED; diff --git a/libcef_dll/ctocpp/base_scoped_ctocpp.h b/libcef_dll/ctocpp/base_scoped_ctocpp.h index 0924c1df5..6e7c0852a 100644 --- a/libcef_dll/ctocpp/base_scoped_ctocpp.h +++ b/libcef_dll/ctocpp/base_scoped_ctocpp.h @@ -6,8 +6,8 @@ #define CEF_LIBCEF_DLL_CTOCPP_BASE_SCOPED_CTOCPP_H_ #pragma once -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" #if !defined(BUILDING_CEF_SHARED) @@ -15,9 +15,9 @@ #endif // Wrap a C structure with a C++ class. -class CefBaseScopedCToCpp - : public CefCToCppScoped { +class CefBaseScopedCToCpp : public CefCToCppScoped { public: CefBaseScopedCToCpp(); }; diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc index ebf19c82f..af29537e5 100644 --- a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9f7b5d40247a23361c6b5622dbfba9fc50663a4f$ +// #include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path, - bool show_dialog) { + bool show_dialog) { cef_before_download_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, cont)) return; @@ -26,30 +27,35 @@ void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path, // Unverified params: download_path // Execute - _struct->cont(_struct, - download_path.GetStruct(), - show_dialog); + _struct->cont(_struct, download_path.GetStruct(), show_dialog); } - // CONSTRUCTOR - Do not edit by hand. -CefBeforeDownloadCallbackCToCpp::CefBeforeDownloadCallbackCToCpp() { -} +CefBeforeDownloadCallbackCToCpp::CefBeforeDownloadCallbackCToCpp() {} -template<> cef_before_download_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefBeforeDownloadCallback* c) { +template <> +cef_before_download_callback_t* CefCToCppRefCounted< + CefBeforeDownloadCallbackCToCpp, + CefBeforeDownloadCallback, + cef_before_download_callback_t>::UnwrapDerived(CefWrapperType type, + CefBeforeDownloadCallback* + c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_BEFORE_DOWNLOAD_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_BEFORE_DOWNLOAD_CALLBACK; diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.h b/libcef_dll/ctocpp/before_download_callback_ctocpp.h index 3e71d658b..84ef5dc8f 100644 --- a/libcef_dll/ctocpp/before_download_callback_ctocpp.h +++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ce25557cba712345acbd9ba9a3ea0233cc2a9103$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefBeforeDownloadCallbackCToCpp : public CefCToCppRefCounted { + CefBeforeDownloadCallback, + cef_before_download_callback_t> { public: CefBeforeDownloadCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.cc b/libcef_dll/ctocpp/binary_value_ctocpp.cc index 652be1cd5..affdb0abf 100644 --- a/libcef_dll/ctocpp/binary_value_ctocpp.cc +++ b/libcef_dll/ctocpp/binary_value_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bbf880e622f6de542a35ea2b0dbd0b874ef2c512$ +// #include "libcef_dll/ctocpp/binary_value_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefBinaryValue::Create(const void* data, - size_t data_size) { + size_t data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -25,15 +26,12 @@ CefRefPtr CefBinaryValue::Create(const void* data, return NULL; // Execute - cef_binary_value_t* _retval = cef_binary_value_create( - data, - data_size); + cef_binary_value_t* _retval = cef_binary_value_create(data, data_size); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefBinaryValueCToCpp::IsValid() { @@ -47,7 +45,7 @@ bool CefBinaryValueCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBinaryValueCToCpp::IsOwned() { @@ -61,7 +59,7 @@ bool CefBinaryValueCToCpp::IsOwned() { int _retval = _struct->is_owned(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBinaryValueCToCpp::IsSame(CefRefPtr that) { @@ -77,11 +75,10 @@ bool CefBinaryValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefBinaryValueCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefBinaryValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBinaryValueCToCpp::IsEqual(CefRefPtr that) { @@ -97,11 +94,10 @@ bool CefBinaryValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_equal(_struct, - CefBinaryValueCToCpp::Unwrap(that)); + int _retval = _struct->is_equal(_struct, CefBinaryValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefBinaryValueCToCpp::Copy() { @@ -132,8 +128,9 @@ size_t CefBinaryValueCToCpp::GetSize() { return _retval; } -size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, - size_t data_offset) { +size_t CefBinaryValueCToCpp::GetData(void* buffer, + size_t buffer_size, + size_t data_offset) { cef_binary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_data)) return 0; @@ -146,32 +143,33 @@ size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, return 0; // Execute - size_t _retval = _struct->get_data(_struct, - buffer, - buffer_size, - data_offset); + size_t _retval = _struct->get_data(_struct, buffer, buffer_size, data_offset); // Return type: simple return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefBinaryValueCToCpp::CefBinaryValueCToCpp() { -} +CefBinaryValueCToCpp::CefBinaryValueCToCpp() {} -template<> cef_binary_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefBinaryValue* c) { +template <> +cef_binary_value_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefBinaryValue* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BINARY_VALUE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_BINARY_VALUE; diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.h b/libcef_dll/ctocpp/binary_value_ctocpp.h index 344689713..4c6a3f845 100644 --- a/libcef_dll/ctocpp/binary_value_ctocpp.h +++ b/libcef_dll/ctocpp/binary_value_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4848ed28ad4e3a9cf60282aeafafb4404309ad62$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefBinaryValueCToCpp - : public CefCToCppRefCounted { +class CefBinaryValueCToCpp : public CefCToCppRefCounted { public: CefBinaryValueCToCpp(); diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index 2a419bf2c..25b3c39fd 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9f702354dd9771258d66cec721eba3e2ab0cd046$ +// #include #include "libcef_dll/ctocpp/browser_ctocpp.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/process_message_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefBrowserCToCpp::GetHost() { @@ -45,7 +46,7 @@ bool CefBrowserCToCpp::CanGoBack() { int _retval = _struct->can_go_back(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserCToCpp::GoBack() { @@ -70,7 +71,7 @@ bool CefBrowserCToCpp::CanGoForward() { int _retval = _struct->can_go_forward(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserCToCpp::GoForward() { @@ -95,7 +96,7 @@ bool CefBrowserCToCpp::IsLoading() { int _retval = _struct->is_loading(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserCToCpp::Reload() { @@ -158,11 +159,10 @@ bool CefBrowserCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefBrowserCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefBrowserCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserCToCpp::IsPopup() { @@ -176,7 +176,7 @@ bool CefBrowserCToCpp::IsPopup() { int _retval = _struct->is_popup(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserCToCpp::HasDocument() { @@ -190,7 +190,7 @@ bool CefBrowserCToCpp::HasDocument() { int _retval = _struct->has_document(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefBrowserCToCpp::GetMainFrame() { @@ -229,8 +229,7 @@ CefRefPtr CefBrowserCToCpp::GetFrame(int64 identifier) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = _struct->get_frame_byident(_struct, - identifier); + cef_frame_t* _retval = _struct->get_frame_byident(_struct, identifier); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); @@ -246,8 +245,7 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { // Unverified params: name // Execute - cef_frame_t* _retval = _struct->get_frame(_struct, - name.GetStruct()); + cef_frame_t* _retval = _struct->get_frame(_struct, name.GetStruct()); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); @@ -282,7 +280,7 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { identifiersList = new int64[identifiersCount]; DCHECK(identifiersList); if (identifiersList) { - memset(identifiersList, 0, sizeof(int64)*identifiersCount); + memset(identifiersList, 0, sizeof(int64) * identifiersCount); } if (identifiersList && identifiersSize > 0) { for (size_t i = 0; i < identifiersSize; ++i) { @@ -292,9 +290,7 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { } // Execute - _struct->get_frame_identifiers(_struct, - &identifiersCount, - identifiersList); + _struct->get_frame_identifiers(_struct, &identifiersCount, identifiersList); // Restore param:identifiers; type: simple_vec_byref identifiers.clear(); @@ -302,7 +298,7 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { for (size_t i = 0; i < identifiersCount; ++i) { identifiers.push_back(identifiersList[i]); } - delete [] identifiersList; + delete[] identifiersList; } } @@ -320,8 +316,7 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) { transfer_string_list_contents(names, namesList); // Execute - _struct->get_frame_names(_struct, - namesList); + _struct->get_frame_names(_struct, namesList); // Restore param:names; type: string_vec_byref if (namesList) { @@ -331,7 +326,8 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) { } } -bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, +bool CefBrowserCToCpp::SendProcessMessage( + CefProcessId target_process, CefRefPtr message) { cef_browser_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, send_process_message)) @@ -345,30 +341,34 @@ bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, return false; // Execute - int _retval = _struct->send_process_message(_struct, - target_process, - CefProcessMessageCToCpp::Unwrap(message)); + int _retval = _struct->send_process_message( + _struct, target_process, CefProcessMessageCToCpp::Unwrap(message)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefBrowserCToCpp::CefBrowserCToCpp() { -} +CefBrowserCToCpp::CefBrowserCToCpp() {} -template<> cef_browser_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefBrowser* c) { +template <> +cef_browser_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefBrowser* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER; diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index 7fbc2563b..87cba71e2 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=82c81038e8e9697ae8c02aef3aa00fb012b947f5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ @@ -19,10 +21,10 @@ #endif #include -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -54,7 +56,7 @@ class CefBrowserCToCpp void GetFrameIdentifiers(std::vector& identifiers) OVERRIDE; void GetFrameNames(std::vector& names) OVERRIDE; bool SendProcessMessage(CefProcessId target_process, - CefRefPtr message) OVERRIDE; + CefRefPtr message) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.cc b/libcef_dll/ctocpp/browser_host_ctocpp.cc index d97fd240b..44fc05cc6 100644 --- a/libcef_dll/ctocpp/browser_host_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_host_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ff50d55a6a41b1cb861df1ff7d48a243dbbd665c$ +// #include "libcef_dll/cpptoc/client_cpptoc.h" #include "libcef_dll/cpptoc/download_image_callback_cpptoc.h" @@ -22,11 +24,12 @@ #include "libcef_dll/ctocpp/request_context_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. -bool CefBrowserHost::CreateBrowser(const CefWindowInfo& windowInfo, - CefRefPtr client, const CefString& url, +bool CefBrowserHost::CreateBrowser( + const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, const CefBrowserSettings& settings, CefRefPtr request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -35,19 +38,18 @@ bool CefBrowserHost::CreateBrowser(const CefWindowInfo& windowInfo, // Execute int _retval = cef_browser_host_create_browser( - &windowInfo, - CefClientCppToC::Wrap(client), - url.GetStruct(), - &settings, + &windowInfo, CefClientCppToC::Wrap(client), url.GetStruct(), &settings, CefRequestContextCToCpp::Unwrap(request_context)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefBrowserHost::CreateBrowserSync( - const CefWindowInfo& windowInfo, CefRefPtr client, - const CefString& url, const CefBrowserSettings& settings, + const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings, CefRefPtr request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -55,17 +57,13 @@ CefRefPtr CefBrowserHost::CreateBrowserSync( // Execute cef_browser_t* _retval = cef_browser_host_create_browser_sync( - &windowInfo, - CefClientCppToC::Wrap(client), - url.GetStruct(), - &settings, + &windowInfo, CefClientCppToC::Wrap(client), url.GetStruct(), &settings, CefRequestContextCToCpp::Unwrap(request_context)); // Return type: refptr_same return CefBrowserCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefBrowserHostCToCpp::GetBrowser() { @@ -90,8 +88,7 @@ void CefBrowserHostCToCpp::CloseBrowser(bool force_close) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->close_browser(_struct, - force_close); + _struct->close_browser(_struct, force_close); } bool CefBrowserHostCToCpp::TryCloseBrowser() { @@ -105,7 +102,7 @@ bool CefBrowserHostCToCpp::TryCloseBrowser() { int _retval = _struct->try_close_browser(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserHostCToCpp::SetFocus(bool focus) { @@ -116,8 +113,7 @@ void CefBrowserHostCToCpp::SetFocus(bool focus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focus(_struct, - focus); + _struct->set_focus(_struct, focus); } CefWindowHandle CefBrowserHostCToCpp::GetWindowHandle() { @@ -159,7 +155,7 @@ bool CefBrowserHostCToCpp::HasView() { int _retval = _struct->has_view(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefBrowserHostCToCpp::GetClient() { @@ -212,13 +208,15 @@ void CefBrowserHostCToCpp::SetZoomLevel(double zoomLevel) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_zoom_level(_struct, - zoomLevel); + _struct->set_zoom_level(_struct, zoomLevel); } -void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, - const CefString& title, const CefString& default_file_path, - const std::vector& accept_filters, int selected_accept_filter, +void CefBrowserHostCToCpp::RunFileDialog( + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, CefRefPtr callback) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, run_file_dialog)) @@ -243,13 +241,10 @@ void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, transfer_string_list_contents(accept_filters, accept_filtersList); // Execute - _struct->run_file_dialog(_struct, - mode, - title.GetStruct(), - default_file_path.GetStruct(), - accept_filtersList, - selected_accept_filter, - CefRunFileDialogCallbackCppToC::Wrap(callback)); + _struct->run_file_dialog(_struct, mode, title.GetStruct(), + default_file_path.GetStruct(), accept_filtersList, + selected_accept_filter, + CefRunFileDialogCallbackCppToC::Wrap(callback)); // Restore param:accept_filters; type: string_vec_byref_const if (accept_filtersList) @@ -269,12 +264,14 @@ void CefBrowserHostCToCpp::StartDownload(const CefString& url) { return; // Execute - _struct->start_download(_struct, - url.GetStruct()); + _struct->start_download(_struct, url.GetStruct()); } -void CefBrowserHostCToCpp::DownloadImage(const CefString& image_url, - bool is_favicon, uint32 max_image_size, bool bypass_cache, +void CefBrowserHostCToCpp::DownloadImage( + const CefString& image_url, + bool is_favicon, + uint32 max_image_size, + bool bypass_cache, CefRefPtr callback) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, download_image)) @@ -292,12 +289,9 @@ void CefBrowserHostCToCpp::DownloadImage(const CefString& image_url, return; // Execute - _struct->download_image(_struct, - image_url.GetStruct(), - is_favicon, - max_image_size, - bypass_cache, - CefDownloadImageCallbackCppToC::Wrap(callback)); + _struct->download_image(_struct, image_url.GetStruct(), is_favicon, + max_image_size, bypass_cache, + CefDownloadImageCallbackCppToC::Wrap(callback)); } void CefBrowserHostCToCpp::Print() { @@ -312,8 +306,8 @@ void CefBrowserHostCToCpp::Print() { } void CefBrowserHostCToCpp::PrintToPDF(const CefString& path, - const CefPdfPrintSettings& settings, - CefRefPtr callback) { + const CefPdfPrintSettings& settings, + CefRefPtr callback) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, print_to_pdf)) return; @@ -327,14 +321,15 @@ void CefBrowserHostCToCpp::PrintToPDF(const CefString& path, // Unverified params: callback // Execute - _struct->print_to_pdf(_struct, - path.GetStruct(), - &settings, - CefPdfPrintCallbackCppToC::Wrap(callback)); + _struct->print_to_pdf(_struct, path.GetStruct(), &settings, + CefPdfPrintCallbackCppToC::Wrap(callback)); } -void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) { +void CefBrowserHostCToCpp::Find(int identifier, + const CefString& searchText, + bool forward, + bool matchCase, + bool findNext) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, find)) return; @@ -347,12 +342,8 @@ void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, return; // Execute - _struct->find(_struct, - identifier, - searchText.GetStruct(), - forward, - matchCase, - findNext); + _struct->find(_struct, identifier, searchText.GetStruct(), forward, matchCase, + findNext); } void CefBrowserHostCToCpp::StopFinding(bool clearSelection) { @@ -363,13 +354,13 @@ void CefBrowserHostCToCpp::StopFinding(bool clearSelection) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->stop_finding(_struct, - clearSelection); + _struct->stop_finding(_struct, clearSelection); } void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, - CefRefPtr client, const CefBrowserSettings& settings, - const CefPoint& inspect_element_at) { + CefRefPtr client, + const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, show_dev_tools)) return; @@ -379,11 +370,8 @@ void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, // Unverified params: windowInfo, client, settings, inspect_element_at // Execute - _struct->show_dev_tools(_struct, - &windowInfo, - CefClientCppToC::Wrap(client), - &settings, - &inspect_element_at); + _struct->show_dev_tools(_struct, &windowInfo, CefClientCppToC::Wrap(client), + &settings, &inspect_element_at); } void CefBrowserHostCToCpp::CloseDevTools() { @@ -408,11 +396,12 @@ bool CefBrowserHostCToCpp::HasDevTools() { int _retval = _struct->has_dev_tools(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserHostCToCpp::GetNavigationEntries( - CefRefPtr visitor, bool current_only) { + CefRefPtr visitor, + bool current_only) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_navigation_entries)) return; @@ -425,9 +414,8 @@ void CefBrowserHostCToCpp::GetNavigationEntries( return; // Execute - _struct->get_navigation_entries(_struct, - CefNavigationEntryVisitorCppToC::Wrap(visitor), - current_only); + _struct->get_navigation_entries( + _struct, CefNavigationEntryVisitorCppToC::Wrap(visitor), current_only); } void CefBrowserHostCToCpp::SetMouseCursorChangeDisabled(bool disabled) { @@ -438,8 +426,7 @@ void CefBrowserHostCToCpp::SetMouseCursorChangeDisabled(bool disabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_mouse_cursor_change_disabled(_struct, - disabled); + _struct->set_mouse_cursor_change_disabled(_struct, disabled); } bool CefBrowserHostCToCpp::IsMouseCursorChangeDisabled() { @@ -453,7 +440,7 @@ bool CefBrowserHostCToCpp::IsMouseCursorChangeDisabled() { int _retval = _struct->is_mouse_cursor_change_disabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserHostCToCpp::ReplaceMisspelling(const CefString& word) { @@ -469,8 +456,7 @@ void CefBrowserHostCToCpp::ReplaceMisspelling(const CefString& word) { return; // Execute - _struct->replace_misspelling(_struct, - word.GetStruct()); + _struct->replace_misspelling(_struct, word.GetStruct()); } void CefBrowserHostCToCpp::AddWordToDictionary(const CefString& word) { @@ -486,8 +472,7 @@ void CefBrowserHostCToCpp::AddWordToDictionary(const CefString& word) { return; // Execute - _struct->add_word_to_dictionary(_struct, - word.GetStruct()); + _struct->add_word_to_dictionary(_struct, word.GetStruct()); } bool CefBrowserHostCToCpp::IsWindowRenderingDisabled() { @@ -501,7 +486,7 @@ bool CefBrowserHostCToCpp::IsWindowRenderingDisabled() { int _retval = _struct->is_window_rendering_disabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserHostCToCpp::WasResized() { @@ -523,8 +508,7 @@ void CefBrowserHostCToCpp::WasHidden(bool hidden) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->was_hidden(_struct, - hidden); + _struct->was_hidden(_struct, hidden); } void CefBrowserHostCToCpp::NotifyScreenInfoChanged() { @@ -546,8 +530,7 @@ void CefBrowserHostCToCpp::Invalidate(PaintElementType type) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->invalidate(_struct, - type); + _struct->invalidate(_struct, type); } void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) { @@ -558,12 +541,13 @@ void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_key_event(_struct, - &event); + _struct->send_key_event(_struct, &event); } void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event, - MouseButtonType type, bool mouseUp, int clickCount) { + MouseButtonType type, + bool mouseUp, + int clickCount) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, send_mouse_click_event)) return; @@ -571,15 +555,11 @@ void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_mouse_click_event(_struct, - &event, - type, - mouseUp, - clickCount); + _struct->send_mouse_click_event(_struct, &event, type, mouseUp, clickCount); } void CefBrowserHostCToCpp::SendMouseMoveEvent(const CefMouseEvent& event, - bool mouseLeave) { + bool mouseLeave) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, send_mouse_move_event)) return; @@ -587,13 +567,12 @@ void CefBrowserHostCToCpp::SendMouseMoveEvent(const CefMouseEvent& event, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_mouse_move_event(_struct, - &event, - mouseLeave); + _struct->send_mouse_move_event(_struct, &event, mouseLeave); } void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event, - int deltaX, int deltaY) { + int deltaX, + int deltaY) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, send_mouse_wheel_event)) return; @@ -601,10 +580,7 @@ void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_mouse_wheel_event(_struct, - &event, - deltaX, - deltaY); + _struct->send_mouse_wheel_event(_struct, &event, deltaX, deltaY); } void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) { @@ -615,8 +591,7 @@ void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_focus_event(_struct, - setFocus); + _struct->send_focus_event(_struct, setFocus); } void CefBrowserHostCToCpp::SendCaptureLostEvent() { @@ -663,13 +638,14 @@ void CefBrowserHostCToCpp::SetWindowlessFrameRate(int frame_rate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_windowless_frame_rate(_struct, - frame_rate); + _struct->set_windowless_frame_rate(_struct, frame_rate); } -void CefBrowserHostCToCpp::ImeSetComposition(const CefString& text, +void CefBrowserHostCToCpp::ImeSetComposition( + const CefString& text, const std::vector& underlines, - const CefRange& replacement_range, const CefRange& selection_range) { + const CefRange& replacement_range, + const CefRange& selection_range) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, ime_set_composition)) return; @@ -692,20 +668,18 @@ void CefBrowserHostCToCpp::ImeSetComposition(const CefString& text, } // Execute - _struct->ime_set_composition(_struct, - text.GetStruct(), - underlinesCount, - underlinesList, - &replacement_range, - &selection_range); + _struct->ime_set_composition(_struct, text.GetStruct(), underlinesCount, + underlinesList, &replacement_range, + &selection_range); // Restore param:underlines; type: simple_vec_byref_const if (underlinesList) - delete [] underlinesList; + delete[] underlinesList; } void CefBrowserHostCToCpp::ImeCommitText(const CefString& text, - const CefRange& replacement_range, int relative_cursor_pos) { + const CefRange& replacement_range, + int relative_cursor_pos) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, ime_commit_text)) return; @@ -715,10 +689,8 @@ void CefBrowserHostCToCpp::ImeCommitText(const CefString& text, // Unverified params: text // Execute - _struct->ime_commit_text(_struct, - text.GetStruct(), - &replacement_range, - relative_cursor_pos); + _struct->ime_commit_text(_struct, text.GetStruct(), &replacement_range, + relative_cursor_pos); } void CefBrowserHostCToCpp::ImeFinishComposingText(bool keep_selection) { @@ -729,8 +701,7 @@ void CefBrowserHostCToCpp::ImeFinishComposingText(bool keep_selection) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->ime_finish_composing_text(_struct, - keep_selection); + _struct->ime_finish_composing_text(_struct, keep_selection); } void CefBrowserHostCToCpp::ImeCancelComposition() { @@ -745,7 +716,8 @@ void CefBrowserHostCToCpp::ImeCancelComposition() { } void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, - const CefMouseEvent& event, DragOperationsMask allowed_ops) { + const CefMouseEvent& event, + DragOperationsMask allowed_ops) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, drag_target_drag_enter)) return; @@ -758,14 +730,12 @@ void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, return; // Execute - _struct->drag_target_drag_enter(_struct, - CefDragDataCToCpp::Unwrap(drag_data), - &event, - allowed_ops); + _struct->drag_target_drag_enter(_struct, CefDragDataCToCpp::Unwrap(drag_data), + &event, allowed_ops); } void CefBrowserHostCToCpp::DragTargetDragOver(const CefMouseEvent& event, - DragOperationsMask allowed_ops) { + DragOperationsMask allowed_ops) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, drag_target_drag_over)) return; @@ -773,9 +743,7 @@ void CefBrowserHostCToCpp::DragTargetDragOver(const CefMouseEvent& event, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->drag_target_drag_over(_struct, - &event, - allowed_ops); + _struct->drag_target_drag_over(_struct, &event, allowed_ops); } void CefBrowserHostCToCpp::DragTargetDragLeave() { @@ -797,12 +765,12 @@ void CefBrowserHostCToCpp::DragTargetDrop(const CefMouseEvent& event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->drag_target_drop(_struct, - &event); + _struct->drag_target_drop(_struct, &event); } -void CefBrowserHostCToCpp::DragSourceEndedAt(int x, int y, - DragOperationsMask op) { +void CefBrowserHostCToCpp::DragSourceEndedAt(int x, + int y, + DragOperationsMask op) { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, drag_source_ended_at)) return; @@ -810,10 +778,7 @@ void CefBrowserHostCToCpp::DragSourceEndedAt(int x, int y, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->drag_source_ended_at(_struct, - x, - y, - op); + _struct->drag_source_ended_at(_struct, x, y, op); } void CefBrowserHostCToCpp::DragSourceSystemDragEnded() { @@ -827,8 +792,8 @@ void CefBrowserHostCToCpp::DragSourceSystemDragEnded() { _struct->drag_source_system_drag_ended(_struct); } -CefRefPtr CefBrowserHostCToCpp::GetVisibleNavigationEntry( - ) { +CefRefPtr +CefBrowserHostCToCpp::GetVisibleNavigationEntry() { cef_browser_host_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_visible_navigation_entry)) return NULL; @@ -836,8 +801,8 @@ CefRefPtr CefBrowserHostCToCpp::GetVisibleNavigationEntry( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_navigation_entry_t* _retval = _struct->get_visible_navigation_entry( - _struct); + cef_navigation_entry_t* _retval = + _struct->get_visible_navigation_entry(_struct); // Return type: refptr_same return CefNavigationEntryCToCpp::Wrap(_retval); @@ -852,27 +817,30 @@ void CefBrowserHostCToCpp::SetAccessibilityState( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_accessibility_state(_struct, - accessibility_state); + _struct->set_accessibility_state(_struct, accessibility_state); } - // CONSTRUCTOR - Do not edit by hand. -CefBrowserHostCToCpp::CefBrowserHostCToCpp() { -} +CefBrowserHostCToCpp::CefBrowserHostCToCpp() {} -template<> cef_browser_host_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefBrowserHost* c) { +template <> +cef_browser_host_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefBrowserHost* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER_HOST; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_BROWSER_HOST; diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.h b/libcef_dll/ctocpp/browser_host_ctocpp.h index b868eaf95..aab396076 100644 --- a/libcef_dll/ctocpp/browser_host_ctocpp.h +++ b/libcef_dll/ctocpp/browser_host_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=589466ca4bd3e901d903764a71a4e8b1ee10003f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ @@ -19,17 +21,17 @@ #endif #include -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefBrowserHostCToCpp - : public CefCToCppRefCounted { +class CefBrowserHostCToCpp : public CefCToCppRefCounted { public: CefBrowserHostCToCpp(); @@ -45,27 +47,36 @@ class CefBrowserHostCToCpp CefRefPtr GetRequestContext() OVERRIDE; double GetZoomLevel() OVERRIDE; void SetZoomLevel(double zoomLevel) OVERRIDE; - void RunFileDialog(FileDialogMode mode, const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, int selected_accept_filter, - CefRefPtr callback) OVERRIDE; + void RunFileDialog(FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) OVERRIDE; void StartDownload(const CefString& url) OVERRIDE; - void DownloadImage(const CefString& image_url, bool is_favicon, - uint32 max_image_size, bool bypass_cache, - CefRefPtr callback) OVERRIDE; + void DownloadImage(const CefString& image_url, + bool is_favicon, + uint32 max_image_size, + bool bypass_cache, + CefRefPtr callback) OVERRIDE; void Print() OVERRIDE; - void PrintToPDF(const CefString& path, const CefPdfPrintSettings& settings, - CefRefPtr callback) OVERRIDE; - void Find(int identifier, const CefString& searchText, bool forward, - bool matchCase, bool findNext) OVERRIDE; + void PrintToPDF(const CefString& path, + const CefPdfPrintSettings& settings, + CefRefPtr callback) OVERRIDE; + void Find(int identifier, + const CefString& searchText, + bool forward, + bool matchCase, + bool findNext) OVERRIDE; void StopFinding(bool clearSelection) OVERRIDE; void ShowDevTools(const CefWindowInfo& windowInfo, - CefRefPtr client, const CefBrowserSettings& settings, - const CefPoint& inspect_element_at) OVERRIDE; + CefRefPtr client, + const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) OVERRIDE; void CloseDevTools() OVERRIDE; bool HasDevTools() OVERRIDE; void GetNavigationEntries(CefRefPtr visitor, - bool current_only) OVERRIDE; + bool current_only) OVERRIDE; void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE; bool IsMouseCursorChangeDisabled() OVERRIDE; void ReplaceMisspelling(const CefString& word) OVERRIDE; @@ -76,28 +87,33 @@ class CefBrowserHostCToCpp void NotifyScreenInfoChanged() OVERRIDE; void Invalidate(PaintElementType type) OVERRIDE; void SendKeyEvent(const CefKeyEvent& event) OVERRIDE; - void SendMouseClickEvent(const CefMouseEvent& event, MouseButtonType type, - bool mouseUp, int clickCount) OVERRIDE; + void SendMouseClickEvent(const CefMouseEvent& event, + MouseButtonType type, + bool mouseUp, + int clickCount) OVERRIDE; void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) OVERRIDE; - void SendMouseWheelEvent(const CefMouseEvent& event, int deltaX, - int deltaY) OVERRIDE; + void SendMouseWheelEvent(const CefMouseEvent& event, + int deltaX, + int deltaY) OVERRIDE; void SendFocusEvent(bool setFocus) OVERRIDE; void SendCaptureLostEvent() OVERRIDE; void NotifyMoveOrResizeStarted() OVERRIDE; int GetWindowlessFrameRate() OVERRIDE; void SetWindowlessFrameRate(int frame_rate) OVERRIDE; void ImeSetComposition(const CefString& text, - const std::vector& underlines, - const CefRange& replacement_range, - const CefRange& selection_range) OVERRIDE; - void ImeCommitText(const CefString& text, const CefRange& replacement_range, - int relative_cursor_pos) OVERRIDE; + const std::vector& underlines, + const CefRange& replacement_range, + const CefRange& selection_range) OVERRIDE; + void ImeCommitText(const CefString& text, + const CefRange& replacement_range, + int relative_cursor_pos) OVERRIDE; void ImeFinishComposingText(bool keep_selection) OVERRIDE; void ImeCancelComposition() OVERRIDE; void DragTargetDragEnter(CefRefPtr drag_data, - const CefMouseEvent& event, DragOperationsMask allowed_ops) OVERRIDE; + const CefMouseEvent& event, + DragOperationsMask allowed_ops) OVERRIDE; void DragTargetDragOver(const CefMouseEvent& event, - DragOperationsMask allowed_ops) OVERRIDE; + DragOperationsMask allowed_ops) OVERRIDE; void DragTargetDragLeave() OVERRIDE; void DragTargetDrop(const CefMouseEvent& event) OVERRIDE; void DragSourceEndedAt(int x, int y, DragOperationsMask op) OVERRIDE; diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc index 604411436..df618a237 100644 --- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4b9ebfdb62673c673fb1628c8f24bb50754cb869$ +// #include "libcef_dll/cpptoc/command_line_cpptoc.h" #include "libcef_dll/cpptoc/list_value_cpptoc.h" #include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h" #include "libcef_dll/ctocpp/print_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefBrowserProcessHandlerCToCpp::OnContextInitialized() { @@ -43,8 +44,8 @@ void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch( return; // Execute - _struct->on_before_child_process_launch(_struct, - CefCommandLineCppToC::Wrap(command_line)); + _struct->on_before_child_process_launch( + _struct, CefCommandLineCppToC::Wrap(command_line)); } void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated( @@ -61,8 +62,8 @@ void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated( return; // Execute - _struct->on_render_process_thread_created(_struct, - CefListValueCppToC::Wrap(extra_info)); + _struct->on_render_process_thread_created( + _struct, CefListValueCppToC::Wrap(extra_info)); } CefRefPtr CefBrowserProcessHandlerCToCpp::GetPrintHandler() { @@ -87,28 +88,34 @@ void CefBrowserProcessHandlerCToCpp::OnScheduleMessagePumpWork(int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->on_schedule_message_pump_work(_struct, - delay_ms); + _struct->on_schedule_message_pump_work(_struct, delay_ms); } - // CONSTRUCTOR - Do not edit by hand. -CefBrowserProcessHandlerCToCpp::CefBrowserProcessHandlerCToCpp() { -} +CefBrowserProcessHandlerCToCpp::CefBrowserProcessHandlerCToCpp() {} -template<> cef_browser_process_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefBrowserProcessHandler* c) { +template <> +cef_browser_process_handler_t* CefCToCppRefCounted< + CefBrowserProcessHandlerCToCpp, + CefBrowserProcessHandler, + cef_browser_process_handler_t>::UnwrapDerived(CefWrapperType type, + CefBrowserProcessHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_BROWSER_PROCESS_HANDLER; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_BROWSER_PROCESS_HANDLER; diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h index 1b5830cc6..4c3a4ef11 100644 --- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h +++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c1cec19dbdd2c4cee35413cbb97073ec244309e5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser_process_handler.h" #include "include/capi/cef_browser_process_handler_capi.h" +#include "include/cef_browser_process_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefBrowserProcessHandlerCToCpp : public CefCToCppRefCounted { + CefBrowserProcessHandler, + cef_browser_process_handler_t> { public: CefBrowserProcessHandlerCToCpp(); diff --git a/libcef_dll/ctocpp/callback_ctocpp.cc b/libcef_dll/ctocpp/callback_ctocpp.cc index 8f79e986c..ef0b99014 100644 --- a/libcef_dll/ctocpp/callback_ctocpp.cc +++ b/libcef_dll/ctocpp/callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7ee795c5a528d9f9d0145b138c8f87e427d9fd48$ +// #include "libcef_dll/ctocpp/callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefCallbackCToCpp::Continue() { @@ -37,22 +38,26 @@ void CefCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefCallbackCToCpp::CefCallbackCToCpp() { -} +CefCallbackCToCpp::CefCallbackCToCpp() {} -template<> cef_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefCallback* c) { +template <> +cef_callback_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CALLBACK; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CALLBACK; diff --git a/libcef_dll/ctocpp/callback_ctocpp.h b/libcef_dll/ctocpp/callback_ctocpp.h index 892d6e7ab..142c6dafc 100644 --- a/libcef_dll/ctocpp/callback_ctocpp.h +++ b/libcef_dll/ctocpp/callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=256892a4f1a26b461dd5149e5ba4bcafdb6a47a5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_callback.h" #include "include/capi/cef_callback_capi.h" +#include "include/cef_callback.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefCallbackCToCpp - : public CefCToCppRefCounted { +class CefCallbackCToCpp : public CefCToCppRefCounted { public: CefCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc index fc61ac6e1..8cc6c14ac 100644 --- a/libcef_dll/ctocpp/client_ctocpp.cc +++ b/libcef_dll/ctocpp/client_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1a5e4dcfa2ffdc3755bd9ea45c928e2bb0e17540$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/process_message_cpptoc.h" @@ -28,7 +30,6 @@ #include "libcef_dll/ctocpp/render_handler_ctocpp.h" #include "libcef_dll/ctocpp/request_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefClientCToCpp::GetContextMenuHandler() { @@ -39,8 +40,8 @@ CefRefPtr CefClientCToCpp::GetContextMenuHandler() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_handler_t* _retval = _struct->get_context_menu_handler( - _struct); + cef_context_menu_handler_t* _retval = + _struct->get_context_menu_handler(_struct); // Return type: refptr_same return CefContextMenuHandlerCToCpp::Wrap(_retval); @@ -138,8 +139,8 @@ CefRefPtr CefClientCToCpp::GetGeolocationHandler() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_geolocation_handler_t* _retval = _struct->get_geolocation_handler( - _struct); + cef_geolocation_handler_t* _retval = + _struct->get_geolocation_handler(_struct); // Return type: refptr_same return CefGeolocationHandlerCToCpp::Wrap(_retval); @@ -229,8 +230,10 @@ CefRefPtr CefClientCToCpp::GetRequestHandler() { return CefRequestHandlerCToCpp::Wrap(_retval); } -bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser, - CefProcessId source_process, CefRefPtr message) { +bool CefClientCToCpp::OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) { cef_client_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_process_message_received)) return false; @@ -247,31 +250,34 @@ bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_process_message_received(_struct, - CefBrowserCppToC::Wrap(browser), - source_process, + int _retval = _struct->on_process_message_received( + _struct, CefBrowserCppToC::Wrap(browser), source_process, CefProcessMessageCppToC::Wrap(message)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefClientCToCpp::CefClientCToCpp() { -} +CefClientCToCpp::CefClientCToCpp() {} -template<> cef_client_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefClient* c) { +template <> +cef_client_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefClient* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CLIENT; +template <> +CefWrapperType CefCToCppRefCounted:: + kWrapperType = WT_CLIENT; diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h index 1724d8b65..4cccf1d10 100644 --- a/libcef_dll/ctocpp/client_ctocpp.h +++ b/libcef_dll/ctocpp/client_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c5a433652b493e327563d0aad569dec2416fdf42$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -45,8 +47,8 @@ class CefClientCToCpp CefRefPtr GetRenderHandler() override; CefRefPtr GetRequestHandler() override; bool OnProcessMessageReceived(CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override; + CefProcessId source_process, + CefRefPtr message) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc index 116b2ec6f..1461ca3fb 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.cc +++ b/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2d277a1a0ba292fb02e44230912d75b438a7fb4f$ +// #include "include/cef_version.h" #include "libcef_dll/ctocpp/command_line_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefCommandLine::CreateCommandLine() { @@ -51,7 +52,6 @@ CefRefPtr CefCommandLine::GetGlobalCommandLine() { return CefCommandLineCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefCommandLineCToCpp::IsValid() { @@ -65,7 +65,7 @@ bool CefCommandLineCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefCommandLineCToCpp::IsReadOnly() { @@ -79,7 +79,7 @@ bool CefCommandLineCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefCommandLineCToCpp::Copy() { @@ -109,9 +109,7 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) { return; // Execute - _struct->init_from_argv(_struct, - argc, - argv); + _struct->init_from_argv(_struct, argc, argv); } void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { @@ -127,8 +125,7 @@ void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { return; // Execute - _struct->init_from_string(_struct, - command_line.GetStruct()); + _struct->init_from_string(_struct, command_line.GetStruct()); } void CefCommandLineCToCpp::Reset() { @@ -156,8 +153,7 @@ void CefCommandLineCToCpp::GetArgv(std::vector& argv) { transfer_string_list_contents(argv, argvList); // Execute - _struct->get_argv(_struct, - argvList); + _struct->get_argv(_struct, argvList); // Restore param:argv; type: string_vec_byref if (argvList) { @@ -212,8 +208,7 @@ void CefCommandLineCToCpp::SetProgram(const CefString& program) { return; // Execute - _struct->set_program(_struct, - program.GetStruct()); + _struct->set_program(_struct, program.GetStruct()); } bool CefCommandLineCToCpp::HasSwitches() { @@ -227,7 +222,7 @@ bool CefCommandLineCToCpp::HasSwitches() { int _retval = _struct->has_switches(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { @@ -243,11 +238,10 @@ bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { return false; // Execute - int _retval = _struct->has_switch(_struct, - name.GetStruct()); + int _retval = _struct->has_switch(_struct, name.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { @@ -263,8 +257,8 @@ CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_switch_value(_struct, - name.GetStruct()); + cef_string_userfree_t _retval = + _struct->get_switch_value(_struct, name.GetStruct()); // Return type: string CefString _retvalStr; @@ -286,8 +280,7 @@ void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { transfer_string_map_contents(switches, switchesMap); // Execute - _struct->get_switches(_struct, - switchesMap); + _struct->get_switches(_struct, switchesMap); // Restore param:switches; type: string_map_single_byref if (switchesMap) { @@ -310,12 +303,11 @@ void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { return; // Execute - _struct->append_switch(_struct, - name.GetStruct()); + _struct->append_switch(_struct, name.GetStruct()); } void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, - const CefString& value) { + const CefString& value) { cef_command_line_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, append_switch_with_value)) return; @@ -332,9 +324,8 @@ void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, return; // Execute - _struct->append_switch_with_value(_struct, - name.GetStruct(), - value.GetStruct()); + _struct->append_switch_with_value(_struct, name.GetStruct(), + value.GetStruct()); } bool CefCommandLineCToCpp::HasArguments() { @@ -348,7 +339,7 @@ bool CefCommandLineCToCpp::HasArguments() { int _retval = _struct->has_arguments(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { @@ -365,8 +356,7 @@ void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { transfer_string_list_contents(arguments, argumentsList); // Execute - _struct->get_arguments(_struct, - argumentsList); + _struct->get_arguments(_struct, argumentsList); // Restore param:arguments; type: string_vec_byref if (argumentsList) { @@ -389,8 +379,7 @@ void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { return; // Execute - _struct->append_argument(_struct, - argument.GetStruct()); + _struct->append_argument(_struct, argument.GetStruct()); } void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) { @@ -406,27 +395,30 @@ void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) { return; // Execute - _struct->prepend_wrapper(_struct, - wrapper.GetStruct()); + _struct->prepend_wrapper(_struct, wrapper.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefCommandLineCToCpp::CefCommandLineCToCpp() { -} +CefCommandLineCToCpp::CefCommandLineCToCpp() {} -template<> cef_command_line_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefCommandLine* c) { +template <> +cef_command_line_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefCommandLine* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COMMAND_LINE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_COMMAND_LINE; diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h index 17364f55f..60497a2ca 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.h +++ b/libcef_dll/ctocpp/command_line_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6a5464306b95a026bd25375534ed3c1c0cc40c85$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ @@ -19,15 +21,15 @@ #endif #include -#include "include/cef_command_line.h" #include "include/capi/cef_command_line_capi.h" +#include "include/cef_command_line.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefCommandLineCToCpp - : public CefCToCppRefCounted { +class CefCommandLineCToCpp : public CefCToCppRefCounted { public: CefCommandLineCToCpp(); @@ -48,7 +50,7 @@ class CefCommandLineCToCpp void GetSwitches(SwitchMap& switches) OVERRIDE; void AppendSwitch(const CefString& name) OVERRIDE; void AppendSwitchWithValue(const CefString& name, - const CefString& value) OVERRIDE; + const CefString& value) OVERRIDE; bool HasArguments() OVERRIDE; void GetArguments(ArgumentList& arguments) OVERRIDE; void AppendArgument(const CefString& argument) OVERRIDE; diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.cc b/libcef_dll/ctocpp/completion_callback_ctocpp.cc index cb0bb6d97..eabb138f7 100644 --- a/libcef_dll/ctocpp/completion_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/completion_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=dbe3d9b43be8554f642165c6230ceb267999fb02$ +// #include "libcef_dll/ctocpp/completion_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefCompletionCallbackCToCpp::OnComplete() { @@ -26,24 +27,30 @@ void CefCompletionCallbackCToCpp::OnComplete() { _struct->on_complete(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefCompletionCallbackCToCpp::CefCompletionCallbackCToCpp() { -} +CefCompletionCallbackCToCpp::CefCompletionCallbackCToCpp() {} -template<> cef_completion_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefCompletionCallback* c) { +template <> +cef_completion_callback_t* CefCToCppRefCounted< + CefCompletionCallbackCToCpp, + CefCompletionCallback, + cef_completion_callback_t>::UnwrapDerived(CefWrapperType type, + CefCompletionCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COMPLETION_CALLBACK; diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.h b/libcef_dll/ctocpp/completion_callback_ctocpp.h index 953accbe1..4a476eaad 100644 --- a/libcef_dll/ctocpp/completion_callback_ctocpp.h +++ b/libcef_dll/ctocpp/completion_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=578edc4be4f116ecc4a45afdead78f5b41b98d82$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_callback.h" #include "include/capi/cef_callback_capi.h" +#include "include/cef_callback.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefCompletionCallbackCToCpp : public CefCToCppRefCounted { + CefCompletionCallback, + cef_completion_callback_t> { public: CefCompletionCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc index 5d75b55b0..48084feec 100644 --- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=29dcaab3b72b6deeb4e6eb682287e1d25c8b21e1$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h" @@ -17,12 +19,13 @@ #include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h" #include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefContextMenuHandlerCToCpp::OnBeforeContextMenu( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr params, CefRefPtr model) { + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) { cef_context_menu_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_context_menu)) return; @@ -47,15 +50,16 @@ void CefContextMenuHandlerCToCpp::OnBeforeContextMenu( return; // Execute - _struct->on_before_context_menu(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefContextMenuParamsCppToC::Wrap(params), - CefMenuModelCppToC::Wrap(model)); + _struct->on_before_context_menu(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefContextMenuParamsCppToC::Wrap(params), + CefMenuModelCppToC::Wrap(model)); } -bool CefContextMenuHandlerCToCpp::RunContextMenu(CefRefPtr browser, - CefRefPtr frame, CefRefPtr params, +bool CefContextMenuHandlerCToCpp::RunContextMenu( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, CefRefPtr model, CefRefPtr callback) { cef_context_menu_handler_t* _struct = GetStruct(); @@ -86,20 +90,20 @@ bool CefContextMenuHandlerCToCpp::RunContextMenu(CefRefPtr browser, return false; // Execute - int _retval = _struct->run_context_menu(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefContextMenuParamsCppToC::Wrap(params), - CefMenuModelCppToC::Wrap(model), + int _retval = _struct->run_context_menu( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefContextMenuParamsCppToC::Wrap(params), CefMenuModelCppToC::Wrap(model), CefRunContextMenuCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefContextMenuHandlerCToCpp::OnContextMenuCommand( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr params, int command_id, + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + int command_id, EventFlags event_flags) { cef_context_menu_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_context_menu_command)) @@ -121,19 +125,17 @@ bool CefContextMenuHandlerCToCpp::OnContextMenuCommand( return false; // Execute - int _retval = _struct->on_context_menu_command(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefContextMenuParamsCppToC::Wrap(params), - command_id, - event_flags); + int _retval = _struct->on_context_menu_command( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefContextMenuParamsCppToC::Wrap(params), command_id, event_flags); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefContextMenuHandlerCToCpp::OnContextMenuDismissed( - CefRefPtr browser, CefRefPtr frame) { + CefRefPtr browser, + CefRefPtr frame) { cef_context_menu_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_context_menu_dismissed)) return; @@ -150,29 +152,34 @@ void CefContextMenuHandlerCToCpp::OnContextMenuDismissed( return; // Execute - _struct->on_context_menu_dismissed(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame)); + _struct->on_context_menu_dismissed(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame)); } - // CONSTRUCTOR - Do not edit by hand. -CefContextMenuHandlerCToCpp::CefContextMenuHandlerCToCpp() { -} +CefContextMenuHandlerCToCpp::CefContextMenuHandlerCToCpp() {} -template<> cef_context_menu_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefContextMenuHandler* c) { +template <> +cef_context_menu_handler_t* CefCToCppRefCounted< + CefContextMenuHandlerCToCpp, + CefContextMenuHandler, + cef_context_menu_handler_t>::UnwrapDerived(CefWrapperType type, + CefContextMenuHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CONTEXT_MENU_HANDLER; diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h index 0e15d938c..f7e4dedba 100644 --- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=82cd962cacde83e1df7af319f1da07f5402a1936$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_ @@ -18,30 +20,36 @@ #error This file can be included DLL-side only #endif -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefContextMenuHandlerCToCpp : public CefCToCppRefCounted { + CefContextMenuHandler, + cef_context_menu_handler_t> { public: CefContextMenuHandlerCToCpp(); // CefContextMenuHandler methods. void OnBeforeContextMenu(CefRefPtr browser, - CefRefPtr frame, CefRefPtr params, - CefRefPtr model) override; - bool RunContextMenu(CefRefPtr browser, CefRefPtr frame, - CefRefPtr params, CefRefPtr model, - CefRefPtr callback) override; + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) override; + bool RunContextMenu(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model, + CefRefPtr callback) override; bool OnContextMenuCommand(CefRefPtr browser, - CefRefPtr frame, CefRefPtr params, - int command_id, EventFlags event_flags) override; + CefRefPtr frame, + CefRefPtr params, + int command_id, + EventFlags event_flags) override; void OnContextMenuDismissed(CefRefPtr browser, - CefRefPtr frame) override; + CefRefPtr frame) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc index 9765b0087..fcaeb7454 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=393260edeabe88e52ab45caee677d59fbfb3270f$ +// #include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. int CefContextMenuParamsCToCpp::GetXCoord() { @@ -117,7 +118,7 @@ bool CefContextMenuParamsCToCpp::HasImageContents() { int _retval = _struct->has_image_contents(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefContextMenuParamsCToCpp::GetTitleText() { @@ -198,8 +199,8 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { return _retval; } -CefContextMenuParams::MediaStateFlags CefContextMenuParamsCToCpp::GetMediaStateFlags( - ) { +CefContextMenuParams::MediaStateFlags +CefContextMenuParamsCToCpp::GetMediaStateFlags() { cef_context_menu_params_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_media_state_flags)) return CM_MEDIAFLAG_NONE; @@ -207,8 +208,8 @@ CefContextMenuParams::MediaStateFlags CefContextMenuParamsCToCpp::GetMediaStateF // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_media_state_flags_t _retval = _struct->get_media_state_flags( - _struct); + cef_context_menu_media_state_flags_t _retval = + _struct->get_media_state_flags(_struct); // Return type: simple return _retval; @@ -261,8 +262,7 @@ bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( transfer_string_list_contents(suggestions, suggestionsList); // Execute - int _retval = _struct->get_dictionary_suggestions(_struct, - suggestionsList); + int _retval = _struct->get_dictionary_suggestions(_struct, suggestionsList); // Restore param:suggestions; type: string_vec_byref if (suggestionsList) { @@ -272,7 +272,7 @@ bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefContextMenuParamsCToCpp::IsEditable() { @@ -286,7 +286,7 @@ bool CefContextMenuParamsCToCpp::IsEditable() { int _retval = _struct->is_editable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { @@ -300,11 +300,11 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { int _retval = _struct->is_spell_check_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CefContextMenuParams::EditStateFlags CefContextMenuParamsCToCpp::GetEditStateFlags( - ) { +CefContextMenuParams::EditStateFlags +CefContextMenuParamsCToCpp::GetEditStateFlags() { cef_context_menu_params_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_edit_state_flags)) return CM_EDITFLAG_NONE; @@ -312,8 +312,8 @@ CefContextMenuParams::EditStateFlags CefContextMenuParamsCToCpp::GetEditStateFla // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_edit_state_flags_t _retval = _struct->get_edit_state_flags( - _struct); + cef_context_menu_edit_state_flags_t _retval = + _struct->get_edit_state_flags(_struct); // Return type: simple return _retval; @@ -330,7 +330,7 @@ bool CefContextMenuParamsCToCpp::IsCustomMenu() { int _retval = _struct->is_custom_menu(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefContextMenuParamsCToCpp::IsPepperMenu() { @@ -344,27 +344,33 @@ bool CefContextMenuParamsCToCpp::IsPepperMenu() { int _retval = _struct->is_pepper_menu(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() { -} +CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {} -template<> cef_context_menu_params_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefContextMenuParams* c) { +template <> +cef_context_menu_params_t* CefCToCppRefCounted< + CefContextMenuParamsCToCpp, + CefContextMenuParams, + cef_context_menu_params_t>::UnwrapDerived(CefWrapperType type, + CefContextMenuParams* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CONTEXT_MENU_PARAMS; diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/libcef_dll/ctocpp/context_menu_params_ctocpp.h index 1bdab01b9..9a8d0c586 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=37ce1fd4db4480afc4d43cfc1ff16bdfdd4a232b$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ @@ -19,15 +21,16 @@ #endif #include -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefContextMenuParamsCToCpp : public CefCToCppRefCounted { + CefContextMenuParams, + cef_context_menu_params_t> { public: CefContextMenuParamsCToCpp(); diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc index 47eb6d4a2..0e30e35f4 100644 --- a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=029e88d2ce63882c56cf0ac4c22772fe149dcfb4$ +// #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefCookieManager::GetGlobalManager( @@ -35,7 +36,8 @@ CefRefPtr CefCookieManager::GetGlobalManager( } CefRefPtr CefCookieManager::CreateManager( - const CefString& path, bool persist_session_cookies, + const CefString& path, + bool persist_session_cookies, CefRefPtr callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -43,15 +45,13 @@ CefRefPtr CefCookieManager::CreateManager( // Execute cef_cookie_manager_t* _retval = cef_cookie_manager_create_manager( - path.GetStruct(), - persist_session_cookies, + path.GetStruct(), persist_session_cookies, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: refptr_same return CefCookieManagerCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefCookieManagerCToCpp::SetSupportedSchemes( @@ -72,9 +72,8 @@ void CefCookieManagerCToCpp::SetSupportedSchemes( transfer_string_list_contents(schemes, schemesList); // Execute - _struct->set_supported_schemes(_struct, - schemesList, - CefCompletionCallbackCppToC::Wrap(callback)); + _struct->set_supported_schemes(_struct, schemesList, + CefCompletionCallbackCppToC::Wrap(callback)); // Restore param:schemes; type: string_vec_byref_const if (schemesList) @@ -95,15 +94,17 @@ bool CefCookieManagerCToCpp::VisitAllCookies( return false; // Execute - int _retval = _struct->visit_all_cookies(_struct, - CefCookieVisitorCppToC::Wrap(visitor)); + int _retval = _struct->visit_all_cookies( + _struct, CefCookieVisitorCppToC::Wrap(visitor)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, - bool includeHttpOnly, CefRefPtr visitor) { +bool CefCookieManagerCToCpp::VisitUrlCookies( + const CefString& url, + bool includeHttpOnly, + CefRefPtr visitor) { cef_cookie_manager_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, visit_url_cookies)) return false; @@ -120,17 +121,18 @@ bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, return false; // Execute - int _retval = _struct->visit_url_cookies(_struct, - url.GetStruct(), - includeHttpOnly, - CefCookieVisitorCppToC::Wrap(visitor)); + int _retval = + _struct->visit_url_cookies(_struct, url.GetStruct(), includeHttpOnly, + CefCookieVisitorCppToC::Wrap(visitor)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefCookieManagerCToCpp::SetCookie(const CefString& url, - const CefCookie& cookie, CefRefPtr callback) { +bool CefCookieManagerCToCpp::SetCookie( + const CefString& url, + const CefCookie& cookie, + CefRefPtr callback) { cef_cookie_manager_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_cookie)) return false; @@ -144,16 +146,15 @@ bool CefCookieManagerCToCpp::SetCookie(const CefString& url, // Unverified params: callback // Execute - int _retval = _struct->set_cookie(_struct, - url.GetStruct(), - &cookie, - CefSetCookieCallbackCppToC::Wrap(callback)); + int _retval = _struct->set_cookie(_struct, url.GetStruct(), &cookie, + CefSetCookieCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, +bool CefCookieManagerCToCpp::DeleteCookies( + const CefString& url, const CefString& cookie_name, CefRefPtr callback) { cef_cookie_manager_t* _struct = GetStruct(); @@ -165,17 +166,18 @@ bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, // Unverified params: url, cookie_name, callback // Execute - int _retval = _struct->delete_cookies(_struct, - url.GetStruct(), - cookie_name.GetStruct(), - CefDeleteCookiesCallbackCppToC::Wrap(callback)); + int _retval = + _struct->delete_cookies(_struct, url.GetStruct(), cookie_name.GetStruct(), + CefDeleteCookiesCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, - bool persist_session_cookies, CefRefPtr callback) { +bool CefCookieManagerCToCpp::SetStoragePath( + const CefString& path, + bool persist_session_cookies, + CefRefPtr callback) { cef_cookie_manager_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_storage_path)) return false; @@ -185,13 +187,12 @@ bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, // Unverified params: path, callback // Execute - int _retval = _struct->set_storage_path(_struct, - path.GetStruct(), - persist_session_cookies, + int _retval = _struct->set_storage_path( + _struct, path.GetStruct(), persist_session_cookies, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefCookieManagerCToCpp::FlushStore( @@ -205,30 +206,36 @@ bool CefCookieManagerCToCpp::FlushStore( // Unverified params: callback // Execute - int _retval = _struct->flush_store(_struct, - CefCompletionCallbackCppToC::Wrap(callback)); + int _retval = _struct->flush_store( + _struct, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefCookieManagerCToCpp::CefCookieManagerCToCpp() { -} +CefCookieManagerCToCpp::CefCookieManagerCToCpp() {} -template<> cef_cookie_manager_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefCookieManager* c) { +template <> +cef_cookie_manager_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefCookieManager* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COOKIE_MANAGER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_COOKIE_MANAGER; diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.h b/libcef_dll/ctocpp/cookie_manager_ctocpp.h index 7ea85182c..7aed26f19 100644 --- a/libcef_dll/ctocpp/cookie_manager_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7dcafc3a29b97d8c330e4590e9970bc3949739a4$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ @@ -19,30 +21,35 @@ #endif #include -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefCookieManagerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefCookieManagerCToCpp(); // CefCookieManager methods. void SetSupportedSchemes(const std::vector& schemes, - CefRefPtr callback) OVERRIDE; + CefRefPtr callback) OVERRIDE; bool VisitAllCookies(CefRefPtr visitor) OVERRIDE; - bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) OVERRIDE; - bool SetCookie(const CefString& url, const CefCookie& cookie, - CefRefPtr callback) OVERRIDE; - bool DeleteCookies(const CefString& url, const CefString& cookie_name, - CefRefPtr callback) OVERRIDE; - bool SetStoragePath(const CefString& path, bool persist_session_cookies, - CefRefPtr callback) OVERRIDE; + bool VisitUrlCookies(const CefString& url, + bool includeHttpOnly, + CefRefPtr visitor) OVERRIDE; + bool SetCookie(const CefString& url, + const CefCookie& cookie, + CefRefPtr callback) OVERRIDE; + bool DeleteCookies(const CefString& url, + const CefString& cookie_name, + CefRefPtr callback) OVERRIDE; + bool SetStoragePath(const CefString& path, + bool persist_session_cookies, + CefRefPtr callback) OVERRIDE; bool FlushStore(CefRefPtr callback) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc index 069fed860..94a19eaff 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc @@ -9,14 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e8834bbf6ab6cb2575f73e3f62e70709f9b36322$ +// #include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, - int total, bool& deleteCookie) { +bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, + int count, + int total, + bool& deleteCookie) { cef_cookie_visitor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, visit)) return false; @@ -27,36 +30,39 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, int deleteCookieInt = deleteCookie; // Execute - int _retval = _struct->visit(_struct, - &cookie, - count, - total, - &deleteCookieInt); + int _retval = + _struct->visit(_struct, &cookie, count, total, &deleteCookieInt); // Restore param:deleteCookie; type: bool_byref - deleteCookie = deleteCookieInt?true:false; + deleteCookie = deleteCookieInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefCookieVisitorCToCpp::CefCookieVisitorCToCpp() { -} +CefCookieVisitorCToCpp::CefCookieVisitorCToCpp() {} -template<> cef_cookie_visitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefCookieVisitor* c) { +template <> +cef_cookie_visitor_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefCookieVisitor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COOKIE_VISITOR; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_COOKIE_VISITOR; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h index d86eabc92..b18391919 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f1c2340ad3a079ba3d095c7cc1542aeb73366752$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ @@ -18,21 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefCookieVisitorCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefCookieVisitorCToCpp(); // CefCookieVisitor methods. - bool Visit(const CefCookie& cookie, int count, int total, - bool& deleteCookie) override; + bool Visit(const CefCookie& cookie, + int count, + int total, + bool& deleteCookie) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/ctocpp_ref_counted.h b/libcef_dll/ctocpp/ctocpp_ref_counted.h index e636c67d7..a4f048dec 100644 --- a/libcef_dll/ctocpp/ctocpp_ref_counted.h +++ b/libcef_dll/ctocpp/ctocpp_ref_counted.h @@ -8,8 +8,8 @@ #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/wrapper_types.h" // Wrap a C structure with a C++ class. This is used when the implementation @@ -37,7 +37,7 @@ class CefCToCppRefCounted : public BaseName { #if DCHECK_IS_ON() // Simple tracking of allocated objects. - static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) + static base::AtomicRefCount DebugObjCt; #endif protected: @@ -103,15 +103,15 @@ class CefCToCppRefCounted : public BaseName { }; template -struct CefCToCppRefCounted::WrapperStruct { +struct CefCToCppRefCounted::WrapperStruct { CefWrapperType type_; StructName* struct_; ClassName wrapper_; }; template -CefRefPtr - CefCToCppRefCounted::Wrap(StructName* s) { +CefRefPtr CefCToCppRefCounted::Wrap( + StructName* s) { if (!s) return NULL; @@ -164,8 +164,8 @@ bool CefCToCppRefCounted::Release() const { template typename CefCToCppRefCounted::WrapperStruct* - CefCToCppRefCounted::GetWrapperStruct( - const BaseName* obj) { +CefCToCppRefCounted::GetWrapperStruct( + const BaseName* obj) { // Offset using the WrapperStruct size instead of individual member sizes to // avoid problems due to platform/compiler differences in structure padding. return reinterpret_cast( diff --git a/libcef_dll/ctocpp/ctocpp_scoped.h b/libcef_dll/ctocpp/ctocpp_scoped.h index 39ff502aa..5da1108a9 100644 --- a/libcef_dll/ctocpp/ctocpp_scoped.h +++ b/libcef_dll/ctocpp/ctocpp_scoped.h @@ -8,8 +8,8 @@ #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" -#include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "include/cef_base.h" #include "libcef_dll/ptr_util.h" #include "libcef_dll/wrapper_types.h" @@ -69,7 +69,7 @@ class CefCToCppScoped : public BaseName { #if DCHECK_IS_ON() // Simple tracking of allocated objects. - static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) + static base::AtomicRefCount DebugObjCt; #endif protected: @@ -112,7 +112,7 @@ class CefCToCppScoped : public BaseName { }; template -struct CefCToCppScoped::WrapperStruct { +struct CefCToCppScoped::WrapperStruct { CefWrapperType type_; StructName* struct_; ClassName wrapper_; @@ -201,8 +201,8 @@ void CefCToCppScoped::operator delete( template typename CefCToCppScoped::WrapperStruct* - CefCToCppScoped::GetWrapperStruct( - const BaseName* obj) { +CefCToCppScoped::GetWrapperStruct( + const BaseName* obj) { // Offset using the WrapperStruct size instead of individual member sizes to // avoid problems due to platform/compiler differences in structure padding. return reinterpret_cast( diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc index 74d45ef84..b886b7019 100644 --- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d6a443ca416468eb7fadc6a4b991c5dc9e742b75$ +// #include "libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefDeleteCookiesCallbackCToCpp::OnComplete(int num_deleted) { @@ -23,28 +24,34 @@ void CefDeleteCookiesCallbackCToCpp::OnComplete(int num_deleted) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->on_complete(_struct, - num_deleted); + _struct->on_complete(_struct, num_deleted); } - // CONSTRUCTOR - Do not edit by hand. -CefDeleteCookiesCallbackCToCpp::CefDeleteCookiesCallbackCToCpp() { -} +CefDeleteCookiesCallbackCToCpp::CefDeleteCookiesCallbackCToCpp() {} -template<> cef_delete_cookies_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDeleteCookiesCallback* c) { +template <> +cef_delete_cookies_callback_t* CefCToCppRefCounted< + CefDeleteCookiesCallbackCToCpp, + CefDeleteCookiesCallback, + cef_delete_cookies_callback_t>::UnwrapDerived(CefWrapperType type, + CefDeleteCookiesCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_DELETE_COOKIES_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_DELETE_COOKIES_CALLBACK; diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h index b585074e9..b32bdffcc 100644 --- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h +++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f84ae1962b7d68c8686c27f33de4ae2e921d5a3f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DELETE_COOKIES_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DELETE_COOKIES_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDeleteCookiesCallbackCToCpp : public CefCToCppRefCounted { + CefDeleteCookiesCallback, + cef_delete_cookies_callback_t> { public: CefDeleteCookiesCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc index 0f6e98f01..e8c16f85c 100644 --- a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc @@ -9,19 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=60cf4242abcc2491bbff94d76da6c1683eae7821$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h" #include "libcef_dll/ctocpp/dialog_handler_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. -bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, - FileDialogMode mode, const CefString& title, +bool CefDialogHandlerCToCpp::OnFileDialog( + CefRefPtr browser, + FileDialogMode mode, + const CefString& title, const CefString& default_file_path, - const std::vector& accept_filters, int selected_accept_filter, + const std::vector& accept_filters, + int selected_accept_filter, CefRefPtr callback) { cef_dialog_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_file_dialog)) @@ -50,13 +54,9 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, transfer_string_list_contents(accept_filters, accept_filtersList); // Execute - int _retval = _struct->on_file_dialog(_struct, - CefBrowserCppToC::Wrap(browser), - mode, - title.GetStruct(), - default_file_path.GetStruct(), - accept_filtersList, - selected_accept_filter, + int _retval = _struct->on_file_dialog( + _struct, CefBrowserCppToC::Wrap(browser), mode, title.GetStruct(), + default_file_path.GetStruct(), accept_filtersList, selected_accept_filter, CefFileDialogCallbackCppToC::Wrap(callback)); // Restore param:accept_filters; type: string_vec_byref_const @@ -64,26 +64,32 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, cef_string_list_free(accept_filtersList); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() { -} +CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {} -template<> cef_dialog_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefDialogHandler* c) { +template <> +cef_dialog_handler_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefDialogHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DIALOG_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DIALOG_HANDLER; diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.h b/libcef_dll/ctocpp/dialog_handler_ctocpp.h index 736d986ac..f47a6439c 100644 --- a/libcef_dll/ctocpp/dialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e9cdc18f83757017cf93965e8a0c5e7f3b9f7c46$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ @@ -19,23 +21,27 @@ #endif #include -#include "include/cef_dialog_handler.h" #include "include/capi/cef_dialog_handler_capi.h" +#include "include/cef_dialog_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDialogHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefDialogHandlerCToCpp(); // CefDialogHandler methods. - bool OnFileDialog(CefRefPtr browser, FileDialogMode mode, - const CefString& title, const CefString& default_file_path, - const std::vector& accept_filters, int selected_accept_filter, - CefRefPtr callback) override; + bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc index ed824673c..2e294b1b8 100644 --- a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc +++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b88a478ed6bd8ba50348a76691f4c36994bca20e$ +// #include "libcef_dll/ctocpp/binary_value_ctocpp.h" #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" @@ -16,7 +18,6 @@ #include "libcef_dll/ctocpp/value_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefDictionaryValue::Create() { @@ -29,7 +30,6 @@ CefRefPtr CefDictionaryValue::Create() { return CefDictionaryValueCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefDictionaryValueCToCpp::IsValid() { @@ -43,7 +43,7 @@ bool CefDictionaryValueCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::IsOwned() { @@ -57,7 +57,7 @@ bool CefDictionaryValueCToCpp::IsOwned() { int _retval = _struct->is_owned(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::IsReadOnly() { @@ -71,7 +71,7 @@ bool CefDictionaryValueCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::IsSame(CefRefPtr that) { @@ -87,11 +87,11 @@ bool CefDictionaryValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefDictionaryValueCToCpp::Unwrap(that)); + int _retval = + _struct->is_same(_struct, CefDictionaryValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr that) { @@ -107,11 +107,11 @@ bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_equal(_struct, - CefDictionaryValueCToCpp::Unwrap(that)); + int _retval = + _struct->is_equal(_struct, CefDictionaryValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefDictionaryValueCToCpp::Copy( @@ -123,8 +123,8 @@ CefRefPtr CefDictionaryValueCToCpp::Copy( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dictionary_value_t* _retval = _struct->copy(_struct, - exclude_empty_children); + cef_dictionary_value_t* _retval = + _struct->copy(_struct, exclude_empty_children); // Return type: refptr_same return CefDictionaryValueCToCpp::Wrap(_retval); @@ -155,7 +155,7 @@ bool CefDictionaryValueCToCpp::Clear() { int _retval = _struct->clear(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { @@ -171,11 +171,10 @@ bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { return false; // Execute - int _retval = _struct->has_key(_struct, - key.GetStruct()); + int _retval = _struct->has_key(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { @@ -192,8 +191,7 @@ bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { transfer_string_list_contents(keys, keysList); // Execute - int _retval = _struct->get_keys(_struct, - keysList); + int _retval = _struct->get_keys(_struct, keysList); // Restore param:keys; type: string_vec_byref if (keysList) { @@ -203,7 +201,7 @@ bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::Remove(const CefString& key) { @@ -219,11 +217,10 @@ bool CefDictionaryValueCToCpp::Remove(const CefString& key) { return false; // Execute - int _retval = _struct->remove(_struct, - key.GetStruct()); + int _retval = _struct->remove(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { @@ -239,8 +236,7 @@ CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { return VTYPE_INVALID; // Execute - cef_value_type_t _retval = _struct->get_type(_struct, - key.GetStruct()); + cef_value_type_t _retval = _struct->get_type(_struct, key.GetStruct()); // Return type: simple return _retval; @@ -259,8 +255,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetValue(const CefString& key) { return NULL; // Execute - cef_value_t* _retval = _struct->get_value(_struct, - key.GetStruct()); + cef_value_t* _retval = _struct->get_value(_struct, key.GetStruct()); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); @@ -279,11 +274,10 @@ bool CefDictionaryValueCToCpp::GetBool(const CefString& key) { return false; // Execute - int _retval = _struct->get_bool(_struct, - key.GetStruct()); + int _retval = _struct->get_bool(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefDictionaryValueCToCpp::GetInt(const CefString& key) { @@ -299,8 +293,7 @@ int CefDictionaryValueCToCpp::GetInt(const CefString& key) { return 0; // Execute - int _retval = _struct->get_int(_struct, - key.GetStruct()); + int _retval = _struct->get_int(_struct, key.GetStruct()); // Return type: simple return _retval; @@ -319,8 +312,7 @@ double CefDictionaryValueCToCpp::GetDouble(const CefString& key) { return 0; // Execute - double _retval = _struct->get_double(_struct, - key.GetStruct()); + double _retval = _struct->get_double(_struct, key.GetStruct()); // Return type: simple return _retval; @@ -339,8 +331,7 @@ CefString CefDictionaryValueCToCpp::GetString(const CefString& key) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_string(_struct, - key.GetStruct()); + cef_string_userfree_t _retval = _struct->get_string(_struct, key.GetStruct()); // Return type: string CefString _retvalStr; @@ -362,8 +353,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetBinary( return NULL; // Execute - cef_binary_value_t* _retval = _struct->get_binary(_struct, - key.GetStruct()); + cef_binary_value_t* _retval = _struct->get_binary(_struct, key.GetStruct()); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); @@ -383,8 +373,8 @@ CefRefPtr CefDictionaryValueCToCpp::GetDictionary( return NULL; // Execute - cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct, - key.GetStruct()); + cef_dictionary_value_t* _retval = + _struct->get_dictionary(_struct, key.GetStruct()); // Return type: refptr_same return CefDictionaryValueCToCpp::Wrap(_retval); @@ -404,15 +394,14 @@ CefRefPtr CefDictionaryValueCToCpp::GetList( return NULL; // Execute - cef_list_value_t* _retval = _struct->get_list(_struct, - key.GetStruct()); + cef_list_value_t* _retval = _struct->get_list(_struct, key.GetStruct()); // Return type: refptr_same return CefListValueCToCpp::Wrap(_retval); } bool CefDictionaryValueCToCpp::SetValue(const CefString& key, - CefRefPtr value) { + CefRefPtr value) { cef_dictionary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_value)) return false; @@ -429,12 +418,11 @@ bool CefDictionaryValueCToCpp::SetValue(const CefString& key, return false; // Execute - int _retval = _struct->set_value(_struct, - key.GetStruct(), - CefValueCToCpp::Unwrap(value)); + int _retval = _struct->set_value(_struct, key.GetStruct(), + CefValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { @@ -450,11 +438,10 @@ bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { return false; // Execute - int _retval = _struct->set_null(_struct, - key.GetStruct()); + int _retval = _struct->set_null(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { @@ -470,12 +457,10 @@ bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { return false; // Execute - int _retval = _struct->set_bool(_struct, - key.GetStruct(), - value); + int _retval = _struct->set_bool(_struct, key.GetStruct(), value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { @@ -491,12 +476,10 @@ bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { return false; // Execute - int _retval = _struct->set_int(_struct, - key.GetStruct(), - value); + int _retval = _struct->set_int(_struct, key.GetStruct(), value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { @@ -512,16 +495,14 @@ bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { return false; // Execute - int _retval = _struct->set_double(_struct, - key.GetStruct(), - value); + int _retval = _struct->set_double(_struct, key.GetStruct(), value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetString(const CefString& key, - const CefString& value) { + const CefString& value) { cef_dictionary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string)) return false; @@ -535,16 +516,15 @@ bool CefDictionaryValueCToCpp::SetString(const CefString& key, // Unverified params: value // Execute - int _retval = _struct->set_string(_struct, - key.GetStruct(), - value.GetStruct()); + int _retval = + _struct->set_string(_struct, key.GetStruct(), value.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, - CefRefPtr value) { + CefRefPtr value) { cef_dictionary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_binary)) return false; @@ -561,15 +541,15 @@ bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, return false; // Execute - int _retval = _struct->set_binary(_struct, - key.GetStruct(), - CefBinaryValueCToCpp::Unwrap(value)); + int _retval = _struct->set_binary(_struct, key.GetStruct(), + CefBinaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, +bool CefDictionaryValueCToCpp::SetDictionary( + const CefString& key, CefRefPtr value) { cef_dictionary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_dictionary)) @@ -587,16 +567,15 @@ bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, return false; // Execute - int _retval = _struct->set_dictionary(_struct, - key.GetStruct(), - CefDictionaryValueCToCpp::Unwrap(value)); + int _retval = _struct->set_dictionary( + _struct, key.GetStruct(), CefDictionaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDictionaryValueCToCpp::SetList(const CefString& key, - CefRefPtr value) { + CefRefPtr value) { cef_dictionary_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_list)) return false; @@ -613,32 +592,37 @@ bool CefDictionaryValueCToCpp::SetList(const CefString& key, return false; // Execute - int _retval = _struct->set_list(_struct, - key.GetStruct(), - CefListValueCToCpp::Unwrap(value)); + int _retval = _struct->set_list(_struct, key.GetStruct(), + CefListValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefDictionaryValueCToCpp::CefDictionaryValueCToCpp() { -} +CefDictionaryValueCToCpp::CefDictionaryValueCToCpp() {} -template<> cef_dictionary_value_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDictionaryValue* c) { +template <> +cef_dictionary_value_t* CefCToCppRefCounted< + CefDictionaryValueCToCpp, + CefDictionaryValue, + cef_dictionary_value_t>::UnwrapDerived(CefWrapperType type, + CefDictionaryValue* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DICTIONARY_VALUE; diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.h b/libcef_dll/ctocpp/dictionary_value_ctocpp.h index 2a18865ea..929a16b26 100644 --- a/libcef_dll/ctocpp/dictionary_value_ctocpp.h +++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=81bfcc253678bc246a83d077a2cf3509958c86ad$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDictionaryValueCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefDictionaryValueCToCpp(); @@ -58,9 +61,9 @@ class CefDictionaryValueCToCpp bool SetDouble(const CefString& key, double value) OVERRIDE; bool SetString(const CefString& key, const CefString& value) OVERRIDE; bool SetBinary(const CefString& key, - CefRefPtr value) OVERRIDE; + CefRefPtr value) OVERRIDE; bool SetDictionary(const CefString& key, - CefRefPtr value) OVERRIDE; + CefRefPtr value) OVERRIDE; bool SetList(const CefString& key, CefRefPtr value) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index 564b38713..18eafa1ff 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6ca2f1e0e45645a486603e812aeaffa2de275268$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" #include "libcef_dll/ctocpp/display_handler_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, - CefRefPtr frame, const CefString& url) { + CefRefPtr frame, + const CefString& url) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_address_change)) return; @@ -40,14 +42,12 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, return; // Execute - _struct->on_address_change(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - url.GetStruct()); + _struct->on_address_change(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), url.GetStruct()); } void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, - const CefString& title) { + const CefString& title) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_title_change)) return; @@ -61,12 +61,12 @@ void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, // Unverified params: title // Execute - _struct->on_title_change(_struct, - CefBrowserCppToC::Wrap(browser), - title.GetStruct()); + _struct->on_title_change(_struct, CefBrowserCppToC::Wrap(browser), + title.GetStruct()); } -void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, +void CefDisplayHandlerCToCpp::OnFaviconURLChange( + CefRefPtr browser, const std::vector& icon_urls) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_favicon_urlchange)) @@ -87,9 +87,8 @@ void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, transfer_string_list_contents(icon_urls, icon_urlsList); // Execute - _struct->on_favicon_urlchange(_struct, - CefBrowserCppToC::Wrap(browser), - icon_urlsList); + _struct->on_favicon_urlchange(_struct, CefBrowserCppToC::Wrap(browser), + icon_urlsList); // Restore param:icon_urls; type: string_vec_byref_const if (icon_urlsList) @@ -97,7 +96,8 @@ void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, } void CefDisplayHandlerCToCpp::OnFullscreenModeChange( - CefRefPtr browser, bool fullscreen) { + CefRefPtr browser, + bool fullscreen) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_fullscreen_mode_change)) return; @@ -110,13 +110,12 @@ void CefDisplayHandlerCToCpp::OnFullscreenModeChange( return; // Execute - _struct->on_fullscreen_mode_change(_struct, - CefBrowserCppToC::Wrap(browser), - fullscreen); + _struct->on_fullscreen_mode_change(_struct, CefBrowserCppToC::Wrap(browser), + fullscreen); } bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, - CefString& text) { + CefString& text) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_tooltip)) return false; @@ -130,16 +129,15 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, // Unverified params: text // Execute - int _retval = _struct->on_tooltip(_struct, - CefBrowserCppToC::Wrap(browser), - text.GetWritableStruct()); + int _retval = _struct->on_tooltip(_struct, CefBrowserCppToC::Wrap(browser), + text.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, - const CefString& value) { + const CefString& value) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_status_message)) return; @@ -153,13 +151,14 @@ void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, // Unverified params: value // Execute - _struct->on_status_message(_struct, - CefBrowserCppToC::Wrap(browser), - value.GetStruct()); + _struct->on_status_message(_struct, CefBrowserCppToC::Wrap(browser), + value.GetStruct()); } bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, - const CefString& message, const CefString& source, int line) { + const CefString& message, + const CefString& source, + int line) { cef_display_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_console_message)) return false; @@ -173,34 +172,37 @@ bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, // Unverified params: message, source // Execute - int _retval = _struct->on_console_message(_struct, - CefBrowserCppToC::Wrap(browser), - message.GetStruct(), - source.GetStruct(), - line); + int _retval = _struct->on_console_message( + _struct, CefBrowserCppToC::Wrap(browser), message.GetStruct(), + source.GetStruct(), line); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() { -} +CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() {} -template<> cef_display_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDisplayHandler* c) { +template <> +cef_display_handler_t* CefCToCppRefCounted< + CefDisplayHandlerCToCpp, + CefDisplayHandler, + cef_display_handler_t>::UnwrapDerived(CefWrapperType type, + CefDisplayHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DISPLAY_HANDLER; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index 4cf0ebd4f..ab880f09a 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=309e3816e3daba60c7809230fdecb59d01e41847$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ @@ -19,32 +21,36 @@ #endif #include -#include "include/cef_display_handler.h" #include "include/capi/cef_display_handler_capi.h" +#include "include/cef_display_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDisplayHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefDisplayHandlerCToCpp(); // CefDisplayHandler methods. - void OnAddressChange(CefRefPtr browser, CefRefPtr frame, - const CefString& url) override; + void OnAddressChange(CefRefPtr browser, + CefRefPtr frame, + const CefString& url) override; void OnTitleChange(CefRefPtr browser, - const CefString& title) override; + const CefString& title) override; void OnFaviconURLChange(CefRefPtr browser, - const std::vector& icon_urls) override; + const std::vector& icon_urls) override; void OnFullscreenModeChange(CefRefPtr browser, - bool fullscreen) override; + bool fullscreen) override; bool OnTooltip(CefRefPtr browser, CefString& text) override; void OnStatusMessage(CefRefPtr browser, - const CefString& value) override; - bool OnConsoleMessage(CefRefPtr browser, const CefString& message, - const CefString& source, int line) override; + const CefString& value) override; + bool OnConsoleMessage(CefRefPtr browser, + const CefString& message, + const CefString& source, + int line) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc index a3fca4c3f..55c0e806a 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.cc +++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8f474a766fbe4a540f7d11ba76775b8de495e774$ +// #include "libcef_dll/ctocpp/domdocument_ctocpp.h" #include "libcef_dll/ctocpp/domnode_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() { @@ -102,8 +103,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetElementById( return NULL; // Execute - cef_domnode_t* _retval = _struct->get_element_by_id(_struct, - id.GetStruct()); + cef_domnode_t* _retval = _struct->get_element_by_id(_struct, id.GetStruct()); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); @@ -134,7 +134,7 @@ bool CefDOMDocumentCToCpp::HasSelection() { int _retval = _struct->has_selection(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefDOMDocumentCToCpp::GetSelectionStartOffset() { @@ -226,8 +226,8 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_complete_url(_struct, - partialURL.GetStruct()); + cef_string_userfree_t _retval = + _struct->get_complete_url(_struct, partialURL.GetStruct()); // Return type: string CefString _retvalStr; @@ -235,23 +235,27 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { return _retvalStr; } - // CONSTRUCTOR - Do not edit by hand. -CefDOMDocumentCToCpp::CefDOMDocumentCToCpp() { -} +CefDOMDocumentCToCpp::CefDOMDocumentCToCpp() {} -template<> cef_domdocument_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefDOMDocument* c) { +template <> +cef_domdocument_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefDOMDocument* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMDOCUMENT; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DOMDOCUMENT; diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h index 1b6597927..512572c0f 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.h +++ b/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e7de3098bdeed346bb0f4616b998eda5b2a341e9$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefDOMDocumentCToCpp - : public CefCToCppRefCounted { +class CefDOMDocumentCToCpp : public CefCToCppRefCounted { public: CefDOMDocumentCToCpp(); diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc index 548d1e4fe..5076c1710 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.cc +++ b/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c383834c864fc6235749c096939144303ea23af1$ +// #include "libcef_dll/ctocpp/domdocument_ctocpp.h" #include "libcef_dll/ctocpp/domnode_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. CefDOMNode::Type CefDOMNodeCToCpp::GetType() { @@ -42,7 +43,7 @@ bool CefDOMNodeCToCpp::IsText() { int _retval = _struct->is_text(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDOMNodeCToCpp::IsElement() { @@ -56,7 +57,7 @@ bool CefDOMNodeCToCpp::IsElement() { int _retval = _struct->is_element(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDOMNodeCToCpp::IsEditable() { @@ -70,7 +71,7 @@ bool CefDOMNodeCToCpp::IsEditable() { int _retval = _struct->is_editable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDOMNodeCToCpp::IsFormControlElement() { @@ -84,7 +85,7 @@ bool CefDOMNodeCToCpp::IsFormControlElement() { int _retval = _struct->is_form_control_element(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDOMNodeCToCpp::GetFormControlElementType() { @@ -95,8 +96,8 @@ CefString CefDOMNodeCToCpp::GetFormControlElementType() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_form_control_element_type( - _struct); + cef_string_userfree_t _retval = + _struct->get_form_control_element_type(_struct); // Return type: string CefString _retvalStr; @@ -117,11 +118,10 @@ bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefDOMNodeCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefDOMNodeCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDOMNodeCToCpp::GetName() { @@ -169,11 +169,10 @@ bool CefDOMNodeCToCpp::SetValue(const CefString& value) { return false; // Execute - int _retval = _struct->set_value(_struct, - value.GetStruct()); + int _retval = _struct->set_value(_struct, value.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDOMNodeCToCpp::GetAsMarkup() { @@ -259,7 +258,7 @@ bool CefDOMNodeCToCpp::HasChildren() { int _retval = _struct->has_children(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { @@ -317,7 +316,7 @@ bool CefDOMNodeCToCpp::HasElementAttributes() { int _retval = _struct->has_element_attributes(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { @@ -333,11 +332,10 @@ bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { return false; // Execute - int _retval = _struct->has_element_attribute(_struct, - attrName.GetStruct()); + int _retval = _struct->has_element_attribute(_struct, attrName.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { @@ -353,8 +351,8 @@ CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_element_attribute(_struct, - attrName.GetStruct()); + cef_string_userfree_t _retval = + _struct->get_element_attribute(_struct, attrName.GetStruct()); // Return type: string CefString _retvalStr; @@ -376,8 +374,7 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { transfer_string_map_contents(attrMap, attrMapMap); // Execute - _struct->get_element_attributes(_struct, - attrMapMap); + _struct->get_element_attributes(_struct, attrMapMap); // Restore param:attrMap; type: string_map_single_byref if (attrMapMap) { @@ -388,7 +385,7 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { } bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, - const CefString& value) { + const CefString& value) { cef_domnode_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_element_attribute)) return false; @@ -405,12 +402,11 @@ bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, return false; // Execute - int _retval = _struct->set_element_attribute(_struct, - attrName.GetStruct(), - value.GetStruct()); + int _retval = _struct->set_element_attribute(_struct, attrName.GetStruct(), + value.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDOMNodeCToCpp::GetElementInnerText() { @@ -443,22 +439,27 @@ CefRect CefDOMNodeCToCpp::GetElementBounds() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefDOMNodeCToCpp::CefDOMNodeCToCpp() { -} +CefDOMNodeCToCpp::CefDOMNodeCToCpp() {} -template<> cef_domnode_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDOMNode* c) { +template <> +cef_domnode_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefDOMNode* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMNODE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMNODE; diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h index a6d751073..1250958ee 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.h +++ b/libcef_dll/ctocpp/domnode_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=517c8bf7f36b294cbbcb0a52dcc9b1d1922986ce$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -54,7 +56,7 @@ class CefDOMNodeCToCpp CefString GetElementAttribute(const CefString& attrName) OVERRIDE; void GetElementAttributes(AttributeMap& attrMap) OVERRIDE; bool SetElementAttribute(const CefString& attrName, - const CefString& value) OVERRIDE; + const CefString& value) OVERRIDE; CefString GetElementInnerText() OVERRIDE; CefRect GetElementBounds() OVERRIDE; }; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc index 08bef8a89..0fcbcae12 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b3f68b08525a2336833f6449763044ad22788e39$ +// #include "libcef_dll/cpptoc/domdocument_cpptoc.h" #include "libcef_dll/ctocpp/domvisitor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { @@ -29,27 +30,30 @@ void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { return; // Execute - _struct->visit(_struct, - CefDOMDocumentCppToC::Wrap(document)); + _struct->visit(_struct, CefDOMDocumentCppToC::Wrap(document)); } - // CONSTRUCTOR - Do not edit by hand. -CefDOMVisitorCToCpp::CefDOMVisitorCToCpp() { -} +CefDOMVisitorCToCpp::CefDOMVisitorCToCpp() {} -template<> cef_domvisitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefDOMVisitor* c) { +template <> +cef_domvisitor_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefDOMVisitor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMVISITOR; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DOMVISITOR; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h index 2eca8aba6..7f59c1893 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.h +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c4f9b419f68b4df50929a757a6978c9c990b54fd$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" +#include "include/cef_dom.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefDOMVisitorCToCpp - : public CefCToCppRefCounted { +class CefDOMVisitorCToCpp : public CefCToCppRefCounted { public: CefDOMVisitorCToCpp(); diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc index bf19f2535..7d76a193f 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc @@ -9,18 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b2141197beb4b7a706c82c5dffbfe5338667d2a2$ +// #include "libcef_dll/cpptoc/before_download_callback_cpptoc.h" #include "libcef_dll/cpptoc/browser_cpptoc.h" -#include "libcef_dll/cpptoc/download_item_cpptoc.h" #include "libcef_dll/cpptoc/download_item_callback_cpptoc.h" +#include "libcef_dll/cpptoc/download_item_cpptoc.h" #include "libcef_dll/ctocpp/download_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -void CefDownloadHandlerCToCpp::OnBeforeDownload(CefRefPtr browser, - CefRefPtr download_item, const CefString& suggested_name, +void CefDownloadHandlerCToCpp::OnBeforeDownload( + CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, CefRefPtr callback) { cef_download_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_download)) @@ -46,14 +49,14 @@ void CefDownloadHandlerCToCpp::OnBeforeDownload(CefRefPtr browser, return; // Execute - _struct->on_before_download(_struct, - CefBrowserCppToC::Wrap(browser), - CefDownloadItemCppToC::Wrap(download_item), - suggested_name.GetStruct(), - CefBeforeDownloadCallbackCppToC::Wrap(callback)); + _struct->on_before_download(_struct, CefBrowserCppToC::Wrap(browser), + CefDownloadItemCppToC::Wrap(download_item), + suggested_name.GetStruct(), + CefBeforeDownloadCallbackCppToC::Wrap(callback)); } -void CefDownloadHandlerCToCpp::OnDownloadUpdated(CefRefPtr browser, +void CefDownloadHandlerCToCpp::OnDownloadUpdated( + CefRefPtr browser, CefRefPtr download_item, CefRefPtr callback) { cef_download_handler_t* _struct = GetStruct(); @@ -76,30 +79,35 @@ void CefDownloadHandlerCToCpp::OnDownloadUpdated(CefRefPtr browser, return; // Execute - _struct->on_download_updated(_struct, - CefBrowserCppToC::Wrap(browser), - CefDownloadItemCppToC::Wrap(download_item), - CefDownloadItemCallbackCppToC::Wrap(callback)); + _struct->on_download_updated(_struct, CefBrowserCppToC::Wrap(browser), + CefDownloadItemCppToC::Wrap(download_item), + CefDownloadItemCallbackCppToC::Wrap(callback)); } - // CONSTRUCTOR - Do not edit by hand. -CefDownloadHandlerCToCpp::CefDownloadHandlerCToCpp() { -} +CefDownloadHandlerCToCpp::CefDownloadHandlerCToCpp() {} -template<> cef_download_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDownloadHandler* c) { +template <> +cef_download_handler_t* CefCToCppRefCounted< + CefDownloadHandlerCToCpp, + CefDownloadHandler, + cef_download_handler_t>::UnwrapDerived(CefWrapperType type, + CefDownloadHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOWNLOAD_HANDLER; diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h index d4bebeaa3..6e800bd01 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.h +++ b/libcef_dll/ctocpp/download_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=45e2e44008510cb55383cc4a206813265d3b8432$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ @@ -18,26 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDownloadHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefDownloadHandlerCToCpp(); // CefDownloadHandler methods. void OnBeforeDownload(CefRefPtr browser, - CefRefPtr download_item, - const CefString& suggested_name, - CefRefPtr callback) override; + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) override; void OnDownloadUpdated(CefRefPtr browser, - CefRefPtr download_item, - CefRefPtr callback) override; + CefRefPtr download_item, + CefRefPtr callback) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/download_image_callback_ctocpp.cc b/libcef_dll/ctocpp/download_image_callback_ctocpp.cc index 33e486b65..758f7633f 100644 --- a/libcef_dll/ctocpp/download_image_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/download_image_callback_ctocpp.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=65f2da73259d7f1847c8b4cdfbd8c7298469fa5c$ +// #include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/ctocpp/download_image_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefDownloadImageCallbackCToCpp::OnDownloadImageFinished( - const CefString& image_url, int http_status_code, + const CefString& image_url, + int http_status_code, CefRefPtr image) { cef_download_image_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_download_image_finished)) @@ -32,30 +34,36 @@ void CefDownloadImageCallbackCToCpp::OnDownloadImageFinished( // Unverified params: image // Execute - _struct->on_download_image_finished(_struct, - image_url.GetStruct(), - http_status_code, - CefImageCppToC::Wrap(image)); + _struct->on_download_image_finished(_struct, image_url.GetStruct(), + http_status_code, + CefImageCppToC::Wrap(image)); } - // CONSTRUCTOR - Do not edit by hand. -CefDownloadImageCallbackCToCpp::CefDownloadImageCallbackCToCpp() { -} +CefDownloadImageCallbackCToCpp::CefDownloadImageCallbackCToCpp() {} -template<> cef_download_image_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDownloadImageCallback* c) { +template <> +cef_download_image_callback_t* CefCToCppRefCounted< + CefDownloadImageCallbackCToCpp, + CefDownloadImageCallback, + cef_download_image_callback_t>::UnwrapDerived(CefWrapperType type, + CefDownloadImageCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_DOWNLOAD_IMAGE_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_DOWNLOAD_IMAGE_CALLBACK; diff --git a/libcef_dll/ctocpp/download_image_callback_ctocpp.h b/libcef_dll/ctocpp/download_image_callback_ctocpp.h index 2a63ab698..a9e9652d2 100644 --- a/libcef_dll/ctocpp/download_image_callback_ctocpp.h +++ b/libcef_dll/ctocpp/download_image_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b7a0a41bf55f4d22f65f8d067df1dc854288a2b5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_IMAGE_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_IMAGE_CALLBACK_CTOCPP_H_ @@ -18,23 +20,25 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDownloadImageCallbackCToCpp : public CefCToCppRefCounted { + CefDownloadImageCallback, + cef_download_image_callback_t> { public: CefDownloadImageCallbackCToCpp(); // CefDownloadImageCallback methods. - void OnDownloadImageFinished(const CefString& image_url, int http_status_code, - CefRefPtr image) override; + void OnDownloadImageFinished(const CefString& image_url, + int http_status_code, + CefRefPtr image) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_IMAGE_CALLBACK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc index fa08ed51a..34bdae476 100644 --- a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d9215ae02910dd9116d40e31163cf7eea491012f$ +// #include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefDownloadItemCallbackCToCpp::Cancel() { @@ -48,24 +49,30 @@ void CefDownloadItemCallbackCToCpp::Resume() { _struct->resume(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefDownloadItemCallbackCToCpp::CefDownloadItemCallbackCToCpp() { -} +CefDownloadItemCallbackCToCpp::CefDownloadItemCallbackCToCpp() {} -template<> cef_download_item_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefDownloadItemCallback* c) { +template <> +cef_download_item_callback_t* CefCToCppRefCounted< + CefDownloadItemCallbackCToCpp, + CefDownloadItemCallback, + cef_download_item_callback_t>::UnwrapDerived(CefWrapperType type, + CefDownloadItemCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOWNLOAD_ITEM_CALLBACK; diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.h b/libcef_dll/ctocpp/download_item_callback_ctocpp.h index 494aca7ce..f7337f856 100644 --- a/libcef_dll/ctocpp/download_item_callback_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fdf7056c94c425adc95c2df102071702c395d1b5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" +#include "include/cef_download_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDownloadItemCallbackCToCpp : public CefCToCppRefCounted { + CefDownloadItemCallback, + cef_download_item_callback_t> { public: CefDownloadItemCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/download_item_ctocpp.cc b/libcef_dll/ctocpp/download_item_ctocpp.cc index 36d652e9a..ba15a8d17 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8d42b80fd9a45dc0d59127e1b72ec9900d5e1679$ +// #include "libcef_dll/ctocpp/download_item_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefDownloadItemCToCpp::IsValid() { @@ -26,7 +27,7 @@ bool CefDownloadItemCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDownloadItemCToCpp::IsInProgress() { @@ -40,7 +41,7 @@ bool CefDownloadItemCToCpp::IsInProgress() { int _retval = _struct->is_in_progress(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDownloadItemCToCpp::IsComplete() { @@ -54,7 +55,7 @@ bool CefDownloadItemCToCpp::IsComplete() { int _retval = _struct->is_complete(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDownloadItemCToCpp::IsCanceled() { @@ -68,7 +69,7 @@ bool CefDownloadItemCToCpp::IsCanceled() { int _retval = _struct->is_canceled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int64 CefDownloadItemCToCpp::GetCurrentSpeed() { @@ -265,23 +266,29 @@ CefString CefDownloadItemCToCpp::GetMimeType() { return _retvalStr; } - // CONSTRUCTOR - Do not edit by hand. -CefDownloadItemCToCpp::CefDownloadItemCToCpp() { -} +CefDownloadItemCToCpp::CefDownloadItemCToCpp() {} -template<> cef_download_item_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefDownloadItem* c) { +template <> +cef_download_item_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefDownloadItem* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOWNLOAD_ITEM; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DOWNLOAD_ITEM; diff --git a/libcef_dll/ctocpp/download_item_ctocpp.h b/libcef_dll/ctocpp/download_item_ctocpp.h index f0532796f..cb0d1fa83 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cbfee67d01164f3c2f132287633a3ef4110d56b7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_download_item.h" #include "include/capi/cef_download_item_capi.h" +#include "include/cef_download_item.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefDownloadItemCToCpp - : public CefCToCppRefCounted { +class CefDownloadItemCToCpp : public CefCToCppRefCounted { public: CefDownloadItemCToCpp(); diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc index e6714562c..7fe5a3068 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=543054b6b4e606ea5c571ca48d2108f8ed6674ab$ +// #include "libcef_dll/ctocpp/drag_data_ctocpp.h" #include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/stream_writer_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefDragData::Create() { @@ -28,7 +29,6 @@ CefRefPtr CefDragData::Create() { return CefDragDataCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefDragDataCToCpp::Clone() { @@ -56,7 +56,7 @@ bool CefDragDataCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDragDataCToCpp::IsLink() { @@ -70,7 +70,7 @@ bool CefDragDataCToCpp::IsLink() { int _retval = _struct->is_link(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDragDataCToCpp::IsFragment() { @@ -84,7 +84,7 @@ bool CefDragDataCToCpp::IsFragment() { int _retval = _struct->is_fragment(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefDragDataCToCpp::IsFile() { @@ -98,7 +98,7 @@ bool CefDragDataCToCpp::IsFile() { int _retval = _struct->is_file(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefDragDataCToCpp::GetLinkURL() { @@ -223,8 +223,8 @@ size_t CefDragDataCToCpp::GetFileContents(CefRefPtr writer) { // Unverified params: writer // Execute - size_t _retval = _struct->get_file_contents(_struct, - CefStreamWriterCToCpp::Unwrap(writer)); + size_t _retval = _struct->get_file_contents( + _struct, CefStreamWriterCToCpp::Unwrap(writer)); // Return type: simple return _retval; @@ -244,8 +244,7 @@ bool CefDragDataCToCpp::GetFileNames(std::vector& names) { transfer_string_list_contents(names, namesList); // Execute - int _retval = _struct->get_file_names(_struct, - namesList); + int _retval = _struct->get_file_names(_struct, namesList); // Restore param:names; type: string_vec_byref if (namesList) { @@ -255,7 +254,7 @@ bool CefDragDataCToCpp::GetFileNames(std::vector& names) { } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefDragDataCToCpp::SetLinkURL(const CefString& url) { @@ -268,8 +267,7 @@ void CefDragDataCToCpp::SetLinkURL(const CefString& url) { // Unverified params: url // Execute - _struct->set_link_url(_struct, - url.GetStruct()); + _struct->set_link_url(_struct, url.GetStruct()); } void CefDragDataCToCpp::SetLinkTitle(const CefString& title) { @@ -282,8 +280,7 @@ void CefDragDataCToCpp::SetLinkTitle(const CefString& title) { // Unverified params: title // Execute - _struct->set_link_title(_struct, - title.GetStruct()); + _struct->set_link_title(_struct, title.GetStruct()); } void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) { @@ -296,8 +293,7 @@ void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) { // Unverified params: data // Execute - _struct->set_link_metadata(_struct, - data.GetStruct()); + _struct->set_link_metadata(_struct, data.GetStruct()); } void CefDragDataCToCpp::SetFragmentText(const CefString& text) { @@ -310,8 +306,7 @@ void CefDragDataCToCpp::SetFragmentText(const CefString& text) { // Unverified params: text // Execute - _struct->set_fragment_text(_struct, - text.GetStruct()); + _struct->set_fragment_text(_struct, text.GetStruct()); } void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) { @@ -324,8 +319,7 @@ void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) { // Unverified params: html // Execute - _struct->set_fragment_html(_struct, - html.GetStruct()); + _struct->set_fragment_html(_struct, html.GetStruct()); } void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) { @@ -338,8 +332,7 @@ void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) { // Unverified params: base_url // Execute - _struct->set_fragment_base_url(_struct, - base_url.GetStruct()); + _struct->set_fragment_base_url(_struct, base_url.GetStruct()); } void CefDragDataCToCpp::ResetFileContents() { @@ -354,7 +347,7 @@ void CefDragDataCToCpp::ResetFileContents() { } void CefDragDataCToCpp::AddFile(const CefString& path, - const CefString& display_name) { + const CefString& display_name) { cef_drag_data_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_file)) return; @@ -368,9 +361,7 @@ void CefDragDataCToCpp::AddFile(const CefString& path, // Unverified params: display_name // Execute - _struct->add_file(_struct, - path.GetStruct(), - display_name.GetStruct()); + _struct->add_file(_struct, path.GetStruct(), display_name.GetStruct()); } CefRefPtr CefDragDataCToCpp::GetImage() { @@ -412,25 +403,30 @@ bool CefDragDataCToCpp::HasImage() { int _retval = _struct->has_image(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefDragDataCToCpp::CefDragDataCToCpp() { -} +CefDragDataCToCpp::CefDragDataCToCpp() {} -template<> cef_drag_data_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDragData* c) { +template <> +cef_drag_data_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefDragData* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DRAG_DATA; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DRAG_DATA; diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h index 202623881..3c1ff5b64 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.h +++ b/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f773bb5e319e3a5fa70227e7ca265a43cda1ee3b$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ @@ -19,15 +21,15 @@ #endif #include -#include "include/cef_drag_data.h" #include "include/capi/cef_drag_data_capi.h" +#include "include/cef_drag_data.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefDragDataCToCpp - : public CefCToCppRefCounted { +class CefDragDataCToCpp : public CefCToCppRefCounted { public: CefDragDataCToCpp(); diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc index 0e73683d1..491746366 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=229f4f18649cbee1661cf3f9c6b25fc5410c2acc$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/drag_data_cpptoc.h" #include "libcef_dll/ctocpp/drag_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, - CefRefPtr dragData, DragOperationsMask mask) { + CefRefPtr dragData, + DragOperationsMask mask) { cef_drag_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_drag_enter)) return false; @@ -35,13 +37,11 @@ bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_drag_enter(_struct, - CefBrowserCppToC::Wrap(browser), - CefDragDataCppToC::Wrap(dragData), - mask); + int _retval = _struct->on_drag_enter(_struct, CefBrowserCppToC::Wrap(browser), + CefDragDataCppToC::Wrap(dragData), mask); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefDragHandlerCToCpp::OnDraggableRegionsChanged( @@ -72,33 +72,35 @@ void CefDragHandlerCToCpp::OnDraggableRegionsChanged( } // Execute - _struct->on_draggable_regions_changed(_struct, - CefBrowserCppToC::Wrap(browser), - regionsCount, - regionsList); + _struct->on_draggable_regions_changed( + _struct, CefBrowserCppToC::Wrap(browser), regionsCount, regionsList); // Restore param:regions; type: simple_vec_byref_const if (regionsList) - delete [] regionsList; + delete[] regionsList; } - // CONSTRUCTOR - Do not edit by hand. -CefDragHandlerCToCpp::CefDragHandlerCToCpp() { -} +CefDragHandlerCToCpp::CefDragHandlerCToCpp() {} -template<> cef_drag_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefDragHandler* c) { +template <> +cef_drag_handler_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefDragHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DRAG_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_DRAG_HANDLER; diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h index bdec3ed58..987500b02 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.h +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a8fc4eaf03379541cdbcf337a97f258abe76a057$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ @@ -19,22 +21,24 @@ #endif #include -#include "include/cef_drag_handler.h" #include "include/capi/cef_drag_handler_capi.h" +#include "include/cef_drag_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefDragHandlerCToCpp - : public CefCToCppRefCounted { +class CefDragHandlerCToCpp : public CefCToCppRefCounted { public: CefDragHandlerCToCpp(); // CefDragHandler methods. bool OnDragEnter(CefRefPtr browser, - CefRefPtr dragData, DragOperationsMask mask) override; - void OnDraggableRegionsChanged(CefRefPtr browser, + CefRefPtr dragData, + DragOperationsMask mask) override; + void OnDraggableRegionsChanged( + CefRefPtr browser, const std::vector& regions) override; }; diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc index e9b40439f..6a8142174 100644 --- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a3c3922ab75506acb378690f3275e26cb834efba$ +// #include "libcef_dll/ctocpp/end_tracing_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefEndTracingCallbackCToCpp::OnEndTracingComplete( @@ -29,28 +30,33 @@ void CefEndTracingCallbackCToCpp::OnEndTracingComplete( return; // Execute - _struct->on_end_tracing_complete(_struct, - tracing_file.GetStruct()); + _struct->on_end_tracing_complete(_struct, tracing_file.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefEndTracingCallbackCToCpp::CefEndTracingCallbackCToCpp() { -} +CefEndTracingCallbackCToCpp::CefEndTracingCallbackCToCpp() {} -template<> cef_end_tracing_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefEndTracingCallback* c) { +template <> +cef_end_tracing_callback_t* CefCToCppRefCounted< + CefEndTracingCallbackCToCpp, + CefEndTracingCallback, + cef_end_tracing_callback_t>::UnwrapDerived(CefWrapperType type, + CefEndTracingCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_END_TRACING_CALLBACK; diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h index d3a89b8bb..185fcea9c 100644 --- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h +++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a3c8b4724fb0e6d53f31573d6f7dafa61f199527$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_END_TRACING_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_END_TRACING_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_trace.h" #include "include/capi/cef_trace_capi.h" +#include "include/cef_trace.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefEndTracingCallbackCToCpp : public CefCToCppRefCounted { + CefEndTracingCallback, + cef_end_tracing_callback_t> { public: CefEndTracingCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc index 783fd9ed8..cf7f2f10c 100644 --- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc @@ -9,14 +9,16 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ce458b428e608a21d3a8ddfb71083edade3cb133$ +// #include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. -void CefFileDialogCallbackCToCpp::Continue(int selected_accept_filter, +void CefFileDialogCallbackCToCpp::Continue( + int selected_accept_filter, const std::vector& file_paths) { cef_file_dialog_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, cont)) @@ -37,9 +39,7 @@ void CefFileDialogCallbackCToCpp::Continue(int selected_accept_filter, transfer_string_list_contents(file_paths, file_pathsList); // Execute - _struct->cont(_struct, - selected_accept_filter, - file_pathsList); + _struct->cont(_struct, selected_accept_filter, file_pathsList); // Restore param:file_paths; type: string_vec_byref_const if (file_pathsList) @@ -57,24 +57,30 @@ void CefFileDialogCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefFileDialogCallbackCToCpp::CefFileDialogCallbackCToCpp() { -} +CefFileDialogCallbackCToCpp::CefFileDialogCallbackCToCpp() {} -template<> cef_file_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefFileDialogCallback* c) { +template <> +cef_file_dialog_callback_t* CefCToCppRefCounted< + CefFileDialogCallbackCToCpp, + CefFileDialogCallback, + cef_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type, + CefFileDialogCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h index d7308336d..a05fbd97a 100644 --- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=632048196763d43a1fa32f7b85757d4db0635212$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ @@ -19,21 +21,22 @@ #endif #include -#include "include/cef_dialog_handler.h" #include "include/capi/cef_dialog_handler_capi.h" +#include "include/cef_dialog_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefFileDialogCallbackCToCpp : public CefCToCppRefCounted { + CefFileDialogCallback, + cef_file_dialog_callback_t> { public: CefFileDialogCallbackCToCpp(); // CefFileDialogCallback methods. void Continue(int selected_accept_filter, - const std::vector& file_paths) OVERRIDE; + const std::vector& file_paths) OVERRIDE; void Cancel() OVERRIDE; }; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc index d6fdf1058..f66e3b9fa 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc @@ -9,16 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d881d2602682ff4510ff88f297aea7b2420f9499$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/ctocpp/find_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, - int identifier, int count, const CefRect& selectionRect, - int activeMatchOrdinal, bool finalUpdate) { + int identifier, + int count, + const CefRect& selectionRect, + int activeMatchOrdinal, + bool finalUpdate) { cef_find_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_find_result)) return; @@ -31,32 +35,32 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, return; // Execute - _struct->on_find_result(_struct, - CefBrowserCppToC::Wrap(browser), - identifier, - count, - &selectionRect, - activeMatchOrdinal, - finalUpdate); + _struct->on_find_result(_struct, CefBrowserCppToC::Wrap(browser), identifier, + count, &selectionRect, activeMatchOrdinal, + finalUpdate); } - // CONSTRUCTOR - Do not edit by hand. -CefFindHandlerCToCpp::CefFindHandlerCToCpp() { -} +CefFindHandlerCToCpp::CefFindHandlerCToCpp() {} -template<> cef_find_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefFindHandler* c) { +template <> +cef_find_handler_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefFindHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FIND_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_FIND_HANDLER; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h index 2216d97e4..2e551ca8e 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.h +++ b/libcef_dll/ctocpp/find_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9be34c8bb768977d5304f29565a2eb7451f596c4$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ @@ -18,22 +20,25 @@ #error This file can be included DLL-side only #endif -#include "include/cef_find_handler.h" #include "include/capi/cef_find_handler_capi.h" +#include "include/cef_find_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefFindHandlerCToCpp - : public CefCToCppRefCounted { +class CefFindHandlerCToCpp : public CefCToCppRefCounted { public: CefFindHandlerCToCpp(); // CefFindHandler methods. - void OnFindResult(CefRefPtr browser, int identifier, int count, - const CefRect& selectionRect, int activeMatchOrdinal, - bool finalUpdate) override; + void OnFindResult(CefRefPtr browser, + int identifier, + int count, + const CefRect& selectionRect, + int activeMatchOrdinal, + bool finalUpdate) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc index fad717146..2087d5d1e 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc @@ -9,15 +9,16 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9622ef1a85aabf6aa381b49f199db5473271b67a$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/ctocpp/focus_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, - bool next) { + bool next) { cef_focus_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_take_focus)) return; @@ -30,13 +31,11 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, return; // Execute - _struct->on_take_focus(_struct, - CefBrowserCppToC::Wrap(browser), - next); + _struct->on_take_focus(_struct, CefBrowserCppToC::Wrap(browser), next); } bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, - FocusSource source) { + FocusSource source) { cef_focus_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_set_focus)) return false; @@ -49,12 +48,11 @@ bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_set_focus(_struct, - CefBrowserCppToC::Wrap(browser), - source); + int _retval = + _struct->on_set_focus(_struct, CefBrowserCppToC::Wrap(browser), source); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr browser) { @@ -70,27 +68,32 @@ void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr browser) { return; // Execute - _struct->on_got_focus(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_got_focus(_struct, CefBrowserCppToC::Wrap(browser)); } - // CONSTRUCTOR - Do not edit by hand. -CefFocusHandlerCToCpp::CefFocusHandlerCToCpp() { -} +CefFocusHandlerCToCpp::CefFocusHandlerCToCpp() {} -template<> cef_focus_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefFocusHandler* c) { +template <> +cef_focus_handler_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefFocusHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FOCUS_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_FOCUS_HANDLER; diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h index 3c34330d4..62ae36779 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.h +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2a02bedc5844d6c50eed12da9506cb0f4c1d33b1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_focus_handler.h" #include "include/capi/cef_focus_handler_capi.h" +#include "include/cef_focus_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefFocusHandlerCToCpp - : public CefCToCppRefCounted { +class CefFocusHandlerCToCpp : public CefCToCppRefCounted { public: CefFocusHandlerCToCpp(); diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index 6ce68c456..d3380107b 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=41f0d92241ef955c0eb0a5a2ed0c3aafae0fb38b$ +// #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/v8context_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefFrameCToCpp::IsValid() { @@ -31,7 +32,7 @@ bool CefFrameCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefFrameCToCpp::Undo() { @@ -135,8 +136,7 @@ void CefFrameCToCpp::GetSource(CefRefPtr visitor) { return; // Execute - _struct->get_source(_struct, - CefStringVisitorCppToC::Wrap(visitor)); + _struct->get_source(_struct, CefStringVisitorCppToC::Wrap(visitor)); } void CefFrameCToCpp::GetText(CefRefPtr visitor) { @@ -152,8 +152,7 @@ void CefFrameCToCpp::GetText(CefRefPtr visitor) { return; // Execute - _struct->get_text(_struct, - CefStringVisitorCppToC::Wrap(visitor)); + _struct->get_text(_struct, CefStringVisitorCppToC::Wrap(visitor)); } void CefFrameCToCpp::LoadRequest(CefRefPtr request) { @@ -169,8 +168,7 @@ void CefFrameCToCpp::LoadRequest(CefRefPtr request) { return; // Execute - _struct->load_request(_struct, - CefRequestCToCpp::Unwrap(request)); + _struct->load_request(_struct, CefRequestCToCpp::Unwrap(request)); } void CefFrameCToCpp::LoadURL(const CefString& url) { @@ -186,12 +184,11 @@ void CefFrameCToCpp::LoadURL(const CefString& url) { return; // Execute - _struct->load_url(_struct, - url.GetStruct()); + _struct->load_url(_struct, url.GetStruct()); } void CefFrameCToCpp::LoadString(const CefString& string_val, - const CefString& url) { + const CefString& url) { cef_frame_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, load_string)) return; @@ -208,13 +205,12 @@ void CefFrameCToCpp::LoadString(const CefString& string_val, return; // Execute - _struct->load_string(_struct, - string_val.GetStruct(), - url.GetStruct()); + _struct->load_string(_struct, string_val.GetStruct(), url.GetStruct()); } void CefFrameCToCpp::ExecuteJavaScript(const CefString& code, - const CefString& script_url, int start_line) { + const CefString& script_url, + int start_line) { cef_frame_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, execute_java_script)) return; @@ -228,10 +224,8 @@ void CefFrameCToCpp::ExecuteJavaScript(const CefString& code, // Unverified params: script_url // Execute - _struct->execute_java_script(_struct, - code.GetStruct(), - script_url.GetStruct(), - start_line); + _struct->execute_java_script(_struct, code.GetStruct(), + script_url.GetStruct(), start_line); } bool CefFrameCToCpp::IsMain() { @@ -245,7 +239,7 @@ bool CefFrameCToCpp::IsMain() { int _retval = _struct->is_main(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefFrameCToCpp::IsFocused() { @@ -259,7 +253,7 @@ bool CefFrameCToCpp::IsFocused() { int _retval = _struct->is_focused(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefFrameCToCpp::GetName() { @@ -363,26 +357,29 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { return; // Execute - _struct->visit_dom(_struct, - CefDOMVisitorCppToC::Wrap(visitor)); + _struct->visit_dom(_struct, CefDOMVisitorCppToC::Wrap(visitor)); } - // CONSTRUCTOR - Do not edit by hand. -CefFrameCToCpp::CefFrameCToCpp() { -} +CefFrameCToCpp::CefFrameCToCpp() {} -template<> cef_frame_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefFrame* c) { +template <> +cef_frame_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefFrame* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FRAME; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_FRAME; diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index 0317ef104..bb58f78fa 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d2930fdc22bf9f6281d2bf797dd27f749b5e512a$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ @@ -18,12 +20,12 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_frame.h" -#include "include/capi/cef_frame_capi.h" -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_v8.h" +#include "include/capi/cef_frame_capi.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -48,8 +50,9 @@ class CefFrameCToCpp void LoadRequest(CefRefPtr request) OVERRIDE; void LoadURL(const CefString& url) OVERRIDE; void LoadString(const CefString& string_val, const CefString& url) OVERRIDE; - void ExecuteJavaScript(const CefString& code, const CefString& script_url, - int start_line) OVERRIDE; + void ExecuteJavaScript(const CefString& code, + const CefString& script_url, + int start_line) OVERRIDE; bool IsMain() OVERRIDE; bool IsFocused() OVERRIDE; CefString GetName() OVERRIDE; diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc index 4aee9b8a9..1653344b2 100644 --- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fad66d22e436870bec7d0d8fd41020aee409199a$ +// #include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefGeolocationCallbackCToCpp::Continue(bool allow) { @@ -23,28 +24,33 @@ void CefGeolocationCallbackCToCpp::Continue(bool allow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->cont(_struct, - allow); + _struct->cont(_struct, allow); } - // CONSTRUCTOR - Do not edit by hand. -CefGeolocationCallbackCToCpp::CefGeolocationCallbackCToCpp() { -} +CefGeolocationCallbackCToCpp::CefGeolocationCallbackCToCpp() {} -template<> cef_geolocation_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefGeolocationCallback* c) { +template <> +cef_geolocation_callback_t* CefCToCppRefCounted< + CefGeolocationCallbackCToCpp, + CefGeolocationCallback, + cef_geolocation_callback_t>::UnwrapDerived(CefWrapperType type, + CefGeolocationCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h index a5e666599..f9e920190 100644 --- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h +++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=00ff7074ec75771173550de78bb3a004023a1a60$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_geolocation_handler.h" #include "include/capi/cef_geolocation_handler_capi.h" +#include "include/cef_geolocation_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefGeolocationCallbackCToCpp : public CefCToCppRefCounted { + CefGeolocationCallback, + cef_geolocation_callback_t> { public: CefGeolocationCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc index 16bba0ef7..f20c3c3e0 100644 --- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc @@ -9,17 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e6b3335f4fa9f8f04ac24c5b66e49923ab7e6e5c$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/geolocation_callback_cpptoc.h" #include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefGeolocationHandlerCToCpp::OnRequestGeolocationPermission( - CefRefPtr browser, const CefString& requesting_url, - int request_id, CefRefPtr callback) { + CefRefPtr browser, + const CefString& requesting_url, + int request_id, + CefRefPtr callback) { cef_geolocation_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_request_geolocation_permission)) return false; @@ -40,18 +43,17 @@ bool CefGeolocationHandlerCToCpp::OnRequestGeolocationPermission( return false; // Execute - int _retval = _struct->on_request_geolocation_permission(_struct, - CefBrowserCppToC::Wrap(browser), - requesting_url.GetStruct(), - request_id, - CefGeolocationCallbackCppToC::Wrap(callback)); + int _retval = _struct->on_request_geolocation_permission( + _struct, CefBrowserCppToC::Wrap(browser), requesting_url.GetStruct(), + request_id, CefGeolocationCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefGeolocationHandlerCToCpp::OnCancelGeolocationPermission( - CefRefPtr browser, int request_id) { + CefRefPtr browser, + int request_id) { cef_geolocation_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_cancel_geolocation_permission)) return; @@ -64,29 +66,34 @@ void CefGeolocationHandlerCToCpp::OnCancelGeolocationPermission( return; // Execute - _struct->on_cancel_geolocation_permission(_struct, - CefBrowserCppToC::Wrap(browser), - request_id); + _struct->on_cancel_geolocation_permission( + _struct, CefBrowserCppToC::Wrap(browser), request_id); } - // CONSTRUCTOR - Do not edit by hand. -CefGeolocationHandlerCToCpp::CefGeolocationHandlerCToCpp() { -} +CefGeolocationHandlerCToCpp::CefGeolocationHandlerCToCpp() {} -template<> cef_geolocation_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefGeolocationHandler* c) { +template <> +cef_geolocation_handler_t* CefCToCppRefCounted< + CefGeolocationHandlerCToCpp, + CefGeolocationHandler, + cef_geolocation_handler_t>::UnwrapDerived(CefWrapperType type, + CefGeolocationHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_GEOLOCATION_HANDLER; diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h index 5cc2b9c72..79864065d 100644 --- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h +++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=726d31775862e2628f53ad4f37b667c249ab5eaa$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_HANDLER_CTOCPP_H_ @@ -18,24 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_geolocation_handler.h" #include "include/capi/cef_geolocation_handler_capi.h" +#include "include/cef_geolocation_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefGeolocationHandlerCToCpp : public CefCToCppRefCounted { + CefGeolocationHandler, + cef_geolocation_handler_t> { public: CefGeolocationHandlerCToCpp(); // CefGeolocationHandler methods. - bool OnRequestGeolocationPermission(CefRefPtr browser, - const CefString& requesting_url, int request_id, + bool OnRequestGeolocationPermission( + CefRefPtr browser, + const CefString& requesting_url, + int request_id, CefRefPtr callback) override; void OnCancelGeolocationPermission(CefRefPtr browser, - int request_id) override; + int request_id) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc index 071d9d451..c485ec04a 100644 --- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a0931ea5dc8d42995b5e114974a8e389d3e58e96$ +// #include "libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefGetGeolocationCallbackCToCpp::OnLocationUpdate( @@ -24,29 +25,35 @@ void CefGetGeolocationCallbackCToCpp::OnLocationUpdate( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->on_location_update(_struct, - &position); + _struct->on_location_update(_struct, &position); } - // CONSTRUCTOR - Do not edit by hand. -CefGetGeolocationCallbackCToCpp::CefGetGeolocationCallbackCToCpp() { -} +CefGetGeolocationCallbackCToCpp::CefGetGeolocationCallbackCToCpp() {} -template<> cef_get_geolocation_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefGetGeolocationCallback* c) { +template <> +cef_get_geolocation_callback_t* CefCToCppRefCounted< + CefGetGeolocationCallbackCToCpp, + CefGetGeolocationCallback, + cef_get_geolocation_callback_t>::UnwrapDerived(CefWrapperType type, + CefGetGeolocationCallback* + c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_GET_GEOLOCATION_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_GET_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h index abb493863..85bb9160c 100644 --- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h +++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8287c3a5529df6bfeba86297af5dcb8049f61f63$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_GET_GEOLOCATION_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_GET_GEOLOCATION_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_geolocation.h" #include "include/capi/cef_geolocation_capi.h" +#include "include/cef_geolocation.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefGetGeolocationCallbackCToCpp : public CefCToCppRefCounted { + CefGetGeolocationCallback, + cef_get_geolocation_callback_t> { public: CefGetGeolocationCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/image_ctocpp.cc b/libcef_dll/ctocpp/image_ctocpp.cc index 8d15a25ff..a451c804a 100644 --- a/libcef_dll/ctocpp/image_ctocpp.cc +++ b/libcef_dll/ctocpp/image_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5e40116321512494caef88ecd4bf6b6185073382$ +// #include "libcef_dll/ctocpp/binary_value_ctocpp.h" #include "libcef_dll/ctocpp/image_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefImage::CreateImage() { @@ -26,7 +27,6 @@ CefRefPtr CefImage::CreateImage() { return CefImageCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefImageCToCpp::IsEmpty() { @@ -40,7 +40,7 @@ bool CefImageCToCpp::IsEmpty() { int _retval = _struct->is_empty(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefImageCToCpp::IsSame(CefRefPtr that) { @@ -56,16 +56,19 @@ bool CefImageCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefImageCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefImageCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefImageCToCpp::AddBitmap(float scale_factor, int pixel_width, - int pixel_height, cef_color_type_t color_type, cef_alpha_type_t alpha_type, - const void* pixel_data, size_t pixel_data_size) { +bool CefImageCToCpp::AddBitmap(float scale_factor, + int pixel_width, + int pixel_height, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + const void* pixel_data, + size_t pixel_data_size) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_bitmap)) return false; @@ -78,21 +81,17 @@ bool CefImageCToCpp::AddBitmap(float scale_factor, int pixel_width, return false; // Execute - int _retval = _struct->add_bitmap(_struct, - scale_factor, - pixel_width, - pixel_height, - color_type, - alpha_type, - pixel_data, - pixel_data_size); + int _retval = + _struct->add_bitmap(_struct, scale_factor, pixel_width, pixel_height, + color_type, alpha_type, pixel_data, pixel_data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefImageCToCpp::AddPNG(float scale_factor, const void* png_data, - size_t png_data_size) { +bool CefImageCToCpp::AddPNG(float scale_factor, + const void* png_data, + size_t png_data_size) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_png)) return false; @@ -105,17 +104,16 @@ bool CefImageCToCpp::AddPNG(float scale_factor, const void* png_data, return false; // Execute - int _retval = _struct->add_png(_struct, - scale_factor, - png_data, - png_data_size); + int _retval = + _struct->add_png(_struct, scale_factor, png_data, png_data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefImageCToCpp::AddJPEG(float scale_factor, const void* jpeg_data, - size_t jpeg_data_size) { +bool CefImageCToCpp::AddJPEG(float scale_factor, + const void* jpeg_data, + size_t jpeg_data_size) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_jpeg)) return false; @@ -128,13 +126,11 @@ bool CefImageCToCpp::AddJPEG(float scale_factor, const void* jpeg_data, return false; // Execute - int _retval = _struct->add_jpeg(_struct, - scale_factor, - jpeg_data, - jpeg_data_size); + int _retval = + _struct->add_jpeg(_struct, scale_factor, jpeg_data, jpeg_data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefImageCToCpp::GetWidth() { @@ -173,11 +169,10 @@ bool CefImageCToCpp::HasRepresentation(float scale_factor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->has_representation(_struct, - scale_factor); + int _retval = _struct->has_representation(_struct, scale_factor); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefImageCToCpp::RemoveRepresentation(float scale_factor) { @@ -188,15 +183,16 @@ bool CefImageCToCpp::RemoveRepresentation(float scale_factor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove_representation(_struct, - scale_factor); + int _retval = _struct->remove_representation(_struct, scale_factor); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefImageCToCpp::GetRepresentationInfo(float scale_factor, - float& actual_scale_factor, int& pixel_width, int& pixel_height) { + float& actual_scale_factor, + int& pixel_width, + int& pixel_height) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_representation_info)) return false; @@ -204,18 +200,18 @@ bool CefImageCToCpp::GetRepresentationInfo(float scale_factor, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_representation_info(_struct, - scale_factor, - &actual_scale_factor, - &pixel_width, - &pixel_height); + int _retval = _struct->get_representation_info( + _struct, scale_factor, &actual_scale_factor, &pixel_width, &pixel_height); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CefRefPtr CefImageCToCpp::GetAsBitmap(float scale_factor, - cef_color_type_t color_type, cef_alpha_type_t alpha_type, int& pixel_width, +CefRefPtr CefImageCToCpp::GetAsBitmap( + float scale_factor, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + int& pixel_width, int& pixel_height) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_as_bitmap)) @@ -224,19 +220,18 @@ CefRefPtr CefImageCToCpp::GetAsBitmap(float scale_factor, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = _struct->get_as_bitmap(_struct, - scale_factor, - color_type, - alpha_type, - &pixel_width, - &pixel_height); + cef_binary_value_t* _retval = + _struct->get_as_bitmap(_struct, scale_factor, color_type, alpha_type, + &pixel_width, &pixel_height); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } CefRefPtr CefImageCToCpp::GetAsPNG(float scale_factor, - bool with_transparency, int& pixel_width, int& pixel_height) { + bool with_transparency, + int& pixel_width, + int& pixel_height) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_as_png)) return NULL; @@ -244,18 +239,17 @@ CefRefPtr CefImageCToCpp::GetAsPNG(float scale_factor, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = _struct->get_as_png(_struct, - scale_factor, - with_transparency, - &pixel_width, - &pixel_height); + cef_binary_value_t* _retval = _struct->get_as_png( + _struct, scale_factor, with_transparency, &pixel_width, &pixel_height); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } CefRefPtr CefImageCToCpp::GetAsJPEG(float scale_factor, - int quality, int& pixel_width, int& pixel_height) { + int quality, + int& pixel_width, + int& pixel_height) { cef_image_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_as_jpeg)) return NULL; @@ -263,32 +257,33 @@ CefRefPtr CefImageCToCpp::GetAsJPEG(float scale_factor, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = _struct->get_as_jpeg(_struct, - scale_factor, - quality, - &pixel_width, - &pixel_height); + cef_binary_value_t* _retval = _struct->get_as_jpeg( + _struct, scale_factor, quality, &pixel_width, &pixel_height); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefImageCToCpp::CefImageCToCpp() { -} +CefImageCToCpp::CefImageCToCpp() {} -template<> cef_image_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefImage* c) { +template <> +cef_image_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefImage* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_IMAGE; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_IMAGE; diff --git a/libcef_dll/ctocpp/image_ctocpp.h b/libcef_dll/ctocpp/image_ctocpp.h index f0393f032..813f49b40 100644 --- a/libcef_dll/ctocpp/image_ctocpp.h +++ b/libcef_dll/ctocpp/image_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a57f068e9c47498fb8d841bdc9d71da07b360131$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_image.h" #include "include/capi/cef_image_capi.h" +#include "include/cef_image.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -32,26 +34,40 @@ class CefImageCToCpp // CefImage methods. bool IsEmpty() OVERRIDE; bool IsSame(CefRefPtr that) OVERRIDE; - bool AddBitmap(float scale_factor, int pixel_width, int pixel_height, - cef_color_type_t color_type, cef_alpha_type_t alpha_type, - const void* pixel_data, size_t pixel_data_size) OVERRIDE; - bool AddPNG(float scale_factor, const void* png_data, - size_t png_data_size) OVERRIDE; - bool AddJPEG(float scale_factor, const void* jpeg_data, - size_t jpeg_data_size) OVERRIDE; + bool AddBitmap(float scale_factor, + int pixel_width, + int pixel_height, + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + const void* pixel_data, + size_t pixel_data_size) OVERRIDE; + bool AddPNG(float scale_factor, + const void* png_data, + size_t png_data_size) OVERRIDE; + bool AddJPEG(float scale_factor, + const void* jpeg_data, + size_t jpeg_data_size) OVERRIDE; size_t GetWidth() OVERRIDE; size_t GetHeight() OVERRIDE; bool HasRepresentation(float scale_factor) OVERRIDE; bool RemoveRepresentation(float scale_factor) OVERRIDE; - bool GetRepresentationInfo(float scale_factor, float& actual_scale_factor, - int& pixel_width, int& pixel_height) OVERRIDE; + bool GetRepresentationInfo(float scale_factor, + float& actual_scale_factor, + int& pixel_width, + int& pixel_height) OVERRIDE; CefRefPtr GetAsBitmap(float scale_factor, - cef_color_type_t color_type, cef_alpha_type_t alpha_type, - int& pixel_width, int& pixel_height) OVERRIDE; - CefRefPtr GetAsPNG(float scale_factor, bool with_transparency, - int& pixel_width, int& pixel_height) OVERRIDE; - CefRefPtr GetAsJPEG(float scale_factor, int quality, - int& pixel_width, int& pixel_height) OVERRIDE; + cef_color_type_t color_type, + cef_alpha_type_t alpha_type, + int& pixel_width, + int& pixel_height) OVERRIDE; + CefRefPtr GetAsPNG(float scale_factor, + bool with_transparency, + int& pixel_width, + int& pixel_height) OVERRIDE; + CefRefPtr GetAsJPEG(float scale_factor, + int quality, + int& pixel_width, + int& pixel_height) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc index 7531ef095..7f35cee43 100644 --- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ed31bf8c6b15dfbe06bc8cc725d845d6b09bcbcf$ +// #include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefJSDialogCallbackCToCpp::Continue(bool success, - const CefString& user_input) { + const CefString& user_input) { cef_jsdialog_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, cont)) return; @@ -26,29 +27,33 @@ void CefJSDialogCallbackCToCpp::Continue(bool success, // Unverified params: user_input // Execute - _struct->cont(_struct, - success, - user_input.GetStruct()); + _struct->cont(_struct, success, user_input.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefJSDialogCallbackCToCpp::CefJSDialogCallbackCToCpp() { -} +CefJSDialogCallbackCToCpp::CefJSDialogCallbackCToCpp() {} -template<> cef_jsdialog_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefJSDialogCallback* c) { +template <> +cef_jsdialog_callback_t* CefCToCppRefCounted< + CefJSDialogCallbackCToCpp, + CefJSDialogCallback, + cef_jsdialog_callback_t>::UnwrapDerived(CefWrapperType type, + CefJSDialogCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_JSDIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h index 0d05cddc5..189a8178f 100644 --- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ba09583753bb1ad73ef2d7a74b9c6ec5127442ae$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_jsdialog_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefJSDialogCallbackCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefJSDialogCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index 40664db08..017c3ede5 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -9,18 +9,23 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b428b0f15ba1b1661a5ce951a659975028f368c8$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h" #include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, - const CefString& origin_url, JSDialogType dialog_type, - const CefString& message_text, const CefString& default_prompt_text, - CefRefPtr callback, bool& suppress_message) { +bool CefJSDialogHandlerCToCpp::OnJSDialog( + CefRefPtr browser, + const CefString& origin_url, + JSDialogType dialog_type, + const CefString& message_text, + const CefString& default_prompt_text, + CefRefPtr callback, + bool& suppress_message) { cef_jsdialog_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_jsdialog)) return false; @@ -41,25 +46,23 @@ bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, int suppress_messageInt = suppress_message; // Execute - int _retval = _struct->on_jsdialog(_struct, - CefBrowserCppToC::Wrap(browser), - origin_url.GetStruct(), - dialog_type, - message_text.GetStruct(), - default_prompt_text.GetStruct(), - CefJSDialogCallbackCppToC::Wrap(callback), - &suppress_messageInt); + int _retval = _struct->on_jsdialog( + _struct, CefBrowserCppToC::Wrap(browser), origin_url.GetStruct(), + dialog_type, message_text.GetStruct(), default_prompt_text.GetStruct(), + CefJSDialogCallbackCppToC::Wrap(callback), &suppress_messageInt); // Restore param:suppress_message; type: bool_byref - suppress_message = suppress_messageInt?true:false; + suppress_message = suppress_messageInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefJSDialogHandlerCToCpp::OnBeforeUnloadDialog( - CefRefPtr browser, const CefString& message_text, - bool is_reload, CefRefPtr callback) { + CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) { cef_jsdialog_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_unload_dialog)) return false; @@ -77,14 +80,12 @@ bool CefJSDialogHandlerCToCpp::OnBeforeUnloadDialog( // Unverified params: message_text // Execute - int _retval = _struct->on_before_unload_dialog(_struct, - CefBrowserCppToC::Wrap(browser), - message_text.GetStruct(), - is_reload, - CefJSDialogCallbackCppToC::Wrap(callback)); + int _retval = _struct->on_before_unload_dialog( + _struct, CefBrowserCppToC::Wrap(browser), message_text.GetStruct(), + is_reload, CefJSDialogCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefJSDialogHandlerCToCpp::OnResetDialogState( @@ -101,8 +102,7 @@ void CefJSDialogHandlerCToCpp::OnResetDialogState( return; // Execute - _struct->on_reset_dialog_state(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_reset_dialog_state(_struct, CefBrowserCppToC::Wrap(browser)); } void CefJSDialogHandlerCToCpp::OnDialogClosed(CefRefPtr browser) { @@ -118,28 +118,33 @@ void CefJSDialogHandlerCToCpp::OnDialogClosed(CefRefPtr browser) { return; // Execute - _struct->on_dialog_closed(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_dialog_closed(_struct, CefBrowserCppToC::Wrap(browser)); } - // CONSTRUCTOR - Do not edit by hand. -CefJSDialogHandlerCToCpp::CefJSDialogHandlerCToCpp() { -} +CefJSDialogHandlerCToCpp::CefJSDialogHandlerCToCpp() {} -template<> cef_jsdialog_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefJSDialogHandler* c) { +template <> +cef_jsdialog_handler_t* CefCToCppRefCounted< + CefJSDialogHandlerCToCpp, + CefJSDialogHandler, + cef_jsdialog_handler_t>::UnwrapDerived(CefWrapperType type, + CefJSDialogHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_JSDIALOG_HANDLER; diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h index 60c48e67f..c6174ca23 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=208187edf72f1be111fbafe681d68277e541b61f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ @@ -18,27 +20,31 @@ #error This file can be included DLL-side only #endif -#include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/cef_jsdialog_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefJSDialogHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefJSDialogHandlerCToCpp(); // CefJSDialogHandler methods. - bool OnJSDialog(CefRefPtr browser, const CefString& origin_url, - JSDialogType dialog_type, const CefString& message_text, - const CefString& default_prompt_text, - CefRefPtr callback, - bool& suppress_message) override; + bool OnJSDialog(CefRefPtr browser, + const CefString& origin_url, + JSDialogType dialog_type, + const CefString& message_text, + const CefString& default_prompt_text, + CefRefPtr callback, + bool& suppress_message) override; bool OnBeforeUnloadDialog(CefRefPtr browser, - const CefString& message_text, bool is_reload, - CefRefPtr callback) override; + const CefString& message_text, + bool is_reload, + CefRefPtr callback) override; void OnResetDialogState(CefRefPtr browser) override; void OnDialogClosed(CefRefPtr browser) override; }; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc index 5e2c5e238..6d9b756d0 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=41649365a1d97eac029e3dbcd8c19da5e03bc341$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/ctocpp/keyboard_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefKeyboardHandlerCToCpp::OnPreKeyEvent(CefRefPtr browser, - const CefKeyEvent& event, CefEventHandle os_event, - bool* is_keyboard_shortcut) { + const CefKeyEvent& event, + CefEventHandle os_event, + bool* is_keyboard_shortcut) { cef_keyboard_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_pre_key_event)) return false; @@ -35,25 +37,25 @@ bool CefKeyboardHandlerCToCpp::OnPreKeyEvent(CefRefPtr browser, return false; // Translate param: is_keyboard_shortcut; type: bool_byaddr - int is_keyboard_shortcutInt = is_keyboard_shortcut?*is_keyboard_shortcut:0; + int is_keyboard_shortcutInt = + is_keyboard_shortcut ? *is_keyboard_shortcut : 0; // Execute - int _retval = _struct->on_pre_key_event(_struct, - CefBrowserCppToC::Wrap(browser), - &event, - os_event, - &is_keyboard_shortcutInt); + int _retval = + _struct->on_pre_key_event(_struct, CefBrowserCppToC::Wrap(browser), + &event, os_event, &is_keyboard_shortcutInt); // Restore param:is_keyboard_shortcut; type: bool_byaddr if (is_keyboard_shortcut) - *is_keyboard_shortcut = is_keyboard_shortcutInt?true:false; + *is_keyboard_shortcut = is_keyboard_shortcutInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, - const CefKeyEvent& event, CefEventHandle os_event) { + const CefKeyEvent& event, + CefEventHandle os_event) { cef_keyboard_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_key_event)) return false; @@ -66,33 +68,37 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_key_event(_struct, - CefBrowserCppToC::Wrap(browser), - &event, - os_event); + int _retval = _struct->on_key_event(_struct, CefBrowserCppToC::Wrap(browser), + &event, os_event); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefKeyboardHandlerCToCpp::CefKeyboardHandlerCToCpp() { -} +CefKeyboardHandlerCToCpp::CefKeyboardHandlerCToCpp() {} -template<> cef_keyboard_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefKeyboardHandler* c) { +template <> +cef_keyboard_handler_t* CefCToCppRefCounted< + CefKeyboardHandlerCToCpp, + CefKeyboardHandler, + cef_keyboard_handler_t>::UnwrapDerived(CefWrapperType type, + CefKeyboardHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_KEYBOARD_HANDLER; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h index c4ddcd9cf..e1ee0e5e1 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9bbb5a9d025a7e2dca5d4510f3a36cedebe06e1e$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ @@ -18,23 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_keyboard_handler.h" #include "include/capi/cef_keyboard_handler_capi.h" +#include "include/cef_keyboard_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefKeyboardHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefKeyboardHandlerCToCpp(); // CefKeyboardHandler methods. - bool OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, - CefEventHandle os_event, bool* is_keyboard_shortcut) override; - bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, - CefEventHandle os_event) override; + bool OnPreKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event, + bool* is_keyboard_shortcut) override; + bool OnKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc index ba820b60a..83fd23f19 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc @@ -9,21 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1fc3388d5e22b38460cfbbdbbca15a10f19320c7$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" #include "libcef_dll/ctocpp/client_ctocpp.h" #include "libcef_dll/ctocpp/life_span_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, - CefRefPtr frame, const CefString& target_url, +bool CefLifeSpanHandlerCToCpp::OnBeforePopup( + CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, const CefString& target_frame_name, - WindowOpenDisposition target_disposition, bool user_gesture, - const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, - CefRefPtr& client, CefBrowserSettings& settings, + WindowOpenDisposition target_disposition, + bool user_gesture, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings, bool* no_javascript_access) { cef_life_span_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_popup)) @@ -51,20 +57,14 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, clientStruct = CefClientCToCpp::Unwrap(client); cef_client_t* clientOrig = clientStruct; // Translate param: no_javascript_access; type: bool_byaddr - int no_javascript_accessInt = no_javascript_access?*no_javascript_access:0; + int no_javascript_accessInt = + no_javascript_access ? *no_javascript_access : 0; // Execute - int _retval = _struct->on_before_popup(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - target_url.GetStruct(), - target_frame_name.GetStruct(), - target_disposition, - user_gesture, - &popupFeatures, - &windowInfo, - &clientStruct, - &settings, + int _retval = _struct->on_before_popup( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + target_url.GetStruct(), target_frame_name.GetStruct(), target_disposition, + user_gesture, &popupFeatures, &windowInfo, &clientStruct, &settings, &no_javascript_accessInt); // Restore param:client; type: refptr_same_byref @@ -77,10 +77,10 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, } // Restore param:no_javascript_access; type: bool_byaddr if (no_javascript_access) - *no_javascript_access = no_javascript_accessInt?true:false; + *no_javascript_access = no_javascript_accessInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { @@ -96,8 +96,7 @@ void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { return; // Execute - _struct->on_after_created(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_after_created(_struct, CefBrowserCppToC::Wrap(browser)); } bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { @@ -113,11 +112,10 @@ bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { return false; // Execute - int _retval = _struct->do_close(_struct, - CefBrowserCppToC::Wrap(browser)); + int _retval = _struct->do_close(_struct, CefBrowserCppToC::Wrap(browser)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { @@ -133,28 +131,33 @@ void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { return; // Execute - _struct->on_before_close(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_before_close(_struct, CefBrowserCppToC::Wrap(browser)); } - // CONSTRUCTOR - Do not edit by hand. -CefLifeSpanHandlerCToCpp::CefLifeSpanHandlerCToCpp() { -} +CefLifeSpanHandlerCToCpp::CefLifeSpanHandlerCToCpp() {} -template<> cef_life_span_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefLifeSpanHandler* c) { +template <> +cef_life_span_handler_t* CefCToCppRefCounted< + CefLifeSpanHandlerCToCpp, + CefLifeSpanHandler, + cef_life_span_handler_t>::UnwrapDerived(CefWrapperType type, + CefLifeSpanHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LIFE_SPAN_HANDLER; diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h index 540e7b25b..522ab7522 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=60562c32e13837f5b1c35765c135caf39a121258$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ @@ -18,27 +20,33 @@ #error This file can be included DLL-side only #endif -#include "include/cef_life_span_handler.h" +#include "include/capi/cef_client_capi.h" #include "include/capi/cef_life_span_handler_capi.h" #include "include/cef_client.h" -#include "include/capi/cef_client_capi.h" +#include "include/cef_life_span_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefLifeSpanHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefLifeSpanHandlerCToCpp(); // CefLifeSpanHandler methods. - bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, - const CefString& target_url, const CefString& target_frame_name, - WindowOpenDisposition target_disposition, bool user_gesture, - const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, - CefRefPtr& client, CefBrowserSettings& settings, - bool* no_javascript_access) override; + bool OnBeforePopup(CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + const CefString& target_frame_name, + WindowOpenDisposition target_disposition, + bool user_gesture, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings, + bool* no_javascript_access) override; void OnAfterCreated(CefRefPtr browser) override; bool DoClose(CefRefPtr browser) override; void OnBeforeClose(CefRefPtr browser) override; diff --git a/libcef_dll/ctocpp/list_value_ctocpp.cc b/libcef_dll/ctocpp/list_value_ctocpp.cc index 9be76054e..2e35ed4e9 100644 --- a/libcef_dll/ctocpp/list_value_ctocpp.cc +++ b/libcef_dll/ctocpp/list_value_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a9ba4a22361c5f7d2de811f12348633bd2515f43$ +// #include "libcef_dll/ctocpp/binary_value_ctocpp.h" #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" #include "libcef_dll/ctocpp/list_value_ctocpp.h" #include "libcef_dll/ctocpp/value_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefListValue::Create() { @@ -28,7 +29,6 @@ CefRefPtr CefListValue::Create() { return CefListValueCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefListValueCToCpp::IsValid() { @@ -42,7 +42,7 @@ bool CefListValueCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::IsOwned() { @@ -56,7 +56,7 @@ bool CefListValueCToCpp::IsOwned() { int _retval = _struct->is_owned(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::IsReadOnly() { @@ -70,7 +70,7 @@ bool CefListValueCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::IsSame(CefRefPtr that) { @@ -86,11 +86,10 @@ bool CefListValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefListValueCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefListValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::IsEqual(CefRefPtr that) { @@ -106,11 +105,10 @@ bool CefListValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_equal(_struct, - CefListValueCToCpp::Unwrap(that)); + int _retval = _struct->is_equal(_struct, CefListValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefListValueCToCpp::Copy() { @@ -135,11 +133,10 @@ bool CefListValueCToCpp::SetSize(size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_size(_struct, - size); + int _retval = _struct->set_size(_struct, size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefListValueCToCpp::GetSize() { @@ -167,7 +164,7 @@ bool CefListValueCToCpp::Clear() { int _retval = _struct->clear(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::Remove(size_t index) { @@ -178,11 +175,10 @@ bool CefListValueCToCpp::Remove(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove(_struct, - index); + int _retval = _struct->remove(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefValueType CefListValueCToCpp::GetType(size_t index) { @@ -193,8 +189,7 @@ CefValueType CefListValueCToCpp::GetType(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_value_type_t _retval = _struct->get_type(_struct, - index); + cef_value_type_t _retval = _struct->get_type(_struct, index); // Return type: simple return _retval; @@ -208,8 +203,7 @@ CefRefPtr CefListValueCToCpp::GetValue(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_value_t* _retval = _struct->get_value(_struct, - index); + cef_value_t* _retval = _struct->get_value(_struct, index); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); @@ -223,11 +217,10 @@ bool CefListValueCToCpp::GetBool(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_bool(_struct, - index); + int _retval = _struct->get_bool(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefListValueCToCpp::GetInt(size_t index) { @@ -238,8 +231,7 @@ int CefListValueCToCpp::GetInt(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_int(_struct, - index); + int _retval = _struct->get_int(_struct, index); // Return type: simple return _retval; @@ -253,8 +245,7 @@ double CefListValueCToCpp::GetDouble(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - double _retval = _struct->get_double(_struct, - index); + double _retval = _struct->get_double(_struct, index); // Return type: simple return _retval; @@ -268,8 +259,7 @@ CefString CefListValueCToCpp::GetString(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_string(_struct, - index); + cef_string_userfree_t _retval = _struct->get_string(_struct, index); // Return type: string CefString _retvalStr; @@ -285,8 +275,7 @@ CefRefPtr CefListValueCToCpp::GetBinary(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = _struct->get_binary(_struct, - index); + cef_binary_value_t* _retval = _struct->get_binary(_struct, index); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); @@ -300,8 +289,7 @@ CefRefPtr CefListValueCToCpp::GetDictionary(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct, - index); + cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct, index); // Return type: refptr_same return CefDictionaryValueCToCpp::Wrap(_retval); @@ -315,8 +303,7 @@ CefRefPtr CefListValueCToCpp::GetList(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_list_value_t* _retval = _struct->get_list(_struct, - index); + cef_list_value_t* _retval = _struct->get_list(_struct, index); // Return type: refptr_same return CefListValueCToCpp::Wrap(_retval); @@ -335,12 +322,11 @@ bool CefListValueCToCpp::SetValue(size_t index, CefRefPtr value) { return false; // Execute - int _retval = _struct->set_value(_struct, - index, - CefValueCToCpp::Unwrap(value)); + int _retval = + _struct->set_value(_struct, index, CefValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetNull(size_t index) { @@ -351,11 +337,10 @@ bool CefListValueCToCpp::SetNull(size_t index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_null(_struct, - index); + int _retval = _struct->set_null(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetBool(size_t index, bool value) { @@ -366,12 +351,10 @@ bool CefListValueCToCpp::SetBool(size_t index, bool value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_bool(_struct, - index, - value); + int _retval = _struct->set_bool(_struct, index, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetInt(size_t index, int value) { @@ -382,12 +365,10 @@ bool CefListValueCToCpp::SetInt(size_t index, int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_int(_struct, - index, - value); + int _retval = _struct->set_int(_struct, index, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetDouble(size_t index, double value) { @@ -398,12 +379,10 @@ bool CefListValueCToCpp::SetDouble(size_t index, double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_double(_struct, - index, - value); + int _retval = _struct->set_double(_struct, index, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetString(size_t index, const CefString& value) { @@ -416,16 +395,14 @@ bool CefListValueCToCpp::SetString(size_t index, const CefString& value) { // Unverified params: value // Execute - int _retval = _struct->set_string(_struct, - index, - value.GetStruct()); + int _retval = _struct->set_string(_struct, index, value.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetBinary(size_t index, - CefRefPtr value) { + CefRefPtr value) { cef_list_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_binary)) return false; @@ -438,16 +415,15 @@ bool CefListValueCToCpp::SetBinary(size_t index, return false; // Execute - int _retval = _struct->set_binary(_struct, - index, - CefBinaryValueCToCpp::Unwrap(value)); + int _retval = + _struct->set_binary(_struct, index, CefBinaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetDictionary(size_t index, - CefRefPtr value) { + CefRefPtr value) { cef_list_value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_dictionary)) return false; @@ -460,12 +436,11 @@ bool CefListValueCToCpp::SetDictionary(size_t index, return false; // Execute - int _retval = _struct->set_dictionary(_struct, - index, - CefDictionaryValueCToCpp::Unwrap(value)); + int _retval = _struct->set_dictionary( + _struct, index, CefDictionaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefListValueCToCpp::SetList(size_t index, CefRefPtr value) { @@ -481,31 +456,34 @@ bool CefListValueCToCpp::SetList(size_t index, CefRefPtr value) { return false; // Execute - int _retval = _struct->set_list(_struct, - index, - CefListValueCToCpp::Unwrap(value)); + int _retval = + _struct->set_list(_struct, index, CefListValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefListValueCToCpp::CefListValueCToCpp() { -} +CefListValueCToCpp::CefListValueCToCpp() {} -template<> cef_list_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefListValue* c) { +template <> +cef_list_value_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefListValue* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LIST_VALUE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_LIST_VALUE; diff --git a/libcef_dll/ctocpp/list_value_ctocpp.h b/libcef_dll/ctocpp/list_value_ctocpp.h index c376ba9d8..43ab736ea 100644 --- a/libcef_dll/ctocpp/list_value_ctocpp.h +++ b/libcef_dll/ctocpp/list_value_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=146d1c1f362c668c9cc049309e2de3091256c70b$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefListValueCToCpp - : public CefCToCppRefCounted { +class CefListValueCToCpp : public CefCToCppRefCounted { public: CefListValueCToCpp(); @@ -58,7 +60,7 @@ class CefListValueCToCpp bool SetString(size_t index, const CefString& value) OVERRIDE; bool SetBinary(size_t index, CefRefPtr value) OVERRIDE; bool SetDictionary(size_t index, - CefRefPtr value) OVERRIDE; + CefRefPtr value) OVERRIDE; bool SetList(size_t index, CefRefPtr value) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc index 3b47e00d1..830c2a596 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc @@ -9,16 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bbb850a48e96714faf6f4772b517bd748a1d36e2$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" #include "libcef_dll/ctocpp/load_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr browser, - bool isLoading, bool canGoBack, bool canGoForward) { + bool isLoading, + bool canGoBack, + bool canGoForward) { cef_load_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_loading_state_change)) return; @@ -31,15 +34,13 @@ void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr browser, return; // Execute - _struct->on_loading_state_change(_struct, - CefBrowserCppToC::Wrap(browser), - isLoading, - canGoBack, - canGoForward); + _struct->on_loading_state_change(_struct, CefBrowserCppToC::Wrap(browser), + isLoading, canGoBack, canGoForward); } void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, - CefRefPtr frame, TransitionType transition_type) { + CefRefPtr frame, + TransitionType transition_type) { cef_load_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_load_start)) return; @@ -56,14 +57,13 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, return; // Execute - _struct->on_load_start(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - transition_type); + _struct->on_load_start(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), transition_type); } void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, - CefRefPtr frame, int httpStatusCode) { + CefRefPtr frame, + int httpStatusCode) { cef_load_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_load_end)) return; @@ -80,15 +80,15 @@ void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, return; // Execute - _struct->on_load_end(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - httpStatusCode); + _struct->on_load_end(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), httpStatusCode); } void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, - CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, - const CefString& failedUrl) { + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) { cef_load_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_load_error)) return; @@ -110,31 +110,32 @@ void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, // Unverified params: errorText // Execute - _struct->on_load_error(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - errorCode, - errorText.GetStruct(), - failedUrl.GetStruct()); + _struct->on_load_error(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), errorCode, + errorText.GetStruct(), failedUrl.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefLoadHandlerCToCpp::CefLoadHandlerCToCpp() { -} +CefLoadHandlerCToCpp::CefLoadHandlerCToCpp() {} -template<> cef_load_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefLoadHandler* c) { +template <> +cef_load_handler_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefLoadHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LOAD_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_LOAD_HANDLER; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h index 9cf0adcc9..d22f8cdea 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.h +++ b/libcef_dll/ctocpp/load_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=35c623e70828a98fcf3e1d03905c6118b44333b0$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ @@ -18,28 +20,34 @@ #error This file can be included DLL-side only #endif -#include "include/cef_load_handler.h" #include "include/capi/cef_load_handler_capi.h" +#include "include/cef_load_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefLoadHandlerCToCpp - : public CefCToCppRefCounted { +class CefLoadHandlerCToCpp : public CefCToCppRefCounted { public: CefLoadHandlerCToCpp(); // CefLoadHandler methods. - void OnLoadingStateChange(CefRefPtr browser, bool isLoading, - bool canGoBack, bool canGoForward) override; - void OnLoadStart(CefRefPtr browser, CefRefPtr frame, - TransitionType transition_type) override; - void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, - int httpStatusCode) override; - void OnLoadError(CefRefPtr browser, CefRefPtr frame, - ErrorCode errorCode, const CefString& errorText, - const CefString& failedUrl) override; + void OnLoadingStateChange(CefRefPtr browser, + bool isLoading, + bool canGoBack, + bool canGoForward) override; + void OnLoadStart(CefRefPtr browser, + CefRefPtr frame, + TransitionType transition_type) override; + void OnLoadEnd(CefRefPtr browser, + CefRefPtr frame, + int httpStatusCode) override; + void OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.cc b/libcef_dll/ctocpp/menu_model_ctocpp.cc index 63f920f8f..a768ec6ff 100644 --- a/libcef_dll/ctocpp/menu_model_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_model_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=be685c43e83d5b570606ed3708ce83d9e6bad0c8$ +// #include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h" #include "libcef_dll/ctocpp/menu_model_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefMenuModel::CreateMenuModel( @@ -26,14 +27,13 @@ CefRefPtr CefMenuModel::CreateMenuModel( return NULL; // Execute - cef_menu_model_t* _retval = cef_menu_model_create( - CefMenuModelDelegateCppToC::Wrap(delegate)); + cef_menu_model_t* _retval = + cef_menu_model_create(CefMenuModelDelegateCppToC::Wrap(delegate)); // Return type: refptr_same return CefMenuModelCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefMenuModelCToCpp::IsSubMenu() { @@ -47,7 +47,7 @@ bool CefMenuModelCToCpp::IsSubMenu() { int _retval = _struct->is_sub_menu(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::Clear() { @@ -61,7 +61,7 @@ bool CefMenuModelCToCpp::Clear() { int _retval = _struct->clear(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefMenuModelCToCpp::GetCount() { @@ -89,7 +89,7 @@ bool CefMenuModelCToCpp::AddSeparator() { int _retval = _struct->add_separator(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { @@ -105,12 +105,10 @@ bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { return false; // Execute - int _retval = _struct->add_item(_struct, - command_id, - label.GetStruct()); + int _retval = _struct->add_item(_struct, command_id, label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { @@ -126,16 +124,15 @@ bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { return false; // Execute - int _retval = _struct->add_check_item(_struct, - command_id, - label.GetStruct()); + int _retval = _struct->add_check_item(_struct, command_id, label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, - int group_id) { +bool CefMenuModelCToCpp::AddRadioItem(int command_id, + const CefString& label, + int group_id) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_radio_item)) return false; @@ -148,17 +145,15 @@ bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, return false; // Execute - int _retval = _struct->add_radio_item(_struct, - command_id, - label.GetStruct(), - group_id); + int _retval = + _struct->add_radio_item(_struct, command_id, label.GetStruct(), group_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, - const CefString& label) { + const CefString& label) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_sub_menu)) return NULL; @@ -171,9 +166,8 @@ CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, return NULL; // Execute - cef_menu_model_t* _retval = _struct->add_sub_menu(_struct, - command_id, - label.GetStruct()); + cef_menu_model_t* _retval = + _struct->add_sub_menu(_struct, command_id, label.GetStruct()); // Return type: refptr_same return CefMenuModelCToCpp::Wrap(_retval); @@ -187,15 +181,15 @@ bool CefMenuModelCToCpp::InsertSeparatorAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->insert_separator_at(_struct, - index); + int _retval = _struct->insert_separator_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, - const CefString& label) { +bool CefMenuModelCToCpp::InsertItemAt(int index, + int command_id, + const CefString& label) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, insert_item_at)) return false; @@ -208,17 +202,16 @@ bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, return false; // Execute - int _retval = _struct->insert_item_at(_struct, - index, - command_id, - label.GetStruct()); + int _retval = + _struct->insert_item_at(_struct, index, command_id, label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, - const CefString& label) { +bool CefMenuModelCToCpp::InsertCheckItemAt(int index, + int command_id, + const CefString& label) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, insert_check_item_at)) return false; @@ -231,17 +224,17 @@ bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, return false; // Execute - int _retval = _struct->insert_check_item_at(_struct, - index, - command_id, - label.GetStruct()); + int _retval = _struct->insert_check_item_at(_struct, index, command_id, + label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, - const CefString& label, int group_id) { +bool CefMenuModelCToCpp::InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, insert_radio_item_at)) return false; @@ -254,18 +247,17 @@ bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, return false; // Execute - int _retval = _struct->insert_radio_item_at(_struct, - index, - command_id, - label.GetStruct(), - group_id); + int _retval = _struct->insert_radio_item_at(_struct, index, command_id, + label.GetStruct(), group_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, - int command_id, const CefString& label) { +CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt( + int index, + int command_id, + const CefString& label) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, insert_sub_menu_at)) return NULL; @@ -278,10 +270,8 @@ CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, return NULL; // Execute - cef_menu_model_t* _retval = _struct->insert_sub_menu_at(_struct, - index, - command_id, - label.GetStruct()); + cef_menu_model_t* _retval = _struct->insert_sub_menu_at( + _struct, index, command_id, label.GetStruct()); // Return type: refptr_same return CefMenuModelCToCpp::Wrap(_retval); @@ -295,11 +285,10 @@ bool CefMenuModelCToCpp::Remove(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove(_struct, - command_id); + int _retval = _struct->remove(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::RemoveAt(int index) { @@ -310,11 +299,10 @@ bool CefMenuModelCToCpp::RemoveAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove_at(_struct, - index); + int _retval = _struct->remove_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefMenuModelCToCpp::GetIndexOf(int command_id) { @@ -325,8 +313,7 @@ int CefMenuModelCToCpp::GetIndexOf(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_index_of(_struct, - command_id); + int _retval = _struct->get_index_of(_struct, command_id); // Return type: simple return _retval; @@ -340,8 +327,7 @@ int CefMenuModelCToCpp::GetCommandIdAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_command_id_at(_struct, - index); + int _retval = _struct->get_command_id_at(_struct, index); // Return type: simple return _retval; @@ -355,12 +341,10 @@ bool CefMenuModelCToCpp::SetCommandIdAt(int index, int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_command_id_at(_struct, - index, - command_id); + int _retval = _struct->set_command_id_at(_struct, index, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefMenuModelCToCpp::GetLabel(int command_id) { @@ -371,8 +355,7 @@ CefString CefMenuModelCToCpp::GetLabel(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_label(_struct, - command_id); + cef_string_userfree_t _retval = _struct->get_label(_struct, command_id); // Return type: string CefString _retvalStr; @@ -388,8 +371,7 @@ CefString CefMenuModelCToCpp::GetLabelAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_label_at(_struct, - index); + cef_string_userfree_t _retval = _struct->get_label_at(_struct, index); // Return type: string CefString _retvalStr; @@ -410,12 +392,10 @@ bool CefMenuModelCToCpp::SetLabel(int command_id, const CefString& label) { return false; // Execute - int _retval = _struct->set_label(_struct, - command_id, - label.GetStruct()); + int _retval = _struct->set_label(_struct, command_id, label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { @@ -431,12 +411,10 @@ bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { return false; // Execute - int _retval = _struct->set_label_at(_struct, - index, - label.GetStruct()); + int _retval = _struct->set_label_at(_struct, index, label.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefMenuModel::MenuItemType CefMenuModelCToCpp::GetType(int command_id) { @@ -447,8 +425,7 @@ CefMenuModel::MenuItemType CefMenuModelCToCpp::GetType(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_item_type_t _retval = _struct->get_type(_struct, - command_id); + cef_menu_item_type_t _retval = _struct->get_type(_struct, command_id); // Return type: simple return _retval; @@ -462,8 +439,7 @@ CefMenuModel::MenuItemType CefMenuModelCToCpp::GetTypeAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_item_type_t _retval = _struct->get_type_at(_struct, - index); + cef_menu_item_type_t _retval = _struct->get_type_at(_struct, index); // Return type: simple return _retval; @@ -477,8 +453,7 @@ int CefMenuModelCToCpp::GetGroupId(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_group_id(_struct, - command_id); + int _retval = _struct->get_group_id(_struct, command_id); // Return type: simple return _retval; @@ -492,8 +467,7 @@ int CefMenuModelCToCpp::GetGroupIdAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_group_id_at(_struct, - index); + int _retval = _struct->get_group_id_at(_struct, index); // Return type: simple return _retval; @@ -507,12 +481,10 @@ bool CefMenuModelCToCpp::SetGroupId(int command_id, int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_group_id(_struct, - command_id, - group_id); + int _retval = _struct->set_group_id(_struct, command_id, group_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetGroupIdAt(int index, int group_id) { @@ -523,12 +495,10 @@ bool CefMenuModelCToCpp::SetGroupIdAt(int index, int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_group_id_at(_struct, - index, - group_id); + int _retval = _struct->set_group_id_at(_struct, index, group_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefMenuModelCToCpp::GetSubMenu(int command_id) { @@ -539,8 +509,7 @@ CefRefPtr CefMenuModelCToCpp::GetSubMenu(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_model_t* _retval = _struct->get_sub_menu(_struct, - command_id); + cef_menu_model_t* _retval = _struct->get_sub_menu(_struct, command_id); // Return type: refptr_same return CefMenuModelCToCpp::Wrap(_retval); @@ -554,8 +523,7 @@ CefRefPtr CefMenuModelCToCpp::GetSubMenuAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_model_t* _retval = _struct->get_sub_menu_at(_struct, - index); + cef_menu_model_t* _retval = _struct->get_sub_menu_at(_struct, index); // Return type: refptr_same return CefMenuModelCToCpp::Wrap(_retval); @@ -569,11 +537,10 @@ bool CefMenuModelCToCpp::IsVisible(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_visible(_struct, - command_id); + int _retval = _struct->is_visible(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::IsVisibleAt(int index) { @@ -584,11 +551,10 @@ bool CefMenuModelCToCpp::IsVisibleAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_visible_at(_struct, - index); + int _retval = _struct->is_visible_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetVisible(int command_id, bool visible) { @@ -599,12 +565,10 @@ bool CefMenuModelCToCpp::SetVisible(int command_id, bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_visible(_struct, - command_id, - visible); + int _retval = _struct->set_visible(_struct, command_id, visible); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetVisibleAt(int index, bool visible) { @@ -615,12 +579,10 @@ bool CefMenuModelCToCpp::SetVisibleAt(int index, bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_visible_at(_struct, - index, - visible); + int _retval = _struct->set_visible_at(_struct, index, visible); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::IsEnabled(int command_id) { @@ -631,11 +593,10 @@ bool CefMenuModelCToCpp::IsEnabled(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_enabled(_struct, - command_id); + int _retval = _struct->is_enabled(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::IsEnabledAt(int index) { @@ -646,11 +607,10 @@ bool CefMenuModelCToCpp::IsEnabledAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_enabled_at(_struct, - index); + int _retval = _struct->is_enabled_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetEnabled(int command_id, bool enabled) { @@ -661,12 +621,10 @@ bool CefMenuModelCToCpp::SetEnabled(int command_id, bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_enabled(_struct, - command_id, - enabled); + int _retval = _struct->set_enabled(_struct, command_id, enabled); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetEnabledAt(int index, bool enabled) { @@ -677,12 +635,10 @@ bool CefMenuModelCToCpp::SetEnabledAt(int index, bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_enabled_at(_struct, - index, - enabled); + int _retval = _struct->set_enabled_at(_struct, index, enabled); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::IsChecked(int command_id) { @@ -693,11 +649,10 @@ bool CefMenuModelCToCpp::IsChecked(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_checked(_struct, - command_id); + int _retval = _struct->is_checked(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::IsCheckedAt(int index) { @@ -708,11 +663,10 @@ bool CefMenuModelCToCpp::IsCheckedAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_checked_at(_struct, - index); + int _retval = _struct->is_checked_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetChecked(int command_id, bool checked) { @@ -723,12 +677,10 @@ bool CefMenuModelCToCpp::SetChecked(int command_id, bool checked) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_checked(_struct, - command_id, - checked); + int _retval = _struct->set_checked(_struct, command_id, checked); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetCheckedAt(int index, bool checked) { @@ -739,12 +691,10 @@ bool CefMenuModelCToCpp::SetCheckedAt(int index, bool checked) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_checked_at(_struct, - index, - checked); + int _retval = _struct->set_checked_at(_struct, index, checked); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::HasAccelerator(int command_id) { @@ -755,11 +705,10 @@ bool CefMenuModelCToCpp::HasAccelerator(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->has_accelerator(_struct, - command_id); + int _retval = _struct->has_accelerator(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::HasAcceleratorAt(int index) { @@ -770,15 +719,17 @@ bool CefMenuModelCToCpp::HasAcceleratorAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->has_accelerator_at(_struct, - index); + int _retval = _struct->has_accelerator_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::SetAccelerator(int command_id, int key_code, - bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { +bool CefMenuModelCToCpp::SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_accelerator)) return false; @@ -786,19 +737,18 @@ bool CefMenuModelCToCpp::SetAccelerator(int command_id, int key_code, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_accelerator(_struct, - command_id, - key_code, - shift_pressed, - ctrl_pressed, - alt_pressed); + int _retval = _struct->set_accelerator( + _struct, command_id, key_code, shift_pressed, ctrl_pressed, alt_pressed); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::SetAcceleratorAt(int index, int key_code, - bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { +bool CefMenuModelCToCpp::SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_accelerator_at)) return false; @@ -806,15 +756,11 @@ bool CefMenuModelCToCpp::SetAcceleratorAt(int index, int key_code, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_accelerator_at(_struct, - index, - key_code, - shift_pressed, - ctrl_pressed, - alt_pressed); + int _retval = _struct->set_accelerator_at( + _struct, index, key_code, shift_pressed, ctrl_pressed, alt_pressed); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::RemoveAccelerator(int command_id) { @@ -825,11 +771,10 @@ bool CefMenuModelCToCpp::RemoveAccelerator(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove_accelerator(_struct, - command_id); + int _retval = _struct->remove_accelerator(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::RemoveAcceleratorAt(int index) { @@ -840,15 +785,17 @@ bool CefMenuModelCToCpp::RemoveAcceleratorAt(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->remove_accelerator_at(_struct, - index); + int _retval = _struct->remove_accelerator_at(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { +bool CefMenuModelCToCpp::GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_accelerator)) return false; @@ -863,26 +810,26 @@ bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, int alt_pressedInt = alt_pressed; // Execute - int _retval = _struct->get_accelerator(_struct, - command_id, - &key_code, - &shift_pressedInt, - &ctrl_pressedInt, - &alt_pressedInt); + int _retval = _struct->get_accelerator(_struct, command_id, &key_code, + &shift_pressedInt, &ctrl_pressedInt, + &alt_pressedInt); // Restore param:shift_pressed; type: bool_byref - shift_pressed = shift_pressedInt?true:false; + shift_pressed = shift_pressedInt ? true : false; // Restore param:ctrl_pressed; type: bool_byref - ctrl_pressed = ctrl_pressedInt?true:false; + ctrl_pressed = ctrl_pressedInt ? true : false; // Restore param:alt_pressed; type: bool_byref - alt_pressed = alt_pressedInt?true:false; + alt_pressed = alt_pressedInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { +bool CefMenuModelCToCpp::GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_accelerator_at)) return false; @@ -897,26 +844,24 @@ bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, int alt_pressedInt = alt_pressed; // Execute - int _retval = _struct->get_accelerator_at(_struct, - index, - &key_code, - &shift_pressedInt, - &ctrl_pressedInt, - &alt_pressedInt); + int _retval = + _struct->get_accelerator_at(_struct, index, &key_code, &shift_pressedInt, + &ctrl_pressedInt, &alt_pressedInt); // Restore param:shift_pressed; type: bool_byref - shift_pressed = shift_pressedInt?true:false; + shift_pressed = shift_pressedInt ? true : false; // Restore param:ctrl_pressed; type: bool_byref - ctrl_pressed = ctrl_pressedInt?true:false; + ctrl_pressed = ctrl_pressedInt ? true : false; // Restore param:alt_pressed; type: bool_byref - alt_pressed = alt_pressedInt?true:false; + alt_pressed = alt_pressedInt ? true : false; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetColor(int command_id, - cef_menu_color_type_t color_type, cef_color_t color) { + cef_menu_color_type_t color_type, + cef_color_t color) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_color)) return false; @@ -924,17 +869,15 @@ bool CefMenuModelCToCpp::SetColor(int command_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_color(_struct, - command_id, - color_type, - color); + int _retval = _struct->set_color(_struct, command_id, color_type, color); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::SetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t color) { +bool CefMenuModelCToCpp::SetColorAt(int index, + cef_menu_color_type_t color_type, + cef_color_t color) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_color_at)) return false; @@ -942,17 +885,15 @@ bool CefMenuModelCToCpp::SetColorAt(int index, cef_menu_color_type_t color_type, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_color_at(_struct, - index, - color_type, - color); + int _retval = _struct->set_color_at(_struct, index, color_type, color); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::GetColor(int command_id, - cef_menu_color_type_t color_type, cef_color_t& color) { + cef_menu_color_type_t color_type, + cef_color_t& color) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_color)) return false; @@ -960,17 +901,15 @@ bool CefMenuModelCToCpp::GetColor(int command_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_color(_struct, - command_id, - color_type, - &color); + int _retval = _struct->get_color(_struct, command_id, color_type, &color); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefMenuModelCToCpp::GetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t& color) { +bool CefMenuModelCToCpp::GetColorAt(int index, + cef_menu_color_type_t color_type, + cef_color_t& color) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_color_at)) return false; @@ -978,17 +917,14 @@ bool CefMenuModelCToCpp::GetColorAt(int index, cef_menu_color_type_t color_type, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_color_at(_struct, - index, - color_type, - &color); + int _retval = _struct->get_color_at(_struct, index, color_type, &color); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetFontList(int command_id, - const CefString& font_list) { + const CefString& font_list) { cef_menu_model_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_font_list)) return false; @@ -998,12 +934,11 @@ bool CefMenuModelCToCpp::SetFontList(int command_id, // Unverified params: font_list // Execute - int _retval = _struct->set_font_list(_struct, - command_id, - font_list.GetStruct()); + int _retval = + _struct->set_font_list(_struct, command_id, font_list.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuModelCToCpp::SetFontListAt(int index, const CefString& font_list) { @@ -1016,31 +951,34 @@ bool CefMenuModelCToCpp::SetFontListAt(int index, const CefString& font_list) { // Unverified params: font_list // Execute - int _retval = _struct->set_font_list_at(_struct, - index, - font_list.GetStruct()); + int _retval = + _struct->set_font_list_at(_struct, index, font_list.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefMenuModelCToCpp::CefMenuModelCToCpp() { -} +CefMenuModelCToCpp::CefMenuModelCToCpp() {} -template<> cef_menu_model_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefMenuModel* c) { +template <> +cef_menu_model_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefMenuModel* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_MODEL; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_MENU_MODEL; diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.h b/libcef_dll/ctocpp/menu_model_ctocpp.h index 4baa75f0a..d7417ad9f 100644 --- a/libcef_dll/ctocpp/menu_model_ctocpp.h +++ b/libcef_dll/ctocpp/menu_model_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4704f46ff34238699c6ac24f6e2e1d2f3b9d6bd2$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_menu_model.h" #include "include/capi/cef_menu_model_capi.h" +#include "include/cef_menu_model.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefMenuModelCToCpp - : public CefCToCppRefCounted { +class CefMenuModelCToCpp : public CefCToCppRefCounted { public: CefMenuModelCToCpp(); @@ -37,18 +39,23 @@ class CefMenuModelCToCpp bool AddSeparator() OVERRIDE; bool AddItem(int command_id, const CefString& label) OVERRIDE; bool AddCheckItem(int command_id, const CefString& label) OVERRIDE; - bool AddRadioItem(int command_id, const CefString& label, - int group_id) OVERRIDE; + bool AddRadioItem(int command_id, + const CefString& label, + int group_id) OVERRIDE; CefRefPtr AddSubMenu(int command_id, - const CefString& label) OVERRIDE; + const CefString& label) OVERRIDE; bool InsertSeparatorAt(int index) OVERRIDE; bool InsertItemAt(int index, int command_id, const CefString& label) OVERRIDE; - bool InsertCheckItemAt(int index, int command_id, - const CefString& label) OVERRIDE; - bool InsertRadioItemAt(int index, int command_id, const CefString& label, - int group_id) OVERRIDE; - CefRefPtr InsertSubMenuAt(int index, int command_id, - const CefString& label) OVERRIDE; + bool InsertCheckItemAt(int index, + int command_id, + const CefString& label) OVERRIDE; + bool InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) OVERRIDE; + CefRefPtr InsertSubMenuAt(int index, + int command_id, + const CefString& label) OVERRIDE; bool Remove(int command_id) OVERRIDE; bool RemoveAt(int index) OVERRIDE; int GetIndexOf(int command_id) OVERRIDE; @@ -80,24 +87,40 @@ class CefMenuModelCToCpp bool SetCheckedAt(int index, bool checked) OVERRIDE; bool HasAccelerator(int command_id) OVERRIDE; bool HasAcceleratorAt(int index) OVERRIDE; - bool SetAccelerator(int command_id, int key_code, bool shift_pressed, - bool ctrl_pressed, bool alt_pressed) OVERRIDE; - bool SetAcceleratorAt(int index, int key_code, bool shift_pressed, - bool ctrl_pressed, bool alt_pressed) OVERRIDE; + bool SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) OVERRIDE; + bool SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) OVERRIDE; bool RemoveAccelerator(int command_id) OVERRIDE; bool RemoveAcceleratorAt(int index) OVERRIDE; - bool GetAccelerator(int command_id, int& key_code, bool& shift_pressed, - bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; - bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, - bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; - bool SetColor(int command_id, cef_menu_color_type_t color_type, - cef_color_t color) OVERRIDE; - bool SetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t color) OVERRIDE; - bool GetColor(int command_id, cef_menu_color_type_t color_type, - cef_color_t& color) OVERRIDE; - bool GetColorAt(int index, cef_menu_color_type_t color_type, - cef_color_t& color) OVERRIDE; + bool GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) OVERRIDE; + bool GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) OVERRIDE; + bool SetColor(int command_id, + cef_menu_color_type_t color_type, + cef_color_t color) OVERRIDE; + bool SetColorAt(int index, + cef_menu_color_type_t color_type, + cef_color_t color) OVERRIDE; + bool GetColor(int command_id, + cef_menu_color_type_t color_type, + cef_color_t& color) OVERRIDE; + bool GetColorAt(int index, + cef_menu_color_type_t color_type, + cef_color_t& color) OVERRIDE; bool SetFontList(int command_id, const CefString& font_list) OVERRIDE; bool SetFontListAt(int index, const CefString& font_list) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc index 58600dbed..433fd9c79 100644 --- a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e789b2428bc059a5ccce8ce1a9cc756986fbcad0$ +// #include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefMenuModelDelegateCToCpp::ExecuteCommand( - CefRefPtr menu_model, int command_id, + CefRefPtr menu_model, + int command_id, cef_event_flags_t event_flags) { cef_menu_model_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, execute_command)) @@ -31,14 +33,13 @@ void CefMenuModelDelegateCToCpp::ExecuteCommand( return; // Execute - _struct->execute_command(_struct, - CefMenuModelCppToC::Wrap(menu_model), - command_id, - event_flags); + _struct->execute_command(_struct, CefMenuModelCppToC::Wrap(menu_model), + command_id, event_flags); } void CefMenuModelDelegateCToCpp::MouseOutsideMenu( - CefRefPtr menu_model, const CefPoint& screen_point) { + CefRefPtr menu_model, + const CefPoint& screen_point) { cef_menu_model_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, mouse_outside_menu)) return; @@ -51,13 +52,13 @@ void CefMenuModelDelegateCToCpp::MouseOutsideMenu( return; // Execute - _struct->mouse_outside_menu(_struct, - CefMenuModelCppToC::Wrap(menu_model), - &screen_point); + _struct->mouse_outside_menu(_struct, CefMenuModelCppToC::Wrap(menu_model), + &screen_point); } void CefMenuModelDelegateCToCpp::UnhandledOpenSubmenu( - CefRefPtr menu_model, bool is_rtl) { + CefRefPtr menu_model, + bool is_rtl) { cef_menu_model_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, unhandled_open_submenu)) return; @@ -70,13 +71,13 @@ void CefMenuModelDelegateCToCpp::UnhandledOpenSubmenu( return; // Execute - _struct->unhandled_open_submenu(_struct, - CefMenuModelCppToC::Wrap(menu_model), - is_rtl); + _struct->unhandled_open_submenu(_struct, CefMenuModelCppToC::Wrap(menu_model), + is_rtl); } void CefMenuModelDelegateCToCpp::UnhandledCloseSubmenu( - CefRefPtr menu_model, bool is_rtl) { + CefRefPtr menu_model, + bool is_rtl) { cef_menu_model_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, unhandled_close_submenu)) return; @@ -89,9 +90,8 @@ void CefMenuModelDelegateCToCpp::UnhandledCloseSubmenu( return; // Execute - _struct->unhandled_close_submenu(_struct, - CefMenuModelCppToC::Wrap(menu_model), - is_rtl); + _struct->unhandled_close_submenu( + _struct, CefMenuModelCppToC::Wrap(menu_model), is_rtl); } void CefMenuModelDelegateCToCpp::MenuWillShow( @@ -108,8 +108,7 @@ void CefMenuModelDelegateCToCpp::MenuWillShow( return; // Execute - _struct->menu_will_show(_struct, - CefMenuModelCppToC::Wrap(menu_model)); + _struct->menu_will_show(_struct, CefMenuModelCppToC::Wrap(menu_model)); } void CefMenuModelDelegateCToCpp::MenuClosed( @@ -126,12 +125,11 @@ void CefMenuModelDelegateCToCpp::MenuClosed( return; // Execute - _struct->menu_closed(_struct, - CefMenuModelCppToC::Wrap(menu_model)); + _struct->menu_closed(_struct, CefMenuModelCppToC::Wrap(menu_model)); } bool CefMenuModelDelegateCToCpp::FormatLabel(CefRefPtr menu_model, - CefString& label) { + CefString& label) { cef_menu_model_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, format_label)) return false; @@ -144,32 +142,37 @@ bool CefMenuModelDelegateCToCpp::FormatLabel(CefRefPtr menu_model, return false; // Execute - int _retval = _struct->format_label(_struct, - CefMenuModelCppToC::Wrap(menu_model), - label.GetWritableStruct()); + int _retval = _struct->format_label( + _struct, CefMenuModelCppToC::Wrap(menu_model), label.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefMenuModelDelegateCToCpp::CefMenuModelDelegateCToCpp() { -} +CefMenuModelDelegateCToCpp::CefMenuModelDelegateCToCpp() {} -template<> cef_menu_model_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefMenuModelDelegate* c) { +template <> +cef_menu_model_delegate_t* CefCToCppRefCounted< + CefMenuModelDelegateCToCpp, + CefMenuModelDelegate, + cef_menu_model_delegate_t>::UnwrapDerived(CefWrapperType type, + CefMenuModelDelegate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_MODEL_DELEGATE; diff --git a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h index 9e206507d..07a36a372 100644 --- a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4c41e357f90dc80d39d56b5e37fefdd2bcc99e92$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_DELEGATE_CTOCPP_H_ @@ -18,33 +20,35 @@ #error This file can be included DLL-side only #endif -#include "include/cef_menu_model_delegate.h" +#include "include/capi/cef_menu_model_capi.h" #include "include/capi/cef_menu_model_delegate_capi.h" #include "include/cef_menu_model.h" -#include "include/capi/cef_menu_model_capi.h" +#include "include/cef_menu_model_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefMenuModelDelegateCToCpp : public CefCToCppRefCounted { + CefMenuModelDelegate, + cef_menu_model_delegate_t> { public: CefMenuModelDelegateCToCpp(); // CefMenuModelDelegate methods. - void ExecuteCommand(CefRefPtr menu_model, int command_id, - cef_event_flags_t event_flags) override; + void ExecuteCommand(CefRefPtr menu_model, + int command_id, + cef_event_flags_t event_flags) override; void MouseOutsideMenu(CefRefPtr menu_model, - const CefPoint& screen_point) override; + const CefPoint& screen_point) override; void UnhandledOpenSubmenu(CefRefPtr menu_model, - bool is_rtl) override; + bool is_rtl) override; void UnhandledCloseSubmenu(CefRefPtr menu_model, - bool is_rtl) override; + bool is_rtl) override; void MenuWillShow(CefRefPtr menu_model) override; void MenuClosed(CefRefPtr menu_model) override; bool FormatLabel(CefRefPtr menu_model, - CefString& label) override; + CefString& label) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_DELEGATE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc index 5bd74ae04..71c735d47 100644 --- a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc +++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9b93796afe697e0e7e9925b0937fc8ee661f8d92$ +// #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" #include "libcef_dll/ctocpp/sslstatus_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefNavigationEntryCToCpp::IsValid() { @@ -27,7 +28,7 @@ bool CefNavigationEntryCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefNavigationEntryCToCpp::GetURL() { @@ -94,8 +95,8 @@ CefString CefNavigationEntryCToCpp::GetTitle() { return _retvalStr; } -CefNavigationEntry::TransitionType CefNavigationEntryCToCpp::GetTransitionType( - ) { +CefNavigationEntry::TransitionType +CefNavigationEntryCToCpp::GetTransitionType() { cef_navigation_entry_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_transition_type)) return TT_EXPLICIT; @@ -120,7 +121,7 @@ bool CefNavigationEntryCToCpp::HasPostData() { int _retval = _struct->has_post_data(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefTime CefNavigationEntryCToCpp::GetCompletionTime() { @@ -165,24 +166,30 @@ CefRefPtr CefNavigationEntryCToCpp::GetSSLStatus() { return CefSSLStatusCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefNavigationEntryCToCpp::CefNavigationEntryCToCpp() { -} +CefNavigationEntryCToCpp::CefNavigationEntryCToCpp() {} -template<> cef_navigation_entry_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefNavigationEntry* c) { +template <> +cef_navigation_entry_t* CefCToCppRefCounted< + CefNavigationEntryCToCpp, + CefNavigationEntry, + cef_navigation_entry_t>::UnwrapDerived(CefWrapperType type, + CefNavigationEntry* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_NAVIGATION_ENTRY; diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_ctocpp.h index e360e50c3..4d0e0cee3 100644 --- a/libcef_dll/ctocpp/navigation_entry_ctocpp.h +++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=132e1a6331558565dfde27b14bdda39bbc4a4b30$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_navigation_entry.h" #include "include/capi/cef_navigation_entry_capi.h" +#include "include/cef_navigation_entry.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefNavigationEntryCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefNavigationEntryCToCpp(); diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc index 1c853e69f..55ff28f55 100644 --- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc @@ -9,15 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=18f54750f071fa94a3397dedaf2b90c3d4fe3f4b$ +// #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" #include "libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry, - bool current, int index, int total) { + bool current, + int index, + int total) { cef_navigation_entry_visitor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, visit)) return false; @@ -30,35 +33,39 @@ bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry, return false; // Execute - int _retval = _struct->visit(_struct, - CefNavigationEntryCppToC::Wrap(entry), - current, - index, - total); + int _retval = _struct->visit(_struct, CefNavigationEntryCppToC::Wrap(entry), + current, index, total); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefNavigationEntryVisitorCToCpp::CefNavigationEntryVisitorCToCpp() { -} +CefNavigationEntryVisitorCToCpp::CefNavigationEntryVisitorCToCpp() {} -template<> cef_navigation_entry_visitor_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefNavigationEntryVisitor* c) { +template <> +cef_navigation_entry_visitor_t* CefCToCppRefCounted< + CefNavigationEntryVisitorCToCpp, + CefNavigationEntryVisitor, + cef_navigation_entry_visitor_t>::UnwrapDerived(CefWrapperType type, + CefNavigationEntryVisitor* + c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_NAVIGATION_ENTRY_VISITOR; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_NAVIGATION_ENTRY_VISITOR; diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h index 56c6ef2f4..93103f7c8 100644 --- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8ce312caa8233f37ffe4fbdc097dfc5238dda427$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ @@ -18,23 +20,26 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefNavigationEntryVisitorCToCpp : public CefCToCppRefCounted { + CefNavigationEntryVisitor, + cef_navigation_entry_visitor_t> { public: CefNavigationEntryVisitorCToCpp(); // CefNavigationEntryVisitor methods. - bool Visit(CefRefPtr entry, bool current, int index, - int total) override; + bool Visit(CefRefPtr entry, + bool current, + int index, + int total) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc index 2a29cc796..326e35b63 100644 --- a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d7aae81d3552e76b0fed3fdbd467fc1a89df7e97$ +// #include "libcef_dll/ctocpp/pdf_print_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefPdfPrintCallbackCToCpp::OnPdfPrintFinished(const CefString& path, - bool ok) { + bool ok) { cef_pdf_print_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_pdf_print_finished)) return; @@ -29,29 +30,33 @@ void CefPdfPrintCallbackCToCpp::OnPdfPrintFinished(const CefString& path, return; // Execute - _struct->on_pdf_print_finished(_struct, - path.GetStruct(), - ok); + _struct->on_pdf_print_finished(_struct, path.GetStruct(), ok); } - // CONSTRUCTOR - Do not edit by hand. -CefPdfPrintCallbackCToCpp::CefPdfPrintCallbackCToCpp() { -} +CefPdfPrintCallbackCToCpp::CefPdfPrintCallbackCToCpp() {} -template<> cef_pdf_print_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefPdfPrintCallback* c) { +template <> +cef_pdf_print_callback_t* CefCToCppRefCounted< + CefPdfPrintCallbackCToCpp, + CefPdfPrintCallback, + cef_pdf_print_callback_t>::UnwrapDerived(CefWrapperType type, + CefPdfPrintCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PDF_PRINT_CALLBACK; diff --git a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h index 961474b3c..db413c543 100644 --- a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h +++ b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5063e25fd11e6ecb5376c1bf0824ccb6e595f34c$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PDF_PRINT_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PDF_PRINT_CALLBACK_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefPdfPrintCallbackCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefPdfPrintCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc index 35b0aef7b..037b18bfc 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=62ea8e5f3c69adcb7cce5105e55bbca12373e533$ +// #include #include "libcef_dll/ctocpp/post_data_ctocpp.h" #include "libcef_dll/ctocpp/post_data_element_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefPostData::Create() { @@ -27,7 +28,6 @@ CefRefPtr CefPostData::Create() { return CefPostDataCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefPostDataCToCpp::IsReadOnly() { @@ -41,7 +41,7 @@ bool CefPostDataCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPostDataCToCpp::HasExcludedElements() { @@ -55,7 +55,7 @@ bool CefPostDataCToCpp::HasExcludedElements() { int _retval = _struct->has_excluded_elements(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefPostDataCToCpp::GetElementCount() { @@ -87,7 +87,7 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) { elementsList = new cef_post_data_element_t*[elementsCount]; DCHECK(elementsList); if (elementsList) { - memset(elementsList, 0, sizeof(cef_post_data_element_t*)*elementsCount); + memset(elementsList, 0, sizeof(cef_post_data_element_t*) * elementsCount); } if (elementsList && elementsSize > 0) { for (size_t i = 0; i < elementsSize; ++i) { @@ -97,9 +97,7 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) { } // Execute - _struct->get_elements(_struct, - &elementsCount, - elementsList); + _struct->get_elements(_struct, &elementsCount, elementsList); // Restore param:elements; type: refptr_vec_same_byref elements.clear(); @@ -107,7 +105,7 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) { for (size_t i = 0; i < elementsCount; ++i) { elements.push_back(CefPostDataElementCToCpp::Wrap(elementsList[i])); } - delete [] elementsList; + delete[] elementsList; } } @@ -124,11 +122,11 @@ bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { return false; // Execute - int _retval = _struct->remove_element(_struct, - CefPostDataElementCToCpp::Unwrap(element)); + int _retval = _struct->remove_element( + _struct, CefPostDataElementCToCpp::Unwrap(element)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPostDataCToCpp::AddElement(CefRefPtr element) { @@ -144,11 +142,11 @@ bool CefPostDataCToCpp::AddElement(CefRefPtr element) { return false; // Execute - int _retval = _struct->add_element(_struct, - CefPostDataElementCToCpp::Unwrap(element)); + int _retval = + _struct->add_element(_struct, CefPostDataElementCToCpp::Unwrap(element)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPostDataCToCpp::RemoveElements() { @@ -162,22 +160,27 @@ void CefPostDataCToCpp::RemoveElements() { _struct->remove_elements(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefPostDataCToCpp::CefPostDataCToCpp() { -} +CefPostDataCToCpp::CefPostDataCToCpp() {} -template<> cef_post_data_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefPostData* c) { +template <> +cef_post_data_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefPostData* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_POST_DATA; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_POST_DATA; diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h index 820b53871..07c5c0797 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c42ac838cae212695711e3e335c1a3ca439eda74$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefPostDataCToCpp - : public CefCToCppRefCounted { +class CefPostDataCToCpp : public CefCToCppRefCounted { public: CefPostDataCToCpp(); diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc index 7ad7a1eba..722f5daeb 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f66e7704d6938d0a6997fd7e7f575930659af430$ +// #include "libcef_dll/ctocpp/post_data_element_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefPostDataElement::Create() { @@ -25,7 +26,6 @@ CefRefPtr CefPostDataElement::Create() { return CefPostDataElementCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefPostDataElementCToCpp::IsReadOnly() { @@ -39,7 +39,7 @@ bool CefPostDataElementCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPostDataElementCToCpp::SetToEmpty() { @@ -66,8 +66,7 @@ void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { return; // Execute - _struct->set_to_file(_struct, - fileName.GetStruct()); + _struct->set_to_file(_struct, fileName.GetStruct()); } void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { @@ -83,9 +82,7 @@ void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { return; // Execute - _struct->set_to_bytes(_struct, - size, - bytes); + _struct->set_to_bytes(_struct, size, bytes); } CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { @@ -145,32 +142,36 @@ size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { return 0; // Execute - size_t _retval = _struct->get_bytes(_struct, - size, - bytes); + size_t _retval = _struct->get_bytes(_struct, size, bytes); // Return type: simple return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefPostDataElementCToCpp::CefPostDataElementCToCpp() { -} +CefPostDataElementCToCpp::CefPostDataElementCToCpp() {} -template<> cef_post_data_element_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefPostDataElement* c) { +template <> +cef_post_data_element_t* CefCToCppRefCounted< + CefPostDataElementCToCpp, + CefPostDataElement, + cef_post_data_element_t>::UnwrapDerived(CefWrapperType type, + CefPostDataElement* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_POST_DATA_ELEMENT; diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h index 019bc2b51..224e359b4 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=13866ee027fb1146fd9a76cae4a92357634a9739$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefPostDataElementCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefPostDataElementCToCpp(); diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc index ed9e40f17..aba3104ba 100644 --- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6cb42b7225acbf15f3a90243cb7d0edf55cf4f46$ +// #include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" #include "libcef_dll/ctocpp/print_settings_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefPrintDialogCallbackCToCpp::Continue( @@ -30,8 +31,7 @@ void CefPrintDialogCallbackCToCpp::Continue( return; // Execute - _struct->cont(_struct, - CefPrintSettingsCToCpp::Unwrap(settings)); + _struct->cont(_struct, CefPrintSettingsCToCpp::Unwrap(settings)); } void CefPrintDialogCallbackCToCpp::Cancel() { @@ -45,24 +45,30 @@ void CefPrintDialogCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefPrintDialogCallbackCToCpp::CefPrintDialogCallbackCToCpp() { -} +CefPrintDialogCallbackCToCpp::CefPrintDialogCallbackCToCpp() {} -template<> cef_print_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefPrintDialogCallback* c) { +template <> +cef_print_dialog_callback_t* CefCToCppRefCounted< + CefPrintDialogCallbackCToCpp, + CefPrintDialogCallback, + cef_print_dialog_callback_t>::UnwrapDerived(CefWrapperType type, + CefPrintDialogCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h index db4e74d47..3c0bba3cf 100644 --- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3b7cafc5ff0eafb1ebcd8301992f34aeb5856e69$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefPrintDialogCallbackCToCpp : public CefCToCppRefCounted { + CefPrintDialogCallback, + cef_print_dialog_callback_t> { public: CefPrintDialogCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc index 301255fab..d096a4de7 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0749b78aaf8f69cd706962477d4d0241c93cf333$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h" @@ -16,7 +18,6 @@ #include "libcef_dll/cpptoc/print_settings_cpptoc.h" #include "libcef_dll/ctocpp/print_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefPrintHandlerCToCpp::OnPrintStart(CefRefPtr browser) { @@ -32,12 +33,12 @@ void CefPrintHandlerCToCpp::OnPrintStart(CefRefPtr browser) { return; // Execute - _struct->on_print_start(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_print_start(_struct, CefBrowserCppToC::Wrap(browser)); } void CefPrintHandlerCToCpp::OnPrintSettings( - CefRefPtr settings, bool get_defaults) { + CefRefPtr settings, + bool get_defaults) { cef_print_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_print_settings)) return; @@ -50,12 +51,12 @@ void CefPrintHandlerCToCpp::OnPrintSettings( return; // Execute - _struct->on_print_settings(_struct, - CefPrintSettingsCppToC::Wrap(settings), - get_defaults); + _struct->on_print_settings(_struct, CefPrintSettingsCppToC::Wrap(settings), + get_defaults); } -bool CefPrintHandlerCToCpp::OnPrintDialog(bool has_selection, +bool CefPrintHandlerCToCpp::OnPrintDialog( + bool has_selection, CefRefPtr callback) { cef_print_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_print_dialog)) @@ -69,16 +70,17 @@ bool CefPrintHandlerCToCpp::OnPrintDialog(bool has_selection, return false; // Execute - int _retval = _struct->on_print_dialog(_struct, - has_selection, - CefPrintDialogCallbackCppToC::Wrap(callback)); + int _retval = _struct->on_print_dialog( + _struct, has_selection, CefPrintDialogCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefPrintHandlerCToCpp::OnPrintJob(const CefString& document_name, - const CefString& pdf_file_path, CefRefPtr callback) { +bool CefPrintHandlerCToCpp::OnPrintJob( + const CefString& document_name, + const CefString& pdf_file_path, + CefRefPtr callback) { cef_print_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_print_job)) return false; @@ -99,13 +101,12 @@ bool CefPrintHandlerCToCpp::OnPrintJob(const CefString& document_name, return false; // Execute - int _retval = _struct->on_print_job(_struct, - document_name.GetStruct(), - pdf_file_path.GetStruct(), + int _retval = _struct->on_print_job( + _struct, document_name.GetStruct(), pdf_file_path.GetStruct(), CefPrintJobCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPrintHandlerCToCpp::OnPrintReset() { @@ -127,30 +128,36 @@ CefSize CefPrintHandlerCToCpp::GetPdfPaperSize(int device_units_per_inch) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_size_t _retval = _struct->get_pdf_paper_size(_struct, - device_units_per_inch); + cef_size_t _retval = + _struct->get_pdf_paper_size(_struct, device_units_per_inch); // Return type: simple return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefPrintHandlerCToCpp::CefPrintHandlerCToCpp() { -} +CefPrintHandlerCToCpp::CefPrintHandlerCToCpp() {} -template<> cef_print_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefPrintHandler* c) { +template <> +cef_print_handler_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefPrintHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_PRINT_HANDLER; diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h index e063ff08c..767acf72a 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.h +++ b/libcef_dll/ctocpp/print_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=104e754c5019270e7bd700c6b979891f1275f9a7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ @@ -18,27 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefPrintHandlerCToCpp - : public CefCToCppRefCounted { +class CefPrintHandlerCToCpp : public CefCToCppRefCounted { public: CefPrintHandlerCToCpp(); // CefPrintHandler methods. void OnPrintStart(CefRefPtr browser) override; void OnPrintSettings(CefRefPtr settings, - bool get_defaults) override; + bool get_defaults) override; bool OnPrintDialog(bool has_selection, - CefRefPtr callback) override; + CefRefPtr callback) override; bool OnPrintJob(const CefString& document_name, - const CefString& pdf_file_path, - CefRefPtr callback) override; + const CefString& pdf_file_path, + CefRefPtr callback) override; void OnPrintReset() override; CefSize GetPdfPaperSize(int device_units_per_inch) override; }; diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc index 74d0dc291..86395e633 100644 --- a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8213d4426eef64d20c16ae466f5c03c1cae911dd$ +// #include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefPrintJobCallbackCToCpp::Continue() { @@ -26,24 +27,30 @@ void CefPrintJobCallbackCToCpp::Continue() { _struct->cont(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefPrintJobCallbackCToCpp::CefPrintJobCallbackCToCpp() { -} +CefPrintJobCallbackCToCpp::CefPrintJobCallbackCToCpp() {} -template<> cef_print_job_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefPrintJobCallback* c) { +template <> +cef_print_job_callback_t* CefCToCppRefCounted< + CefPrintJobCallbackCToCpp, + CefPrintJobCallback, + cef_print_job_callback_t>::UnwrapDerived(CefWrapperType type, + CefPrintJobCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_JOB_CALLBACK; diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.h b/libcef_dll/ctocpp/print_job_callback_ctocpp.h index 129a7e989..0f818851f 100644 --- a/libcef_dll/ctocpp/print_job_callback_ctocpp.h +++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4e509d2e658e168c9d498572b98273d2bddeec9d$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" +#include "include/cef_print_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefPrintJobCallbackCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefPrintJobCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.cc b/libcef_dll/ctocpp/print_settings_ctocpp.cc index 7d80f72c0..346a80251 100644 --- a/libcef_dll/ctocpp/print_settings_ctocpp.cc +++ b/libcef_dll/ctocpp/print_settings_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7dea8c243d0082bc8a9cf98e4b8b2e58d7d02602$ +// #include #include "libcef_dll/ctocpp/print_settings_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefPrintSettings::Create() { @@ -26,7 +27,6 @@ CefRefPtr CefPrintSettings::Create() { return CefPrintSettingsCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefPrintSettingsCToCpp::IsValid() { @@ -40,7 +40,7 @@ bool CefPrintSettingsCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPrintSettingsCToCpp::IsReadOnly() { @@ -54,7 +54,7 @@ bool CefPrintSettingsCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefPrintSettingsCToCpp::Copy() { @@ -79,8 +79,7 @@ void CefPrintSettingsCToCpp::SetOrientation(bool landscape) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_orientation(_struct, - landscape); + _struct->set_orientation(_struct, landscape); } bool CefPrintSettingsCToCpp::IsLandscape() { @@ -94,12 +93,13 @@ bool CefPrintSettingsCToCpp::IsLandscape() { int _retval = _struct->is_landscape(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPrintSettingsCToCpp::SetPrinterPrintableArea( const CefSize& physical_size_device_units, - const CefRect& printable_area_device_units, bool landscape_needs_flip) { + const CefRect& printable_area_device_units, + bool landscape_needs_flip) { cef_print_settings_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_printer_printable_area)) return; @@ -107,10 +107,9 @@ void CefPrintSettingsCToCpp::SetPrinterPrintableArea( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_printer_printable_area(_struct, - &physical_size_device_units, - &printable_area_device_units, - landscape_needs_flip); + _struct->set_printer_printable_area(_struct, &physical_size_device_units, + &printable_area_device_units, + landscape_needs_flip); } void CefPrintSettingsCToCpp::SetDeviceName(const CefString& name) { @@ -123,8 +122,7 @@ void CefPrintSettingsCToCpp::SetDeviceName(const CefString& name) { // Unverified params: name // Execute - _struct->set_device_name(_struct, - name.GetStruct()); + _struct->set_device_name(_struct, name.GetStruct()); } CefString CefPrintSettingsCToCpp::GetDeviceName() { @@ -151,8 +149,7 @@ void CefPrintSettingsCToCpp::SetDPI(int dpi) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_dpi(_struct, - dpi); + _struct->set_dpi(_struct, dpi); } int CefPrintSettingsCToCpp::GetDPI() { @@ -190,13 +187,11 @@ void CefPrintSettingsCToCpp::SetPageRanges(const PageRangeList& ranges) { } // Execute - _struct->set_page_ranges(_struct, - rangesCount, - rangesList); + _struct->set_page_ranges(_struct, rangesCount, rangesList); // Restore param:ranges; type: simple_vec_byref_const if (rangesList) - delete [] rangesList; + delete[] rangesList; } size_t CefPrintSettingsCToCpp::GetPageRangesCount() { @@ -228,7 +223,7 @@ void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { rangesList = new cef_range_t[rangesCount]; DCHECK(rangesList); if (rangesList) { - memset(rangesList, 0, sizeof(cef_range_t)*rangesCount); + memset(rangesList, 0, sizeof(cef_range_t) * rangesCount); } if (rangesList && rangesSize > 0) { for (size_t i = 0; i < rangesSize; ++i) { @@ -238,9 +233,7 @@ void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { } // Execute - _struct->get_page_ranges(_struct, - &rangesCount, - rangesList); + _struct->get_page_ranges(_struct, &rangesCount, rangesList); // Restore param:ranges; type: simple_vec_byref ranges.clear(); @@ -248,7 +241,7 @@ void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { for (size_t i = 0; i < rangesCount; ++i) { ranges.push_back(rangesList[i]); } - delete [] rangesList; + delete[] rangesList; } } @@ -260,8 +253,7 @@ void CefPrintSettingsCToCpp::SetSelectionOnly(bool selection_only) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_selection_only(_struct, - selection_only); + _struct->set_selection_only(_struct, selection_only); } bool CefPrintSettingsCToCpp::IsSelectionOnly() { @@ -275,7 +267,7 @@ bool CefPrintSettingsCToCpp::IsSelectionOnly() { int _retval = _struct->is_selection_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPrintSettingsCToCpp::SetCollate(bool collate) { @@ -286,8 +278,7 @@ void CefPrintSettingsCToCpp::SetCollate(bool collate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_collate(_struct, - collate); + _struct->set_collate(_struct, collate); } bool CefPrintSettingsCToCpp::WillCollate() { @@ -301,7 +292,7 @@ bool CefPrintSettingsCToCpp::WillCollate() { int _retval = _struct->will_collate(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPrintSettingsCToCpp::SetColorModel(ColorModel model) { @@ -312,8 +303,7 @@ void CefPrintSettingsCToCpp::SetColorModel(ColorModel model) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_color_model(_struct, - model); + _struct->set_color_model(_struct, model); } CefPrintSettings::ColorModel CefPrintSettingsCToCpp::GetColorModel() { @@ -338,8 +328,7 @@ void CefPrintSettingsCToCpp::SetCopies(int copies) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_copies(_struct, - copies); + _struct->set_copies(_struct, copies); } int CefPrintSettingsCToCpp::GetCopies() { @@ -364,8 +353,7 @@ void CefPrintSettingsCToCpp::SetDuplexMode(DuplexMode mode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_duplex_mode(_struct, - mode); + _struct->set_duplex_mode(_struct, mode); } CefPrintSettings::DuplexMode CefPrintSettingsCToCpp::GetDuplexMode() { @@ -382,23 +370,29 @@ CefPrintSettings::DuplexMode CefPrintSettingsCToCpp::GetDuplexMode() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefPrintSettingsCToCpp::CefPrintSettingsCToCpp() { -} +CefPrintSettingsCToCpp::CefPrintSettingsCToCpp() {} -template<> cef_print_settings_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefPrintSettings* c) { +template <> +cef_print_settings_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefPrintSettings* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_SETTINGS; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_PRINT_SETTINGS; diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.h b/libcef_dll/ctocpp/print_settings_ctocpp.h index b07988fa9..147f3f550 100644 --- a/libcef_dll/ctocpp/print_settings_ctocpp.h +++ b/libcef_dll/ctocpp/print_settings_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a1320a64f63df47ffc59cdc4cf5859f1b877a0a7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_print_settings.h" #include "include/capi/cef_print_settings_capi.h" +#include "include/cef_print_settings.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefPrintSettingsCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefPrintSettingsCToCpp(); @@ -37,8 +40,8 @@ class CefPrintSettingsCToCpp void SetOrientation(bool landscape) OVERRIDE; bool IsLandscape() OVERRIDE; void SetPrinterPrintableArea(const CefSize& physical_size_device_units, - const CefRect& printable_area_device_units, - bool landscape_needs_flip) OVERRIDE; + const CefRect& printable_area_device_units, + bool landscape_needs_flip) OVERRIDE; void SetDeviceName(const CefString& name) OVERRIDE; CefString GetDeviceName() OVERRIDE; void SetDPI(int dpi) OVERRIDE; diff --git a/libcef_dll/ctocpp/process_message_ctocpp.cc b/libcef_dll/ctocpp/process_message_ctocpp.cc index acf98c59b..3ad99e502 100644 --- a/libcef_dll/ctocpp/process_message_ctocpp.cc +++ b/libcef_dll/ctocpp/process_message_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8d022d9bff90419f3c199e1ee0068945cf6329f1$ +// #include "libcef_dll/ctocpp/list_value_ctocpp.h" #include "libcef_dll/ctocpp/process_message_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefProcessMessage::Create(const CefString& name) { @@ -25,14 +26,12 @@ CefRefPtr CefProcessMessage::Create(const CefString& name) { return NULL; // Execute - cef_process_message_t* _retval = cef_process_message_create( - name.GetStruct()); + cef_process_message_t* _retval = cef_process_message_create(name.GetStruct()); // Return type: refptr_same return CefProcessMessageCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefProcessMessageCToCpp::IsValid() { @@ -46,7 +45,7 @@ bool CefProcessMessageCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefProcessMessageCToCpp::IsReadOnly() { @@ -60,7 +59,7 @@ bool CefProcessMessageCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefProcessMessageCToCpp::Copy() { @@ -107,24 +106,29 @@ CefRefPtr CefProcessMessageCToCpp::GetArgumentList() { return CefListValueCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefProcessMessageCToCpp::CefProcessMessageCToCpp() { -} +CefProcessMessageCToCpp::CefProcessMessageCToCpp() {} -template<> cef_process_message_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefProcessMessage* c) { +template <> +cef_process_message_t* CefCToCppRefCounted< + CefProcessMessageCToCpp, + CefProcessMessage, + cef_process_message_t>::UnwrapDerived(CefWrapperType type, + CefProcessMessage* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PROCESS_MESSAGE; diff --git a/libcef_dll/ctocpp/process_message_ctocpp.h b/libcef_dll/ctocpp/process_message_ctocpp.h index a3b209a45..2ec39fb90 100644 --- a/libcef_dll/ctocpp/process_message_ctocpp.h +++ b/libcef_dll/ctocpp/process_message_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=12096d5fdfd928cef1cf8a3752f8f08c04444c97$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_process_message.h" #include "include/capi/cef_process_message_capi.h" +#include "include/cef_process_message.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefProcessMessageCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefProcessMessageCToCpp(); diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc index 2a3d781bd..0d879a1af 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e6cce9479e55e626246b278bc40c43bbdebd4746$ +// #include "libcef_dll/ctocpp/read_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { @@ -28,10 +29,7 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = _struct->read(_struct, - ptr, - size, - n); + size_t _retval = _struct->read(_struct, ptr, size, n); // Return type: simple return _retval; @@ -45,9 +43,7 @@ int CefReadHandlerCToCpp::Seek(int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->seek(_struct, - offset, - whence); + int _retval = _struct->seek(_struct, offset, whence); // Return type: simple return _retval; @@ -92,26 +88,30 @@ bool CefReadHandlerCToCpp::MayBlock() { int _retval = _struct->may_block(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefReadHandlerCToCpp::CefReadHandlerCToCpp() { -} +CefReadHandlerCToCpp::CefReadHandlerCToCpp() {} -template<> cef_read_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefReadHandler* c) { +template <> +cef_read_handler_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefReadHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_READ_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_READ_HANDLER; diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h index 6f5159e22..71d79cb92 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.h +++ b/libcef_dll/ctocpp/read_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=84206eea2ffe23ccc9e9db1d5f3effea4611d28c$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefReadHandlerCToCpp - : public CefCToCppRefCounted { +class CefReadHandlerCToCpp : public CefCToCppRefCounted { public: CefReadHandlerCToCpp(); diff --git a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc index 65c7db096..ce7c03d28 100644 --- a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc @@ -9,14 +9,16 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3f82b194276294c2480a3e266d0610c09b767f21$ +// #include "libcef_dll/ctocpp/register_cdm_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefRegisterCdmCallbackCToCpp::OnCdmRegistrationComplete( - cef_cdm_registration_error_t result, const CefString& error_message) { + cef_cdm_registration_error_t result, + const CefString& error_message) { cef_register_cdm_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_cdm_registration_complete)) return; @@ -26,29 +28,34 @@ void CefRegisterCdmCallbackCToCpp::OnCdmRegistrationComplete( // Unverified params: error_message // Execute - _struct->on_cdm_registration_complete(_struct, - result, - error_message.GetStruct()); + _struct->on_cdm_registration_complete(_struct, result, + error_message.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefRegisterCdmCallbackCToCpp::CefRegisterCdmCallbackCToCpp() { -} +CefRegisterCdmCallbackCToCpp::CefRegisterCdmCallbackCToCpp() {} -template<> cef_register_cdm_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRegisterCdmCallback* c) { +template <> +cef_register_cdm_callback_t* CefCToCppRefCounted< + CefRegisterCdmCallbackCToCpp, + CefRegisterCdmCallback, + cef_register_cdm_callback_t>::UnwrapDerived(CefWrapperType type, + CefRegisterCdmCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REGISTER_CDM_CALLBACK; diff --git a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h index d7c0e2549..82af17882 100644 --- a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h +++ b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8faf541fd61f1542dab47ee52b7dc5863889d673$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REGISTER_CDM_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REGISTER_CDM_CALLBACK_CTOCPP_H_ @@ -18,23 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRegisterCdmCallbackCToCpp : public CefCToCppRefCounted { + CefRegisterCdmCallback, + cef_register_cdm_callback_t> { public: CefRegisterCdmCallbackCToCpp(); // CefRegisterCdmCallback methods. void OnCdmRegistrationComplete(cef_cdm_registration_error_t result, - const CefString& error_message) override; + const CefString& error_message) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_REGISTER_CDM_CALLBACK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index 867f93814..81700c470 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1266c6cf5ac224eb92dc0e999287dece4b2ac0b0$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/drag_data_cpptoc.h" #include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h" #include "libcef_dll/ctocpp/render_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. -CefRefPtr CefRenderHandlerCToCpp::GetAccessibilityHandler( - ) { +CefRefPtr +CefRenderHandlerCToCpp::GetAccessibilityHandler() { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_accessibility_handler)) return NULL; @@ -27,15 +28,15 @@ CefRefPtr CefRenderHandlerCToCpp::GetAccessibilityHandl // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_accessibility_handler_t* _retval = _struct->get_accessibility_handler( - _struct); + cef_accessibility_handler_t* _retval = + _struct->get_accessibility_handler(_struct); // Return type: refptr_same return CefAccessibilityHandlerCToCpp::Wrap(_retval); } bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, - CefRect& rect) { + CefRect& rect) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_root_screen_rect)) return false; @@ -48,16 +49,15 @@ bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, return false; // Execute - int _retval = _struct->get_root_screen_rect(_struct, - CefBrowserCppToC::Wrap(browser), - &rect); + int _retval = _struct->get_root_screen_rect( + _struct, CefBrowserCppToC::Wrap(browser), &rect); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, - CefRect& rect) { + CefRect& rect) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_view_rect)) return false; @@ -70,16 +70,18 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, return false; // Execute - int _retval = _struct->get_view_rect(_struct, - CefBrowserCppToC::Wrap(browser), - &rect); + int _retval = + _struct->get_view_rect(_struct, CefBrowserCppToC::Wrap(browser), &rect); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, - int viewX, int viewY, int& screenX, int& screenY) { + int viewX, + int viewY, + int& screenX, + int& screenY) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_screen_point)) return false; @@ -92,19 +94,16 @@ bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, return false; // Execute - int _retval = _struct->get_screen_point(_struct, - CefBrowserCppToC::Wrap(browser), - viewX, - viewY, - &screenX, - &screenY); + int _retval = + _struct->get_screen_point(_struct, CefBrowserCppToC::Wrap(browser), viewX, + viewY, &screenX, &screenY); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRenderHandlerCToCpp::GetScreenInfo(CefRefPtr browser, - CefScreenInfo& screen_info) { + CefScreenInfo& screen_info) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_screen_info)) return false; @@ -117,16 +116,15 @@ bool CefRenderHandlerCToCpp::GetScreenInfo(CefRefPtr browser, return false; // Execute - int _retval = _struct->get_screen_info(_struct, - CefBrowserCppToC::Wrap(browser), - &screen_info); + int _retval = _struct->get_screen_info( + _struct, CefBrowserCppToC::Wrap(browser), &screen_info); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, - bool show) { + bool show) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_popup_show)) return; @@ -139,13 +137,11 @@ void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, return; // Execute - _struct->on_popup_show(_struct, - CefBrowserCppToC::Wrap(browser), - show); + _struct->on_popup_show(_struct, CefBrowserCppToC::Wrap(browser), show); } void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, - const CefRect& rect) { + const CefRect& rect) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_popup_size)) return; @@ -158,14 +154,15 @@ void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, return; // Execute - _struct->on_popup_size(_struct, - CefBrowserCppToC::Wrap(browser), - &rect); + _struct->on_popup_size(_struct, CefBrowserCppToC::Wrap(browser), &rect); } void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, - PaintElementType type, const RectList& dirtyRects, const void* buffer, - int width, int height) { + PaintElementType type, + const RectList& dirtyRects, + const void* buffer, + int width, + int height) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_paint)) return; @@ -195,22 +192,18 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, } // Execute - _struct->on_paint(_struct, - CefBrowserCppToC::Wrap(browser), - type, - dirtyRectsCount, - dirtyRectsList, - buffer, - width, - height); + _struct->on_paint(_struct, CefBrowserCppToC::Wrap(browser), type, + dirtyRectsCount, dirtyRectsList, buffer, width, height); // Restore param:dirtyRects; type: simple_vec_byref_const if (dirtyRectsList) - delete [] dirtyRectsList; + delete[] dirtyRectsList; } -void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, - CefCursorHandle cursor, CursorType type, +void CefRenderHandlerCToCpp::OnCursorChange( + CefRefPtr browser, + CefCursorHandle cursor, + CursorType type, const CefCursorInfo& custom_cursor_info) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_cursor_change)) @@ -224,16 +217,15 @@ void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, return; // Execute - _struct->on_cursor_change(_struct, - CefBrowserCppToC::Wrap(browser), - cursor, - type, - &custom_cursor_info); + _struct->on_cursor_change(_struct, CefBrowserCppToC::Wrap(browser), cursor, + type, &custom_cursor_info); } bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr browser, - CefRefPtr drag_data, DragOperationsMask allowed_ops, int x, - int y) { + CefRefPtr drag_data, + DragOperationsMask allowed_ops, + int x, + int y) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, start_dragging)) return false; @@ -250,19 +242,16 @@ bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr browser, return false; // Execute - int _retval = _struct->start_dragging(_struct, - CefBrowserCppToC::Wrap(browser), - CefDragDataCppToC::Wrap(drag_data), - allowed_ops, - x, - y); + int _retval = _struct->start_dragging( + _struct, CefBrowserCppToC::Wrap(browser), + CefDragDataCppToC::Wrap(drag_data), allowed_ops, x, y); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr browser, - DragOperation operation) { + DragOperation operation) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, update_drag_cursor)) return; @@ -275,13 +264,14 @@ void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr browser, return; // Execute - _struct->update_drag_cursor(_struct, - CefBrowserCppToC::Wrap(browser), - operation); + _struct->update_drag_cursor(_struct, CefBrowserCppToC::Wrap(browser), + operation); } void CefRenderHandlerCToCpp::OnScrollOffsetChanged( - CefRefPtr browser, double x, double y) { + CefRefPtr browser, + double x, + double y) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_scroll_offset_changed)) return; @@ -294,14 +284,13 @@ void CefRenderHandlerCToCpp::OnScrollOffsetChanged( return; // Execute - _struct->on_scroll_offset_changed(_struct, - CefBrowserCppToC::Wrap(browser), - x, - y); + _struct->on_scroll_offset_changed(_struct, CefBrowserCppToC::Wrap(browser), x, + y); } void CefRenderHandlerCToCpp::OnImeCompositionRangeChanged( - CefRefPtr browser, const CefRange& selected_range, + CefRefPtr browser, + const CefRange& selected_range, const RectList& character_bounds) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_ime_composition_range_changed)) @@ -328,34 +317,38 @@ void CefRenderHandlerCToCpp::OnImeCompositionRangeChanged( } // Execute - _struct->on_ime_composition_range_changed(_struct, - CefBrowserCppToC::Wrap(browser), - &selected_range, - character_boundsCount, - character_boundsList); + _struct->on_ime_composition_range_changed( + _struct, CefBrowserCppToC::Wrap(browser), &selected_range, + character_boundsCount, character_boundsList); // Restore param:character_bounds; type: simple_vec_byref_const if (character_boundsList) - delete [] character_boundsList; + delete[] character_boundsList; } - // CONSTRUCTOR - Do not edit by hand. -CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() { -} +CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() {} -template<> cef_render_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefRenderHandler* c) { +template <> +cef_render_handler_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefRenderHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RENDER_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_RENDER_HANDLER; diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index 84b9509ec..2e0789745 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f130f820959643bdc5e10628e3f6cd81e07d79ea$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_render_handler.h" #include "include/capi/cef_render_handler_capi.h" +#include "include/cef_render_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRenderHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefRenderHandlerCToCpp(); @@ -34,27 +37,38 @@ class CefRenderHandlerCToCpp CefRefPtr GetAccessibilityHandler() override; bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) override; bool GetViewRect(CefRefPtr browser, CefRect& rect) override; - bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, - int& screenX, int& screenY) override; + bool GetScreenPoint(CefRefPtr browser, + int viewX, + int viewY, + int& screenX, + int& screenY) override; bool GetScreenInfo(CefRefPtr browser, - CefScreenInfo& screen_info) override; + CefScreenInfo& screen_info) override; void OnPopupShow(CefRefPtr browser, bool show) override; void OnPopupSize(CefRefPtr browser, const CefRect& rect) override; - void OnPaint(CefRefPtr browser, PaintElementType type, - const RectList& dirtyRects, const void* buffer, int width, - int height) override; - void OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, - CursorType type, const CefCursorInfo& custom_cursor_info) override; + void OnPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const void* buffer, + int width, + int height) override; + void OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CursorType type, + const CefCursorInfo& custom_cursor_info) override; bool StartDragging(CefRefPtr browser, - CefRefPtr drag_data, DragOperationsMask allowed_ops, int x, - int y) override; + CefRefPtr drag_data, + DragOperationsMask allowed_ops, + int x, + int y) override; void UpdateDragCursor(CefRefPtr browser, - DragOperation operation) override; - void OnScrollOffsetChanged(CefRefPtr browser, double x, - double y) override; + DragOperation operation) override; + void OnScrollOffsetChanged(CefRefPtr browser, + double x, + double y) override; void OnImeCompositionRangeChanged(CefRefPtr browser, - const CefRange& selected_range, - const RectList& character_bounds) override; + const CefRange& selected_range, + const RectList& character_bounds) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc index 78ea66135..598ee6022 100644 --- a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e31c65768a5ec576b9dc22888d39dfbe04ab2dc5$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/domnode_cpptoc.h" @@ -22,7 +24,6 @@ #include "libcef_dll/ctocpp/load_handler_ctocpp.h" #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated( @@ -40,7 +41,7 @@ void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated( // Execute _struct->on_render_thread_created(_struct, - CefListValueCppToC::Wrap(extra_info)); + CefListValueCppToC::Wrap(extra_info)); } void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() { @@ -68,8 +69,7 @@ void CefRenderProcessHandlerCToCpp::OnBrowserCreated( return; // Execute - _struct->on_browser_created(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_browser_created(_struct, CefBrowserCppToC::Wrap(browser)); } void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed( @@ -86,8 +86,7 @@ void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed( return; // Execute - _struct->on_browser_destroyed(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_browser_destroyed(_struct, CefBrowserCppToC::Wrap(browser)); } CefRefPtr CefRenderProcessHandlerCToCpp::GetLoadHandler() { @@ -105,8 +104,10 @@ CefRefPtr CefRenderProcessHandlerCToCpp::GetLoadHandler() { } bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr request, NavigationType navigation_type, + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + NavigationType navigation_type, bool is_redirect) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_navigation)) @@ -128,19 +129,17 @@ bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation( return false; // Execute - int _retval = _struct->on_before_navigation(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - navigation_type, - is_redirect); + int _retval = _struct->on_before_navigation( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), navigation_type, is_redirect); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRenderProcessHandlerCToCpp::OnContextCreated( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr context) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_context_created)) @@ -162,14 +161,14 @@ void CefRenderProcessHandlerCToCpp::OnContextCreated( return; // Execute - _struct->on_context_created(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefV8ContextCppToC::Wrap(context)); + _struct->on_context_created(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefV8ContextCppToC::Wrap(context)); } void CefRenderProcessHandlerCToCpp::OnContextReleased( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr context) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_context_released)) @@ -191,15 +190,16 @@ void CefRenderProcessHandlerCToCpp::OnContextReleased( return; // Execute - _struct->on_context_released(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefV8ContextCppToC::Wrap(context)); + _struct->on_context_released(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefV8ContextCppToC::Wrap(context)); } void CefRenderProcessHandlerCToCpp::OnUncaughtException( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr context, CefRefPtr exception, + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context, + CefRefPtr exception, CefRefPtr stackTrace) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_uncaught_exception)) @@ -229,16 +229,15 @@ void CefRenderProcessHandlerCToCpp::OnUncaughtException( return; // Execute - _struct->on_uncaught_exception(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefV8ContextCppToC::Wrap(context), - CefV8ExceptionCppToC::Wrap(exception), + _struct->on_uncaught_exception( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefV8ContextCppToC::Wrap(context), CefV8ExceptionCppToC::Wrap(exception), CefV8StackTraceCppToC::Wrap(stackTrace)); } void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr node) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_focused_node_changed)) @@ -253,14 +252,14 @@ void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged( // Unverified params: frame, node // Execute - _struct->on_focused_node_changed(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefDOMNodeCppToC::Wrap(node)); + _struct->on_focused_node_changed(_struct, CefBrowserCppToC::Wrap(browser), + CefFrameCppToC::Wrap(frame), + CefDOMNodeCppToC::Wrap(node)); } bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived( - CefRefPtr browser, CefProcessId source_process, + CefRefPtr browser, + CefProcessId source_process, CefRefPtr message) { cef_render_process_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_process_message_received)) @@ -278,33 +277,38 @@ bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived( return false; // Execute - int _retval = _struct->on_process_message_received(_struct, - CefBrowserCppToC::Wrap(browser), - source_process, + int _retval = _struct->on_process_message_received( + _struct, CefBrowserCppToC::Wrap(browser), source_process, CefProcessMessageCppToC::Wrap(message)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefRenderProcessHandlerCToCpp::CefRenderProcessHandlerCToCpp() { -} +CefRenderProcessHandlerCToCpp::CefRenderProcessHandlerCToCpp() {} -template<> cef_render_process_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRenderProcessHandler* c) { +template <> +cef_render_process_handler_t* CefCToCppRefCounted< + CefRenderProcessHandlerCToCpp, + CefRenderProcessHandler, + cef_render_process_handler_t>::UnwrapDerived(CefWrapperType type, + CefRenderProcessHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RENDER_PROCESS_HANDLER; diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.h b/libcef_dll/ctocpp/render_process_handler_ctocpp.h index a4274e97f..d8a7bd9c9 100644 --- a/libcef_dll/ctocpp/render_process_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=fb6e44f2dbdbf3baea36d79448a2749848f21643$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_render_process_handler.h" #include "include/capi/cef_render_process_handler_capi.h" +#include "include/cef_render_process_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRenderProcessHandlerCToCpp : public CefCToCppRefCounted { + CefRenderProcessHandler, + cef_render_process_handler_t> { public: CefRenderProcessHandlerCToCpp(); @@ -37,21 +40,27 @@ class CefRenderProcessHandlerCToCpp void OnBrowserDestroyed(CefRefPtr browser) override; CefRefPtr GetLoadHandler() override; bool OnBeforeNavigation(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - NavigationType navigation_type, bool is_redirect) override; + CefRefPtr frame, + CefRefPtr request, + NavigationType navigation_type, + bool is_redirect) override; void OnContextCreated(CefRefPtr browser, - CefRefPtr frame, CefRefPtr context) override; + CefRefPtr frame, + CefRefPtr context) override; void OnContextReleased(CefRefPtr browser, - CefRefPtr frame, CefRefPtr context) override; + CefRefPtr frame, + CefRefPtr context) override; void OnUncaughtException(CefRefPtr browser, - CefRefPtr frame, CefRefPtr context, - CefRefPtr exception, - CefRefPtr stackTrace) override; + CefRefPtr frame, + CefRefPtr context, + CefRefPtr exception, + CefRefPtr stackTrace) override; void OnFocusedNodeChanged(CefRefPtr browser, - CefRefPtr frame, CefRefPtr node) override; + CefRefPtr frame, + CefRefPtr node) override; bool OnProcessMessageReceived(CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override; + CefProcessId source_process, + CefRefPtr message) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.cc b/libcef_dll/ctocpp/request_callback_ctocpp.cc index f287fd61a..3fbfab1f1 100644 --- a/libcef_dll/ctocpp/request_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/request_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=eb26fb79e218ac49035cc0097fe82f394e880df7$ +// #include "libcef_dll/ctocpp/request_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefRequestCallbackCToCpp::Continue(bool allow) { @@ -23,8 +24,7 @@ void CefRequestCallbackCToCpp::Continue(bool allow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->cont(_struct, - allow); + _struct->cont(_struct, allow); } void CefRequestCallbackCToCpp::Cancel() { @@ -38,24 +38,30 @@ void CefRequestCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefRequestCallbackCToCpp::CefRequestCallbackCToCpp() { -} +CefRequestCallbackCToCpp::CefRequestCallbackCToCpp() {} -template<> cef_request_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRequestCallback* c) { +template <> +cef_request_callback_t* CefCToCppRefCounted< + CefRequestCallbackCToCpp, + CefRequestCallback, + cef_request_callback_t>::UnwrapDerived(CefWrapperType type, + CefRequestCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST_CALLBACK; diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.h b/libcef_dll/ctocpp/request_callback_ctocpp.h index c49f1cbf3..a291dbeca 100644 --- a/libcef_dll/ctocpp/request_callback_ctocpp.h +++ b/libcef_dll/ctocpp/request_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=30e3a8e0af1a46f48c8dee5cc94d056c856b23d3$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefRequestCallbackCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefRequestCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/request_context_ctocpp.cc b/libcef_dll/ctocpp/request_context_ctocpp.cc index 11783a502..3806fbf2e 100644 --- a/libcef_dll/ctocpp/request_context_ctocpp.cc +++ b/libcef_dll/ctocpp/request_context_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5e273b65a19f371ad2fa5073c38dd6ad7a2c40d5$ +// #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" #include "libcef_dll/cpptoc/request_context_handler_cpptoc.h" @@ -20,7 +22,6 @@ #include "libcef_dll/ctocpp/value_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefRequestContext::GetGlobalContext() { @@ -42,8 +43,7 @@ CefRefPtr CefRequestContext::CreateContext( // Execute cef_request_context_t* _retval = cef_request_context_create_context( - &settings, - CefRequestContextHandlerCppToC::Wrap(handler)); + &settings, CefRequestContextHandlerCppToC::Wrap(handler)); // Return type: refptr_same return CefRequestContextCToCpp::Wrap(_retval); @@ -61,15 +61,14 @@ CefRefPtr CefRequestContext::CreateContext( // Unverified params: handler // Execute - cef_request_context_t* _retval = cef_create_context_shared( - CefRequestContextCToCpp::Unwrap(other), - CefRequestContextHandlerCppToC::Wrap(handler)); + cef_request_context_t* _retval = + cef_create_context_shared(CefRequestContextCToCpp::Unwrap(other), + CefRequestContextHandlerCppToC::Wrap(handler)); // Return type: refptr_same return CefRequestContextCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { @@ -85,11 +84,11 @@ bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefRequestContextCToCpp::Unwrap(other)); + int _retval = + _struct->is_same(_struct, CefRequestContextCToCpp::Unwrap(other)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRequestContextCToCpp::IsSharingWith( @@ -106,11 +105,11 @@ bool CefRequestContextCToCpp::IsSharingWith( return false; // Execute - int _retval = _struct->is_sharing_with(_struct, - CefRequestContextCToCpp::Unwrap(other)); + int _retval = + _struct->is_sharing_with(_struct, CefRequestContextCToCpp::Unwrap(other)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRequestContextCToCpp::IsGlobal() { @@ -124,7 +123,7 @@ bool CefRequestContextCToCpp::IsGlobal() { int _retval = _struct->is_global(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefRequestContextCToCpp::GetHandler() { @@ -168,15 +167,16 @@ CefRefPtr CefRequestContextCToCpp::GetDefaultCookieManager( // Unverified params: callback // Execute - cef_cookie_manager_t* _retval = _struct->get_default_cookie_manager(_struct, - CefCompletionCallbackCppToC::Wrap(callback)); + cef_cookie_manager_t* _retval = _struct->get_default_cookie_manager( + _struct, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: refptr_same return CefCookieManagerCToCpp::Wrap(_retval); } bool CefRequestContextCToCpp::RegisterSchemeHandlerFactory( - const CefString& scheme_name, const CefString& domain_name, + const CefString& scheme_name, + const CefString& domain_name, CefRefPtr factory) { cef_request_context_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, register_scheme_handler_factory)) @@ -191,13 +191,12 @@ bool CefRequestContextCToCpp::RegisterSchemeHandlerFactory( // Unverified params: domain_name, factory // Execute - int _retval = _struct->register_scheme_handler_factory(_struct, - scheme_name.GetStruct(), - domain_name.GetStruct(), + int _retval = _struct->register_scheme_handler_factory( + _struct, scheme_name.GetStruct(), domain_name.GetStruct(), CefSchemeHandlerFactoryCppToC::Wrap(factory)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRequestContextCToCpp::ClearSchemeHandlerFactories() { @@ -211,7 +210,7 @@ bool CefRequestContextCToCpp::ClearSchemeHandlerFactories() { int _retval = _struct->clear_scheme_handler_factories(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRequestContextCToCpp::PurgePluginListCache(bool reload_pages) { @@ -222,8 +221,7 @@ void CefRequestContextCToCpp::PurgePluginListCache(bool reload_pages) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->purge_plugin_list_cache(_struct, - reload_pages); + _struct->purge_plugin_list_cache(_struct, reload_pages); } bool CefRequestContextCToCpp::HasPreference(const CefString& name) { @@ -239,11 +237,10 @@ bool CefRequestContextCToCpp::HasPreference(const CefString& name) { return false; // Execute - int _retval = _struct->has_preference(_struct, - name.GetStruct()); + int _retval = _struct->has_preference(_struct, name.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefRequestContextCToCpp::GetPreference( @@ -260,8 +257,7 @@ CefRefPtr CefRequestContextCToCpp::GetPreference( return NULL; // Execute - cef_value_t* _retval = _struct->get_preference(_struct, - name.GetStruct()); + cef_value_t* _retval = _struct->get_preference(_struct, name.GetStruct()); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); @@ -276,8 +272,8 @@ CefRefPtr CefRequestContextCToCpp::GetAllPreferences( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dictionary_value_t* _retval = _struct->get_all_preferences(_struct, - include_defaults); + cef_dictionary_value_t* _retval = + _struct->get_all_preferences(_struct, include_defaults); // Return type: refptr_same return CefDictionaryValueCToCpp::Wrap(_retval); @@ -296,15 +292,15 @@ bool CefRequestContextCToCpp::CanSetPreference(const CefString& name) { return false; // Execute - int _retval = _struct->can_set_preference(_struct, - name.GetStruct()); + int _retval = _struct->can_set_preference(_struct, name.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRequestContextCToCpp::SetPreference(const CefString& name, - CefRefPtr value, CefString& error) { + CefRefPtr value, + CefString& error) { cef_request_context_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_preference)) return false; @@ -318,13 +314,12 @@ bool CefRequestContextCToCpp::SetPreference(const CefString& name, // Unverified params: value // Execute - int _retval = _struct->set_preference(_struct, - name.GetStruct(), - CefValueCToCpp::Unwrap(value), - error.GetWritableStruct()); + int _retval = _struct->set_preference(_struct, name.GetStruct(), + CefValueCToCpp::Unwrap(value), + error.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRequestContextCToCpp::ClearCertificateExceptions( @@ -338,8 +333,8 @@ void CefRequestContextCToCpp::ClearCertificateExceptions( // Unverified params: callback // Execute - _struct->clear_certificate_exceptions(_struct, - CefCompletionCallbackCppToC::Wrap(callback)); + _struct->clear_certificate_exceptions( + _struct, CefCompletionCallbackCppToC::Wrap(callback)); } void CefRequestContextCToCpp::CloseAllConnections( @@ -354,10 +349,11 @@ void CefRequestContextCToCpp::CloseAllConnections( // Execute _struct->close_all_connections(_struct, - CefCompletionCallbackCppToC::Wrap(callback)); + CefCompletionCallbackCppToC::Wrap(callback)); } -void CefRequestContextCToCpp::ResolveHost(const CefString& origin, +void CefRequestContextCToCpp::ResolveHost( + const CefString& origin, CefRefPtr callback) { cef_request_context_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, resolve_host)) @@ -375,13 +371,13 @@ void CefRequestContextCToCpp::ResolveHost(const CefString& origin, return; // Execute - _struct->resolve_host(_struct, - origin.GetStruct(), - CefResolveCallbackCppToC::Wrap(callback)); + _struct->resolve_host(_struct, origin.GetStruct(), + CefResolveCallbackCppToC::Wrap(callback)); } cef_errorcode_t CefRequestContextCToCpp::ResolveHostCached( - const CefString& origin, std::vector& resolved_ips) { + const CefString& origin, + std::vector& resolved_ips) { cef_request_context_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, resolve_host_cached)) return ERR_FAILED; @@ -400,9 +396,8 @@ cef_errorcode_t CefRequestContextCToCpp::ResolveHostCached( transfer_string_list_contents(resolved_ips, resolved_ipsList); // Execute - cef_errorcode_t _retval = _struct->resolve_host_cached(_struct, - origin.GetStruct(), - resolved_ipsList); + cef_errorcode_t _retval = _struct->resolve_host_cached( + _struct, origin.GetStruct(), resolved_ipsList); // Restore param:resolved_ips; type: string_vec_byref if (resolved_ipsList) { @@ -415,24 +410,29 @@ cef_errorcode_t CefRequestContextCToCpp::ResolveHostCached( return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefRequestContextCToCpp::CefRequestContextCToCpp() { -} +CefRequestContextCToCpp::CefRequestContextCToCpp() {} -template<> cef_request_context_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRequestContext* c) { +template <> +cef_request_context_t* CefCToCppRefCounted< + CefRequestContextCToCpp, + CefRequestContext, + cef_request_context_t>::UnwrapDerived(CefWrapperType type, + CefRequestContext* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST_CONTEXT; diff --git a/libcef_dll/ctocpp/request_context_ctocpp.h b/libcef_dll/ctocpp/request_context_ctocpp.h index 03eb35dbd..b0351c5e2 100644 --- a/libcef_dll/ctocpp/request_context_ctocpp.h +++ b/libcef_dll/ctocpp/request_context_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=007659e858fb2ce87b3974d8d304d850434bac8b$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ @@ -19,17 +21,18 @@ #endif #include -#include "include/cef_request_context.h" #include "include/capi/cef_request_context_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_request_context.h" +#include "include/cef_scheme.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefRequestContextCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefRequestContextCToCpp(); @@ -41,7 +44,8 @@ class CefRequestContextCToCpp CefString GetCachePath() OVERRIDE; CefRefPtr GetDefaultCookieManager( CefRefPtr callback) OVERRIDE; - bool RegisterSchemeHandlerFactory(const CefString& scheme_name, + bool RegisterSchemeHandlerFactory( + const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory) OVERRIDE; bool ClearSchemeHandlerFactories() OVERRIDE; @@ -51,14 +55,16 @@ class CefRequestContextCToCpp CefRefPtr GetAllPreferences( bool include_defaults) OVERRIDE; bool CanSetPreference(const CefString& name) OVERRIDE; - bool SetPreference(const CefString& name, CefRefPtr value, - CefString& error) OVERRIDE; + bool SetPreference(const CefString& name, + CefRefPtr value, + CefString& error) OVERRIDE; void ClearCertificateExceptions( CefRefPtr callback) OVERRIDE; void CloseAllConnections(CefRefPtr callback) OVERRIDE; void ResolveHost(const CefString& origin, - CefRefPtr callback) OVERRIDE; - cef_errorcode_t ResolveHostCached(const CefString& origin, + CefRefPtr callback) OVERRIDE; + cef_errorcode_t ResolveHostCached( + const CefString& origin, std::vector& resolved_ips) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc index e253567d8..d7b4b6fe8 100644 --- a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f756067d7f727278a3e4f887a308ecc72ef8a23e$ +// #include "libcef_dll/cpptoc/cookie_manager_cpptoc.h" #include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h" #include "libcef_dll/ctocpp/request_context_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefRequestContextHandlerCToCpp::GetCookieManager() { @@ -32,8 +33,11 @@ CefRefPtr CefRequestContextHandlerCToCpp::GetCookieManager() { } bool CefRequestContextHandlerCToCpp::OnBeforePluginLoad( - const CefString& mime_type, const CefString& plugin_url, bool is_main_frame, - const CefString& top_origin_url, CefRefPtr plugin_info, + const CefString& mime_type, + const CefString& plugin_url, + bool is_main_frame, + const CefString& top_origin_url, + CefRefPtr plugin_info, PluginPolicy* plugin_policy) { cef_request_context_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_plugin_load)) @@ -56,36 +60,40 @@ bool CefRequestContextHandlerCToCpp::OnBeforePluginLoad( // Unverified params: plugin_url, top_origin_url // Execute - int _retval = _struct->on_before_plugin_load(_struct, - mime_type.GetStruct(), - plugin_url.GetStruct(), - is_main_frame, - top_origin_url.GetStruct(), - CefWebPluginInfoCppToC::Wrap(plugin_info), + int _retval = _struct->on_before_plugin_load( + _struct, mime_type.GetStruct(), plugin_url.GetStruct(), is_main_frame, + top_origin_url.GetStruct(), CefWebPluginInfoCppToC::Wrap(plugin_info), plugin_policy); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefRequestContextHandlerCToCpp::CefRequestContextHandlerCToCpp() { -} +CefRequestContextHandlerCToCpp::CefRequestContextHandlerCToCpp() {} -template<> cef_request_context_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRequestContextHandler* c) { +template <> +cef_request_context_handler_t* CefCToCppRefCounted< + CefRequestContextHandlerCToCpp, + CefRequestContextHandler, + cef_request_context_handler_t>::UnwrapDerived(CefWrapperType type, + CefRequestContextHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_REQUEST_CONTEXT_HANDLER; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_REQUEST_CONTEXT_HANDLER; diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.h b/libcef_dll/ctocpp/request_context_handler_ctocpp.h index 82094aba9..b50dde03b 100644 --- a/libcef_dll/ctocpp/request_context_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f51e1ceef8535c2d81dd7a9918da5e3b9861376f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_ @@ -18,24 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request_context_handler.h" #include "include/capi/cef_request_context_handler_capi.h" +#include "include/cef_request_context_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRequestContextHandlerCToCpp : public CefCToCppRefCounted { + CefRequestContextHandler, + cef_request_context_handler_t> { public: CefRequestContextHandlerCToCpp(); // CefRequestContextHandler methods. CefRefPtr GetCookieManager() override; bool OnBeforePluginLoad(const CefString& mime_type, - const CefString& plugin_url, bool is_main_frame, - const CefString& top_origin_url, CefRefPtr plugin_info, - PluginPolicy* plugin_policy) override; + const CefString& plugin_url, + bool is_main_frame, + const CefString& top_origin_url, + CefRefPtr plugin_info, + PluginPolicy* plugin_policy) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc index 646ee8c94..ee35cb053 100644 --- a/libcef_dll/ctocpp/request_ctocpp.cc +++ b/libcef_dll/ctocpp/request_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ab6fd3ffc31f09fa60192f56e8b58a8e9de54ef2$ +// #include "libcef_dll/ctocpp/post_data_ctocpp.h" #include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefRequest::Create() { @@ -27,7 +28,6 @@ CefRefPtr CefRequest::Create() { return CefRequestCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefRequestCToCpp::IsReadOnly() { @@ -41,7 +41,7 @@ bool CefRequestCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefRequestCToCpp::GetURL() { @@ -73,8 +73,7 @@ void CefRequestCToCpp::SetURL(const CefString& url) { return; // Execute - _struct->set_url(_struct, - url.GetStruct()); + _struct->set_url(_struct, url.GetStruct()); } CefString CefRequestCToCpp::GetMethod() { @@ -106,12 +105,11 @@ void CefRequestCToCpp::SetMethod(const CefString& method) { return; // Execute - _struct->set_method(_struct, - method.GetStruct()); + _struct->set_method(_struct, method.GetStruct()); } void CefRequestCToCpp::SetReferrer(const CefString& referrer_url, - ReferrerPolicy policy) { + ReferrerPolicy policy) { cef_request_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_referrer)) return; @@ -124,9 +122,7 @@ void CefRequestCToCpp::SetReferrer(const CefString& referrer_url, return; // Execute - _struct->set_referrer(_struct, - referrer_url.GetStruct(), - policy); + _struct->set_referrer(_struct, referrer_url.GetStruct(), policy); } CefString CefRequestCToCpp::GetReferrerURL() { @@ -186,8 +182,7 @@ void CefRequestCToCpp::SetPostData(CefRefPtr postData) { return; // Execute - _struct->set_post_data(_struct, - CefPostDataCToCpp::Unwrap(postData)); + _struct->set_post_data(_struct, CefPostDataCToCpp::Unwrap(postData)); } void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { @@ -204,8 +199,7 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - _struct->get_header_map(_struct, - headerMapMultimap); + _struct->get_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref if (headerMapMultimap) { @@ -229,16 +223,17 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - _struct->set_header_map(_struct, - headerMapMultimap); + _struct->set_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref_const if (headerMapMultimap) cef_string_multimap_free(headerMapMultimap); } -void CefRequestCToCpp::Set(const CefString& url, const CefString& method, - CefRefPtr postData, const HeaderMap& headerMap) { +void CefRequestCToCpp::Set(const CefString& url, + const CefString& method, + CefRefPtr postData, + const HeaderMap& headerMap) { cef_request_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set)) return; @@ -262,11 +257,8 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - _struct->set(_struct, - url.GetStruct(), - method.GetStruct(), - CefPostDataCToCpp::Unwrap(postData), - headerMapMultimap); + _struct->set(_struct, url.GetStruct(), method.GetStruct(), + CefPostDataCToCpp::Unwrap(postData), headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref_const if (headerMapMultimap) @@ -295,8 +287,7 @@ void CefRequestCToCpp::SetFlags(int flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_flags(_struct, - flags); + _struct->set_flags(_struct, flags); } CefString CefRequestCToCpp::GetFirstPartyForCookies() { @@ -328,8 +319,7 @@ void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { return; // Execute - _struct->set_first_party_for_cookies(_struct, - url.GetStruct()); + _struct->set_first_party_for_cookies(_struct, url.GetStruct()); } CefRequest::ResourceType CefRequestCToCpp::GetResourceType() { @@ -374,22 +364,27 @@ uint64 CefRequestCToCpp::GetIdentifier() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefRequestCToCpp::CefRequestCToCpp() { -} +CefRequestCToCpp::CefRequestCToCpp() {} -template<> cef_request_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefRequest* c) { +template <> +cef_request_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefRequest* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST; diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h index 6f55e95fd..3f381ca62 100644 --- a/libcef_dll/ctocpp/request_ctocpp.h +++ b/libcef_dll/ctocpp/request_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1719a5ddf35f1269ee759b2b0cd5682bef6ed2e1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request.h" #include "include/capi/cef_request_capi.h" +#include "include/cef_request.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -36,15 +38,17 @@ class CefRequestCToCpp CefString GetMethod() OVERRIDE; void SetMethod(const CefString& method) OVERRIDE; void SetReferrer(const CefString& referrer_url, - ReferrerPolicy policy) OVERRIDE; + ReferrerPolicy policy) OVERRIDE; CefString GetReferrerURL() OVERRIDE; ReferrerPolicy GetReferrerPolicy() OVERRIDE; CefRefPtr GetPostData() OVERRIDE; void SetPostData(CefRefPtr postData) OVERRIDE; void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; - void Set(const CefString& url, const CefString& method, - CefRefPtr postData, const HeaderMap& headerMap) OVERRIDE; + void Set(const CefString& url, + const CefString& method, + CefRefPtr postData, + const HeaderMap& headerMap) OVERRIDE; int GetFlags() OVERRIDE; void SetFlags(int flags) OVERRIDE; CefString GetFirstPartyForCookies() OVERRIDE; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc index b55fe5b84..39b89a8d9 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -9,26 +9,28 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=03df0b0112a7f9f6cdce88b34a972ec27042b92f$ +// #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" -#include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/cpptoc/request_callback_cpptoc.h" +#include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/cpptoc/response_cpptoc.h" -#include "libcef_dll/cpptoc/sslinfo_cpptoc.h" #include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h" +#include "libcef_dll/cpptoc/sslinfo_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" #include "libcef_dll/ctocpp/request_handler_ctocpp.h" #include "libcef_dll/ctocpp/resource_handler_ctocpp.h" #include "libcef_dll/ctocpp/response_filter_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - bool is_redirect) { + CefRefPtr frame, + CefRefPtr request, + bool is_redirect) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_browse)) return false; @@ -49,19 +51,20 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_before_browse(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - is_redirect); + int _retval = _struct->on_before_browse( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), is_redirect); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefRequestHandlerCToCpp::OnOpenURLFromTab(CefRefPtr browser, - CefRefPtr frame, const CefString& target_url, - WindowOpenDisposition target_disposition, bool user_gesture) { +bool CefRequestHandlerCToCpp::OnOpenURLFromTab( + CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + WindowOpenDisposition target_disposition, + bool user_gesture) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_open_urlfrom_tab)) return false; @@ -82,20 +85,19 @@ bool CefRequestHandlerCToCpp::OnOpenURLFromTab(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_open_urlfrom_tab(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - target_url.GetStruct(), - target_disposition, - user_gesture); + int _retval = _struct->on_open_urlfrom_tab( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + target_url.GetStruct(), target_disposition, user_gesture); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr request, CefRefPtr callback) { + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr callback) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_before_resource_load)) return RV_CONTINUE; @@ -120,9 +122,8 @@ CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( return RV_CONTINUE; // Execute - cef_return_value_t _retval = _struct->on_before_resource_load(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), + cef_return_value_t _retval = _struct->on_before_resource_load( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), CefRequestCallbackCppToC::Wrap(callback)); @@ -131,7 +132,8 @@ CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( } CefRefPtr CefRequestHandlerCToCpp::GetResourceHandler( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr request) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_resource_handler)) @@ -153,18 +155,20 @@ CefRefPtr CefRequestHandlerCToCpp::GetResourceHandler( return NULL; // Execute - cef_resource_handler_t* _retval = _struct->get_resource_handler(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), + cef_resource_handler_t* _retval = _struct->get_resource_handler( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request)); // Return type: refptr_same return CefResourceHandlerCToCpp::Wrap(_retval); } -void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - CefRefPtr response, CefString& new_url) { +void CefRequestHandlerCToCpp::OnResourceRedirect( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response, + CefString& new_url) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_resource_redirect)) return; @@ -189,16 +193,16 @@ void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, return; // Execute - _struct->on_resource_redirect(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - CefResponseCppToC::Wrap(response), + _struct->on_resource_redirect( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response), new_url.GetWritableStruct()); } -bool CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, +bool CefRequestHandlerCToCpp::OnResourceResponse( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, CefRefPtr response) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_resource_response)) @@ -224,19 +228,19 @@ bool CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_resource_response(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - CefResponseCppToC::Wrap(response)); + int _retval = _struct->on_resource_response( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefRequestHandlerCToCpp::GetResourceResponseFilter( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr request, CefRefPtr response) { + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_resource_response_filter)) return NULL; @@ -262,20 +266,20 @@ CefRefPtr CefRequestHandlerCToCpp::GetResourceResponseFilter( // Execute cef_response_filter_t* _retval = _struct->get_resource_response_filter( - _struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - CefResponseCppToC::Wrap(response)); + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response)); // Return type: refptr_same return CefResponseFilterCToCpp::Wrap(_retval); } void CefRequestHandlerCToCpp::OnResourceLoadComplete( - CefRefPtr browser, CefRefPtr frame, - CefRefPtr request, CefRefPtr response, - URLRequestStatus status, int64 received_content_length) { + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response, + URLRequestStatus status, + int64 received_content_length) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_resource_load_complete)) return; @@ -300,18 +304,20 @@ void CefRequestHandlerCToCpp::OnResourceLoadComplete( return; // Execute - _struct->on_resource_load_complete(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - CefRequestCppToC::Wrap(request), - CefResponseCppToC::Wrap(response), - status, - received_content_length); + _struct->on_resource_load_complete( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response), + status, received_content_length); } -bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, - CefRefPtr frame, bool isProxy, const CefString& host, int port, - const CefString& realm, const CefString& scheme, +bool CefRequestHandlerCToCpp::GetAuthCredentials( + CefRefPtr browser, + CefRefPtr frame, + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, CefRefPtr callback) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_auth_credentials)) @@ -338,22 +344,19 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, // Unverified params: realm, scheme // Execute - int _retval = _struct->get_auth_credentials(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - isProxy, - host.GetStruct(), - port, - realm.GetStruct(), - scheme.GetStruct(), + int _retval = _struct->get_auth_credentials( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + isProxy, host.GetStruct(), port, realm.GetStruct(), scheme.GetStruct(), CefAuthCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr browser, - const CefString& origin_url, int64 new_size, +bool CefRequestHandlerCToCpp::OnQuotaRequest( + CefRefPtr browser, + const CefString& origin_url, + int64 new_size, CefRefPtr callback) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_quota_request)) @@ -375,18 +378,17 @@ bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_quota_request(_struct, - CefBrowserCppToC::Wrap(browser), - origin_url.GetStruct(), - new_size, - CefRequestCallbackCppToC::Wrap(callback)); + int _retval = _struct->on_quota_request( + _struct, CefBrowserCppToC::Wrap(browser), origin_url.GetStruct(), + new_size, CefRequestCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, - const CefString& url, bool& allow_os_execution) { + const CefString& url, + bool& allow_os_execution) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_protocol_execution)) return; @@ -406,18 +408,19 @@ void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, int allow_os_executionInt = allow_os_execution; // Execute - _struct->on_protocol_execution(_struct, - CefBrowserCppToC::Wrap(browser), - url.GetStruct(), - &allow_os_executionInt); + _struct->on_protocol_execution(_struct, CefBrowserCppToC::Wrap(browser), + url.GetStruct(), &allow_os_executionInt); // Restore param:allow_os_execution; type: bool_byref - allow_os_execution = allow_os_executionInt?true:false; + allow_os_execution = allow_os_executionInt ? true : false; } -bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr browser, - cef_errorcode_t cert_error, const CefString& request_url, - CefRefPtr ssl_info, CefRefPtr callback) { +bool CefRequestHandlerCToCpp::OnCertificateError( + CefRefPtr browser, + cef_errorcode_t cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_certificate_error)) return false; @@ -442,20 +445,21 @@ bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr browser, return false; // Execute - int _retval = _struct->on_certificate_error(_struct, - CefBrowserCppToC::Wrap(browser), - cert_error, - request_url.GetStruct(), - CefSSLInfoCppToC::Wrap(ssl_info), + int _retval = _struct->on_certificate_error( + _struct, CefBrowserCppToC::Wrap(browser), cert_error, + request_url.GetStruct(), CefSSLInfoCppToC::Wrap(ssl_info), CefRequestCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefRequestHandlerCToCpp::OnSelectClientCertificate( - CefRefPtr browser, bool isProxy, const CefString& host, - int port, const X509CertificateList& certificates, + CefRefPtr browser, + bool isProxy, + const CefString& host, + int port, + const X509CertificateList& certificates, CefRefPtr callback) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_select_client_certificate)) @@ -490,25 +494,21 @@ bool CefRequestHandlerCToCpp::OnSelectClientCertificate( } // Execute - int _retval = _struct->on_select_client_certificate(_struct, - CefBrowserCppToC::Wrap(browser), - isProxy, - host.GetStruct(), - port, - certificatesCount, - certificatesList, + int _retval = _struct->on_select_client_certificate( + _struct, CefBrowserCppToC::Wrap(browser), isProxy, host.GetStruct(), port, + certificatesCount, certificatesList, CefSelectClientCertificateCallbackCppToC::Wrap(callback)); // Restore param:certificates; type: refptr_vec_diff_byref_const if (certificatesList) - delete [] certificatesList; + delete[] certificatesList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr browser, - const CefString& plugin_path) { + const CefString& plugin_path) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_plugin_crashed)) return; @@ -525,9 +525,8 @@ void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr browser, return; // Execute - _struct->on_plugin_crashed(_struct, - CefBrowserCppToC::Wrap(browser), - plugin_path.GetStruct()); + _struct->on_plugin_crashed(_struct, CefBrowserCppToC::Wrap(browser), + plugin_path.GetStruct()); } void CefRequestHandlerCToCpp::OnRenderViewReady(CefRefPtr browser) { @@ -543,12 +542,12 @@ void CefRequestHandlerCToCpp::OnRenderViewReady(CefRefPtr browser) { return; // Execute - _struct->on_render_view_ready(_struct, - CefBrowserCppToC::Wrap(browser)); + _struct->on_render_view_ready(_struct, CefBrowserCppToC::Wrap(browser)); } void CefRequestHandlerCToCpp::OnRenderProcessTerminated( - CefRefPtr browser, TerminationStatus status) { + CefRefPtr browser, + TerminationStatus status) { cef_request_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_render_process_terminated)) return; @@ -561,29 +560,33 @@ void CefRequestHandlerCToCpp::OnRenderProcessTerminated( return; // Execute - _struct->on_render_process_terminated(_struct, - CefBrowserCppToC::Wrap(browser), - status); + _struct->on_render_process_terminated( + _struct, CefBrowserCppToC::Wrap(browser), status); } - // CONSTRUCTOR - Do not edit by hand. -CefRequestHandlerCToCpp::CefRequestHandlerCToCpp() { -} +CefRequestHandlerCToCpp::CefRequestHandlerCToCpp() {} -template<> cef_request_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRequestHandler* c) { +template <> +cef_request_handler_t* CefCToCppRefCounted< + CefRequestHandlerCToCpp, + CefRequestHandler, + cef_request_handler_t>::UnwrapDerived(CefWrapperType type, + CefRequestHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST_HANDLER; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h index 0dfe69115..c6200ba7c 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7d5dd9e17b2405fe0520a239f41d7f8fca93a921$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ @@ -18,65 +20,90 @@ #error This file can be included DLL-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRequestHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefRequestHandlerCToCpp(); // CefRequestHandler methods. - bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, - CefRefPtr request, bool is_redirect) override; + bool OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + bool is_redirect) override; bool OnOpenURLFromTab(CefRefPtr browser, - CefRefPtr frame, const CefString& target_url, - WindowOpenDisposition target_disposition, bool user_gesture) override; - ReturnValue OnBeforeResourceLoad(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, + CefRefPtr frame, + const CefString& target_url, + WindowOpenDisposition target_disposition, + bool user_gesture) override; + ReturnValue OnBeforeResourceLoad( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, CefRefPtr callback) override; CefRefPtr GetResourceHandler( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr request) override; void OnResourceRedirect(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - CefRefPtr response, CefString& new_url) override; + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response, + CefString& new_url) override; bool OnResourceResponse(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - CefRefPtr response) override; + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response) override; CefRefPtr GetResourceResponseFilter( - CefRefPtr browser, CefRefPtr frame, + CefRefPtr browser, + CefRefPtr frame, CefRefPtr request, CefRefPtr response) override; void OnResourceLoadComplete(CefRefPtr browser, - CefRefPtr frame, CefRefPtr request, - CefRefPtr response, URLRequestStatus status, - int64 received_content_length) override; + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response, + URLRequestStatus status, + int64 received_content_length) override; bool GetAuthCredentials(CefRefPtr browser, - CefRefPtr frame, bool isProxy, const CefString& host, int port, - const CefString& realm, const CefString& scheme, - CefRefPtr callback) override; + CefRefPtr frame, + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) override; bool OnQuotaRequest(CefRefPtr browser, - const CefString& origin_url, int64 new_size, - CefRefPtr callback) override; - void OnProtocolExecution(CefRefPtr browser, const CefString& url, - bool& allow_os_execution) override; + const CefString& origin_url, + int64 new_size, + CefRefPtr callback) override; + void OnProtocolExecution(CefRefPtr browser, + const CefString& url, + bool& allow_os_execution) override; bool OnCertificateError(CefRefPtr browser, - cef_errorcode_t cert_error, const CefString& request_url, - CefRefPtr ssl_info, - CefRefPtr callback) override; - bool OnSelectClientCertificate(CefRefPtr browser, bool isProxy, - const CefString& host, int port, const X509CertificateList& certificates, + cef_errorcode_t cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) override; + bool OnSelectClientCertificate( + CefRefPtr browser, + bool isProxy, + const CefString& host, + int port, + const X509CertificateList& certificates, CefRefPtr callback) override; void OnPluginCrashed(CefRefPtr browser, - const CefString& plugin_path) override; + const CefString& plugin_path) override; void OnRenderViewReady(CefRefPtr browser) override; void OnRenderProcessTerminated(CefRefPtr browser, - TerminationStatus status) override; + TerminationStatus status) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/resolve_callback_ctocpp.cc b/libcef_dll/ctocpp/resolve_callback_ctocpp.cc index ac3d136e6..c3e33378a 100644 --- a/libcef_dll/ctocpp/resolve_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/resolve_callback_ctocpp.cc @@ -9,14 +9,16 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0e6164c03fe22c9849bdecb957011e7d6d3c80e6$ +// #include "libcef_dll/ctocpp/resolve_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. -void CefResolveCallbackCToCpp::OnResolveCompleted(cef_errorcode_t result, +void CefResolveCallbackCToCpp::OnResolveCompleted( + cef_errorcode_t result, const std::vector& resolved_ips) { cef_resolve_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_resolve_completed)) @@ -33,33 +35,37 @@ void CefResolveCallbackCToCpp::OnResolveCompleted(cef_errorcode_t result, transfer_string_list_contents(resolved_ips, resolved_ipsList); // Execute - _struct->on_resolve_completed(_struct, - result, - resolved_ipsList); + _struct->on_resolve_completed(_struct, result, resolved_ipsList); // Restore param:resolved_ips; type: string_vec_byref_const if (resolved_ipsList) cef_string_list_free(resolved_ipsList); } - // CONSTRUCTOR - Do not edit by hand. -CefResolveCallbackCToCpp::CefResolveCallbackCToCpp() { -} +CefResolveCallbackCToCpp::CefResolveCallbackCToCpp() {} -template<> cef_resolve_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefResolveCallback* c) { +template <> +cef_resolve_callback_t* CefCToCppRefCounted< + CefResolveCallbackCToCpp, + CefResolveCallback, + cef_resolve_callback_t>::UnwrapDerived(CefWrapperType type, + CefResolveCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESOLVE_CALLBACK; diff --git a/libcef_dll/ctocpp/resolve_callback_ctocpp.h b/libcef_dll/ctocpp/resolve_callback_ctocpp.h index b7a48dcba..51a56ecb6 100644 --- a/libcef_dll/ctocpp/resolve_callback_ctocpp.h +++ b/libcef_dll/ctocpp/resolve_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=986ed44644eed23928885b33f9d92a82b8df590a$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOLVE_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESOLVE_CALLBACK_CTOCPP_H_ @@ -19,23 +21,24 @@ #endif #include -#include "include/cef_request_context.h" #include "include/capi/cef_request_context_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_request_context.h" +#include "include/cef_scheme.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefResolveCallbackCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefResolveCallbackCToCpp(); // CefResolveCallback methods. void OnResolveCompleted(cef_errorcode_t result, - const std::vector& resolved_ips) override; + const std::vector& resolved_ips) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RESOLVE_CALLBACK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/resource_bundle_ctocpp.cc b/libcef_dll/ctocpp/resource_bundle_ctocpp.cc index 7823e08d7..1197d13b8 100644 --- a/libcef_dll/ctocpp/resource_bundle_ctocpp.cc +++ b/libcef_dll/ctocpp/resource_bundle_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ce7a9042d0bdebfd5c017e6bda42ee819699b6cc$ +// #include "libcef_dll/ctocpp/resource_bundle_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefResourceBundle::GetGlobal() { @@ -25,7 +26,6 @@ CefRefPtr CefResourceBundle::GetGlobal() { return CefResourceBundleCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefString CefResourceBundleCToCpp::GetLocalizedString(int string_id) { @@ -36,8 +36,8 @@ CefString CefResourceBundleCToCpp::GetLocalizedString(int string_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_localized_string(_struct, - string_id); + cef_string_userfree_t _retval = + _struct->get_localized_string(_struct, string_id); // Return type: string CefString _retvalStr; @@ -45,8 +45,9 @@ CefString CefResourceBundleCToCpp::GetLocalizedString(int string_id) { return _retvalStr; } -bool CefResourceBundleCToCpp::GetDataResource(int resource_id, void*& data, - size_t& data_size) { +bool CefResourceBundleCToCpp::GetDataResource(int resource_id, + void*& data, + size_t& data_size) { cef_resource_bundle_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_data_resource)) return false; @@ -54,17 +55,17 @@ bool CefResourceBundleCToCpp::GetDataResource(int resource_id, void*& data, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_data_resource(_struct, - resource_id, - &data, - &data_size); + int _retval = + _struct->get_data_resource(_struct, resource_id, &data, &data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefResourceBundleCToCpp::GetDataResourceForScale(int resource_id, - ScaleFactor scale_factor, void*& data, size_t& data_size) { + ScaleFactor scale_factor, + void*& data, + size_t& data_size) { cef_resource_bundle_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_data_resource_for_scale)) return false; @@ -72,34 +73,36 @@ bool CefResourceBundleCToCpp::GetDataResourceForScale(int resource_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_data_resource_for_scale(_struct, - resource_id, - scale_factor, - &data, - &data_size); + int _retval = _struct->get_data_resource_for_scale( + _struct, resource_id, scale_factor, &data, &data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefResourceBundleCToCpp::CefResourceBundleCToCpp() { -} +CefResourceBundleCToCpp::CefResourceBundleCToCpp() {} -template<> cef_resource_bundle_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefResourceBundle* c) { +template <> +cef_resource_bundle_t* CefCToCppRefCounted< + CefResourceBundleCToCpp, + CefResourceBundle, + cef_resource_bundle_t>::UnwrapDerived(CefWrapperType type, + CefResourceBundle* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESOURCE_BUNDLE; diff --git a/libcef_dll/ctocpp/resource_bundle_ctocpp.h b/libcef_dll/ctocpp/resource_bundle_ctocpp.h index 2778e07a2..ce8b1865b 100644 --- a/libcef_dll/ctocpp/resource_bundle_ctocpp.h +++ b/libcef_dll/ctocpp/resource_bundle_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d3f3422c0d8946dc9538424e2055c2543b45ebee$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_CTOCPP_H_ @@ -18,24 +20,28 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_resource_bundle.h" #include "include/capi/cef_resource_bundle_capi.h" +#include "include/cef_resource_bundle.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefResourceBundleCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefResourceBundleCToCpp(); // CefResourceBundle methods. CefString GetLocalizedString(int string_id) OVERRIDE; - bool GetDataResource(int resource_id, void*& data, - size_t& data_size) OVERRIDE; - bool GetDataResourceForScale(int resource_id, ScaleFactor scale_factor, - void*& data, size_t& data_size) OVERRIDE; + bool GetDataResource(int resource_id, + void*& data, + size_t& data_size) OVERRIDE; + bool GetDataResourceForScale(int resource_id, + ScaleFactor scale_factor, + void*& data, + size_t& data_size) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc index 1baae8565..a715bf8b2 100644 --- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2cc1b07e08cab179b9bd5943df8a523bba9be20b$ +// #include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefResourceBundleHandlerCToCpp::GetLocalizedString(int string_id, - CefString& string) { + CefString& string) { cef_resource_bundle_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_localized_string)) return false; @@ -24,16 +25,16 @@ bool CefResourceBundleHandlerCToCpp::GetLocalizedString(int string_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_localized_string(_struct, - string_id, - string.GetWritableStruct()); + int _retval = _struct->get_localized_string(_struct, string_id, + string.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefResourceBundleHandlerCToCpp::GetDataResource(int resource_id, - void*& data, size_t& data_size) { + void*& data, + size_t& data_size) { cef_resource_bundle_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_data_resource)) return false; @@ -41,17 +42,18 @@ bool CefResourceBundleHandlerCToCpp::GetDataResource(int resource_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_data_resource(_struct, - resource_id, - &data, - &data_size); + int _retval = + _struct->get_data_resource(_struct, resource_id, &data, &data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefResourceBundleHandlerCToCpp::GetDataResourceForScale(int resource_id, - ScaleFactor scale_factor, void*& data, size_t& data_size) { +bool CefResourceBundleHandlerCToCpp::GetDataResourceForScale( + int resource_id, + ScaleFactor scale_factor, + void*& data, + size_t& data_size) { cef_resource_bundle_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_data_resource_for_scale)) return false; @@ -59,34 +61,38 @@ bool CefResourceBundleHandlerCToCpp::GetDataResourceForScale(int resource_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_data_resource_for_scale(_struct, - resource_id, - scale_factor, - &data, - &data_size); + int _retval = _struct->get_data_resource_for_scale( + _struct, resource_id, scale_factor, &data, &data_size); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefResourceBundleHandlerCToCpp::CefResourceBundleHandlerCToCpp() { -} +CefResourceBundleHandlerCToCpp::CefResourceBundleHandlerCToCpp() {} -template<> cef_resource_bundle_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefResourceBundleHandler* c) { +template <> +cef_resource_bundle_handler_t* CefCToCppRefCounted< + CefResourceBundleHandlerCToCpp, + CefResourceBundleHandler, + cef_resource_bundle_handler_t>::UnwrapDerived(CefWrapperType type, + CefResourceBundleHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_RESOURCE_BUNDLE_HANDLER; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_RESOURCE_BUNDLE_HANDLER; diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h index 0703f89fc..c6f549e1a 100644 --- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h +++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=faa171dda1ac7a104588f4235b676c3a99fa3653$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_ @@ -18,24 +20,28 @@ #error This file can be included DLL-side only #endif -#include "include/cef_resource_bundle_handler.h" #include "include/capi/cef_resource_bundle_handler_capi.h" +#include "include/cef_resource_bundle_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefResourceBundleHandlerCToCpp : public CefCToCppRefCounted { + CefResourceBundleHandler, + cef_resource_bundle_handler_t> { public: CefResourceBundleHandlerCToCpp(); // CefResourceBundleHandler methods. bool GetLocalizedString(int string_id, CefString& string) override; - bool GetDataResource(int resource_id, void*& data, - size_t& data_size) override; - bool GetDataResourceForScale(int resource_id, ScaleFactor scale_factor, - void*& data, size_t& data_size) override; + bool GetDataResource(int resource_id, + void*& data, + size_t& data_size) override; + bool GetDataResourceForScale(int resource_id, + ScaleFactor scale_factor, + void*& data, + size_t& data_size) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_handler_ctocpp.cc index ba1209bfc..3ddeb3374 100644 --- a/libcef_dll/ctocpp/resource_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/resource_handler_ctocpp.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8745295d751a800ecf0a19fb93839e07c978f3a8$ +// #include "libcef_dll/cpptoc/callback_cpptoc.h" #include "libcef_dll/cpptoc/request_cpptoc.h" #include "libcef_dll/cpptoc/response_cpptoc.h" #include "libcef_dll/ctocpp/resource_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr request, - CefRefPtr callback) { + CefRefPtr callback) { cef_resource_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, process_request)) return false; @@ -36,16 +37,17 @@ bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr request, return false; // Execute - int _retval = _struct->process_request(_struct, - CefRequestCppToC::Wrap(request), - CefCallbackCppToC::Wrap(callback)); + int _retval = + _struct->process_request(_struct, CefRequestCppToC::Wrap(request), + CefCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefResourceHandlerCToCpp::GetResponseHeaders( - CefRefPtr response, int64& response_length, + CefRefPtr response, + int64& response_length, CefString& redirectUrl) { cef_resource_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_response_headers)) @@ -59,14 +61,15 @@ void CefResourceHandlerCToCpp::GetResponseHeaders( return; // Execute - _struct->get_response_headers(_struct, - CefResponseCppToC::Wrap(response), - &response_length, - redirectUrl.GetWritableStruct()); + _struct->get_response_headers(_struct, CefResponseCppToC::Wrap(response), + &response_length, + redirectUrl.GetWritableStruct()); } -bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, - int& bytes_read, CefRefPtr callback) { +bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) { cef_resource_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, read_response)) return false; @@ -83,14 +86,12 @@ bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, return false; // Execute - int _retval = _struct->read_response(_struct, - data_out, - bytes_to_read, - &bytes_read, - CefCallbackCppToC::Wrap(callback)); + int _retval = + _struct->read_response(_struct, data_out, bytes_to_read, &bytes_read, + CefCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefResourceHandlerCToCpp::CanGetCookie(const CefCookie& cookie) { @@ -101,11 +102,10 @@ bool CefResourceHandlerCToCpp::CanGetCookie(const CefCookie& cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->can_get_cookie(_struct, - &cookie); + int _retval = _struct->can_get_cookie(_struct, &cookie); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefResourceHandlerCToCpp::CanSetCookie(const CefCookie& cookie) { @@ -116,11 +116,10 @@ bool CefResourceHandlerCToCpp::CanSetCookie(const CefCookie& cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->can_set_cookie(_struct, - &cookie); + int _retval = _struct->can_set_cookie(_struct, &cookie); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefResourceHandlerCToCpp::Cancel() { @@ -134,24 +133,30 @@ void CefResourceHandlerCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefResourceHandlerCToCpp::CefResourceHandlerCToCpp() { -} +CefResourceHandlerCToCpp::CefResourceHandlerCToCpp() {} -template<> cef_resource_handler_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefResourceHandler* c) { +template <> +cef_resource_handler_t* CefCToCppRefCounted< + CefResourceHandlerCToCpp, + CefResourceHandler, + cef_resource_handler_t>::UnwrapDerived(CefWrapperType type, + CefResourceHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESOURCE_HANDLER; diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.h b/libcef_dll/ctocpp/resource_handler_ctocpp.h index 34686eee7..cbb059c7b 100644 --- a/libcef_dll/ctocpp/resource_handler_ctocpp.h +++ b/libcef_dll/ctocpp/resource_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=61202c134f84e17a57c8eb07cef35db1d79056f5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESOURCE_HANDLER_CTOCPP_H_ @@ -18,25 +20,29 @@ #error This file can be included DLL-side only #endif -#include "include/cef_resource_handler.h" #include "include/capi/cef_resource_handler_capi.h" +#include "include/cef_resource_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefResourceHandlerCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefResourceHandlerCToCpp(); // CefResourceHandler methods. bool ProcessRequest(CefRefPtr request, - CefRefPtr callback) override; + CefRefPtr callback) override; void GetResponseHeaders(CefRefPtr response, - int64& response_length, CefString& redirectUrl) override; - bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, - CefRefPtr callback) override; + int64& response_length, + CefString& redirectUrl) override; + bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) override; bool CanGetCookie(const CefCookie& cookie) override; bool CanSetCookie(const CefCookie& cookie) override; void Cancel() override; diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc index 20a3d905f..dc91c4ce2 100644 --- a/libcef_dll/ctocpp/response_ctocpp.cc +++ b/libcef_dll/ctocpp/response_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=874b9373e3311b3f0828c5c47d88500d268d4825$ +// #include "libcef_dll/ctocpp/response_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefResponse::Create() { @@ -26,7 +27,6 @@ CefRefPtr CefResponse::Create() { return CefResponseCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefResponseCToCpp::IsReadOnly() { @@ -40,7 +40,7 @@ bool CefResponseCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } cef_errorcode_t CefResponseCToCpp::GetError() { @@ -65,8 +65,7 @@ void CefResponseCToCpp::SetError(cef_errorcode_t error) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_error(_struct, - error); + _struct->set_error(_struct, error); } int CefResponseCToCpp::GetStatus() { @@ -91,8 +90,7 @@ void CefResponseCToCpp::SetStatus(int status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_status(_struct, - status); + _struct->set_status(_struct, status); } CefString CefResponseCToCpp::GetStatusText() { @@ -124,8 +122,7 @@ void CefResponseCToCpp::SetStatusText(const CefString& statusText) { return; // Execute - _struct->set_status_text(_struct, - statusText.GetStruct()); + _struct->set_status_text(_struct, statusText.GetStruct()); } CefString CefResponseCToCpp::GetMimeType() { @@ -157,8 +154,7 @@ void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { return; // Execute - _struct->set_mime_type(_struct, - mimeType.GetStruct()); + _struct->set_mime_type(_struct, mimeType.GetStruct()); } CefString CefResponseCToCpp::GetHeader(const CefString& name) { @@ -174,8 +170,8 @@ CefString CefResponseCToCpp::GetHeader(const CefString& name) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_header(_struct, - name.GetStruct()); + cef_string_userfree_t _retval = + _struct->get_header(_struct, name.GetStruct()); // Return type: string CefString _retvalStr; @@ -197,8 +193,7 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - _struct->get_header_map(_struct, - headerMapMultimap); + _struct->get_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref if (headerMapMultimap) { @@ -222,30 +217,33 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - _struct->set_header_map(_struct, - headerMapMultimap); + _struct->set_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref_const if (headerMapMultimap) cef_string_multimap_free(headerMapMultimap); } - // CONSTRUCTOR - Do not edit by hand. -CefResponseCToCpp::CefResponseCToCpp() { -} +CefResponseCToCpp::CefResponseCToCpp() {} -template<> cef_response_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefResponse* c) { +template <> +cef_response_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefResponse* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESPONSE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESPONSE; diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h index bf041e723..67c5d2e0b 100644 --- a/libcef_dll/ctocpp/response_ctocpp.h +++ b/libcef_dll/ctocpp/response_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e47f062a6fd7366b38f2f02b71415ced089445d1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_response.h" #include "include/capi/cef_response_capi.h" +#include "include/cef_response.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefResponseCToCpp - : public CefCToCppRefCounted { +class CefResponseCToCpp : public CefCToCppRefCounted { public: CefResponseCToCpp(); diff --git a/libcef_dll/ctocpp/response_filter_ctocpp.cc b/libcef_dll/ctocpp/response_filter_ctocpp.cc index 2f90784ca..550cf3aae 100644 --- a/libcef_dll/ctocpp/response_filter_ctocpp.cc +++ b/libcef_dll/ctocpp/response_filter_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c162c4bbfc565459583569f4bfd0bb7d58da8ce5$ +// #include "libcef_dll/ctocpp/response_filter_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefResponseFilterCToCpp::InitFilter() { @@ -26,12 +27,16 @@ bool CefResponseFilterCToCpp::InitFilter() { int _retval = _struct->init_filter(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter(void* data_in, - size_t data_in_size, size_t& data_in_read, void* data_out, - size_t data_out_size, size_t& data_out_written) { +CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter( + void* data_in, + size_t data_in_size, + size_t& data_in_read, + void* data_out, + size_t data_out_size, + size_t& data_out_written) { cef_response_filter_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, filter)) return RESPONSE_FILTER_ERROR; @@ -45,36 +50,37 @@ CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter(void* data_in, // Unverified params: data_in // Execute - cef_response_filter_status_t _retval = _struct->filter(_struct, - data_in, - data_in_size, - &data_in_read, - data_out, - data_out_size, - &data_out_written); + cef_response_filter_status_t _retval = + _struct->filter(_struct, data_in, data_in_size, &data_in_read, data_out, + data_out_size, &data_out_written); // Return type: simple return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefResponseFilterCToCpp::CefResponseFilterCToCpp() { -} +CefResponseFilterCToCpp::CefResponseFilterCToCpp() {} -template<> cef_response_filter_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefResponseFilter* c) { +template <> +cef_response_filter_t* CefCToCppRefCounted< + CefResponseFilterCToCpp, + CefResponseFilter, + cef_response_filter_t>::UnwrapDerived(CefWrapperType type, + CefResponseFilter* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESPONSE_FILTER; diff --git a/libcef_dll/ctocpp/response_filter_ctocpp.h b/libcef_dll/ctocpp/response_filter_ctocpp.h index 3cd86f663..fa6d35628 100644 --- a/libcef_dll/ctocpp/response_filter_ctocpp.h +++ b/libcef_dll/ctocpp/response_filter_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e709c25a002099ade1f74a091063389035a0d4c0$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_FILTER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RESPONSE_FILTER_CTOCPP_H_ @@ -18,23 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_response_filter.h" #include "include/capi/cef_response_filter_capi.h" +#include "include/cef_response_filter.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefResponseFilterCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefResponseFilterCToCpp(); // CefResponseFilter methods. bool InitFilter() override; - FilterStatus Filter(void* data_in, size_t data_in_size, size_t& data_in_read, - void* data_out, size_t data_out_size, - size_t& data_out_written) override; + FilterStatus Filter(void* data_in, + size_t data_in_size, + size_t& data_in_read, + void* data_out, + size_t data_out_size, + size_t& data_out_written) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RESPONSE_FILTER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc index eb9556d6d..bc5c43b00 100644 --- a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=52f1e64598056c4e301e20277282e6fcbb67ed68$ +// #include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefRunContextMenuCallbackCToCpp::Continue(int command_id, - EventFlags event_flags) { + EventFlags event_flags) { cef_run_context_menu_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, cont)) return; @@ -24,9 +25,7 @@ void CefRunContextMenuCallbackCToCpp::Continue(int command_id, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->cont(_struct, - command_id, - event_flags); + _struct->cont(_struct, command_id, event_flags); } void CefRunContextMenuCallbackCToCpp::Cancel() { @@ -40,25 +39,32 @@ void CefRunContextMenuCallbackCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefRunContextMenuCallbackCToCpp::CefRunContextMenuCallbackCToCpp() { -} +CefRunContextMenuCallbackCToCpp::CefRunContextMenuCallbackCToCpp() {} -template<> cef_run_context_menu_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRunContextMenuCallback* c) { +template <> +cef_run_context_menu_callback_t* CefCToCppRefCounted< + CefRunContextMenuCallbackCToCpp, + CefRunContextMenuCallback, + cef_run_context_menu_callback_t>::UnwrapDerived(CefWrapperType type, + CefRunContextMenuCallback* + c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = - 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_RUN_CONTEXT_MENU_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_RUN_CONTEXT_MENU_CALLBACK; diff --git a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h index 933fea821..689da12bd 100644 --- a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h +++ b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ddfc8729e6df0f7d60ea61507ebbfdd32d05914a$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_CONTEXT_MENU_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RUN_CONTEXT_MENU_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_context_menu_handler.h" #include "include/capi/cef_context_menu_handler_capi.h" +#include "include/cef_context_menu_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefRunContextMenuCallbackCToCpp : public CefCToCppRefCounted { + CefRunContextMenuCallback, + cef_run_context_menu_callback_t> { public: CefRunContextMenuCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc index 8de11f315..8670627dc 100644 --- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c7f630a2e2b926950107a50d8bbe428d5954e1c6$ +// #include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed( - int selected_accept_filter, const std::vector& file_paths) { + int selected_accept_filter, + const std::vector& file_paths) { cef_run_file_dialog_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_file_dialog_dismissed)) return; @@ -37,33 +39,40 @@ void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed( transfer_string_list_contents(file_paths, file_pathsList); // Execute - _struct->on_file_dialog_dismissed(_struct, - selected_accept_filter, - file_pathsList); + _struct->on_file_dialog_dismissed(_struct, selected_accept_filter, + file_pathsList); // Restore param:file_paths; type: string_vec_byref_const if (file_pathsList) cef_string_list_free(file_pathsList); } - // CONSTRUCTOR - Do not edit by hand. -CefRunFileDialogCallbackCToCpp::CefRunFileDialogCallbackCToCpp() { -} +CefRunFileDialogCallbackCToCpp::CefRunFileDialogCallbackCToCpp() {} -template<> cef_run_file_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefRunFileDialogCallback* c) { +template <> +cef_run_file_dialog_callback_t* CefCToCppRefCounted< + CefRunFileDialogCallbackCToCpp, + CefRunFileDialogCallback, + cef_run_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type, + CefRunFileDialogCallback* + c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_RUN_FILE_DIALOG_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_RUN_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h index eebd19442..bffc770ce 100644 --- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b8d1746d32c5fc771d83499123ec6920a2aa2fb2$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_ @@ -19,23 +21,24 @@ #endif #include -#include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" -#include "include/cef_client.h" #include "include/capi/cef_client_capi.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefRunFileDialogCallbackCToCpp : public CefCToCppRefCounted { + CefRunFileDialogCallback, + cef_run_file_dialog_callback_t> { public: CefRunFileDialogCallbackCToCpp(); // CefRunFileDialogCallback methods. void OnFileDialogDismissed(int selected_accept_filter, - const std::vector& file_paths) override; + const std::vector& file_paths) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc index a25954fe3..8459f2998 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=873b1eff71d696da390c589c35d039616fc4ea47$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" @@ -16,12 +18,13 @@ #include "libcef_dll/ctocpp/resource_handler_ctocpp.h" #include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( - CefRefPtr browser, CefRefPtr frame, - const CefString& scheme_name, CefRefPtr request) { + CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) { cef_scheme_handler_factory_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, create)) return NULL; @@ -39,34 +42,38 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( // Unverified params: browser, frame // Execute - cef_resource_handler_t* _retval = _struct->create(_struct, - CefBrowserCppToC::Wrap(browser), - CefFrameCppToC::Wrap(frame), - scheme_name.GetStruct(), - CefRequestCppToC::Wrap(request)); + cef_resource_handler_t* _retval = _struct->create( + _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), + scheme_name.GetStruct(), CefRequestCppToC::Wrap(request)); // Return type: refptr_same return CefResourceHandlerCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefSchemeHandlerFactoryCToCpp::CefSchemeHandlerFactoryCToCpp() { -} +CefSchemeHandlerFactoryCToCpp::CefSchemeHandlerFactoryCToCpp() {} -template<> cef_scheme_handler_factory_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefSchemeHandlerFactory* c) { +template <> +cef_scheme_handler_factory_t* CefCToCppRefCounted< + CefSchemeHandlerFactoryCToCpp, + CefSchemeHandlerFactory, + cef_scheme_handler_factory_t>::UnwrapDerived(CefWrapperType type, + CefSchemeHandlerFactory* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SCHEME_HANDLER_FACTORY; diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h index 01b0d1b4c..95350f787 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ce82cf1d315c16d2a2e9a690c7b45579b9eb2183$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ @@ -18,22 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_scheme.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefSchemeHandlerFactoryCToCpp : public CefCToCppRefCounted { + CefSchemeHandlerFactory, + cef_scheme_handler_factory_t> { public: CefSchemeHandlerFactoryCToCpp(); // CefSchemeHandlerFactory methods. CefRefPtr Create(CefRefPtr browser, - CefRefPtr frame, const CefString& scheme_name, - CefRefPtr request) override; + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc b/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc index ed9fd9c9d..50fbfaf7a 100644 --- a/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc @@ -9,15 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2b2e211c650612103fc46dc368fe2fa60492e6ea$ +// #include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, - bool is_standard, bool is_local, bool is_display_isolated, bool is_secure, - bool is_cors_enabled, bool is_csp_bypassing) { + bool is_standard, + bool is_local, + bool is_display_isolated, + bool is_secure, + bool is_cors_enabled, + bool is_csp_bypassing) { cef_scheme_registrar_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, add_custom_scheme)) return false; @@ -30,44 +35,47 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, return false; // Execute - int _retval = _struct->add_custom_scheme(_struct, - scheme_name.GetStruct(), - is_standard, - is_local, - is_display_isolated, - is_secure, - is_cors_enabled, - is_csp_bypassing); + int _retval = _struct->add_custom_scheme( + _struct, scheme_name.GetStruct(), is_standard, is_local, + is_display_isolated, is_secure, is_cors_enabled, is_csp_bypassing); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefSchemeRegistrarCToCpp::CefSchemeRegistrarCToCpp() { -} +CefSchemeRegistrarCToCpp::CefSchemeRegistrarCToCpp() {} -template<> cef_scheme_registrar_t* CefCToCppScoped::UnwrapDerivedOwn( - CefWrapperType type, CefOwnPtr c) { +template <> +cef_scheme_registrar_t* CefCToCppScoped< + CefSchemeRegistrarCToCpp, + CefSchemeRegistrar, + cef_scheme_registrar_t>::UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_scheme_registrar_t* CefCToCppScoped::UnwrapDerivedRaw( - CefWrapperType type, CefRawPtr c) { +template <> +cef_scheme_registrar_t* CefCToCppScoped< + CefSchemeRegistrarCToCpp, + CefSchemeRegistrar, + cef_scheme_registrar_t>::UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = +template <> +CefWrapperType CefCToCppScoped::kWrapperType = WT_SCHEME_REGISTRAR; diff --git a/libcef_dll/ctocpp/scheme_registrar_ctocpp.h b/libcef_dll/ctocpp/scheme_registrar_ctocpp.h index c73725fec..984397cf7 100644 --- a/libcef_dll/ctocpp/scheme_registrar_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_registrar_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3d8b5e8cd8b2775fa63accc1896ac660d112d3a6$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ @@ -18,22 +20,27 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" +#include "include/cef_scheme.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefSchemeRegistrarCToCpp - : public CefCToCppScoped { + : public CefCToCppScoped { public: CefSchemeRegistrarCToCpp(); // CefSchemeRegistrar methods. - bool AddCustomScheme(const CefString& scheme_name, bool is_standard, - bool is_local, bool is_display_isolated, bool is_secure, - bool is_cors_enabled, bool is_csp_bypassing) OVERRIDE; + bool AddCustomScheme(const CefString& scheme_name, + bool is_standard, + bool is_local, + bool is_display_isolated, + bool is_secure, + bool is_cors_enabled, + bool is_csp_bypassing) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc index 73c66f332..2777b60c0 100644 --- a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=843bc95ef88f74f32af2d7bc9a42d6b841b052e7$ +// #include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefSelectClientCertificateCallbackCToCpp::Select( @@ -27,32 +28,36 @@ void CefSelectClientCertificateCallbackCToCpp::Select( // Unverified params: cert // Execute - _struct->select(_struct, - CefX509CertificateCToCpp::Unwrap(cert)); + _struct->select(_struct, CefX509CertificateCToCpp::Unwrap(cert)); } - // CONSTRUCTOR - Do not edit by hand. -CefSelectClientCertificateCallbackCToCpp::CefSelectClientCertificateCallbackCToCpp( - ) { -} +CefSelectClientCertificateCallbackCToCpp:: + CefSelectClientCertificateCallbackCToCpp() {} -template<> cef_select_client_certificate_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefSelectClientCertificateCallback* c) { +template <> +cef_select_client_certificate_callback_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefSelectClientCertificateCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted +CefWrapperType CefCToCppRefCounted< + CefSelectClientCertificateCallbackCToCpp, CefSelectClientCertificateCallback, cef_select_client_certificate_callback_t>::kWrapperType = WT_SELECT_CLIENT_CERTIFICATE_CALLBACK; diff --git a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h index 02cae4237..028b6eb74 100644 --- a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h +++ b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0890056d2cadd93f5405727fb23b6792ba312daf$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SELECT_CLIENT_CERTIFICATE_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SELECT_CLIENT_CERTIFICATE_CALLBACK_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" +#include "include/cef_request_handler.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefSelectClientCertificateCallbackCToCpp : public CefCToCppRefCounted { + CefSelectClientCertificateCallback, + cef_select_client_certificate_callback_t> { public: CefSelectClientCertificateCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc index fdfb97722..e92d4d6e7 100644 --- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=64bb21d6f7eb7214b898501824ecafb9935ba809$ +// #include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefSetCookieCallbackCToCpp::OnComplete(bool success) { @@ -23,28 +24,33 @@ void CefSetCookieCallbackCToCpp::OnComplete(bool success) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->on_complete(_struct, - success); + _struct->on_complete(_struct, success); } - // CONSTRUCTOR - Do not edit by hand. -CefSetCookieCallbackCToCpp::CefSetCookieCallbackCToCpp() { -} +CefSetCookieCallbackCToCpp::CefSetCookieCallbackCToCpp() {} -template<> cef_set_cookie_callback_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefSetCookieCallback* c) { +template <> +cef_set_cookie_callback_t* CefCToCppRefCounted< + CefSetCookieCallbackCToCpp, + CefSetCookieCallback, + cef_set_cookie_callback_t>::UnwrapDerived(CefWrapperType type, + CefSetCookieCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SET_COOKIE_CALLBACK; diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h index 3bcb48737..fd1cebd40 100644 --- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h +++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5cb193d97f2ae5ddfecf9d2a57524d1f14f10ca3$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SET_COOKIE_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SET_COOKIE_CALLBACK_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" +#include "include/cef_cookie.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefSetCookieCallbackCToCpp : public CefCToCppRefCounted { + CefSetCookieCallback, + cef_set_cookie_callback_t> { public: CefSetCookieCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.cc b/libcef_dll/ctocpp/sslinfo_ctocpp.cc index 9f0fbef84..44f6a8f5f 100644 --- a/libcef_dll/ctocpp/sslinfo_ctocpp.cc +++ b/libcef_dll/ctocpp/sslinfo_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=cacdb914520e516cc103d8a3318ae768339df314$ +// #include "libcef_dll/ctocpp/sslinfo_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. cef_cert_status_t CefSSLInfoCToCpp::GetCertStatus() { @@ -44,22 +45,27 @@ CefRefPtr CefSSLInfoCToCpp::GetX509Certificate() { return CefX509CertificateCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefSSLInfoCToCpp::CefSSLInfoCToCpp() { -} +CefSSLInfoCToCpp::CefSSLInfoCToCpp() {} -template<> cef_sslinfo_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefSSLInfo* c) { +template <> +cef_sslinfo_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefSSLInfo* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SSLINFO; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SSLINFO; diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.h b/libcef_dll/ctocpp/sslinfo_ctocpp.h index c494eb320..8c98b3d45 100644 --- a/libcef_dll/ctocpp/sslinfo_ctocpp.h +++ b/libcef_dll/ctocpp/sslinfo_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=16d6b5872e3d8609c825026cd3cd0e83e44ca1e4$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SSLINFO_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SSLINFO_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_ssl_info.h" #include "include/capi/cef_ssl_info_capi.h" +#include "include/cef_ssl_info.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/sslstatus_ctocpp.cc b/libcef_dll/ctocpp/sslstatus_ctocpp.cc index c0fe9b924..9075bb1b8 100644 --- a/libcef_dll/ctocpp/sslstatus_ctocpp.cc +++ b/libcef_dll/ctocpp/sslstatus_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7c600e4c245f2a601a4d9664f1661f963b5fe714$ +// #include "libcef_dll/ctocpp/sslstatus_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefSSLStatusCToCpp::IsSecureConnection() { @@ -27,7 +28,7 @@ bool CefSSLStatusCToCpp::IsSecureConnection() { int _retval = _struct->is_secure_connection(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } cef_cert_status_t CefSSLStatusCToCpp::GetCertStatus() { @@ -86,23 +87,27 @@ CefRefPtr CefSSLStatusCToCpp::GetX509Certificate() { return CefX509CertificateCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefSSLStatusCToCpp::CefSSLStatusCToCpp() { -} +CefSSLStatusCToCpp::CefSSLStatusCToCpp() {} -template<> cef_sslstatus_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefSSLStatus* c) { +template <> +cef_sslstatus_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefSSLStatus* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SSLSTATUS; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_SSLSTATUS; diff --git a/libcef_dll/ctocpp/sslstatus_ctocpp.h b/libcef_dll/ctocpp/sslstatus_ctocpp.h index 3d3904909..6791548bd 100644 --- a/libcef_dll/ctocpp/sslstatus_ctocpp.h +++ b/libcef_dll/ctocpp/sslstatus_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=087dfd8003478f7e1c145b5fa478eb55c5fbfccd$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_SSLSTATUS_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_SSLSTATUS_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_ssl_status.h" #include "include/capi/cef_ssl_status_capi.h" +#include "include/cef_ssl_status.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefSSLStatusCToCpp - : public CefCToCppRefCounted { +class CefSSLStatusCToCpp : public CefCToCppRefCounted { public: CefSSLStatusCToCpp(); diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc index 8e82738f1..0989f9498 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0ec4ed2c33eca8b0f123dc7cec65dbdf389462d2$ +// #include "libcef_dll/cpptoc/read_handler_cpptoc.h" #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefStreamReader::CreateForFile( @@ -26,15 +27,15 @@ CefRefPtr CefStreamReader::CreateForFile( return NULL; // Execute - cef_stream_reader_t* _retval = cef_stream_reader_create_for_file( - fileName.GetStruct()); + cef_stream_reader_t* _retval = + cef_stream_reader_create_for_file(fileName.GetStruct()); // Return type: refptr_same return CefStreamReaderCToCpp::Wrap(_retval); } CefRefPtr CefStreamReader::CreateForData(void* data, - size_t size) { + size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -43,9 +44,7 @@ CefRefPtr CefStreamReader::CreateForData(void* data, return NULL; // Execute - cef_stream_reader_t* _retval = cef_stream_reader_create_for_data( - data, - size); + cef_stream_reader_t* _retval = cef_stream_reader_create_for_data(data, size); // Return type: refptr_same return CefStreamReaderCToCpp::Wrap(_retval); @@ -61,14 +60,13 @@ CefRefPtr CefStreamReader::CreateForHandler( return NULL; // Execute - cef_stream_reader_t* _retval = cef_stream_reader_create_for_handler( - CefReadHandlerCppToC::Wrap(handler)); + cef_stream_reader_t* _retval = + cef_stream_reader_create_for_handler(CefReadHandlerCppToC::Wrap(handler)); // Return type: refptr_same return CefStreamReaderCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { @@ -84,10 +82,7 @@ size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = _struct->read(_struct, - ptr, - size, - n); + size_t _retval = _struct->read(_struct, ptr, size, n); // Return type: simple return _retval; @@ -101,9 +96,7 @@ int CefStreamReaderCToCpp::Seek(int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->seek(_struct, - offset, - whence); + int _retval = _struct->seek(_struct, offset, whence); // Return type: simple return _retval; @@ -148,26 +141,32 @@ bool CefStreamReaderCToCpp::MayBlock() { int _retval = _struct->may_block(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefStreamReaderCToCpp::CefStreamReaderCToCpp() { -} +CefStreamReaderCToCpp::CefStreamReaderCToCpp() {} -template<> cef_stream_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefStreamReader* c) { +template <> +cef_stream_reader_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefStreamReader* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STREAM_READER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_STREAM_READER; diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h index 4dbcd12f3..2aa9d96a7 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.h +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=604f97b3cd8cf3dbd1a603e596daba809ccb104f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefStreamReaderCToCpp - : public CefCToCppRefCounted { +class CefStreamReaderCToCpp : public CefCToCppRefCounted { public: CefStreamReaderCToCpp(); diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc index b4c6fe123..b9210ddf9 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f0efd8c331d50945f8030c786eb88c99a4ac86ed$ +// #include "libcef_dll/cpptoc/write_handler_cpptoc.h" #include "libcef_dll/ctocpp/stream_writer_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefStreamWriter::CreateForFile( @@ -26,8 +27,8 @@ CefRefPtr CefStreamWriter::CreateForFile( return NULL; // Execute - cef_stream_writer_t* _retval = cef_stream_writer_create_for_file( - fileName.GetStruct()); + cef_stream_writer_t* _retval = + cef_stream_writer_create_for_file(fileName.GetStruct()); // Return type: refptr_same return CefStreamWriterCToCpp::Wrap(_retval); @@ -50,7 +51,6 @@ CefRefPtr CefStreamWriter::CreateForHandler( return CefStreamWriterCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { @@ -66,10 +66,7 @@ size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = _struct->write(_struct, - ptr, - size, - n); + size_t _retval = _struct->write(_struct, ptr, size, n); // Return type: simple return _retval; @@ -83,9 +80,7 @@ int CefStreamWriterCToCpp::Seek(int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->seek(_struct, - offset, - whence); + int _retval = _struct->seek(_struct, offset, whence); // Return type: simple return _retval; @@ -130,26 +125,32 @@ bool CefStreamWriterCToCpp::MayBlock() { int _retval = _struct->may_block(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefStreamWriterCToCpp::CefStreamWriterCToCpp() { -} +CefStreamWriterCToCpp::CefStreamWriterCToCpp() {} -template<> cef_stream_writer_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefStreamWriter* c) { +template <> +cef_stream_writer_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefStreamWriter* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STREAM_WRITER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_STREAM_WRITER; diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h index 3f7476d86..bed099555 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.h +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f21436369197b967957c039f1a510b9a3ec9c5a8$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefStreamWriterCToCpp - : public CefCToCppRefCounted { +class CefStreamWriterCToCpp : public CefCToCppRefCounted { public: CefStreamWriterCToCpp(); diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.cc b/libcef_dll/ctocpp/string_visitor_ctocpp.cc index 18e2cab95..9376f5bf1 100644 --- a/libcef_dll/ctocpp/string_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/string_visitor_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1df4d5e3bf537c2a8668df657dc8eabe55bdb5ff$ +// #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefStringVisitorCToCpp::Visit(const CefString& string) { @@ -25,27 +26,32 @@ void CefStringVisitorCToCpp::Visit(const CefString& string) { // Unverified params: string // Execute - _struct->visit(_struct, - string.GetStruct()); + _struct->visit(_struct, string.GetStruct()); } - // CONSTRUCTOR - Do not edit by hand. -CefStringVisitorCToCpp::CefStringVisitorCToCpp() { -} +CefStringVisitorCToCpp::CefStringVisitorCToCpp() {} -template<> cef_string_visitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefStringVisitor* c) { +template <> +cef_string_visitor_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefStringVisitor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STRING_VISITOR; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_STRING_VISITOR; diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.h b/libcef_dll/ctocpp/string_visitor_ctocpp.h index b8fd4c569..ac10500cd 100644 --- a/libcef_dll/ctocpp/string_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/string_visitor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a03f2252039d8736ef18636e4b582fa748901219$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_STRING_VISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_STRING_VISITOR_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/cef_string_visitor.h" #include "include/capi/cef_string_visitor_capi.h" +#include "include/cef_string_visitor.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefStringVisitorCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefStringVisitorCToCpp(); diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc index e447dd5b5..62580b265 100644 --- a/libcef_dll/ctocpp/task_ctocpp.cc +++ b/libcef_dll/ctocpp/task_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8693984af64ea36db2fb82d397f7e0b482cccb99$ +// #include "libcef_dll/ctocpp/task_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefTaskCToCpp::Execute() { @@ -26,22 +27,26 @@ void CefTaskCToCpp::Execute() { _struct->execute(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefTaskCToCpp::CefTaskCToCpp() { -} +CefTaskCToCpp::CefTaskCToCpp() {} -template<> cef_task_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefTask* c) { +template <> +cef_task_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefTask* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TASK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_TASK; diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h index c3cb9b339..235a7c2e9 100644 --- a/libcef_dll/ctocpp/task_ctocpp.h +++ b/libcef_dll/ctocpp/task_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=08a239239e42b86a7981838e58b10eefa56a317b$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included DLL-side only #endif -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" +#include "include/cef_task.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.cc b/libcef_dll/ctocpp/task_runner_ctocpp.cc index 8537c2225..ade473919 100644 --- a/libcef_dll/ctocpp/task_runner_ctocpp.cc +++ b/libcef_dll/ctocpp/task_runner_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1c3649a0a566198686f496673b77f9bd74865581$ +// #include "libcef_dll/cpptoc/task_cpptoc.h" #include "libcef_dll/ctocpp/task_runner_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefTaskRunner::GetForCurrentThread() { @@ -30,14 +31,12 @@ CefRefPtr CefTaskRunner::GetForThread(CefThreadId threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_task_runner_t* _retval = cef_task_runner_get_for_thread( - threadId); + cef_task_runner_t* _retval = cef_task_runner_get_for_thread(threadId); // Return type: refptr_same return CefTaskRunnerCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { @@ -53,11 +52,10 @@ bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefTaskRunnerCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefTaskRunnerCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTaskRunnerCToCpp::BelongsToCurrentThread() { @@ -71,7 +69,7 @@ bool CefTaskRunnerCToCpp::BelongsToCurrentThread() { int _retval = _struct->belongs_to_current_thread(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) { @@ -82,11 +80,10 @@ bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->belongs_to_thread(_struct, - threadId); + int _retval = _struct->belongs_to_thread(_struct, threadId); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { @@ -102,15 +99,14 @@ bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { return false; // Execute - int _retval = _struct->post_task(_struct, - CefTaskCppToC::Wrap(task)); + int _retval = _struct->post_task(_struct, CefTaskCppToC::Wrap(task)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, - int64 delay_ms) { + int64 delay_ms) { cef_task_runner_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, post_delayed_task)) return false; @@ -123,31 +119,34 @@ bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, return false; // Execute - int _retval = _struct->post_delayed_task(_struct, - CefTaskCppToC::Wrap(task), - delay_ms); + int _retval = + _struct->post_delayed_task(_struct, CefTaskCppToC::Wrap(task), delay_ms); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefTaskRunnerCToCpp::CefTaskRunnerCToCpp() { -} +CefTaskRunnerCToCpp::CefTaskRunnerCToCpp() {} -template<> cef_task_runner_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefTaskRunner* c) { +template <> +cef_task_runner_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTaskRunner* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TASK_RUNNER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_TASK_RUNNER; diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.h b/libcef_dll/ctocpp/task_runner_ctocpp.h index a3631f8db..159c74dc1 100644 --- a/libcef_dll/ctocpp/task_runner_ctocpp.h +++ b/libcef_dll/ctocpp/task_runner_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=edae05f04964383ddb8eef9d16147739ce2f89b6$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" +#include "include/cef_task.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefTaskRunnerCToCpp - : public CefCToCppRefCounted { +class CefTaskRunnerCToCpp : public CefCToCppRefCounted { public: CefTaskRunnerCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc index f4444f299..5b6142e65 100644 --- a/libcef_dll/ctocpp/test/translator_test_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc @@ -9,20 +9,21 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=abbba0b09a8c13d342b51a2b8cfbc363fde99ca2$ +// #include -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" #include "libcef_dll/ctocpp/test/translator_test_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefTranslatorTest::Create() { @@ -35,7 +36,6 @@ CefRefPtr CefTranslatorTest::Create() { return CefTranslatorTestCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefTranslatorTestCToCpp::GetVoid() { @@ -60,7 +60,7 @@ bool CefTranslatorTestCToCpp::GetBool() { int _retval = _struct->get_bool(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefTranslatorTestCToCpp::GetInt() { @@ -130,7 +130,7 @@ bool CefTranslatorTestCToCpp::SetVoid() { int _retval = _struct->set_void(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetBool(bool val) { @@ -141,11 +141,10 @@ bool CefTranslatorTestCToCpp::SetBool(bool val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_bool(_struct, - val); + int _retval = _struct->set_bool(_struct, val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetInt(int val) { @@ -156,11 +155,10 @@ bool CefTranslatorTestCToCpp::SetInt(int val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_int(_struct, - val); + int _retval = _struct->set_int(_struct, val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetDouble(double val) { @@ -171,11 +169,10 @@ bool CefTranslatorTestCToCpp::SetDouble(double val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_double(_struct, - val); + int _retval = _struct->set_double(_struct, val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetLong(long val) { @@ -186,11 +183,10 @@ bool CefTranslatorTestCToCpp::SetLong(long val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_long(_struct, - val); + int _retval = _struct->set_long(_struct, val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetSizet(size_t val) { @@ -201,11 +197,10 @@ bool CefTranslatorTestCToCpp::SetSizet(size_t val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_sizet(_struct, - val); + int _retval = _struct->set_sizet(_struct, val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetIntList(const std::vector& val) { @@ -229,16 +224,14 @@ bool CefTranslatorTestCToCpp::SetIntList(const std::vector& val) { } // Execute - int _retval = _struct->set_int_list(_struct, - valCount, - valList); + int _retval = _struct->set_int_list(_struct, valCount, valList); // Restore param:val; type: simple_vec_byref_const if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { @@ -256,7 +249,7 @@ bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { valList = new int[valCount]; DCHECK(valList); if (valList) { - memset(valList, 0, sizeof(int)*valCount); + memset(valList, 0, sizeof(int) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { @@ -266,9 +259,7 @@ bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { } // Execute - int _retval = _struct->get_int_list_by_ref(_struct, - &valCount, - valList); + int _retval = _struct->get_int_list_by_ref(_struct, &valCount, valList); // Restore param:val; type: simple_vec_byref val.clear(); @@ -276,11 +267,11 @@ bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { for (size_t i = 0; i < valCount; ++i) { val.push_back(valList[i]); } - delete [] valList; + delete[] valList; } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetIntListSize() { @@ -326,11 +317,10 @@ bool CefTranslatorTestCToCpp::SetString(const CefString& val) { return false; // Execute - int _retval = _struct->set_string(_struct, - val.GetStruct()); + int _retval = _struct->set_string(_struct, val.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTranslatorTestCToCpp::GetStringByRef(CefString& val) { @@ -341,8 +331,7 @@ void CefTranslatorTestCToCpp::GetStringByRef(CefString& val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->get_string_by_ref(_struct, - val.GetWritableStruct()); + _struct->get_string_by_ref(_struct, val.GetWritableStruct()); } bool CefTranslatorTestCToCpp::SetStringList(const std::vector& val) { @@ -359,15 +348,14 @@ bool CefTranslatorTestCToCpp::SetStringList(const std::vector& val) { transfer_string_list_contents(val, valList); // Execute - int _retval = _struct->set_string_list(_struct, - valList); + int _retval = _struct->set_string_list(_struct, valList); // Restore param:val; type: string_vec_byref_const if (valList) cef_string_list_free(valList); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetStringListByRef(StringList& val) { @@ -384,8 +372,7 @@ bool CefTranslatorTestCToCpp::GetStringListByRef(StringList& val) { transfer_string_list_contents(val, valList); // Execute - int _retval = _struct->get_string_list_by_ref(_struct, - valList); + int _retval = _struct->get_string_list_by_ref(_struct, valList); // Restore param:val; type: string_vec_byref if (valList) { @@ -395,7 +382,7 @@ bool CefTranslatorTestCToCpp::GetStringListByRef(StringList& val) { } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetStringMap(const StringMap& val) { @@ -412,19 +399,18 @@ bool CefTranslatorTestCToCpp::SetStringMap(const StringMap& val) { transfer_string_map_contents(val, valMap); // Execute - int _retval = _struct->set_string_map(_struct, - valMap); + int _retval = _struct->set_string_map(_struct, valMap); // Restore param:val; type: string_map_single_byref_const if (valMap) cef_string_map_free(valMap); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefTranslatorTestCToCpp::GetStringMapByRef(std::map& val) { +bool CefTranslatorTestCToCpp::GetStringMapByRef( + std::map& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string_map_by_ref)) return false; @@ -438,8 +424,7 @@ bool CefTranslatorTestCToCpp::GetStringMapByRef(std::mapget_string_map_by_ref(_struct, - valMap); + int _retval = _struct->get_string_map_by_ref(_struct, valMap); // Restore param:val; type: string_map_single_byref if (valMap) { @@ -449,11 +434,11 @@ bool CefTranslatorTestCToCpp::GetStringMapByRef(std::map& val) { +bool CefTranslatorTestCToCpp::SetStringMultimap( + const std::multimap& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string_multimap)) return false; @@ -467,15 +452,14 @@ bool CefTranslatorTestCToCpp::SetStringMultimap(const std::multimapset_string_multimap(_struct, - valMultimap); + int _retval = _struct->set_string_multimap(_struct, valMultimap); // Restore param:val; type: string_map_multi_byref_const if (valMultimap) cef_string_multimap_free(valMultimap); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetStringMultimapByRef(StringMultimap& val) { @@ -492,8 +476,7 @@ bool CefTranslatorTestCToCpp::GetStringMultimapByRef(StringMultimap& val) { transfer_string_multimap_contents(val, valMultimap); // Execute - int _retval = _struct->get_string_multimap_by_ref(_struct, - valMultimap); + int _retval = _struct->get_string_multimap_by_ref(_struct, valMultimap); // Restore param:val; type: string_map_multi_byref if (valMultimap) { @@ -503,7 +486,7 @@ bool CefTranslatorTestCToCpp::GetStringMultimapByRef(StringMultimap& val) { } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefPoint CefTranslatorTestCToCpp::GetPoint() { @@ -528,11 +511,10 @@ bool CefTranslatorTestCToCpp::SetPoint(const CefPoint& val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_point(_struct, - &val); + int _retval = _struct->set_point(_struct, &val); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTranslatorTestCToCpp::GetPointByRef(CefPoint& val) { @@ -543,8 +525,7 @@ void CefTranslatorTestCToCpp::GetPointByRef(CefPoint& val) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->get_point_by_ref(_struct, - &val); + _struct->get_point_by_ref(_struct, &val); } bool CefTranslatorTestCToCpp::SetPointList(const std::vector& val) { @@ -568,16 +549,14 @@ bool CefTranslatorTestCToCpp::SetPointList(const std::vector& val) { } // Execute - int _retval = _struct->set_point_list(_struct, - valCount, - valList); + int _retval = _struct->set_point_list(_struct, valCount, valList); // Restore param:val; type: simple_vec_byref_const if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { @@ -595,7 +574,7 @@ bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { valList = new cef_point_t[valCount]; DCHECK(valList); if (valList) { - memset(valList, 0, sizeof(cef_point_t)*valCount); + memset(valList, 0, sizeof(cef_point_t) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { @@ -605,9 +584,7 @@ bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { } // Execute - int _retval = _struct->get_point_list_by_ref(_struct, - &valCount, - valList); + int _retval = _struct->get_point_list_by_ref(_struct, &valCount, valList); // Restore param:val; type: simple_vec_byref val.clear(); @@ -615,11 +592,11 @@ bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { for (size_t i = 0; i < valCount; ++i) { val.push_back(valList[i]); } - delete [] valList; + delete[] valList; } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetPointListSize() { @@ -636,8 +613,8 @@ size_t CefTranslatorTestCToCpp::GetPointListSize() { return _retval; } -CefRefPtr CefTranslatorTestCToCpp::GetRefPtrLibrary( - int val) { +CefRefPtr +CefTranslatorTestCToCpp::GetRefPtrLibrary(int val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library)) return NULL; @@ -645,9 +622,8 @@ CefRefPtr CefTranslatorTestCToCpp::GetRefPtrLibr // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_translator_test_ref_ptr_library_t* _retval = _struct->get_ref_ptr_library( - _struct, - val); + cef_translator_test_ref_ptr_library_t* _retval = + _struct->get_ref_ptr_library(_struct, val); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); @@ -667,14 +643,15 @@ int CefTranslatorTestCToCpp::SetRefPtrLibrary( return 0; // Execute - int _retval = _struct->set_ref_ptr_library(_struct, - CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); + int _retval = _struct->set_ref_ptr_library( + _struct, CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); // Return type: simple return _retval; } -CefRefPtr CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn( +CefRefPtr +CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn( CefRefPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_and_return)) @@ -689,8 +666,8 @@ CefRefPtr CefTranslatorTestCToCpp::SetRefPtrLibr // Execute cef_translator_test_ref_ptr_library_t* _retval = - _struct->set_ref_ptr_library_and_return(_struct, - CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); + _struct->set_ref_ptr_library_and_return( + _struct, CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); @@ -710,14 +687,15 @@ int CefTranslatorTestCToCpp::SetChildRefPtrLibrary( return 0; // Execute - int _retval = _struct->set_child_ref_ptr_library(_struct, - CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); + int _retval = _struct->set_child_ref_ptr_library( + _struct, CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); // Return type: simple return _retval; } -CefRefPtr CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent( +CefRefPtr +CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent( CefRefPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_library_and_return_parent)) @@ -732,15 +710,16 @@ CefRefPtr CefTranslatorTestCToCpp::SetChildRefPt // Execute cef_translator_test_ref_ptr_library_t* _retval = - _struct->set_child_ref_ptr_library_and_return_parent(_struct, - CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); + _struct->set_child_ref_ptr_library_and_return_parent( + _struct, CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); } bool CefTranslatorTestCToCpp::SetRefPtrLibraryList( - const std::vector>& val, int val1, + const std::vector>& val, + int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_list)) @@ -762,22 +741,20 @@ bool CefTranslatorTestCToCpp::SetRefPtrLibraryList( } // Execute - int _retval = _struct->set_ref_ptr_library_list(_struct, - valCount, - valList, - val1, - val2); + int _retval = + _struct->set_ref_ptr_library_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: refptr_vec_same_byref_const if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val, - int val1, int val2) { + int val1, + int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library_list_by_ref)) return false; @@ -792,8 +769,8 @@ bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val, valList = new cef_translator_test_ref_ptr_library_t*[valCount]; DCHECK(valList); if (valList) { - memset(valList, 0, sizeof( - cef_translator_test_ref_ptr_library_t*)*valCount); + memset(valList, 0, + sizeof(cef_translator_test_ref_ptr_library_t*) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { @@ -803,11 +780,8 @@ bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val, } // Execute - int _retval = _struct->get_ref_ptr_library_list_by_ref(_struct, - &valCount, - valList, - val1, - val2); + int _retval = _struct->get_ref_ptr_library_list_by_ref(_struct, &valCount, + valList, val1, val2); // Restore param:val; type: refptr_vec_same_byref val.clear(); @@ -815,11 +789,11 @@ bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val, for (size_t i = 0; i < valCount; ++i) { val.push_back(CefTranslatorTestRefPtrLibraryCToCpp::Wrap(valList[i])); } - delete [] valList; + delete[] valList; } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetRefPtrLibraryListSize() { @@ -850,14 +824,15 @@ int CefTranslatorTestCToCpp::SetRefPtrClient( return 0; // Execute - int _retval = _struct->set_ref_ptr_client(_struct, - CefTranslatorTestRefPtrClientCppToC::Wrap(val)); + int _retval = _struct->set_ref_ptr_client( + _struct, CefTranslatorTestRefPtrClientCppToC::Wrap(val)); // Return type: simple return _retval; } -CefRefPtr CefTranslatorTestCToCpp::SetRefPtrClientAndReturn( +CefRefPtr +CefTranslatorTestCToCpp::SetRefPtrClientAndReturn( CefRefPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_and_return)) @@ -872,8 +847,8 @@ CefRefPtr CefTranslatorTestCToCpp::SetRefPtrClien // Execute cef_translator_test_ref_ptr_client_t* _retval = - _struct->set_ref_ptr_client_and_return(_struct, - CefTranslatorTestRefPtrClientCppToC::Wrap(val)); + _struct->set_ref_ptr_client_and_return( + _struct, CefTranslatorTestRefPtrClientCppToC::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval); @@ -893,14 +868,15 @@ int CefTranslatorTestCToCpp::SetChildRefPtrClient( return 0; // Execute - int _retval = _struct->set_child_ref_ptr_client(_struct, - CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); + int _retval = _struct->set_child_ref_ptr_client( + _struct, CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); // Return type: simple return _retval; } -CefRefPtr CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent( +CefRefPtr +CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent( CefRefPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_client_and_return_parent)) @@ -915,15 +891,16 @@ CefRefPtr CefTranslatorTestCToCpp::SetChildRefPtr // Execute cef_translator_test_ref_ptr_client_t* _retval = - _struct->set_child_ref_ptr_client_and_return_parent(_struct, - CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); + _struct->set_child_ref_ptr_client_and_return_parent( + _struct, CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval); } bool CefTranslatorTestCToCpp::SetRefPtrClientList( - const std::vector>& val, int val1, + const std::vector>& val, + int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_list)) @@ -945,21 +922,19 @@ bool CefTranslatorTestCToCpp::SetRefPtrClientList( } // Execute - int _retval = _struct->set_ref_ptr_client_list(_struct, - valCount, - valList, - val1, - val2); + int _retval = + _struct->set_ref_ptr_client_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: refptr_vec_diff_byref_const if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef(RefPtrClientList& val, +bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef( + RefPtrClientList& val, CefRefPtr val1, CefRefPtr val2) { cef_translator_test_t* _struct = GetStruct(); @@ -985,8 +960,8 @@ bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef(RefPtrClientList& val, valList = new cef_translator_test_ref_ptr_client_t*[valCount]; DCHECK(valList); if (valList) { - memset(valList, 0, sizeof( - cef_translator_test_ref_ptr_client_t*)*valCount); + memset(valList, 0, + sizeof(cef_translator_test_ref_ptr_client_t*) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { @@ -996,9 +971,8 @@ bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef(RefPtrClientList& val, } // Execute - int _retval = _struct->get_ref_ptr_client_list_by_ref(_struct, - &valCount, - valList, + int _retval = _struct->get_ref_ptr_client_list_by_ref( + _struct, &valCount, valList, CefTranslatorTestRefPtrClientCppToC::Wrap(val1), CefTranslatorTestRefPtrClientCppToC::Wrap(val2)); @@ -1008,11 +982,11 @@ bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef(RefPtrClientList& val, for (size_t i = 0; i < valCount; ++i) { val.push_back(CefTranslatorTestRefPtrClientCppToC::Unwrap(valList[i])); } - delete [] valList; + delete[] valList; } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() { @@ -1029,8 +1003,8 @@ size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() { return _retval; } -CefOwnPtr CefTranslatorTestCToCpp::GetOwnPtrLibrary( - int val) { +CefOwnPtr +CefTranslatorTestCToCpp::GetOwnPtrLibrary(int val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_own_ptr_library)) return CefOwnPtr(); @@ -1038,9 +1012,8 @@ CefOwnPtr CefTranslatorTestCToCpp::GetOwnPtrLibr // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_translator_test_scoped_library_t* _retval = _struct->get_own_ptr_library( - _struct, - val); + cef_translator_test_scoped_library_t* _retval = + _struct->get_own_ptr_library(_struct, val); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); @@ -1060,14 +1033,15 @@ int CefTranslatorTestCToCpp::SetOwnPtrLibrary( return 0; // Execute - int _retval = _struct->set_own_ptr_library(_struct, - CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); + int _retval = _struct->set_own_ptr_library( + _struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } -CefOwnPtr CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn( +CefOwnPtr +CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn( CefOwnPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_library_and_return)) @@ -1082,8 +1056,9 @@ CefOwnPtr CefTranslatorTestCToCpp::SetOwnPtrLibr // Execute cef_translator_test_scoped_library_t* _retval = - _struct->set_own_ptr_library_and_return(_struct, - CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); + _struct->set_own_ptr_library_and_return( + _struct, + CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); @@ -1103,14 +1078,16 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary( return 0; // Execute - int _retval = _struct->set_child_own_ptr_library(_struct, + int _retval = _struct->set_child_own_ptr_library( + _struct, CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } -CefOwnPtr CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent( +CefOwnPtr +CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent( CefOwnPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_library_and_return_parent)) @@ -1125,8 +1102,9 @@ CefOwnPtr CefTranslatorTestCToCpp::SetChildOwnPt // Execute cef_translator_test_scoped_library_t* _retval = - _struct->set_child_own_ptr_library_and_return_parent(_struct, - CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val))); + _struct->set_child_own_ptr_library_and_return_parent( + _struct, + CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); @@ -1146,14 +1124,15 @@ int CefTranslatorTestCToCpp::SetOwnPtrClient( return 0; // Execute - int _retval = _struct->set_own_ptr_client(_struct, - CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); + int _retval = _struct->set_own_ptr_client( + _struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } -CefOwnPtr CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn( +CefOwnPtr +CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn( CefOwnPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_client_and_return)) @@ -1168,8 +1147,8 @@ CefOwnPtr CefTranslatorTestCToCpp::SetOwnPtrClien // Execute cef_translator_test_scoped_client_t* _retval = - _struct->set_own_ptr_client_and_return(_struct, - CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); + _struct->set_own_ptr_client_and_return( + _struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); // Return type: ownptr_diff return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval); @@ -1189,14 +1168,16 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrClient( return 0; // Execute - int _retval = _struct->set_child_own_ptr_client(_struct, + int _retval = _struct->set_child_own_ptr_client( + _struct, CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } -CefOwnPtr CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent( +CefOwnPtr +CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent( CefOwnPtr val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_client_and_return_parent)) @@ -1211,8 +1192,9 @@ CefOwnPtr CefTranslatorTestCToCpp::SetChildOwnPtr // Execute cef_translator_test_scoped_client_t* _retval = - _struct->set_child_own_ptr_client_and_return_parent(_struct, - CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val))); + _struct->set_child_own_ptr_client_and_return_parent( + _struct, + CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val))); // Return type: ownptr_diff return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval); @@ -1232,8 +1214,8 @@ int CefTranslatorTestCToCpp::SetRawPtrLibrary( return 0; // Execute - int _retval = _struct->set_raw_ptr_library(_struct, - CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val)); + int _retval = _struct->set_raw_ptr_library( + _struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val)); // Return type: simple return _retval; @@ -1253,15 +1235,16 @@ int CefTranslatorTestCToCpp::SetChildRawPtrLibrary( return 0; // Execute - int _retval = _struct->set_child_raw_ptr_library(_struct, - CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(val)); + int _retval = _struct->set_child_raw_ptr_library( + _struct, CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(val)); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetRawPtrLibraryList( - const std::vector>& val, int val1, + const std::vector>& val, + int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_library_list)) @@ -1283,18 +1266,15 @@ bool CefTranslatorTestCToCpp::SetRawPtrLibraryList( } // Execute - int _retval = _struct->set_raw_ptr_library_list(_struct, - valCount, - valList, - val1, - val2); + int _retval = + _struct->set_raw_ptr_library_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: rawptr_vec_same_byref_const if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefTranslatorTestCToCpp::SetRawPtrClient( @@ -1315,8 +1295,7 @@ int CefTranslatorTestCToCpp::SetRawPtrClient( CefTranslatorTestScopedClientCppToC::WrapRaw(val)); // Execute - int _retval = _struct->set_raw_ptr_client(_struct, - valPtr->GetStruct()); + int _retval = _struct->set_raw_ptr_client(_struct, valPtr->GetStruct()); // Return type: simple return _retval; @@ -1340,15 +1319,15 @@ int CefTranslatorTestCToCpp::SetChildRawPtrClient( CefTranslatorTestScopedClientChildCppToC::WrapRaw(val)); // Execute - int _retval = _struct->set_child_raw_ptr_client(_struct, - valPtr->GetStruct()); + int _retval = _struct->set_child_raw_ptr_client(_struct, valPtr->GetStruct()); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetRawPtrClientList( - const std::vector>& val, int val1, + const std::vector>& val, + int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_client_list)) @@ -1364,18 +1343,16 @@ bool CefTranslatorTestCToCpp::SetRawPtrClientList( DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { - valList[i] = CefTranslatorTestScopedClientCppToC::WrapRaw( - val[i]).release()->GetStruct(); + valList[i] = CefTranslatorTestScopedClientCppToC::WrapRaw(val[i]) + .release() + ->GetStruct(); } } } // Execute - int _retval = _struct->set_raw_ptr_client_list(_struct, - valCount, - valList, - val1, - val2); + int _retval = + _struct->set_raw_ptr_client_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: rawptr_vec_diff_byref_const if (valCount > 0) { @@ -1384,30 +1361,35 @@ bool CefTranslatorTestCToCpp::SetRawPtrClientList( } } if (valList) - delete [] valList; + delete[] valList; // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestCToCpp::CefTranslatorTestCToCpp() { -} +CefTranslatorTestCToCpp::CefTranslatorTestCToCpp() {} -template<> cef_translator_test_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefTranslatorTest* c) { +template <> +cef_translator_test_t* CefCToCppRefCounted< + CefTranslatorTestCToCpp, + CefTranslatorTest, + cef_translator_test_t>::UnwrapDerived(CefWrapperType type, + CefTranslatorTest* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TRANSLATOR_TEST; diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ctocpp.h index 07afe803a..d9f6f4907 100644 --- a/libcef_dll/ctocpp/test/translator_test_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c86d51db351aeb618d915e3b65d4ee2952884682$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ @@ -20,15 +22,16 @@ #include #include -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefTranslatorTestCToCpp(); @@ -55,8 +58,8 @@ class CefTranslatorTestCToCpp bool GetStringListByRef(StringList& val) OVERRIDE; bool SetStringMap(const StringMap& val) OVERRIDE; bool GetStringMapByRef(std::map& val) OVERRIDE; - bool SetStringMultimap(const std::multimap& val) OVERRIDE; + bool SetStringMultimap( + const std::multimap& val) OVERRIDE; bool GetStringMultimapByRef(StringMultimap& val) OVERRIDE; CefPoint GetPoint() OVERRIDE; bool SetPoint(const CefPoint& val) OVERRIDE; @@ -70,13 +73,16 @@ class CefTranslatorTestCToCpp CefRefPtr val) OVERRIDE; int SetChildRefPtrLibrary( CefRefPtr val) OVERRIDE; - CefRefPtr SetChildRefPtrLibraryAndReturnParent( + CefRefPtr + SetChildRefPtrLibraryAndReturnParent( CefRefPtr val) OVERRIDE; bool SetRefPtrLibraryList( const std::vector>& val, - int val1, int val2) OVERRIDE; - bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1, + int val1, int val2) OVERRIDE; + bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, + int val1, + int val2) OVERRIDE; size_t GetRefPtrLibraryListSize() OVERRIDE; int SetRefPtrClient(CefRefPtr val) OVERRIDE; CefRefPtr SetRefPtrClientAndReturn( @@ -87,8 +93,10 @@ class CefTranslatorTestCToCpp CefRefPtr val) OVERRIDE; bool SetRefPtrClientList( const std::vector>& val, - int val1, int val2) OVERRIDE; - bool GetRefPtrClientListByRef(RefPtrClientList& val, + int val1, + int val2) OVERRIDE; + bool GetRefPtrClientListByRef( + RefPtrClientList& val, CefRefPtr val1, CefRefPtr val2) OVERRIDE; size_t GetRefPtrClientListSize() OVERRIDE; @@ -98,7 +106,8 @@ class CefTranslatorTestCToCpp CefOwnPtr val) OVERRIDE; int SetChildOwnPtrLibrary( CefOwnPtr val) OVERRIDE; - CefOwnPtr SetChildOwnPtrLibraryAndReturnParent( + CefOwnPtr + SetChildOwnPtrLibraryAndReturnParent( CefOwnPtr val) OVERRIDE; int SetOwnPtrClient(CefOwnPtr val) OVERRIDE; CefOwnPtr SetOwnPtrClientAndReturn( @@ -112,13 +121,15 @@ class CefTranslatorTestCToCpp CefRawPtr val) OVERRIDE; bool SetRawPtrLibraryList( const std::vector>& val, - int val1, int val2) OVERRIDE; + int val1, + int val2) OVERRIDE; int SetRawPtrClient(CefRawPtr val) OVERRIDE; int SetChildRawPtrClient( CefRawPtr val) OVERRIDE; bool SetRawPtrClientList( const std::vector>& val, - int val1, int val2) OVERRIDE; + int val1, + int val2) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc index 9ab2284b9..30da2eea7 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a8637d9865fe06a6d46a5a8f7c7427e44c52c7a9$ +// #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestRefPtrClientChildCToCpp::GetOtherValue() { @@ -44,28 +45,32 @@ int CefTranslatorTestRefPtrClientChildCToCpp::GetValue() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrClientChildCToCpp::CefTranslatorTestRefPtrClientChildCToCpp( - ) { -} +CefTranslatorTestRefPtrClientChildCToCpp:: + CefTranslatorTestRefPtrClientChildCToCpp() {} -template<> cef_translator_test_ref_ptr_client_child_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefTranslatorTestRefPtrClientChild* c) { +template <> +cef_translator_test_ref_ptr_client_child_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTranslatorTestRefPtrClientChild* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted +base::AtomicRefCount CefCToCppRefCounted< + CefTranslatorTestRefPtrClientChildCToCpp, CefTranslatorTestRefPtrClientChild, cef_translator_test_ref_ptr_client_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted +CefWrapperType CefCToCppRefCounted< + CefTranslatorTestRefPtrClientChildCToCpp, CefTranslatorTestRefPtrClientChild, cef_translator_test_ref_ptr_client_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h index ed10750f9..6f07c23c5 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0d7d73d267052bd84e36b819040da0b40258f551$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestRefPtrClientChildCToCpp : public CefCToCppRefCounted { + CefTranslatorTestRefPtrClientChild, + cef_translator_test_ref_ptr_client_child_t> { public: CefTranslatorTestRefPtrClientChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc index 7b1cb40b7..3159c1a49 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=07881bece2c4f3ec1becec5d12d51d909a122d13$ +// -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" // VIRTUAL METHODS - Body may be edited by hand. @@ -30,32 +31,36 @@ int CefTranslatorTestRefPtrClientCToCpp::GetValue() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrClientCToCpp::CefTranslatorTestRefPtrClientCToCpp() { -} +CefTranslatorTestRefPtrClientCToCpp::CefTranslatorTestRefPtrClientCToCpp() {} -template<> cef_translator_test_ref_ptr_client_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefTranslatorTestRefPtrClient* c) { +template <> +cef_translator_test_ref_ptr_client_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTranslatorTestRefPtrClient* c) { if (type == WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD) { return reinterpret_cast( CefTranslatorTestRefPtrClientChildCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_TRANSLATOR_TEST_REF_PTR_CLIENT; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_TRANSLATOR_TEST_REF_PTR_CLIENT; diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h index 6222c5c3d..d2a543946 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d07dd78f742011d300473cb926b64a8e6661dbdb$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestRefPtrClientCToCpp : public CefCToCppRefCounted { + CefTranslatorTestRefPtrClient, + cef_translator_test_ref_ptr_client_t> { public: CefTranslatorTestRefPtrClientCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc index 4445e2faa..46d554583 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc @@ -9,28 +9,28 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a4407d8be20daf15d0f61b04a65d1f43d3de67a1$ +// #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefTranslatorTestRefPtrLibraryChildChild::Create( - int value, int other_value, int other_other_value) { +CefRefPtr +CefTranslatorTestRefPtrLibraryChildChild::Create(int value, + int other_value, + int other_other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_ref_ptr_library_child_child_t* _retval = - cef_translator_test_ref_ptr_library_child_child_create( - value, - other_value, - other_other_value); + cef_translator_test_ref_ptr_library_child_child_create(value, other_value, + other_other_value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryChildChildCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetOtherOtherValue() { @@ -56,14 +56,13 @@ void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetOtherOtherValue( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_other_value(_struct, - value); + _struct->set_other_other_value(_struct, value); } int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetOtherValue() { cef_translator_test_ref_ptr_library_child_t* _struct = - reinterpret_cast(GetStruct( - )); + reinterpret_cast( + GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_other_value)) return 0; @@ -78,16 +77,15 @@ int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetOtherValue() { void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetOtherValue(int value) { cef_translator_test_ref_ptr_library_child_t* _struct = - reinterpret_cast(GetStruct( - )); + reinterpret_cast( + GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_other_value)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_value(_struct, - value); + _struct->set_other_value(_struct, value); } int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetValue() { @@ -114,32 +112,36 @@ void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrLibraryChildChildCToCpp::CefTranslatorTestRefPtrLibraryChildChildCToCpp( - ) { -} +CefTranslatorTestRefPtrLibraryChildChildCToCpp:: + CefTranslatorTestRefPtrLibraryChildChildCToCpp() {} -template<> cef_translator_test_ref_ptr_library_child_child_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefTranslatorTestRefPtrLibraryChildChild* c) { +template <> +cef_translator_test_ref_ptr_library_child_child_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, + CefTranslatorTestRefPtrLibraryChildChild* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted +base::AtomicRefCount CefCToCppRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCToCpp, CefTranslatorTestRefPtrLibraryChildChild, cef_translator_test_ref_ptr_library_child_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted +CefWrapperType CefCToCppRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCToCpp, CefTranslatorTestRefPtrLibraryChildChild, cef_translator_test_ref_ptr_library_child_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h index affefbf2b..d67835caf 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a78c19f40ad8ff5fd10bdaeba1675753ca1389e7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_ @@ -18,16 +20,17 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestRefPtrLibraryChildChildCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted< + CefTranslatorTestRefPtrLibraryChildChildCToCpp, + CefTranslatorTestRefPtrLibraryChildChild, + cef_translator_test_ref_ptr_library_child_child_t> { public: CefTranslatorTestRefPtrLibraryChildChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc index 4917e0278..10f2bda19 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc @@ -9,28 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=42b33c187c2a011f627f10b314bf89363101aa4e$ +// -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefTranslatorTestRefPtrLibraryChild::Create( - int value, int other_value) { +CefRefPtr +CefTranslatorTestRefPtrLibraryChild::Create(int value, int other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_ref_ptr_library_child_t* _retval = - cef_translator_test_ref_ptr_library_child_create( - value, - other_value); + cef_translator_test_ref_ptr_library_child_create(value, other_value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryChildCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestRefPtrLibraryChildCToCpp::GetOtherValue() { @@ -55,8 +53,7 @@ void CefTranslatorTestRefPtrLibraryChildCToCpp::SetOtherValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_value(_struct, - value); + _struct->set_other_value(_struct, value); } int CefTranslatorTestRefPtrLibraryChildCToCpp::GetValue() { @@ -83,37 +80,40 @@ void CefTranslatorTestRefPtrLibraryChildCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrLibraryChildCToCpp::CefTranslatorTestRefPtrLibraryChildCToCpp( - ) { -} +CefTranslatorTestRefPtrLibraryChildCToCpp:: + CefTranslatorTestRefPtrLibraryChildCToCpp() {} -template<> cef_translator_test_ref_ptr_library_child_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefTranslatorTestRefPtrLibraryChild* c) { +template <> +cef_translator_test_ref_ptr_library_child_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTranslatorTestRefPtrLibraryChild* c) { if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestRefPtrLibraryChildChildCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted +base::AtomicRefCount CefCToCppRefCounted< + CefTranslatorTestRefPtrLibraryChildCToCpp, CefTranslatorTestRefPtrLibraryChild, cef_translator_test_ref_ptr_library_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted +CefWrapperType CefCToCppRefCounted< + CefTranslatorTestRefPtrLibraryChildCToCpp, CefTranslatorTestRefPtrLibraryChild, cef_translator_test_ref_ptr_library_child_t>::kWrapperType = WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h index f8149f837..d880671fc 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=4e4d079f92bba5864128b9310e2085f82e70bf4e$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestRefPtrLibraryChildCToCpp : public CefCToCppRefCounted { + CefTranslatorTestRefPtrLibraryChild, + cef_translator_test_ref_ptr_library_child_t> { public: CefTranslatorTestRefPtrLibraryChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc index f8887a2ce..eb5b66fc1 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc @@ -9,28 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8378563b430352b25a0ae9400c3c181798dec565$ +// -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefTranslatorTestRefPtrLibrary::Create( - int value) { +CefRefPtr +CefTranslatorTestRefPtrLibrary::Create(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_ref_ptr_library_t* _retval = - cef_translator_test_ref_ptr_library_create( - value); + cef_translator_test_ref_ptr_library_create(value); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestRefPtrLibraryCToCpp::GetValue() { @@ -55,41 +54,44 @@ void CefTranslatorTestRefPtrLibraryCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestRefPtrLibraryCToCpp::CefTranslatorTestRefPtrLibraryCToCpp() { -} +CefTranslatorTestRefPtrLibraryCToCpp::CefTranslatorTestRefPtrLibraryCToCpp() {} -template<> cef_translator_test_ref_ptr_library_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefTranslatorTestRefPtrLibrary* c) { +template <> +cef_translator_test_ref_ptr_library_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTranslatorTestRefPtrLibrary* c) { if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) { return reinterpret_cast( CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestRefPtrLibraryChildChildCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_TRANSLATOR_TEST_REF_PTR_LIBRARY; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_TRANSLATOR_TEST_REF_PTR_LIBRARY; diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h index b14544194..748e1fe96 100644 --- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0b3741e17039b85b3fda09f552304b911c5905b1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestRefPtrLibraryCToCpp : public CefCToCppRefCounted { + CefTranslatorTestRefPtrLibrary, + cef_translator_test_ref_ptr_library_t> { public: CefTranslatorTestRefPtrLibraryCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc index 21da945f6..866206472 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=039072ac0b2371a43277b274d6701b32143cfcf2$ +// #include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestScopedClientChildCToCpp::GetOtherValue() { @@ -44,36 +45,44 @@ int CefTranslatorTestScopedClientChildCToCpp::GetValue() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedClientChildCToCpp::CefTranslatorTestScopedClientChildCToCpp( - ) { -} +CefTranslatorTestScopedClientChildCToCpp:: + CefTranslatorTestScopedClientChildCToCpp() {} -template<> cef_translator_test_scoped_client_child_t* CefCToCppScoped::UnwrapDerivedOwn( - CefWrapperType type, CefOwnPtr c) { +template <> +cef_translator_test_scoped_client_child_t* +CefCToCppScoped:: + UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_translator_test_scoped_client_child_t* CefCToCppScoped::UnwrapDerivedRaw( - CefWrapperType type, CefRawPtr c) { +template <> +cef_translator_test_scoped_client_child_t* +CefCToCppScoped:: + UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD; +template <> +CefWrapperType + CefCToCppScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h index 59dc1bb5e..a7fd74911 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8d312aa7be71578d576d6a698ecc351382f5bdf2$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestScopedClientChildCToCpp : public CefCToCppScoped { + CefTranslatorTestScopedClientChild, + cef_translator_test_scoped_client_child_t> { public: CefTranslatorTestScopedClientChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc index 810c50ae8..1b4410ef8 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8695b6dab7c2fe666f99f1229549b89f50301301$ +// -#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" // VIRTUAL METHODS - Body may be edited by hand. @@ -30,48 +31,57 @@ int CefTranslatorTestScopedClientCToCpp::GetValue() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedClientCToCpp::CefTranslatorTestScopedClientCToCpp() { -} +CefTranslatorTestScopedClientCToCpp::CefTranslatorTestScopedClientCToCpp() {} -template<> cef_translator_test_scoped_client_t* CefCToCppScoped::UnwrapDerivedOwn(CefWrapperType type, - CefOwnPtr c) { +template <> +cef_translator_test_scoped_client_t* +CefCToCppScoped:: + UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) { return reinterpret_cast( CefTranslatorTestScopedClientChildCToCpp::UnwrapOwn( - CefOwnPtr( - reinterpret_cast(c.release())))); + CefOwnPtr( + reinterpret_cast( + c.release())))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_translator_test_scoped_client_t* CefCToCppScoped::UnwrapDerivedRaw(CefWrapperType type, - CefRawPtr c) { +template <> +cef_translator_test_scoped_client_t* +CefCToCppScoped:: + UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) { return reinterpret_cast( CefTranslatorTestScopedClientChildCToCpp::UnwrapRaw( - CefRawPtr( - reinterpret_cast(CEF_RAW_PTR_GET( - c))))); + CefRawPtr( + reinterpret_cast( + CEF_RAW_PTR_GET(c))))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_CLIENT; +template <> +CefWrapperType + CefCToCppScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_CLIENT; diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h index a77accd17..845045f07 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d4c5506ce6facfc859087098e8ec17694a5cfa52$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTranslatorTestScopedClientCToCpp : public CefCToCppScoped { + CefTranslatorTestScopedClient, + cef_translator_test_scoped_client_t> { public: CefTranslatorTestScopedClientCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc index 8401e202f..207d792b1 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc @@ -9,28 +9,28 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=65f1a184cabfaeb24fe9ef8ae1ca0581eddab410$ +// #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. -CefOwnPtr CefTranslatorTestScopedLibraryChildChild::Create( - int value, int other_value, int other_other_value) { +CefOwnPtr +CefTranslatorTestScopedLibraryChildChild::Create(int value, + int other_value, + int other_other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_scoped_library_child_child_t* _retval = - cef_translator_test_scoped_library_child_child_create( - value, - other_value, - other_other_value); + cef_translator_test_scoped_library_child_child_create(value, other_value, + other_other_value); // Return type: ownptr_same return CefTranslatorTestScopedLibraryChildChildCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestScopedLibraryChildChildCToCpp::GetOtherOtherValue() { @@ -56,14 +56,13 @@ void CefTranslatorTestScopedLibraryChildChildCToCpp::SetOtherOtherValue( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_other_value(_struct, - value); + _struct->set_other_other_value(_struct, value); } int CefTranslatorTestScopedLibraryChildChildCToCpp::GetOtherValue() { cef_translator_test_scoped_library_child_t* _struct = - reinterpret_cast(GetStruct( - )); + reinterpret_cast( + GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_other_value)) return 0; @@ -78,16 +77,15 @@ int CefTranslatorTestScopedLibraryChildChildCToCpp::GetOtherValue() { void CefTranslatorTestScopedLibraryChildChildCToCpp::SetOtherValue(int value) { cef_translator_test_scoped_library_child_t* _struct = - reinterpret_cast(GetStruct( - )); + reinterpret_cast( + GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_other_value)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_value(_struct, - value); + _struct->set_other_value(_struct, value); } int CefTranslatorTestScopedLibraryChildChildCToCpp::GetValue() { @@ -114,42 +112,47 @@ void CefTranslatorTestScopedLibraryChildChildCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedLibraryChildChildCToCpp::CefTranslatorTestScopedLibraryChildChildCToCpp( - ) { -} +CefTranslatorTestScopedLibraryChildChildCToCpp:: + CefTranslatorTestScopedLibraryChildChildCToCpp() {} -template<> cef_translator_test_scoped_library_child_child_t* CefCToCppScoped::UnwrapDerivedOwn( - CefWrapperType type, - CefOwnPtr c) { +template <> +cef_translator_test_scoped_library_child_child_t* +CefCToCppScoped:: + UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_translator_test_scoped_library_child_child_t* CefCToCppScoped::UnwrapDerivedRaw( - CefWrapperType type, - CefRawPtr c) { +template <> +cef_translator_test_scoped_library_child_child_t* +CefCToCppScoped:: + UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped +base::AtomicRefCount CefCToCppScoped< + CefTranslatorTestScopedLibraryChildChildCToCpp, CefTranslatorTestScopedLibraryChildChild, cef_translator_test_scoped_library_child_child_t>::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped +CefWrapperType CefCToCppScoped< + CefTranslatorTestScopedLibraryChildChildCToCpp, CefTranslatorTestScopedLibraryChildChild, cef_translator_test_scoped_library_child_child_t>::kWrapperType = WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h index e0988b19f..f95b555ec 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ede7264f245eb85561218f7c397b376cfcd6c881$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestScopedLibraryChildChildCToCpp : public CefCToCppScoped { + CefTranslatorTestScopedLibraryChildChild, + cef_translator_test_scoped_library_child_child_t> { public: CefTranslatorTestScopedLibraryChildChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc index b437f92fc..8a15e6b48 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc @@ -9,28 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5af91636e08968269d7630c7af4a4c43510cffac$ +// -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" // STATIC METHODS - Body may be edited by hand. -CefOwnPtr CefTranslatorTestScopedLibraryChild::Create( - int value, int other_value) { +CefOwnPtr +CefTranslatorTestScopedLibraryChild::Create(int value, int other_value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_scoped_library_child_t* _retval = - cef_translator_test_scoped_library_child_create( - value, - other_value); + cef_translator_test_scoped_library_child_create(value, other_value); // Return type: ownptr_same return CefTranslatorTestScopedLibraryChildCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestScopedLibraryChildCToCpp::GetOtherValue() { @@ -55,8 +53,7 @@ void CefTranslatorTestScopedLibraryChildCToCpp::SetOtherValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_other_value(_struct, - value); + _struct->set_other_value(_struct, value); } int CefTranslatorTestScopedLibraryChildCToCpp::GetValue() { @@ -83,54 +80,61 @@ void CefTranslatorTestScopedLibraryChildCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedLibraryChildCToCpp::CefTranslatorTestScopedLibraryChildCToCpp( - ) { -} +CefTranslatorTestScopedLibraryChildCToCpp:: + CefTranslatorTestScopedLibraryChildCToCpp() {} -template<> cef_translator_test_scoped_library_child_t* CefCToCppScoped::UnwrapDerivedOwn( - CefWrapperType type, CefOwnPtr c) { +template <> +cef_translator_test_scoped_library_child_t* +CefCToCppScoped:: + UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapOwn( - CefOwnPtr( - reinterpret_cast(c.release( - ))))); + CefOwnPtr( + reinterpret_cast( + c.release())))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_translator_test_scoped_library_child_t* CefCToCppScoped::UnwrapDerivedRaw( - CefWrapperType type, CefRawPtr c) { +template <> +cef_translator_test_scoped_library_child_t* +CefCToCppScoped:: + UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw( - CefRawPtr( - reinterpret_cast( - CEF_RAW_PTR_GET(c))))); + CefRawPtr( + reinterpret_cast( + CEF_RAW_PTR_GET(c))))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD; +template <> +CefWrapperType + CefCToCppScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h index 39beaa77a..ec8eacffa 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d07cb0e1a08569a519ef42eafe1b2c8446b2d840$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestScopedLibraryChildCToCpp : public CefCToCppScoped { + CefTranslatorTestScopedLibraryChild, + cef_translator_test_scoped_library_child_t> { public: CefTranslatorTestScopedLibraryChildCToCpp(); diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc index 1a7db5f24..eef46dddc 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc @@ -9,28 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d4d0574d3ca8e5226b711d9b5e5e3c58b26680e0$ +// -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h" - +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" // STATIC METHODS - Body may be edited by hand. -CefOwnPtr CefTranslatorTestScopedLibrary::Create( - int value) { +CefOwnPtr +CefTranslatorTestScopedLibrary::Create(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_scoped_library_t* _retval = - cef_translator_test_scoped_library_create( - value); + cef_translator_test_scoped_library_create(value); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. int CefTranslatorTestScopedLibraryCToCpp::GetValue() { @@ -55,66 +54,74 @@ void CefTranslatorTestScopedLibraryCToCpp::SetValue(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_value(_struct, - value); + _struct->set_value(_struct, value); } - // CONSTRUCTOR - Do not edit by hand. -CefTranslatorTestScopedLibraryCToCpp::CefTranslatorTestScopedLibraryCToCpp() { -} +CefTranslatorTestScopedLibraryCToCpp::CefTranslatorTestScopedLibraryCToCpp() {} -template<> cef_translator_test_scoped_library_t* CefCToCppScoped::UnwrapDerivedOwn( - CefWrapperType type, CefOwnPtr c) { +template <> +cef_translator_test_scoped_library_t* +CefCToCppScoped:: + UnwrapDerivedOwn(CefWrapperType type, + CefOwnPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn( - CefOwnPtr( - reinterpret_cast(c.release())))); + CefOwnPtr( + reinterpret_cast( + c.release())))); } if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapOwn( - CefOwnPtr( - reinterpret_cast(c.release( - ))))); + CefOwnPtr( + reinterpret_cast( + c.release())))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } -template<> cef_translator_test_scoped_library_t* CefCToCppScoped::UnwrapDerivedRaw( - CefWrapperType type, CefRawPtr c) { +template <> +cef_translator_test_scoped_library_t* +CefCToCppScoped:: + UnwrapDerivedRaw(CefWrapperType type, + CefRawPtr c) { if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw( - CefRawPtr( - reinterpret_cast(CEF_RAW_PTR_GET( - c))))); + CefRawPtr( + reinterpret_cast( + CEF_RAW_PTR_GET(c))))); } if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) { return reinterpret_cast( CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw( - CefRawPtr( - reinterpret_cast( - CEF_RAW_PTR_GET(c))))); + CefRawPtr( + reinterpret_cast( + CEF_RAW_PTR_GET(c))))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppScoped::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppScoped::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppScoped::kWrapperType = - WT_TRANSLATOR_TEST_SCOPED_LIBRARY; +template <> +CefWrapperType + CefCToCppScoped::kWrapperType = + WT_TRANSLATOR_TEST_SCOPED_LIBRARY; diff --git a/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h index 978316de5..009aae06c 100644 --- a/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h +++ b/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7615ff956f45991a56cad535593fc68da2a73aa4$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/test/cef_translator_test.h" #include "include/capi/test/cef_translator_test_capi.h" +#include "include/test/cef_translator_test.h" #include "libcef_dll/ctocpp/ctocpp_scoped.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefTranslatorTestScopedLibraryCToCpp : public CefCToCppScoped { + CefTranslatorTestScopedLibrary, + cef_translator_test_scoped_library_t> { public: CefTranslatorTestScopedLibraryCToCpp(); diff --git a/libcef_dll/ctocpp/thread_ctocpp.cc b/libcef_dll/ctocpp/thread_ctocpp.cc index b657003bc..b477102bb 100644 --- a/libcef_dll/ctocpp/thread_ctocpp.cc +++ b/libcef_dll/ctocpp/thread_ctocpp.cc @@ -9,33 +9,33 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ac4acfafda72e57c9bd261be73e8d47fd30ebc0e$ +// #include "libcef_dll/ctocpp/task_runner_ctocpp.h" #include "libcef_dll/ctocpp/thread_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefThread::CreateThread(const CefString& display_name, - cef_thread_priority_t priority, cef_message_loop_type_t message_loop_type, - bool stoppable, cef_com_init_mode_t com_init_mode) { +CefRefPtr CefThread::CreateThread( + const CefString& display_name, + cef_thread_priority_t priority, + cef_message_loop_type_t message_loop_type, + bool stoppable, + cef_com_init_mode_t com_init_mode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: display_name // Execute - cef_thread_t* _retval = cef_thread_create( - display_name.GetStruct(), - priority, - message_loop_type, - stoppable, - com_init_mode); + cef_thread_t* _retval = + cef_thread_create(display_name.GetStruct(), priority, message_loop_type, + stoppable, com_init_mode); // Return type: refptr_same return CefThreadCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefThreadCToCpp::GetTaskRunner() { @@ -88,25 +88,29 @@ bool CefThreadCToCpp::IsRunning() { int _retval = _struct->is_running(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefThreadCToCpp::CefThreadCToCpp() { -} +CefThreadCToCpp::CefThreadCToCpp() {} -template<> cef_thread_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefThread* c) { +template <> +cef_thread_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefThread* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_THREAD; +template <> +CefWrapperType CefCToCppRefCounted:: + kWrapperType = WT_THREAD; diff --git a/libcef_dll/ctocpp/thread_ctocpp.h b/libcef_dll/ctocpp/thread_ctocpp.h index 8bfbdb4ea..8dc5c6fdc 100644 --- a/libcef_dll/ctocpp/thread_ctocpp.h +++ b/libcef_dll/ctocpp/thread_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0f4a81621659efd51fcc1f985fe11a47edc66920$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_THREAD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_THREAD_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_thread.h" #include "include/capi/cef_thread_capi.h" +#include "include/cef_thread.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc index 29bf425b2..d7f5afc6f 100644 --- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc +++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9388706ef42ddd5675e32501ee217f31ec8a5917$ +// #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" #include "libcef_dll/cpptoc/urlrequest_cpptoc.h" #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefURLRequestClientCToCpp::OnRequestComplete( @@ -31,12 +32,13 @@ void CefURLRequestClientCToCpp::OnRequestComplete( return; // Execute - _struct->on_request_complete(_struct, - CefURLRequestCppToC::Wrap(request)); + _struct->on_request_complete(_struct, CefURLRequestCppToC::Wrap(request)); } void CefURLRequestClientCToCpp::OnUploadProgress( - CefRefPtr request, int64 current, int64 total) { + CefRefPtr request, + int64 current, + int64 total) { cef_urlrequest_client_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_upload_progress)) return; @@ -49,14 +51,14 @@ void CefURLRequestClientCToCpp::OnUploadProgress( return; // Execute - _struct->on_upload_progress(_struct, - CefURLRequestCppToC::Wrap(request), - current, - total); + _struct->on_upload_progress(_struct, CefURLRequestCppToC::Wrap(request), + current, total); } void CefURLRequestClientCToCpp::OnDownloadProgress( - CefRefPtr request, int64 current, int64 total) { + CefRefPtr request, + int64 current, + int64 total) { cef_urlrequest_client_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_download_progress)) return; @@ -69,14 +71,13 @@ void CefURLRequestClientCToCpp::OnDownloadProgress( return; // Execute - _struct->on_download_progress(_struct, - CefURLRequestCppToC::Wrap(request), - current, - total); + _struct->on_download_progress(_struct, CefURLRequestCppToC::Wrap(request), + current, total); } void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr request, - const void* data, size_t data_length) { + const void* data, + size_t data_length) { cef_urlrequest_client_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_download_data)) return; @@ -93,15 +94,17 @@ void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr request, return; // Execute - _struct->on_download_data(_struct, - CefURLRequestCppToC::Wrap(request), - data, - data_length); + _struct->on_download_data(_struct, CefURLRequestCppToC::Wrap(request), data, + data_length); } -bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy, - const CefString& host, int port, const CefString& realm, - const CefString& scheme, CefRefPtr callback) { +bool CefURLRequestClientCToCpp::GetAuthCredentials( + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) { cef_urlrequest_client_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_auth_credentials)) return false; @@ -123,36 +126,38 @@ bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy, // Unverified params: realm // Execute - int _retval = _struct->get_auth_credentials(_struct, - isProxy, - host.GetStruct(), - port, - realm.GetStruct(), - scheme.GetStruct(), - CefAuthCallbackCppToC::Wrap(callback)); + int _retval = _struct->get_auth_credentials( + _struct, isProxy, host.GetStruct(), port, realm.GetStruct(), + scheme.GetStruct(), CefAuthCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefURLRequestClientCToCpp::CefURLRequestClientCToCpp() { -} +CefURLRequestClientCToCpp::CefURLRequestClientCToCpp() {} -template<> cef_urlrequest_client_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefURLRequestClient* c) { +template <> +cef_urlrequest_client_t* CefCToCppRefCounted< + CefURLRequestClientCToCpp, + CefURLRequestClient, + cef_urlrequest_client_t>::UnwrapDerived(CefWrapperType type, + CefURLRequestClient* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_URLREQUEST_CLIENT; diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h index c8f5452e7..b2bb91282 100644 --- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h +++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2b6e104252b8713c7c700e819e997f045f4afec9$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_ @@ -18,29 +20,36 @@ #error This file can be included DLL-side only #endif -#include "include/cef_urlrequest.h" #include "include/capi/cef_urlrequest_capi.h" +#include "include/cef_urlrequest.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefURLRequestClientCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefURLRequestClientCToCpp(); // CefURLRequestClient methods. void OnRequestComplete(CefRefPtr request) override; - void OnUploadProgress(CefRefPtr request, int64 current, - int64 total) override; - void OnDownloadProgress(CefRefPtr request, int64 current, - int64 total) override; - void OnDownloadData(CefRefPtr request, const void* data, - size_t data_length) override; - bool GetAuthCredentials(bool isProxy, const CefString& host, int port, - const CefString& realm, const CefString& scheme, - CefRefPtr callback) override; + void OnUploadProgress(CefRefPtr request, + int64 current, + int64 total) override; + void OnDownloadProgress(CefRefPtr request, + int64 current, + int64 total) override; + void OnDownloadData(CefRefPtr request, + const void* data, + size_t data_length) override; + bool GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_ctocpp.cc index a32e56476..b3517d4ea 100644 --- a/libcef_dll/ctocpp/urlrequest_ctocpp.cc +++ b/libcef_dll/ctocpp/urlrequest_ctocpp.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5997d1eb9b92020d5261d7110f5c590ee85b1878$ +// #include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" -#include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/request_context_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" #include "libcef_dll/ctocpp/response_ctocpp.h" #include "libcef_dll/ctocpp/urlrequest_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefURLRequest::Create(CefRefPtr request, +CefRefPtr CefURLRequest::Create( + CefRefPtr request, CefRefPtr client, CefRefPtr request_context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -35,16 +37,15 @@ CefRefPtr CefURLRequest::Create(CefRefPtr request, // Unverified params: request_context // Execute - cef_urlrequest_t* _retval = cef_urlrequest_create( - CefRequestCToCpp::Unwrap(request), - CefURLRequestClientCppToC::Wrap(client), - CefRequestContextCToCpp::Unwrap(request_context)); + cef_urlrequest_t* _retval = + cef_urlrequest_create(CefRequestCToCpp::Unwrap(request), + CefURLRequestClientCppToC::Wrap(client), + CefRequestContextCToCpp::Unwrap(request_context)); // Return type: refptr_same return CefURLRequestCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefURLRequestCToCpp::GetRequest() { @@ -128,23 +129,27 @@ void CefURLRequestCToCpp::Cancel() { _struct->cancel(_struct); } - // CONSTRUCTOR - Do not edit by hand. -CefURLRequestCToCpp::CefURLRequestCToCpp() { -} +CefURLRequestCToCpp::CefURLRequestCToCpp() {} -template<> cef_urlrequest_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefURLRequest* c) { +template <> +cef_urlrequest_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefURLRequest* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_URLREQUEST; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_URLREQUEST; diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.h b/libcef_dll/ctocpp/urlrequest_ctocpp.h index 88df2438a..b2de44182 100644 --- a/libcef_dll/ctocpp/urlrequest_ctocpp.h +++ b/libcef_dll/ctocpp/urlrequest_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0a4434a7eb2de42fb593870977e176948361c63f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_urlrequest.h" #include "include/capi/cef_urlrequest_capi.h" +#include "include/cef_urlrequest.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefURLRequestCToCpp - : public CefCToCppRefCounted { +class CefURLRequestCToCpp : public CefCToCppRefCounted { public: CefURLRequestCToCpp(); diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc index d38867432..4da3b983f 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8d2618628f2907d261fe020c7e5d60dd5f45f14b$ +// #include "libcef_dll/cpptoc/v8value_cpptoc.h" #include "libcef_dll/ctocpp/v8accessor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8AccessorCToCpp::Get(const CefString& name, - const CefRefPtr object, CefRefPtr& retval, - CefString& exception) { + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) { cef_v8accessor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get)) return false; @@ -41,11 +43,9 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = _struct->get(_struct, - name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - &retvalStruct, - exception.GetWritableStruct()); + int _retval = + _struct->get(_struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), + &retvalStruct, exception.GetWritableStruct()); // Restore param:retval; type: refptr_diff_byref if (retvalStruct) { @@ -57,12 +57,13 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8AccessorCToCpp::Set(const CefString& name, - const CefRefPtr object, const CefRefPtr value, - CefString& exception) { + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) { cef_v8accessor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set)) return false; @@ -83,33 +84,35 @@ bool CefV8AccessorCToCpp::Set(const CefString& name, return false; // Execute - int _retval = _struct->set(_struct, - name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - CefV8ValueCppToC::Wrap(value), - exception.GetWritableStruct()); + int _retval = _struct->set( + _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), + CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefV8AccessorCToCpp::CefV8AccessorCToCpp() { -} +CefV8AccessorCToCpp::CefV8AccessorCToCpp() {} -template<> cef_v8accessor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8Accessor* c) { +template <> +cef_v8accessor_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefV8Accessor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8ACCESSOR; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8ACCESSOR; diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h index 63e70ca5b..824350092 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.h +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=929b592d0ac552c950f81c540baa049b5cee74f1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ @@ -18,23 +20,27 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefV8AccessorCToCpp - : public CefCToCppRefCounted { +class CefV8AccessorCToCpp : public CefCToCppRefCounted { public: CefV8AccessorCToCpp(); // CefV8Accessor methods. - bool Get(const CefString& name, const CefRefPtr object, - CefRefPtr& retval, CefString& exception) override; - bool Set(const CefString& name, const CefRefPtr object, - const CefRefPtr value, CefString& exception) override; + bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) override; + bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc index fa2f463d6..6af7801a9 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d520e6de025a46b26dadb74dbb55aefb956ebbcc$ +// #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" @@ -17,7 +19,6 @@ #include "libcef_dll/ctocpp/v8exception_ctocpp.h" #include "libcef_dll/ctocpp/v8value_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefV8Context::GetCurrentContext() { @@ -47,10 +48,9 @@ bool CefV8Context::InContext() { int _retval = cef_v8context_in_context(); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefV8ContextCToCpp::GetTaskRunner() { @@ -78,7 +78,7 @@ bool CefV8ContextCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefV8ContextCToCpp::GetBrowser() { @@ -134,7 +134,7 @@ bool CefV8ContextCToCpp::Enter() { int _retval = _struct->enter(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ContextCToCpp::Exit() { @@ -148,7 +148,7 @@ bool CefV8ContextCToCpp::Exit() { int _retval = _struct->exit(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { @@ -164,16 +164,17 @@ bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefV8ContextCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefV8ContextCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ContextCToCpp::Eval(const CefString& code, - const CefString& script_url, int start_line, CefRefPtr& retval, - CefRefPtr& exception) { + const CefString& script_url, + int start_line, + CefRefPtr& retval, + CefRefPtr& exception) { cef_v8context_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, eval)) return false; @@ -198,12 +199,8 @@ bool CefV8ContextCToCpp::Eval(const CefString& code, cef_v8exception_t* exceptionOrig = exceptionStruct; // Execute - int _retval = _struct->eval(_struct, - code.GetStruct(), - script_url.GetStruct(), - start_line, - &retvalStruct, - &exceptionStruct); + int _retval = _struct->eval(_struct, code.GetStruct(), script_url.GetStruct(), + start_line, &retvalStruct, &exceptionStruct); // Restore param:retval; type: refptr_same_byref if (retvalStruct) { @@ -223,26 +220,30 @@ bool CefV8ContextCToCpp::Eval(const CefString& code, } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefV8ContextCToCpp::CefV8ContextCToCpp() { -} +CefV8ContextCToCpp::CefV8ContextCToCpp() {} -template<> cef_v8context_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8Context* c) { +template <> +cef_v8context_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefV8Context* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8CONTEXT; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8CONTEXT; diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h index 9bd218f6a..ada6fe565 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=aa93485d557e0532ef47252661885fc1e7945789$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefV8ContextCToCpp - : public CefCToCppRefCounted { +class CefV8ContextCToCpp : public CefCToCppRefCounted { public: CefV8ContextCToCpp(); @@ -39,9 +41,11 @@ class CefV8ContextCToCpp bool Enter() OVERRIDE; bool Exit() OVERRIDE; bool IsSame(CefRefPtr that) OVERRIDE; - bool Eval(const CefString& code, const CefString& script_url, int start_line, - CefRefPtr& retval, - CefRefPtr& exception) OVERRIDE; + bool Eval(const CefString& code, + const CefString& script_url, + int start_line, + CefRefPtr& retval, + CefRefPtr& exception) OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc index 3c4dee1ec..78fe802f8 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.cc +++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e9044628b089a7405c28d4c6c91665ca11534519$ +// #include "libcef_dll/ctocpp/v8exception_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefString CefV8ExceptionCToCpp::GetMessage() { @@ -133,23 +134,27 @@ int CefV8ExceptionCToCpp::GetEndColumn() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefV8ExceptionCToCpp::CefV8ExceptionCToCpp() { -} +CefV8ExceptionCToCpp::CefV8ExceptionCToCpp() {} -template<> cef_v8exception_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8Exception* c) { +template <> +cef_v8exception_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefV8Exception* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8EXCEPTION; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8EXCEPTION; diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h index ed2cbec2f..152017396 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.h +++ b/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=454802fd5ee72ffafd720eab24f754c58a2ff4a8$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefV8ExceptionCToCpp - : public CefCToCppRefCounted { +class CefV8ExceptionCToCpp : public CefCToCppRefCounted { public: CefV8ExceptionCToCpp(); diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc index 1d14e730f..56db5dff2 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc @@ -9,16 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=581f5db624374bcc4f0bec130cf3f93b5705590b$ +// #include "libcef_dll/cpptoc/v8value_cpptoc.h" #include "libcef_dll/ctocpp/v8handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8HandlerCToCpp::Execute(const CefString& name, - CefRefPtr object, const CefV8ValueList& arguments, - CefRefPtr& retval, CefString& exception) { + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) { cef_v8handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, execute)) return false; @@ -53,17 +56,13 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = _struct->execute(_struct, - name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - argumentsCount, - argumentsList, - &retvalStruct, - exception.GetWritableStruct()); + int _retval = _struct->execute( + _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), argumentsCount, + argumentsList, &retvalStruct, exception.GetWritableStruct()); // Restore param:arguments; type: refptr_vec_diff_byref_const if (argumentsList) - delete [] argumentsList; + delete[] argumentsList; // Restore param:retval; type: refptr_diff_byref if (retvalStruct) { if (retvalStruct != retvalOrig) { @@ -74,26 +73,30 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefV8HandlerCToCpp::CefV8HandlerCToCpp() { -} +CefV8HandlerCToCpp::CefV8HandlerCToCpp() {} -template<> cef_v8handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8Handler* c) { +template <> +cef_v8handler_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefV8Handler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8HANDLER; diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h index 2d320ef5b..cae47e24a 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=11ba7f2c44ac267c732baf2518203538641bd805$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ @@ -18,22 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefV8HandlerCToCpp - : public CefCToCppRefCounted { +class CefV8HandlerCToCpp : public CefCToCppRefCounted { public: CefV8HandlerCToCpp(); // CefV8Handler methods. - bool Execute(const CefString& name, CefRefPtr object, - const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) override; + bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8interceptor_ctocpp.cc b/libcef_dll/ctocpp/v8interceptor_ctocpp.cc index 49216779a..a6d646cd0 100644 --- a/libcef_dll/ctocpp/v8interceptor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8interceptor_ctocpp.cc @@ -9,16 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5296e3d09e1c1773e2fc0234e2cb51e5438c7381$ +// #include "libcef_dll/cpptoc/v8value_cpptoc.h" #include "libcef_dll/ctocpp/v8interceptor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8InterceptorCToCpp::Get(const CefString& name, - const CefRefPtr object, CefRefPtr& retval, - CefString& exception) { + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) { cef_v8interceptor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_byname)) return false; @@ -41,10 +43,8 @@ bool CefV8InterceptorCToCpp::Get(const CefString& name, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = _struct->get_byname(_struct, - name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - &retvalStruct, + int _retval = _struct->get_byname( + _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), &retvalStruct, exception.GetWritableStruct()); // Restore param:retval; type: refptr_diff_byref @@ -57,11 +57,13 @@ bool CefV8InterceptorCToCpp::Get(const CefString& name, } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefV8InterceptorCToCpp::Get(int index, const CefRefPtr object, - CefRefPtr& retval, CefString& exception) { +bool CefV8InterceptorCToCpp::Get(int index, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) { cef_v8interceptor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_byindex)) return false; @@ -84,11 +86,9 @@ bool CefV8InterceptorCToCpp::Get(int index, const CefRefPtr object, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = _struct->get_byindex(_struct, - index, - CefV8ValueCppToC::Wrap(object), - &retvalStruct, - exception.GetWritableStruct()); + int _retval = + _struct->get_byindex(_struct, index, CefV8ValueCppToC::Wrap(object), + &retvalStruct, exception.GetWritableStruct()); // Restore param:retval; type: refptr_diff_byref if (retvalStruct) { @@ -100,12 +100,13 @@ bool CefV8InterceptorCToCpp::Get(int index, const CefRefPtr object, } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8InterceptorCToCpp::Set(const CefString& name, - const CefRefPtr object, const CefRefPtr value, - CefString& exception) { + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) { cef_v8interceptor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_byname)) return false; @@ -126,18 +127,18 @@ bool CefV8InterceptorCToCpp::Set(const CefString& name, return false; // Execute - int _retval = _struct->set_byname(_struct, - name.GetStruct(), - CefV8ValueCppToC::Wrap(object), - CefV8ValueCppToC::Wrap(value), - exception.GetWritableStruct()); + int _retval = _struct->set_byname( + _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), + CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefV8InterceptorCToCpp::Set(int index, const CefRefPtr object, - const CefRefPtr value, CefString& exception) { +bool CefV8InterceptorCToCpp::Set(int index, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) { cef_v8interceptor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_byindex)) return false; @@ -158,33 +159,37 @@ bool CefV8InterceptorCToCpp::Set(int index, const CefRefPtr object, return false; // Execute - int _retval = _struct->set_byindex(_struct, - index, - CefV8ValueCppToC::Wrap(object), - CefV8ValueCppToC::Wrap(value), - exception.GetWritableStruct()); + int _retval = _struct->set_byindex( + _struct, index, CefV8ValueCppToC::Wrap(object), + CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefV8InterceptorCToCpp::CefV8InterceptorCToCpp() { -} +CefV8InterceptorCToCpp::CefV8InterceptorCToCpp() {} -template<> cef_v8interceptor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8Interceptor* c) { +template <> +cef_v8interceptor_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefV8Interceptor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8INTERCEPTOR; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8INTERCEPTOR; diff --git a/libcef_dll/ctocpp/v8interceptor_ctocpp.h b/libcef_dll/ctocpp/v8interceptor_ctocpp.h index 7e5dbfc1f..701bd80a8 100644 --- a/libcef_dll/ctocpp/v8interceptor_ctocpp.h +++ b/libcef_dll/ctocpp/v8interceptor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=864b1b13843f4e36dfd48bd6a724266080324899$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8INTERCEPTOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8INTERCEPTOR_CTOCPP_H_ @@ -18,27 +20,36 @@ #error This file can be included DLL-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefV8InterceptorCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefV8InterceptorCToCpp(); // CefV8Interceptor methods. - bool Get(const CefString& name, const CefRefPtr object, - CefRefPtr& retval, CefString& exception) override; - bool Get(int index, const CefRefPtr object, - CefRefPtr& retval, CefString& exception) override; - bool Set(const CefString& name, const CefRefPtr object, - const CefRefPtr value, CefString& exception) override; - bool Set(int index, const CefRefPtr object, - const CefRefPtr value, CefString& exception) override; + bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) override; + bool Get(int index, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) override; + bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) override; + bool Set(int index, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) override; }; #endif // CEF_LIBCEF_DLL_CTOCPP_V8INTERCEPTOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc index 0ec6232e2..10cac4b44 100644 --- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc +++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=190878db3c35559a52669c437c3e4392fddfd07f$ +// #include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8StackFrameCToCpp::IsValid() { @@ -26,7 +27,7 @@ bool CefV8StackFrameCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefV8StackFrameCToCpp::GetScriptName() { @@ -53,8 +54,8 @@ CefString CefV8StackFrameCToCpp::GetScriptNameOrSourceURL() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_script_name_or_source_url( - _struct); + cef_string_userfree_t _retval = + _struct->get_script_name_or_source_url(_struct); // Return type: string CefString _retvalStr; @@ -117,7 +118,7 @@ bool CefV8StackFrameCToCpp::IsEval() { int _retval = _struct->is_eval(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8StackFrameCToCpp::IsConstructor() { @@ -131,26 +132,32 @@ bool CefV8StackFrameCToCpp::IsConstructor() { int _retval = _struct->is_constructor(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefV8StackFrameCToCpp::CefV8StackFrameCToCpp() { -} +CefV8StackFrameCToCpp::CefV8StackFrameCToCpp() {} -template<> cef_v8stack_frame_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8StackFrame* c) { +template <> +cef_v8stack_frame_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefV8StackFrame* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8STACK_FRAME; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8STACK_FRAME; diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h index 2cfad29e7..99c7839c7 100644 --- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h +++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=19b69ac6bbdafeea89591fce2acd1f0402db53b1$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefV8StackFrameCToCpp - : public CefCToCppRefCounted { +class CefV8StackFrameCToCpp : public CefCToCppRefCounted { public: CefV8StackFrameCToCpp(); diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc index 251cbdc82..1a2dfe90e 100644 --- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc +++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc @@ -9,25 +9,24 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0d5501d1df13b04f9f52443df3f76a9d3de5b8b8$ +// #include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefV8StackTrace::GetCurrent(int frame_limit) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8stack_trace_t* _retval = cef_v8stack_trace_get_current( - frame_limit); + cef_v8stack_trace_t* _retval = cef_v8stack_trace_get_current(frame_limit); // Return type: refptr_same return CefV8StackTraceCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8StackTraceCToCpp::IsValid() { @@ -41,7 +40,7 @@ bool CefV8StackTraceCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefV8StackTraceCToCpp::GetFrameCount() { @@ -66,30 +65,35 @@ CefRefPtr CefV8StackTraceCToCpp::GetFrame(int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8stack_frame_t* _retval = _struct->get_frame(_struct, - index); + cef_v8stack_frame_t* _retval = _struct->get_frame(_struct, index); // Return type: refptr_same return CefV8StackFrameCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefV8StackTraceCToCpp::CefV8StackTraceCToCpp() { -} +CefV8StackTraceCToCpp::CefV8StackTraceCToCpp() {} -template<> cef_v8stack_trace_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefV8StackTrace* c) { +template <> +cef_v8stack_trace_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefV8StackTrace* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8STACK_TRACE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_V8STACK_TRACE; diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h index ee1e5c326..afe821cfa 100644 --- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h +++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c12938d604ca62b718634597e1a9322652d7e9db$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefV8StackTraceCToCpp - : public CefCToCppRefCounted { +class CefV8StackTraceCToCpp : public CefCToCppRefCounted { public: CefV8StackTraceCToCpp(); diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc index 019bc151b..0901d527b 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.cc +++ b/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=99e81b5d76118790646d2343910363948570fb77$ +// #include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h" #include "libcef_dll/cpptoc/v8accessor_cpptoc.h" @@ -19,7 +21,6 @@ #include "libcef_dll/ctocpp/v8value_ctocpp.h" #include "libcef_dll/transfer_util.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefV8Value::CreateUndefined() { @@ -46,8 +47,7 @@ CefRefPtr CefV8Value::CreateBool(bool value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_bool( - value); + cef_v8value_t* _retval = cef_v8value_create_bool(value); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -57,8 +57,7 @@ CefRefPtr CefV8Value::CreateInt(int32 value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_int( - value); + cef_v8value_t* _retval = cef_v8value_create_int(value); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -68,8 +67,7 @@ CefRefPtr CefV8Value::CreateUInt(uint32 value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_uint( - value); + cef_v8value_t* _retval = cef_v8value_create_uint(value); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -79,8 +77,7 @@ CefRefPtr CefV8Value::CreateDouble(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_double( - value); + cef_v8value_t* _retval = cef_v8value_create_double(value); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -90,8 +87,7 @@ CefRefPtr CefV8Value::CreateDate(const CefTime& date) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_date( - &date); + cef_v8value_t* _retval = cef_v8value_create_date(&date); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -103,8 +99,7 @@ CefRefPtr CefV8Value::CreateString(const CefString& value) { // Unverified params: value // Execute - cef_v8value_t* _retval = cef_v8value_create_string( - value.GetStruct()); + cef_v8value_t* _retval = cef_v8value_create_string(value.GetStruct()); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -118,9 +113,9 @@ CefRefPtr CefV8Value::CreateObject( // Unverified params: accessor, interceptor // Execute - cef_v8value_t* _retval = cef_v8value_create_object( - CefV8AccessorCppToC::Wrap(accessor), - CefV8InterceptorCppToC::Wrap(interceptor)); + cef_v8value_t* _retval = + cef_v8value_create_object(CefV8AccessorCppToC::Wrap(accessor), + CefV8InterceptorCppToC::Wrap(interceptor)); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -130,14 +125,14 @@ CefRefPtr CefV8Value::CreateArray(int length) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = cef_v8value_create_array( - length); + cef_v8value_t* _retval = cef_v8value_create_array(length); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateFunction(const CefString& name, +CefRefPtr CefV8Value::CreateFunction( + const CefString& name, CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -152,14 +147,12 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, // Execute cef_v8value_t* _retval = cef_v8value_create_function( - name.GetStruct(), - CefV8HandlerCppToC::Wrap(handler)); + name.GetStruct(), CefV8HandlerCppToC::Wrap(handler)); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefV8ValueCToCpp::IsValid() { @@ -173,7 +166,7 @@ bool CefV8ValueCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsUndefined() { @@ -187,7 +180,7 @@ bool CefV8ValueCToCpp::IsUndefined() { int _retval = _struct->is_undefined(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsNull() { @@ -201,7 +194,7 @@ bool CefV8ValueCToCpp::IsNull() { int _retval = _struct->is_null(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsBool() { @@ -215,7 +208,7 @@ bool CefV8ValueCToCpp::IsBool() { int _retval = _struct->is_bool(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsInt() { @@ -229,7 +222,7 @@ bool CefV8ValueCToCpp::IsInt() { int _retval = _struct->is_int(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsUInt() { @@ -243,7 +236,7 @@ bool CefV8ValueCToCpp::IsUInt() { int _retval = _struct->is_uint(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsDouble() { @@ -257,7 +250,7 @@ bool CefV8ValueCToCpp::IsDouble() { int _retval = _struct->is_double(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsDate() { @@ -271,7 +264,7 @@ bool CefV8ValueCToCpp::IsDate() { int _retval = _struct->is_date(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsString() { @@ -285,7 +278,7 @@ bool CefV8ValueCToCpp::IsString() { int _retval = _struct->is_string(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsObject() { @@ -299,7 +292,7 @@ bool CefV8ValueCToCpp::IsObject() { int _retval = _struct->is_object(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsArray() { @@ -313,7 +306,7 @@ bool CefV8ValueCToCpp::IsArray() { int _retval = _struct->is_array(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsFunction() { @@ -327,7 +320,7 @@ bool CefV8ValueCToCpp::IsFunction() { int _retval = _struct->is_function(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { @@ -343,11 +336,10 @@ bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefV8ValueCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefV8ValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::GetBoolValue() { @@ -361,7 +353,7 @@ bool CefV8ValueCToCpp::GetBoolValue() { int _retval = _struct->get_bool_value(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int32 CefV8ValueCToCpp::GetIntValue() { @@ -447,7 +439,7 @@ bool CefV8ValueCToCpp::IsUserCreated() { int _retval = _struct->is_user_created(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::HasException() { @@ -461,7 +453,7 @@ bool CefV8ValueCToCpp::HasException() { int _retval = _struct->has_exception(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefV8ValueCToCpp::GetException() { @@ -489,7 +481,7 @@ bool CefV8ValueCToCpp::ClearException() { int _retval = _struct->clear_exception(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::WillRethrowExceptions() { @@ -503,7 +495,7 @@ bool CefV8ValueCToCpp::WillRethrowExceptions() { int _retval = _struct->will_rethrow_exceptions(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) { @@ -514,11 +506,10 @@ bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_rethrow_exceptions(_struct, - rethrow); + int _retval = _struct->set_rethrow_exceptions(_struct, rethrow); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::HasValue(const CefString& key) { @@ -531,11 +522,10 @@ bool CefV8ValueCToCpp::HasValue(const CefString& key) { // Unverified params: key // Execute - int _retval = _struct->has_value_bykey(_struct, - key.GetStruct()); + int _retval = _struct->has_value_bykey(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::HasValue(int index) { @@ -551,11 +541,10 @@ bool CefV8ValueCToCpp::HasValue(int index) { return false; // Execute - int _retval = _struct->has_value_byindex(_struct, - index); + int _retval = _struct->has_value_byindex(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { @@ -568,11 +557,10 @@ bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { // Unverified params: key // Execute - int _retval = _struct->delete_value_bykey(_struct, - key.GetStruct()); + int _retval = _struct->delete_value_bykey(_struct, key.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::DeleteValue(int index) { @@ -588,11 +576,10 @@ bool CefV8ValueCToCpp::DeleteValue(int index) { return false; // Execute - int _retval = _struct->delete_value_byindex(_struct, - index); + int _retval = _struct->delete_value_byindex(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { @@ -605,8 +592,7 @@ CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { // Unverified params: key // Execute - cef_v8value_t* _retval = _struct->get_value_bykey(_struct, - key.GetStruct()); + cef_v8value_t* _retval = _struct->get_value_bykey(_struct, key.GetStruct()); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); @@ -625,15 +611,15 @@ CefRefPtr CefV8ValueCToCpp::GetValue(int index) { return NULL; // Execute - cef_v8value_t* _retval = _struct->get_value_byindex(_struct, - index); + cef_v8value_t* _retval = _struct->get_value_byindex(_struct, index); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } bool CefV8ValueCToCpp::SetValue(const CefString& key, - CefRefPtr value, PropertyAttribute attribute) { + CefRefPtr value, + PropertyAttribute attribute) { cef_v8value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_value_bykey)) return false; @@ -647,13 +633,11 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, // Unverified params: key // Execute - int _retval = _struct->set_value_bykey(_struct, - key.GetStruct(), - CefV8ValueCToCpp::Unwrap(value), - attribute); + int _retval = _struct->set_value_bykey( + _struct, key.GetStruct(), CefV8ValueCToCpp::Unwrap(value), attribute); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { @@ -673,16 +657,16 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { return false; // Execute - int _retval = _struct->set_value_byindex(_struct, - index, - CefV8ValueCToCpp::Unwrap(value)); + int _retval = _struct->set_value_byindex(_struct, index, + CefV8ValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, - PropertyAttribute attribute) { +bool CefV8ValueCToCpp::SetValue(const CefString& key, + AccessControl settings, + PropertyAttribute attribute) { cef_v8value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_value_byaccessor)) return false; @@ -692,13 +676,11 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, // Unverified params: key // Execute - int _retval = _struct->set_value_byaccessor(_struct, - key.GetStruct(), - settings, - attribute); + int _retval = _struct->set_value_byaccessor(_struct, key.GetStruct(), + settings, attribute); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { @@ -715,8 +697,7 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { transfer_string_list_contents(keys, keysList); // Execute - int _retval = _struct->get_keys(_struct, - keysList); + int _retval = _struct->get_keys(_struct, keysList); // Restore param:keys; type: string_vec_byref if (keysList) { @@ -726,7 +707,7 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { } // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { @@ -739,11 +720,11 @@ bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { // Unverified params: user_data // Execute - int _retval = _struct->set_user_data(_struct, - CefBaseRefCountedCppToC::Wrap(user_data)); + int _retval = + _struct->set_user_data(_struct, CefBaseRefCountedCppToC::Wrap(user_data)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefV8ValueCToCpp::GetUserData() { @@ -782,8 +763,8 @@ int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->adjust_externally_allocated_memory(_struct, - change_in_bytes); + int _retval = + _struct->adjust_externally_allocated_memory(_struct, change_in_bytes); // Return type: simple return _retval; @@ -834,7 +815,8 @@ CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { } CefRefPtr CefV8ValueCToCpp::ExecuteFunction( - CefRefPtr object, const CefV8ValueList& arguments) { + CefRefPtr object, + const CefV8ValueList& arguments) { cef_v8value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, execute_function)) return NULL; @@ -857,21 +839,20 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunction( } // Execute - cef_v8value_t* _retval = _struct->execute_function(_struct, - CefV8ValueCToCpp::Unwrap(object), - argumentsCount, - argumentsList); + cef_v8value_t* _retval = _struct->execute_function( + _struct, CefV8ValueCToCpp::Unwrap(object), argumentsCount, argumentsList); // Restore param:arguments; type: refptr_vec_same_byref_const if (argumentsList) - delete [] argumentsList; + delete[] argumentsList; // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( - CefRefPtr context, CefRefPtr object, + CefRefPtr context, + CefRefPtr object, const CefV8ValueList& arguments) { cef_v8value_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, execute_function_with_context)) @@ -899,36 +880,39 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( } // Execute - cef_v8value_t* _retval = _struct->execute_function_with_context(_struct, - CefV8ContextCToCpp::Unwrap(context), - CefV8ValueCToCpp::Unwrap(object), - argumentsCount, - argumentsList); + cef_v8value_t* _retval = _struct->execute_function_with_context( + _struct, CefV8ContextCToCpp::Unwrap(context), + CefV8ValueCToCpp::Unwrap(object), argumentsCount, argumentsList); // Restore param:arguments; type: refptr_vec_same_byref_const if (argumentsList) - delete [] argumentsList; + delete[] argumentsList; // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } - // CONSTRUCTOR - Do not edit by hand. -CefV8ValueCToCpp::CefV8ValueCToCpp() { -} +CefV8ValueCToCpp::CefV8ValueCToCpp() {} -template<> cef_v8value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefV8Value* c) { +template <> +cef_v8value_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefV8Value* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8VALUE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8VALUE; diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h index 7518e6619..93c2650bb 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.h +++ b/libcef_dll/ctocpp/v8value_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=b811aad20b2d74c0c8e028354163a5e68f52517e$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ @@ -19,8 +21,8 @@ #endif #include -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" +#include "include/cef_v8.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -62,11 +64,13 @@ class CefV8ValueCToCpp bool DeleteValue(int index) OVERRIDE; CefRefPtr GetValue(const CefString& key) OVERRIDE; CefRefPtr GetValue(int index) OVERRIDE; - bool SetValue(const CefString& key, CefRefPtr value, - PropertyAttribute attribute) OVERRIDE; + bool SetValue(const CefString& key, + CefRefPtr value, + PropertyAttribute attribute) OVERRIDE; bool SetValue(int index, CefRefPtr value) OVERRIDE; - bool SetValue(const CefString& key, AccessControl settings, - PropertyAttribute attribute) OVERRIDE; + bool SetValue(const CefString& key, + AccessControl settings, + PropertyAttribute attribute) OVERRIDE; bool GetKeys(std::vector& keys) OVERRIDE; bool SetUserData(CefRefPtr user_data) OVERRIDE; CefRefPtr GetUserData() OVERRIDE; @@ -75,10 +79,12 @@ class CefV8ValueCToCpp int GetArrayLength() OVERRIDE; CefString GetFunctionName() OVERRIDE; CefRefPtr GetFunctionHandler() OVERRIDE; - CefRefPtr ExecuteFunction(CefRefPtr object, + CefRefPtr ExecuteFunction( + CefRefPtr object, const CefV8ValueList& arguments) OVERRIDE; CefRefPtr ExecuteFunctionWithContext( - CefRefPtr context, CefRefPtr object, + CefRefPtr context, + CefRefPtr object, const CefV8ValueList& arguments) OVERRIDE; }; diff --git a/libcef_dll/ctocpp/value_ctocpp.cc b/libcef_dll/ctocpp/value_ctocpp.cc index fcc56ee38..3e2dc8f6b 100644 --- a/libcef_dll/ctocpp/value_ctocpp.cc +++ b/libcef_dll/ctocpp/value_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=dce21cc429320a9d24fd80ad2bc1347b03f82808$ +// #include "libcef_dll/ctocpp/binary_value_ctocpp.h" #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" #include "libcef_dll/ctocpp/list_value_ctocpp.h" #include "libcef_dll/ctocpp/value_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefValue::Create() { @@ -28,7 +29,6 @@ CefRefPtr CefValue::Create() { return CefValueCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefValueCToCpp::IsValid() { @@ -42,7 +42,7 @@ bool CefValueCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::IsOwned() { @@ -56,7 +56,7 @@ bool CefValueCToCpp::IsOwned() { int _retval = _struct->is_owned(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::IsReadOnly() { @@ -70,7 +70,7 @@ bool CefValueCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::IsSame(CefRefPtr that) { @@ -86,11 +86,10 @@ bool CefValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefValueCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::IsEqual(CefRefPtr that) { @@ -106,11 +105,10 @@ bool CefValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_equal(_struct, - CefValueCToCpp::Unwrap(that)); + int _retval = _struct->is_equal(_struct, CefValueCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefValueCToCpp::Copy() { @@ -152,7 +150,7 @@ bool CefValueCToCpp::GetBool() { int _retval = _struct->get_bool(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefValueCToCpp::GetInt() { @@ -252,7 +250,7 @@ bool CefValueCToCpp::SetNull() { int _retval = _struct->set_null(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetBool(bool value) { @@ -263,11 +261,10 @@ bool CefValueCToCpp::SetBool(bool value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_bool(_struct, - value); + int _retval = _struct->set_bool(_struct, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetInt(int value) { @@ -278,11 +275,10 @@ bool CefValueCToCpp::SetInt(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_int(_struct, - value); + int _retval = _struct->set_int(_struct, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetDouble(double value) { @@ -293,11 +289,10 @@ bool CefValueCToCpp::SetDouble(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->set_double(_struct, - value); + int _retval = _struct->set_double(_struct, value); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetString(const CefString& value) { @@ -310,11 +305,10 @@ bool CefValueCToCpp::SetString(const CefString& value) { // Unverified params: value // Execute - int _retval = _struct->set_string(_struct, - value.GetStruct()); + int _retval = _struct->set_string(_struct, value.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetBinary(CefRefPtr value) { @@ -330,11 +324,11 @@ bool CefValueCToCpp::SetBinary(CefRefPtr value) { return false; // Execute - int _retval = _struct->set_binary(_struct, - CefBinaryValueCToCpp::Unwrap(value)); + int _retval = + _struct->set_binary(_struct, CefBinaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetDictionary(CefRefPtr value) { @@ -350,11 +344,11 @@ bool CefValueCToCpp::SetDictionary(CefRefPtr value) { return false; // Execute - int _retval = _struct->set_dictionary(_struct, - CefDictionaryValueCToCpp::Unwrap(value)); + int _retval = + _struct->set_dictionary(_struct, CefDictionaryValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefValueCToCpp::SetList(CefRefPtr value) { @@ -370,29 +364,32 @@ bool CefValueCToCpp::SetList(CefRefPtr value) { return false; // Execute - int _retval = _struct->set_list(_struct, - CefListValueCToCpp::Unwrap(value)); + int _retval = _struct->set_list(_struct, CefListValueCToCpp::Unwrap(value)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefValueCToCpp::CefValueCToCpp() { -} +CefValueCToCpp::CefValueCToCpp() {} -template<> cef_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefValue* c) { +template <> +cef_value_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefValue* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VALUE; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_VALUE; diff --git a/libcef_dll/ctocpp/value_ctocpp.h b/libcef_dll/ctocpp/value_ctocpp.h index 24b6e3a3e..9c3044580 100644 --- a/libcef_dll/ctocpp/value_ctocpp.h +++ b/libcef_dll/ctocpp/value_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f0494edd5fdf58f4c3d999ab6bf4f29658e0f819$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_values.h" #include "include/capi/cef_values_capi.h" +#include "include/cef_values.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/box_layout_ctocpp.cc b/libcef_dll/ctocpp/views/box_layout_ctocpp.cc index 152dee2c8..bd04b9018 100644 --- a/libcef_dll/ctocpp/views/box_layout_ctocpp.cc +++ b/libcef_dll/ctocpp/views/box_layout_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c244fabd0671d80878beec9fcaa13b0251048f50$ +// #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefBoxLayoutCToCpp::SetFlexForView(CefRefPtr view, int flex) { @@ -30,9 +31,7 @@ void CefBoxLayoutCToCpp::SetFlexForView(CefRefPtr view, int flex) { return; // Execute - _struct->set_flex_for_view(_struct, - CefViewCToCpp::Unwrap(view), - flex); + _struct->set_flex_for_view(_struct, CefViewCToCpp::Unwrap(view), flex); } void CefBoxLayoutCToCpp::ClearFlexForView(CefRefPtr view) { @@ -48,8 +47,7 @@ void CefBoxLayoutCToCpp::ClearFlexForView(CefRefPtr view) { return; // Execute - _struct->clear_flex_for_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->clear_flex_for_view(_struct, CefViewCToCpp::Unwrap(view)); } CefRefPtr CefBoxLayoutCToCpp::AsBoxLayout() { @@ -91,26 +89,30 @@ bool CefBoxLayoutCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefBoxLayoutCToCpp::CefBoxLayoutCToCpp() { -} +CefBoxLayoutCToCpp::CefBoxLayoutCToCpp() {} -template<> cef_box_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefBoxLayout* c) { +template <> +cef_box_layout_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefBoxLayout* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BOX_LAYOUT; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_BOX_LAYOUT; diff --git a/libcef_dll/ctocpp/views/box_layout_ctocpp.h b/libcef_dll/ctocpp/views/box_layout_ctocpp.h index 4db8bce5e..232ef78a6 100644 --- a/libcef_dll/ctocpp/views/box_layout_ctocpp.h +++ b/libcef_dll/ctocpp/views/box_layout_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=101c51d45d4911ff0497fe2e32a75869ff262361$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BOX_LAYOUT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BOX_LAYOUT_CTOCPP_H_ @@ -18,17 +20,17 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_box_layout.h" #include "include/capi/views/cef_box_layout_capi.h" -#include "include/views/cef_view.h" #include "include/capi/views/cef_view_capi.h" +#include "include/views/cef_box_layout.h" +#include "include/views/cef_view.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefBoxLayoutCToCpp - : public CefCToCppRefCounted { +class CefBoxLayoutCToCpp : public CefCToCppRefCounted { public: CefBoxLayoutCToCpp(); diff --git a/libcef_dll/ctocpp/views/browser_view_ctocpp.cc b/libcef_dll/ctocpp/views/browser_view_ctocpp.cc index 5fe0fa6de..3b1d32a4b 100644 --- a/libcef_dll/ctocpp/views/browser_view_ctocpp.cc +++ b/libcef_dll/ctocpp/views/browser_view_ctocpp.cc @@ -9,25 +9,27 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=db4176c64eb45165a67d1495aa9222169c6f4c89$ +// -#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" #include "libcef_dll/cpptoc/client_cpptoc.h" +#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/request_context_ctocpp.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" #include "libcef_dll/ctocpp/views/panel_ctocpp.h" -#include "libcef_dll/ctocpp/request_context_ctocpp.h" #include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" #include "libcef_dll/ctocpp/views/textfield_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefBrowserView::CreateBrowserView( - CefRefPtr client, const CefString& url, + CefRefPtr client, + const CefString& url, const CefBrowserSettings& settings, CefRefPtr request_context, CefRefPtr delegate) { @@ -37,9 +39,7 @@ CefRefPtr CefBrowserView::CreateBrowserView( // Execute cef_browser_view_t* _retval = cef_browser_view_create( - CefClientCppToC::Wrap(client), - url.GetStruct(), - &settings, + CefClientCppToC::Wrap(client), url.GetStruct(), &settings, CefRequestContextCToCpp::Unwrap(request_context), CefBrowserViewDelegateCppToC::Wrap(delegate)); @@ -57,14 +57,13 @@ CefRefPtr CefBrowserView::GetForBrowser( return NULL; // Execute - cef_browser_view_t* _retval = cef_browser_view_get_for_browser( - CefBrowserCToCpp::Unwrap(browser)); + cef_browser_view_t* _retval = + cef_browser_view_get_for_browser(CefBrowserCToCpp::Unwrap(browser)); // Return type: refptr_same return CefBrowserViewCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefBrowserViewCToCpp::GetBrowser() { @@ -89,8 +88,7 @@ void CefBrowserViewCToCpp::SetPreferAccelerators(bool prefer_accelerators) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_prefer_accelerators(_struct, - prefer_accelerators); + _struct->set_prefer_accelerators(_struct, prefer_accelerators); } CefRefPtr CefBrowserViewCToCpp::AsBrowserView() { @@ -187,8 +185,7 @@ CefString CefBrowserViewCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -207,7 +204,7 @@ bool CefBrowserViewCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::IsAttached() { @@ -221,7 +218,7 @@ bool CefBrowserViewCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::IsSame(CefRefPtr that) { @@ -237,11 +234,10 @@ bool CefBrowserViewCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefBrowserViewCToCpp::GetDelegate() { @@ -294,8 +290,7 @@ void CefBrowserViewCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefBrowserViewCToCpp::GetGroupID() { @@ -320,8 +315,7 @@ void CefBrowserViewCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefBrowserViewCToCpp::GetParentView() { @@ -346,8 +340,7 @@ CefRefPtr CefBrowserViewCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -361,8 +354,7 @@ void CefBrowserViewCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefBrowserViewCToCpp::GetBounds() { @@ -401,8 +393,7 @@ void CefBrowserViewCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefBrowserViewCToCpp::GetSize() { @@ -427,8 +418,7 @@ void CefBrowserViewCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefBrowserViewCToCpp::GetPosition() { @@ -506,8 +496,7 @@ int CefBrowserViewCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -532,8 +521,7 @@ void CefBrowserViewCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefBrowserViewCToCpp::IsVisible() { @@ -547,7 +535,7 @@ bool CefBrowserViewCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::IsDrawn() { @@ -561,7 +549,7 @@ bool CefBrowserViewCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserViewCToCpp::SetEnabled(bool enabled) { @@ -572,8 +560,7 @@ void CefBrowserViewCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefBrowserViewCToCpp::IsEnabled() { @@ -587,7 +574,7 @@ bool CefBrowserViewCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserViewCToCpp::SetFocusable(bool focusable) { @@ -598,8 +585,7 @@ void CefBrowserViewCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefBrowserViewCToCpp::IsFocusable() { @@ -613,7 +599,7 @@ bool CefBrowserViewCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::IsAccessibilityFocusable() { @@ -627,7 +613,7 @@ bool CefBrowserViewCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefBrowserViewCToCpp::RequestFocus() { @@ -649,8 +635,7 @@ void CefBrowserViewCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefBrowserViewCToCpp::GetBackgroundColor() { @@ -675,11 +660,10 @@ bool CefBrowserViewCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -690,11 +674,10 @@ bool CefBrowserViewCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -705,11 +688,10 @@ bool CefBrowserViewCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -720,15 +702,14 @@ bool CefBrowserViewCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -741,16 +722,15 @@ bool CefBrowserViewCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefBrowserViewCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -763,31 +743,34 @@ bool CefBrowserViewCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefBrowserViewCToCpp::CefBrowserViewCToCpp() { -} +CefBrowserViewCToCpp::CefBrowserViewCToCpp() {} -template<> cef_browser_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefBrowserView* c) { +template <> +cef_browser_view_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefBrowserView* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER_VIEW; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_BROWSER_VIEW; diff --git a/libcef_dll/ctocpp/views/browser_view_ctocpp.h b/libcef_dll/ctocpp/views/browser_view_ctocpp.h index 78aabfffc..ab3802292 100644 --- a/libcef_dll/ctocpp/views/browser_view_ctocpp.h +++ b/libcef_dll/ctocpp/views/browser_view_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1e7369596ef3c39e73d8349601e0b5bfdb24d1ef$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_browser_view.h" #include "include/capi/views/cef_browser_view_capi.h" +#include "include/views/cef_browser_view.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefBrowserViewCToCpp - : public CefCToCppRefCounted { +class CefBrowserViewCToCpp : public CefCToCppRefCounted { public: CefBrowserViewCToCpp(); diff --git a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc index b89d79753..537d3461f 100644 --- a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc @@ -9,18 +9,20 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0eb6f0608c15cba18640c52aa8a3fd0ed73cce15$ +// #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" -#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" #include "libcef_dll/ctocpp/client_ctocpp.h" - +#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" // VIRTUAL METHODS - Body may be edited by hand. void CefBrowserViewDelegateCToCpp::OnBrowserCreated( - CefRefPtr browser_view, CefRefPtr browser) { + CefRefPtr browser_view, + CefRefPtr browser) { cef_browser_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_browser_created)) return; @@ -37,13 +39,13 @@ void CefBrowserViewDelegateCToCpp::OnBrowserCreated( return; // Execute - _struct->on_browser_created(_struct, - CefBrowserViewCppToC::Wrap(browser_view), - CefBrowserCppToC::Wrap(browser)); + _struct->on_browser_created(_struct, CefBrowserViewCppToC::Wrap(browser_view), + CefBrowserCppToC::Wrap(browser)); } void CefBrowserViewDelegateCToCpp::OnBrowserDestroyed( - CefRefPtr browser_view, CefRefPtr browser) { + CefRefPtr browser_view, + CefRefPtr browser) { cef_browser_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_browser_destroyed)) return; @@ -61,13 +63,16 @@ void CefBrowserViewDelegateCToCpp::OnBrowserDestroyed( // Execute _struct->on_browser_destroyed(_struct, - CefBrowserViewCppToC::Wrap(browser_view), - CefBrowserCppToC::Wrap(browser)); + CefBrowserViewCppToC::Wrap(browser_view), + CefBrowserCppToC::Wrap(browser)); } -CefRefPtr CefBrowserViewDelegateCToCpp::GetDelegateForPopupBrowserView( - CefRefPtr browser_view, const CefBrowserSettings& settings, - CefRefPtr client, bool is_devtools) { +CefRefPtr +CefBrowserViewDelegateCToCpp::GetDelegateForPopupBrowserView( + CefRefPtr browser_view, + const CefBrowserSettings& settings, + CefRefPtr client, + bool is_devtools) { cef_browser_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_delegate_for_popup_browser_view)) return NULL; @@ -85,11 +90,9 @@ CefRefPtr CefBrowserViewDelegateCToCpp::GetDelegateForPo // Execute cef_browser_view_delegate_t* _retval = - _struct->get_delegate_for_popup_browser_view(_struct, - CefBrowserViewCppToC::Wrap(browser_view), - &settings, - CefClientCToCpp::Unwrap(client), - is_devtools); + _struct->get_delegate_for_popup_browser_view( + _struct, CefBrowserViewCppToC::Wrap(browser_view), &settings, + CefClientCToCpp::Unwrap(client), is_devtools); // Return type: refptr_same return CefBrowserViewDelegateCToCpp::Wrap(_retval); @@ -97,7 +100,8 @@ CefRefPtr CefBrowserViewDelegateCToCpp::GetDelegateForPo bool CefBrowserViewDelegateCToCpp::OnPopupBrowserViewCreated( CefRefPtr browser_view, - CefRefPtr popup_browser_view, bool is_devtools) { + CefRefPtr popup_browser_view, + bool is_devtools) { cef_browser_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_popup_browser_view_created)) return false; @@ -114,19 +118,18 @@ bool CefBrowserViewDelegateCToCpp::OnPopupBrowserViewCreated( return false; // Execute - int _retval = _struct->on_popup_browser_view_created(_struct, - CefBrowserViewCppToC::Wrap(browser_view), - CefBrowserViewCppToC::Wrap(popup_browser_view), - is_devtools); + int _retval = _struct->on_popup_browser_view_created( + _struct, CefBrowserViewCppToC::Wrap(browser_view), + CefBrowserViewCppToC::Wrap(popup_browser_view), is_devtools); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefSize CefBrowserViewDelegateCToCpp::GetPreferredSize( CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -138,16 +141,16 @@ CefSize CefBrowserViewDelegateCToCpp::GetPreferredSize( return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefBrowserViewDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -159,16 +162,16 @@ CefSize CefBrowserViewDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefBrowserViewDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -180,17 +183,17 @@ CefSize CefBrowserViewDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefBrowserViewDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -202,18 +205,19 @@ int CefBrowserViewDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } -void CefBrowserViewDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); +void CefBrowserViewDelegateCToCpp::OnParentViewChanged( + CefRefPtr view, + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -229,16 +233,16 @@ void CefBrowserViewDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } -void CefBrowserViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); +void CefBrowserViewDelegateCToCpp::OnChildViewChanged( + CefRefPtr view, + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -254,15 +258,13 @@ void CefBrowserViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefBrowserViewDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -274,13 +276,12 @@ void CefBrowserViewDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefBrowserViewDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -292,28 +293,33 @@ void CefBrowserViewDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefBrowserViewDelegateCToCpp::CefBrowserViewDelegateCToCpp() { -} +CefBrowserViewDelegateCToCpp::CefBrowserViewDelegateCToCpp() {} -template<> cef_browser_view_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefBrowserViewDelegate* c) { +template <> +cef_browser_view_delegate_t* CefCToCppRefCounted< + CefBrowserViewDelegateCToCpp, + CefBrowserViewDelegate, + cef_browser_view_delegate_t>::UnwrapDerived(CefWrapperType type, + CefBrowserViewDelegate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER_VIEW_DELEGATE; diff --git a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h index 21fb803a0..0eeeb175c 100644 --- a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=259b6a14e0f63f28e71cea91c1899a57e4478d01$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_ @@ -18,44 +20,48 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_browser_view_delegate.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/views/cef_browser_view_capi.h" #include "include/capi/views/cef_browser_view_delegate_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" #include "include/views/cef_browser_view.h" -#include "include/capi/views/cef_browser_view_capi.h" +#include "include/views/cef_browser_view_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefBrowserViewDelegateCToCpp : public CefCToCppRefCounted { + CefBrowserViewDelegate, + cef_browser_view_delegate_t> { public: CefBrowserViewDelegateCToCpp(); // CefBrowserViewDelegate methods. void OnBrowserCreated(CefRefPtr browser_view, - CefRefPtr browser) override; + CefRefPtr browser) override; void OnBrowserDestroyed(CefRefPtr browser_view, - CefRefPtr browser) override; + CefRefPtr browser) override; CefRefPtr GetDelegateForPopupBrowserView( CefRefPtr browser_view, - const CefBrowserSettings& settings, CefRefPtr client, + const CefBrowserSettings& settings, + CefRefPtr client, bool is_devtools) override; bool OnPopupBrowserViewCreated(CefRefPtr browser_view, - CefRefPtr popup_browser_view, - bool is_devtools) override; + CefRefPtr popup_browser_view, + bool is_devtools) override; // CefViewDelegate methods. CefSize GetPreferredSize(CefRefPtr view) override; CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/button_ctocpp.cc b/libcef_dll/ctocpp/views/button_ctocpp.cc index 48f3984c6..96f69ad0f 100644 --- a/libcef_dll/ctocpp/views/button_ctocpp.cc +++ b/libcef_dll/ctocpp/views/button_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=95094867efa267a8462c40596e749539670db449$ +// #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" @@ -21,7 +23,6 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefButtonCToCpp::AsLabelButton() { @@ -46,8 +47,7 @@ void CefButtonCToCpp::SetState(cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_state(_struct, - state); + _struct->set_state(_struct, state); } cef_button_state_t CefButtonCToCpp::GetState() { @@ -72,8 +72,7 @@ void CefButtonCToCpp::SetInkDropEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_ink_drop_enabled(_struct, - enabled); + _struct->set_ink_drop_enabled(_struct, enabled); } void CefButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { @@ -89,8 +88,7 @@ void CefButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { return; // Execute - _struct->set_tooltip_text(_struct, - tooltip_text.GetStruct()); + _struct->set_tooltip_text(_struct, tooltip_text.GetStruct()); } void CefButtonCToCpp::SetAccessibleName(const CefString& name) { @@ -106,8 +104,7 @@ void CefButtonCToCpp::SetAccessibleName(const CefString& name) { return; // Execute - _struct->set_accessible_name(_struct, - name.GetStruct()); + _struct->set_accessible_name(_struct, name.GetStruct()); } CefRefPtr CefButtonCToCpp::AsBrowserView() { @@ -204,8 +201,7 @@ CefString CefButtonCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -224,7 +220,7 @@ bool CefButtonCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::IsAttached() { @@ -238,7 +234,7 @@ bool CefButtonCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::IsSame(CefRefPtr that) { @@ -254,11 +250,10 @@ bool CefButtonCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefButtonCToCpp::GetDelegate() { @@ -311,8 +306,7 @@ void CefButtonCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefButtonCToCpp::GetGroupID() { @@ -337,8 +331,7 @@ void CefButtonCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefButtonCToCpp::GetParentView() { @@ -363,8 +356,7 @@ CefRefPtr CefButtonCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -378,8 +370,7 @@ void CefButtonCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefButtonCToCpp::GetBounds() { @@ -418,8 +409,7 @@ void CefButtonCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefButtonCToCpp::GetSize() { @@ -444,8 +434,7 @@ void CefButtonCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefButtonCToCpp::GetPosition() { @@ -523,8 +512,7 @@ int CefButtonCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -549,8 +537,7 @@ void CefButtonCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefButtonCToCpp::IsVisible() { @@ -564,7 +551,7 @@ bool CefButtonCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::IsDrawn() { @@ -578,7 +565,7 @@ bool CefButtonCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefButtonCToCpp::SetEnabled(bool enabled) { @@ -589,8 +576,7 @@ void CefButtonCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefButtonCToCpp::IsEnabled() { @@ -604,7 +590,7 @@ bool CefButtonCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefButtonCToCpp::SetFocusable(bool focusable) { @@ -615,8 +601,7 @@ void CefButtonCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefButtonCToCpp::IsFocusable() { @@ -630,7 +615,7 @@ bool CefButtonCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::IsAccessibilityFocusable() { @@ -644,7 +629,7 @@ bool CefButtonCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefButtonCToCpp::RequestFocus() { @@ -666,8 +651,7 @@ void CefButtonCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefButtonCToCpp::GetBackgroundColor() { @@ -692,11 +676,10 @@ bool CefButtonCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -707,11 +690,10 @@ bool CefButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -722,11 +704,10 @@ bool CefButtonCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -737,15 +718,14 @@ bool CefButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -758,16 +738,15 @@ bool CefButtonCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefButtonCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -780,38 +759,41 @@ bool CefButtonCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefButtonCToCpp::CefButtonCToCpp() { -} +CefButtonCToCpp::CefButtonCToCpp() {} -template<> cef_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefButton* c) { +template <> +cef_button_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefButton* c) { if (type == WT_LABEL_BUTTON) { - return reinterpret_cast(CefLabelButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefLabelButtonCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_MENU_BUTTON) { - return reinterpret_cast(CefMenuButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefMenuButtonCToCpp::Unwrap(reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BUTTON; +template <> +CefWrapperType CefCToCppRefCounted:: + kWrapperType = WT_BUTTON; diff --git a/libcef_dll/ctocpp/views/button_ctocpp.h b/libcef_dll/ctocpp/views/button_ctocpp.h index d3b19644d..fef29aca4 100644 --- a/libcef_dll/ctocpp/views/button_ctocpp.h +++ b/libcef_dll/ctocpp/views/button_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e96ae0220686ce1cb36adf65a51dd725eba8786e$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_CTOCPP_H_ @@ -18,10 +20,10 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_button.h" #include "include/capi/views/cef_button_capi.h" -#include "include/views/cef_label_button.h" #include "include/capi/views/cef_label_button_capi.h" +#include "include/views/cef_button.h" +#include "include/views/cef_label_button.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc index 674e2df53..c1739aa92 100644 --- a/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2777421fafeccaca2d573bce9b42f28fa0407fb0$ +// #include "libcef_dll/cpptoc/views/button_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefButtonDelegateCToCpp::OnButtonPressed(CefRefPtr button) { @@ -31,8 +32,7 @@ void CefButtonDelegateCToCpp::OnButtonPressed(CefRefPtr button) { return; // Execute - _struct->on_button_pressed(_struct, - CefButtonCppToC::Wrap(button)); + _struct->on_button_pressed(_struct, CefButtonCppToC::Wrap(button)); } void CefButtonDelegateCToCpp::OnButtonStateChanged( @@ -49,13 +49,12 @@ void CefButtonDelegateCToCpp::OnButtonStateChanged( return; // Execute - _struct->on_button_state_changed(_struct, - CefButtonCppToC::Wrap(button)); + _struct->on_button_state_changed(_struct, CefButtonCppToC::Wrap(button)); } CefSize CefButtonDelegateCToCpp::GetPreferredSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -67,16 +66,16 @@ CefSize CefButtonDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefButtonDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -88,16 +87,16 @@ CefSize CefButtonDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefButtonDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -109,17 +108,17 @@ CefSize CefButtonDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefButtonDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -131,18 +130,18 @@ int CefButtonDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } void CefButtonDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -158,16 +157,15 @@ void CefButtonDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -183,15 +181,13 @@ void CefButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefButtonDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -203,13 +199,12 @@ void CefButtonDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefButtonDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -221,33 +216,37 @@ void CefButtonDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefButtonDelegateCToCpp::CefButtonDelegateCToCpp() { -} +CefButtonDelegateCToCpp::CefButtonDelegateCToCpp() {} -template<> cef_button_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefButtonDelegate* c) { +template <> +cef_button_delegate_t* CefCToCppRefCounted< + CefButtonDelegateCToCpp, + CefButtonDelegate, + cef_button_delegate_t>::UnwrapDerived(CefWrapperType type, + CefButtonDelegate* c) { if (type == WT_MENU_BUTTON_DELEGATE) { return reinterpret_cast( CefMenuButtonDelegateCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BUTTON_DELEGATE; diff --git a/libcef_dll/ctocpp/views/button_delegate_ctocpp.h b/libcef_dll/ctocpp/views/button_delegate_ctocpp.h index 0e65769b3..d2409f36a 100644 --- a/libcef_dll/ctocpp/views/button_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/button_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0c1f554d07c5025bf039d701dd48a2ea109ecbfa$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_button_delegate.h" +#include "include/capi/views/cef_button_capi.h" #include "include/capi/views/cef_button_delegate_capi.h" #include "include/views/cef_button.h" -#include "include/capi/views/cef_button_capi.h" +#include "include/views/cef_button_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefButtonDelegateCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefButtonDelegateCToCpp(); @@ -41,10 +44,12 @@ class CefButtonDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/display_ctocpp.cc b/libcef_dll/ctocpp/views/display_ctocpp.cc index 30aaf90d8..196e8d998 100644 --- a/libcef_dll/ctocpp/views/display_ctocpp.cc +++ b/libcef_dll/ctocpp/views/display_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2e6bd09f8d9e40e522cc5d1060666ebe8a295bc0$ +// #include #include "libcef_dll/ctocpp/views/display_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefDisplay::GetPrimaryDisplay() { @@ -26,27 +27,27 @@ CefRefPtr CefDisplay::GetPrimaryDisplay() { return CefDisplayCToCpp::Wrap(_retval); } -CefRefPtr CefDisplay::GetDisplayNearestPoint(const CefPoint& point, +CefRefPtr CefDisplay::GetDisplayNearestPoint( + const CefPoint& point, bool input_pixel_coords) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_display_t* _retval = cef_display_get_nearest_point( - &point, - input_pixel_coords); + cef_display_t* _retval = + cef_display_get_nearest_point(&point, input_pixel_coords); // Return type: refptr_same return CefDisplayCToCpp::Wrap(_retval); } CefRefPtr CefDisplay::GetDisplayMatchingBounds( - const CefRect& bounds, bool input_pixel_coords) { + const CefRect& bounds, + bool input_pixel_coords) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_display_t* _retval = cef_display_get_matching_bounds( - &bounds, - input_pixel_coords); + cef_display_t* _retval = + cef_display_get_matching_bounds(&bounds, input_pixel_coords); // Return type: refptr_same return CefDisplayCToCpp::Wrap(_retval); @@ -73,7 +74,7 @@ void CefDisplay::GetAllDisplays(std::vector>& displays) { displaysList = new cef_display_t*[displaysCount]; DCHECK(displaysList); if (displaysList) { - memset(displaysList, 0, sizeof(cef_display_t*)*displaysCount); + memset(displaysList, 0, sizeof(cef_display_t*) * displaysCount); } if (displaysList && displaysSize > 0) { for (size_t i = 0; i < displaysSize; ++i) { @@ -83,9 +84,7 @@ void CefDisplay::GetAllDisplays(std::vector>& displays) { } // Execute - cef_display_get_alls( - &displaysCount, - displaysList); + cef_display_get_alls(&displaysCount, displaysList); // Restore param:displays; type: refptr_vec_same_byref displays.clear(); @@ -93,11 +92,10 @@ void CefDisplay::GetAllDisplays(std::vector>& displays) { for (size_t i = 0; i < displaysCount; ++i) { displays.push_back(CefDisplayCToCpp::Wrap(displaysList[i])); } - delete [] displaysList; + delete[] displaysList; } } - // VIRTUAL METHODS - Body may be edited by hand. int64 CefDisplayCToCpp::GetID() { @@ -136,8 +134,7 @@ void CefDisplayCToCpp::ConvertPointToPixels(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->convert_point_to_pixels(_struct, - &point); + _struct->convert_point_to_pixels(_struct, &point); } void CefDisplayCToCpp::ConvertPointFromPixels(CefPoint& point) { @@ -148,8 +145,7 @@ void CefDisplayCToCpp::ConvertPointFromPixels(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->convert_point_from_pixels(_struct, - &point); + _struct->convert_point_from_pixels(_struct, &point); } CefRect CefDisplayCToCpp::GetBounds() { @@ -194,22 +190,27 @@ int CefDisplayCToCpp::GetRotation() { return _retval; } - // CONSTRUCTOR - Do not edit by hand. -CefDisplayCToCpp::CefDisplayCToCpp() { -} +CefDisplayCToCpp::CefDisplayCToCpp() {} -template<> cef_display_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDisplay* c) { +template <> +cef_display_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefDisplay* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DISPLAY; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DISPLAY; diff --git a/libcef_dll/ctocpp/views/display_ctocpp.h b/libcef_dll/ctocpp/views/display_ctocpp.h index 693875308..d0c2052d1 100644 --- a/libcef_dll/ctocpp/views/display_ctocpp.h +++ b/libcef_dll/ctocpp/views/display_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=aa269f6a4dd9e01cb41f345ed926f8ea48f4e3a2$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_DISPLAY_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_DISPLAY_CTOCPP_H_ @@ -18,8 +20,8 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_display.h" #include "include/capi/views/cef_display_capi.h" +#include "include/views/cef_display.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc b/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc index 29ae9c46f..c55c41e5d 100644 --- a/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc +++ b/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=de60346a2373edcaa4087576ef4a33ce919f5b6d$ +// #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefFillLayoutCToCpp::AsBoxLayout() { @@ -55,26 +56,30 @@ bool CefFillLayoutCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefFillLayoutCToCpp::CefFillLayoutCToCpp() { -} +CefFillLayoutCToCpp::CefFillLayoutCToCpp() {} -template<> cef_fill_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefFillLayout* c) { +template <> +cef_fill_layout_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefFillLayout* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FILL_LAYOUT; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_FILL_LAYOUT; diff --git a/libcef_dll/ctocpp/views/fill_layout_ctocpp.h b/libcef_dll/ctocpp/views/fill_layout_ctocpp.h index a4dc1d979..665d27273 100644 --- a/libcef_dll/ctocpp/views/fill_layout_ctocpp.h +++ b/libcef_dll/ctocpp/views/fill_layout_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=77e7a2a31224107e2728b64ad97ad899dd62269c$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_FILL_LAYOUT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_FILL_LAYOUT_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_fill_layout.h" #include "include/capi/views/cef_fill_layout_capi.h" +#include "include/views/cef_fill_layout.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefFillLayoutCToCpp - : public CefCToCppRefCounted { +class CefFillLayoutCToCpp : public CefCToCppRefCounted { public: CefFillLayoutCToCpp(); diff --git a/libcef_dll/ctocpp/views/label_button_ctocpp.cc b/libcef_dll/ctocpp/views/label_button_ctocpp.cc index bfad07004..3a96a9e38 100644 --- a/libcef_dll/ctocpp/views/label_button_ctocpp.cc +++ b/libcef_dll/ctocpp/views/label_button_ctocpp.cc @@ -9,12 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6ad7bcb4afded09f312d3ec082bb4df35da9beec$ +// #include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" +#include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" -#include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/views/label_button_ctocpp.h" #include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" #include "libcef_dll/ctocpp/views/panel_ctocpp.h" @@ -23,11 +25,11 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefLabelButton::CreateLabelButton( - CefRefPtr delegate, const CefString& text, + CefRefPtr delegate, + const CefString& text, bool with_frame) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -39,15 +41,12 @@ CefRefPtr CefLabelButton::CreateLabelButton( // Execute cef_label_button_t* _retval = cef_label_button_create( - CefButtonDelegateCppToC::Wrap(delegate), - text.GetStruct(), - with_frame); + CefButtonDelegateCppToC::Wrap(delegate), text.GetStruct(), with_frame); // Return type: refptr_same return CefLabelButtonCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefLabelButtonCToCpp::AsMenuButton() { @@ -77,8 +76,7 @@ void CefLabelButtonCToCpp::SetText(const CefString& text) { return; // Execute - _struct->set_text(_struct, - text.GetStruct()); + _struct->set_text(_struct, text.GetStruct()); } CefString CefLabelButtonCToCpp::GetText() { @@ -98,7 +96,7 @@ CefString CefLabelButtonCToCpp::GetText() { } void CefLabelButtonCToCpp::SetImage(cef_button_state_t button_state, - CefRefPtr image) { + CefRefPtr image) { cef_label_button_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_image)) return; @@ -108,9 +106,7 @@ void CefLabelButtonCToCpp::SetImage(cef_button_state_t button_state, // Unverified params: image // Execute - _struct->set_image(_struct, - button_state, - CefImageCToCpp::Unwrap(image)); + _struct->set_image(_struct, button_state, CefImageCToCpp::Unwrap(image)); } CefRefPtr CefLabelButtonCToCpp::GetImage( @@ -122,15 +118,14 @@ CefRefPtr CefLabelButtonCToCpp::GetImage( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_image_t* _retval = _struct->get_image(_struct, - button_state); + cef_image_t* _retval = _struct->get_image(_struct, button_state); // Return type: refptr_same return CefImageCToCpp::Wrap(_retval); } void CefLabelButtonCToCpp::SetTextColor(cef_button_state_t for_state, - cef_color_t color) { + cef_color_t color) { cef_label_button_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_text_color)) return; @@ -138,9 +133,7 @@ void CefLabelButtonCToCpp::SetTextColor(cef_button_state_t for_state, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_text_color(_struct, - for_state, - color); + _struct->set_text_color(_struct, for_state, color); } void CefLabelButtonCToCpp::SetEnabledTextColors(cef_color_t color) { @@ -151,8 +144,7 @@ void CefLabelButtonCToCpp::SetEnabledTextColors(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled_text_colors(_struct, - color); + _struct->set_enabled_text_colors(_struct, color); } void CefLabelButtonCToCpp::SetFontList(const CefString& font_list) { @@ -168,8 +160,7 @@ void CefLabelButtonCToCpp::SetFontList(const CefString& font_list) { return; // Execute - _struct->set_font_list(_struct, - font_list.GetStruct()); + _struct->set_font_list(_struct, font_list.GetStruct()); } void CefLabelButtonCToCpp::SetHorizontalAlignment( @@ -181,8 +172,7 @@ void CefLabelButtonCToCpp::SetHorizontalAlignment( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_horizontal_alignment(_struct, - alignment); + _struct->set_horizontal_alignment(_struct, alignment); } void CefLabelButtonCToCpp::SetMinimumSize(const CefSize& size) { @@ -193,8 +183,7 @@ void CefLabelButtonCToCpp::SetMinimumSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_minimum_size(_struct, - &size); + _struct->set_minimum_size(_struct, &size); } void CefLabelButtonCToCpp::SetMaximumSize(const CefSize& size) { @@ -205,8 +194,7 @@ void CefLabelButtonCToCpp::SetMaximumSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_maximum_size(_struct, - &size); + _struct->set_maximum_size(_struct, &size); } CefRefPtr CefLabelButtonCToCpp::AsLabelButton() { @@ -231,8 +219,7 @@ void CefLabelButtonCToCpp::SetState(cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_state(_struct, - state); + _struct->set_state(_struct, state); } cef_button_state_t CefLabelButtonCToCpp::GetState() { @@ -257,8 +244,7 @@ void CefLabelButtonCToCpp::SetInkDropEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_ink_drop_enabled(_struct, - enabled); + _struct->set_ink_drop_enabled(_struct, enabled); } void CefLabelButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { @@ -274,8 +260,7 @@ void CefLabelButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { return; // Execute - _struct->set_tooltip_text(_struct, - tooltip_text.GetStruct()); + _struct->set_tooltip_text(_struct, tooltip_text.GetStruct()); } void CefLabelButtonCToCpp::SetAccessibleName(const CefString& name) { @@ -291,8 +276,7 @@ void CefLabelButtonCToCpp::SetAccessibleName(const CefString& name) { return; // Execute - _struct->set_accessible_name(_struct, - name.GetStruct()); + _struct->set_accessible_name(_struct, name.GetStruct()); } CefRefPtr CefLabelButtonCToCpp::AsBrowserView() { @@ -389,8 +373,7 @@ CefString CefLabelButtonCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -409,7 +392,7 @@ bool CefLabelButtonCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::IsAttached() { @@ -423,7 +406,7 @@ bool CefLabelButtonCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::IsSame(CefRefPtr that) { @@ -439,11 +422,10 @@ bool CefLabelButtonCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefLabelButtonCToCpp::GetDelegate() { @@ -496,8 +478,7 @@ void CefLabelButtonCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefLabelButtonCToCpp::GetGroupID() { @@ -522,8 +503,7 @@ void CefLabelButtonCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefLabelButtonCToCpp::GetParentView() { @@ -548,8 +528,7 @@ CefRefPtr CefLabelButtonCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -563,8 +542,7 @@ void CefLabelButtonCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefLabelButtonCToCpp::GetBounds() { @@ -603,8 +581,7 @@ void CefLabelButtonCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefLabelButtonCToCpp::GetSize() { @@ -629,8 +606,7 @@ void CefLabelButtonCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefLabelButtonCToCpp::GetPosition() { @@ -708,8 +684,7 @@ int CefLabelButtonCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -734,8 +709,7 @@ void CefLabelButtonCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefLabelButtonCToCpp::IsVisible() { @@ -749,7 +723,7 @@ bool CefLabelButtonCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::IsDrawn() { @@ -763,7 +737,7 @@ bool CefLabelButtonCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefLabelButtonCToCpp::SetEnabled(bool enabled) { @@ -774,8 +748,7 @@ void CefLabelButtonCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefLabelButtonCToCpp::IsEnabled() { @@ -789,7 +762,7 @@ bool CefLabelButtonCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefLabelButtonCToCpp::SetFocusable(bool focusable) { @@ -800,8 +773,7 @@ void CefLabelButtonCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefLabelButtonCToCpp::IsFocusable() { @@ -815,7 +787,7 @@ bool CefLabelButtonCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::IsAccessibilityFocusable() { @@ -829,7 +801,7 @@ bool CefLabelButtonCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefLabelButtonCToCpp::RequestFocus() { @@ -851,8 +823,7 @@ void CefLabelButtonCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefLabelButtonCToCpp::GetBackgroundColor() { @@ -877,11 +848,10 @@ bool CefLabelButtonCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -892,11 +862,10 @@ bool CefLabelButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -907,11 +876,10 @@ bool CefLabelButtonCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -922,15 +890,14 @@ bool CefLabelButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -943,16 +910,15 @@ bool CefLabelButtonCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefLabelButtonCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -965,35 +931,38 @@ bool CefLabelButtonCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefLabelButtonCToCpp::CefLabelButtonCToCpp() { -} +CefLabelButtonCToCpp::CefLabelButtonCToCpp() {} -template<> cef_label_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefLabelButton* c) { +template <> +cef_label_button_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefLabelButton* c) { if (type == WT_MENU_BUTTON) { - return reinterpret_cast(CefMenuButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefMenuButtonCToCpp::Unwrap(reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LABEL_BUTTON; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_LABEL_BUTTON; diff --git a/libcef_dll/ctocpp/views/label_button_ctocpp.h b/libcef_dll/ctocpp/views/label_button_ctocpp.h index ff5c3c874..711290d03 100644 --- a/libcef_dll/ctocpp/views/label_button_ctocpp.h +++ b/libcef_dll/ctocpp/views/label_button_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ce64517474af4fd801c702c68d9e6acbb38cdea7$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LABEL_BUTTON_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_LABEL_BUTTON_CTOCPP_H_ @@ -18,17 +20,17 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_label_button.h" #include "include/capi/views/cef_label_button_capi.h" -#include "include/views/cef_menu_button.h" #include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_label_button.h" +#include "include/views/cef_menu_button.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefLabelButtonCToCpp - : public CefCToCppRefCounted { +class CefLabelButtonCToCpp : public CefCToCppRefCounted { public: CefLabelButtonCToCpp(); @@ -37,7 +39,7 @@ class CefLabelButtonCToCpp void SetText(const CefString& text) OVERRIDE; CefString GetText() OVERRIDE; void SetImage(cef_button_state_t button_state, - CefRefPtr image) OVERRIDE; + CefRefPtr image) OVERRIDE; CefRefPtr GetImage(cef_button_state_t button_state) OVERRIDE; void SetTextColor(cef_button_state_t for_state, cef_color_t color) OVERRIDE; void SetEnabledTextColors(cef_color_t color) OVERRIDE; diff --git a/libcef_dll/ctocpp/views/layout_ctocpp.cc b/libcef_dll/ctocpp/views/layout_ctocpp.cc index 0cba620d6..ae97864bf 100644 --- a/libcef_dll/ctocpp/views/layout_ctocpp.cc +++ b/libcef_dll/ctocpp/views/layout_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a519fd1a0f098ffbcfc309721e5b388a5e3b81d9$ +// #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/layout_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefLayoutCToCpp::AsBoxLayout() { @@ -56,33 +57,37 @@ bool CefLayoutCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefLayoutCToCpp::CefLayoutCToCpp() { -} +CefLayoutCToCpp::CefLayoutCToCpp() {} -template<> cef_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefLayout* c) { +template <> +cef_layout_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefLayout* c) { if (type == WT_BOX_LAYOUT) { - return reinterpret_cast(CefBoxLayoutCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefBoxLayoutCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_FILL_LAYOUT) { - return reinterpret_cast(CefFillLayoutCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefFillLayoutCToCpp::Unwrap(reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LAYOUT; +template <> +CefWrapperType CefCToCppRefCounted:: + kWrapperType = WT_LAYOUT; diff --git a/libcef_dll/ctocpp/views/layout_ctocpp.h b/libcef_dll/ctocpp/views/layout_ctocpp.h index ed873d595..db39d1573 100644 --- a/libcef_dll/ctocpp/views/layout_ctocpp.h +++ b/libcef_dll/ctocpp/views/layout_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d40a6c56132bb4691591a17c6c55efa2d831a3d3$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LAYOUT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_LAYOUT_CTOCPP_H_ @@ -18,12 +20,12 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_layout.h" +#include "include/capi/views/cef_box_layout_capi.h" +#include "include/capi/views/cef_fill_layout_capi.h" #include "include/capi/views/cef_layout_capi.h" #include "include/views/cef_box_layout.h" -#include "include/capi/views/cef_box_layout_capi.h" #include "include/views/cef_fill_layout.h" -#include "include/capi/views/cef_fill_layout_capi.h" +#include "include/views/cef_layout.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/menu_button_ctocpp.cc b/libcef_dll/ctocpp/views/menu_button_ctocpp.cc index 406847627..764863d92 100644 --- a/libcef_dll/ctocpp/views/menu_button_ctocpp.cc +++ b/libcef_dll/ctocpp/views/menu_button_ctocpp.cc @@ -9,27 +9,30 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=bdbe24f084050955892d6d78dcb36c0eccddbe6d$ +// #include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" +#include "libcef_dll/ctocpp/image_ctocpp.h" +#include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" -#include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/views/label_button_ctocpp.h" #include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" -#include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/views/panel_ctocpp.h" #include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" #include "libcef_dll/ctocpp/views/textfield_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefMenuButton::CreateMenuButton( - CefRefPtr delegate, const CefString& text, - bool with_frame, bool with_menu_marker) { + CefRefPtr delegate, + const CefString& text, + bool with_frame, + bool with_menu_marker) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: delegate; type: refptr_diff @@ -39,22 +42,19 @@ CefRefPtr CefMenuButton::CreateMenuButton( // Unverified params: text // Execute - cef_menu_button_t* _retval = cef_menu_button_create( - CefMenuButtonDelegateCppToC::Wrap(delegate), - text.GetStruct(), - with_frame, - with_menu_marker); + cef_menu_button_t* _retval = + cef_menu_button_create(CefMenuButtonDelegateCppToC::Wrap(delegate), + text.GetStruct(), with_frame, with_menu_marker); // Return type: refptr_same return CefMenuButtonCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefMenuButtonCToCpp::ShowMenu(CefRefPtr menu_model, - const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) { + const CefPoint& screen_point, + cef_menu_anchor_position_t anchor_position) { cef_menu_button_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, show_menu)) return; @@ -67,10 +67,8 @@ void CefMenuButtonCToCpp::ShowMenu(CefRefPtr menu_model, return; // Execute - _struct->show_menu(_struct, - CefMenuModelCToCpp::Unwrap(menu_model), - &screen_point, - anchor_position); + _struct->show_menu(_struct, CefMenuModelCToCpp::Unwrap(menu_model), + &screen_point, anchor_position); } void CefMenuButtonCToCpp::TriggerMenu() { @@ -85,8 +83,8 @@ void CefMenuButtonCToCpp::TriggerMenu() { } CefRefPtr CefMenuButtonCToCpp::AsMenuButton() { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, as_menu_button)) return NULL; @@ -100,8 +98,8 @@ CefRefPtr CefMenuButtonCToCpp::AsMenuButton() { } void CefMenuButtonCToCpp::SetText(const CefString& text) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_text)) return; @@ -113,13 +111,12 @@ void CefMenuButtonCToCpp::SetText(const CefString& text) { return; // Execute - _struct->set_text(_struct, - text.GetStruct()); + _struct->set_text(_struct, text.GetStruct()); } CefString CefMenuButtonCToCpp::GetText() { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_text)) return CefString(); @@ -135,9 +132,9 @@ CefString CefMenuButtonCToCpp::GetText() { } void CefMenuButtonCToCpp::SetImage(cef_button_state_t button_state, - CefRefPtr image) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + CefRefPtr image) { + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_image)) return; @@ -146,59 +143,53 @@ void CefMenuButtonCToCpp::SetImage(cef_button_state_t button_state, // Unverified params: image // Execute - _struct->set_image(_struct, - button_state, - CefImageCToCpp::Unwrap(image)); + _struct->set_image(_struct, button_state, CefImageCToCpp::Unwrap(image)); } CefRefPtr CefMenuButtonCToCpp::GetImage( cef_button_state_t button_state) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_image)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_image_t* _retval = _struct->get_image(_struct, - button_state); + cef_image_t* _retval = _struct->get_image(_struct, button_state); // Return type: refptr_same return CefImageCToCpp::Wrap(_retval); } void CefMenuButtonCToCpp::SetTextColor(cef_button_state_t for_state, - cef_color_t color) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_color_t color) { + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_text_color)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_text_color(_struct, - for_state, - color); + _struct->set_text_color(_struct, for_state, color); } void CefMenuButtonCToCpp::SetEnabledTextColors(cef_color_t color) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_enabled_text_colors)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled_text_colors(_struct, - color); + _struct->set_enabled_text_colors(_struct, color); } void CefMenuButtonCToCpp::SetFontList(const CefString& font_list) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_font_list)) return; @@ -210,48 +201,44 @@ void CefMenuButtonCToCpp::SetFontList(const CefString& font_list) { return; // Execute - _struct->set_font_list(_struct, - font_list.GetStruct()); + _struct->set_font_list(_struct, font_list.GetStruct()); } void CefMenuButtonCToCpp::SetHorizontalAlignment( cef_horizontal_alignment_t alignment) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_horizontal_alignment)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_horizontal_alignment(_struct, - alignment); + _struct->set_horizontal_alignment(_struct, alignment); } void CefMenuButtonCToCpp::SetMinimumSize(const CefSize& size) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_minimum_size)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_minimum_size(_struct, - &size); + _struct->set_minimum_size(_struct, &size); } void CefMenuButtonCToCpp::SetMaximumSize(const CefSize& size) { - cef_label_button_t* _struct = reinterpret_cast(GetStruct( - )); + cef_label_button_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, set_maximum_size)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_maximum_size(_struct, - &size); + _struct->set_maximum_size(_struct, &size); } CefRefPtr CefMenuButtonCToCpp::AsLabelButton() { @@ -276,8 +263,7 @@ void CefMenuButtonCToCpp::SetState(cef_button_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_state(_struct, - state); + _struct->set_state(_struct, state); } cef_button_state_t CefMenuButtonCToCpp::GetState() { @@ -302,8 +288,7 @@ void CefMenuButtonCToCpp::SetInkDropEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_ink_drop_enabled(_struct, - enabled); + _struct->set_ink_drop_enabled(_struct, enabled); } void CefMenuButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { @@ -319,8 +304,7 @@ void CefMenuButtonCToCpp::SetTooltipText(const CefString& tooltip_text) { return; // Execute - _struct->set_tooltip_text(_struct, - tooltip_text.GetStruct()); + _struct->set_tooltip_text(_struct, tooltip_text.GetStruct()); } void CefMenuButtonCToCpp::SetAccessibleName(const CefString& name) { @@ -336,8 +320,7 @@ void CefMenuButtonCToCpp::SetAccessibleName(const CefString& name) { return; // Execute - _struct->set_accessible_name(_struct, - name.GetStruct()); + _struct->set_accessible_name(_struct, name.GetStruct()); } CefRefPtr CefMenuButtonCToCpp::AsBrowserView() { @@ -434,8 +417,7 @@ CefString CefMenuButtonCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -454,7 +436,7 @@ bool CefMenuButtonCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::IsAttached() { @@ -468,7 +450,7 @@ bool CefMenuButtonCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::IsSame(CefRefPtr that) { @@ -484,11 +466,10 @@ bool CefMenuButtonCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefMenuButtonCToCpp::GetDelegate() { @@ -541,8 +522,7 @@ void CefMenuButtonCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefMenuButtonCToCpp::GetGroupID() { @@ -567,8 +547,7 @@ void CefMenuButtonCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefMenuButtonCToCpp::GetParentView() { @@ -593,8 +572,7 @@ CefRefPtr CefMenuButtonCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -608,8 +586,7 @@ void CefMenuButtonCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefMenuButtonCToCpp::GetBounds() { @@ -648,8 +625,7 @@ void CefMenuButtonCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefMenuButtonCToCpp::GetSize() { @@ -674,8 +650,7 @@ void CefMenuButtonCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefMenuButtonCToCpp::GetPosition() { @@ -753,8 +728,7 @@ int CefMenuButtonCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -779,8 +753,7 @@ void CefMenuButtonCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefMenuButtonCToCpp::IsVisible() { @@ -794,7 +767,7 @@ bool CefMenuButtonCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::IsDrawn() { @@ -808,7 +781,7 @@ bool CefMenuButtonCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefMenuButtonCToCpp::SetEnabled(bool enabled) { @@ -819,8 +792,7 @@ void CefMenuButtonCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefMenuButtonCToCpp::IsEnabled() { @@ -834,7 +806,7 @@ bool CefMenuButtonCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefMenuButtonCToCpp::SetFocusable(bool focusable) { @@ -845,8 +817,7 @@ void CefMenuButtonCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefMenuButtonCToCpp::IsFocusable() { @@ -860,7 +831,7 @@ bool CefMenuButtonCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::IsAccessibilityFocusable() { @@ -874,7 +845,7 @@ bool CefMenuButtonCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefMenuButtonCToCpp::RequestFocus() { @@ -896,8 +867,7 @@ void CefMenuButtonCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefMenuButtonCToCpp::GetBackgroundColor() { @@ -922,11 +892,10 @@ bool CefMenuButtonCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -937,11 +906,10 @@ bool CefMenuButtonCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -952,11 +920,10 @@ bool CefMenuButtonCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -967,15 +934,14 @@ bool CefMenuButtonCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -988,16 +954,15 @@ bool CefMenuButtonCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefMenuButtonCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -1010,31 +975,34 @@ bool CefMenuButtonCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefMenuButtonCToCpp::CefMenuButtonCToCpp() { -} +CefMenuButtonCToCpp::CefMenuButtonCToCpp() {} -template<> cef_menu_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefMenuButton* c) { +template <> +cef_menu_button_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefMenuButton* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_BUTTON; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_MENU_BUTTON; diff --git a/libcef_dll/ctocpp/views/menu_button_ctocpp.h b/libcef_dll/ctocpp/views/menu_button_ctocpp.h index 045de2ba3..74bec7a90 100644 --- a/libcef_dll/ctocpp/views/menu_button_ctocpp.h +++ b/libcef_dll/ctocpp/views/menu_button_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ba470a970b4e0cd7a80058ff44d604e0a082a2e9$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_CTOCPP_H_ @@ -18,22 +20,22 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_menu_button.h" #include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_menu_button.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefMenuButtonCToCpp - : public CefCToCppRefCounted { +class CefMenuButtonCToCpp : public CefCToCppRefCounted { public: CefMenuButtonCToCpp(); // CefMenuButton methods. void ShowMenu(CefRefPtr menu_model, - const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) OVERRIDE; + const CefPoint& screen_point, + cef_menu_anchor_position_t anchor_position) OVERRIDE; void TriggerMenu() OVERRIDE; // CefLabelButton methods. @@ -41,7 +43,7 @@ class CefMenuButtonCToCpp void SetText(const CefString& text) OVERRIDE; CefString GetText() OVERRIDE; void SetImage(cef_button_state_t button_state, - CefRefPtr image) OVERRIDE; + CefRefPtr image) OVERRIDE; CefRefPtr GetImage(cef_button_state_t button_state) OVERRIDE; void SetTextColor(cef_button_state_t for_state, cef_color_t color) OVERRIDE; void SetEnabledTextColors(cef_color_t color) OVERRIDE; diff --git a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc index a29127f99..64e552ac9 100644 --- a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc @@ -9,17 +9,19 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=149d24f6846b814d8207fc358bd77af7c82b037c$ +// #include "libcef_dll/cpptoc/views/button_cpptoc.h" #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefMenuButtonDelegateCToCpp::OnMenuButtonPressed( - CefRefPtr menu_button, const CefPoint& screen_point) { + CefRefPtr menu_button, + const CefPoint& screen_point) { cef_menu_button_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_menu_button_pressed)) return; @@ -32,14 +34,13 @@ void CefMenuButtonDelegateCToCpp::OnMenuButtonPressed( return; // Execute - _struct->on_menu_button_pressed(_struct, - CefMenuButtonCppToC::Wrap(menu_button), - &screen_point); + _struct->on_menu_button_pressed( + _struct, CefMenuButtonCppToC::Wrap(menu_button), &screen_point); } void CefMenuButtonDelegateCToCpp::OnButtonPressed(CefRefPtr button) { - cef_button_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_button_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_button_pressed)) return; @@ -51,14 +52,13 @@ void CefMenuButtonDelegateCToCpp::OnButtonPressed(CefRefPtr button) { return; // Execute - _struct->on_button_pressed(_struct, - CefButtonCppToC::Wrap(button)); + _struct->on_button_pressed(_struct, CefButtonCppToC::Wrap(button)); } void CefMenuButtonDelegateCToCpp::OnButtonStateChanged( CefRefPtr button) { - cef_button_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_button_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_button_state_changed)) return; @@ -70,13 +70,12 @@ void CefMenuButtonDelegateCToCpp::OnButtonStateChanged( return; // Execute - _struct->on_button_state_changed(_struct, - CefButtonCppToC::Wrap(button)); + _struct->on_button_state_changed(_struct, CefButtonCppToC::Wrap(button)); } CefSize CefMenuButtonDelegateCToCpp::GetPreferredSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -88,16 +87,16 @@ CefSize CefMenuButtonDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefMenuButtonDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -109,16 +108,16 @@ CefSize CefMenuButtonDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefMenuButtonDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -130,17 +129,17 @@ CefSize CefMenuButtonDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefMenuButtonDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -152,18 +151,19 @@ int CefMenuButtonDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } -void CefMenuButtonDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); +void CefMenuButtonDelegateCToCpp::OnParentViewChanged( + CefRefPtr view, + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -179,16 +179,15 @@ void CefMenuButtonDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefMenuButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -204,15 +203,13 @@ void CefMenuButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefMenuButtonDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -224,13 +221,12 @@ void CefMenuButtonDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -242,28 +238,33 @@ void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() { -} +CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() {} -template<> cef_menu_button_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefMenuButtonDelegate* c) { +template <> +cef_menu_button_delegate_t* CefCToCppRefCounted< + CefMenuButtonDelegateCToCpp, + CefMenuButtonDelegate, + cef_menu_button_delegate_t>::UnwrapDerived(CefWrapperType type, + CefMenuButtonDelegate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_BUTTON_DELEGATE; diff --git a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h index cd02c0e82..f8a6b8e19 100644 --- a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=71ef57288d2a5fc3a22b1f22385ac43303f37256$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_ @@ -18,23 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_menu_button_delegate.h" +#include "include/capi/views/cef_menu_button_capi.h" #include "include/capi/views/cef_menu_button_delegate_capi.h" #include "include/views/cef_menu_button.h" -#include "include/capi/views/cef_menu_button_capi.h" +#include "include/views/cef_menu_button_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefMenuButtonDelegateCToCpp : public CefCToCppRefCounted { + CefMenuButtonDelegate, + cef_menu_button_delegate_t> { public: CefMenuButtonDelegateCToCpp(); // CefMenuButtonDelegate methods. void OnMenuButtonPressed(CefRefPtr menu_button, - const CefPoint& screen_point) override; + const CefPoint& screen_point) override; // CefButtonDelegate methods. void OnButtonPressed(CefRefPtr button) override; @@ -45,10 +48,12 @@ class CefMenuButtonDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/panel_ctocpp.cc b/libcef_dll/ctocpp/views/panel_ctocpp.cc index de2619af0..354c3042c 100644 --- a/libcef_dll/ctocpp/views/panel_ctocpp.cc +++ b/libcef_dll/ctocpp/views/panel_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2bb4549039d08672bb565effcda7826a192e266a$ +// #include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" @@ -23,7 +25,6 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefPanel::CreatePanel( @@ -33,14 +34,13 @@ CefRefPtr CefPanel::CreatePanel( // Unverified params: delegate // Execute - cef_panel_t* _retval = cef_panel_create( - CefPanelDelegateCppToC::Wrap(delegate)); + cef_panel_t* _retval = + cef_panel_create(CefPanelDelegateCppToC::Wrap(delegate)); // Return type: refptr_same return CefPanelCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefPanelCToCpp::AsWindow() { @@ -80,8 +80,7 @@ CefRefPtr CefPanelCToCpp::SetToBoxLayout( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_box_layout_t* _retval = _struct->set_to_box_layout(_struct, - &settings); + cef_box_layout_t* _retval = _struct->set_to_box_layout(_struct, &settings); // Return type: refptr_same return CefBoxLayoutCToCpp::Wrap(_retval); @@ -125,8 +124,7 @@ void CefPanelCToCpp::AddChildView(CefRefPtr view) { return; // Execute - _struct->add_child_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->add_child_view(_struct, CefViewCToCpp::Unwrap(view)); } void CefPanelCToCpp::AddChildViewAt(CefRefPtr view, int index) { @@ -146,9 +144,7 @@ void CefPanelCToCpp::AddChildViewAt(CefRefPtr view, int index) { return; // Execute - _struct->add_child_view_at(_struct, - CefViewCToCpp::Unwrap(view), - index); + _struct->add_child_view_at(_struct, CefViewCToCpp::Unwrap(view), index); } void CefPanelCToCpp::ReorderChildView(CefRefPtr view, int index) { @@ -164,9 +160,7 @@ void CefPanelCToCpp::ReorderChildView(CefRefPtr view, int index) { return; // Execute - _struct->reorder_child_view(_struct, - CefViewCToCpp::Unwrap(view), - index); + _struct->reorder_child_view(_struct, CefViewCToCpp::Unwrap(view), index); } void CefPanelCToCpp::RemoveChildView(CefRefPtr view) { @@ -182,8 +176,7 @@ void CefPanelCToCpp::RemoveChildView(CefRefPtr view) { return; // Execute - _struct->remove_child_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->remove_child_view(_struct, CefViewCToCpp::Unwrap(view)); } void CefPanelCToCpp::RemoveAllChildViews() { @@ -224,8 +217,7 @@ CefRefPtr CefPanelCToCpp::GetChildViewAt(int index) { return NULL; // Execute - cef_view_t* _retval = _struct->get_child_view_at(_struct, - index); + cef_view_t* _retval = _struct->get_child_view_at(_struct, index); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -325,8 +317,7 @@ CefString CefPanelCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -345,7 +336,7 @@ bool CefPanelCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::IsAttached() { @@ -359,7 +350,7 @@ bool CefPanelCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::IsSame(CefRefPtr that) { @@ -375,11 +366,10 @@ bool CefPanelCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefPanelCToCpp::GetDelegate() { @@ -432,8 +422,7 @@ void CefPanelCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefPanelCToCpp::GetGroupID() { @@ -458,8 +447,7 @@ void CefPanelCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefPanelCToCpp::GetParentView() { @@ -484,8 +472,7 @@ CefRefPtr CefPanelCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -499,8 +486,7 @@ void CefPanelCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefPanelCToCpp::GetBounds() { @@ -539,8 +525,7 @@ void CefPanelCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefPanelCToCpp::GetSize() { @@ -565,8 +550,7 @@ void CefPanelCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefPanelCToCpp::GetPosition() { @@ -644,8 +628,7 @@ int CefPanelCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -670,8 +653,7 @@ void CefPanelCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefPanelCToCpp::IsVisible() { @@ -685,7 +667,7 @@ bool CefPanelCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::IsDrawn() { @@ -699,7 +681,7 @@ bool CefPanelCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPanelCToCpp::SetEnabled(bool enabled) { @@ -710,8 +692,7 @@ void CefPanelCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefPanelCToCpp::IsEnabled() { @@ -725,7 +706,7 @@ bool CefPanelCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPanelCToCpp::SetFocusable(bool focusable) { @@ -736,8 +717,7 @@ void CefPanelCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefPanelCToCpp::IsFocusable() { @@ -751,7 +731,7 @@ bool CefPanelCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::IsAccessibilityFocusable() { @@ -765,7 +745,7 @@ bool CefPanelCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefPanelCToCpp::RequestFocus() { @@ -787,8 +767,7 @@ void CefPanelCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefPanelCToCpp::GetBackgroundColor() { @@ -813,11 +792,10 @@ bool CefPanelCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -828,11 +806,10 @@ bool CefPanelCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -843,11 +820,10 @@ bool CefPanelCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -858,15 +834,14 @@ bool CefPanelCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -879,16 +854,15 @@ bool CefPanelCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefPanelCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -901,34 +875,37 @@ bool CefPanelCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefPanelCToCpp::CefPanelCToCpp() { -} +CefPanelCToCpp::CefPanelCToCpp() {} -template<> cef_panel_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefPanel* c) { +template <> +cef_panel_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefPanel* c) { if (type == WT_WINDOW) { - return reinterpret_cast(CefWindowCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefWindowCToCpp::Unwrap(reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PANEL; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_PANEL; diff --git a/libcef_dll/ctocpp/views/panel_ctocpp.h b/libcef_dll/ctocpp/views/panel_ctocpp.h index 30bfd1d3b..a369de895 100644 --- a/libcef_dll/ctocpp/views/panel_ctocpp.h +++ b/libcef_dll/ctocpp/views/panel_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=9d99661767ab4fdc94ea011361addc51ccc1fde3$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_CTOCPP_H_ @@ -18,16 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_panel.h" -#include "include/capi/views/cef_panel_capi.h" -#include "include/views/cef_box_layout.h" #include "include/capi/views/cef_box_layout_capi.h" -#include "include/views/cef_fill_layout.h" #include "include/capi/views/cef_fill_layout_capi.h" -#include "include/views/cef_layout.h" #include "include/capi/views/cef_layout_capi.h" -#include "include/views/cef_window.h" +#include "include/capi/views/cef_panel_capi.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_box_layout.h" +#include "include/views/cef_fill_layout.h" +#include "include/views/cef_layout.h" +#include "include/views/cef_panel.h" +#include "include/views/cef_window.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc index 4dc1e0bac..e636c7f50 100644 --- a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc @@ -9,17 +9,18 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=85c20ac96c3594ba48eeba93a5be33f53223f2ab$ +// #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefSize CefPanelDelegateCToCpp::GetPreferredSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -31,16 +32,16 @@ CefSize CefPanelDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefPanelDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -52,16 +53,16 @@ CefSize CefPanelDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefPanelDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -73,17 +74,17 @@ CefSize CefPanelDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefPanelDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -95,18 +96,18 @@ int CefPanelDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } void CefPanelDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -122,16 +123,15 @@ void CefPanelDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefPanelDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -147,15 +147,13 @@ void CefPanelDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefPanelDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -167,13 +165,12 @@ void CefPanelDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefPanelDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -185,32 +182,37 @@ void CefPanelDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefPanelDelegateCToCpp::CefPanelDelegateCToCpp() { -} +CefPanelDelegateCToCpp::CefPanelDelegateCToCpp() {} -template<> cef_panel_delegate_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefPanelDelegate* c) { +template <> +cef_panel_delegate_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefPanelDelegate* c) { if (type == WT_WINDOW_DELEGATE) { return reinterpret_cast( - CefWindowDelegateCToCpp::Unwrap(reinterpret_cast( - c))); + CefWindowDelegateCToCpp::Unwrap( + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PANEL_DELEGATE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_PANEL_DELEGATE; diff --git a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h index 021d76474..ced6e0a61 100644 --- a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=2905a9ae48b8393c7bf1751e6a5a10b763cded7d$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_panel_delegate.h" #include "include/capi/views/cef_panel_delegate_capi.h" +#include "include/views/cef_panel_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefPanelDelegateCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefPanelDelegateCToCpp(); @@ -37,10 +40,12 @@ class CefPanelDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc b/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc index f653d889b..0077ad74f 100644 --- a/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc +++ b/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1d8214a457c639f3b107c50c1da51c9bb90217db$ +// #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" @@ -19,7 +21,6 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefScrollView::CreateScrollView( @@ -29,14 +30,13 @@ CefRefPtr CefScrollView::CreateScrollView( // Unverified params: delegate // Execute - cef_scroll_view_t* _retval = cef_scroll_view_create( - CefViewDelegateCppToC::Wrap(delegate)); + cef_scroll_view_t* _retval = + cef_scroll_view_create(CefViewDelegateCppToC::Wrap(delegate)); // Return type: refptr_same return CefScrollViewCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefScrollViewCToCpp::SetContentView(CefRefPtr view) { @@ -52,8 +52,7 @@ void CefScrollViewCToCpp::SetContentView(CefRefPtr view) { return; // Execute - _struct->set_content_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->set_content_view(_struct, CefViewCToCpp::Unwrap(view)); } CefRefPtr CefScrollViewCToCpp::GetContentView() { @@ -95,7 +94,7 @@ bool CefScrollViewCToCpp::HasHorizontalScrollbar() { int _retval = _struct->has_horizontal_scrollbar(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefScrollViewCToCpp::GetHorizontalScrollbarHeight() { @@ -123,7 +122,7 @@ bool CefScrollViewCToCpp::HasVerticalScrollbar() { int _retval = _struct->has_vertical_scrollbar(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefScrollViewCToCpp::GetVerticalScrollbarWidth() { @@ -234,8 +233,7 @@ CefString CefScrollViewCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -254,7 +252,7 @@ bool CefScrollViewCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::IsAttached() { @@ -268,7 +266,7 @@ bool CefScrollViewCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::IsSame(CefRefPtr that) { @@ -284,11 +282,10 @@ bool CefScrollViewCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefScrollViewCToCpp::GetDelegate() { @@ -341,8 +338,7 @@ void CefScrollViewCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefScrollViewCToCpp::GetGroupID() { @@ -367,8 +363,7 @@ void CefScrollViewCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefScrollViewCToCpp::GetParentView() { @@ -393,8 +388,7 @@ CefRefPtr CefScrollViewCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -408,8 +402,7 @@ void CefScrollViewCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefScrollViewCToCpp::GetBounds() { @@ -448,8 +441,7 @@ void CefScrollViewCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefScrollViewCToCpp::GetSize() { @@ -474,8 +466,7 @@ void CefScrollViewCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefScrollViewCToCpp::GetPosition() { @@ -553,8 +544,7 @@ int CefScrollViewCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -579,8 +569,7 @@ void CefScrollViewCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefScrollViewCToCpp::IsVisible() { @@ -594,7 +583,7 @@ bool CefScrollViewCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::IsDrawn() { @@ -608,7 +597,7 @@ bool CefScrollViewCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefScrollViewCToCpp::SetEnabled(bool enabled) { @@ -619,8 +608,7 @@ void CefScrollViewCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefScrollViewCToCpp::IsEnabled() { @@ -634,7 +622,7 @@ bool CefScrollViewCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefScrollViewCToCpp::SetFocusable(bool focusable) { @@ -645,8 +633,7 @@ void CefScrollViewCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefScrollViewCToCpp::IsFocusable() { @@ -660,7 +647,7 @@ bool CefScrollViewCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::IsAccessibilityFocusable() { @@ -674,7 +661,7 @@ bool CefScrollViewCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefScrollViewCToCpp::RequestFocus() { @@ -696,8 +683,7 @@ void CefScrollViewCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefScrollViewCToCpp::GetBackgroundColor() { @@ -722,11 +708,10 @@ bool CefScrollViewCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -737,11 +722,10 @@ bool CefScrollViewCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -752,11 +736,10 @@ bool CefScrollViewCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -767,15 +750,14 @@ bool CefScrollViewCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -788,16 +770,15 @@ bool CefScrollViewCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefScrollViewCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -810,31 +791,34 @@ bool CefScrollViewCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefScrollViewCToCpp::CefScrollViewCToCpp() { -} +CefScrollViewCToCpp::CefScrollViewCToCpp() {} -template<> cef_scroll_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefScrollView* c) { +template <> +cef_scroll_view_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefScrollView* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SCROLL_VIEW; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_SCROLL_VIEW; diff --git a/libcef_dll/ctocpp/views/scroll_view_ctocpp.h b/libcef_dll/ctocpp/views/scroll_view_ctocpp.h index d07dacd4e..52afeff79 100644 --- a/libcef_dll/ctocpp/views/scroll_view_ctocpp.h +++ b/libcef_dll/ctocpp/views/scroll_view_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=66a00808f5796a34066e53c70fadcbff51158f03$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_SCROLL_VIEW_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_SCROLL_VIEW_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_scroll_view.h" #include "include/capi/views/cef_scroll_view_capi.h" +#include "include/views/cef_scroll_view.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefScrollViewCToCpp - : public CefCToCppRefCounted { +class CefScrollViewCToCpp : public CefCToCppRefCounted { public: CefScrollViewCToCpp(); diff --git a/libcef_dll/ctocpp/views/textfield_ctocpp.cc b/libcef_dll/ctocpp/views/textfield_ctocpp.cc index f650900b9..2dacaf6b6 100644 --- a/libcef_dll/ctocpp/views/textfield_ctocpp.cc +++ b/libcef_dll/ctocpp/views/textfield_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=5b2c763a6d31b66c7310b67d5d7424676cd9c85c$ +// #include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" @@ -20,7 +22,6 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefTextfield::CreateTextfield( @@ -30,14 +31,13 @@ CefRefPtr CefTextfield::CreateTextfield( // Unverified params: delegate // Execute - cef_textfield_t* _retval = cef_textfield_create( - CefTextfieldDelegateCppToC::Wrap(delegate)); + cef_textfield_t* _retval = + cef_textfield_create(CefTextfieldDelegateCppToC::Wrap(delegate)); // Return type: refptr_same return CefTextfieldCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefTextfieldCToCpp::SetPasswordInput(bool password_input) { @@ -48,8 +48,7 @@ void CefTextfieldCToCpp::SetPasswordInput(bool password_input) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_password_input(_struct, - password_input); + _struct->set_password_input(_struct, password_input); } bool CefTextfieldCToCpp::IsPasswordInput() { @@ -63,7 +62,7 @@ bool CefTextfieldCToCpp::IsPasswordInput() { int _retval = _struct->is_password_input(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldCToCpp::SetReadOnly(bool read_only) { @@ -74,8 +73,7 @@ void CefTextfieldCToCpp::SetReadOnly(bool read_only) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_read_only(_struct, - read_only); + _struct->set_read_only(_struct, read_only); } bool CefTextfieldCToCpp::IsReadOnly() { @@ -89,7 +87,7 @@ bool CefTextfieldCToCpp::IsReadOnly() { int _retval = _struct->is_read_only(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefTextfieldCToCpp::GetText() { @@ -121,8 +119,7 @@ void CefTextfieldCToCpp::SetText(const CefString& text) { return; // Execute - _struct->set_text(_struct, - text.GetStruct()); + _struct->set_text(_struct, text.GetStruct()); } void CefTextfieldCToCpp::AppendText(const CefString& text) { @@ -138,8 +135,7 @@ void CefTextfieldCToCpp::AppendText(const CefString& text) { return; // Execute - _struct->append_text(_struct, - text.GetStruct()); + _struct->append_text(_struct, text.GetStruct()); } void CefTextfieldCToCpp::InsertOrReplaceText(const CefString& text) { @@ -155,8 +151,7 @@ void CefTextfieldCToCpp::InsertOrReplaceText(const CefString& text) { return; // Execute - _struct->insert_or_replace_text(_struct, - text.GetStruct()); + _struct->insert_or_replace_text(_struct, text.GetStruct()); } bool CefTextfieldCToCpp::HasSelection() { @@ -170,7 +165,7 @@ bool CefTextfieldCToCpp::HasSelection() { int _retval = _struct->has_selection(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefTextfieldCToCpp::GetSelectedText() { @@ -197,8 +192,7 @@ void CefTextfieldCToCpp::SelectAll(bool reversed) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->select_all(_struct, - reversed); + _struct->select_all(_struct, reversed); } void CefTextfieldCToCpp::ClearSelection() { @@ -234,8 +228,7 @@ void CefTextfieldCToCpp::SelectRange(const CefRange& range) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->select_range(_struct, - &range); + _struct->select_range(_struct, &range); } size_t CefTextfieldCToCpp::GetCursorPosition() { @@ -260,8 +253,7 @@ void CefTextfieldCToCpp::SetTextColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_text_color(_struct, - color); + _struct->set_text_color(_struct, color); } cef_color_t CefTextfieldCToCpp::GetTextColor() { @@ -286,8 +278,7 @@ void CefTextfieldCToCpp::SetSelectionTextColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_selection_text_color(_struct, - color); + _struct->set_selection_text_color(_struct, color); } cef_color_t CefTextfieldCToCpp::GetSelectionTextColor() { @@ -312,8 +303,7 @@ void CefTextfieldCToCpp::SetSelectionBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_selection_background_color(_struct, - color); + _struct->set_selection_background_color(_struct, color); } cef_color_t CefTextfieldCToCpp::GetSelectionBackgroundColor() { @@ -343,12 +333,11 @@ void CefTextfieldCToCpp::SetFontList(const CefString& font_list) { return; // Execute - _struct->set_font_list(_struct, - font_list.GetStruct()); + _struct->set_font_list(_struct, font_list.GetStruct()); } void CefTextfieldCToCpp::ApplyTextColor(cef_color_t color, - const CefRange& range) { + const CefRange& range) { cef_textfield_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, apply_text_color)) return; @@ -356,13 +345,12 @@ void CefTextfieldCToCpp::ApplyTextColor(cef_color_t color, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->apply_text_color(_struct, - color, - &range); + _struct->apply_text_color(_struct, color, &range); } -void CefTextfieldCToCpp::ApplyTextStyle(cef_text_style_t style, bool add, - const CefRange& range) { +void CefTextfieldCToCpp::ApplyTextStyle(cef_text_style_t style, + bool add, + const CefRange& range) { cef_textfield_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, apply_text_style)) return; @@ -370,10 +358,7 @@ void CefTextfieldCToCpp::ApplyTextStyle(cef_text_style_t style, bool add, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->apply_text_style(_struct, - style, - add, - &range); + _struct->apply_text_style(_struct, style, add, &range); } bool CefTextfieldCToCpp::IsCommandEnabled(int command_id) { @@ -384,11 +369,10 @@ bool CefTextfieldCToCpp::IsCommandEnabled(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->is_command_enabled(_struct, - command_id); + int _retval = _struct->is_command_enabled(_struct, command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldCToCpp::ExecuteCommand(int command_id) { @@ -399,8 +383,7 @@ void CefTextfieldCToCpp::ExecuteCommand(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->execute_command(_struct, - command_id); + _struct->execute_command(_struct, command_id); } void CefTextfieldCToCpp::ClearEditHistory() { @@ -427,8 +410,7 @@ void CefTextfieldCToCpp::SetPlaceholderText(const CefString& text) { return; // Execute - _struct->set_placeholder_text(_struct, - text.GetStruct()); + _struct->set_placeholder_text(_struct, text.GetStruct()); } CefString CefTextfieldCToCpp::GetPlaceholderText() { @@ -455,8 +437,7 @@ void CefTextfieldCToCpp::SetPlaceholderTextColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_placeholder_text_color(_struct, - color); + _struct->set_placeholder_text_color(_struct, color); } void CefTextfieldCToCpp::SetAccessibleName(const CefString& name) { @@ -472,8 +453,7 @@ void CefTextfieldCToCpp::SetAccessibleName(const CefString& name) { return; // Execute - _struct->set_accessible_name(_struct, - name.GetStruct()); + _struct->set_accessible_name(_struct, name.GetStruct()); } CefRefPtr CefTextfieldCToCpp::AsBrowserView() { @@ -570,8 +550,7 @@ CefString CefTextfieldCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -590,7 +569,7 @@ bool CefTextfieldCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::IsAttached() { @@ -604,7 +583,7 @@ bool CefTextfieldCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::IsSame(CefRefPtr that) { @@ -620,11 +599,10 @@ bool CefTextfieldCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefTextfieldCToCpp::GetDelegate() { @@ -677,8 +655,7 @@ void CefTextfieldCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefTextfieldCToCpp::GetGroupID() { @@ -703,8 +680,7 @@ void CefTextfieldCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefTextfieldCToCpp::GetParentView() { @@ -729,8 +705,7 @@ CefRefPtr CefTextfieldCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -744,8 +719,7 @@ void CefTextfieldCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefTextfieldCToCpp::GetBounds() { @@ -784,8 +758,7 @@ void CefTextfieldCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefTextfieldCToCpp::GetSize() { @@ -810,8 +783,7 @@ void CefTextfieldCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefTextfieldCToCpp::GetPosition() { @@ -889,8 +861,7 @@ int CefTextfieldCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -915,8 +886,7 @@ void CefTextfieldCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefTextfieldCToCpp::IsVisible() { @@ -930,7 +900,7 @@ bool CefTextfieldCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::IsDrawn() { @@ -944,7 +914,7 @@ bool CefTextfieldCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldCToCpp::SetEnabled(bool enabled) { @@ -955,8 +925,7 @@ void CefTextfieldCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefTextfieldCToCpp::IsEnabled() { @@ -970,7 +939,7 @@ bool CefTextfieldCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldCToCpp::SetFocusable(bool focusable) { @@ -981,8 +950,7 @@ void CefTextfieldCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefTextfieldCToCpp::IsFocusable() { @@ -996,7 +964,7 @@ bool CefTextfieldCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::IsAccessibilityFocusable() { @@ -1010,7 +978,7 @@ bool CefTextfieldCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldCToCpp::RequestFocus() { @@ -1032,8 +1000,7 @@ void CefTextfieldCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefTextfieldCToCpp::GetBackgroundColor() { @@ -1058,11 +1025,10 @@ bool CefTextfieldCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -1073,11 +1039,10 @@ bool CefTextfieldCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -1088,11 +1053,10 @@ bool CefTextfieldCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -1103,15 +1067,14 @@ bool CefTextfieldCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -1124,16 +1087,15 @@ bool CefTextfieldCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefTextfieldCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -1146,31 +1108,34 @@ bool CefTextfieldCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefTextfieldCToCpp::CefTextfieldCToCpp() { -} +CefTextfieldCToCpp::CefTextfieldCToCpp() {} -template<> cef_textfield_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefTextfield* c) { +template <> +cef_textfield_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefTextfield* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TEXTFIELD; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_TEXTFIELD; diff --git a/libcef_dll/ctocpp/views/textfield_ctocpp.h b/libcef_dll/ctocpp/views/textfield_ctocpp.h index 319b44f07..ec19e3d72 100644 --- a/libcef_dll/ctocpp/views/textfield_ctocpp.h +++ b/libcef_dll/ctocpp/views/textfield_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6b2021efb395846e372f8c453bac1d5a81778ad6$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_textfield.h" #include "include/capi/views/cef_textfield_capi.h" +#include "include/views/cef_textfield.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefTextfieldCToCpp - : public CefCToCppRefCounted { +class CefTextfieldCToCpp : public CefCToCppRefCounted { public: CefTextfieldCToCpp(); @@ -54,8 +56,9 @@ class CefTextfieldCToCpp cef_color_t GetSelectionBackgroundColor() OVERRIDE; void SetFontList(const CefString& font_list) OVERRIDE; void ApplyTextColor(cef_color_t color, const CefRange& range) OVERRIDE; - void ApplyTextStyle(cef_text_style_t style, bool add, - const CefRange& range) OVERRIDE; + void ApplyTextStyle(cef_text_style_t style, + bool add, + const CefRange& range) OVERRIDE; bool IsCommandEnabled(int command_id) OVERRIDE; void ExecuteCommand(int command_id) OVERRIDE; void ClearEditHistory() OVERRIDE; diff --git a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc index 1af92a421..800b445d7 100644 --- a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc @@ -9,16 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=da5f37cac68a3759f2dc14056f25f33fb2957315$ +// #include "libcef_dll/cpptoc/views/textfield_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefTextfieldDelegateCToCpp::OnKeyEvent(CefRefPtr textfield, - const CefKeyEvent& event) { + const CefKeyEvent& event) { cef_textfield_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_key_event)) return false; @@ -31,12 +32,11 @@ bool CefTextfieldDelegateCToCpp::OnKeyEvent(CefRefPtr textfield, return false; // Execute - int _retval = _struct->on_key_event(_struct, - CefTextfieldCppToC::Wrap(textfield), - &event); + int _retval = _struct->on_key_event( + _struct, CefTextfieldCppToC::Wrap(textfield), &event); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefTextfieldDelegateCToCpp::OnAfterUserAction( @@ -53,13 +53,12 @@ void CefTextfieldDelegateCToCpp::OnAfterUserAction( return; // Execute - _struct->on_after_user_action(_struct, - CefTextfieldCppToC::Wrap(textfield)); + _struct->on_after_user_action(_struct, CefTextfieldCppToC::Wrap(textfield)); } CefSize CefTextfieldDelegateCToCpp::GetPreferredSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -71,16 +70,16 @@ CefSize CefTextfieldDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefTextfieldDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -92,16 +91,16 @@ CefSize CefTextfieldDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefTextfieldDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -113,17 +112,17 @@ CefSize CefTextfieldDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefTextfieldDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -135,18 +134,19 @@ int CefTextfieldDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } -void CefTextfieldDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); +void CefTextfieldDelegateCToCpp::OnParentViewChanged( + CefRefPtr view, + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -162,16 +162,15 @@ void CefTextfieldDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefTextfieldDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -187,15 +186,13 @@ void CefTextfieldDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefTextfieldDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -207,13 +204,12 @@ void CefTextfieldDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefTextfieldDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -225,28 +221,33 @@ void CefTextfieldDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefTextfieldDelegateCToCpp::CefTextfieldDelegateCToCpp() { -} +CefTextfieldDelegateCToCpp::CefTextfieldDelegateCToCpp() {} -template<> cef_textfield_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefTextfieldDelegate* c) { +template <> +cef_textfield_delegate_t* CefCToCppRefCounted< + CefTextfieldDelegateCToCpp, + CefTextfieldDelegate, + cef_textfield_delegate_t>::UnwrapDerived(CefWrapperType type, + CefTextfieldDelegate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TEXTFIELD_DELEGATE; diff --git a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h index 4e3ac87dd..ccafd56b0 100644 --- a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=c316d6a78b4aa8715a63c2e3d754438572615c55$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_ @@ -18,23 +20,24 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_textfield_delegate.h" +#include "include/capi/views/cef_textfield_capi.h" #include "include/capi/views/cef_textfield_delegate_capi.h" #include "include/views/cef_textfield.h" -#include "include/capi/views/cef_textfield_capi.h" +#include "include/views/cef_textfield_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTextfieldDelegateCToCpp : public CefCToCppRefCounted { + CefTextfieldDelegate, + cef_textfield_delegate_t> { public: CefTextfieldDelegateCToCpp(); // CefTextfieldDelegate methods. bool OnKeyEvent(CefRefPtr textfield, - const CefKeyEvent& event) override; + const CefKeyEvent& event) override; void OnAfterUserAction(CefRefPtr textfield) override; // CefViewDelegate methods. @@ -42,10 +45,12 @@ class CefTextfieldDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/view_ctocpp.cc b/libcef_dll/ctocpp/views/view_ctocpp.cc index 392ef53c8..60125121b 100644 --- a/libcef_dll/ctocpp/views/view_ctocpp.cc +++ b/libcef_dll/ctocpp/views/view_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7d48e623cbf70be51e4809e2fd1b08341d5dd620$ +// #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" @@ -21,7 +23,6 @@ #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefViewCToCpp::AsBrowserView() { @@ -118,8 +119,7 @@ CefString CefViewCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -138,7 +138,7 @@ bool CefViewCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::IsAttached() { @@ -152,7 +152,7 @@ bool CefViewCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::IsSame(CefRefPtr that) { @@ -168,11 +168,10 @@ bool CefViewCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefViewCToCpp::GetDelegate() { @@ -225,8 +224,7 @@ void CefViewCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefViewCToCpp::GetGroupID() { @@ -251,8 +249,7 @@ void CefViewCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefViewCToCpp::GetParentView() { @@ -277,8 +274,7 @@ CefRefPtr CefViewCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -292,8 +288,7 @@ void CefViewCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefViewCToCpp::GetBounds() { @@ -332,8 +327,7 @@ void CefViewCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefViewCToCpp::GetSize() { @@ -358,8 +352,7 @@ void CefViewCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefViewCToCpp::GetPosition() { @@ -437,8 +430,7 @@ int CefViewCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -463,8 +455,7 @@ void CefViewCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefViewCToCpp::IsVisible() { @@ -478,7 +469,7 @@ bool CefViewCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::IsDrawn() { @@ -492,7 +483,7 @@ bool CefViewCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefViewCToCpp::SetEnabled(bool enabled) { @@ -503,8 +494,7 @@ void CefViewCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefViewCToCpp::IsEnabled() { @@ -518,7 +508,7 @@ bool CefViewCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefViewCToCpp::SetFocusable(bool focusable) { @@ -529,8 +519,7 @@ void CefViewCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefViewCToCpp::IsFocusable() { @@ -544,7 +533,7 @@ bool CefViewCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::IsAccessibilityFocusable() { @@ -558,7 +547,7 @@ bool CefViewCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefViewCToCpp::RequestFocus() { @@ -580,8 +569,7 @@ void CefViewCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefViewCToCpp::GetBackgroundColor() { @@ -606,11 +594,10 @@ bool CefViewCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -621,11 +608,10 @@ bool CefViewCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -636,11 +622,10 @@ bool CefViewCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -651,15 +636,14 @@ bool CefViewCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -672,16 +656,15 @@ bool CefViewCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefViewCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -694,62 +677,65 @@ bool CefViewCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefViewCToCpp::CefViewCToCpp() { -} +CefViewCToCpp::CefViewCToCpp() {} -template<> cef_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefView* c) { +template <> +cef_view_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefView* c) { if (type == WT_BROWSER_VIEW) { - return reinterpret_cast(CefBrowserViewCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefBrowserViewCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_BUTTON) { - return reinterpret_cast(CefButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefButtonCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_LABEL_BUTTON) { - return reinterpret_cast(CefLabelButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefLabelButtonCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_MENU_BUTTON) { - return reinterpret_cast(CefMenuButtonCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefMenuButtonCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_PANEL) { - return reinterpret_cast(CefPanelCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefPanelCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_SCROLL_VIEW) { - return reinterpret_cast(CefScrollViewCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefScrollViewCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_TEXTFIELD) { - return reinterpret_cast(CefTextfieldCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefTextfieldCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_WINDOW) { - return reinterpret_cast(CefWindowCToCpp::Unwrap( - reinterpret_cast(c))); + return reinterpret_cast( + CefWindowCToCpp::Unwrap(reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VIEW; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_VIEW; diff --git a/libcef_dll/ctocpp/views/view_ctocpp.h b/libcef_dll/ctocpp/views/view_ctocpp.h index 9893cdd4d..938f66bfd 100644 --- a/libcef_dll/ctocpp/views/view_ctocpp.h +++ b/libcef_dll/ctocpp/views/view_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=8a0511296741305bd92e37397a1587afc35565c2$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_CTOCPP_H_ @@ -18,20 +20,20 @@ #error This file can be included wrapper-side only #endif -#include "include/views/cef_view.h" -#include "include/capi/views/cef_view_capi.h" -#include "include/views/cef_browser_view.h" #include "include/capi/views/cef_browser_view_capi.h" -#include "include/views/cef_button.h" #include "include/capi/views/cef_button_capi.h" -#include "include/views/cef_panel.h" #include "include/capi/views/cef_panel_capi.h" -#include "include/views/cef_scroll_view.h" #include "include/capi/views/cef_scroll_view_capi.h" -#include "include/views/cef_textfield.h" #include "include/capi/views/cef_textfield_capi.h" -#include "include/views/cef_window.h" +#include "include/capi/views/cef_view_capi.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_browser_view.h" +#include "include/views/cef_button.h" +#include "include/views/cef_panel.h" +#include "include/views/cef_scroll_view.h" +#include "include/views/cef_textfield.h" +#include "include/views/cef_view.h" +#include "include/views/cef_window.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. diff --git a/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc index a08a33824..2a932cde2 100644 --- a/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=89d54d92898217240204511d1f90da18890f04ee$ +// #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" @@ -19,7 +21,6 @@ #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefSize CefViewDelegateCToCpp::GetPreferredSize(CefRefPtr view) { @@ -35,8 +36,8 @@ CefSize CefViewDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; @@ -55,8 +56,8 @@ CefSize CefViewDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; @@ -75,15 +76,15 @@ CefSize CefViewDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefViewDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { + int width) { cef_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -96,16 +97,16 @@ int CefViewDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } void CefViewDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { + bool added, + CefRefPtr parent) { cef_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -122,14 +123,13 @@ void CefViewDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { + bool added, + CefRefPtr child) { cef_view_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -146,10 +146,8 @@ void CefViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefViewDelegateCToCpp::OnFocus(CefRefPtr view) { @@ -165,8 +163,7 @@ void CefViewDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefViewDelegateCToCpp::OnBlur(CefRefPtr view) { @@ -182,57 +179,61 @@ void CefViewDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefViewDelegateCToCpp::CefViewDelegateCToCpp() { -} +CefViewDelegateCToCpp::CefViewDelegateCToCpp() {} -template<> cef_view_delegate_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefViewDelegate* c) { +template <> +cef_view_delegate_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefViewDelegate* c) { if (type == WT_BROWSER_VIEW_DELEGATE) { return reinterpret_cast( CefBrowserViewDelegateCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } if (type == WT_BUTTON_DELEGATE) { return reinterpret_cast( - CefButtonDelegateCToCpp::Unwrap(reinterpret_cast( - c))); + CefButtonDelegateCToCpp::Unwrap( + reinterpret_cast(c))); } if (type == WT_MENU_BUTTON_DELEGATE) { return reinterpret_cast( CefMenuButtonDelegateCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } if (type == WT_PANEL_DELEGATE) { return reinterpret_cast( - CefPanelDelegateCToCpp::Unwrap(reinterpret_cast( - c))); + CefPanelDelegateCToCpp::Unwrap(reinterpret_cast(c))); } if (type == WT_TEXTFIELD_DELEGATE) { return reinterpret_cast( CefTextfieldDelegateCToCpp::Unwrap( - reinterpret_cast(c))); + reinterpret_cast(c))); } if (type == WT_WINDOW_DELEGATE) { return reinterpret_cast( - CefWindowDelegateCToCpp::Unwrap(reinterpret_cast( - c))); + CefWindowDelegateCToCpp::Unwrap( + reinterpret_cast(c))); } NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VIEW_DELEGATE; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_VIEW_DELEGATE; diff --git a/libcef_dll/ctocpp/views/view_delegate_ctocpp.h b/libcef_dll/ctocpp/views/view_delegate_ctocpp.h index ca491606f..0f485c136 100644 --- a/libcef_dll/ctocpp/views/view_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/view_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=53be4f879079c7799cd42536e7e16e9b9d7a81a8$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_ @@ -18,17 +20,17 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_view_delegate.h" +#include "include/capi/views/cef_view_capi.h" #include "include/capi/views/cef_view_delegate_capi.h" #include "include/views/cef_view.h" -#include "include/capi/views/cef_view_capi.h" +#include "include/views/cef_view_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefViewDelegateCToCpp - : public CefCToCppRefCounted { +class CefViewDelegateCToCpp : public CefCToCppRefCounted { public: CefViewDelegateCToCpp(); @@ -37,10 +39,12 @@ class CefViewDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/views/window_ctocpp.cc b/libcef_dll/ctocpp/views/window_ctocpp.cc index 80967ccf4..23b5219d0 100644 --- a/libcef_dll/ctocpp/views/window_ctocpp.cc +++ b/libcef_dll/ctocpp/views/window_ctocpp.cc @@ -9,24 +9,25 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=89793d32af95e19caecc99078e0465e2b467ee6a$ +// #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" +#include "libcef_dll/ctocpp/image_ctocpp.h" +#include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" #include "libcef_dll/ctocpp/views/button_ctocpp.h" #include "libcef_dll/ctocpp/views/display_ctocpp.h" #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" -#include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/views/layout_ctocpp.h" -#include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/views/panel_ctocpp.h" #include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" #include "libcef_dll/ctocpp/views/textfield_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" #include "libcef_dll/ctocpp/views/window_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefWindow::CreateTopLevelWindow( @@ -36,14 +37,13 @@ CefRefPtr CefWindow::CreateTopLevelWindow( // Unverified params: delegate // Execute - cef_window_t* _retval = cef_window_create_top_level( - CefWindowDelegateCppToC::Wrap(delegate)); + cef_window_t* _retval = + cef_window_create_top_level(CefWindowDelegateCppToC::Wrap(delegate)); // Return type: refptr_same return CefWindowCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefWindowCToCpp::Show() { @@ -76,8 +76,7 @@ void CefWindowCToCpp::CenterWindow(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->center_window(_struct, - &size); + _struct->center_window(_struct, &size); } void CefWindowCToCpp::Close() { @@ -102,7 +101,7 @@ bool CefWindowCToCpp::IsClosed() { int _retval = _struct->is_closed(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::Activate() { @@ -138,7 +137,7 @@ bool CefWindowCToCpp::IsActive() { int _retval = _struct->is_active(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::BringToTop() { @@ -160,8 +159,7 @@ void CefWindowCToCpp::SetAlwaysOnTop(bool on_top) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_always_on_top(_struct, - on_top); + _struct->set_always_on_top(_struct, on_top); } bool CefWindowCToCpp::IsAlwaysOnTop() { @@ -175,7 +173,7 @@ bool CefWindowCToCpp::IsAlwaysOnTop() { int _retval = _struct->is_always_on_top(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::Maximize() { @@ -219,8 +217,7 @@ void CefWindowCToCpp::SetFullscreen(bool fullscreen) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_fullscreen(_struct, - fullscreen); + _struct->set_fullscreen(_struct, fullscreen); } bool CefWindowCToCpp::IsMaximized() { @@ -234,7 +231,7 @@ bool CefWindowCToCpp::IsMaximized() { int _retval = _struct->is_maximized(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsMinimized() { @@ -248,7 +245,7 @@ bool CefWindowCToCpp::IsMinimized() { int _retval = _struct->is_minimized(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsFullscreen() { @@ -262,7 +259,7 @@ bool CefWindowCToCpp::IsFullscreen() { int _retval = _struct->is_fullscreen(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::SetTitle(const CefString& title) { @@ -275,8 +272,7 @@ void CefWindowCToCpp::SetTitle(const CefString& title) { // Unverified params: title // Execute - _struct->set_title(_struct, - title.GetStruct()); + _struct->set_title(_struct, title.GetStruct()); } CefString CefWindowCToCpp::GetTitle() { @@ -308,8 +304,7 @@ void CefWindowCToCpp::SetWindowIcon(CefRefPtr image) { return; // Execute - _struct->set_window_icon(_struct, - CefImageCToCpp::Unwrap(image)); + _struct->set_window_icon(_struct, CefImageCToCpp::Unwrap(image)); } CefRefPtr CefWindowCToCpp::GetWindowIcon() { @@ -339,8 +334,7 @@ void CefWindowCToCpp::SetWindowAppIcon(CefRefPtr image) { return; // Execute - _struct->set_window_app_icon(_struct, - CefImageCToCpp::Unwrap(image)); + _struct->set_window_app_icon(_struct, CefImageCToCpp::Unwrap(image)); } CefRefPtr CefWindowCToCpp::GetWindowAppIcon() { @@ -358,8 +352,8 @@ CefRefPtr CefWindowCToCpp::GetWindowAppIcon() { } void CefWindowCToCpp::ShowMenu(CefRefPtr menu_model, - const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) { + const CefPoint& screen_point, + cef_menu_anchor_position_t anchor_position) { cef_window_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, show_menu)) return; @@ -372,10 +366,8 @@ void CefWindowCToCpp::ShowMenu(CefRefPtr menu_model, return; // Execute - _struct->show_menu(_struct, - CefMenuModelCToCpp::Unwrap(menu_model), - &screen_point, - anchor_position); + _struct->show_menu(_struct, CefMenuModelCToCpp::Unwrap(menu_model), + &screen_point, anchor_position); } void CefWindowCToCpp::CancelMenu() { @@ -441,13 +433,11 @@ void CefWindowCToCpp::SetDraggableRegions( } // Execute - _struct->set_draggable_regions(_struct, - regionsCount, - regionsList); + _struct->set_draggable_regions(_struct, regionsCount, regionsList); // Restore param:regions; type: simple_vec_byref_const if (regionsList) - delete [] regionsList; + delete[] regionsList; } CefWindowHandle CefWindowCToCpp::GetWindowHandle() { @@ -472,9 +462,7 @@ void CefWindowCToCpp::SendKeyPress(int key_code, uint32 event_flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_key_press(_struct, - key_code, - event_flags); + _struct->send_key_press(_struct, key_code, event_flags); } void CefWindowCToCpp::SendMouseMove(int screen_x, int screen_y) { @@ -485,13 +473,12 @@ void CefWindowCToCpp::SendMouseMove(int screen_x, int screen_y) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_mouse_move(_struct, - screen_x, - screen_y); + _struct->send_mouse_move(_struct, screen_x, screen_y); } void CefWindowCToCpp::SendMouseEvents(cef_mouse_button_type_t button, - bool mouse_down, bool mouse_up) { + bool mouse_down, + bool mouse_up) { cef_window_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, send_mouse_events)) return; @@ -499,14 +486,14 @@ void CefWindowCToCpp::SendMouseEvents(cef_mouse_button_type_t button, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->send_mouse_events(_struct, - button, - mouse_down, - mouse_up); + _struct->send_mouse_events(_struct, button, mouse_down, mouse_up); } -void CefWindowCToCpp::SetAccelerator(int command_id, int key_code, - bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { +void CefWindowCToCpp::SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) { cef_window_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_accelerator)) return; @@ -514,12 +501,8 @@ void CefWindowCToCpp::SetAccelerator(int command_id, int key_code, // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_accelerator(_struct, - command_id, - key_code, - shift_pressed, - ctrl_pressed, - alt_pressed); + _struct->set_accelerator(_struct, command_id, key_code, shift_pressed, + ctrl_pressed, alt_pressed); } void CefWindowCToCpp::RemoveAccelerator(int command_id) { @@ -530,8 +513,7 @@ void CefWindowCToCpp::RemoveAccelerator(int command_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->remove_accelerator(_struct, - command_id); + _struct->remove_accelerator(_struct, command_id); } void CefWindowCToCpp::RemoveAllAccelerators() { @@ -582,8 +564,7 @@ CefRefPtr CefWindowCToCpp::SetToBoxLayout( // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_box_layout_t* _retval = _struct->set_to_box_layout(_struct, - &settings); + cef_box_layout_t* _retval = _struct->set_to_box_layout(_struct, &settings); // Return type: refptr_same return CefBoxLayoutCToCpp::Wrap(_retval); @@ -627,8 +608,7 @@ void CefWindowCToCpp::AddChildView(CefRefPtr view) { return; // Execute - _struct->add_child_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->add_child_view(_struct, CefViewCToCpp::Unwrap(view)); } void CefWindowCToCpp::AddChildViewAt(CefRefPtr view, int index) { @@ -648,9 +628,7 @@ void CefWindowCToCpp::AddChildViewAt(CefRefPtr view, int index) { return; // Execute - _struct->add_child_view_at(_struct, - CefViewCToCpp::Unwrap(view), - index); + _struct->add_child_view_at(_struct, CefViewCToCpp::Unwrap(view), index); } void CefWindowCToCpp::ReorderChildView(CefRefPtr view, int index) { @@ -666,9 +644,7 @@ void CefWindowCToCpp::ReorderChildView(CefRefPtr view, int index) { return; // Execute - _struct->reorder_child_view(_struct, - CefViewCToCpp::Unwrap(view), - index); + _struct->reorder_child_view(_struct, CefViewCToCpp::Unwrap(view), index); } void CefWindowCToCpp::RemoveChildView(CefRefPtr view) { @@ -684,8 +660,7 @@ void CefWindowCToCpp::RemoveChildView(CefRefPtr view) { return; // Execute - _struct->remove_child_view(_struct, - CefViewCToCpp::Unwrap(view)); + _struct->remove_child_view(_struct, CefViewCToCpp::Unwrap(view)); } void CefWindowCToCpp::RemoveAllChildViews() { @@ -726,8 +701,7 @@ CefRefPtr CefWindowCToCpp::GetChildViewAt(int index) { return NULL; // Execute - cef_view_t* _retval = _struct->get_child_view_at(_struct, - index); + cef_view_t* _retval = _struct->get_child_view_at(_struct, index); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -827,8 +801,7 @@ CefString CefWindowCToCpp::ToString(bool include_children) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->to_string(_struct, - include_children); + cef_string_userfree_t _retval = _struct->to_string(_struct, include_children); // Return type: string CefString _retvalStr; @@ -847,7 +820,7 @@ bool CefWindowCToCpp::IsValid() { int _retval = _struct->is_valid(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsAttached() { @@ -861,7 +834,7 @@ bool CefWindowCToCpp::IsAttached() { int _retval = _struct->is_attached(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsSame(CefRefPtr that) { @@ -877,11 +850,10 @@ bool CefWindowCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = _struct->is_same(_struct, - CefViewCToCpp::Unwrap(that)); + int _retval = _struct->is_same(_struct, CefViewCToCpp::Unwrap(that)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefRefPtr CefWindowCToCpp::GetDelegate() { @@ -934,8 +906,7 @@ void CefWindowCToCpp::SetID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_id(_struct, - id); + _struct->set_id(_struct, id); } int CefWindowCToCpp::GetGroupID() { @@ -960,8 +931,7 @@ void CefWindowCToCpp::SetGroupID(int group_id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_group_id(_struct, - group_id); + _struct->set_group_id(_struct, group_id); } CefRefPtr CefWindowCToCpp::GetParentView() { @@ -986,8 +956,7 @@ CefRefPtr CefWindowCToCpp::GetViewForID(int id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_view_t* _retval = _struct->get_view_for_id(_struct, - id); + cef_view_t* _retval = _struct->get_view_for_id(_struct, id); // Return type: refptr_same return CefViewCToCpp::Wrap(_retval); @@ -1001,8 +970,7 @@ void CefWindowCToCpp::SetBounds(const CefRect& bounds) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_bounds(_struct, - &bounds); + _struct->set_bounds(_struct, &bounds); } CefRect CefWindowCToCpp::GetBounds() { @@ -1041,8 +1009,7 @@ void CefWindowCToCpp::SetSize(const CefSize& size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_size(_struct, - &size); + _struct->set_size(_struct, &size); } CefSize CefWindowCToCpp::GetSize() { @@ -1067,8 +1034,7 @@ void CefWindowCToCpp::SetPosition(const CefPoint& position) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_position(_struct, - &position); + _struct->set_position(_struct, &position); } CefPoint CefWindowCToCpp::GetPosition() { @@ -1146,8 +1112,7 @@ int CefWindowCToCpp::GetHeightForWidth(int width) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->get_height_for_width(_struct, - width); + int _retval = _struct->get_height_for_width(_struct, width); // Return type: simple return _retval; @@ -1172,8 +1137,7 @@ void CefWindowCToCpp::SetVisible(bool visible) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_visible(_struct, - visible); + _struct->set_visible(_struct, visible); } bool CefWindowCToCpp::IsVisible() { @@ -1187,7 +1151,7 @@ bool CefWindowCToCpp::IsVisible() { int _retval = _struct->is_visible(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsDrawn() { @@ -1201,7 +1165,7 @@ bool CefWindowCToCpp::IsDrawn() { int _retval = _struct->is_drawn(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::SetEnabled(bool enabled) { @@ -1212,8 +1176,7 @@ void CefWindowCToCpp::SetEnabled(bool enabled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_enabled(_struct, - enabled); + _struct->set_enabled(_struct, enabled); } bool CefWindowCToCpp::IsEnabled() { @@ -1227,7 +1190,7 @@ bool CefWindowCToCpp::IsEnabled() { int _retval = _struct->is_enabled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::SetFocusable(bool focusable) { @@ -1238,8 +1201,7 @@ void CefWindowCToCpp::SetFocusable(bool focusable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_focusable(_struct, - focusable); + _struct->set_focusable(_struct, focusable); } bool CefWindowCToCpp::IsFocusable() { @@ -1253,7 +1215,7 @@ bool CefWindowCToCpp::IsFocusable() { int _retval = _struct->is_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::IsAccessibilityFocusable() { @@ -1267,7 +1229,7 @@ bool CefWindowCToCpp::IsAccessibilityFocusable() { int _retval = _struct->is_accessibility_focusable(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWindowCToCpp::RequestFocus() { @@ -1289,8 +1251,7 @@ void CefWindowCToCpp::SetBackgroundColor(cef_color_t color) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - _struct->set_background_color(_struct, - color); + _struct->set_background_color(_struct, color); } cef_color_t CefWindowCToCpp::GetBackgroundColor() { @@ -1315,11 +1276,10 @@ bool CefWindowCToCpp::ConvertPointToScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_screen(_struct, - &point); + int _retval = _struct->convert_point_to_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::ConvertPointFromScreen(CefPoint& point) { @@ -1330,11 +1290,10 @@ bool CefWindowCToCpp::ConvertPointFromScreen(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_screen(_struct, - &point); + int _retval = _struct->convert_point_from_screen(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::ConvertPointToWindow(CefPoint& point) { @@ -1345,11 +1304,10 @@ bool CefWindowCToCpp::ConvertPointToWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_to_window(_struct, - &point); + int _retval = _struct->convert_point_to_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::ConvertPointFromWindow(CefPoint& point) { @@ -1360,15 +1318,14 @@ bool CefWindowCToCpp::ConvertPointFromWindow(CefPoint& point) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->convert_point_from_window(_struct, - &point); + int _retval = _struct->convert_point_from_window(_struct, &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::ConvertPointToView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_to_view)) return false; @@ -1381,16 +1338,15 @@ bool CefWindowCToCpp::ConvertPointToView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_to_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_to_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowCToCpp::ConvertPointFromView(CefRefPtr view, - CefPoint& point) { + CefPoint& point) { cef_view_t* _struct = reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, convert_point_from_view)) return false; @@ -1403,30 +1359,33 @@ bool CefWindowCToCpp::ConvertPointFromView(CefRefPtr view, return false; // Execute - int _retval = _struct->convert_point_from_view(_struct, - CefViewCToCpp::Unwrap(view), - &point); + int _retval = _struct->convert_point_from_view( + _struct, CefViewCToCpp::Unwrap(view), &point); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefWindowCToCpp::CefWindowCToCpp() { -} +CefWindowCToCpp::CefWindowCToCpp() {} -template<> cef_window_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefWindow* c) { +template <> +cef_window_t* +CefCToCppRefCounted::UnwrapDerived( + CefWrapperType type, + CefWindow* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WINDOW; +template <> +CefWrapperType CefCToCppRefCounted:: + kWrapperType = WT_WINDOW; diff --git a/libcef_dll/ctocpp/views/window_ctocpp.h b/libcef_dll/ctocpp/views/window_ctocpp.h index f85c3ff75..0292b043e 100644 --- a/libcef_dll/ctocpp/views/window_ctocpp.h +++ b/libcef_dll/ctocpp/views/window_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=88ac661252337963a1857c77a4f103a377874b01$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_ @@ -19,8 +21,8 @@ #endif #include -#include "include/views/cef_window.h" #include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_window.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. @@ -56,8 +58,8 @@ class CefWindowCToCpp void SetWindowAppIcon(CefRefPtr image) OVERRIDE; CefRefPtr GetWindowAppIcon() OVERRIDE; void ShowMenu(CefRefPtr menu_model, - const CefPoint& screen_point, - cef_menu_anchor_position_t anchor_position) OVERRIDE; + const CefPoint& screen_point, + cef_menu_anchor_position_t anchor_position) OVERRIDE; void CancelMenu() OVERRIDE; CefRefPtr GetDisplay() OVERRIDE; CefRect GetClientAreaBoundsInScreen() OVERRIDE; @@ -66,10 +68,14 @@ class CefWindowCToCpp CefWindowHandle GetWindowHandle() OVERRIDE; void SendKeyPress(int key_code, uint32 event_flags) OVERRIDE; void SendMouseMove(int screen_x, int screen_y) OVERRIDE; - void SendMouseEvents(cef_mouse_button_type_t button, bool mouse_down, - bool mouse_up) OVERRIDE; - void SetAccelerator(int command_id, int key_code, bool shift_pressed, - bool ctrl_pressed, bool alt_pressed) OVERRIDE; + void SendMouseEvents(cef_mouse_button_type_t button, + bool mouse_down, + bool mouse_up) OVERRIDE; + void SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) OVERRIDE; void RemoveAccelerator(int command_id) OVERRIDE; void RemoveAllAccelerators() OVERRIDE; diff --git a/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc index 87250396a..b8ae60ae6 100644 --- a/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc +++ b/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc @@ -9,12 +9,13 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6427d6295c6219f21468ed99bf20e4d3eddfe83b$ +// #include "libcef_dll/cpptoc/views/view_cpptoc.h" #include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefWindowDelegateCToCpp::OnWindowCreated(CefRefPtr window) { @@ -30,8 +31,7 @@ void CefWindowDelegateCToCpp::OnWindowCreated(CefRefPtr window) { return; // Execute - _struct->on_window_created(_struct, - CefWindowCppToC::Wrap(window)); + _struct->on_window_created(_struct, CefWindowCppToC::Wrap(window)); } void CefWindowDelegateCToCpp::OnWindowDestroyed(CefRefPtr window) { @@ -47,8 +47,7 @@ void CefWindowDelegateCToCpp::OnWindowDestroyed(CefRefPtr window) { return; // Execute - _struct->on_window_destroyed(_struct, - CefWindowCppToC::Wrap(window)); + _struct->on_window_destroyed(_struct, CefWindowCppToC::Wrap(window)); } bool CefWindowDelegateCToCpp::IsFrameless(CefRefPtr window) { @@ -64,11 +63,10 @@ bool CefWindowDelegateCToCpp::IsFrameless(CefRefPtr window) { return false; // Execute - int _retval = _struct->is_frameless(_struct, - CefWindowCppToC::Wrap(window)); + int _retval = _struct->is_frameless(_struct, CefWindowCppToC::Wrap(window)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::CanResize(CefRefPtr window) { @@ -84,11 +82,10 @@ bool CefWindowDelegateCToCpp::CanResize(CefRefPtr window) { return false; // Execute - int _retval = _struct->can_resize(_struct, - CefWindowCppToC::Wrap(window)); + int _retval = _struct->can_resize(_struct, CefWindowCppToC::Wrap(window)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::CanMaximize(CefRefPtr window) { @@ -104,11 +101,10 @@ bool CefWindowDelegateCToCpp::CanMaximize(CefRefPtr window) { return false; // Execute - int _retval = _struct->can_maximize(_struct, - CefWindowCppToC::Wrap(window)); + int _retval = _struct->can_maximize(_struct, CefWindowCppToC::Wrap(window)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::CanMinimize(CefRefPtr window) { @@ -124,11 +120,10 @@ bool CefWindowDelegateCToCpp::CanMinimize(CefRefPtr window) { return false; // Execute - int _retval = _struct->can_minimize(_struct, - CefWindowCppToC::Wrap(window)); + int _retval = _struct->can_minimize(_struct, CefWindowCppToC::Wrap(window)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::CanClose(CefRefPtr window) { @@ -144,15 +139,14 @@ bool CefWindowDelegateCToCpp::CanClose(CefRefPtr window) { return false; // Execute - int _retval = _struct->can_close(_struct, - CefWindowCppToC::Wrap(window)); + int _retval = _struct->can_close(_struct, CefWindowCppToC::Wrap(window)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::OnAccelerator(CefRefPtr window, - int command_id) { + int command_id) { cef_window_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_accelerator)) return false; @@ -165,16 +159,15 @@ bool CefWindowDelegateCToCpp::OnAccelerator(CefRefPtr window, return false; // Execute - int _retval = _struct->on_accelerator(_struct, - CefWindowCppToC::Wrap(window), - command_id); + int _retval = _struct->on_accelerator(_struct, CefWindowCppToC::Wrap(window), + command_id); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefWindowDelegateCToCpp::OnKeyEvent(CefRefPtr window, - const CefKeyEvent& event) { + const CefKeyEvent& event) { cef_window_delegate_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, on_key_event)) return false; @@ -187,17 +180,16 @@ bool CefWindowDelegateCToCpp::OnKeyEvent(CefRefPtr window, return false; // Execute - int _retval = _struct->on_key_event(_struct, - CefWindowCppToC::Wrap(window), - &event); + int _retval = + _struct->on_key_event(_struct, CefWindowCppToC::Wrap(window), &event); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefSize CefWindowDelegateCToCpp::GetPreferredSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_preferred_size)) return CefSize(); @@ -209,16 +201,16 @@ CefSize CefWindowDelegateCToCpp::GetPreferredSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_preferred_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefWindowDelegateCToCpp::GetMinimumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_minimum_size)) return CefSize(); @@ -230,16 +222,16 @@ CefSize CefWindowDelegateCToCpp::GetMinimumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_minimum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } CefSize CefWindowDelegateCToCpp::GetMaximumSize(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_maximum_size)) return CefSize(); @@ -251,17 +243,17 @@ CefSize CefWindowDelegateCToCpp::GetMaximumSize(CefRefPtr view) { return CefSize(); // Execute - cef_size_t _retval = _struct->get_maximum_size(_struct, - CefViewCppToC::Wrap(view)); + cef_size_t _retval = + _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view)); // Return type: simple return _retval; } int CefWindowDelegateCToCpp::GetHeightForWidth(CefRefPtr view, - int width) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + int width) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, get_height_for_width)) return 0; @@ -273,18 +265,18 @@ int CefWindowDelegateCToCpp::GetHeightForWidth(CefRefPtr view, return 0; // Execute - int _retval = _struct->get_height_for_width(_struct, - CefViewCppToC::Wrap(view), - width); + int _retval = + _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width); // Return type: simple return _retval; } void CefWindowDelegateCToCpp::OnParentViewChanged(CefRefPtr view, - bool added, CefRefPtr parent) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr parent) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed)) return; @@ -300,16 +292,15 @@ void CefWindowDelegateCToCpp::OnParentViewChanged(CefRefPtr view, return; // Execute - _struct->on_parent_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(parent)); + _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(parent)); } void CefWindowDelegateCToCpp::OnChildViewChanged(CefRefPtr view, - bool added, CefRefPtr child) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + bool added, + CefRefPtr child) { + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_child_view_changed)) return; @@ -325,15 +316,13 @@ void CefWindowDelegateCToCpp::OnChildViewChanged(CefRefPtr view, return; // Execute - _struct->on_child_view_changed(_struct, - CefViewCppToC::Wrap(view), - added, - CefViewCppToC::Wrap(child)); + _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added, + CefViewCppToC::Wrap(child)); } void CefWindowDelegateCToCpp::OnFocus(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_focus)) return; @@ -345,13 +334,12 @@ void CefWindowDelegateCToCpp::OnFocus(CefRefPtr view) { return; // Execute - _struct->on_focus(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_focus(_struct, CefViewCppToC::Wrap(view)); } void CefWindowDelegateCToCpp::OnBlur(CefRefPtr view) { - cef_view_delegate_t* _struct = reinterpret_cast( - GetStruct()); + cef_view_delegate_t* _struct = + reinterpret_cast(GetStruct()); if (CEF_MEMBER_MISSING(_struct, on_blur)) return; @@ -363,28 +351,32 @@ void CefWindowDelegateCToCpp::OnBlur(CefRefPtr view) { return; // Execute - _struct->on_blur(_struct, - CefViewCppToC::Wrap(view)); + _struct->on_blur(_struct, CefViewCppToC::Wrap(view)); } - // CONSTRUCTOR - Do not edit by hand. -CefWindowDelegateCToCpp::CefWindowDelegateCToCpp() { -} +CefWindowDelegateCToCpp::CefWindowDelegateCToCpp() {} -template<> cef_window_delegate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefWindowDelegate* c) { +template <> +cef_window_delegate_t* CefCToCppRefCounted< + CefWindowDelegateCToCpp, + CefWindowDelegate, + cef_window_delegate_t>::UnwrapDerived(CefWrapperType type, + CefWindowDelegate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WINDOW_DELEGATE; diff --git a/libcef_dll/ctocpp/views/window_delegate_ctocpp.h b/libcef_dll/ctocpp/views/window_delegate_ctocpp.h index 980e7f38a..84e2c340d 100644 --- a/libcef_dll/ctocpp/views/window_delegate_ctocpp.h +++ b/libcef_dll/ctocpp/views/window_delegate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=d6154885643d45eb81ecbd3a017776983a841651$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/views/cef_window_delegate.h" +#include "include/capi/views/cef_window_capi.h" #include "include/capi/views/cef_window_delegate_capi.h" #include "include/views/cef_window.h" -#include "include/capi/views/cef_window_capi.h" +#include "include/views/cef_window_delegate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefWindowDelegateCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefWindowDelegateCToCpp(); @@ -42,7 +45,7 @@ class CefWindowDelegateCToCpp bool CanClose(CefRefPtr window) override; bool OnAccelerator(CefRefPtr window, int command_id) override; bool OnKeyEvent(CefRefPtr window, - const CefKeyEvent& event) override; + const CefKeyEvent& event) override; // CefPanelDelegate methods. @@ -51,10 +54,12 @@ class CefWindowDelegateCToCpp CefSize GetMinimumSize(CefRefPtr view) override; CefSize GetMaximumSize(CefRefPtr view) override; int GetHeightForWidth(CefRefPtr view, int width) override; - void OnParentViewChanged(CefRefPtr view, bool added, - CefRefPtr parent) override; - void OnChildViewChanged(CefRefPtr view, bool added, - CefRefPtr child) override; + void OnParentViewChanged(CefRefPtr view, + bool added, + CefRefPtr parent) override; + void OnChildViewChanged(CefRefPtr view, + bool added, + CefRefPtr child) override; void OnFocus(CefRefPtr view) override; void OnBlur(CefRefPtr view) override; }; diff --git a/libcef_dll/ctocpp/waitable_event_ctocpp.cc b/libcef_dll/ctocpp/waitable_event_ctocpp.cc index 5677e99e2..ec2c0461a 100644 --- a/libcef_dll/ctocpp/waitable_event_ctocpp.cc +++ b/libcef_dll/ctocpp/waitable_event_ctocpp.cc @@ -9,26 +9,26 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ac1dfcde986921cadaa0086dc9206913a7ca91f3$ +// #include "libcef_dll/ctocpp/waitable_event_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefWaitableEvent::CreateWaitableEvent( - bool automatic_reset, bool initially_signaled) { + bool automatic_reset, + bool initially_signaled) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_waitable_event_t* _retval = cef_waitable_event_create( - automatic_reset, - initially_signaled); + cef_waitable_event_t* _retval = + cef_waitable_event_create(automatic_reset, initially_signaled); // Return type: refptr_same return CefWaitableEventCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. void CefWaitableEventCToCpp::Reset() { @@ -64,7 +64,7 @@ bool CefWaitableEventCToCpp::IsSignaled() { int _retval = _struct->is_signaled(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } void CefWaitableEventCToCpp::Wait() { @@ -86,30 +86,35 @@ bool CefWaitableEventCToCpp::TimedWait(int64 max_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->timed_wait(_struct, - max_ms); + int _retval = _struct->timed_wait(_struct, max_ms); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefWaitableEventCToCpp::CefWaitableEventCToCpp() { -} +CefWaitableEventCToCpp::CefWaitableEventCToCpp() {} -template<> cef_waitable_event_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefWaitableEvent* c) { +template <> +cef_waitable_event_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefWaitableEvent* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WAITABLE_EVENT; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_WAITABLE_EVENT; diff --git a/libcef_dll/ctocpp/waitable_event_ctocpp.h b/libcef_dll/ctocpp/waitable_event_ctocpp.h index 72c6d72db..07db40d3b 100644 --- a/libcef_dll/ctocpp/waitable_event_ctocpp.h +++ b/libcef_dll/ctocpp/waitable_event_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e2422d9752bd7deb320c55f0463a6d3152278a66$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_WAITABLE_EVENT_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_WAITABLE_EVENT_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_waitable_event.h" #include "include/capi/cef_waitable_event_capi.h" +#include "include/cef_waitable_event.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefWaitableEventCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefWaitableEventCToCpp(); diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc index 4b63637c9..6c5283518 100644 --- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=56d75b86aa8982feda73441e5453b85ded539f5f$ +// #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefString CefWebPluginInfoCToCpp::GetName() { @@ -79,24 +80,29 @@ CefString CefWebPluginInfoCToCpp::GetDescription() { return _retvalStr; } - // CONSTRUCTOR - Do not edit by hand. -CefWebPluginInfoCToCpp::CefWebPluginInfoCToCpp() { -} +CefWebPluginInfoCToCpp::CefWebPluginInfoCToCpp() {} -template<> cef_web_plugin_info_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefWebPluginInfo* c) { +template <> +cef_web_plugin_info_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefWebPluginInfo* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WEB_PLUGIN_INFO; diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h index d971085bb..0ce538c71 100644 --- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e4cafb79279b1f64c26625ef4b5e835771fecf94$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefWebPluginInfoCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefWebPluginInfoCToCpp(); diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc index ee10be2ec..77f99f962 100644 --- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=af1af3527892457a1c2f98673d68d1a0e96db53a$ +// #include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h" #include "libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info, - int count, int total) { + int count, + int total) { cef_web_plugin_info_visitor_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, visit)) return false; @@ -30,33 +32,38 @@ bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info, return false; // Execute - int _retval = _struct->visit(_struct, - CefWebPluginInfoCppToC::Wrap(info), - count, - total); + int _retval = + _struct->visit(_struct, CefWebPluginInfoCppToC::Wrap(info), count, total); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefWebPluginInfoVisitorCToCpp::CefWebPluginInfoVisitorCToCpp() { -} +CefWebPluginInfoVisitorCToCpp::CefWebPluginInfoVisitorCToCpp() {} -template<> cef_web_plugin_info_visitor_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefWebPluginInfoVisitor* c) { +template <> +cef_web_plugin_info_visitor_t* CefCToCppRefCounted< + CefWebPluginInfoVisitorCToCpp, + CefWebPluginInfoVisitor, + cef_web_plugin_info_visitor_t>::UnwrapDerived(CefWrapperType type, + CefWebPluginInfoVisitor* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_WEB_PLUGIN_INFO_VISITOR; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_WEB_PLUGIN_INFO_VISITOR; diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h index 83155447f..4c33d8a91 100644 --- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a589058a89323c1e870abae591d9b56810a7c679$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_VISITOR_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_VISITOR_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefWebPluginInfoVisitorCToCpp : public CefCToCppRefCounted { + CefWebPluginInfoVisitor, + cef_web_plugin_info_visitor_t> { public: CefWebPluginInfoVisitorCToCpp(); diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc index 72f285b2b..37c6c7ef4 100644 --- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc @@ -9,14 +9,15 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f44993cacfbd7d02a1eef80d0a0331734d0639f8$ +// #include "libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. void CefWebPluginUnstableCallbackCToCpp::IsUnstable(const CefString& path, - bool unstable) { + bool unstable) { cef_web_plugin_unstable_callback_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, is_unstable)) return; @@ -29,32 +30,34 @@ void CefWebPluginUnstableCallbackCToCpp::IsUnstable(const CefString& path, return; // Execute - _struct->is_unstable(_struct, - path.GetStruct(), - unstable); + _struct->is_unstable(_struct, path.GetStruct(), unstable); } - // CONSTRUCTOR - Do not edit by hand. -CefWebPluginUnstableCallbackCToCpp::CefWebPluginUnstableCallbackCToCpp() { -} +CefWebPluginUnstableCallbackCToCpp::CefWebPluginUnstableCallbackCToCpp() {} -template<> cef_web_plugin_unstable_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefWebPluginUnstableCallback* c) { +template <> +cef_web_plugin_unstable_callback_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefWebPluginUnstableCallback* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount + CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = - WT_WEB_PLUGIN_UNSTABLE_CALLBACK; +template <> +CefWrapperType + CefCToCppRefCounted::kWrapperType = + WT_WEB_PLUGIN_UNSTABLE_CALLBACK; diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h index 9addbcd30..efde93333 100644 --- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=3d750ecb7c0a286d3b9f8492d7c9620fb2b62fb8$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_UNSTABLE_CALLBACK_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_UNSTABLE_CALLBACK_CTOCPP_H_ @@ -18,17 +20,18 @@ #error This file can be included DLL-side only #endif -#include "include/cef_web_plugin.h" +#include "include/capi/cef_browser_capi.h" #include "include/capi/cef_web_plugin_capi.h" #include "include/cef_browser.h" -#include "include/capi/cef_browser_capi.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefWebPluginUnstableCallbackCToCpp : public CefCToCppRefCounted { + CefWebPluginUnstableCallback, + cef_web_plugin_unstable_callback_t> { public: CefWebPluginUnstableCallbackCToCpp(); diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc index 3669acfc8..4a6552751 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ceb1d8ea37c7815a778f7f51e68f0160ecd972ee$ +// #include "libcef_dll/ctocpp/write_handler_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { @@ -28,10 +29,7 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = _struct->write(_struct, - ptr, - size, - n); + size_t _retval = _struct->write(_struct, ptr, size, n); // Return type: simple return _retval; @@ -45,9 +43,7 @@ int CefWriteHandlerCToCpp::Seek(int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = _struct->seek(_struct, - offset, - whence); + int _retval = _struct->seek(_struct, offset, whence); // Return type: simple return _retval; @@ -92,26 +88,32 @@ bool CefWriteHandlerCToCpp::MayBlock() { int _retval = _struct->may_block(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefWriteHandlerCToCpp::CefWriteHandlerCToCpp() { -} +CefWriteHandlerCToCpp::CefWriteHandlerCToCpp() {} -template<> cef_write_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefWriteHandler* c) { +template <> +cef_write_handler_t* +CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, + CefWriteHandler* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WRITE_HANDLER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_WRITE_HANDLER; diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h index 8b2db0653..a04407e97 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.h +++ b/libcef_dll/ctocpp/write_handler_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=a9ba57e6b76a732bbb00ff249a5e06107da56b91$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included DLL-side only #endif -#include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" +#include "include/cef_stream.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. -class CefWriteHandlerCToCpp - : public CefCToCppRefCounted { +class CefWriteHandlerCToCpp : public CefCToCppRefCounted { public: CefWriteHandlerCToCpp(); diff --git a/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc b/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc index 0aab09547..df57c3680 100644 --- a/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc +++ b/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6f1cfb4286ceb605bfc6ba718d0ef1b3620bb9de$ +// #include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h" #include "libcef_dll/transfer_util.h" - // VIRTUAL METHODS - Body may be edited by hand. CefString CefX509CertPrincipalCToCpp::GetDisplayName() { @@ -111,8 +112,7 @@ void CefX509CertPrincipalCToCpp::GetStreetAddresses( transfer_string_list_contents(addresses, addressesList); // Execute - _struct->get_street_addresses(_struct, - addressesList); + _struct->get_street_addresses(_struct, addressesList); // Restore param:addresses; type: string_vec_byref if (addressesList) { @@ -137,8 +137,7 @@ void CefX509CertPrincipalCToCpp::GetOrganizationNames( transfer_string_list_contents(names, namesList); // Execute - _struct->get_organization_names(_struct, - namesList); + _struct->get_organization_names(_struct, namesList); // Restore param:names; type: string_vec_byref if (namesList) { @@ -163,8 +162,7 @@ void CefX509CertPrincipalCToCpp::GetOrganizationUnitNames( transfer_string_list_contents(names, namesList); // Execute - _struct->get_organization_unit_names(_struct, - namesList); + _struct->get_organization_unit_names(_struct, namesList); // Restore param:names; type: string_vec_byref if (namesList) { @@ -189,8 +187,7 @@ void CefX509CertPrincipalCToCpp::GetDomainComponents( transfer_string_list_contents(components, componentsList); // Execute - _struct->get_domain_components(_struct, - componentsList); + _struct->get_domain_components(_struct, componentsList); // Restore param:components; type: string_vec_byref if (componentsList) { @@ -200,24 +197,30 @@ void CefX509CertPrincipalCToCpp::GetDomainComponents( } } - // CONSTRUCTOR - Do not edit by hand. -CefX509CertPrincipalCToCpp::CefX509CertPrincipalCToCpp() { -} +CefX509CertPrincipalCToCpp::CefX509CertPrincipalCToCpp() {} -template<> cef_x509cert_principal_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefX509CertPrincipal* c) { +template <> +cef_x509cert_principal_t* CefCToCppRefCounted< + CefX509CertPrincipalCToCpp, + CefX509CertPrincipal, + cef_x509cert_principal_t>::UnwrapDerived(CefWrapperType type, + CefX509CertPrincipal* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = + 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_X509CERT_PRINCIPAL; diff --git a/libcef_dll/ctocpp/x509cert_principal_ctocpp.h b/libcef_dll/ctocpp/x509cert_principal_ctocpp.h index 4fd5c72e7..f46c52094 100644 --- a/libcef_dll/ctocpp/x509cert_principal_ctocpp.h +++ b/libcef_dll/ctocpp/x509cert_principal_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=0df26d8e3e24a565188269937ea52f88be24b4d5$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERT_PRINCIPAL_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_X509CERT_PRINCIPAL_CTOCPP_H_ @@ -19,15 +21,16 @@ #endif #include -#include "include/cef_x509_certificate.h" #include "include/capi/cef_x509_certificate_capi.h" +#include "include/cef_x509_certificate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefX509CertPrincipalCToCpp : public CefCToCppRefCounted { + CefX509CertPrincipal, + cef_x509cert_principal_t> { public: CefX509CertPrincipalCToCpp(); diff --git a/libcef_dll/ctocpp/x509certificate_ctocpp.cc b/libcef_dll/ctocpp/x509certificate_ctocpp.cc index 950007041..7267c5ffb 100644 --- a/libcef_dll/ctocpp/x509certificate_ctocpp.cc +++ b/libcef_dll/ctocpp/x509certificate_ctocpp.cc @@ -9,13 +9,14 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e6992d1ee8d86f4289cb51e155bce1990879e4db$ +// #include #include "libcef_dll/ctocpp/binary_value_ctocpp.h" #include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" - // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefX509CertificateCToCpp::GetSubject() { @@ -146,7 +147,7 @@ void CefX509CertificateCToCpp::GetDEREncodedIssuerChain( chainList = new cef_binary_value_t*[chainCount]; DCHECK(chainList); if (chainList) { - memset(chainList, 0, sizeof(cef_binary_value_t*)*chainCount); + memset(chainList, 0, sizeof(cef_binary_value_t*) * chainCount); } if (chainList && chainSize > 0) { for (size_t i = 0; i < chainSize; ++i) { @@ -156,9 +157,7 @@ void CefX509CertificateCToCpp::GetDEREncodedIssuerChain( } // Execute - _struct->get_derencoded_issuer_chain(_struct, - &chainCount, - chainList); + _struct->get_derencoded_issuer_chain(_struct, &chainCount, chainList); // Restore param:chain; type: refptr_vec_same_byref chain.clear(); @@ -166,7 +165,7 @@ void CefX509CertificateCToCpp::GetDEREncodedIssuerChain( for (size_t i = 0; i < chainCount; ++i) { chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i])); } - delete [] chainList; + delete[] chainList; } } @@ -186,7 +185,7 @@ void CefX509CertificateCToCpp::GetPEMEncodedIssuerChain( chainList = new cef_binary_value_t*[chainCount]; DCHECK(chainList); if (chainList) { - memset(chainList, 0, sizeof(cef_binary_value_t*)*chainCount); + memset(chainList, 0, sizeof(cef_binary_value_t*) * chainCount); } if (chainList && chainSize > 0) { for (size_t i = 0; i < chainSize; ++i) { @@ -196,9 +195,7 @@ void CefX509CertificateCToCpp::GetPEMEncodedIssuerChain( } // Execute - _struct->get_pemencoded_issuer_chain(_struct, - &chainCount, - chainList); + _struct->get_pemencoded_issuer_chain(_struct, &chainCount, chainList); // Restore param:chain; type: refptr_vec_same_byref chain.clear(); @@ -206,28 +203,33 @@ void CefX509CertificateCToCpp::GetPEMEncodedIssuerChain( for (size_t i = 0; i < chainCount; ++i) { chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i])); } - delete [] chainList; + delete[] chainList; } } - // CONSTRUCTOR - Do not edit by hand. -CefX509CertificateCToCpp::CefX509CertificateCToCpp() { -} +CefX509CertificateCToCpp::CefX509CertificateCToCpp() {} -template<> cef_x509certificate_t* CefCToCppRefCounted::UnwrapDerived( - CefWrapperType type, CefX509Certificate* c) { +template <> +cef_x509certificate_t* CefCToCppRefCounted< + CefX509CertificateCToCpp, + CefX509Certificate, + cef_x509certificate_t>::UnwrapDerived(CefWrapperType type, + CefX509Certificate* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = WT_X509CERTIFICATE; diff --git a/libcef_dll/ctocpp/x509certificate_ctocpp.h b/libcef_dll/ctocpp/x509certificate_ctocpp.h index 8a7925a47..5819b5b1f 100644 --- a/libcef_dll/ctocpp/x509certificate_ctocpp.h +++ b/libcef_dll/ctocpp/x509certificate_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=7f9dc4c67e92b5f5aeb4409aa103b2d4d097e9b3$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERTIFICATE_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_X509CERTIFICATE_CTOCPP_H_ @@ -18,15 +20,16 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_x509_certificate.h" #include "include/capi/cef_x509_certificate_capi.h" +#include "include/cef_x509_certificate.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefX509CertificateCToCpp - : public CefCToCppRefCounted { + : public CefCToCppRefCounted { public: CefX509CertificateCToCpp(); diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc index b38bbc368..9d1da5066 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -9,15 +9,17 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=ac328bf1a231e47e402b7a154a96171eec5265ec$ +// #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" #include "libcef_dll/ctocpp/xml_reader_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefXmlReader::Create(CefRefPtr stream, - EncodingType encodingType, const CefString& URI) { + EncodingType encodingType, + const CefString& URI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -31,15 +33,12 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, // Execute cef_xml_reader_t* _retval = cef_xml_reader_create( - CefStreamReaderCToCpp::Unwrap(stream), - encodingType, - URI.GetStruct()); + CefStreamReaderCToCpp::Unwrap(stream), encodingType, URI.GetStruct()); // Return type: refptr_same return CefXmlReaderCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefXmlReaderCToCpp::MoveToNextNode() { @@ -53,7 +52,7 @@ bool CefXmlReaderCToCpp::MoveToNextNode() { int _retval = _struct->move_to_next_node(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::Close() { @@ -67,7 +66,7 @@ bool CefXmlReaderCToCpp::Close() { int _retval = _struct->close(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::HasError() { @@ -81,7 +80,7 @@ bool CefXmlReaderCToCpp::HasError() { int _retval = _struct->has_error(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefXmlReaderCToCpp::GetError() { @@ -235,7 +234,7 @@ bool CefXmlReaderCToCpp::IsEmptyElement() { int _retval = _struct->is_empty_element(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::HasValue() { @@ -249,7 +248,7 @@ bool CefXmlReaderCToCpp::HasValue() { int _retval = _struct->has_value(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefXmlReaderCToCpp::GetValue() { @@ -279,7 +278,7 @@ bool CefXmlReaderCToCpp::HasAttributes() { int _retval = _struct->has_attributes(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } size_t CefXmlReaderCToCpp::GetAttributeCount() { @@ -309,8 +308,8 @@ CefString CefXmlReaderCToCpp::GetAttribute(int index) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_attribute_byindex(_struct, - index); + cef_string_userfree_t _retval = + _struct->get_attribute_byindex(_struct, index); // Return type: string CefString _retvalStr; @@ -331,8 +330,8 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_attribute_byqname(_struct, - qualifiedName.GetStruct()); + cef_string_userfree_t _retval = + _struct->get_attribute_byqname(_struct, qualifiedName.GetStruct()); // Return type: string CefString _retvalStr; @@ -341,7 +340,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { } CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, - const CefString& namespaceURI) { + const CefString& namespaceURI) { cef_xml_reader_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_attribute_bylname)) return CefString(); @@ -358,9 +357,8 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, return CefString(); // Execute - cef_string_userfree_t _retval = _struct->get_attribute_bylname(_struct, - localName.GetStruct(), - namespaceURI.GetStruct()); + cef_string_userfree_t _retval = _struct->get_attribute_bylname( + _struct, localName.GetStruct(), namespaceURI.GetStruct()); // Return type: string CefString _retvalStr; @@ -427,11 +425,10 @@ bool CefXmlReaderCToCpp::MoveToAttribute(int index) { return false; // Execute - int _retval = _struct->move_to_attribute_byindex(_struct, - index); + int _retval = _struct->move_to_attribute_byindex(_struct, index); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { @@ -447,15 +444,15 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { return false; // Execute - int _retval = _struct->move_to_attribute_byqname(_struct, - qualifiedName.GetStruct()); + int _retval = + _struct->move_to_attribute_byqname(_struct, qualifiedName.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, - const CefString& namespaceURI) { + const CefString& namespaceURI) { cef_xml_reader_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, move_to_attribute_bylname)) return false; @@ -472,12 +469,11 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, return false; // Execute - int _retval = _struct->move_to_attribute_bylname(_struct, - localName.GetStruct(), - namespaceURI.GetStruct()); + int _retval = _struct->move_to_attribute_bylname( + _struct, localName.GetStruct(), namespaceURI.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::MoveToFirstAttribute() { @@ -491,7 +487,7 @@ bool CefXmlReaderCToCpp::MoveToFirstAttribute() { int _retval = _struct->move_to_first_attribute(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::MoveToNextAttribute() { @@ -505,7 +501,7 @@ bool CefXmlReaderCToCpp::MoveToNextAttribute() { int _retval = _struct->move_to_next_attribute(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefXmlReaderCToCpp::MoveToCarryingElement() { @@ -519,26 +515,30 @@ bool CefXmlReaderCToCpp::MoveToCarryingElement() { int _retval = _struct->move_to_carrying_element(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefXmlReaderCToCpp::CefXmlReaderCToCpp() { -} +CefXmlReaderCToCpp::CefXmlReaderCToCpp() {} -template<> cef_xml_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefXmlReader* c) { +template <> +cef_xml_reader_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefXmlReader* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_XML_READER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_XML_READER; diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h index 54fa11904..d7caa3fb3 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.h +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=f7c6ec7a65338563a20155417177b38ee3565c1f$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_xml_reader.h" #include "include/capi/cef_xml_reader_capi.h" +#include "include/cef_xml_reader.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefXmlReaderCToCpp - : public CefCToCppRefCounted { +class CefXmlReaderCToCpp : public CefCToCppRefCounted { public: CefXmlReaderCToCpp(); @@ -51,14 +53,14 @@ class CefXmlReaderCToCpp CefString GetAttribute(int index) OVERRIDE; CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; CefString GetAttribute(const CefString& localName, - const CefString& namespaceURI) OVERRIDE; + const CefString& namespaceURI) OVERRIDE; CefString GetInnerXml() OVERRIDE; CefString GetOuterXml() OVERRIDE; int GetLineNumber() OVERRIDE; bool MoveToAttribute(int index) OVERRIDE; bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; bool MoveToAttribute(const CefString& localName, - const CefString& namespaceURI) OVERRIDE; + const CefString& namespaceURI) OVERRIDE; bool MoveToFirstAttribute() OVERRIDE; bool MoveToNextAttribute() OVERRIDE; bool MoveToCarryingElement() OVERRIDE; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc index efc3cf3a1..97bae6b15 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -9,11 +9,12 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=11321ae1cfc63ec2688da39afd83b866dfd4a497$ +// #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" #include "libcef_dll/ctocpp/zip_reader_ctocpp.h" - // STATIC METHODS - Body may be edited by hand. CefRefPtr CefZipReader::Create( @@ -26,14 +27,13 @@ CefRefPtr CefZipReader::Create( return NULL; // Execute - cef_zip_reader_t* _retval = cef_zip_reader_create( - CefStreamReaderCToCpp::Unwrap(stream)); + cef_zip_reader_t* _retval = + cef_zip_reader_create(CefStreamReaderCToCpp::Unwrap(stream)); // Return type: refptr_same return CefZipReaderCToCpp::Wrap(_retval); } - // VIRTUAL METHODS - Body may be edited by hand. bool CefZipReaderCToCpp::MoveToFirstFile() { @@ -47,7 +47,7 @@ bool CefZipReaderCToCpp::MoveToFirstFile() { int _retval = _struct->move_to_first_file(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefZipReaderCToCpp::MoveToNextFile() { @@ -61,11 +61,11 @@ bool CefZipReaderCToCpp::MoveToNextFile() { int _retval = _struct->move_to_next_file(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, - bool caseSensitive) { + bool caseSensitive) { cef_zip_reader_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, move_to_file)) return false; @@ -78,12 +78,11 @@ bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, return false; // Execute - int _retval = _struct->move_to_file(_struct, - fileName.GetStruct(), - caseSensitive); + int _retval = + _struct->move_to_file(_struct, fileName.GetStruct(), caseSensitive); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefZipReaderCToCpp::Close() { @@ -97,7 +96,7 @@ bool CefZipReaderCToCpp::Close() { int _retval = _struct->close(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CefString CefZipReaderCToCpp::GetFileName() { @@ -154,11 +153,10 @@ bool CefZipReaderCToCpp::OpenFile(const CefString& password) { // Unverified params: password // Execute - int _retval = _struct->open_file(_struct, - password.GetStruct()); + int _retval = _struct->open_file(_struct, password.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } bool CefZipReaderCToCpp::CloseFile() { @@ -172,7 +170,7 @@ bool CefZipReaderCToCpp::CloseFile() { int _retval = _struct->close_file(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { @@ -188,9 +186,7 @@ int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { return 0; // Execute - int _retval = _struct->read_file(_struct, - buffer, - bufferSize); + int _retval = _struct->read_file(_struct, buffer, bufferSize); // Return type: simple return _retval; @@ -221,26 +217,30 @@ bool CefZipReaderCToCpp::Eof() { int _retval = _struct->eof(_struct); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } - // CONSTRUCTOR - Do not edit by hand. -CefZipReaderCToCpp::CefZipReaderCToCpp() { -} +CefZipReaderCToCpp::CefZipReaderCToCpp() {} -template<> cef_zip_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, - CefZipReader* c) { +template <> +cef_zip_reader_t* +CefCToCppRefCounted:: + UnwrapDerived(CefWrapperType type, CefZipReader* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() -template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; +template <> +base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0; #endif -template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_ZIP_READER; +template <> +CefWrapperType CefCToCppRefCounted::kWrapperType = + WT_ZIP_READER; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h index 42ddcd8e0..66a77c466 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.h +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=48ff90ae43ac6759c5106d5b3ef486a04a474988$ +// #ifndef CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ @@ -18,15 +20,15 @@ #error This file can be included wrapper-side only #endif -#include "include/cef_zip_reader.h" #include "include/capi/cef_zip_reader_capi.h" +#include "include/cef_zip_reader.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. -class CefZipReaderCToCpp - : public CefCToCppRefCounted { +class CefZipReaderCToCpp : public CefCToCppRefCounted { public: CefZipReaderCToCpp(); diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index c7d27c7db..167bee558 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -9,89 +9,80 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=1713327e819a8a3e44808a4415926326886efdf7$ +// -#include "include/cef_app.h" #include "include/capi/cef_app_capi.h" -#include "include/cef_crash_util.h" #include "include/capi/cef_crash_util_capi.h" -#include "include/cef_file_util.h" #include "include/capi/cef_file_util_capi.h" -#include "include/cef_geolocation.h" #include "include/capi/cef_geolocation_capi.h" -#include "include/cef_origin_whitelist.h" #include "include/capi/cef_origin_whitelist_capi.h" -#include "include/cef_parser.h" #include "include/capi/cef_parser_capi.h" -#include "include/cef_path_util.h" #include "include/capi/cef_path_util_capi.h" -#include "include/cef_process_util.h" #include "include/capi/cef_process_util_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" -#include "include/cef_ssl_info.h" #include "include/capi/cef_ssl_info_capi.h" -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" -#include "include/cef_trace.h" #include "include/capi/cef_trace_capi.h" -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" -#include "include/cef_web_plugin.h" #include "include/capi/cef_web_plugin_capi.h" +#include "include/cef_app.h" +#include "include/cef_crash_util.h" +#include "include/cef_file_util.h" +#include "include/cef_geolocation.h" +#include "include/cef_origin_whitelist.h" +#include "include/cef_parser.h" +#include "include/cef_path_util.h" +#include "include/cef_process_util.h" +#include "include/cef_scheme.h" +#include "include/cef_ssl_info.h" +#include "include/cef_task.h" +#include "include/cef_trace.h" +#include "include/cef_v8.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" #include "libcef_dll/cpptoc/before_download_callback_cpptoc.h" #include "libcef_dll/cpptoc/binary_value_cpptoc.h" -#include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" #include "libcef_dll/cpptoc/browser_cpptoc.h" #include "libcef_dll/cpptoc/browser_host_cpptoc.h" -#include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" -#include "libcef_dll/cpptoc/views/button_cpptoc.h" #include "libcef_dll/cpptoc/callback_cpptoc.h" #include "libcef_dll/cpptoc/command_line_cpptoc.h" #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h" +#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" #include "libcef_dll/cpptoc/domdocument_cpptoc.h" #include "libcef_dll/cpptoc/domnode_cpptoc.h" -#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" -#include "libcef_dll/cpptoc/views/display_cpptoc.h" -#include "libcef_dll/cpptoc/download_item_cpptoc.h" #include "libcef_dll/cpptoc/download_item_callback_cpptoc.h" +#include "libcef_dll/cpptoc/download_item_cpptoc.h" #include "libcef_dll/cpptoc/drag_data_cpptoc.h" #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h" -#include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" #include "libcef_dll/cpptoc/geolocation_callback_cpptoc.h" #include "libcef_dll/cpptoc/image_cpptoc.h" #include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h" -#include "libcef_dll/cpptoc/views/label_button_cpptoc.h" -#include "libcef_dll/cpptoc/views/layout_cpptoc.h" #include "libcef_dll/cpptoc/list_value_cpptoc.h" -#include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" #include "libcef_dll/cpptoc/menu_model_cpptoc.h" #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" -#include "libcef_dll/cpptoc/views/panel_cpptoc.h" #include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h" #include "libcef_dll/cpptoc/print_job_callback_cpptoc.h" #include "libcef_dll/cpptoc/print_settings_cpptoc.h" #include "libcef_dll/cpptoc/process_message_cpptoc.h" #include "libcef_dll/cpptoc/request_callback_cpptoc.h" #include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h" +#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" +#include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h" #include "libcef_dll/cpptoc/sslinfo_cpptoc.h" #include "libcef_dll/cpptoc/sslstatus_cpptoc.h" -#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" -#include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" -#include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h" #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" #include "libcef_dll/cpptoc/stream_writer_cpptoc.h" #include "libcef_dll/cpptoc/task_runner_cpptoc.h" -#include "libcef_dll/cpptoc/views/textfield_cpptoc.h" -#include "libcef_dll/cpptoc/thread_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" +#include "libcef_dll/cpptoc/thread_cpptoc.h" #include "libcef_dll/cpptoc/urlrequest_cpptoc.h" #include "libcef_dll/cpptoc/v8context_cpptoc.h" #include "libcef_dll/cpptoc/v8exception_cpptoc.h" @@ -99,10 +90,21 @@ #include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h" #include "libcef_dll/cpptoc/v8value_cpptoc.h" #include "libcef_dll/cpptoc/value_cpptoc.h" +#include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" +#include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" +#include "libcef_dll/cpptoc/views/button_cpptoc.h" +#include "libcef_dll/cpptoc/views/display_cpptoc.h" +#include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" +#include "libcef_dll/cpptoc/views/label_button_cpptoc.h" +#include "libcef_dll/cpptoc/views/layout_cpptoc.h" +#include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" +#include "libcef_dll/cpptoc/views/panel_cpptoc.h" +#include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" +#include "libcef_dll/cpptoc/views/textfield_cpptoc.h" #include "libcef_dll/cpptoc/views/view_cpptoc.h" +#include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/cpptoc/waitable_event_cpptoc.h" #include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h" -#include "libcef_dll/cpptoc/views/window_cpptoc.h" #include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h" #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" #include "libcef_dll/cpptoc/xml_reader_cpptoc.h" @@ -110,15 +112,13 @@ #include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h" #include "libcef_dll/ctocpp/app_ctocpp.h" #include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h" -#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" -#include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h" #include "libcef_dll/ctocpp/completion_callback_ctocpp.h" #include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h" #include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h" -#include "libcef_dll/ctocpp/domvisitor_ctocpp.h" #include "libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h" #include "libcef_dll/ctocpp/dialog_handler_ctocpp.h" #include "libcef_dll/ctocpp/display_handler_ctocpp.h" +#include "libcef_dll/ctocpp/domvisitor_ctocpp.h" #include "libcef_dll/ctocpp/download_handler_ctocpp.h" #include "libcef_dll/ctocpp/download_image_callback_ctocpp.h" #include "libcef_dll/ctocpp/drag_handler_ctocpp.h" @@ -131,10 +131,8 @@ #include "libcef_dll/ctocpp/keyboard_handler_ctocpp.h" #include "libcef_dll/ctocpp/life_span_handler_ctocpp.h" #include "libcef_dll/ctocpp/load_handler_ctocpp.h" -#include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" #include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h" #include "libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h" -#include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h" #include "libcef_dll/ctocpp/pdf_print_callback_ctocpp.h" #include "libcef_dll/ctocpp/print_handler_ctocpp.h" #include "libcef_dll/ctocpp/read_handler_ctocpp.h" @@ -151,27 +149,31 @@ #include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h" #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" #include "libcef_dll/ctocpp/task_ctocpp.h" -#include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h" #include "libcef_dll/ctocpp/v8accessor_ctocpp.h" #include "libcef_dll/ctocpp/v8handler_ctocpp.h" #include "libcef_dll/ctocpp/v8interceptor_ctocpp.h" +#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" +#include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h" +#include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" +#include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h" +#include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h" #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" +#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" #include "libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h" #include "libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h" -#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" #include "libcef_dll/ctocpp/write_handler_ctocpp.h" #include "libcef_dll/transfer_util.h" - // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, - struct _cef_app_t* application, void* windows_sandbox_info) { + struct _cef_app_t* application, + void* windows_sandbox_info) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: args; type: struct_byref_const @@ -186,18 +188,17 @@ CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, argsObj.Set(*args, false); // Execute - int _retval = CefExecuteProcess( - argsObj, - CefAppCToCpp::Wrap(application), - windows_sandbox_info); + int _retval = CefExecuteProcess(argsObj, CefAppCToCpp::Wrap(application), + windows_sandbox_info); // Return type: simple return _retval; } CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args, - const struct _cef_settings_t* settings, struct _cef_app_t* application, - void* windows_sandbox_info) { + const struct _cef_settings_t* settings, + struct _cef_app_t* application, + void* windows_sandbox_info) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: args; type: struct_byref_const @@ -220,11 +221,9 @@ CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args, settingsObj.Set(*settings, false); // Execute - bool _retval = CefInitialize( - argsObj, - settingsObj, - CefAppCToCpp::Wrap(application), - windows_sandbox_info); + bool _retval = + CefInitialize(argsObj, settingsObj, CefAppCToCpp::Wrap(application), + windows_sandbox_info); // Return type: bool return _retval; @@ -238,17 +237,17 @@ CEF_EXPORT void cef_shutdown() { #if DCHECK_IS_ON() // Check that all wrapper objects have been destroyed - DCHECK(base::AtomicRefCountIsZero( - &CefAccessibilityHandlerCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefAccessibilityHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefBeforeDownloadCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefBeforeDownloadCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBinaryValueCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBoxLayoutCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserHostCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefBrowserProcessHandlerCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefBrowserProcessHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserViewCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserViewDelegateCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefButtonCppToC::DebugObjCt)); @@ -261,17 +260,17 @@ CEF_EXPORT void cef_shutdown() { DCHECK(base::AtomicRefCountIsZero(&CefDOMDocumentCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDOMNodeCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDOMVisitorCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDeleteCookiesCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDeleteCookiesCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDialogHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDictionaryValueCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDisplayCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDisplayHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDownloadHandlerCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDownloadImageCallbackCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDownloadItemCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDownloadImageCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDownloadItemCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDownloadItemCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDragDataCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCToCpp::DebugObjCt)); @@ -283,8 +282,8 @@ CEF_EXPORT void cef_shutdown() { DCHECK(base::AtomicRefCountIsZero(&CefFrameCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefGeolocationHandlerCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefGetGeolocationCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefGetGeolocationCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefImageCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefJSDialogCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefJSDialogHandlerCToCpp::DebugObjCt)); @@ -299,8 +298,8 @@ CEF_EXPORT void cef_shutdown() { DCHECK(base::AtomicRefCountIsZero(&CefMenuModelCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefMenuModelDelegateCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefNavigationEntryCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefNavigationEntryVisitorCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefNavigationEntryVisitorCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPanelCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPanelDelegateCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPdfPrintCallbackCToCpp::DebugObjCt)); @@ -312,23 +311,23 @@ CEF_EXPORT void cef_shutdown() { DCHECK(base::AtomicRefCountIsZero(&CefReadHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRegisterCdmCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRenderHandlerCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRenderProcessHandlerCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRenderProcessHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRequestCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRequestHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResolveCallbackCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefResourceBundleHandlerCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefResourceBundleHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResourceHandlerCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResponseFilterCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRunContextMenuCallbackCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRunFileDialogCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRunContextMenuCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRunFileDialogCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSSLInfoCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSSLStatusCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefSchemeHandlerFactoryCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefSchemeHandlerFactoryCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSchemeRegistrarCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefScrollViewCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero( @@ -378,8 +377,8 @@ CEF_EXPORT void cef_shutdown() { DCHECK(base::AtomicRefCountIsZero(&CefViewDelegateCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWaitableEventCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWebPluginInfoCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefWebPluginInfoVisitorCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefWebPluginInfoVisitorCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero( &CefWebPluginUnstableCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWindowCppToC::DebugObjCt)); @@ -417,8 +416,7 @@ CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - CefSetOSModalLoop( - osModalLoop?true:false); + CefSetOSModalLoop(osModalLoop ? true : false); } CEF_EXPORT void cef_enable_highdpi_support() { @@ -439,7 +437,7 @@ CEF_EXPORT int cef_crash_reporting_enabled() { } CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key, - const cef_string_t* value) { + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: key; type: string_byref_const @@ -449,9 +447,7 @@ CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key, // Unverified params: value // Execute - CefSetCrashKeyValue( - CefString(key), - CefString(value)); + CefSetCrashKeyValue(CefString(key), CefString(value)); } CEF_EXPORT int cef_create_directory(const cef_string_t* full_path) { @@ -463,8 +459,7 @@ CEF_EXPORT int cef_create_directory(const cef_string_t* full_path) { return 0; // Execute - bool _retval = CefCreateDirectory( - CefString(full_path)); + bool _retval = CefCreateDirectory(CefString(full_path)); // Return type: bool return _retval; @@ -482,15 +477,14 @@ CEF_EXPORT int cef_get_temp_directory(cef_string_t* temp_dir) { CefString temp_dirStr(temp_dir); // Execute - bool _retval = CefGetTempDirectory( - temp_dirStr); + bool _retval = CefGetTempDirectory(temp_dirStr); // Return type: bool return _retval; } CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix, - cef_string_t* new_temp_path) { + cef_string_t* new_temp_path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: new_temp_path; type: string_byref @@ -503,16 +497,15 @@ CEF_EXPORT int cef_create_new_temp_directory(const cef_string_t* prefix, CefString new_temp_pathStr(new_temp_path); // Execute - bool _retval = CefCreateNewTempDirectory( - CefString(prefix), - new_temp_pathStr); + bool _retval = CefCreateNewTempDirectory(CefString(prefix), new_temp_pathStr); // Return type: bool return _retval; } CEF_EXPORT int cef_create_temp_directory_in_directory( - const cef_string_t* base_dir, const cef_string_t* prefix, + const cef_string_t* base_dir, + const cef_string_t* prefix, cef_string_t* new_dir) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -531,9 +524,7 @@ CEF_EXPORT int cef_create_temp_directory_in_directory( // Execute bool _retval = CefCreateTempDirectoryInDirectory( - CefString(base_dir), - CefString(prefix), - new_dirStr); + CefString(base_dir), CefString(prefix), new_dirStr); // Return type: bool return _retval; @@ -548,8 +539,7 @@ CEF_EXPORT int cef_directory_exists(const cef_string_t* path) { return 0; // Execute - bool _retval = CefDirectoryExists( - CefString(path)); + bool _retval = CefDirectoryExists(CefString(path)); // Return type: bool return _retval; @@ -564,16 +554,15 @@ CEF_EXPORT int cef_delete_file(const cef_string_t* path, int recursive) { return 0; // Execute - bool _retval = CefDeleteFile( - CefString(path), - recursive?true:false); + bool _retval = CefDeleteFile(CefString(path), recursive ? true : false); // Return type: bool return _retval; } CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir, - const cef_string_t* dest_file, int include_hidden_files) { + const cef_string_t* dest_file, + int include_hidden_files) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: src_dir; type: string_byref_const @@ -586,10 +575,8 @@ CEF_EXPORT int cef_zip_directory(const cef_string_t* src_dir, return 0; // Execute - bool _retval = CefZipDirectory( - CefString(src_dir), - CefString(dest_file), - include_hidden_files?true:false); + bool _retval = CefZipDirectory(CefString(src_dir), CefString(dest_file), + include_hidden_files ? true : false); // Return type: bool return _retval; @@ -605,16 +592,18 @@ CEF_EXPORT int cef_get_geolocation( return 0; // Execute - bool _retval = CefGetGeolocation( - CefGetGeolocationCallbackCToCpp::Wrap(callback)); + bool _retval = + CefGetGeolocation(CefGetGeolocationCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } CEF_EXPORT int cef_add_cross_origin_whitelist_entry( - const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains) { + const cef_string_t* source_origin, + const cef_string_t* target_protocol, + const cef_string_t* target_domain, + int allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -629,18 +618,18 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry( // Execute bool _retval = CefAddCrossOriginWhitelistEntry( - CefString(source_origin), - CefString(target_protocol), - CefString(target_domain), - allow_target_subdomains?true:false); + CefString(source_origin), CefString(target_protocol), + CefString(target_domain), allow_target_subdomains ? true : false); // Return type: bool return _retval; } CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( - const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains) { + const cef_string_t* source_origin, + const cef_string_t* target_protocol, + const cef_string_t* target_domain, + int allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -655,10 +644,8 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( // Execute bool _retval = CefRemoveCrossOriginWhitelistEntry( - CefString(source_origin), - CefString(target_protocol), - CefString(target_domain), - allow_target_subdomains?true:false); + CefString(source_origin), CefString(target_protocol), + CefString(target_domain), allow_target_subdomains ? true : false); // Return type: bool return _retval; @@ -675,7 +662,7 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist() { } CEF_EXPORT int cef_parse_url(const cef_string_t* url, - struct _cef_urlparts_t* parts) { + struct _cef_urlparts_t* parts) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -693,9 +680,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url, partsObj.AttachTo(*parts); // Execute - bool _retval = CefParseURL( - CefString(url), - partsObj); + bool _retval = CefParseURL(CefString(url), partsObj); // Restore param: parts; type: struct_byref if (parts) @@ -706,7 +691,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url, } CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, - cef_string_t* url) { + cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: parts; type: struct_byref_const @@ -726,16 +711,14 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, CefString urlStr(url); // Execute - bool _retval = CefCreateURL( - partsObj, - urlStr); + bool _retval = CefCreateURL(partsObj, urlStr); // Return type: bool return _retval; } -CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display( - const cef_string_t* origin_url) { +CEF_EXPORT cef_string_userfree_t +cef_format_url_for_security_display(const cef_string_t* origin_url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: origin_url; type: string_byref_const @@ -744,15 +727,14 @@ CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display( return NULL; // Execute - CefString _retval = CefFormatUrlForSecurityDisplay( - CefString(origin_url)); + CefString _retval = CefFormatUrlForSecurityDisplay(CefString(origin_url)); // Return type: string return _retval.DetachToUserFree(); } -CEF_EXPORT cef_string_userfree_t cef_get_mime_type( - const cef_string_t* extension) { +CEF_EXPORT cef_string_userfree_t +cef_get_mime_type(const cef_string_t* extension) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: extension; type: string_byref_const @@ -761,15 +743,14 @@ CEF_EXPORT cef_string_userfree_t cef_get_mime_type( return NULL; // Execute - CefString _retval = CefGetMimeType( - CefString(extension)); + CefString _retval = CefGetMimeType(CefString(extension)); // Return type: string return _retval.DetachToUserFree(); } CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, - cef_string_list_t extensions) { + cef_string_list_t extensions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: mime_type; type: string_byref_const @@ -786,9 +767,7 @@ CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, transfer_string_list_contents(extensions, extensionsList); // Execute - CefGetExtensionsForMimeType( - CefString(mime_type), - extensionsList); + CefGetExtensionsForMimeType(CefString(mime_type), extensionsList); // Restore param: extensions; type: string_vec_byref cef_string_list_clear(extensions); @@ -796,7 +775,7 @@ CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, } CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data, - size_t data_size) { + size_t data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -805,9 +784,7 @@ CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data, return NULL; // Execute - CefString _retval = CefBase64Encode( - data, - data_size); + CefString _retval = CefBase64Encode(data, data_size); // Return type: string return _retval.DetachToUserFree(); @@ -823,15 +800,14 @@ CEF_EXPORT struct _cef_binary_value_t* cef_base64decode( return NULL; // Execute - CefRefPtr _retval = CefBase64Decode( - CefString(data)); + CefRefPtr _retval = CefBase64Decode(CefString(data)); // Return type: refptr_same return CefBinaryValueCppToC::Wrap(_retval); } CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, - int use_plus) { + int use_plus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: text; type: string_byref_const @@ -840,16 +816,16 @@ CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, return NULL; // Execute - CefString _retval = CefURIEncode( - CefString(text), - use_plus?true:false); + CefString _retval = CefURIEncode(CefString(text), use_plus ? true : false); // Return type: string return _retval.DetachToUserFree(); } -CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, - int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule) { +CEF_EXPORT cef_string_userfree_t +cef_uridecode(const cef_string_t* text, + int convert_to_utf8, + cef_uri_unescape_rule_t unescape_rule) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: text; type: string_byref_const @@ -859,15 +835,14 @@ CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, // Execute CefString _retval = CefURIDecode( - CefString(text), - convert_to_utf8?true:false, - unescape_rule); + CefString(text), convert_to_utf8 ? true : false, unescape_rule); // Return type: string return _retval.DetachToUserFree(); } -CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, +CEF_EXPORT struct _cef_value_t* cef_parse_json( + const cef_string_t* json_string, cef_json_parser_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -877,17 +852,17 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string, return NULL; // Execute - CefRefPtr _retval = CefParseJSON( - CefString(json_string), - options); + CefRefPtr _retval = CefParseJSON(CefString(json_string), options); // Return type: refptr_same return CefValueCppToC::Wrap(_retval); } CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( - const cef_string_t* json_string, cef_json_parser_options_t options, - cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out) { + const cef_string_t* json_string, + cef_json_parser_options_t options, + cef_json_parser_error_t* error_code_out, + cef_string_t* error_msg_out) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: json_string; type: string_byref_const @@ -905,16 +880,13 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( // Translate param: error_code_out; type: simple_byref cef_json_parser_error_t error_code_outVal = - error_code_out?*error_code_out:JSON_NO_ERROR; + error_code_out ? *error_code_out : JSON_NO_ERROR; // Translate param: error_msg_out; type: string_byref CefString error_msg_outStr(error_msg_out); // Execute CefRefPtr _retval = CefParseJSONAndReturnError( - CefString(json_string), - options, - error_code_outVal, - error_msg_outStr); + CefString(json_string), options, error_code_outVal, error_msg_outStr); // Restore param: error_code_out; type: simple_byref if (error_code_out) @@ -924,8 +896,8 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( return CefValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node, - cef_json_writer_options_t options) { +CEF_EXPORT cef_string_userfree_t +cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: node; type: refptr_same @@ -934,9 +906,7 @@ CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node, return NULL; // Execute - CefString _retval = CefWriteJSON( - CefValueCppToC::Unwrap(node), - options); + CefString _retval = CefWriteJSON(CefValueCppToC::Unwrap(node), options); // Return type: string return _retval.DetachToUserFree(); @@ -954,9 +924,7 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) { CefString pathStr(path); // Execute - bool _retval = CefGetPath( - key, - pathStr); + bool _retval = CefGetPath(key, pathStr); // Return type: bool return _retval; @@ -971,15 +939,15 @@ CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line) { return 0; // Execute - bool _retval = CefLaunchProcess( - CefCommandLineCppToC::Unwrap(command_line)); + bool _retval = CefLaunchProcess(CefCommandLineCppToC::Unwrap(command_line)); // Return type: bool return _retval; } CEF_EXPORT int cef_register_scheme_handler_factory( - const cef_string_t* scheme_name, const cef_string_t* domain_name, + const cef_string_t* scheme_name, + const cef_string_t* domain_name, struct _cef_scheme_handler_factory_t* factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -991,8 +959,7 @@ CEF_EXPORT int cef_register_scheme_handler_factory( // Execute bool _retval = CefRegisterSchemeHandlerFactory( - CefString(scheme_name), - CefString(domain_name), + CefString(scheme_name), CefString(domain_name), CefSchemeHandlerFactoryCToCpp::Wrap(factory)); // Return type: bool @@ -1013,8 +980,7 @@ CEF_EXPORT int cef_is_cert_status_error(cef_cert_status_t status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - bool _retval = CefIsCertStatusError( - status); + bool _retval = CefIsCertStatusError(status); // Return type: bool return _retval; @@ -1024,8 +990,7 @@ CEF_EXPORT int cef_is_cert_status_minor_error(cef_cert_status_t status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - bool _retval = CefIsCertStatusMinorError( - status); + bool _retval = CefIsCertStatusMinorError(status); // Return type: bool return _retval; @@ -1035,15 +1000,14 @@ CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - bool _retval = CefCurrentlyOn( - threadId); + bool _retval = CefCurrentlyOn(threadId); // Return type: bool return _retval; } CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, - struct _cef_task_t* task) { + struct _cef_task_t* task) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -1052,16 +1016,15 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, return 0; // Execute - bool _retval = CefPostTask( - threadId, - CefTaskCToCpp::Wrap(task)); + bool _retval = CefPostTask(threadId, CefTaskCToCpp::Wrap(task)); // Return type: bool return _retval; } CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, - struct _cef_task_t* task, int64 delay_ms) { + struct _cef_task_t* task, + int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -1070,40 +1033,36 @@ CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, return 0; // Execute - bool _retval = CefPostDelayedTask( - threadId, - CefTaskCToCpp::Wrap(task), - delay_ms); + bool _retval = + CefPostDelayedTask(threadId, CefTaskCToCpp::Wrap(task), delay_ms); // Return type: bool return _retval; } CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories, - struct _cef_completion_callback_t* callback) { + struct _cef_completion_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: categories, callback // Execute - bool _retval = CefBeginTracing( - CefString(categories), - CefCompletionCallbackCToCpp::Wrap(callback)); + bool _retval = CefBeginTracing(CefString(categories), + CefCompletionCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; } CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file, - struct _cef_end_tracing_callback_t* callback) { + struct _cef_end_tracing_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: tracing_file, callback // Execute - bool _retval = CefEndTracing( - CefString(tracing_file), - CefEndTracingCallbackCToCpp::Wrap(callback)); + bool _retval = CefEndTracing(CefString(tracing_file), + CefEndTracingCallbackCToCpp::Wrap(callback)); // Return type: bool return _retval; @@ -1120,7 +1079,8 @@ CEF_EXPORT int64 cef_now_from_system_trace_time() { } CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) { + const cef_string_t* javascript_code, + struct _cef_v8handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: extension_name; type: string_byref_const @@ -1134,10 +1094,9 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, // Unverified params: handler // Execute - bool _retval = CefRegisterExtension( - CefString(extension_name), - CefString(javascript_code), - CefV8HandlerCToCpp::Wrap(handler)); + bool _retval = CefRegisterExtension(CefString(extension_name), + CefString(javascript_code), + CefV8HandlerCToCpp::Wrap(handler)); // Return type: bool return _retval; @@ -1153,8 +1112,7 @@ CEF_EXPORT void cef_visit_web_plugin_info( return; // Execute - CefVisitWebPluginInfo( - CefWebPluginInfoVisitorCToCpp::Wrap(visitor)); + CefVisitWebPluginInfo(CefWebPluginInfoVisitorCToCpp::Wrap(visitor)); } CEF_EXPORT void cef_refresh_web_plugins() { @@ -1173,8 +1131,7 @@ CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path) { return; // Execute - CefUnregisterInternalWebPlugin( - CefString(path)); + CefUnregisterInternalWebPlugin(CefString(path)); } CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path) { @@ -1186,11 +1143,11 @@ CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path) { return; // Execute - CefRegisterWebPluginCrash( - CefString(path)); + CefRegisterWebPluginCrash(CefString(path)); } -CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, +CEF_EXPORT void cef_is_web_plugin_unstable( + const cef_string_t* path, struct _cef_web_plugin_unstable_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1204,12 +1161,12 @@ CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, return; // Execute - CefIsWebPluginUnstable( - CefString(path), - CefWebPluginUnstableCallbackCToCpp::Wrap(callback)); + CefIsWebPluginUnstable(CefString(path), + CefWebPluginUnstableCallbackCToCpp::Wrap(callback)); } -CEF_EXPORT void cef_register_widevine_cdm(const cef_string_t* path, +CEF_EXPORT void cef_register_widevine_cdm( + const cef_string_t* path, struct _cef_register_cdm_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1220,8 +1177,6 @@ CEF_EXPORT void cef_register_widevine_cdm(const cef_string_t* path, // Unverified params: callback // Execute - CefRegisterWidevineCdm( - CefString(path), - CefRegisterCdmCallbackCToCpp::Wrap(callback)); + CefRegisterWidevineCdm(CefString(path), + CefRegisterCdmCallbackCToCpp::Wrap(callback)); } - diff --git a/libcef_dll/libcef_dll2.cc b/libcef_dll/libcef_dll2.cc index c5302edc1..12bf82328 100644 --- a/libcef_dll/libcef_dll2.cc +++ b/libcef_dll/libcef_dll2.cc @@ -3,26 +3,37 @@ // can be found in the LICENSE file. // -#include "include/cef_version.h" #include +#include "include/cef_version.h" CEF_EXPORT int cef_version_info(int entry) { switch (entry) { - case 0: return CEF_VERSION_MAJOR; - case 1: return CEF_COMMIT_NUMBER; - case 2: return CHROME_VERSION_MAJOR; - case 3: return CHROME_VERSION_MINOR; - case 4: return CHROME_VERSION_BUILD; - case 5: return CHROME_VERSION_PATCH; - default: return 0; + case 0: + return CEF_VERSION_MAJOR; + case 1: + return CEF_COMMIT_NUMBER; + case 2: + return CHROME_VERSION_MAJOR; + case 3: + return CHROME_VERSION_MINOR; + case 4: + return CHROME_VERSION_BUILD; + case 5: + return CHROME_VERSION_PATCH; + default: + return 0; } } CEF_EXPORT const char* cef_api_hash(int entry) { switch (entry) { - case 0: return CEF_API_HASH_PLATFORM; - case 1: return CEF_API_HASH_UNIVERSAL; - case 2: return CEF_COMMIT_HASH; - default: return NULL; + case 0: + return CEF_API_HASH_PLATFORM; + case 1: + return CEF_API_HASH_UNIVERSAL; + case 2: + return CEF_COMMIT_HASH; + default: + return NULL; } } diff --git a/libcef_dll/ptr_util.h b/libcef_dll/ptr_util.h index 78e182a01..969232216 100644 --- a/libcef_dll/ptr_util.h +++ b/libcef_dll/ptr_util.h @@ -9,11 +9,10 @@ // Helpers for CefOwnPtr<>. #if defined(USING_CHROMIUM_INCLUDES) #define OWN_PASS(p) std::move(p) -#define OWN_RETURN_AS(p,t) (p) +#define OWN_RETURN_AS(p, t) (p) #else #define OWN_PASS(p) (p).Pass() -#define OWN_RETURN_AS(p,t) (p).PassAs() +#define OWN_RETURN_AS(p, t) (p).PassAs() #endif #endif // CEF_LIBCEF_DLL_PTR_UTIL_H_ - diff --git a/libcef_dll/resource.h b/libcef_dll/resource.h index cbeef193d..a4a588910 100644 --- a/libcef_dll/resource.h +++ b/libcef_dll/resource.h @@ -6,21 +6,20 @@ // Avoid files associated with MacOS #define _X86_ -#define IDD_ALERT 130 -#define IDD_CONFIRM 131 -#define IDD_PROMPT 132 -#define IDC_PROMPTEDIT 1000 -#define IDC_DIALOGTEXT 1001 - +#define IDD_ALERT 130 +#define IDD_CONFIRM 131 +#define IDD_PROMPT 132 +#define IDC_PROMPTEDIT 1000 +#define IDC_DIALOGTEXT 1001 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 130 -#define _APS_NEXT_COMMAND_VALUE 32000 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32000 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 #endif #endif diff --git a/libcef_dll/sandbox/sandbox_win.cc b/libcef_dll/sandbox/sandbox_win.cc index 5b85bf855..3db05390f 100644 --- a/libcef_dll/sandbox/sandbox_win.cc +++ b/libcef_dll/sandbox/sandbox_win.cc @@ -17,8 +17,7 @@ void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo* info) { } else { // Ensure the proper mitigations are enforced for the browser process. sandbox::ApplyProcessMitigationsToCurrentProcess( - sandbox::MITIGATION_DEP | - sandbox::MITIGATION_DEP_NO_ATL_THUNK); + sandbox::MITIGATION_DEP | sandbox::MITIGATION_DEP_NO_ATL_THUNK); } } diff --git a/libcef_dll/transfer_util.cc b/libcef_dll/transfer_util.cc index b35460f21..03fed4c1f 100644 --- a/libcef_dll/transfer_util.cc +++ b/libcef_dll/transfer_util.cc @@ -5,68 +5,60 @@ #include "transfer_util.h" void transfer_string_list_contents(cef_string_list_t fromList, - StringList& toList) -{ + StringList& toList) { size_t size = cef_string_list_size(fromList); CefString value; - for(size_t i = 0; i < size; i++) { - cef_string_list_value(fromList, i, value.GetWritableStruct()); - toList.push_back(value); + for (size_t i = 0; i < size; i++) { + cef_string_list_value(fromList, i, value.GetWritableStruct()); + toList.push_back(value); } } void transfer_string_list_contents(const StringList& fromList, - cef_string_list_t toList) -{ + cef_string_list_t toList) { size_t size = fromList.size(); - for(size_t i = 0; i < size; ++i) + for (size_t i = 0; i < size; ++i) cef_string_list_append(toList, fromList[i].GetStruct()); } -void transfer_string_map_contents(cef_string_map_t fromMap, - StringMap& toMap) -{ +void transfer_string_map_contents(cef_string_map_t fromMap, StringMap& toMap) { size_t size = cef_string_map_size(fromMap); CefString key, value; - - for(size_t i = 0; i < size; ++i) { + + for (size_t i = 0; i < size; ++i) { cef_string_map_key(fromMap, i, key.GetWritableStruct()); cef_string_map_value(fromMap, i, value.GetWritableStruct()); - + toMap.insert(std::make_pair(key, value)); } } void transfer_string_map_contents(const StringMap& fromMap, - cef_string_map_t toMap) -{ + cef_string_map_t toMap) { StringMap::const_iterator it = fromMap.begin(); - for(; it != fromMap.end(); ++it) + for (; it != fromMap.end(); ++it) cef_string_map_append(toMap, it->first.GetStruct(), it->second.GetStruct()); } void transfer_string_multimap_contents(cef_string_multimap_t fromMap, - StringMultimap& toMap) -{ + StringMultimap& toMap) { size_t size = cef_string_multimap_size(fromMap); CefString key, value; - for(size_t i = 0; i < size; ++i) { + for (size_t i = 0; i < size; ++i) { cef_string_multimap_key(fromMap, i, key.GetWritableStruct()); cef_string_multimap_value(fromMap, i, value.GetWritableStruct()); - + toMap.insert(std::make_pair(key, value)); } } void transfer_string_multimap_contents(const StringMultimap& fromMap, - cef_string_multimap_t toMap) -{ + cef_string_multimap_t toMap) { StringMultimap::const_iterator it = fromMap.begin(); - for(; it != fromMap.end(); ++it) { - cef_string_multimap_append(toMap, - it->first.GetStruct(), - it->second.GetStruct()); + for (; it != fromMap.end(); ++it) { + cef_string_multimap_append(toMap, it->first.GetStruct(), + it->second.GetStruct()); } } diff --git a/libcef_dll/transfer_util.h b/libcef_dll/transfer_util.h index 88dff1a38..f2c3e8159 100644 --- a/libcef_dll/transfer_util.h +++ b/libcef_dll/transfer_util.h @@ -22,8 +22,7 @@ void transfer_string_list_contents(const StringList& fromList, // Copy contents from one map type to another. typedef std::map StringMap; -void transfer_string_map_contents(cef_string_map_t fromMap, - StringMap& toMap); +void transfer_string_map_contents(cef_string_map_t fromMap, StringMap& toMap); void transfer_string_map_contents(const StringMap& fromMap, cef_string_map_t toMap); diff --git a/libcef_dll/views_stub.cc b/libcef_dll/views_stub.cc index 9849362a1..52d3ddfd6 100644 --- a/libcef_dll/views_stub.cc +++ b/libcef_dll/views_stub.cc @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=e6daa179971241b884282dafa19b5c8b362e7ca0$ +// #include "include/views/cef_browser_view.h" #include "include/views/cef_display.h" @@ -21,11 +23,11 @@ #include "base/logging.h" - // STATIC STUB METHODS - Do not edit by hand. CefRefPtr CefBrowserView::CreateBrowserView( - CefRefPtr client, const CefString& url, + CefRefPtr client, + const CefString& url, const CefBrowserSettings& settings, CefRefPtr request_context, CefRefPtr delegate) { @@ -44,14 +46,16 @@ CefRefPtr CefDisplay::GetPrimaryDisplay() { return NULL; } -CefRefPtr CefDisplay::GetDisplayNearestPoint(const CefPoint& point, +CefRefPtr CefDisplay::GetDisplayNearestPoint( + const CefPoint& point, bool input_pixel_coords) { NOTIMPLEMENTED(); return NULL; } CefRefPtr CefDisplay::GetDisplayMatchingBounds( - const CefRect& bounds, bool input_pixel_coords) { + const CefRect& bounds, + bool input_pixel_coords) { NOTIMPLEMENTED(); return NULL; } @@ -66,15 +70,18 @@ void CefDisplay::GetAllDisplays(std::vector>& displays) { } CefRefPtr CefLabelButton::CreateLabelButton( - CefRefPtr delegate, const CefString& text, + CefRefPtr delegate, + const CefString& text, bool with_frame) { NOTIMPLEMENTED(); return NULL; } CefRefPtr CefMenuButton::CreateMenuButton( - CefRefPtr delegate, const CefString& text, - bool with_frame, bool with_menu_marker) { + CefRefPtr delegate, + const CefString& text, + bool with_frame, + bool with_menu_marker) { NOTIMPLEMENTED(); return NULL; } @@ -102,4 +109,3 @@ CefRefPtr CefWindow::CreateTopLevelWindow( NOTIMPLEMENTED(); return NULL; } - diff --git a/libcef_dll/wrapper/cef_browser_info_map.h b/libcef_dll/wrapper/cef_browser_info_map.h index 9cf1ab486..a26566c8c 100644 --- a/libcef_dll/wrapper/cef_browser_info_map.h +++ b/libcef_dll/wrapper/cef_browser_info_map.h @@ -13,17 +13,15 @@ // Default traits for CefBrowserInfoMap. Override to provide different object // destruction behavior. -template +template struct DefaultCefBrowserInfoMapTraits { - static void Destruct(ObjectType info) { - delete info; - } + static void Destruct(ObjectType info) { delete info; } }; // Maps an arbitrary IdType to an arbitrary ObjectType on a per-browser basis. template > + typename Traits = DefaultCefBrowserInfoMapTraits> class CefBrowserInfoMap { public: // Implement this interface to visit and optionally delete objects in the map. @@ -38,7 +36,7 @@ class CefBrowserInfoMap { virtual bool OnNextInfo(int browser_id, InfoIdType info_id, InfoObjectType info, - bool* remove) =0; + bool* remove) = 0; protected: virtual ~Visitor() {} @@ -46,9 +44,7 @@ class CefBrowserInfoMap { CefBrowserInfoMap() {} - ~CefBrowserInfoMap() { - clear(); - } + ~CefBrowserInfoMap() { clear(); } // Add an object associated with the specified ID values. void Add(int browser_id, IdType info_id, ObjectType info) { @@ -261,5 +257,4 @@ class CefBrowserInfoMap { DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoMap); }; - #endif // CEF_LIBCEF_DLL_WRAPPER_CEF_BROWSER_INFO_MAP_H_ diff --git a/libcef_dll/wrapper/cef_byte_read_handler.cc b/libcef_dll/wrapper/cef_byte_read_handler.cc index f8878a145..dbb518187 100644 --- a/libcef_dll/wrapper/cef_byte_read_handler.cc +++ b/libcef_dll/wrapper/cef_byte_read_handler.cc @@ -8,10 +8,10 @@ #include #include -CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size, +CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, + size_t size, CefRefPtr source) - : bytes_(bytes), size_(size), offset_(0), source_(source) { -} + : bytes_(bytes), size_(size), offset_(0), source_(source) {} size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) { base::AutoLock lock_scope(lock_); @@ -26,30 +26,30 @@ int CefByteReadHandler::Seek(int64 offset, int whence) { int rv = -1L; base::AutoLock lock_scope(lock_); switch (whence) { - case SEEK_CUR: - if (offset_ + offset > size_ || offset_ + offset < 0) + case SEEK_CUR: + if (offset_ + offset > size_ || offset_ + offset < 0) + break; + offset_ += offset; + rv = 0; break; - offset_ += offset; - rv = 0; - break; - case SEEK_END: { + case SEEK_END: { #if defined(OS_WIN) - int64 offset_abs = _abs64(offset); + int64 offset_abs = _abs64(offset); #else - int64 offset_abs = std::abs(offset); + int64 offset_abs = std::abs(offset); #endif - if (offset_abs > size_) + if (offset_abs > size_) + break; + offset_ = size_ - offset_abs; + rv = 0; break; - offset_ = size_ - offset_abs; - rv = 0; - break; - } - case SEEK_SET: - if (offset > size_ || offset < 0) + } + case SEEK_SET: + if (offset > size_ || offset < 0) + break; + offset_ = offset; + rv = 0; break; - offset_ = offset; - rv = 0; - break; } return rv; diff --git a/libcef_dll/wrapper/cef_closure_task.cc b/libcef_dll/wrapper/cef_closure_task.cc index 0b4939053..636ca24dd 100644 --- a/libcef_dll/wrapper/cef_closure_task.cc +++ b/libcef_dll/wrapper/cef_closure_task.cc @@ -2,16 +2,14 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/wrapper/cef_closure_task.h" #include "include/base/cef_callback.h" +#include "include/wrapper/cef_closure_task.h" namespace { class CefClosureTask : public CefTask { public: - explicit CefClosureTask(const base::Closure& closure) - : closure_(closure) { - } + explicit CefClosureTask(const base::Closure& closure) : closure_(closure) {} // CefTask method virtual void Execute() OVERRIDE { @@ -36,7 +34,8 @@ bool CefPostTask(CefThreadId threadId, const base::Closure& closure) { return CefPostTask(threadId, new CefClosureTask(closure)); } -bool CefPostDelayedTask(CefThreadId threadId, const base::Closure& closure, +bool CefPostDelayedTask(CefThreadId threadId, + const base::Closure& closure, int64 delay_ms) { return CefPostDelayedTask(threadId, new CefClosureTask(closure), delay_ms); } diff --git a/libcef_dll/wrapper/cef_message_router.cc b/libcef_dll/wrapper/cef_message_router.cc index ffd03f8cc..6c063bdca 100644 --- a/libcef_dll/wrapper/cef_message_router.cc +++ b/libcef_dll/wrapper/cef_message_router.cc @@ -35,8 +35,7 @@ const char kCanceledErrorMessage[] = "The query has been canceled"; // Validate configuration settings. bool ValidateConfig(CefMessageRouterConfig& config) { // Must specify function names. - if (config.js_cancel_function.empty() || - config.js_query_function.empty()) { + if (config.js_cancel_function.empty() || config.js_query_function.empty()) { return false; } @@ -75,8 +74,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { : router_(router), browser_id_(browser_id), query_id_(query_id), - persistent_(persistent) { - } + persistent_(persistent) {} virtual ~CallbackImpl() { // Hitting this DCHECK means that you didn't call Success or Failure // on the Callback after returning true from Handler::OnQuery. You must @@ -87,13 +85,13 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { virtual void Success(const CefString& response) OVERRIDE { if (!CefCurrentlyOn(TID_UI)) { // Must execute on the UI thread to access member variables. - CefPostTask(TID_UI, - base::Bind(&CallbackImpl::Success, this, response)); + CefPostTask(TID_UI, base::Bind(&CallbackImpl::Success, this, response)); return; } if (router_) { - CefPostTask(TID_UI, + CefPostTask( + TID_UI, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackSuccess, router_.get(), browser_id_, query_id_, response)); @@ -108,14 +106,14 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { const CefString& error_message) OVERRIDE { if (!CefCurrentlyOn(TID_UI)) { // Must execute on the UI thread to access member variables. - CefPostTask(TID_UI, - base::Bind(&CallbackImpl::Failure, this, - error_code, error_message)); + CefPostTask(TID_UI, base::Bind(&CallbackImpl::Failure, this, error_code, + error_message)); return; } if (router_) { - CefPostTask(TID_UI, + CefPostTask( + TID_UI, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackFailure, router_.get(), browser_id_, query_id_, error_code, error_message)); @@ -141,11 +139,10 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { explicit CefMessageRouterBrowserSideImpl(const CefMessageRouterConfig& config) : config_(config), - query_message_name_( - config.js_query_function.ToString() + kMessageSuffix), - cancel_message_name_( - config.js_cancel_function.ToString() + kMessageSuffix) { - } + query_message_name_(config.js_query_function.ToString() + + kMessageSuffix), + cancel_message_name_(config.js_cancel_function.ToString() + + kMessageSuffix) {} virtual ~CefMessageRouterBrowserSideImpl() { // There should be no pending queries when the router is deleted. @@ -155,8 +152,8 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { virtual bool AddHandler(Handler* handler, bool first) OVERRIDE { CEF_REQUIRE_UI_THREAD(); if (handler_set_.find(handler) == handler_set_.end()) { - handler_set_.insert( - first ? handler_set_.begin() : handler_set_.end(), handler); + handler_set_.insert(first ? handler_set_.begin() : handler_set_.end(), + handler); return true; } return false; @@ -187,9 +184,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { // Need to iterate over each QueryInfo object to test the handler. class Visitor : public BrowserQueryInfoMap::Visitor { public: - explicit Visitor(Handler* handler) - : handler_(handler), - count_(0) {} + explicit Visitor(Handler* handler) : handler_(handler), count_(0) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -206,13 +201,12 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { Handler* handler_; int count_; }; - + Visitor visitor(handler); if (browser.get()) { // Count queries associated with the specified browser. - browser_query_info_map_.FindAll( - browser->GetIdentifier(), &visitor); + browser_query_info_map_.FindAll(browser->GetIdentifier(), &visitor); } else { // Count all queries for all browsers. browser_query_info_map_.FindAll(&visitor); @@ -278,7 +272,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { frame = browser->GetFrame(frame_id); CefRefPtr callback( new CallbackImpl(this, browser_id, query_id, persistent)); - + // Make a copy of the handler list in case the user adds or removes a // handler while we're iterating. HandlerSet handler_set = handler_set_; @@ -286,8 +280,9 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { bool handled = false; HandlerSet::const_iterator it_handler = handler_set.begin(); for (; it_handler != handler_set.end(); ++it_handler) { - handled = (*it_handler)->OnQuery(browser, frame, query_id, request, - persistent, callback.get()); + handled = (*it_handler) + ->OnQuery(browser, frame, query_id, request, persistent, + callback.get()); if (handled) break; } @@ -371,8 +366,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { class Visitor : public BrowserQueryInfoMap::Visitor { public: explicit Visitor(bool always_remove) - : always_remove_(always_remove), - removed_(false) {} + : always_remove_(always_remove), removed_(false) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -428,8 +422,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { } } - void SendQuerySuccess(QueryInfo* info, - const CefString& response) { + void SendQuerySuccess(QueryInfo* info, const CefString& response) { SendQuerySuccess(info->browser, info->context_id, info->request_id, response); } @@ -472,11 +465,12 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { } // Cancel a query that has not been sent to a handler. - void CancelUnhandledQuery(CefRefPtr browser, int context_id, + void CancelUnhandledQuery(CefRefPtr browser, + int context_id, int request_id) { - SendQueryFailure(browser, context_id, request_id, kCanceledErrorCode, - kCanceledErrorMessage); - } + SendQueryFailure(browser, context_id, request_id, kCanceledErrorCode, + kCanceledErrorMessage); + } // Cancel a query that has already been sent to a handler. void CancelQuery(int64 query_id, QueryInfo* info, bool notify_renderer) { @@ -503,8 +497,8 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { if (!CefCurrentlyOn(TID_UI)) { // Must execute on the UI thread. CefPostTask(TID_UI, - base::Bind(&CefMessageRouterBrowserSideImpl::CancelPendingFor, this, - browser, handler, notify_renderer)); + base::Bind(&CefMessageRouterBrowserSideImpl::CancelPendingFor, + this, browser, handler, notify_renderer)); return; } @@ -542,8 +536,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { if (browser.get()) { // Cancel all queries associated with the specified browser. - browser_query_info_map_.FindAll( - browser->GetIdentifier(), &visitor); + browser_query_info_map_.FindAll(browser->GetIdentifier(), &visitor); } else { // Cancel all queries for all browsers. browser_query_info_map_.FindAll(&visitor); @@ -558,9 +551,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { Visitor(CefMessageRouterBrowserSideImpl* router, int context_id, int request_id) - : router_(router), - context_id_(context_id), - request_id_(request_id) {} + : router_(router), context_id_(context_id), request_id_(request_id) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -571,7 +562,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { *remove = true; router_->CancelQuery(info_id, info, false); delete info; - + // Stop iterating if only canceling a single request. return (request_id_ == kReservedId); } @@ -614,13 +605,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { public: class V8HandlerImpl : public CefV8Handler { public: - V8HandlerImpl( - CefRefPtr router, - const CefMessageRouterConfig& config) - : router_(router), - config_(config), - context_id_(kReservedId) { - } + V8HandlerImpl(CefRefPtr router, + const CefMessageRouterConfig& config) + : router_(router), config_(config), context_id_(kReservedId) {} virtual bool Execute(const CefString& name, CefRefPtr object, @@ -637,9 +624,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { CefRefPtr requestVal = arg->GetValue(kMemberRequest); if (!requestVal.get() || !requestVal->IsString()) { - exception = "Invalid arguments; object member '"+ - std::string(kMemberRequest) +"' is required and must " - "have type string"; + exception = "Invalid arguments; object member '" + + std::string(kMemberRequest) + + "' is required and must have type string"; return true; } @@ -647,9 +634,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (arg->HasValue(kMemberOnSuccess)) { successVal = arg->GetValue(kMemberOnSuccess); if (!successVal->IsFunction()) { - exception = "Invalid arguments; object member '"+ - std::string(kMemberOnSuccess) +"' must have type " - "function"; + exception = "Invalid arguments; object member '" + + std::string(kMemberOnSuccess) + + "' must have type function"; return true; } } @@ -658,9 +645,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (arg->HasValue(kMemberOnFailure)) { failureVal = arg->GetValue(kMemberOnFailure); if (!failureVal->IsFunction()) { - exception = "Invalid arguments; object member '"+ - std::string(kMemberOnFailure) +"' must have type " - "function"; + exception = "Invalid arguments; object member '" + + std::string(kMemberOnFailure) + + "' must have type function"; return true; } } @@ -669,9 +656,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (arg->HasValue(kMemberPersistent)) { persistentVal = arg->GetValue(kMemberPersistent); if (!persistentVal->IsBool()) { - exception = "Invalid arguments; object member '"+ - std::string(kMemberPersistent) +"' must have type " - "boolean"; + exception = "Invalid arguments; object member '" + + std::string(kMemberPersistent) + + "' must have type boolean"; return true; } } @@ -699,8 +686,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (request_id != kReservedId) { CefRefPtr context = CefV8Context::GetCurrentContext(); const int context_id = GetIDForContext(context); - result = router_->SendCancel(context->GetBrowser(), - context_id, request_id); + result = router_->SendCancel(context->GetBrowser(), context_id, + request_id); } retval = CefV8Value::CreateBool(result); return true; @@ -724,16 +711,15 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { IMPLEMENT_REFCOUNTING(V8HandlerImpl); }; - explicit CefMessageRouterRendererSideImpl(const CefMessageRouterConfig& config) + explicit CefMessageRouterRendererSideImpl( + const CefMessageRouterConfig& config) : config_(config), - query_message_name_( - config.js_query_function.ToString() + kMessageSuffix), - cancel_message_name_( - config.js_cancel_function.ToString() + kMessageSuffix) { - } + query_message_name_(config.js_query_function.ToString() + + kMessageSuffix), + cancel_message_name_(config.js_cancel_function.ToString() + + kMessageSuffix) {} - virtual ~CefMessageRouterRendererSideImpl() { - } + virtual ~CefMessageRouterRendererSideImpl() {} virtual int GetPendingCount(CefRefPtr browser, CefRefPtr context) OVERRIDE { @@ -750,9 +736,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { // Need to iterate over each RequestInfo object to test the context. class Visitor : public BrowserRequestInfoMap::Visitor { public: - explicit Visitor(int context_id) - : context_id_(context_id), - count_(0) {} + explicit Visitor(int context_id) : context_id_(context_id), count_(0) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -774,8 +758,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (browser.get()) { // Count requests associated with the specified browser. - browser_request_info_map_.FindAll( - browser->GetIdentifier(), &visitor); + browser_request_info_map_.FindAll(browser->GetIdentifier(), &visitor); } else { // Count all requests for all browsers. browser_request_info_map_.FindAll(&visitor); @@ -803,8 +786,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { CefRefPtr handler = new V8HandlerImpl(this, config_); CefV8Value::PropertyAttribute attributes = static_cast( - V8_PROPERTY_ATTRIBUTE_READONLY | - V8_PROPERTY_ATTRIBUTE_DONTENUM | + V8_PROPERTY_ATTRIBUTE_READONLY | V8_PROPERTY_ATTRIBUTE_DONTENUM | V8_PROPERTY_ATTRIBUTE_DONTDELETE); // Add the query function. @@ -849,7 +831,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { if (is_success) { DCHECK_EQ(args->GetSize(), 4U); const CefString& response = args->GetString(3); - CefPostTask(TID_RENDERER, + CefPostTask( + TID_RENDERER, base::Bind( &CefMessageRouterRendererSideImpl::ExecuteSuccessCallback, this, browser->GetIdentifier(), context_id, request_id, response)); @@ -857,7 +840,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { DCHECK_EQ(args->GetSize(), 5U); int error_code = args->GetInt(3); const CefString& error_message = args->GetString(4); - CefPostTask(TID_RENDERER, + CefPostTask( + TID_RENDERER, base::Bind( &CefMessageRouterRendererSideImpl::ExecuteFailureCallback, this, browser->GetIdentifier(), context_id, request_id, error_code, @@ -896,8 +880,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { class Visitor : public BrowserRequestInfoMap::Visitor { public: explicit Visitor(bool always_remove) - : always_remove_(always_remove), - removed_(false) {} + : always_remove_(always_remove), removed_(false) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -915,8 +898,8 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { }; Visitor visitor(always_remove); - RequestInfo* info = browser_request_info_map_.Find(browser_id, - std::make_pair(request_id, context_id), &visitor); + RequestInfo* info = browser_request_info_map_.Find( + browser_id, std::make_pair(request_id, context_id), &visitor); if (info) *removed = visitor.removed(); return info; @@ -940,7 +923,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { info->success_callback = success_callback; info->failure_callback = failure_callback; browser_request_info_map_.Add(browser->GetIdentifier(), - std::make_pair(context_id, request_id), info); + std::make_pair(context_id, request_id), info); CefRefPtr message = CefProcessMessage::Create(query_message_name_); @@ -961,7 +944,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { // If |request_id| is kReservedId all requests associated with |context_id| // will be canceled, otherwise only the specified |request_id| will be - // canceled. Returns true if any request was canceled. + // canceled. Returns true if any request was canceled. bool SendCancel(CefRefPtr browser, int context_id, int request_id) { @@ -985,8 +968,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { class Visitor : public BrowserRequestInfoMap::Visitor { public: explicit Visitor(int context_id) - : context_id_(context_id), - cancel_count_(0) {} + : context_id_(context_id), cancel_count_(0) {} virtual bool OnNextInfo(int browser_id, InfoIdType info_id, @@ -1028,7 +1010,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { } // Execute the onSuccess JavaScript callback. - void ExecuteSuccessCallback(int browser_id, int context_id, int request_id, + void ExecuteSuccessCallback(int browser_id, + int context_id, + int request_id, const CefString& response) { CEF_REQUIRE_RENDERER_THREAD(); @@ -1050,8 +1034,11 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { } // Execute the onFailure JavaScript callback. - void ExecuteFailureCallback(int browser_id, int context_id, int request_id, - int error_code, const CefString& error_message) { + void ExecuteFailureCallback(int browser_id, + int context_id, + int request_id, + int error_code, + const CefString& error_message) { CEF_REQUIRE_RENDERER_THREAD(); bool removed; @@ -1128,7 +1115,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { // Map of context ID to CefV8Context for existing contexts. An entry is added // when a bound function is executed for the first time in the context and // removed when the context is released. - typedef std::map > ContextMap; + typedef std::map> ContextMap; ContextMap context_map_; DISALLOW_COPY_AND_ASSIGN(CefMessageRouterRendererSideImpl); @@ -1137,9 +1124,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { } // namespace CefMessageRouterConfig::CefMessageRouterConfig() - : js_query_function("cefQuery"), - js_cancel_function("cefQueryCancel") { -} + : js_query_function("cefQuery"), js_cancel_function("cefQueryCancel") {} // static CefRefPtr CefMessageRouterBrowserSide::Create( diff --git a/libcef_dll/wrapper/cef_resource_manager.cc b/libcef_dll/wrapper/cef_resource_manager.cc index 4ef459965..16cc91528 100644 --- a/libcef_dll/wrapper/cef_resource_manager.cc +++ b/libcef_dll/wrapper/cef_resource_manager.cc @@ -20,7 +20,7 @@ namespace { #else #define PATH_SEP '/' #endif - + // Returns |url| without the query or fragment components, if any. std::string GetUrlWithoutQueryOrFragment(const std::string& url) { // Find the first instance of '?' or '#'. @@ -49,16 +49,13 @@ std::string GetFilteredUrl(const std::string& url) { return url; } - // Provider of fixed contents. class ContentProvider : public CefResourceManager::Provider { public: ContentProvider(const std::string& url, const std::string& content, const std::string& mime_type) - : url_(url), - content_(content), - mime_type_(mime_type) { + : url_(url), content_(content), mime_type_(mime_type) { DCHECK(!url.empty()); DCHECK(!content.empty()); } @@ -72,10 +69,9 @@ class ContentProvider : public CefResourceManager::Provider { return false; } - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(content_.data())), - content_.length()); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(content_.data())), + content_.length()); // Determine the mime type a single time if it isn't already set. if (mime_type_.empty()) @@ -93,14 +89,12 @@ class ContentProvider : public CefResourceManager::Provider { DISALLOW_COPY_AND_ASSIGN(ContentProvider); }; - // Provider of contents loaded from a directory on the file system. class DirectoryProvider : public CefResourceManager::Provider { public: DirectoryProvider(const std::string& url_path, const std::string& directory_path) - : url_path_(url_path), - directory_path_(directory_path) { + : url_path_(url_path), directory_path_(directory_path) { DCHECK(!url_path_.empty()); DCHECK(!directory_path_.empty()); @@ -122,8 +116,8 @@ class DirectoryProvider : public CefResourceManager::Provider { const std::string& file_path = GetFilePath(url); // Open |file_path| on the FILE thread. - CefPostTask(TID_FILE, - base::Bind(&DirectoryProvider::OpenOnFileThread, file_path, request)); + CefPostTask(TID_FILE, base::Bind(&DirectoryProvider::OpenOnFileThread, + file_path, request)); return true; } @@ -146,9 +140,8 @@ class DirectoryProvider : public CefResourceManager::Provider { CefStreamReader::CreateForFile(file_path); // Continue loading on the IO thread. - CefPostTask(TID_IO, - base::Bind(&DirectoryProvider::ContinueOpenOnIOThread, request, - stream)); + CefPostTask(TID_IO, base::Bind(&DirectoryProvider::ContinueOpenOnIOThread, + request, stream)); } static void ContinueOpenOnIOThread( @@ -159,8 +152,7 @@ class DirectoryProvider : public CefResourceManager::Provider { CefRefPtr handler; if (stream.get()) { handler = new CefStreamResourceHandler( - request->mime_type_resolver().Run(request->url()), - stream); + request->mime_type_resolver().Run(request->url()), stream); } request->Continue(handler); } @@ -171,19 +163,18 @@ class DirectoryProvider : public CefResourceManager::Provider { DISALLOW_COPY_AND_ASSIGN(DirectoryProvider); }; - // Provider of contents loaded from an archive file. class ArchiveProvider : public CefResourceManager::Provider { public: ArchiveProvider(const std::string& url_path, const std::string& archive_path, const std::string& password) - : url_path_(url_path), - archive_path_(archive_path), - password_(password), - archive_load_started_(false), - archive_load_ended_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { + : url_path_(url_path), + archive_path_(archive_path), + password_(password), + archive_load_started_(false), + archive_load_ended_(false), + ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { DCHECK(!url_path_.empty()); DCHECK(!archive_path_.empty()); @@ -207,9 +198,9 @@ class ArchiveProvider : public CefResourceManager::Provider { pending_requests_.push_back(request); // Load the archive file on the FILE thread. - CefPostTask(TID_FILE, - base::Bind(&ArchiveProvider::LoadOnFileThread, - weak_ptr_factory_.GetWeakPtr(), archive_path_, password_)); + CefPostTask(TID_FILE, base::Bind(&ArchiveProvider::LoadOnFileThread, + weak_ptr_factory_.GetWeakPtr(), + archive_path_, password_)); return true; } @@ -244,7 +235,7 @@ class ArchiveProvider : public CefResourceManager::Provider { } CefPostTask(TID_IO, - base::Bind(&ArchiveProvider::ContinueOnIOThread, ptr, archive)); + base::Bind(&ArchiveProvider::ContinueOnIOThread, ptr, archive)); } void ContinueOnIOThread(CefRefPtr archive) { @@ -272,8 +263,7 @@ class ArchiveProvider : public CefResourceManager::Provider { CefRefPtr file = archive_->GetFile(relative_path); if (file.get()) { handler = new CefStreamResourceHandler( - request->mime_type_resolver().Run(url), - file->GetStreamReader()); + request->mime_type_resolver().Run(url), file->GetStreamReader()); } } @@ -293,7 +283,7 @@ class ArchiveProvider : public CefResourceManager::Provider { CefRefPtr archive_; // List of requests that are pending while the archive is being loaded. - typedef std::vector > + typedef std::vector> PendingRequests; PendingRequests pending_requests_; @@ -305,18 +295,14 @@ class ArchiveProvider : public CefResourceManager::Provider { } // namespace - // CefResourceManager::ProviderEntry implementation. struct CefResourceManager::ProviderEntry { - ProviderEntry(Provider* provider, - int order, - const std::string& identifier) - : provider_(provider), - order_(order), - identifier_(identifier), - deletion_pending_(false) { - } + ProviderEntry(Provider* provider, int order, const std::string& identifier) + : provider_(provider), + order_(order), + identifier_(identifier), + deletion_pending_(false) {} scoped_ptr provider_; int order_; @@ -329,7 +315,6 @@ struct CefResourceManager::ProviderEntry { bool deletion_pending_; }; - // CefResourceManager::RequestState implementation. CefResourceManager::RequestState::~RequestState() { @@ -338,14 +323,13 @@ CefResourceManager::RequestState::~RequestState() { callback_->Continue(true); } - // CefResourceManager::Request implementation. void CefResourceManager::Request::Continue( CefRefPtr handler) { if (!CefCurrentlyOn(TID_IO)) { - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::Request::Continue, this, handler)); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::Request::Continue, this, + handler)); return; } @@ -356,14 +340,13 @@ void CefResourceManager::Request::Continue( // not called unexpectedly if Provider::OnRequest calls this method and then // calls CefResourceManager::Remove*. CefPostTask(TID_IO, - base::Bind(&CefResourceManager::Request::ContinueOnIOThread, - base::Passed(&state_), handler)); + base::Bind(&CefResourceManager::Request::ContinueOnIOThread, + base::Passed(&state_), handler)); } void CefResourceManager::Request::Stop() { if (!CefCurrentlyOn(TID_IO)) { - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::Request::Stop, this)); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::Request::Stop, this)); return; } @@ -373,14 +356,12 @@ void CefResourceManager::Request::Stop() { // Disassociate |state_| immediately so that Provider::OnRequestCanceled is // not called unexpectedly if Provider::OnRequest calls this method and then // calls CefResourceManager::Remove*. - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::Request::StopOnIOThread, - base::Passed(&state_))); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::Request::StopOnIOThread, + base::Passed(&state_))); } CefResourceManager::Request::Request(scoped_ptr state) - : state_(state.Pass()), - params_(state_->params_) { + : state_(state.Pass()), params_(state_->params_) { CEF_REQUIRE_IO_THREAD(); ProviderEntry* entry = *(state_->current_entry_pos_); @@ -397,7 +378,7 @@ CefResourceManager::Request::Request(scoped_ptr state) // executes a callback before returning, in which case execution will continue // asynchronously in any case. scoped_ptr - CefResourceManager::Request::SendRequest() { +CefResourceManager::Request::SendRequest() { CEF_REQUIRE_IO_THREAD(); Provider* provider = (*state_->current_entry_pos_)->provider_.get(); if (!provider->OnRequest(this)) @@ -431,13 +412,11 @@ void CefResourceManager::Request::StopOnIOThread( manager->StopRequest(state.Pass()); } - // CefResourceManager implementation. CefResourceManager::CefResourceManager() : url_filter_(base::Bind(GetFilteredUrl)), - mime_type_resolver_(base::Bind(GetMimeType)) { -} + mime_type_resolver_(base::Bind(GetMimeType)) {} CefResourceManager::~CefResourceManager() { CEF_REQUIRE_IO_THREAD(); @@ -461,22 +440,21 @@ void CefResourceManager::AddContentProvider(const std::string& url, AddProvider(new ContentProvider(url, content, mime_type), order, identifier); } -void CefResourceManager::AddDirectoryProvider( - const std::string& url_path, - const std::string& directory_path, - int order, - const std::string& identifier) { - AddProvider(new DirectoryProvider(url_path, directory_path), - order, identifier); +void CefResourceManager::AddDirectoryProvider(const std::string& url_path, + const std::string& directory_path, + int order, + const std::string& identifier) { + AddProvider(new DirectoryProvider(url_path, directory_path), order, + identifier); } - + void CefResourceManager::AddArchiveProvider(const std::string& url_path, const std::string& archive_path, const std::string& password, int order, const std::string& identifier) { - AddProvider(new ArchiveProvider(url_path, archive_path, password), - order, identifier); + AddProvider(new ArchiveProvider(url_path, archive_path, password), order, + identifier); } void CefResourceManager::AddProvider(Provider* provider, @@ -487,9 +465,8 @@ void CefResourceManager::AddProvider(Provider* provider, return; if (!CefCurrentlyOn(TID_IO)) { - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::AddProvider, this, provider, order, - identifier)); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::AddProvider, this, + provider, order, identifier)); return; } @@ -513,8 +490,8 @@ void CefResourceManager::AddProvider(Provider* provider, void CefResourceManager::RemoveProviders(const std::string& identifier) { if (!CefCurrentlyOn(TID_IO)) { - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::RemoveProviders, this, identifier)); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::RemoveProviders, this, + identifier)); return; } @@ -533,7 +510,7 @@ void CefResourceManager::RemoveProviders(const std::string& identifier) { void CefResourceManager::RemoveAllProviders() { if (!CefCurrentlyOn(TID_IO)) { CefPostTask(TID_IO, - base::Bind(&CefResourceManager::RemoveAllProviders, this)); + base::Bind(&CefResourceManager::RemoveAllProviders, this)); return; } @@ -547,8 +524,8 @@ void CefResourceManager::RemoveAllProviders() { void CefResourceManager::SetMimeTypeResolver(const MimeTypeResolver& resolver) { if (!CefCurrentlyOn(TID_IO)) { - CefPostTask(TID_IO, - base::Bind(&CefResourceManager::SetMimeTypeResolver, this, resolver)); + CefPostTask(TID_IO, base::Bind(&CefResourceManager::SetMimeTypeResolver, + this, resolver)); return; } @@ -561,7 +538,7 @@ void CefResourceManager::SetMimeTypeResolver(const MimeTypeResolver& resolver) { void CefResourceManager::SetUrlFilter(const UrlFilter& filter) { if (!CefCurrentlyOn(TID_IO)) { CefPostTask(TID_IO, - base::Bind(&CefResourceManager::SetUrlFilter, this, filter)); + base::Bind(&CefResourceManager::SetUrlFilter, this, filter)); return; } @@ -581,7 +558,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad( // Find the first provider that is not pending deletion. ProviderEntryList::iterator current_entry_pos = providers_.begin(); GetNextValidProvider(current_entry_pos); - + if (current_entry_pos == providers_.end()) { // No providers so continue the request immediately. return RV_CONTINUE; @@ -712,8 +689,7 @@ bool CefResourceManager::IncrementProvider(RequestState* state) { void CefResourceManager::DetachRequestFromProvider(RequestState* state) { if (state->current_entry_pos_ != providers_.end()) { // Remove the association from the current provider entry. - ProviderEntryList::iterator current_entry_pos = - state->current_entry_pos_; + ProviderEntryList::iterator current_entry_pos = state->current_entry_pos_; ProviderEntry* current_entry = *(current_entry_pos); current_entry->pending_requests_.erase(state->current_request_pos_); diff --git a/libcef_dll/wrapper/cef_scoped_temp_dir.cc b/libcef_dll/wrapper/cef_scoped_temp_dir.cc index d0a55f48c..9269aba40 100644 --- a/libcef_dll/wrapper/cef_scoped_temp_dir.cc +++ b/libcef_dll/wrapper/cef_scoped_temp_dir.cc @@ -7,8 +7,7 @@ #include "include/base/cef_logging.h" #include "include/cef_file_util.h" -CefScopedTempDir::CefScopedTempDir() { -} +CefScopedTempDir::CefScopedTempDir() {} CefScopedTempDir::~CefScopedTempDir() { if (!path_.empty() && !Delete()) diff --git a/libcef_dll/wrapper/cef_stream_resource_handler.cc b/libcef_dll/wrapper/cef_stream_resource_handler.cc index ed6a2c435..0362c705e 100644 --- a/libcef_dll/wrapper/cef_stream_resource_handler.cc +++ b/libcef_dll/wrapper/cef_stream_resource_handler.cc @@ -18,12 +18,7 @@ // Class that represents a readable/writable character buffer. class CefStreamResourceHandler::Buffer { public: - Buffer() - : size_(0), - bytes_requested_(0), - bytes_written_(0), - bytes_read_(0) { - } + Buffer() : size_(0), bytes_requested_(0), bytes_written_(0), bytes_read_(0) {} void Reset(int new_size) { if (size_ < new_size) { @@ -36,19 +31,15 @@ class CefStreamResourceHandler::Buffer { bytes_read_ = 0; } - bool IsEmpty() const { - return (bytes_written_ == 0); - } + bool IsEmpty() const { return (bytes_written_ == 0); } - bool CanRead() const { - return (bytes_read_ < bytes_written_); - } + bool CanRead() const { return (bytes_read_ < bytes_written_); } int WriteTo(void* data_out, int bytes_to_read) { const int write_size = std::min(bytes_to_read, bytes_written_ - bytes_read_); if (write_size > 0) { - memcpy(data_out, buffer_ .get() + bytes_read_, write_size); + memcpy(data_out, buffer_.get() + bytes_read_, write_size); bytes_read_ += write_size; } return write_size; @@ -59,9 +50,9 @@ class CefStreamResourceHandler::Buffer { // more data. int bytes_read; do { - bytes_read = static_cast( - reader->Read(buffer_.get() + bytes_written_, 1, - bytes_requested_ - bytes_written_)); + bytes_read = + static_cast(reader->Read(buffer_.get() + bytes_written_, 1, + bytes_requested_ - bytes_written_)); bytes_written_ += bytes_read; } while (bytes_read != 0 && bytes_written_ < bytes_requested_); @@ -86,7 +77,8 @@ CefStreamResourceHandler::CefStreamResourceHandler( mime_type_(mime_type), stream_(stream) #if DCHECK_IS_ON() - , buffer_owned_by_file_thread_(false) + , + buffer_owned_by_file_thread_(false) #endif { DCHECK(!mime_type_.empty()); @@ -106,7 +98,8 @@ CefStreamResourceHandler::CefStreamResourceHandler( header_map_(header_map), stream_(stream) #if DCHECK_IS_ON() - , buffer_owned_by_file_thread_(false) + , + buffer_owned_by_file_thread_(false) #endif { DCHECK(!mime_type_.empty()); @@ -114,8 +107,7 @@ CefStreamResourceHandler::CefStreamResourceHandler( read_on_file_thread_ = stream_->MayBlock(); } -CefStreamResourceHandler::~CefStreamResourceHandler() { -} +CefStreamResourceHandler::~CefStreamResourceHandler() {} bool CefStreamResourceHandler::ProcessRequest(CefRefPtr request, CefRefPtr callback) { @@ -164,8 +156,8 @@ bool CefStreamResourceHandler::ReadResponse(void* data_out, buffer_owned_by_file_thread_ = true; #endif CefPostTask(TID_FILE, - base::Bind(&CefStreamResourceHandler::ReadOnFileThread, this, - bytes_to_read, callback)); + base::Bind(&CefStreamResourceHandler::ReadOnFileThread, this, + bytes_to_read, callback)); return true; } } else { @@ -184,8 +176,7 @@ bool CefStreamResourceHandler::ReadResponse(void* data_out, } } -void CefStreamResourceHandler::Cancel() { -} +void CefStreamResourceHandler::Cancel() {} void CefStreamResourceHandler::ReadOnFileThread( int bytes_to_read, diff --git a/libcef_dll/wrapper/cef_xml_object.cc b/libcef_dll/wrapper/cef_xml_object.cc index 7e0d1712a..18bae1edb 100644 --- a/libcef_dll/wrapper/cef_xml_object.cc +++ b/libcef_dll/wrapper/cef_xml_object.cc @@ -15,8 +15,7 @@ namespace { class CefXmlObjectLoader { public: explicit CefXmlObjectLoader(CefRefPtr root_object) - : root_object_(root_object) { - } + : root_object_(root_object) {} bool Load(CefRefPtr stream, CefXmlReader::EncodingType encodingType, @@ -59,8 +58,8 @@ class CefXmlObjectLoader { } else { // Value following a child element is not allowed. std::stringstream ss; - ss << "Value following child element, line " << - reader->GetLineNumber(); + ss << "Value following child element, line " + << reader->GetLineNumber(); load_error_ = ss.str(); ret = false; break; @@ -82,7 +81,7 @@ class CefXmlObjectLoader { // Read all object attributes. do { new_object->SetAttributeValue(reader->GetQualifiedName(), - reader->GetValue()); + reader->GetValue()); } while (reader->MoveToNextAttribute()); reader->MoveToCarryingElement(); } @@ -107,9 +106,9 @@ class CefXmlObjectLoader { // never occur (the parser catches this error). NOTREACHED(); std::stringstream ss; - ss << "Mismatched end tag for " << - std::string(cur_object->GetName()) << - ", line " << reader->GetLineNumber(); + ss << "Mismatched end tag for " + << std::string(cur_object->GetName()) << ", line " + << reader->GetLineNumber(); load_error_ = ss.str(); ret = false; break; @@ -129,8 +128,8 @@ class CefXmlObjectLoader { } else { // Value following a child element is not allowed. std::stringstream ss; - ss << "Value following child element, line " << - reader->GetLineNumber(); + ss << "Value following child element, line " + << reader->GetLineNumber(); load_error_ = ss.str(); ret = false; break; @@ -159,15 +158,14 @@ class CefXmlObjectLoader { } // namespace CefXmlObject::CefXmlObject(const CefString& name) - : name_(name), parent_(NULL) { -} + : name_(name), parent_(NULL) {} -CefXmlObject::~CefXmlObject() { -} +CefXmlObject::~CefXmlObject() {} bool CefXmlObject::Load(CefRefPtr stream, CefXmlReader::EncodingType encodingType, - const CefString& URI, CefString* loadError) { + const CefString& URI, + CefString* loadError) { Clear(); CefXmlObjectLoader loader(this); diff --git a/libcef_dll/wrapper/cef_zip_archive.cc b/libcef_dll/wrapper/cef_zip_archive.cc index 8be28b617..a0d12bf17 100644 --- a/libcef_dll/wrapper/cef_zip_archive.cc +++ b/libcef_dll/wrapper/cef_zip_archive.cc @@ -47,9 +47,8 @@ class CefZipFile : public CefZipArchive::File { virtual size_t GetDataSize() const OVERRIDE { return data_size_; } virtual CefRefPtr GetStreamReader() const OVERRIDE { - CefRefPtr handler( - new CefByteReadHandler(data_.get(), data_size_, - const_cast(this))); + CefRefPtr handler(new CefByteReadHandler( + data_.get(), data_size_, const_cast(this))); return CefStreamReader::CreateForHandler(handler); } @@ -67,11 +66,9 @@ class CefZipFile : public CefZipArchive::File { // CefZipArchive implementation -CefZipArchive::CefZipArchive() { -} +CefZipArchive::CefZipArchive() {} -CefZipArchive::~CefZipArchive() { -} +CefZipArchive::~CefZipArchive() {} size_t CefZipArchive::Load(CefRefPtr stream, const CefString& password, @@ -116,7 +113,7 @@ size_t CefZipArchive::Load(CefRefPtr stream, // Read the file contents. do { - offset += reader->ReadFile(data + offset, size - offset); + offset += reader->ReadFile(data + offset, size - offset); } while (offset < size && !reader->Eof()); DCHECK(offset == size); diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index efa5c73e9..084b26425 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -9,48 +9,48 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=62ad3894d1548a39b032798d25a7a9b157f8a7bc$ +// -#include "include/cef_app.h" #include "include/capi/cef_app_capi.h" -#include "include/cef_crash_util.h" #include "include/capi/cef_crash_util_capi.h" -#include "include/cef_file_util.h" #include "include/capi/cef_file_util_capi.h" -#include "include/cef_geolocation.h" #include "include/capi/cef_geolocation_capi.h" -#include "include/cef_origin_whitelist.h" #include "include/capi/cef_origin_whitelist_capi.h" -#include "include/cef_parser.h" #include "include/capi/cef_parser_capi.h" -#include "include/cef_path_util.h" #include "include/capi/cef_path_util_capi.h" -#include "include/cef_process_util.h" #include "include/capi/cef_process_util_capi.h" -#include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" -#include "include/cef_ssl_info.h" #include "include/capi/cef_ssl_info_capi.h" -#include "include/cef_task.h" #include "include/capi/cef_task_capi.h" -#include "include/cef_trace.h" #include "include/capi/cef_trace_capi.h" -#include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" -#include "include/cef_web_plugin.h" #include "include/capi/cef_web_plugin_capi.h" +#include "include/cef_app.h" +#include "include/cef_crash_util.h" +#include "include/cef_file_util.h" +#include "include/cef_geolocation.h" +#include "include/cef_origin_whitelist.h" +#include "include/cef_parser.h" +#include "include/cef_path_util.h" +#include "include/cef_process_util.h" +#include "include/cef_scheme.h" +#include "include/cef_ssl_info.h" +#include "include/cef_task.h" +#include "include/cef_trace.h" +#include "include/cef_v8.h" #include "include/cef_version.h" +#include "include/cef_web_plugin.h" #include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h" #include "libcef_dll/cpptoc/app_cpptoc.h" #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" -#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" -#include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" #include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" -#include "libcef_dll/cpptoc/domvisitor_cpptoc.h" #include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h" #include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" #include "libcef_dll/cpptoc/display_handler_cpptoc.h" +#include "libcef_dll/cpptoc/domvisitor_cpptoc.h" #include "libcef_dll/cpptoc/download_handler_cpptoc.h" #include "libcef_dll/cpptoc/download_image_callback_cpptoc.h" #include "libcef_dll/cpptoc/drag_handler_cpptoc.h" @@ -63,10 +63,8 @@ #include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" #include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" #include "libcef_dll/cpptoc/load_handler_cpptoc.h" -#include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" #include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h" #include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" -#include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h" #include "libcef_dll/cpptoc/pdf_print_callback_cpptoc.h" #include "libcef_dll/cpptoc/print_handler_cpptoc.h" #include "libcef_dll/cpptoc/read_handler_cpptoc.h" @@ -83,74 +81,67 @@ #include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h" #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" #include "libcef_dll/cpptoc/task_cpptoc.h" -#include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" -#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" #include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" #include "libcef_dll/cpptoc/v8accessor_cpptoc.h" #include "libcef_dll/cpptoc/v8handler_cpptoc.h" #include "libcef_dll/cpptoc/v8interceptor_cpptoc.h" +#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" +#include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" +#include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" +#include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h" +#include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h" #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" +#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" #include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h" #include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" -#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" #include "libcef_dll/cpptoc/write_handler_cpptoc.h" #include "libcef_dll/ctocpp/auth_callback_ctocpp.h" #include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" #include "libcef_dll/ctocpp/binary_value_ctocpp.h" -#include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" #include "libcef_dll/ctocpp/browser_ctocpp.h" #include "libcef_dll/ctocpp/browser_host_ctocpp.h" -#include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" -#include "libcef_dll/ctocpp/views/button_ctocpp.h" #include "libcef_dll/ctocpp/callback_ctocpp.h" #include "libcef_dll/ctocpp/command_line_ctocpp.h" #include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" +#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" #include "libcef_dll/ctocpp/domdocument_ctocpp.h" #include "libcef_dll/ctocpp/domnode_ctocpp.h" -#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" -#include "libcef_dll/ctocpp/views/display_ctocpp.h" -#include "libcef_dll/ctocpp/download_item_ctocpp.h" #include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" +#include "libcef_dll/ctocpp/download_item_ctocpp.h" #include "libcef_dll/ctocpp/drag_data_ctocpp.h" #include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" -#include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" #include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" #include "libcef_dll/ctocpp/image_ctocpp.h" #include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" -#include "libcef_dll/ctocpp/views/label_button_ctocpp.h" -#include "libcef_dll/ctocpp/views/layout_ctocpp.h" #include "libcef_dll/ctocpp/list_value_ctocpp.h" -#include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" #include "libcef_dll/ctocpp/menu_model_ctocpp.h" #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" -#include "libcef_dll/ctocpp/views/panel_ctocpp.h" #include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" #include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" #include "libcef_dll/ctocpp/print_settings_ctocpp.h" #include "libcef_dll/ctocpp/process_message_ctocpp.h" #include "libcef_dll/ctocpp/request_callback_ctocpp.h" #include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" +#include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h" #include "libcef_dll/ctocpp/sslinfo_ctocpp.h" #include "libcef_dll/ctocpp/sslstatus_ctocpp.h" -#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" -#include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" -#include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h" #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" #include "libcef_dll/ctocpp/stream_writer_ctocpp.h" #include "libcef_dll/ctocpp/task_runner_ctocpp.h" -#include "libcef_dll/ctocpp/views/textfield_ctocpp.h" -#include "libcef_dll/ctocpp/thread_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" -#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" +#include "libcef_dll/ctocpp/thread_ctocpp.h" #include "libcef_dll/ctocpp/urlrequest_ctocpp.h" #include "libcef_dll/ctocpp/v8context_ctocpp.h" #include "libcef_dll/ctocpp/v8exception_ctocpp.h" @@ -158,10 +149,21 @@ #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" #include "libcef_dll/ctocpp/v8value_ctocpp.h" #include "libcef_dll/ctocpp/value_ctocpp.h" +#include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" +#include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" +#include "libcef_dll/ctocpp/views/button_ctocpp.h" +#include "libcef_dll/ctocpp/views/display_ctocpp.h" +#include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" +#include "libcef_dll/ctocpp/views/label_button_ctocpp.h" +#include "libcef_dll/ctocpp/views/layout_ctocpp.h" +#include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" +#include "libcef_dll/ctocpp/views/panel_ctocpp.h" +#include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" +#include "libcef_dll/ctocpp/views/textfield_ctocpp.h" #include "libcef_dll/ctocpp/views/view_ctocpp.h" +#include "libcef_dll/ctocpp/views/window_ctocpp.h" #include "libcef_dll/ctocpp/waitable_event_ctocpp.h" #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" -#include "libcef_dll/ctocpp/views/window_ctocpp.h" #include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h" #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" #include "libcef_dll/ctocpp/xml_reader_ctocpp.h" @@ -171,11 +173,11 @@ // Define used to facilitate parsing. #define CEF_GLOBAL - // GLOBAL METHODS - Body may be edited by hand. CEF_GLOBAL int CefExecuteProcess(const CefMainArgs& args, - CefRefPtr application, void* windows_sandbox_info) { + CefRefPtr application, + void* windows_sandbox_info) { const char* api_hash = cef_api_hash(0); if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { // The libcef API hash does not match the current header API hash. @@ -188,18 +190,17 @@ CEF_GLOBAL int CefExecuteProcess(const CefMainArgs& args, // Unverified params: application, windows_sandbox_info // Execute - int _retval = cef_execute_process( - &args, - CefAppCppToC::Wrap(application), - windows_sandbox_info); + int _retval = cef_execute_process(&args, CefAppCppToC::Wrap(application), + windows_sandbox_info); // Return type: simple return _retval; } CEF_GLOBAL bool CefInitialize(const CefMainArgs& args, - const CefSettings& settings, CefRefPtr application, - void* windows_sandbox_info) { + const CefSettings& settings, + CefRefPtr application, + void* windows_sandbox_info) { const char* api_hash = cef_api_hash(0); if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { // The libcef API hash does not match the current header API hash. @@ -213,13 +214,10 @@ CEF_GLOBAL bool CefInitialize(const CefMainArgs& args, // Execute int _retval = cef_initialize( - &args, - &settings, - CefAppCppToC::Wrap(application), - windows_sandbox_info); + &args, &settings, CefAppCppToC::Wrap(application), windows_sandbox_info); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL void CefShutdown() { @@ -230,17 +228,17 @@ CEF_GLOBAL void CefShutdown() { #if DCHECK_IS_ON() // Check that all wrapper objects have been destroyed - DCHECK(base::AtomicRefCountIsZero( - &CefAccessibilityHandlerCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefAccessibilityHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefBeforeDownloadCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefBeforeDownloadCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBinaryValueCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBoxLayoutCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserHostCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefBrowserProcessHandlerCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefBrowserProcessHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserViewCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefBrowserViewDelegateCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefButtonCToCpp::DebugObjCt)); @@ -253,18 +251,18 @@ CEF_GLOBAL void CefShutdown() { DCHECK(base::AtomicRefCountIsZero(&CefDOMDocumentCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDOMNodeCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDOMVisitorCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDeleteCookiesCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDeleteCookiesCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDialogHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDictionaryValueCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDisplayCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDisplayHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDownloadHandlerCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDownloadImageCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDownloadImageCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDownloadItemCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefDownloadItemCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefDownloadItemCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDragDataCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCppToC::DebugObjCt)); @@ -275,8 +273,8 @@ CEF_GLOBAL void CefShutdown() { DCHECK(base::AtomicRefCountIsZero(&CefFrameCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefGeolocationHandlerCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefGetGeolocationCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefGetGeolocationCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefImageCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefJSDialogCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefJSDialogHandlerCppToC::DebugObjCt)); @@ -291,8 +289,8 @@ CEF_GLOBAL void CefShutdown() { DCHECK(base::AtomicRefCountIsZero(&CefMenuModelCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefMenuModelDelegateCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefNavigationEntryCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefNavigationEntryVisitorCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefNavigationEntryVisitorCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPanelCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPanelDelegateCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefPdfPrintCallbackCppToC::DebugObjCt)); @@ -304,23 +302,23 @@ CEF_GLOBAL void CefShutdown() { DCHECK(base::AtomicRefCountIsZero(&CefReadHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRegisterCdmCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRenderHandlerCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRenderProcessHandlerCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRenderProcessHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRequestCallbackCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefRequestHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResolveCallbackCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefResourceBundleHandlerCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefResourceBundleHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResourceHandlerCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefResponseFilterCppToC::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRunContextMenuCallbackCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefRunFileDialogCallbackCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRunContextMenuCallbackCToCpp::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefRunFileDialogCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSSLInfoCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSSLStatusCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefSchemeHandlerFactoryCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefSchemeHandlerFactoryCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefSchemeRegistrarCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefScrollViewCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero( @@ -370,8 +368,8 @@ CEF_GLOBAL void CefShutdown() { DCHECK(base::AtomicRefCountIsZero(&CefViewDelegateCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWaitableEventCToCpp::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWebPluginInfoCToCpp::DebugObjCt)); - DCHECK(base::AtomicRefCountIsZero( - &CefWebPluginInfoVisitorCppToC::DebugObjCt)); + DCHECK( + base::AtomicRefCountIsZero(&CefWebPluginInfoVisitorCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero( &CefWebPluginUnstableCallbackCppToC::DebugObjCt)); DCHECK(base::AtomicRefCountIsZero(&CefWindowCToCpp::DebugObjCt)); @@ -409,8 +407,7 @@ CEF_GLOBAL void CefSetOSModalLoop(bool osModalLoop) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_set_osmodal_loop( - osModalLoop); + cef_set_osmodal_loop(osModalLoop); } CEF_GLOBAL void CefEnableHighDPISupport() { @@ -427,11 +424,11 @@ CEF_GLOBAL bool CefCrashReportingEnabled() { int _retval = cef_crash_reporting_enabled(); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL void CefSetCrashKeyValue(const CefString& key, - const CefString& value) { + const CefString& value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: key; type: string_byref_const @@ -441,9 +438,7 @@ CEF_GLOBAL void CefSetCrashKeyValue(const CefString& key, // Unverified params: value // Execute - cef_set_crash_key_value( - key.GetStruct(), - value.GetStruct()); + cef_set_crash_key_value(key.GetStruct(), value.GetStruct()); } CEF_GLOBAL bool CefCreateDirectory(const CefString& full_path) { @@ -455,41 +450,39 @@ CEF_GLOBAL bool CefCreateDirectory(const CefString& full_path) { return false; // Execute - int _retval = cef_create_directory( - full_path.GetStruct()); + int _retval = cef_create_directory(full_path.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefGetTempDirectory(CefString& temp_dir) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_get_temp_directory( - temp_dir.GetWritableStruct()); + int _retval = cef_get_temp_directory(temp_dir.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefCreateNewTempDirectory(const CefString& prefix, - CefString& new_temp_path) { + CefString& new_temp_path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: prefix // Execute int _retval = cef_create_new_temp_directory( - prefix.GetStruct(), - new_temp_path.GetWritableStruct()); + prefix.GetStruct(), new_temp_path.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefCreateTempDirectoryInDirectory(const CefString& base_dir, - const CefString& prefix, CefString& new_dir) { + const CefString& prefix, + CefString& new_dir) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: base_dir; type: string_byref_const @@ -500,12 +493,10 @@ CEF_GLOBAL bool CefCreateTempDirectoryInDirectory(const CefString& base_dir, // Execute int _retval = cef_create_temp_directory_in_directory( - base_dir.GetStruct(), - prefix.GetStruct(), - new_dir.GetWritableStruct()); + base_dir.GetStruct(), prefix.GetStruct(), new_dir.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefDirectoryExists(const CefString& path) { @@ -517,11 +508,10 @@ CEF_GLOBAL bool CefDirectoryExists(const CefString& path) { return false; // Execute - int _retval = cef_directory_exists( - path.GetStruct()); + int _retval = cef_directory_exists(path.GetStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefDeleteFile(const CefString& path, bool recursive) { @@ -533,16 +523,15 @@ CEF_GLOBAL bool CefDeleteFile(const CefString& path, bool recursive) { return false; // Execute - int _retval = cef_delete_file( - path.GetStruct(), - recursive); + int _retval = cef_delete_file(path.GetStruct(), recursive); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefZipDirectory(const CefString& src_dir, - const CefString& dest_file, bool include_hidden_files) { + const CefString& dest_file, + bool include_hidden_files) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: src_dir; type: string_byref_const @@ -555,13 +544,11 @@ CEF_GLOBAL bool CefZipDirectory(const CefString& src_dir, return false; // Execute - int _retval = cef_zip_directory( - src_dir.GetStruct(), - dest_file.GetStruct(), - include_hidden_files); + int _retval = cef_zip_directory(src_dir.GetStruct(), dest_file.GetStruct(), + include_hidden_files); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefGetGeolocation( @@ -574,15 +561,17 @@ CEF_GLOBAL bool CefGetGeolocation( return false; // Execute - int _retval = cef_get_geolocation( - CefGetGeolocationCallbackCppToC::Wrap(callback)); + int _retval = + cef_get_geolocation(CefGetGeolocationCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, - const CefString& target_protocol, const CefString& target_domain, +CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry( + const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, bool allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -598,18 +587,18 @@ CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, // Execute int _retval = cef_add_cross_origin_whitelist_entry( - source_origin.GetStruct(), - target_protocol.GetStruct(), - target_domain.GetStruct(), - allow_target_subdomains); + source_origin.GetStruct(), target_protocol.GetStruct(), + target_domain.GetStruct(), allow_target_subdomains); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( - const CefString& source_origin, const CefString& target_protocol, - const CefString& target_domain, bool allow_target_subdomains) { + const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, + bool allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -624,13 +613,11 @@ CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( // Execute int _retval = cef_remove_cross_origin_whitelist_entry( - source_origin.GetStruct(), - target_protocol.GetStruct(), - target_domain.GetStruct(), - allow_target_subdomains); + source_origin.GetStruct(), target_protocol.GetStruct(), + target_domain.GetStruct(), allow_target_subdomains); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefClearCrossOriginWhitelist() { @@ -640,7 +627,7 @@ CEF_GLOBAL bool CefClearCrossOriginWhitelist() { int _retval = cef_clear_cross_origin_whitelist(); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) { @@ -652,28 +639,24 @@ CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) { return false; // Execute - int _retval = cef_parse_url( - url.GetStruct(), - &parts); + int _retval = cef_parse_url(url.GetStruct(), &parts); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_create_url( - &parts, - url.GetWritableStruct()); + int _retval = cef_create_url(&parts, url.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CEF_GLOBAL CefString CefFormatUrlForSecurityDisplay( - const CefString& origin_url) { +CEF_GLOBAL CefString +CefFormatUrlForSecurityDisplay(const CefString& origin_url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: origin_url; type: string_byref_const @@ -682,8 +665,8 @@ CEF_GLOBAL CefString CefFormatUrlForSecurityDisplay( return CefString(); // Execute - cef_string_userfree_t _retval = cef_format_url_for_security_display( - origin_url.GetStruct()); + cef_string_userfree_t _retval = + cef_format_url_for_security_display(origin_url.GetStruct()); // Return type: string CefString _retvalStr; @@ -700,8 +683,7 @@ CEF_GLOBAL CefString CefGetMimeType(const CefString& extension) { return CefString(); // Execute - cef_string_userfree_t _retval = cef_get_mime_type( - extension.GetStruct()); + cef_string_userfree_t _retval = cef_get_mime_type(extension.GetStruct()); // Return type: string CefString _retvalStr; @@ -709,7 +691,8 @@ CEF_GLOBAL CefString CefGetMimeType(const CefString& extension) { return _retvalStr; } -CEF_GLOBAL void CefGetExtensionsForMimeType(const CefString& mime_type, +CEF_GLOBAL void CefGetExtensionsForMimeType( + const CefString& mime_type, std::vector& extensions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -725,9 +708,7 @@ CEF_GLOBAL void CefGetExtensionsForMimeType(const CefString& mime_type, transfer_string_list_contents(extensions, extensionsList); // Execute - cef_get_extensions_for_mime_type( - mime_type.GetStruct(), - extensionsList); + cef_get_extensions_for_mime_type(mime_type.GetStruct(), extensionsList); // Restore param:extensions; type: string_vec_byref if (extensionsList) { @@ -746,9 +727,7 @@ CEF_GLOBAL CefString CefBase64Encode(const void* data, size_t data_size) { return CefString(); // Execute - cef_string_userfree_t _retval = cef_base64encode( - data, - data_size); + cef_string_userfree_t _retval = cef_base64encode(data, data_size); // Return type: string CefString _retvalStr; @@ -765,8 +744,7 @@ CEF_GLOBAL CefRefPtr CefBase64Decode(const CefString& data) { return NULL; // Execute - cef_binary_value_t* _retval = cef_base64decode( - data.GetStruct()); + cef_binary_value_t* _retval = cef_base64decode(data.GetStruct()); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); @@ -781,9 +759,7 @@ CEF_GLOBAL CefString CefURIEncode(const CefString& text, bool use_plus) { return CefString(); // Execute - cef_string_userfree_t _retval = cef_uriencode( - text.GetStruct(), - use_plus); + cef_string_userfree_t _retval = cef_uriencode(text.GetStruct(), use_plus); // Return type: string CefString _retvalStr; @@ -791,8 +767,9 @@ CEF_GLOBAL CefString CefURIEncode(const CefString& text, bool use_plus) { return _retvalStr; } -CEF_GLOBAL CefString CefURIDecode(const CefString& text, bool convert_to_utf8, - cef_uri_unescape_rule_t unescape_rule) { +CEF_GLOBAL CefString CefURIDecode(const CefString& text, + bool convert_to_utf8, + cef_uri_unescape_rule_t unescape_rule) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: text; type: string_byref_const @@ -801,10 +778,8 @@ CEF_GLOBAL CefString CefURIDecode(const CefString& text, bool convert_to_utf8, return CefString(); // Execute - cef_string_userfree_t _retval = cef_uridecode( - text.GetStruct(), - convert_to_utf8, - unescape_rule); + cef_string_userfree_t _retval = + cef_uridecode(text.GetStruct(), convert_to_utf8, unescape_rule); // Return type: string CefString _retvalStr; @@ -813,7 +788,7 @@ CEF_GLOBAL CefString CefURIDecode(const CefString& text, bool convert_to_utf8, } CEF_GLOBAL CefRefPtr CefParseJSON(const CefString& json_string, - cef_json_parser_options_t options) { + cef_json_parser_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: json_string; type: string_byref_const @@ -822,17 +797,17 @@ CEF_GLOBAL CefRefPtr CefParseJSON(const CefString& json_string, return NULL; // Execute - cef_value_t* _retval = cef_parse_json( - json_string.GetStruct(), - options); + cef_value_t* _retval = cef_parse_json(json_string.GetStruct(), options); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); } CEF_GLOBAL CefRefPtr CefParseJSONAndReturnError( - const CefString& json_string, cef_json_parser_options_t options, - cef_json_parser_error_t& error_code_out, CefString& error_msg_out) { + const CefString& json_string, + cef_json_parser_options_t options, + cef_json_parser_error_t& error_code_out, + CefString& error_msg_out) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: json_string; type: string_byref_const @@ -842,9 +817,7 @@ CEF_GLOBAL CefRefPtr CefParseJSONAndReturnError( // Execute cef_value_t* _retval = cef_parse_jsonand_return_error( - json_string.GetStruct(), - options, - &error_code_out, + json_string.GetStruct(), options, &error_code_out, error_msg_out.GetWritableStruct()); // Return type: refptr_same @@ -852,7 +825,7 @@ CEF_GLOBAL CefRefPtr CefParseJSONAndReturnError( } CEF_GLOBAL CefString CefWriteJSON(CefRefPtr node, - cef_json_writer_options_t options) { + cef_json_writer_options_t options) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: node; type: refptr_same @@ -861,9 +834,8 @@ CEF_GLOBAL CefString CefWriteJSON(CefRefPtr node, return CefString(); // Execute - cef_string_userfree_t _retval = cef_write_json( - CefValueCToCpp::Unwrap(node), - options); + cef_string_userfree_t _retval = + cef_write_json(CefValueCToCpp::Unwrap(node), options); // Return type: string CefString _retvalStr; @@ -875,12 +847,10 @@ CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_get_path( - key, - path.GetWritableStruct()); + int _retval = cef_get_path(key, path.GetWritableStruct()); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefLaunchProcess(CefRefPtr command_line) { @@ -892,14 +862,14 @@ CEF_GLOBAL bool CefLaunchProcess(CefRefPtr command_line) { return false; // Execute - int _retval = cef_launch_process( - CefCommandLineCToCpp::Unwrap(command_line)); + int _retval = cef_launch_process(CefCommandLineCToCpp::Unwrap(command_line)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } -CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, +CEF_GLOBAL bool CefRegisterSchemeHandlerFactory( + const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -912,12 +882,11 @@ CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, // Execute int _retval = cef_register_scheme_handler_factory( - scheme_name.GetStruct(), - domain_name.GetStruct(), + scheme_name.GetStruct(), domain_name.GetStruct(), CefSchemeHandlerFactoryCppToC::Wrap(factory)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefClearSchemeHandlerFactories() { @@ -927,40 +896,37 @@ CEF_GLOBAL bool CefClearSchemeHandlerFactories() { int _retval = cef_clear_scheme_handler_factories(); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefIsCertStatusError(cef_cert_status_t status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_is_cert_status_error( - status); + int _retval = cef_is_cert_status_error(status); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefIsCertStatusMinorError(cef_cert_status_t status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_is_cert_status_minor_error( - status); + int _retval = cef_is_cert_status_minor_error(status); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = cef_currently_on( - threadId); + int _retval = cef_currently_on(threadId); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) { @@ -972,16 +938,15 @@ CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) { return false; // Execute - int _retval = cef_post_task( - threadId, - CefTaskCppToC::Wrap(task)); + int _retval = cef_post_task(threadId, CefTaskCppToC::Wrap(task)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, - CefRefPtr task, int64 delay_ms) { + CefRefPtr task, + int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -990,43 +955,39 @@ CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, return false; // Execute - int _retval = cef_post_delayed_task( - threadId, - CefTaskCppToC::Wrap(task), - delay_ms); + int _retval = + cef_post_delayed_task(threadId, CefTaskCppToC::Wrap(task), delay_ms); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefBeginTracing(const CefString& categories, - CefRefPtr callback) { + CefRefPtr callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: categories, callback // Execute - int _retval = cef_begin_tracing( - categories.GetStruct(), - CefCompletionCallbackCppToC::Wrap(callback)); + int _retval = cef_begin_tracing(categories.GetStruct(), + CefCompletionCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL bool CefEndTracing(const CefString& tracing_file, - CefRefPtr callback) { + CefRefPtr callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: tracing_file, callback // Execute - int _retval = cef_end_tracing( - tracing_file.GetStruct(), - CefEndTracingCallbackCppToC::Wrap(callback)); + int _retval = cef_end_tracing(tracing_file.GetStruct(), + CefEndTracingCallbackCppToC::Wrap(callback)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL int64 CefNowFromSystemTraceTime() { @@ -1040,7 +1001,8 @@ CEF_GLOBAL int64 CefNowFromSystemTraceTime() { } CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, CefRefPtr handler) { + const CefString& javascript_code, + CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: extension_name; type: string_byref_const @@ -1054,13 +1016,12 @@ CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, // Unverified params: handler // Execute - int _retval = cef_register_extension( - extension_name.GetStruct(), - javascript_code.GetStruct(), - CefV8HandlerCppToC::Wrap(handler)); + int _retval = cef_register_extension(extension_name.GetStruct(), + javascript_code.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); // Return type: bool - return _retval?true:false; + return _retval ? true : false; } CEF_GLOBAL void CefVisitWebPluginInfo( @@ -1073,8 +1034,7 @@ CEF_GLOBAL void CefVisitWebPluginInfo( return; // Execute - cef_visit_web_plugin_info( - CefWebPluginInfoVisitorCppToC::Wrap(visitor)); + cef_visit_web_plugin_info(CefWebPluginInfoVisitorCppToC::Wrap(visitor)); } CEF_GLOBAL void CefRefreshWebPlugins() { @@ -1093,8 +1053,7 @@ CEF_GLOBAL void CefUnregisterInternalWebPlugin(const CefString& path) { return; // Execute - cef_unregister_internal_web_plugin( - path.GetStruct()); + cef_unregister_internal_web_plugin(path.GetStruct()); } CEF_GLOBAL void CefRegisterWebPluginCrash(const CefString& path) { @@ -1106,11 +1065,11 @@ CEF_GLOBAL void CefRegisterWebPluginCrash(const CefString& path) { return; // Execute - cef_register_web_plugin_crash( - path.GetStruct()); + cef_register_web_plugin_crash(path.GetStruct()); } -CEF_GLOBAL void CefIsWebPluginUnstable(const CefString& path, +CEF_GLOBAL void CefIsWebPluginUnstable( + const CefString& path, CefRefPtr callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1125,11 +1084,11 @@ CEF_GLOBAL void CefIsWebPluginUnstable(const CefString& path, // Execute cef_is_web_plugin_unstable( - path.GetStruct(), - CefWebPluginUnstableCallbackCppToC::Wrap(callback)); + path.GetStruct(), CefWebPluginUnstableCallbackCppToC::Wrap(callback)); } -CEF_GLOBAL void CefRegisterWidevineCdm(const CefString& path, +CEF_GLOBAL void CefRegisterWidevineCdm( + const CefString& path, CefRefPtr callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -1140,8 +1099,6 @@ CEF_GLOBAL void CefRegisterWidevineCdm(const CefString& path, // Unverified params: callback // Execute - cef_register_widevine_cdm( - path.GetStruct(), - CefRegisterCdmCallbackCppToC::Wrap(callback)); + cef_register_widevine_cdm(path.GetStruct(), + CefRegisterCdmCallbackCppToC::Wrap(callback)); } - diff --git a/libcef_dll/wrapper/libcef_dll_wrapper2.cc b/libcef_dll/wrapper/libcef_dll_wrapper2.cc index dc8ba7b02..bdeef8a88 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper2.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper2.cc @@ -1,4 +1,3 @@ // Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. - diff --git a/libcef_dll/wrapper_types.h b/libcef_dll/wrapper_types.h index de3a301c1..c86cb0cf2 100644 --- a/libcef_dll/wrapper_types.h +++ b/libcef_dll/wrapper_types.h @@ -9,6 +9,8 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // +// $hash=6e2b488ccd8d106f6bf4a53209bb8d79848c7fb5$ +// #ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ #define CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ diff --git a/tests/cefclient/browser/browser_window.cc b/tests/cefclient/browser/browser_window.cc index 05dcd0676..6b550fecd 100644 --- a/tests/cefclient/browser/browser_window.cc +++ b/tests/cefclient/browser/browser_window.cc @@ -10,13 +10,11 @@ namespace client { BrowserWindow::BrowserWindow(Delegate* delegate) - : delegate_(delegate), - is_closing_(false) { + : delegate_(delegate), is_closing_(false) { DCHECK(delegate_); } -void BrowserWindow::SetDeviceScaleFactor(float device_scale_factor) { -} +void BrowserWindow::SetDeviceScaleFactor(float device_scale_factor) {} float BrowserWindow::GetDeviceScaleFactor() const { return 1.0f; @@ -83,7 +81,7 @@ void BrowserWindow::OnSetLoadingState(bool isLoading, } void BrowserWindow::OnSetDraggableRegions( - const std::vector& regions) { + const std::vector& regions) { REQUIRE_MAIN_THREAD(); delegate_->OnSetDraggableRegions(regions); } diff --git a/tests/cefclient/browser/browser_window.h b/tests/cefclient/browser/browser_window.h index 65e6b6772..963b7b671 100644 --- a/tests/cefclient/browser/browser_window.h +++ b/tests/cefclient/browser/browser_window.h @@ -68,7 +68,10 @@ class BrowserWindow : public ClientHandler::Delegate { // Show the popup window with correct parent and bounds in parent coordinates. virtual void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) = 0; + int x, + int y, + size_t width, + size_t height) = 0; // Show the window. virtual void Show() = 0; diff --git a/tests/cefclient/browser/browser_window_osr_gtk.cc b/tests/cefclient/browser/browser_window_osr_gtk.cc index 628d8a476..c7e222e7f 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.cc +++ b/tests/cefclient/browser/browser_window_osr_gtk.cc @@ -4,18 +4,18 @@ #include "tests/cefclient/browser/browser_window_osr_gtk.h" +#include #include #include #include #include #include #include -#include #define XK_3270 // for XK_3270_BackTab -#include #include #include +#include #include "include/base/cef_logging.h" #include "include/wrapper/cef_closure_task.h" @@ -637,7 +637,7 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) { case XF86XK_KbdBrightnessUp: return VKEY_KBD_BRIGHTNESS_UP; - // TODO(sad): some keycodes are still missing. + // TODO(sad): some keycodes are still missing. } return VKEY_UNKNOWN; } @@ -645,123 +645,123 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) { // From content/browser/renderer_host/input/web_input_event_util_posix.cc. KeyboardCode GdkEventToWindowsKeyCode(const GdkEventKey* event) { static const unsigned int kHardwareCodeToGDKKeyval[] = { - 0, // 0x00: - 0, // 0x01: - 0, // 0x02: - 0, // 0x03: - 0, // 0x04: - 0, // 0x05: - 0, // 0x06: - 0, // 0x07: - 0, // 0x08: - 0, // 0x09: GDK_Escape - GDK_1, // 0x0A: GDK_1 - GDK_2, // 0x0B: GDK_2 - GDK_3, // 0x0C: GDK_3 - GDK_4, // 0x0D: GDK_4 - GDK_5, // 0x0E: GDK_5 - GDK_6, // 0x0F: GDK_6 - GDK_7, // 0x10: GDK_7 - GDK_8, // 0x11: GDK_8 - GDK_9, // 0x12: GDK_9 - GDK_0, // 0x13: GDK_0 - GDK_minus, // 0x14: GDK_minus - GDK_equal, // 0x15: GDK_equal - 0, // 0x16: GDK_BackSpace - 0, // 0x17: GDK_Tab - GDK_q, // 0x18: GDK_q - GDK_w, // 0x19: GDK_w - GDK_e, // 0x1A: GDK_e - GDK_r, // 0x1B: GDK_r - GDK_t, // 0x1C: GDK_t - GDK_y, // 0x1D: GDK_y - GDK_u, // 0x1E: GDK_u - GDK_i, // 0x1F: GDK_i - GDK_o, // 0x20: GDK_o - GDK_p, // 0x21: GDK_p - GDK_bracketleft, // 0x22: GDK_bracketleft - GDK_bracketright, // 0x23: GDK_bracketright - 0, // 0x24: GDK_Return - 0, // 0x25: GDK_Control_L - GDK_a, // 0x26: GDK_a - GDK_s, // 0x27: GDK_s - GDK_d, // 0x28: GDK_d - GDK_f, // 0x29: GDK_f - GDK_g, // 0x2A: GDK_g - GDK_h, // 0x2B: GDK_h - GDK_j, // 0x2C: GDK_j - GDK_k, // 0x2D: GDK_k - GDK_l, // 0x2E: GDK_l - GDK_semicolon, // 0x2F: GDK_semicolon - GDK_apostrophe, // 0x30: GDK_apostrophe - GDK_grave, // 0x31: GDK_grave - 0, // 0x32: GDK_Shift_L - GDK_backslash, // 0x33: GDK_backslash - GDK_z, // 0x34: GDK_z - GDK_x, // 0x35: GDK_x - GDK_c, // 0x36: GDK_c - GDK_v, // 0x37: GDK_v - GDK_b, // 0x38: GDK_b - GDK_n, // 0x39: GDK_n - GDK_m, // 0x3A: GDK_m - GDK_comma, // 0x3B: GDK_comma - GDK_period, // 0x3C: GDK_period - GDK_slash, // 0x3D: GDK_slash - 0, // 0x3E: GDK_Shift_R - 0, // 0x3F: - 0, // 0x40: - 0, // 0x41: - 0, // 0x42: - 0, // 0x43: - 0, // 0x44: - 0, // 0x45: - 0, // 0x46: - 0, // 0x47: - 0, // 0x48: - 0, // 0x49: - 0, // 0x4A: - 0, // 0x4B: - 0, // 0x4C: - 0, // 0x4D: - 0, // 0x4E: - 0, // 0x4F: - 0, // 0x50: - 0, // 0x51: - 0, // 0x52: - 0, // 0x53: - 0, // 0x54: - 0, // 0x55: - 0, // 0x56: - 0, // 0x57: - 0, // 0x58: - 0, // 0x59: - 0, // 0x5A: - 0, // 0x5B: - 0, // 0x5C: - 0, // 0x5D: - 0, // 0x5E: - 0, // 0x5F: - 0, // 0x60: - 0, // 0x61: - 0, // 0x62: - 0, // 0x63: - 0, // 0x64: - 0, // 0x65: - 0, // 0x66: - 0, // 0x67: - 0, // 0x68: - 0, // 0x69: - 0, // 0x6A: - 0, // 0x6B: - 0, // 0x6C: - 0, // 0x6D: - 0, // 0x6E: - 0, // 0x6F: - 0, // 0x70: - 0, // 0x71: - 0, // 0x72: - GDK_Super_L, // 0x73: GDK_Super_L - GDK_Super_R, // 0x74: GDK_Super_R + 0, // 0x00: + 0, // 0x01: + 0, // 0x02: + 0, // 0x03: + 0, // 0x04: + 0, // 0x05: + 0, // 0x06: + 0, // 0x07: + 0, // 0x08: + 0, // 0x09: GDK_Escape + GDK_1, // 0x0A: GDK_1 + GDK_2, // 0x0B: GDK_2 + GDK_3, // 0x0C: GDK_3 + GDK_4, // 0x0D: GDK_4 + GDK_5, // 0x0E: GDK_5 + GDK_6, // 0x0F: GDK_6 + GDK_7, // 0x10: GDK_7 + GDK_8, // 0x11: GDK_8 + GDK_9, // 0x12: GDK_9 + GDK_0, // 0x13: GDK_0 + GDK_minus, // 0x14: GDK_minus + GDK_equal, // 0x15: GDK_equal + 0, // 0x16: GDK_BackSpace + 0, // 0x17: GDK_Tab + GDK_q, // 0x18: GDK_q + GDK_w, // 0x19: GDK_w + GDK_e, // 0x1A: GDK_e + GDK_r, // 0x1B: GDK_r + GDK_t, // 0x1C: GDK_t + GDK_y, // 0x1D: GDK_y + GDK_u, // 0x1E: GDK_u + GDK_i, // 0x1F: GDK_i + GDK_o, // 0x20: GDK_o + GDK_p, // 0x21: GDK_p + GDK_bracketleft, // 0x22: GDK_bracketleft + GDK_bracketright, // 0x23: GDK_bracketright + 0, // 0x24: GDK_Return + 0, // 0x25: GDK_Control_L + GDK_a, // 0x26: GDK_a + GDK_s, // 0x27: GDK_s + GDK_d, // 0x28: GDK_d + GDK_f, // 0x29: GDK_f + GDK_g, // 0x2A: GDK_g + GDK_h, // 0x2B: GDK_h + GDK_j, // 0x2C: GDK_j + GDK_k, // 0x2D: GDK_k + GDK_l, // 0x2E: GDK_l + GDK_semicolon, // 0x2F: GDK_semicolon + GDK_apostrophe, // 0x30: GDK_apostrophe + GDK_grave, // 0x31: GDK_grave + 0, // 0x32: GDK_Shift_L + GDK_backslash, // 0x33: GDK_backslash + GDK_z, // 0x34: GDK_z + GDK_x, // 0x35: GDK_x + GDK_c, // 0x36: GDK_c + GDK_v, // 0x37: GDK_v + GDK_b, // 0x38: GDK_b + GDK_n, // 0x39: GDK_n + GDK_m, // 0x3A: GDK_m + GDK_comma, // 0x3B: GDK_comma + GDK_period, // 0x3C: GDK_period + GDK_slash, // 0x3D: GDK_slash + 0, // 0x3E: GDK_Shift_R + 0, // 0x3F: + 0, // 0x40: + 0, // 0x41: + 0, // 0x42: + 0, // 0x43: + 0, // 0x44: + 0, // 0x45: + 0, // 0x46: + 0, // 0x47: + 0, // 0x48: + 0, // 0x49: + 0, // 0x4A: + 0, // 0x4B: + 0, // 0x4C: + 0, // 0x4D: + 0, // 0x4E: + 0, // 0x4F: + 0, // 0x50: + 0, // 0x51: + 0, // 0x52: + 0, // 0x53: + 0, // 0x54: + 0, // 0x55: + 0, // 0x56: + 0, // 0x57: + 0, // 0x58: + 0, // 0x59: + 0, // 0x5A: + 0, // 0x5B: + 0, // 0x5C: + 0, // 0x5D: + 0, // 0x5E: + 0, // 0x5F: + 0, // 0x60: + 0, // 0x61: + 0, // 0x62: + 0, // 0x63: + 0, // 0x64: + 0, // 0x65: + 0, // 0x66: + 0, // 0x67: + 0, // 0x68: + 0, // 0x69: + 0, // 0x6A: + 0, // 0x6B: + 0, // 0x6C: + 0, // 0x6D: + 0, // 0x6E: + 0, // 0x6F: + 0, // 0x70: + 0, // 0x71: + 0, // 0x72: + GDK_Super_L, // 0x73: GDK_Super_L + GDK_Super_R, // 0x74: GDK_Super_R }; // |windows_key_code| has to include a valid virtual-key code even when we @@ -779,8 +779,7 @@ KeyboardCode GdkEventToWindowsKeyCode(const GdkEventKey* event) { // even when we change the layout options, e.g. when we swap a control // key and a caps-lock key, GTK doesn't swap their // |event->hardware_keycode| values but swap their |event->keyval| values. - KeyboardCode windows_key_code = - KeyboardCodeFromXKeysym(event->keyval); + KeyboardCode windows_key_code = KeyboardCodeFromXKeysym(event->keyval); if (windows_key_code) return windows_key_code; @@ -803,7 +802,7 @@ KeyboardCode GetWindowsKeyCodeWithoutLocation(KeyboardCode key_code) { return VKEY_CONTROL; case VKEY_LSHIFT: case VKEY_RSHIFT: - return VKEY_SHIFT; + return VKEY_SHIFT; case VKEY_LMENU: case VKEY_RMENU: return VKEY_MENU; @@ -880,8 +879,8 @@ void GetWidgetRectInScreen(GtkWidget* widget, GdkRectangle* r) { r->height = widget->allocation.height; } -CefBrowserHost::DragOperationsMask -GetDragOperationsMask(GdkDragContext* drag_context) { +CefBrowserHost::DragOperationsMask GetDragOperationsMask( + GdkDragContext* drag_context) { int allowed_ops = DRAG_OPERATION_NONE; GdkDragAction drag_action = gdk_drag_context_get_actions(drag_context); if (drag_action & GDK_ACTION_COPY) @@ -908,7 +907,7 @@ class ScopedGLContext { if (is_valid_) { gdk_gl_drawable_gl_end(gldrawable_); - if(swap_buffers_) { + if (swap_buffers_) { if (gdk_gl_drawable_is_double_buffered(gldrawable_)) gdk_gl_drawable_swap_buffers(gldrawable_); else @@ -968,8 +967,8 @@ void BrowserWindowOsrGtk::CreateBrowser( Create(parent_handle); // Retrieve the X11 Window ID for the GTK parent window. - GtkWidget* window = gtk_widget_get_ancestor( - GTK_WIDGET(parent_handle), GTK_TYPE_WINDOW); + GtkWidget* window = + gtk_widget_get_ancestor(GTK_WIDGET(parent_handle), GTK_TYPE_WINDOW); ::Window xwindow = GDK_WINDOW_XID(gtk_widget_get_window(window)); DCHECK(xwindow); @@ -978,8 +977,8 @@ void BrowserWindowOsrGtk::CreateBrowser( // Create the browser asynchronously. CefBrowserHost::CreateBrowser(window_info, client_handler_, - client_handler_->startup_url(), - settings, request_context); + client_handler_->startup_url(), settings, + request_context); } void BrowserWindowOsrGtk::GetPopupConfig(CefWindowHandle temp_handle, @@ -992,7 +991,10 @@ void BrowserWindowOsrGtk::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowOsrGtk::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); DCHECK(browser_.get()); @@ -1021,7 +1023,7 @@ void BrowserWindowOsrGtk::Show() { void BrowserWindowOsrGtk::Hide() { REQUIRE_MAIN_THREAD(); - + if (!browser_) return; @@ -1087,8 +1089,8 @@ void BrowserWindowOsrGtk::OnBeforeClose(CefRefPtr browser) { UnregisterDragDrop(); // Disconnect all signal handlers that reference |this|. - g_signal_handlers_disconnect_matched(glarea_, G_SIGNAL_MATCH_DATA, 0, 0, - NULL, NULL, this); + g_signal_handlers_disconnect_matched(glarea_, G_SIGNAL_MATCH_DATA, 0, 0, NULL, + NULL, this); DisableGL(); } @@ -1111,8 +1113,8 @@ bool BrowserWindowOsrGtk::GetViewRect(CefRefPtr browser, // for popup menus to be located and sized inside the view. rect.x = rect.y = 0; rect.width = DeviceToLogical(glarea_->allocation.width, device_scale_factor_); - rect.height = DeviceToLogical(glarea_->allocation.height, - device_scale_factor_); + rect.height = + DeviceToLogical(glarea_->allocation.height, device_scale_factor_); return true; } @@ -1167,13 +1169,12 @@ void BrowserWindowOsrGtk::OnPopupSize(CefRefPtr browser, renderer_.OnPopupSize(browser, LogicalToDevice(rect, device_scale_factor_)); } -void BrowserWindowOsrGtk::OnPaint( - CefRefPtr browser, - CefRenderHandler::PaintElementType type, - const CefRenderHandler::RectList& dirtyRects, - const void* buffer, - int width, - int height) { +void BrowserWindowOsrGtk::OnPaint(CefRefPtr browser, + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const void* buffer, + int width, + int height) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); @@ -1226,7 +1227,8 @@ bool BrowserWindowOsrGtk::StartDragging( CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) { + int x, + int y) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); @@ -1290,10 +1292,9 @@ void BrowserWindowOsrGtk::Create(ClientWindowHandle parent_handle) { glarea_ = gtk_drawing_area_new(); DCHECK(glarea_); - GdkGLConfig* glconfig = gdk_gl_config_new_by_mode( - static_cast(GDK_GL_MODE_RGB | - GDK_GL_MODE_DEPTH | - GDK_GL_MODE_DOUBLE)); + GdkGLConfig* glconfig = + gdk_gl_config_new_by_mode(static_cast( + GDK_GL_MODE_RGB | GDK_GL_MODE_DEPTH | GDK_GL_MODE_DOUBLE)); DCHECK(glconfig); gtk_widget_set_gl_capability(glarea_, glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE); @@ -1303,17 +1304,12 @@ void BrowserWindowOsrGtk::Create(ClientWindowHandle parent_handle) { g_signal_connect(G_OBJECT(glarea_), "size_allocate", G_CALLBACK(&BrowserWindowOsrGtk::SizeAllocation), this); - gtk_widget_set_events(glarea_, - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK | - GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK | - GDK_SCROLL_MASK | - GDK_FOCUS_CHANGE_MASK); + gtk_widget_set_events( + glarea_, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | + GDK_SCROLL_MASK | GDK_FOCUS_CHANGE_MASK); g_signal_connect(G_OBJECT(glarea_), "button_press_event", G_CALLBACK(&BrowserWindowOsrGtk::ClickEvent), this); g_signal_connect(G_OBJECT(glarea_), "button_release_event", @@ -1456,9 +1452,8 @@ gint BrowserWindowOsrGtk::KeyEvent(GtkWidget* widget, // If ctrl key is pressed down, then control character shall be input. if (key_event.modifiers & EVENTFLAG_CONTROL_DOWN) { - key_event.character = - GetControlCharacter(windows_key_code, - key_event.modifiers & EVENTFLAG_SHIFT_DOWN); + key_event.character = GetControlCharacter( + windows_key_code, key_event.modifiers & EVENTFLAG_SHIFT_DOWN); } else { key_event.character = key_event.unmodified_character; } @@ -1574,7 +1569,7 @@ gint BrowserWindowOsrGtk::FocusEvent(GtkWidget* widget, REQUIRE_MAIN_THREAD(); if (self->browser_.get()) - self->browser_->GetHost()->SendFocusEvent(event->in == TRUE); + self->browser_->GetHost()->SendFocusEvent(event->in == TRUE); return TRUE; } @@ -1582,8 +1577,7 @@ bool BrowserWindowOsrGtk::IsOverPopupWidget(int x, int y) const { const CefRect& rc = renderer_.popup_rect(); int popup_right = rc.x + rc.width; int popup_bottom = rc.y + rc.height; - return (x >= rc.x) && (x < popup_right) && - (y >= rc.y) && (y < popup_bottom); + return (x >= rc.x) && (x < popup_right) && (y >= rc.y) && (y < popup_bottom); } int BrowserWindowOsrGtk::GetPopupXOffset() const { @@ -1669,11 +1663,8 @@ void BrowserWindowOsrGtk::RegisterDragDrop() { G_CALLBACK(&BrowserWindowOsrGtk::DragEnd), this); // Destination widget and its events. - gtk_drag_dest_set(glarea_, - (GtkDestDefaults) 0, - (GtkTargetEntry*) NULL, - 0, - (GdkDragAction) GDK_ACTION_COPY); + gtk_drag_dest_set(glarea_, (GtkDestDefaults)0, (GtkTargetEntry*)NULL, 0, + (GdkDragAction)GDK_ACTION_COPY); g_signal_connect(G_OBJECT(glarea_), "drag_motion", G_CALLBACK(&BrowserWindowOsrGtk::DragMotion), this); g_signal_connect(G_OBJECT(glarea_), "drag_leave", @@ -1723,20 +1714,18 @@ void BrowserWindowOsrGtk::DragBegin(GtkWidget* widget, int pixel_width = 0; int pixel_height = 0; CefRefPtr image_binary = - self->drag_data_->GetImage()->GetAsPNG(self->device_scale_factor_, - true, - pixel_width, - pixel_height); + self->drag_data_->GetImage()->GetAsPNG(self->device_scale_factor_, true, + pixel_width, pixel_height); if (!image_binary) { LOG(ERROR) << "Failed to set drag icon, drag image error"; return; } size_t image_size = image_binary->GetSize(); - guint8* image_buffer = (guint8*) malloc(image_size); // must free - image_binary->GetData((void*) image_buffer, image_size, 0); + guint8* image_buffer = (guint8*)malloc(image_size); // must free + image_binary->GetData((void*)image_buffer, image_size, 0); GdkPixbufLoader* loader = NULL; // must unref - GError* error = NULL; // must free - GdkPixbuf* pixbuf = NULL; // owned by loader + GError* error = NULL; // must free + GdkPixbuf* pixbuf = NULL; // owned by loader gboolean success = FALSE; loader = gdk_pixbuf_loader_new_with_type("png", &error); if (error == NULL && loader) { @@ -1853,7 +1842,7 @@ gboolean BrowserWindowOsrGtk::DragMotion(GtkWidget* widget, return TRUE; } else { LOG(WARNING) << "Invalid drag destination widget"; - gdk_drag_status(drag_context, (GdkDragAction) 0, time); + gdk_drag_status(drag_context, (GdkDragAction)0, time); return FALSE; } } @@ -1890,8 +1879,7 @@ gboolean BrowserWindowOsrGtk::DragFailed(GtkWidget* widget, // Send drag end coordinates and system drag ended event. if (self->browser_) { // Real coordinates not available. - self->browser_->GetHost()->DragSourceEndedAt(-1, -1, - self->drag_operation_); + self->browser_->GetHost()->DragSourceEndedAt(-1, -1, self->drag_operation_); self->browser_->GetHost()->DragSourceSystemDragEnded(); } diff --git a/tests/cefclient/browser/browser_window_osr_gtk.h b/tests/cefclient/browser/browser_window_osr_gtk.h index f1fbee6fa..e52feb61d 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.h +++ b/tests/cefclient/browser/browser_window_osr_gtk.h @@ -34,7 +34,10 @@ class BrowserWindowOsrGtk : public BrowserWindow, CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; @@ -46,10 +49,8 @@ class BrowserWindowOsrGtk : public BrowserWindow, // ClientHandlerOsr::OsrDelegate methods. void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; - bool GetRootScreenRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; + bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -58,8 +59,7 @@ class BrowserWindowOsrGtk : public BrowserWindow, bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) OVERRIDE; void OnPopupShow(CefRefPtr browser, bool show) OVERRIDE; - void OnPopupSize(CefRefPtr browser, - const CefRect& rect) OVERRIDE; + void OnPopupSize(CefRefPtr browser, const CefRect& rect) OVERRIDE; void OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, @@ -73,7 +73,8 @@ class BrowserWindowOsrGtk : public BrowserWindow, bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) OVERRIDE; + int x, + int y) OVERRIDE; void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) OVERRIDE; void OnImeCompositionRangeChanged( diff --git a/tests/cefclient/browser/browser_window_osr_mac.h b/tests/cefclient/browser/browser_window_osr_mac.h index 9600bf21c..7dcbd3335 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.h +++ b/tests/cefclient/browser/browser_window_osr_mac.h @@ -36,7 +36,10 @@ class BrowserWindowOsrMac : public BrowserWindow, CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; @@ -48,10 +51,8 @@ class BrowserWindowOsrMac : public BrowserWindow, // ClientHandlerOsr::OsrDelegate methods. void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; - bool GetRootScreenRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; + bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -60,8 +61,7 @@ class BrowserWindowOsrMac : public BrowserWindow, bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) OVERRIDE; void OnPopupShow(CefRefPtr browser, bool show) OVERRIDE; - void OnPopupSize(CefRefPtr browser, - const CefRect& rect) OVERRIDE; + void OnPopupSize(CefRefPtr browser, const CefRect& rect) OVERRIDE; void OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, @@ -75,7 +75,8 @@ class BrowserWindowOsrMac : public BrowserWindow, bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) OVERRIDE; + int x, + int y) OVERRIDE; void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) OVERRIDE; void OnImeCompositionRangeChanged( diff --git a/tests/cefclient/browser/browser_window_osr_mac.mm b/tests/cefclient/browser/browser_window_osr_mac.mm index 6112c0415..1b4596bbf 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.mm +++ b/tests/cefclient/browser/browser_window_osr_mac.mm @@ -5,8 +5,8 @@ #include "tests/cefclient/browser/browser_window_osr_mac.h" #include -#import #include +#import #include "include/base/cef_logging.h" #include "include/cef_parser.h" @@ -33,7 +33,7 @@ CefTextInputClientOSRMac* GetInputClientFromContext( } // namespace @interface BrowserOpenGLView - : NSOpenGLView { + : NSOpenGLView { @private NSTrackingArea* tracking_area_; client::BrowserWindowOsrMac* browser_window_; @@ -64,8 +64,8 @@ CefTextInputClientOSRMac* GetInputClientFromContext( } - (id)initWithFrame:(NSRect)frame - andBrowserWindow:(client::BrowserWindowOsrMac*)browser_window - andRenderer:(client::OsrRenderer*)renderer; + andBrowserWindow:(client::BrowserWindowOsrMac*)browser_window + andRenderer:(client::OsrRenderer*)renderer; - (void)detach; - (CefRefPtr)getBrowser; @@ -78,7 +78,8 @@ CefTextInputClientOSRMac* GetInputClientFromContext( - (BOOL)isKeyUpEvent:(NSEvent*)event; - (BOOL)isKeyPadEvent:(NSEvent*)event; - (BOOL)startDragging:(CefRefPtr)drag_data - allowedOps:(NSDragOperation)ops point:(NSPoint)p; + allowedOps:(NSDragOperation)ops + point:(NSPoint)p; - (void)setCurrentDragOp:(NSDragOperation)op; - (void)resetDragDrop; @@ -105,11 +106,11 @@ CefTextInputClientOSRMac* GetInputClientFromContext( - (NSRect)convertRectFromBackingInternal:(NSRect)aRect; - (NSRect)convertRectToBackingInternal:(NSRect)aRect; - (void)ChangeCompositionRange:(CefRange)range - character_bounds:(const CefRenderHandler::RectList&) character_bounds; + character_bounds: + (const CefRenderHandler::RectList&)character_bounds; - (void)UpdateAccessibilityTree:(CefRefPtr)value; @end - namespace { NSString* const kCEFDragDummyPboardType = @"org.CEF.drag-dummy-type"; @@ -118,7 +119,7 @@ NSString* const kNSURLTitlePboardType = @"public.url-name"; class ScopedGLContext { public: ScopedGLContext(BrowserOpenGLView* view, bool swap_buffers) - : swap_buffers_(swap_buffers) { + : swap_buffers_(swap_buffers) { context_ = [view openGLContext]; [context_ makeCurrentContext]; } @@ -127,6 +128,7 @@ class ScopedGLContext { if (swap_buffers_) [context_ flushBuffer]; } + private: NSOpenGLContext* context_; const bool swap_buffers_; @@ -143,19 +145,15 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { } // namespace - @implementation BrowserOpenGLView - (id)initWithFrame:(NSRect)frame - andBrowserWindow:(client::BrowserWindowOsrMac*)browser_window - andRenderer:(client::OsrRenderer*)renderer { - NSOpenGLPixelFormat * pixelFormat = - [[NSOpenGLPixelFormat alloc] - initWithAttributes:(NSOpenGLPixelFormatAttribute[]) { - NSOpenGLPFADoubleBuffer, - NSOpenGLPFADepthSize, - 32, - 0}]; + andBrowserWindow:(client::BrowserWindowOsrMac*)browser_window + andRenderer:(client::OsrRenderer*)renderer { + NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] + initWithAttributes:(NSOpenGLPixelFormatAttribute[]){ + NSOpenGLPFADoubleBuffer, NSOpenGLPFADepthSize, 32, + 0}]; [pixelFormat autorelease]; if (self = [super initWithFrame:frame pixelFormat:pixelFormat]) { @@ -165,13 +163,12 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { endWheelMonitor_ = nil; device_scale_factor_ = 1.0f; - tracking_area_ = - [[NSTrackingArea alloc] initWithRect:frame - options:NSTrackingMouseMoved | - NSTrackingActiveInActiveApp | - NSTrackingInVisibleRect - owner:self - userInfo:nil]; + tracking_area_ = [[NSTrackingArea alloc] + initWithRect:frame + options:NSTrackingMouseMoved | NSTrackingActiveInActiveApp | + NSTrackingInVisibleRect + owner:self + userInfo:nil]; [self addTrackingArea:tracking_area_]; // enable HiDPI buffer @@ -179,12 +176,9 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { [self resetDragDrop]; - NSArray* types = [NSArray arrayWithObjects: - kCEFDragDummyPboardType, - NSStringPboardType, - NSFilenamesPboardType, - NSPasteboardTypeString, - nil]; + NSArray* types = [NSArray + arrayWithObjects:kCEFDragDummyPboardType, NSStringPboardType, + NSFilenamesPboardType, NSPasteboardTypeString, nil]; [self registerForDraggedTypes:types]; } @@ -227,9 +221,9 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { browser->GetHost()->WasResized(); } -- (void) sendMouseClick:(NSEvent*)event - button:(CefBrowserHost::MouseButtonType)type - isUp:(bool)isUp { +- (void)sendMouseClick:(NSEvent*)event + button:(CefBrowserHost::MouseButtonType)type + isUp:(bool)isUp { CefRefPtr browser = [self getBrowser]; if (!browser.get()) return; @@ -244,22 +238,20 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { point = [self convertPointToBackingInternal:point]; if (!isUp) { - was_last_mouse_down_on_view_ = ![self isOverPopupWidgetX:point.x - andY:point.y]; + was_last_mouse_down_on_view_ = + ![self isOverPopupWidgetX:point.x andY:point.y]; } else if (was_last_mouse_down_on_view_ && [self isOverPopupWidgetX:point.x andY:point.y] && ([self getPopupXOffset] || [self getPopupYOffset])) { return; } - browser->GetHost()->SendMouseClickEvent(mouseEvent, - type, - isUp, + browser->GetHost()->SendMouseClickEvent(mouseEvent, type, isUp, [event clickCount]); } - (void)mouseDown:(NSEvent*)event { - [self sendMouseClick: event button:MBT_LEFT isUp:false]; + [self sendMouseClick:event button:MBT_LEFT isUp:false]; } - (void)rightMouseDown:(NSEvent*)event { @@ -270,15 +262,15 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { return; } - [self sendMouseClick: event button:MBT_RIGHT isUp:false]; + [self sendMouseClick:event button:MBT_RIGHT isUp:false]; } - (void)otherMouseDown:(NSEvent*)event { - [self sendMouseClick: event button:MBT_MIDDLE isUp:false]; + [self sendMouseClick:event button:MBT_MIDDLE isUp:false]; } - (void)mouseUp:(NSEvent*)event { - [self sendMouseClick: event button: MBT_LEFT isUp: true]; + [self sendMouseClick:event button:MBT_LEFT isUp:true]; } - (void)rightMouseUp:(NSEvent*)event { @@ -289,11 +281,11 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { [self setNeedsDisplay:YES]; return; } - [self sendMouseClick: event button: MBT_RIGHT isUp: true]; + [self sendMouseClick:event button:MBT_RIGHT isUp:true]; } - (void)otherMouseUp:(NSEvent*)event { - [self sendMouseClick: event button: MBT_MIDDLE isUp: true]; + [self sendMouseClick:event button:MBT_MIDDLE isUp:true]; } - (void)mouseMoved:(NSEvent*)event { @@ -303,7 +295,8 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { if (rotating_) { // Apply rotation effect. - cur_mouse_pos_ = [self getClickPointForEvent:event];; + cur_mouse_pos_ = [self getClickPointForEvent:event]; + ; renderer_->IncrementSpin((cur_mouse_pos_.x - last_mouse_pos_.x), (cur_mouse_pos_.y - last_mouse_pos_.y)); last_mouse_pos_ = cur_mouse_pos_; @@ -350,8 +343,8 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { return; if ([event type] != NSFlagsChanged) { - CefTextInputClientOSRMac* client = GetInputClientFromContext( - text_input_context_osr_mac_); + CefTextInputClientOSRMac* client = + GetInputClientFromContext(text_input_context_osr_mac_); if (client) { [client HandleKeyEventBeforeTextInputClient:event]; @@ -406,12 +399,13 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // view when the scrolling ends. Also it avoids sending duplicate scroll // events to the renderer. if ([event phase] == NSEventPhaseBegan && !endWheelMonitor_) { - endWheelMonitor_ = - [NSEvent addLocalMonitorForEventsMatchingMask:NSScrollWheelMask - handler:^(NSEvent* blockEvent) { - [self shortCircuitScrollWheelEvent:blockEvent]; - return blockEvent; - }]; + endWheelMonitor_ = [NSEvent + addLocalMonitorForEventsMatchingMask:NSScrollWheelMask + handler:^(NSEvent* blockEvent) { + [self shortCircuitScrollWheelEvent: + blockEvent]; + return blockEvent; + }]; } [self sendScrollWheelEvet:event]; @@ -496,7 +490,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { browser->GetFocusedFrame()->Paste(); } -- (void)delete:(id)sender { +- (void) delete:(id)sender { CefRefPtr browser = [self getBrowser]; if (browser.get()) browser->GetFocusedFrame()->Delete(); @@ -518,7 +512,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { return point; } -- (void)getKeyEvent:(CefKeyEvent &)keyEvent forEvent:(NSEvent *)event { +- (void)getKeyEvent:(CefKeyEvent&)keyEvent forEvent:(NSEvent*)event { if ([event type] == NSKeyDown || [event type] == NSKeyUp) { NSString* s = [event characters]; if ([s length] > 0) @@ -542,11 +536,11 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { - (NSTextInputContext*)inputContext { if (!text_input_context_osr_mac_) { CefTextInputClientOSRMac* text_input_client = - [[[CefTextInputClientOSRMac alloc] - initWithBrowser:[self getBrowser]] retain]; + [[[CefTextInputClientOSRMac alloc] initWithBrowser:[self getBrowser]] + retain]; - text_input_context_osr_mac_ = [[[NSTextInputContext alloc] initWithClient: - text_input_client] retain]; + text_input_context_osr_mac_ = + [[[NSTextInputContext alloc] initWithClient:text_input_client] retain]; } return text_input_context_osr_mac_; @@ -605,8 +599,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { if ([event modifierFlags] & NSAlphaShiftKeyMask) modifiers |= EVENTFLAG_CAPS_LOCK_ON; - if ([event type] == NSKeyUp || - [event type] == NSKeyDown || + if ([event type] == NSKeyUp || [event type] == NSKeyDown || [event type] == NSFlagsChanged) { // Only perform this check for key events if ([self isKeyPadEvent:event]) @@ -624,19 +617,19 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { case NSLeftMouseDown: case NSLeftMouseUp: modifiers |= EVENTFLAG_LEFT_MOUSE_BUTTON; - break; + break; case NSRightMouseDragged: case NSRightMouseDown: case NSRightMouseUp: modifiers |= EVENTFLAG_RIGHT_MOUSE_BUTTON; - break; + break; case NSOtherMouseDragged: case NSOtherMouseDown: case NSOtherMouseUp: modifiers |= EVENTFLAG_MIDDLE_MOUSE_BUTTON; - break; + break; default: - break; + break; } return modifiers; @@ -649,26 +642,26 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // FIXME: This logic fails if the user presses both Shift keys at once, for // example: we treat releasing one of them as keyDown. switch ([event keyCode]) { - case 54: // Right Command - case 55: // Left Command + case 54: // Right Command + case 55: // Left Command return ([event modifierFlags] & NSCommandKeyMask) == 0; - case 57: // Capslock + case 57: // Capslock return ([event modifierFlags] & NSAlphaShiftKeyMask) == 0; - case 56: // Left Shift - case 60: // Right Shift + case 56: // Left Shift + case 60: // Right Shift return ([event modifierFlags] & NSShiftKeyMask) == 0; - case 58: // Left Alt - case 61: // Right Alt - return ([event modifierFlags] & NSAlternateKeyMask) == 0; + case 58: // Left Alt + case 61: // Right Alt + return ([event modifierFlags] & NSAlternateKeyMask) == 0; - case 59: // Left Ctrl - case 62: // Right Ctrl + case 59: // Left Ctrl + case 62: // Right Ctrl return ([event modifierFlags] & NSControlKeyMask) == 0; - case 63: // Function + case 63: // Function return ([event modifierFlags] & NSFunctionKeyMask) == 0; } return false; @@ -679,24 +672,24 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { return true; switch ([event keyCode]) { - case 71: // Clear - case 81: // = - case 75: // / - case 67: // * - case 78: // - - case 69: // + - case 76: // Enter - case 65: // . - case 82: // 0 - case 83: // 1 - case 84: // 2 - case 85: // 3 - case 86: // 4 - case 87: // 5 - case 88: // 6 - case 89: // 7 - case 91: // 8 - case 92: // 9 + case 71: // Clear + case 81: // = + case 75: // / + case 67: // * + case 78: // - + case 69: // + + case 76: // Enter + case 65: // . + case 82: // 0 + case 83: // 1 + case 84: // 2 + case 85: // 3 + case 86: // 4 + case 87: // 5 + case 88: // 6 + case 89: // 7 + case 91: // 8 + case 92: // 9 return true; } @@ -709,18 +702,17 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { [self resetDeviceScaleFactor]; } -- (void)drawRect: (NSRect) dirtyRect { +- (void)drawRect:(NSRect)dirtyRect { CefRefPtr browser = [self getBrowser]; if ([self inLiveResize] || !browser.get()) { // Fill with the background color. const cef_color_t background_color = client::MainContext::Get()->GetBackgroundColor(); - NSColor* color = - [NSColor colorWithCalibratedRed: - float(CefColorGetR(background_color)) / 255.0f - green:float(CefColorGetG(background_color)) / 255.0f - blue:float(CefColorGetB(background_color)) / 255.0f - alpha:1.f]; + NSColor* color = [NSColor + colorWithCalibratedRed:float(CefColorGetR(background_color)) / 255.0f + green:float(CefColorGetG(background_color)) / 255.0f + blue:float(CefColorGetB(background_color)) / 255.0f + alpha:1.f]; [color setFill]; NSRectFill(dirtyRect); } @@ -780,9 +772,9 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // NSDraggingSource Protocol -- (NSDragOperation)draggingSession:(NSDraggingSession *)session +- (NSDragOperation)draggingSession:(NSDraggingSession*)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context { - switch(context) { + switch (context) { case NSDraggingContextOutsideApplication: return current_allowed_ops_; @@ -827,7 +819,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { if (operation == (NSDragOperationMove | NSDragOperationCopy)) operation &= ~NSDragOperationMove; - NSPoint windowPoint = [[self window] convertScreenToBase: screenPoint]; + NSPoint windowPoint = [[self window] convertScreenToBase:screenPoint]; NSPoint pt = [self flipWindowPointToView:windowPoint]; CefRenderHandler::DragOperation op = static_cast(operation); @@ -846,8 +838,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { CefRefPtr drag_data; if (!current_drag_data_) { drag_data = CefDragData::Create(); - [self populateDropData:drag_data - fromPasteboard:[info draggingPasteboard]]; + [self populateDropData:drag_data fromPasteboard:[info draggingPasteboard]]; } else { drag_data = current_drag_data_->Clone(); drag_data->ResetFileContents(); @@ -909,7 +900,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // NSPasteboardOwner Protocol -- (void)pasteboard:(NSPasteboard *)pboard provideDataForType:(NSString *)type { +- (void)pasteboard:(NSPasteboard*)pboard provideDataForType:(NSString*)type { if (!current_drag_data_) { return; } @@ -917,17 +908,21 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // URL. if ([type isEqualToString:NSURLPboardType]) { DCHECK(current_drag_data_->IsLink()); - NSString* strUrl = [NSString stringWithUTF8String: - current_drag_data_->GetLinkURL().ToString().c_str()]; + NSString* strUrl = + [NSString stringWithUTF8String:current_drag_data_->GetLinkURL() + .ToString() + .c_str()]; NSURL* url = [NSURL URLWithString:strUrl]; [url writeToPasteboard:pboard]; - // URL title. + // URL title. } else if ([type isEqualToString:kNSURLTitlePboardType]) { - NSString* strTitle = [NSString stringWithUTF8String: - current_drag_data_->GetLinkTitle().ToString().c_str()]; + NSString* strTitle = + [NSString stringWithUTF8String:current_drag_data_->GetLinkTitle() + .ToString() + .c_str()]; [pboard setString:strTitle forType:kNSURLTitlePboardType]; - // File contents. + // File contents. } else if ([type isEqualToString:(NSString*)fileUTI_]) { size_t size = current_drag_data_->GetFileContents(NULL); DCHECK_GT(size, 0U); @@ -940,52 +935,52 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { [pboard setData:[NSData dataWithBytes:handler->GetData() length:handler->GetDataSize()] - forType:(NSString*)fileUTI_]; + forType:(NSString*)fileUTI_]; - // Plain text. + // Plain text. } else if ([type isEqualToString:NSStringPboardType]) { - NSString* strTitle = [NSString stringWithUTF8String: - current_drag_data_->GetFragmentText().ToString().c_str()]; + NSString* strTitle = + [NSString stringWithUTF8String:current_drag_data_->GetFragmentText() + .ToString() + .c_str()]; [pboard setString:strTitle forType:NSStringPboardType]; } else if ([type isEqualToString:kCEFDragDummyPboardType]) { // The dummy type _was_ promised and someone decided to call the bluff. - [pboard setData:[NSData data] - forType:kCEFDragDummyPboardType]; - + [pboard setData:[NSData data] forType:kCEFDragDummyPboardType]; } } // NSAccessibility Protocol implementation. - (BOOL)accessibilityIsIgnored { - if(!accessibility_helper_) + if (!accessibility_helper_) return YES; else return NO; } -- (id)accessibilityAttributeValue:(NSString *)attribute { - if(!accessibility_helper_) +- (id)accessibilityAttributeValue:(NSString*)attribute { + if (!accessibility_helper_) return [super accessibilityAttributeValue:attribute]; if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) { return NSAccessibilityGroupRole; } else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) { client::OsrAXNode* node = accessibility_helper_->GetRootNode(); - std::string desc = node ? node->AxDescription(): ""; + std::string desc = node ? node->AxDescription() : ""; return [NSString stringWithUTF8String:desc.c_str()]; } else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) { client::OsrAXNode* node = accessibility_helper_->GetRootNode(); - std::string desc = node ? node->AxValue(): ""; + std::string desc = node ? node->AxValue() : ""; return [NSString stringWithUTF8String:desc.c_str()]; - } else if ([attribute isEqualToString: - NSAccessibilityRoleDescriptionAttribute]) { + } else if ([attribute + isEqualToString:NSAccessibilityRoleDescriptionAttribute]) { return NSAccessibilityRoleDescriptionForUIElement(self); } else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { client::OsrAXNode* node = accessibility_helper_->GetRootNode(); // Add Root as first Kid NSMutableArray* kids = [NSMutableArray arrayWithCapacity:1]; NSObject* child = node->GetNativeAccessibleObject(NULL); - [kids addObject: child]; + [kids addObject:child]; return NSAccessibilityUnignoredChildren(kids); } else { return [super accessibilityAttributeValue:attribute]; @@ -1019,8 +1014,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { DCHECK(!pasteboard_); pasteboard_ = [[NSPasteboard pasteboardWithName:NSDragPboard] retain]; - [pasteboard_ declareTypes:@[ kCEFDragDummyPboardType ] - owner:self]; + [pasteboard_ declareTypes:@[ kCEFDragDummyPboardType ] owner:self]; // URL (and title). if (current_drag_data_->IsLink()) { @@ -1036,18 +1030,19 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // File. if (contents_size > 0) { - std::string file_name = current_drag_data_->GetFileName().ToString(); - size_t sep = file_name.find_last_of("."); - CefString extension = file_name.substr(sep + 1); + std::string file_name = current_drag_data_->GetFileName().ToString(); + size_t sep = file_name.find_last_of("."); + CefString extension = file_name.substr(sep + 1); - mimeType = CefGetMimeType(extension); + mimeType = CefGetMimeType(extension); if (!mimeType.empty()) { CFStringRef mimeTypeCF; mimeTypeCF = CFStringCreateWithCString(kCFAllocatorDefault, - mimeType.ToString().c_str(), kCFStringEncodingUTF8); + mimeType.ToString().c_str(), + kCFStringEncodingUTF8); fileUTI_ = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, - mimeTypeCF, NULL); + mimeTypeCF, NULL); CFRelease(mimeTypeCF); // File (HFS) promise. NSArray* fileUTIList = @[ (NSString*)fileUTI_ ]; @@ -1061,8 +1056,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { // Plain text. if (!current_drag_data_->GetFragmentText().empty()) { - [pasteboard_ addTypes:@[ NSStringPboardType ] - owner:self]; + [pasteboard_ addTypes:@[ NSStringPboardType ] owner:self]; } } @@ -1085,8 +1079,8 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { if ([files isKindOfClass:[NSArray class]] && [files count]) { for (NSUInteger i = 0; i < [files count]; i++) { NSString* filename = [files objectAtIndex:i]; - BOOL exists = [[NSFileManager defaultManager] - fileExistsAtPath:filename]; + BOOL exists = + [[NSFileManager defaultManager] fileExistsAtPath:filename]; if (exists) { data->AddFile([filename UTF8String], CefString()); } @@ -1096,7 +1090,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { } - (NSPoint)flipWindowPointToView:(const NSPoint&)windowPoint { - NSPoint viewPoint = [self convertPoint:windowPoint fromView:nil]; + NSPoint viewPoint = [self convertPoint:windowPoint fromView:nil]; NSRect viewFrame = [self frame]; viewPoint.y = viewFrame.size.height - viewPoint.y; return viewPoint; @@ -1148,8 +1142,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { CefRect rc = renderer_->popup_rect(); int popup_right = rc.x + rc.width; int popup_bottom = rc.y + rc.height; - return (x >= rc.x) && (x < popup_right) && - (y >= rc.y) && (y < popup_bottom); + return (x >= rc.x) && (x < popup_right) && (y >= rc.y) && (y < popup_bottom); } - (int)getPopupXOffset { @@ -1188,17 +1181,17 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { } - (void)ChangeCompositionRange:(CefRange)range - character_bounds:(const CefRenderHandler::RectList&) bounds { + character_bounds:(const CefRenderHandler::RectList&)bounds { CefTextInputClientOSRMac* client = GetInputClientFromContext(text_input_context_osr_mac_); if (client) - [client ChangeCompositionRange: range character_bounds:bounds]; + [client ChangeCompositionRange:range character_bounds:bounds]; } - (void)UpdateAccessibilityTree:(CefRefPtr)value { if (!accessibility_helper_) { - accessibility_helper_ = new client::OsrAccessibilityHelper(value, - [self getBrowser]); + accessibility_helper_ = + new client::OsrAccessibilityHelper(value, [self getBrowser]); } else { accessibility_helper_->UpdateAccessibilityTree(value); } @@ -1211,7 +1204,6 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { } @end - namespace client { BrowserWindowOsrMac::BrowserWindowOsrMac(BrowserWindow::Delegate* delegate, @@ -1247,8 +1239,8 @@ void BrowserWindowOsrMac::CreateBrowser( // Create the browser asynchronously. CefBrowserHost::CreateBrowser(window_info, client_handler_, - client_handler_->startup_url(), - settings, request_context); + client_handler_->startup_url(), settings, + request_context); } void BrowserWindowOsrMac::GetPopupConfig(CefWindowHandle temp_handle, @@ -1261,7 +1253,10 @@ void BrowserWindowOsrMac::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowOsrMac::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); DCHECK(browser_.get()); @@ -1291,7 +1286,7 @@ void BrowserWindowOsrMac::Show() { void BrowserWindowOsrMac::Hide() { REQUIRE_MAIN_THREAD(); - + if (!browser_.get()) return; @@ -1391,9 +1386,8 @@ bool BrowserWindowOsrMac::GetScreenPoint(CefRefPtr browser, // (viewX, viewX) is in browser view coordinates. // Convert to device coordinates. - NSPoint view_pt = NSMakePoint( - LogicalToDevice(viewX, device_scale_factor), - LogicalToDevice(viewY, device_scale_factor)); + NSPoint view_pt = NSMakePoint(LogicalToDevice(viewX, device_scale_factor), + LogicalToDevice(viewY, device_scale_factor)); // Convert to OS X view coordinates. view_pt = [GLView(nsview_) convertPointFromBackingInternal:view_pt]; @@ -1464,13 +1458,12 @@ void BrowserWindowOsrMac::OnPopupSize(CefRefPtr browser, renderer_.OnPopupSize(browser, device_rect); } -void BrowserWindowOsrMac::OnPaint( - CefRefPtr browser, - CefRenderHandler::PaintElementType type, - const CefRenderHandler::RectList& dirtyRects, - const void* buffer, - int width, - int height) { +void BrowserWindowOsrMac::OnPaint(CefRefPtr browser, + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const void* buffer, + int width, + int height) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); @@ -1513,7 +1506,8 @@ bool BrowserWindowOsrMac::StartDragging( CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) { + int x, + int y) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); @@ -1532,10 +1526,10 @@ bool BrowserWindowOsrMac::StartDragging( // Convert to OS X view coordinates. point = [GLView(nsview_) convertPointFromBackingInternal:point]; - return [GLView(nsview_) - startDragging:drag_data - allowedOps:static_cast(allowed_ops) - point:point]; + return + [GLView(nsview_) startDragging:drag_data + allowedOps:static_cast(allowed_ops) + point:point]; } void BrowserWindowOsrMac::UpdateDragCursor( @@ -1574,22 +1568,21 @@ void BrowserWindowOsrMac::Create(ClientWindowHandle parent_handle, DCHECK(!nsview_); NSRect window_rect = NSMakeRect(rect.x, rect.y, rect.width, rect.height); - nsview_ = - [[BrowserOpenGLView alloc] initWithFrame:window_rect - andBrowserWindow:this - andRenderer:&renderer_]; + nsview_ = [[BrowserOpenGLView alloc] initWithFrame:window_rect + andBrowserWindow:this + andRenderer:&renderer_]; [nsview_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; - [nsview_ setAutoresizesSubviews: true]; + [nsview_ setAutoresizesSubviews:true]; [parent_handle addSubview:nsview_]; // Determine the default scale factor. [GLView(nsview_) resetDeviceScaleFactor]; [[NSNotificationCenter defaultCenter] - addObserver:nsview_ - selector:@selector(windowDidChangeBackingProperties:) - name:NSWindowDidChangeBackingPropertiesNotification - object:[nsview_ window]]; + addObserver:nsview_ + selector:@selector(windowDidChangeBackingProperties:) + name:NSWindowDidChangeBackingPropertiesNotification + object:[nsview_ window]]; } } // namespace client diff --git a/tests/cefclient/browser/browser_window_osr_win.cc b/tests/cefclient/browser/browser_window_osr_win.cc index 00cbd7bf7..e509898ba 100644 --- a/tests/cefclient/browser/browser_window_osr_win.cc +++ b/tests/cefclient/browser/browser_window_osr_win.cc @@ -42,7 +42,10 @@ void BrowserWindowOsrWin::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowOsrWin::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); if (osr_window_) osr_window_->ShowPopup(parent_handle, x, y, width, height); diff --git a/tests/cefclient/browser/browser_window_osr_win.h b/tests/cefclient/browser/browser_window_osr_win.h index 5b1215eb5..9064796f7 100644 --- a/tests/cefclient/browser/browser_window_osr_win.h +++ b/tests/cefclient/browser/browser_window_osr_win.h @@ -33,7 +33,10 @@ class BrowserWindowOsrWin : public BrowserWindow, CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; diff --git a/tests/cefclient/browser/browser_window_std_gtk.cc b/tests/cefclient/browser/browser_window_std_gtk.cc index 251b9c7bd..42b8b53a3 100644 --- a/tests/cefclient/browser/browser_window_std_gtk.cc +++ b/tests/cefclient/browser/browser_window_std_gtk.cc @@ -4,9 +4,9 @@ #include "tests/cefclient/browser/browser_window_std_gtk.h" -#include #include #include +#include #include #undef Success // Definition conflicts with cef_message_router.h @@ -31,14 +31,10 @@ void SetXWindowVisible(::Window xwindow, bool visible) { ::Display* xdisplay = cef_get_xdisplay(); // Retrieve the atoms required by the below XChangeProperty call. - const char* kAtoms[] = { - "_NET_WM_STATE", - "ATOM", - "_NET_WM_STATE_HIDDEN" - }; + const char* kAtoms[] = {"_NET_WM_STATE", "ATOM", "_NET_WM_STATE_HIDDEN"}; Atom atoms[3]; - int result = XInternAtoms(xdisplay, const_cast(kAtoms), 3, false, - atoms); + int result = + XInternAtoms(xdisplay, const_cast(kAtoms), 3, false, atoms); if (!result) NOTREACHED(); @@ -47,37 +43,36 @@ void SetXWindowVisible(::Window xwindow, bool visible) { scoped_ptr data(new Atom[1]); data[0] = atoms[2]; - XChangeProperty(xdisplay, - xwindow, + XChangeProperty(xdisplay, xwindow, atoms[0], // name atoms[1], // type - 32, // size in bits of items in 'value' + 32, // size in bits of items in 'value' PropModeReplace, reinterpret_cast(data.get()), 1); // num items } else { // Set an empty array of property state values. - XChangeProperty(xdisplay, - xwindow, + XChangeProperty(xdisplay, xwindow, atoms[0], // name atoms[1], // type - 32, // size in bits of items in 'value' - PropModeReplace, - NULL, + 32, // size in bits of items in 'value' + PropModeReplace, NULL, 0); // num items } } void SetXWindowBounds(::Window xwindow, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { ::Display* xdisplay = cef_get_xdisplay(); XWindowChanges changes = {0}; changes.x = x; changes.y = y; changes.width = static_cast(width); changes.height = static_cast(height); - XConfigureWindow(xdisplay, xwindow, - CWX | CWY | CWHeight | CWWidth, &changes); + XConfigureWindow(xdisplay, xwindow, CWX | CWY | CWHeight | CWWidth, &changes); } } // namespace @@ -99,8 +94,8 @@ void BrowserWindowStdGtk::CreateBrowser( window_info.SetAsChild(GetXWindowForWidget(parent_handle), rect); CefBrowserHost::CreateBrowser(window_info, client_handler_, - client_handler_->startup_url(), - settings, request_context); + client_handler_->startup_url(), settings, + request_context); } void BrowserWindowStdGtk::GetPopupConfig(CefWindowHandle temp_handle, @@ -114,7 +109,10 @@ void BrowserWindowStdGtk::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowStdGtk::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); if (browser_) { @@ -124,7 +122,7 @@ void BrowserWindowStdGtk::ShowPopup(ClientWindowHandle parent_handle, DCHECK(xwindow); XReparentWindow(xdisplay, xwindow, parent_xwindow, x, y); - + SetXWindowBounds(xwindow, x, y, width, height); SetXWindowVisible(xwindow, true); } @@ -175,5 +173,4 @@ ClientWindowHandle BrowserWindowStdGtk::GetWindowHandle() const { return NULL; } - } // namespace client diff --git a/tests/cefclient/browser/browser_window_std_gtk.h b/tests/cefclient/browser/browser_window_std_gtk.h index 434385d83..8b9fa0cf1 100644 --- a/tests/cefclient/browser/browser_window_std_gtk.h +++ b/tests/cefclient/browser/browser_window_std_gtk.h @@ -17,8 +17,7 @@ class BrowserWindowStdGtk : public BrowserWindow { public: // Constructor may be called on any thread. // |delegate| must outlive this object. - BrowserWindowStdGtk(Delegate* delegate, - const std::string& startup_url); + BrowserWindowStdGtk(Delegate* delegate, const std::string& startup_url); // BrowserWindow methods. void CreateBrowser(ClientWindowHandle parent_handle, @@ -30,7 +29,10 @@ class BrowserWindowStdGtk : public BrowserWindow { CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; diff --git a/tests/cefclient/browser/browser_window_std_mac.h b/tests/cefclient/browser/browser_window_std_mac.h index 225c3c5e4..832e13f73 100644 --- a/tests/cefclient/browser/browser_window_std_mac.h +++ b/tests/cefclient/browser/browser_window_std_mac.h @@ -17,8 +17,7 @@ class BrowserWindowStdMac : public BrowserWindow { public: // Constructor may be called on any thread. // |delegate| must outlive this object. - BrowserWindowStdMac(Delegate* delegate, - const std::string& startup_url); + BrowserWindowStdMac(Delegate* delegate, const std::string& startup_url); // BrowserWindow methods. void CreateBrowser(ClientWindowHandle parent_handle, @@ -30,7 +29,10 @@ class BrowserWindowStdMac : public BrowserWindow { CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; diff --git a/tests/cefclient/browser/browser_window_std_mac.mm b/tests/cefclient/browser/browser_window_std_mac.mm index c56c2913f..087a90dbd 100644 --- a/tests/cefclient/browser/browser_window_std_mac.mm +++ b/tests/cefclient/browser/browser_window_std_mac.mm @@ -26,12 +26,12 @@ void BrowserWindowStdMac::CreateBrowser( REQUIRE_MAIN_THREAD(); CefWindowInfo window_info; - window_info.SetAsChild(parent_handle, - rect.x, rect.y, rect.width, rect.height); + window_info.SetAsChild(parent_handle, rect.x, rect.y, rect.width, + rect.height); CefBrowserHost::CreateBrowser(window_info, client_handler_, - client_handler_->startup_url(), - settings, request_context); + client_handler_->startup_url(), settings, + request_context); } void BrowserWindowStdMac::GetPopupConfig(CefWindowHandle temp_handle, @@ -45,7 +45,10 @@ void BrowserWindowStdMac::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowStdMac::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); NSView* browser_view = GetWindowHandle(); diff --git a/tests/cefclient/browser/browser_window_std_win.cc b/tests/cefclient/browser/browser_window_std_win.cc index 19d9c1fa8..0b96b0fd0 100644 --- a/tests/cefclient/browser/browser_window_std_win.cc +++ b/tests/cefclient/browser/browser_window_std_win.cc @@ -27,8 +27,8 @@ void BrowserWindowStdWin::CreateBrowser( window_info.SetAsChild(parent_handle, wnd_rect); CefBrowserHost::CreateBrowser(window_info, client_handler_, - client_handler_->startup_url(), - settings, request_context); + client_handler_->startup_url(), settings, + request_context); } void BrowserWindowStdWin::GetPopupConfig(CefWindowHandle temp_handle, @@ -42,15 +42,17 @@ void BrowserWindowStdWin::GetPopupConfig(CefWindowHandle temp_handle, } void BrowserWindowStdWin::ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { REQUIRE_MAIN_THREAD(); HWND hwnd = GetWindowHandle(); if (hwnd) { SetParent(hwnd, parent_handle); - SetWindowPos(hwnd, NULL, x, y, - static_cast(width), static_cast(height), - SWP_NOZORDER); + SetWindowPos(hwnd, NULL, x, y, static_cast(width), + static_cast(height), SWP_NOZORDER); ShowWindow(hwnd, SW_SHOW); } } @@ -70,8 +72,8 @@ void BrowserWindowStdWin::Hide() { if (hwnd) { // When the frame window is minimized set the browser window size to 0x0 to // reduce resource usage. - SetWindowPos(hwnd, NULL, - 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + SetWindowPos(hwnd, NULL, 0, 0, 0, 0, + SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); } } @@ -81,9 +83,8 @@ void BrowserWindowStdWin::SetBounds(int x, int y, size_t width, size_t height) { HWND hwnd = GetWindowHandle(); if (hwnd) { // Set the browser window bounds. - SetWindowPos(hwnd, NULL, x, y, - static_cast(width), static_cast(height), - SWP_NOZORDER); + SetWindowPos(hwnd, NULL, x, y, static_cast(width), + static_cast(height), SWP_NOZORDER); } } @@ -102,5 +103,4 @@ ClientWindowHandle BrowserWindowStdWin::GetWindowHandle() const { return NULL; } - } // namespace client diff --git a/tests/cefclient/browser/browser_window_std_win.h b/tests/cefclient/browser/browser_window_std_win.h index 8bea19572..c778b25ad 100644 --- a/tests/cefclient/browser/browser_window_std_win.h +++ b/tests/cefclient/browser/browser_window_std_win.h @@ -17,8 +17,7 @@ class BrowserWindowStdWin : public BrowserWindow { public: // Constructor may be called on any thread. // |delegate| must outlive this object. - BrowserWindowStdWin(Delegate* delegate, - const std::string& startup_url); + BrowserWindowStdWin(Delegate* delegate, const std::string& startup_url); // BrowserWindow methods. void CreateBrowser(ClientWindowHandle parent_handle, @@ -30,7 +29,10 @@ class BrowserWindowStdWin : public BrowserWindow { CefRefPtr& client, CefBrowserSettings& settings) OVERRIDE; void ShowPopup(ClientWindowHandle parent_handle, - int x, int y, size_t width, size_t height) OVERRIDE; + int x, + int y, + size_t width, + size_t height) OVERRIDE; void Show() OVERRIDE; void Hide() OVERRIDE; void SetBounds(int x, int y, size_t width, size_t height) OVERRIDE; diff --git a/tests/cefclient/browser/bytes_write_handler.cc b/tests/cefclient/browser/bytes_write_handler.cc index 77b606956..d5349f6ea 100644 --- a/tests/cefclient/browser/bytes_write_handler.cc +++ b/tests/cefclient/browser/bytes_write_handler.cc @@ -12,9 +12,7 @@ namespace client { BytesWriteHandler::BytesWriteHandler(size_t grow) - : grow_(grow), - datasize_(grow), - offset_(0) { + : grow_(grow), datasize_(grow), offset_(0) { DCHECK_GT(grow, 0U); data_ = malloc(grow); DCHECK(data_ != NULL); @@ -44,26 +42,26 @@ int BytesWriteHandler::Seek(int64 offset, int whence) { int rv = -1L; base::AutoLock lock_scope(lock_); switch (whence) { - case SEEK_CUR: - if (offset_ + offset > datasize_ || offset_ + offset < 0) + case SEEK_CUR: + if (offset_ + offset > datasize_ || offset_ + offset < 0) + break; + offset_ += offset; + rv = 0; break; - offset_ += offset; - rv = 0; - break; - case SEEK_END: { - int64 offset_abs = std::abs(offset); - if (offset_abs > datasize_) + case SEEK_END: { + int64 offset_abs = std::abs(offset); + if (offset_abs > datasize_) + break; + offset_ = datasize_ - offset_abs; + rv = 0; break; - offset_ = datasize_ - offset_abs; - rv = 0; - break; - } - case SEEK_SET: - if (offset > datasize_ || offset < 0) + } + case SEEK_SET: + if (offset > datasize_ || offset < 0) + break; + offset_ = offset; + rv = 0; break; - offset_ = offset; - rv = 0; - break; } return rv; diff --git a/tests/cefclient/browser/client_handler.cc b/tests/cefclient/browser/client_handler.cc index 2b1db1638..727509f3d 100644 --- a/tests/cefclient/browser/client_handler.cc +++ b/tests/cefclient/browser/client_handler.cc @@ -35,7 +35,7 @@ namespace { // Custom menu command Ids. enum client_menu_ids { - CLIENT_ID_SHOW_DEVTOOLS = MENU_ID_USER_FIRST, + CLIENT_ID_SHOW_DEVTOOLS = MENU_ID_USER_FIRST, CLIENT_ID_CLOSE_DEVTOOLS, CLIENT_ID_INSPECT_ELEMENT, CLIENT_ID_SHOW_SSL_INFO, @@ -54,9 +54,8 @@ std::string GetTimeString(const CefTime& value) { return "Unspecified"; static const char* kMonths[] = { - "January", "February", "March", "April", "May", "June", "July", "August", - "September", "October", "November", "December" - }; + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December"}; std::string month; if (value.month >= 1 && value.month <= 12) month = kMonths[value.month - 1]; @@ -64,10 +63,10 @@ std::string GetTimeString(const CefTime& value) { month = "Invalid"; std::stringstream ss; - ss << month << " " << value.day_of_month << ", " << value.year << " " << - std::setfill('0') << std::setw(2) << value.hour << ":" << - std::setfill('0') << std::setw(2) << value.minute << ":" << - std::setfill('0') << std::setw(2) << value.second; + ss << month << " " << value.day_of_month << ", " << value.year << " " + << std::setfill('0') << std::setw(2) << value.hour << ":" + << std::setfill('0') << std::setw(2) << value.minute << ":" + << std::setfill('0') << std::setw(2) << value.second; return ss.str(); } @@ -85,8 +84,15 @@ std::string GetBinaryString(CefRefPtr value) { return CefBase64Encode(src.data(), src.size()); } -#define FLAG(flag) if (status & flag) result += std::string(#flag) + "
    " -#define VALUE(val,def) if (val == def) return std::string(#def) +#define FLAG(flag) \ + if (status & flag) { \ + result += std::string(#flag) + "
    "; \ + } + +#define VALUE(val, def) \ + if (val == def) { \ + return std::string(#def); \ + } std::string GetCertStatusString(cef_cert_status_t status) { std::string result; @@ -146,9 +152,10 @@ void LoadErrorPage(CefRefPtr frame, ss << "Page failed to load" "" "

    Page failed to load.

    " - "URL: "<< failed_url << "" - "
    Error: " << test_runner::GetErrorString(error_code) << - " (" << error_code << ")"; + "URL: " << failed_url + << "
    Error: " << test_runner::GetErrorString(error_code) << " (" + << error_code << ")"; if (!other_info.empty()) ss << "
    " << other_info; @@ -159,7 +166,7 @@ void LoadErrorPage(CefRefPtr frame, // Return HTML string with information about a certificate. std::string GetCertificateInformation(CefRefPtr cert, - cef_cert_status_t certstatus) { + cef_cert_status_t certstatus) { CefRefPtr subject = cert->GetSubject(); CefRefPtr issuer = cert->GetIssuer(); @@ -170,22 +177,22 @@ std::string GetCertificateInformation(CefRefPtr cert, ""; if (certstatus != CERT_STATUS_NONE) { - ss << ""; + ss << ""; } - ss << "" - "" - "" << - "" - ""; + ss << "" + "" + "" + << "" + ""; CefX509Certificate::IssuerChainBinaryList der_chain_list; CefX509Certificate::IssuerChainBinaryList pem_chain_list; @@ -198,11 +205,12 @@ std::string GetCertificateInformation(CefRefPtr cert, for (size_t i = 0U; i < der_chain_list.size(); ++i) { ss << "" - "" + "" "" - ""; + ""; } ss << "
    FieldValue
    Status" << - GetCertStatusString(certstatus) << "
    Status" << GetCertStatusString(certstatus) + << "
    Subject" << - (subject.get() ? subject->GetDisplayName().ToString() : " ") << - "
    Issuer" << - (issuer.get() ? issuer->GetDisplayName().ToString() : " ") << - "
    Serial #*" << - GetBinaryString(cert->GetSerialNumber()) << "
    Valid Start" << - GetTimeString(cert->GetValidStart()) << "
    Valid Expiry" << - GetTimeString(cert->GetValidExpiry()) << "
    Subject" + << (subject.get() ? subject->GetDisplayName().ToString() : " ") + << "
    Issuer" + << (issuer.get() ? issuer->GetDisplayName().ToString() : " ") + << "
    Serial #*" + << GetBinaryString(cert->GetSerialNumber()) << "
    Valid Start" << GetTimeString(cert->GetValidStart()) + << "
    Valid Expiry" + << GetTimeString(cert->GetValidExpiry()) << "
    DER Encoded*" << - GetBinaryString(der_chain_list[i]) << "
    " + << GetBinaryString(der_chain_list[i]) + << "
    PEM Encoded*" << - GetBinaryString(pem_chain_list[i]) << "
    " + << GetBinaryString(pem_chain_list[i]) << "
    * Displayed value is base64 encoded."; @@ -211,18 +219,14 @@ std::string GetCertificateInformation(CefRefPtr cert, } // namespace - class ClientDownloadImageCallback : public CefDownloadImageCallback { public: - explicit ClientDownloadImageCallback( - CefRefPtr client_handler) - : client_handler_(client_handler) { - } + explicit ClientDownloadImageCallback(CefRefPtr client_handler) + : client_handler_(client_handler) {} - void OnDownloadImageFinished( - const CefString& image_url, - int http_status_code, - CefRefPtr image) OVERRIDE { + void OnDownloadImageFinished(const CefString& image_url, + int http_status_code, + CefRefPtr image) OVERRIDE { if (image) client_handler_->NotifyFavicon(image); } @@ -234,18 +238,17 @@ class ClientDownloadImageCallback : public CefDownloadImageCallback { DISALLOW_COPY_AND_ASSIGN(ClientDownloadImageCallback); }; - ClientHandler::ClientHandler(Delegate* delegate, bool is_osr, const std::string& startup_url) - : is_osr_(is_osr), - startup_url_(startup_url), - download_favicon_images_(false), - delegate_(delegate), - browser_count_(0), - console_log_file_(MainContext::Get()->GetConsoleLogPath()), - first_console_message_(true), - focus_on_editable_field_(false) { + : is_osr_(is_osr), + startup_url_(startup_url), + download_favicon_images_(false), + delegate_(delegate), + browser_count_(0), + console_log_file_(MainContext::Get()->GetConsoleLogPath()), + first_console_message_(true), + focus_on_editable_field_(false) { DCHECK(!console_log_file_.empty()); #if defined(OS_LINUX) @@ -299,11 +302,10 @@ bool ClientHandler::OnProcessMessageReceived( return false; } -void ClientHandler::OnBeforeContextMenu( - CefRefPtr browser, - CefRefPtr frame, - CefRefPtr params, - CefRefPtr model) { +void ClientHandler::OnBeforeContextMenu(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) { CEF_REQUIRE_UI_THREAD(); if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) { @@ -330,12 +332,11 @@ void ClientHandler::OnBeforeContextMenu( delegate_->OnBeforeContextMenu(model); } -bool ClientHandler::OnContextMenuCommand( - CefRefPtr browser, - CefRefPtr frame, - CefRefPtr params, - int command_id, - EventFlags event_flags) { +bool ClientHandler::OnContextMenuCommand(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + int command_id, + EventFlags event_flags) { CEF_REQUIRE_UI_THREAD(); switch (command_id) { @@ -400,10 +401,9 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr browser, FILE* file = fopen(console_log_file_.c_str(), "a"); if (file) { std::stringstream ss; - ss << "Message: " << message.ToString() << NEWLINE << - "Source: " << source.ToString() << NEWLINE << - "Line: " << line << NEWLINE << - "-----------------------" << NEWLINE; + ss << "Message: " << message.ToString() << NEWLINE + << "Source: " << source.ToString() << NEWLINE << "Line: " << line + << NEWLINE << "-----------------------" << NEWLINE; fputs(ss.str().c_str(), file); fclose(file); @@ -435,10 +435,9 @@ void ClientHandler::OnDownloadUpdated( CEF_REQUIRE_UI_THREAD(); if (download_item->IsComplete()) { - test_runner::Alert( - browser, - "File \"" + download_item->GetFullPath().ToString() + - "\" downloaded successfully."); + test_runner::Alert(browser, "File \"" + + download_item->GetFullPath().ToString() + + "\" downloaded successfully."); } } @@ -449,8 +448,7 @@ bool ClientHandler::OnDragEnter(CefRefPtr browser, // Forbid dragging of URLs and files. if ((mask & DRAG_OPERATION_LINK) && !dragData->IsFragment()) { - test_runner::Alert( - browser, "cefclient blocks dragging of URLs and files"); + test_runner::Alert(browser, "cefclient blocks dragging of URLs and files"); return true; } @@ -472,10 +470,10 @@ void ClientHandler::OnTakeFocus(CefRefPtr browser, bool next) { } bool ClientHandler::OnRequestGeolocationPermission( - CefRefPtr browser, - const CefString& requesting_url, - int request_id, - CefRefPtr callback) { + CefRefPtr browser, + const CefString& requesting_url, + int request_id, + CefRefPtr callback) { CEF_REQUIRE_UI_THREAD(); // Allow geolocation access from all websites. @@ -561,8 +559,7 @@ void ClientHandler::OnBeforeClose(CefRefPtr browser) { if (--browser_count_ == 0) { // Remove and delete message router handlers. - MessageHandlerSet::const_iterator it = - message_handler_set_.begin(); + MessageHandlerSet::const_iterator it = message_handler_set_.begin(); for (; it != message_handler_set_.end(); ++it) { message_router_->RemoveHandler(*(it)); delete *(it); @@ -636,10 +633,10 @@ bool ClientHandler::OnOpenURLFromTab( } cef_return_value_t ClientHandler::OnBeforeResourceLoad( - CefRefPtr browser, - CefRefPtr frame, - CefRefPtr request, - CefRefPtr callback) { + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr callback) { CEF_REQUIRE_IO_THREAD(); return resource_manager_->OnBeforeResourceLoad(browser, frame, request, @@ -691,12 +688,11 @@ void ClientHandler::OnProtocolExecution(CefRefPtr browser, allow_os_execution = true; } -bool ClientHandler::OnCertificateError( - CefRefPtr browser, - ErrorCode cert_error, - const CefString& request_url, - CefRefPtr ssl_info, - CefRefPtr callback) { +bool ClientHandler::OnCertificateError(CefRefPtr browser, + ErrorCode cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) { CEF_REQUIRE_UI_THREAD(); CefRefPtr cert = ssl_info->GetX509Certificate(); @@ -732,7 +728,7 @@ bool ClientHandler::OnSelectClientCertificate( return true; } - std::vector >::const_iterator it = + std::vector>::const_iterator it = certificates.begin(); for (; it != certificates.end(); ++it) { CefString subject((*it)->GetSubject()->GetDisplayName()); @@ -839,8 +835,8 @@ void ClientHandler::ShowSSLInformation(CefRefPtr browser) { ss << "SSL Information" "" - "

    SSL Connection

    " << - ""; + "

    SSL Connection

    " + << "
    FieldValue
    "; CefURLParts urlparts; if (CefParseURL(nav->GetURL(), urlparts)) { @@ -851,10 +847,10 @@ void ClientHandler::ShowSSLInformation(CefRefPtr browser) { ss << ""; } - ss << ""; - ss << ""; + ss << ""; + ss << ""; ss << "
    FieldValue
    SSL Version" << - GetSSLVersionString(ssl->GetSSLVersion()) << "
    Content Status" << - GetContentStatusString(ssl->GetContentStatus()) << "
    SSL Version" + << GetSSLVersionString(ssl->GetSSLVersion()) << "
    Content Status" + << GetContentStatusString(ssl->GetContentStatus()) << "
    "; @@ -869,13 +865,12 @@ void ClientHandler::ShowSSLInformation(CefRefPtr browser) { test_runner::GetDataURI(ss.str(), "text/html")); } -bool ClientHandler::CreatePopupWindow( - CefRefPtr browser, - bool is_devtools, - const CefPopupFeatures& popupFeatures, - CefWindowInfo& windowInfo, - CefRefPtr& client, - CefBrowserSettings& settings) { +bool ClientHandler::CreatePopupWindow(CefRefPtr browser, + bool is_devtools, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings) { // Note: This method will be called on multiple threads. // The popup browser will be parented to a new native window. @@ -886,7 +881,6 @@ bool ClientHandler::CreatePopupWindow( return true; } - void ClientHandler::NotifyBrowserCreated(CefRefPtr browser) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. @@ -926,8 +920,7 @@ void ClientHandler::NotifyBrowserClosed(CefRefPtr browser) { void ClientHandler::NotifyAddress(const CefString& url) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&ClientHandler::NotifyAddress, this, url)); + MAIN_POST_CLOSURE(base::Bind(&ClientHandler::NotifyAddress, this, url)); return; } @@ -938,8 +931,7 @@ void ClientHandler::NotifyAddress(const CefString& url) { void ClientHandler::NotifyTitle(const CefString& title) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&ClientHandler::NotifyTitle, this, title)); + MAIN_POST_CLOSURE(base::Bind(&ClientHandler::NotifyTitle, this, title)); return; } @@ -950,8 +942,7 @@ void ClientHandler::NotifyTitle(const CefString& title) { void ClientHandler::NotifyFavicon(CefRefPtr image) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&ClientHandler::NotifyFavicon, this, image)); + MAIN_POST_CLOSURE(base::Bind(&ClientHandler::NotifyFavicon, this, image)); return; } @@ -976,9 +967,8 @@ void ClientHandler::NotifyLoadingState(bool isLoading, bool canGoForward) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&ClientHandler::NotifyLoadingState, this, - isLoading, canGoBack, canGoForward)); + MAIN_POST_CLOSURE(base::Bind(&ClientHandler::NotifyLoadingState, this, + isLoading, canGoBack, canGoForward)); return; } @@ -1002,8 +992,7 @@ void ClientHandler::NotifyDraggableRegions( void ClientHandler::NotifyTakeFocus(bool next) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&ClientHandler::NotifyTakeFocus, this, next)); + MAIN_POST_CLOSURE(base::Bind(&ClientHandler::NotifyTakeFocus, this, next)); return; } diff --git a/tests/cefclient/browser/client_handler.h b/tests/cefclient/browser/client_handler.h index 26c7e814a..a176368c6 100644 --- a/tests/cefclient/browser/client_handler.h +++ b/tests/cefclient/browser/client_handler.h @@ -58,7 +58,7 @@ class ClientHandler : public CefClient, virtual void OnSetTitle(const std::string& title) = 0; // Set the Favicon image. - virtual void OnSetFavicon(CefRefPtr image) {}; + virtual void OnSetFavicon(CefRefPtr image){}; // Set fullscreen mode. virtual void OnSetFullscreen(bool fullscreen) = 0; @@ -98,33 +98,17 @@ class ClientHandler : public CefClient, CefRefPtr GetContextMenuHandler() OVERRIDE { return this; } - CefRefPtr GetDisplayHandler() OVERRIDE { - return this; - } - CefRefPtr GetDownloadHandler() OVERRIDE { - return this; - } - CefRefPtr GetDragHandler() OVERRIDE { - return this; - } - CefRefPtr GetFocusHandler() OVERRIDE { - return this; - } + CefRefPtr GetDisplayHandler() OVERRIDE { return this; } + CefRefPtr GetDownloadHandler() OVERRIDE { return this; } + CefRefPtr GetDragHandler() OVERRIDE { return this; } + CefRefPtr GetFocusHandler() OVERRIDE { return this; } CefRefPtr GetGeolocationHandler() OVERRIDE { return this; } - CefRefPtr GetKeyboardHandler() OVERRIDE { - return this; - } - CefRefPtr GetLifeSpanHandler() OVERRIDE { - return this; - } - CefRefPtr GetLoadHandler() OVERRIDE { - return this; - } - CefRefPtr GetRequestHandler() OVERRIDE { - return this; - } + CefRefPtr GetKeyboardHandler() OVERRIDE { return this; } + CefRefPtr GetLifeSpanHandler() OVERRIDE { return this; } + CefRefPtr GetLoadHandler() OVERRIDE { return this; } + CefRefPtr GetRequestHandler() OVERRIDE { return this; } bool OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) OVERRIDE; @@ -165,15 +149,13 @@ class ClientHandler : public CefClient, int line) OVERRIDE; // CefDownloadHandler methods - void OnBeforeDownload( - CefRefPtr browser, - CefRefPtr download_item, - const CefString& suggested_name, - CefRefPtr callback) OVERRIDE; - void OnDownloadUpdated( - CefRefPtr browser, - CefRefPtr download_item, - CefRefPtr callback) OVERRIDE; + void OnBeforeDownload(CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) OVERRIDE; + void OnDownloadUpdated(CefRefPtr browser, + CefRefPtr download_item, + CefRefPtr callback) OVERRIDE; // CefDragHandler methods bool OnDragEnter(CefRefPtr browser, @@ -259,12 +241,11 @@ class ClientHandler : public CefClient, void OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allow_os_execution) OVERRIDE; - bool OnCertificateError( - CefRefPtr browser, - ErrorCode cert_error, - const CefString& request_url, - CefRefPtr ssl_info, - CefRefPtr callback) OVERRIDE; + bool OnCertificateError(CefRefPtr browser, + ErrorCode cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) OVERRIDE; bool OnSelectClientCertificate( CefRefPtr browser, bool isProxy, @@ -315,13 +296,12 @@ class ClientHandler : public CefClient, // will be true if the window will be used for DevTools. Return true to // proceed with popup browser creation or false to cancel the popup browser. // May be called on any thead. - bool CreatePopupWindow( - CefRefPtr browser, - bool is_devtools, - const CefPopupFeatures& popupFeatures, - CefWindowInfo& windowInfo, - CefRefPtr& client, - CefBrowserSettings& settings); + bool CreatePopupWindow(CefRefPtr browser, + bool is_devtools, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings); // Execute Delegate notifications on the main thread. void NotifyBrowserCreated(CefRefPtr browser); @@ -331,11 +311,8 @@ class ClientHandler : public CefClient, void NotifyTitle(const CefString& title); void NotifyFavicon(CefRefPtr image); void NotifyFullscreen(bool fullscreen); - void NotifyLoadingState(bool isLoading, - bool canGoBack, - bool canGoForward); - void NotifyDraggableRegions( - const std::vector& regions); + void NotifyLoadingState(bool isLoading, bool canGoBack, bool canGoForward); + void NotifyDraggableRegions(const std::vector& regions); void NotifyTakeFocus(bool next); // Test context menu creation. diff --git a/tests/cefclient/browser/client_handler_osr.cc b/tests/cefclient/browser/client_handler_osr.cc index b84543805..a2a2863f0 100644 --- a/tests/cefclient/browser/client_handler_osr.cc +++ b/tests/cefclient/browser/client_handler_osr.cc @@ -13,8 +13,7 @@ namespace client { ClientHandlerOsr::ClientHandlerOsr(Delegate* delegate, OsrDelegate* osr_delegate, const std::string& startup_url) - : ClientHandler(delegate, true, startup_url), - osr_delegate_(osr_delegate) { + : ClientHandler(delegate, true, startup_url), osr_delegate_(osr_delegate) { DCHECK(osr_delegate_); } @@ -78,8 +77,7 @@ bool ClientHandlerOsr::GetScreenInfo(CefRefPtr browser, return osr_delegate_->GetScreenInfo(browser, screen_info); } -void ClientHandlerOsr::OnPopupShow(CefRefPtr browser, - bool show) { +void ClientHandlerOsr::OnPopupShow(CefRefPtr browser, bool show) { CEF_REQUIRE_UI_THREAD(); if (!osr_delegate_) return; @@ -106,28 +104,30 @@ void ClientHandlerOsr::OnPaint(CefRefPtr browser, osr_delegate_->OnPaint(browser, type, dirtyRects, buffer, width, height); } -void ClientHandlerOsr::OnCursorChange( - CefRefPtr browser, - CefCursorHandle cursor, - CursorType type, - const CefCursorInfo& custom_cursor_info) { +void ClientHandlerOsr::OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CursorType type, + const CefCursorInfo& custom_cursor_info) { CEF_REQUIRE_UI_THREAD(); if (!osr_delegate_) return; osr_delegate_->OnCursorChange(browser, cursor, type, custom_cursor_info); } -bool ClientHandlerOsr::StartDragging(CefRefPtr browser, +bool ClientHandlerOsr::StartDragging( + CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) { + int x, + int y) { CEF_REQUIRE_UI_THREAD(); if (!osr_delegate_) return false; return osr_delegate_->StartDragging(browser, drag_data, allowed_ops, x, y); } -void ClientHandlerOsr::UpdateDragCursor(CefRefPtr browser, +void ClientHandlerOsr::UpdateDragCursor( + CefRefPtr browser, CefRenderHandler::DragOperation operation) { CEF_REQUIRE_UI_THREAD(); if (!osr_delegate_) diff --git a/tests/cefclient/browser/client_handler_osr.h b/tests/cefclient/browser/client_handler_osr.h index 83837317b..42723102b 100644 --- a/tests/cefclient/browser/client_handler_osr.h +++ b/tests/cefclient/browser/client_handler_osr.h @@ -27,8 +27,7 @@ class ClientHandlerOsr : public ClientHandler, // These methods match the CefRenderHandler interface. virtual bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) = 0; - virtual bool GetViewRect(CefRefPtr browser, - CefRect& rect) = 0; + virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) = 0; virtual bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -45,15 +44,15 @@ class ClientHandlerOsr : public ClientHandler, const void* buffer, int width, int height) = 0; - virtual void OnCursorChange( - CefRefPtr browser, - CefCursorHandle cursor, - CefRenderHandler::CursorType type, - const CefCursorInfo& custom_cursor_info) = 0; + virtual void OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CefRenderHandler::CursorType type, + const CefCursorInfo& custom_cursor_info) = 0; virtual bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) = 0; + int x, + int y) = 0; virtual void UpdateDragCursor( CefRefPtr browser, CefRenderHandler::DragOperation operation) = 0; @@ -77,9 +76,7 @@ class ClientHandlerOsr : public ClientHandler, void DetachOsrDelegate(); // CefClient methods. - CefRefPtr GetRenderHandler() OVERRIDE { - return this; - } + CefRefPtr GetRenderHandler() OVERRIDE { return this; } CefRefPtr GetAccessibilityHandler() OVERRIDE { return this; } @@ -89,10 +86,8 @@ class ClientHandlerOsr : public ClientHandler, void OnBeforeClose(CefRefPtr browser) OVERRIDE; // CefRenderHandler methods. - bool GetRootScreenRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; + bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -101,8 +96,7 @@ class ClientHandlerOsr : public ClientHandler, bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) OVERRIDE; void OnPopupShow(CefRefPtr browser, bool show) OVERRIDE; - void OnPopupSize(CefRefPtr browser, - const CefRect& rect) OVERRIDE; + void OnPopupSize(CefRefPtr browser, const CefRect& rect) OVERRIDE; void OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, @@ -116,7 +110,8 @@ class ClientHandlerOsr : public ClientHandler, bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) OVERRIDE; + int x, + int y) OVERRIDE; void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) OVERRIDE; void OnImeCompositionRangeChanged( diff --git a/tests/cefclient/browser/client_handler_std.cc b/tests/cefclient/browser/client_handler_std.cc index 00fab5eeb..803028f6e 100644 --- a/tests/cefclient/browser/client_handler_std.cc +++ b/tests/cefclient/browser/client_handler_std.cc @@ -8,7 +8,6 @@ namespace client { ClientHandlerStd::ClientHandlerStd(Delegate* delegate, const std::string& startup_url) - : ClientHandler(delegate, false, startup_url) { -} + : ClientHandler(delegate, false, startup_url) {} } // namespace client diff --git a/tests/cefclient/browser/client_handler_std.h b/tests/cefclient/browser/client_handler_std.h index 94eed857a..5a73a3eec 100644 --- a/tests/cefclient/browser/client_handler_std.h +++ b/tests/cefclient/browser/client_handler_std.h @@ -14,8 +14,7 @@ namespace client { // one browser per handler instance. class ClientHandlerStd : public ClientHandler { public: - ClientHandlerStd(Delegate* delegate, - const std::string& startup_url); + ClientHandlerStd(Delegate* delegate, const std::string& startup_url); private: // Include the default reference counting implementation. diff --git a/tests/cefclient/browser/client_types.h b/tests/cefclient/browser/client_types.h index f228f4e89..d26a1b4b3 100644 --- a/tests/cefclient/browser/client_types.h +++ b/tests/cefclient/browser/client_types.h @@ -30,4 +30,3 @@ class NSWindow; #endif // defined OS_MACOSX #endif // CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_TYPES_H_ - diff --git a/tests/cefclient/browser/dialog_handler_gtk.cc b/tests/cefclient/browser/dialog_handler_gtk.cc index df66bb05f..042be2ca9 100644 --- a/tests/cefclient/browser/dialog_handler_gtk.cc +++ b/tests/cefclient/browser/dialog_handler_gtk.cc @@ -34,10 +34,10 @@ std::string GetDescriptionFromMimeType(const std::string& mime_type) { const char* mime_type; const char* label; } kWildCardMimeTypes[] = { - { "audio", "Audio Files" }, - { "image", "Image Files" }, - { "text", "Text Files" }, - { "video", "Video Files" }, + {"audio", "Audio Files"}, + {"image", "Image Files"}, + {"text", "Text Files"}, + {"video", "Video Files"}, }; for (size_t i = 0; @@ -143,10 +143,7 @@ GtkWindow* GetWindow(CefRefPtr browser) { } // namespace - -ClientDialogHandlerGtk::ClientDialogHandlerGtk() - : gtk_dialog_(NULL) { -} +ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(NULL) {} bool ClientDialogHandlerGtk::OnFileDialog( CefRefPtr browser, @@ -163,7 +160,7 @@ bool ClientDialogHandlerGtk::OnFileDialog( // Remove any modifier flags. FileDialogMode mode_type = - static_cast(mode & FILE_DIALOG_TYPE_MASK); + static_cast(mode & FILE_DIALOG_TYPE_MASK); if (mode_type == FILE_DIALOG_OPEN || mode_type == FILE_DIALOG_OPEN_MULTIPLE) { action = GTK_FILE_CHOOSER_ACTION_OPEN; @@ -206,20 +203,15 @@ bool ClientDialogHandlerGtk::OnFileDialog( return false; GtkWidget* dialog = gtk_file_chooser_dialog_new( - title_str.c_str(), - GTK_WINDOW(window), - action, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - accept_button, GTK_RESPONSE_ACCEPT, - NULL); + title_str.c_str(), GTK_WINDOW(window), action, GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, accept_button, GTK_RESPONSE_ACCEPT, NULL); if (mode_type == FILE_DIALOG_OPEN_MULTIPLE) gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE); if (mode_type == FILE_DIALOG_SAVE) { gtk_file_chooser_set_do_overwrite_confirmation( - GTK_FILE_CHOOSER(dialog), - !!(mode & FILE_DIALOG_OVERWRITEPROMPT_FLAG)); + GTK_FILE_CHOOSER(dialog), !!(mode & FILE_DIALOG_OVERWRITEPROMPT_FLAG)); } gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), @@ -232,8 +224,7 @@ bool ClientDialogHandlerGtk::OnFileDialog( struct stat sb; if (stat(file_path.c_str(), &sb) == 0 && S_ISREG(sb.st_mode)) { // Use the directory and name of the existing file. - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), - file_path.data()); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), file_path.data()); exists = true; } @@ -300,14 +291,13 @@ bool ClientDialogHandlerGtk::OnFileDialog( return true; } -bool ClientDialogHandlerGtk::OnJSDialog( - CefRefPtr browser, - const CefString& origin_url, - JSDialogType dialog_type, - const CefString& message_text, - const CefString& default_prompt_text, - CefRefPtr callback, - bool& suppress_message) { +bool ClientDialogHandlerGtk::OnJSDialog(CefRefPtr browser, + const CefString& origin_url, + JSDialogType dialog_type, + const CefString& message_text, + const CefString& default_prompt_text, + CefRefPtr callback, + bool& suppress_message) { CEF_REQUIRE_UI_THREAD(); GtkButtonsType buttons = GTK_BUTTONS_NONE; @@ -345,22 +335,16 @@ bool ClientDialogHandlerGtk::OnJSDialog( if (!window) return false; - gtk_dialog_ = gtk_message_dialog_new(GTK_WINDOW(window), - GTK_DIALOG_MODAL, - gtk_message_type, - buttons, - "%s", + gtk_dialog_ = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_MODAL, + gtk_message_type, buttons, "%s", message_text.ToString().c_str()); - g_signal_connect(gtk_dialog_, - "delete-event", - G_CALLBACK(gtk_widget_hide_on_delete), - NULL); + g_signal_connect(gtk_dialog_, "delete-event", + G_CALLBACK(gtk_widget_hide_on_delete), NULL); gtk_window_set_title(GTK_WINDOW(gtk_dialog_), title.c_str()); GtkWidget* ok_button = gtk_dialog_add_button(GTK_DIALOG(gtk_dialog_), - GTK_STOCK_OK, - GTK_RESPONSE_OK); + GTK_STOCK_OK, GTK_RESPONSE_OK); if (dialog_type != JSDIALOGTYPE_PROMPT) gtk_widget_grab_focus(ok_button); @@ -431,4 +415,3 @@ void ClientDialogHandlerGtk::OnDialogResponse(GtkDialog* dialog, } } // namespace client - diff --git a/tests/cefclient/browser/dialog_handler_gtk.h b/tests/cefclient/browser/dialog_handler_gtk.h index 95ffd8e05..163d0a35b 100644 --- a/tests/cefclient/browser/dialog_handler_gtk.h +++ b/tests/cefclient/browser/dialog_handler_gtk.h @@ -35,15 +35,14 @@ class ClientDialogHandlerGtk : public CefDialogHandler, const CefString& default_prompt_text, CefRefPtr callback, bool& suppress_message) OVERRIDE; - bool OnBeforeUnloadDialog( - CefRefPtr browser, - const CefString& message_text, - bool is_reload, - CefRefPtr callback) OVERRIDE; + bool OnBeforeUnloadDialog(CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) OVERRIDE; void OnResetDialogState(CefRefPtr browser) OVERRIDE; private: - static void OnDialogResponse(GtkDialog *dialog, + static void OnDialogResponse(GtkDialog* dialog, gint response_id, ClientDialogHandlerGtk* handler); diff --git a/tests/cefclient/browser/dialog_test.cc b/tests/cefclient/browser/dialog_test.cc index 25360f718..eebdce181 100644 --- a/tests/cefclient/browser/dialog_test.cc +++ b/tests/cefclient/browser/dialog_test.cc @@ -30,9 +30,7 @@ const char kFileSaveMessageName[] = "DialogTest.FileSave"; class DialogState : public base::RefCountedThreadSafe { public: DialogState() - : mode_(FILE_DIALOG_OPEN), - last_selected_filter_(0), - pending_(false) {} + : mode_(FILE_DIALOG_OPEN), last_selected_filter_(0), pending_(false) {} cef_file_dialog_mode_t mode_; int last_selected_filter_; @@ -48,9 +46,7 @@ class DialogCallback : public CefRunFileDialogCallback { DialogCallback( CefRefPtr router_callback, scoped_refptr dialog_state) - : router_callback_(router_callback), - dialog_state_(dialog_state) { - } + : router_callback_(router_callback), dialog_state_(dialog_state) {} virtual void OnFileDialogDismissed( int last_selected_filter, @@ -147,7 +143,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { if (dialog_state_->mode_ != FILE_DIALOG_OPEN_FOLDER) { // Build filters based on mime time. accept_filters.push_back("text/*"); - + // Build filters based on file extension. accept_filters.push_back(".log"); accept_filters.push_back(".patch"); @@ -161,10 +157,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { dialog_state_->pending_ = true; browser->GetHost()->RunFileDialog( - dialog_state_->mode_, - title, - dialog_state_->last_file_, - accept_filters, + dialog_state_->mode_, title, dialog_state_->last_file_, accept_filters, dialog_state_->last_selected_filter_, new DialogCallback(callback, dialog_state_)); diff --git a/tests/cefclient/browser/drm_test.cc b/tests/cefclient/browser/drm_test.cc index 795432c90..25eda95a7 100644 --- a/tests/cefclient/browser/drm_test.cc +++ b/tests/cefclient/browser/drm_test.cc @@ -26,8 +26,7 @@ const char kWidevineCdmPathKey[] = "widevine_cdm_path"; class CdmCallback : public CefRegisterCdmCallback { public: CdmCallback(CefRefPtr callback) - : callback_(callback) { - } + : callback_(callback) {} void OnCdmRegistrationComplete(cef_cdm_registration_error_t result, const CefString& error_message) OVERRIDE { @@ -101,9 +100,9 @@ class Handler : public CefMessageRouterBrowserSide::Handler { cef_value_type_t value_type, CefRefPtr callback) { if (!dictionary->HasKey(key) || dictionary->GetType(key) != value_type) { - callback->Failure(kMessageFormatError, - "Missing or incorrectly formatted message key: " + - std::string(key)); + callback->Failure( + kMessageFormatError, + "Missing or incorrectly formatted message key: " + std::string(key)); return false; } return true; diff --git a/tests/cefclient/browser/main_context.cc b/tests/cefclient/browser/main_context.cc index 3a38f20fc..9f6150e66 100644 --- a/tests/cefclient/browser/main_context.cc +++ b/tests/cefclient/browser/main_context.cc @@ -23,7 +23,6 @@ MainContext* MainContext::Get() { MainContext::MainContext() { DCHECK(!g_main_context); g_main_context = this; - } MainContext::~MainContext() { diff --git a/tests/cefclient/browser/main_context_impl.cc b/tests/cefclient/browser/main_context_impl.cc index d1f83be33..5ccedae73 100644 --- a/tests/cefclient/browser/main_context_impl.cc +++ b/tests/cefclient/browser/main_context_impl.cc @@ -69,8 +69,8 @@ MainContextImpl::MainContextImpl(CefRefPtr command_line, use_views_ = command_line_->HasSwitch(switches::kUseViews); if (use_windowless_rendering_ && use_views_) { - LOG(ERROR) << - "Windowless rendering is not supported by the Views framework."; + LOG(ERROR) + << "Windowless rendering is not supported by the Views framework."; use_views_ = false; } @@ -157,8 +157,10 @@ void MainContextImpl::PopulateSettings(CefSettings* settings) { void MainContextImpl::PopulateBrowserSettings(CefBrowserSettings* settings) { if (command_line_->HasSwitch(switches::kOffScreenFrameRate)) { - settings->windowless_frame_rate = atoi(command_line_-> - GetSwitchValue(switches::kOffScreenFrameRate).ToString().c_str()); + settings->windowless_frame_rate = + atoi(command_line_->GetSwitchValue(switches::kOffScreenFrameRate) + .ToString() + .c_str()); } if (browser_background_color_ != 0) diff --git a/tests/cefclient/browser/main_context_impl.h b/tests/cefclient/browser/main_context_impl.h index 3c6465bd5..a58784caa 100644 --- a/tests/cefclient/browser/main_context_impl.h +++ b/tests/cefclient/browser/main_context_impl.h @@ -53,9 +53,7 @@ class MainContextImpl : public MainContext { // Returns true if the context is in a valid state (initialized and not yet // shut down). - bool InValidState() const { - return initialized_ && !shutdown_; - } + bool InValidState() const { return initialized_ && !shutdown_; } CefRefPtr command_line_; const bool terminate_when_all_windows_closed_; diff --git a/tests/cefclient/browser/main_context_impl_win.cc b/tests/cefclient/browser/main_context_impl_win.cc index bf041764b..4bf4d588b 100644 --- a/tests/cefclient/browser/main_context_impl_win.cc +++ b/tests/cefclient/browser/main_context_impl_win.cc @@ -14,8 +14,8 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) { std::string path; // Save the file in the user's "My Documents" folder. - if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, - NULL, 0, szFolderPath))) { + if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, + 0, szFolderPath))) { path = CefString(szFolderPath); path += "\\" + file_name; } diff --git a/tests/cefclient/browser/main_message_loop_multithreaded_win.cc b/tests/cefclient/browser/main_message_loop_multithreaded_win.cc index 887ed8367..a8aa6f3bf 100644 --- a/tests/cefclient/browser/main_message_loop_multithreaded_win.cc +++ b/tests/cefclient/browser/main_message_loop_multithreaded_win.cc @@ -23,8 +23,7 @@ MainMessageLoopMultithreadedWin::MainMessageLoopMultithreadedWin() : thread_id_(base::PlatformThread::CurrentId()), task_message_id_(RegisterWindowMessage(kTaskMessageName)), dialog_hwnd_(NULL), - message_hwnd_(NULL) { -} + message_hwnd_(NULL) {} MainMessageLoopMultithreadedWin::~MainMessageLoopMultithreadedWin() { DCHECK(RunsTasksOnCurrentThread()); @@ -123,8 +122,11 @@ HWND MainMessageLoopMultithreadedWin::CreateMessageWindow(HINSTANCE hInstance) { } // static -LRESULT CALLBACK MainMessageLoopMultithreadedWin::MessageWndProc( - HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK +MainMessageLoopMultithreadedWin::MessageWndProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { MainMessageLoopMultithreadedWin* self = GetUserDataPtr(hWnd); @@ -136,11 +138,13 @@ LRESULT CALLBACK MainMessageLoopMultithreadedWin::MessageWndProc( // Release the reference added in PostTaskInternal. This will likely result // in |task| being deleted. task->Release(); - } else switch (message) { - case WM_DESTROY: - // Clear the reference to |self|. - SetUserDataPtr(hWnd, NULL); - break; + } else { + switch (message) { + case WM_DESTROY: + // Clear the reference to |self|. + SetUserDataPtr(hWnd, NULL); + break; + } } return DefWindowProc(hWnd, message, wParam, lParam); diff --git a/tests/cefclient/browser/main_message_loop_multithreaded_win.h b/tests/cefclient/browser/main_message_loop_multithreaded_win.h index 5e6e32ddb..7f045558e 100644 --- a/tests/cefclient/browser/main_message_loop_multithreaded_win.h +++ b/tests/cefclient/browser/main_message_loop_multithreaded_win.h @@ -36,7 +36,9 @@ class MainMessageLoopMultithreadedWin : public MainMessageLoop { static HWND CreateMessageWindow(HINSTANCE hInstance); // Window procedure for the message window. - static LRESULT CALLBACK MessageWndProc(HWND hWnd, UINT message, WPARAM wParam, + static LRESULT CALLBACK MessageWndProc(HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam); void PostTaskInternal(CefRefPtr task); @@ -51,7 +53,7 @@ class MainMessageLoopMultithreadedWin : public MainMessageLoop { // Must be protected by |lock_|. HWND message_hwnd_; - std::queue > queued_tasks_; + std::queue> queued_tasks_; DISALLOW_COPY_AND_ASSIGN(MainMessageLoopMultithreadedWin); }; diff --git a/tests/cefclient/browser/osr_accessibility_helper.cc b/tests/cefclient/browser/osr_accessibility_helper.cc index 07f803014..673e0f974 100644 --- a/tests/cefclient/browser/osr_accessibility_helper.cc +++ b/tests/cefclient/browser/osr_accessibility_helper.cc @@ -9,16 +9,14 @@ namespace client { OsrAccessibilityHelper::OsrAccessibilityHelper(CefRefPtr value, CefRefPtr browser) - : root_node_id_(-1), - focused_node_id_(-1), - browser_(browser) { + : root_node_id_(-1), focused_node_id_(-1), browser_(browser) { UpdateAccessibilityTree(value); } void OsrAccessibilityHelper::UpdateAccessibilityTree( CefRefPtr value) { if (value && value->GetType() == VTYPE_LIST) { - CefRefPtr list = value->GetList(); + CefRefPtr list = value->GetList(); size_t numEvents = list->GetSize(); if (numEvents > 0) { for (size_t i = 0; i < numEvents; i++) { @@ -55,7 +53,7 @@ void OsrAccessibilityHelper::UpdateLayout( // reset root node if that is to be cleared if (node_id_to_clear == root_node_id_) root_node_id_ = -1; - OsrAXNode *node = GetNode(node_id_to_clear); + OsrAXNode* node = GetNode(node_id_to_clear); DestroyNode(node); } diff --git a/tests/cefclient/browser/osr_accessibility_helper.h b/tests/cefclient/browser/osr_accessibility_helper.h index c6c337576..f4ea50d25 100644 --- a/tests/cefclient/browser/osr_accessibility_helper.h +++ b/tests/cefclient/browser/osr_accessibility_helper.h @@ -23,21 +23,15 @@ class OsrAccessibilityHelper { void UpdateAccessibilityTree(CefRefPtr value); - OsrAXNode* GetRootNode() const { - return GetNode(root_node_id_); - } + OsrAXNode* GetRootNode() const { return GetNode(root_node_id_); } - OsrAXNode* GetFocusedNode() const { - return GetNode(focused_node_id_); - } + OsrAXNode* GetFocusedNode() const { return GetNode(focused_node_id_); } CefWindowHandle GetWindowHandle() const { return browser_->GetHost()->GetWindowHandle(); } - CefRefPtr GetBrowser() const { - return browser_; - }; + CefRefPtr GetBrowser() const { return browser_; }; OsrAXNode* GetNode(int nodeId) const; diff --git a/tests/cefclient/browser/osr_accessibility_node.cc b/tests/cefclient/browser/osr_accessibility_node.cc index b0615c822..fdbb41d1f 100644 --- a/tests/cefclient/browser/osr_accessibility_node.cc +++ b/tests/cefclient/browser/osr_accessibility_node.cc @@ -13,8 +13,10 @@ namespace client { OsrAXNode::OsrAXNode(CefRefPtr value, OsrAccessibilityHelper* helper) - : node_id_(-1), platform_accessibility_(NULL), parent_(NULL), - accessibility_helper_(helper) { + : node_id_(-1), + platform_accessibility_(NULL), + parent_(NULL), + accessibility_helper_(helper) { UpdateValue(value); } @@ -29,7 +31,7 @@ void OsrAXNode::UpdateValue(CefRefPtr value) { CefRefPtr childs = value->GetList("child_ids"); // Reset child Ids child_ids_.clear(); - for(size_t idx = 0; idx < childs->GetSize(); idx++) + for (size_t idx = 0; idx < childs->GetSize(); idx++) child_ids_.push_back(childs->GetInt(idx)); } // Update Location @@ -51,9 +53,9 @@ void OsrAXNode::UpdateValue(CefRefPtr value) { if (attributes_ && attributes_->HasKey("name")) name_ = attributes_->GetString("name"); if (attributes_ && attributes_->HasKey("value")) - value_ = attributes_->GetString("value"); + value_ = attributes_->GetString("value"); if (attributes_ && attributes_->HasKey("description")) - description_ = attributes_->GetString("description"); + description_ = attributes_->GetString("description"); } } } diff --git a/tests/cefclient/browser/osr_accessibility_node.h b/tests/cefclient/browser/osr_accessibility_node.h index fd56a3d96..3f33927d8 100644 --- a/tests/cefclient/browser/osr_accessibility_node.h +++ b/tests/cefclient/browser/osr_accessibility_node.h @@ -51,39 +51,27 @@ class OsrAXNode { CefNativeAccessible* GetNativeAccessibleObject(OsrAXNode* parent); CefNativeAccessible* GetParentAccessibleObject() const { - return parent_? parent_->platform_accessibility_ : NULL; + return parent_ ? parent_->platform_accessibility_ : NULL; } OsrAccessibilityHelper* GetAccessibilityHelper() const { return accessibility_helper_; }; - int GetChildCount() const { - return static_cast(child_ids_.size()); - } + int GetChildCount() const { return static_cast(child_ids_.size()); } // Return the Child at the specified index OsrAXNode* ChildAtIndex(int index) const; - const CefString& AxRole() const { - return role_; - } + const CefString& AxRole() const { return role_; } - int OsrAXNodeId() const { - return node_id_; - } + int OsrAXNodeId() const { return node_id_; } - const CefString& AxValue() const { - return value_; - } + const CefString& AxValue() const { return value_; } - const CefString& AxName() const { - return name_; - } + const CefString& AxName() const { return name_; } - const CefString& AxDescription() const { - return description_; - } + const CefString& AxDescription() const { return description_; } CefRect AxLocation() const; diff --git a/tests/cefclient/browser/osr_accessibility_node_mac.mm b/tests/cefclient/browser/osr_accessibility_node_mac.mm index 07cfa3cba..9aa243256 100644 --- a/tests/cefclient/browser/osr_accessibility_node_mac.mm +++ b/tests/cefclient/browser/osr_accessibility_node_mac.mm @@ -7,8 +7,8 @@ #include "tests/cefclient/browser/osr_accessibility_node.h" -#import #import +#import #include "tests/cefclient/browser/osr_accessibility_helper.h" @@ -248,11 +248,10 @@ inline int MiddleY(const CefRect& rect) { CefNativeAccessible* parent_; } -- (id) init:(client::OsrAXNode*) node; -+ (OsrAXNodeObject *) elementWithNode:(client::OsrAXNode*) node; +- (id)init:(client::OsrAXNode*)node; ++ (OsrAXNodeObject*)elementWithNode:(client::OsrAXNode*)node; @end - @implementation OsrAXNodeObject - (id)init:(client::OsrAXNode*)node { node_ = node; @@ -263,7 +262,7 @@ inline int MiddleY(const CefRect& rect) { return self; } -+ (OsrAXNodeObject *)elementWithNode:(client::OsrAXNode*)node { ++ (OsrAXNodeObject*)elementWithNode:(client::OsrAXNode*)node { // We manage the release ourself return [[OsrAXNodeObject alloc] init:node]; } @@ -279,27 +278,27 @@ inline int MiddleY(const CefRect& rect) { // Utility methods to map AX information received from renderer // to platform properties -- (NSString*) axRole { +- (NSString*)axRole { // Get the Role from CefAccessibilityHelper and Map to NSRole return AxRoleToNSAxRole(node_->AxRole()); } -- (NSString*) axDescription { +- (NSString*)axDescription { std::string desc = node_->AxDescription(); return [NSString stringWithUTF8String:desc.c_str()]; } -- (NSString*) axName { +- (NSString*)axName { std::string desc = node_->AxName(); return [NSString stringWithUTF8String:desc.c_str()]; } -- (NSString*) axValue { +- (NSString*)axValue { std::string desc = node_->AxValue(); return [NSString stringWithUTF8String:desc.c_str()]; } -- (void)doMouseClick: (cef_mouse_button_type_t)type { +- (void)doMouseClick:(cef_mouse_button_type_t)type { CefRefPtr browser = node_->GetBrowser(); if (browser) { CefMouseEvent mouse_event; @@ -313,20 +312,20 @@ inline int MiddleY(const CefRect& rect) { } } -- (NSMutableArray *) getKids { +- (NSMutableArray*)getKids { int numChilds = node_->GetChildCount(); if (numChilds > 0) { NSMutableArray* kids = [NSMutableArray arrayWithCapacity:numChilds]; - for(int index = 0; indexChildAtIndex(index); - [kids addObject: child ? child->GetNativeAccessibleObject(node_) : nil]; + [kids addObject:child ? child->GetNativeAccessibleObject(node_) : nil]; } return kids; } return nil; } -- (NSPoint) position { +- (NSPoint)position { CefRect cef_rect = node_->AxLocation(); NSPoint origin = NSMakePoint(cef_rect.x, cef_rect.y); NSSize size = NSMakeSize(cef_rect.width, cef_rect.height); @@ -336,19 +335,19 @@ inline int MiddleY(const CefRect& rect) { NSPoint originInWindow = [view convertPoint:origin toView:nil]; NSRect point_rect = NSMakeRect(originInWindow.x, originInWindow.y, 0, 0); - NSPoint originInScreen = [[view window] - convertRectToScreen:point_rect].origin; + NSPoint originInScreen = + [[view window] convertRectToScreen:point_rect].origin; originInScreen.y = originInScreen.y - size.height; return originInScreen; } -- (NSSize) size { +- (NSSize)size { CefRect cef_rect = node_->AxLocation(); - NSRect rect = NSMakeRect(cef_rect.x, cef_rect.y, - cef_rect.width, cef_rect.height); + NSRect rect = + NSMakeRect(cef_rect.x, cef_rect.y, cef_rect.width, cef_rect.height); NSView* view = node_->GetWindowHandle(); - rect = [[view window]convertRectToScreen: rect]; + rect = [[view window] convertRectToScreen:rect]; return rect.size; } @@ -362,39 +361,38 @@ inline int MiddleY(const CefRect& rect) { return NO; } -- (NSArray *)accessibilityAttributeNames { +- (NSArray*)accessibilityAttributeNames { static NSArray* attributes = nil; if (attributes == nil) { - attributes = [[NSArray alloc] initWithObjects: - NSAccessibilityRoleAttribute, - NSAccessibilityRoleDescriptionAttribute, - NSAccessibilityChildrenAttribute, - NSAccessibilityValueAttribute, - NSAccessibilityTitleAttribute, - NSAccessibilityDescriptionAttribute, - NSAccessibilityFocusedAttribute, - NSAccessibilityParentAttribute, - NSAccessibilityWindowAttribute, - NSAccessibilityTopLevelUIElementAttribute, - NSAccessibilityPositionAttribute, - NSAccessibilitySizeAttribute, - nil]; + attributes = [[NSArray alloc] + initWithObjects:NSAccessibilityRoleAttribute, + NSAccessibilityRoleDescriptionAttribute, + NSAccessibilityChildrenAttribute, + NSAccessibilityValueAttribute, + NSAccessibilityTitleAttribute, + NSAccessibilityDescriptionAttribute, + NSAccessibilityFocusedAttribute, + NSAccessibilityParentAttribute, + NSAccessibilityWindowAttribute, + NSAccessibilityTopLevelUIElementAttribute, + NSAccessibilityPositionAttribute, + NSAccessibilitySizeAttribute, nil]; } return attributes; } -- (id)accessibilityAttributeValue:(NSString *)attribute { +- (id)accessibilityAttributeValue:(NSString*)attribute { if (!node_) return nil; if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) { return [self axRole]; - } else if ([attribute isEqualToString: - NSAccessibilityRoleDescriptionAttribute]) { + } else if ([attribute + isEqualToString:NSAccessibilityRoleDescriptionAttribute]) { return NSAccessibilityRoleDescription([self axRole], nil); } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { // Just check if the app thinks we're focused. - id focusedElement = [NSApp accessibilityAttributeValue: - NSAccessibilityFocusedUIElementAttribute]; + id focusedElement = [NSApp + accessibilityAttributeValue:NSAccessibilityFocusedUIElementAttribute]; return [NSNumber numberWithBool:[focusedElement isEqual:self]]; } else if ([attribute isEqualToString:NSAccessibilityParentAttribute]) { return NSAccessibilityUnignoredAncestor(parent_); @@ -402,17 +400,16 @@ inline int MiddleY(const CefRect& rect) { return NSAccessibilityUnignoredChildren([self getKids]); } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) { // We're in the same window as our parent. - return [parent_ - accessibilityAttributeValue:NSAccessibilityWindowAttribute]; - } else if ([attribute isEqualToString: - NSAccessibilityTopLevelUIElementAttribute]) { + return [parent_ accessibilityAttributeValue:NSAccessibilityWindowAttribute]; + } else if ([attribute + isEqualToString:NSAccessibilityTopLevelUIElementAttribute]) { // We're in the same top level element as our parent. - return [parent_ accessibilityAttributeValue: - NSAccessibilityTopLevelUIElementAttribute]; + return [parent_ + accessibilityAttributeValue:NSAccessibilityTopLevelUIElementAttribute]; } else if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) { - return [NSValue valueWithPoint:[self position]]; + return [NSValue valueWithPoint:[self position]]; } else if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) { - return [NSValue valueWithSize:[self size]]; + return [NSValue valueWithSize:[self size]]; } else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) { return [self axDescription]; } else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) { @@ -427,15 +424,15 @@ inline int MiddleY(const CefRect& rect) { return NSAccessibilityUnignoredAncestor(self); } -- (NSArray *)accessibilityActionNames { +- (NSArray*)accessibilityActionNames { return [NSArray arrayWithObject:NSAccessibilityPressAction]; } -- (NSString *)accessibilityActionDescription:(NSString *)action { +- (NSString*)accessibilityActionDescription:(NSString*)action { return NSAccessibilityActionDescription(action); } -- (void)accessibilityPerformAction:(NSString *)action { +- (void)accessibilityPerformAction:(NSString*)action { if ([action isEqualToString:NSAccessibilityPressAction]) { // Do Click on Default action [self doMouseClick:MBT_LEFT]; @@ -462,12 +459,12 @@ namespace client { void OsrAXNode::NotifyAccessibilityEvent(std::string event_type) const { if (event_type == "focus") { - NSAccessibilityPostNotification(GetWindowHandle(), - NSAccessibilityFocusedUIElementChangedNotification); + NSAccessibilityPostNotification( + GetWindowHandle(), NSAccessibilityFocusedUIElementChangedNotification); } else if (event_type == "textChanged") { NSAccessibilityPostNotification(GetWindowHandle(), NSAccessibilityTitleChangedNotification); - } else if (event_type == "valueChanged"){ + } else if (event_type == "valueChanged") { NSAccessibilityPostNotification(GetWindowHandle(), NSAccessibilityValueChangedNotification); } else if (event_type == "textSelectionChanged") { @@ -478,8 +475,8 @@ void OsrAXNode::NotifyAccessibilityEvent(std::string event_type) const { void OsrAXNode::Destroy() { if (platform_accessibility_) { - NSAccessibilityPostNotification(platform_accessibility_, - NSAccessibilityUIElementDestroyedNotification); + NSAccessibilityPostNotification( + platform_accessibility_, NSAccessibilityUIElementDestroyedNotification); } delete this; diff --git a/tests/cefclient/browser/osr_accessibility_node_win.cc b/tests/cefclient/browser/osr_accessibility_node_win.cc index d4f57d90c..6a7def237 100644 --- a/tests/cefclient/browser/osr_accessibility_node_win.cc +++ b/tests/cefclient/browser/osr_accessibility_node_win.cc @@ -10,9 +10,9 @@ #if defined(CEF_USE_ATL) -#include #include #include +#include #include "tests/cefclient/browser/osr_accessibility_helper.h" @@ -29,8 +29,8 @@ namespace { // coordinates. void ClientToScreen(HWND hwnd, LPRECT lpRect) { if (lpRect) { - POINT ptTL = { lpRect->left, lpRect->top }; - POINT ptBR = { lpRect->right, lpRect->bottom }; + POINT ptTL = {lpRect->left, lpRect->top}; + POINT ptBR = {lpRect->right, lpRect->bottom}; // Win32 API only provides the call for a point. ClientToScreen(hwnd, &ptTL); ClientToScreen(hwnd, &ptBR); @@ -135,8 +135,11 @@ struct CefIAccessible : public IAccessible { STDMETHODIMP accDoDefaultAction(VARIANT var_id) override; // Retrieves the specified object's current screen location. - STDMETHODIMP accLocation(LONG* x_left, LONG* y_top, LONG* width, - LONG* height, VARIANT var_id) override; + STDMETHODIMP accLocation(LONG* x_left, + LONG* y_top, + LONG* width, + LONG* height, + VARIANT var_id) override; // Traverses to another UI element and retrieves the object. STDMETHODIMP accNavigate(LONG nav_dir, VARIANT start, VARIANT* end) override; @@ -185,29 +188,35 @@ struct CefIAccessible : public IAccessible { // IAccessible methods not implemented. STDMETHODIMP get_accSelection(VARIANT* selected) override; STDMETHODIMP accSelect(LONG flags_sel, VARIANT var_id) override; - STDMETHODIMP get_accHelpTopic(BSTR* help_file, VARIANT var_id, + STDMETHODIMP get_accHelpTopic(BSTR* help_file, + VARIANT var_id, LONG* topic_id) override; STDMETHODIMP put_accName(VARIANT var_id, BSTR put_name) override; // Implement IDispatch STDMETHODIMP GetTypeInfoCount(unsigned int FAR* pctinfo); - STDMETHODIMP GetTypeInfo(unsigned int iTInfo, LCID lcid, + STDMETHODIMP GetTypeInfo(unsigned int iTInfo, + LCID lcid, ITypeInfo FAR* FAR* ppTInfo); - STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, - unsigned int cNames, LCID lcid, + STDMETHODIMP GetIDsOfNames(REFIID riid, + OLECHAR FAR* FAR* rgszNames, + unsigned int cNames, + LCID lcid, DISPID FAR* rgDispId); - STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, - DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, - EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr); + STDMETHODIMP Invoke(DISPID dispIdMember, + REFIID riid, + LCID lcid, + WORD wFlags, + DISPPARAMS FAR* pDispParams, + VARIANT FAR* pVarResult, + EXCEPINFO FAR* pExcepInfo, + unsigned int FAR* puArgErr); - CefIAccessible(OsrAXNode* node) : node_(node), ref_count_(0) { - } + CefIAccessible(OsrAXNode* node) : node_(node), ref_count_(0) {} // Remove the node reference when OsrAXNode is destroyed, so that // MSAA clients get CO_E_OBJNOTCONNECTED - void MarkDestroyed() { - node_ = NULL; - } + void MarkDestroyed() { node_ = NULL; } protected: // Ref Count @@ -258,7 +267,7 @@ STDMETHODIMP_(ULONG) CefIAccessible::Release() { // ********************* // Returns the parent IAccessible in the form of an IDispatch interface. -STDMETHODIMP CefIAccessible::get_accParent(IDispatch **ppdispParent) { +STDMETHODIMP CefIAccessible::get_accParent(IDispatch** ppdispParent) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (ppdispParent) { @@ -268,8 +277,8 @@ STDMETHODIMP CefIAccessible::get_accParent(IDispatch **ppdispParent) { HWND hWnd = ::GetParent(node_->GetWindowHandle()); // if we have a window attempt to get its IAccessible pointer if (hWnd) { - AccessibleObjectFromWindow(hWnd, (DWORD)OBJID_CLIENT, - IID_IAccessible, (void**)(&parent)); + AccessibleObjectFromWindow(hWnd, (DWORD)OBJID_CLIENT, IID_IAccessible, + (void**)(&parent)); } } @@ -278,15 +287,14 @@ STDMETHODIMP CefIAccessible::get_accParent(IDispatch **ppdispParent) { *ppdispParent = parent; retCode = (*ppdispParent) ? S_OK : S_FALSE; } - } - else { + } else { retCode = E_INVALIDARG; } return retCode; } // Returns the number of children we have for this element. -STDMETHODIMP CefIAccessible::get_accChildCount(long *pcountChildren) { +STDMETHODIMP CefIAccessible::get_accChildCount(long* pcountChildren) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode) && pcountChildren) { // Get Child node count for this from Accessibility tree @@ -299,7 +307,7 @@ STDMETHODIMP CefIAccessible::get_accChildCount(long *pcountChildren) { // Returns a child IAccessible object. STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild, - IDispatch **ppdispChild) { + IDispatch** ppdispChild) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { int numChilds = node_->GetChildCount(); @@ -331,7 +339,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild, } // Check and returns the accessible name for element from accessibility tree -STDMETHODIMP CefIAccessible::get_accName(VARIANT varChild, BSTR *pszName) { +STDMETHODIMP CefIAccessible::get_accName(VARIANT varChild, BSTR* pszName) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pszName && VALID_CHILDID(varChild)) { @@ -339,14 +347,14 @@ STDMETHODIMP CefIAccessible::get_accName(VARIANT varChild, BSTR *pszName) { CComBSTR bstrResult(name.c_str()); *pszName = bstrResult.Detach(); } - } else { + } else { retCode = E_INVALIDARG; } return retCode; } // Check and returns the value for element from accessibility tree -STDMETHODIMP CefIAccessible::get_accValue(VARIANT varChild, BSTR *pszValue) { +STDMETHODIMP CefIAccessible::get_accValue(VARIANT varChild, BSTR* pszValue) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pszValue && VALID_CHILDID(varChild)) { @@ -354,7 +362,7 @@ STDMETHODIMP CefIAccessible::get_accValue(VARIANT varChild, BSTR *pszValue) { CComBSTR bstrResult(name.c_str()); *pszValue = bstrResult.Detach(); } - } else { + } else { retCode = E_INVALIDARG; } return retCode; @@ -370,14 +378,14 @@ STDMETHODIMP CefIAccessible::get_accDescription(VARIANT varChild, CComBSTR bstrResult(name.c_str()); *pszDescription = bstrResult.Detach(); } - } else { + } else { retCode = E_INVALIDARG; } return retCode; } // Check and returns the MSAA Role for element from accessibility tree -STDMETHODIMP CefIAccessible::get_accRole(VARIANT varChild, VARIANT *pvarRole) { +STDMETHODIMP CefIAccessible::get_accRole(VARIANT varChild, VARIANT* pvarRole) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { // Get the accessibilty role and Map to MSAA Role @@ -393,23 +401,23 @@ STDMETHODIMP CefIAccessible::get_accRole(VARIANT varChild, VARIANT *pvarRole) { // Check and returns Accessibility State for element from accessibility tree STDMETHODIMP CefIAccessible::get_accState(VARIANT varChild, - VARIANT *pvarState) { + VARIANT* pvarState) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pvarState) { pvarState->vt = VT_I4; - pvarState->lVal = (GetFocus() == node_->GetWindowHandle()) ? - STATE_SYSTEM_FOCUSED : 0; + pvarState->lVal = + (GetFocus() == node_->GetWindowHandle()) ? STATE_SYSTEM_FOCUSED : 0; pvarState->lVal |= STATE_SYSTEM_PRESSED; pvarState->lVal |= STATE_SYSTEM_FOCUSABLE; // For child if (varChild.lVal == CHILDID_SELF) { DWORD dwStyle = GetWindowLong(node_->GetWindowHandle(), GWL_STYLE); - pvarState->lVal |= ((dwStyle & WS_VISIBLE) == 0) ? - STATE_SYSTEM_INVISIBLE : 0; - pvarState->lVal |= ((dwStyle & WS_DISABLED) > 0) ? - STATE_SYSTEM_UNAVAILABLE : 0; + pvarState->lVal |= + ((dwStyle & WS_VISIBLE) == 0) ? STATE_SYSTEM_INVISIBLE : 0; + pvarState->lVal |= + ((dwStyle & WS_DISABLED) > 0) ? STATE_SYSTEM_UNAVAILABLE : 0; } } else { retCode = E_INVALIDARG; @@ -419,7 +427,8 @@ STDMETHODIMP CefIAccessible::get_accState(VARIANT varChild, } // Check and returns Accessibility Shortcut if any for element -STDMETHODIMP CefIAccessible::get_accKeyboardShortcut(VARIANT varChild, +STDMETHODIMP CefIAccessible::get_accKeyboardShortcut( + VARIANT varChild, BSTR* pszKeyboardShortcut) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { @@ -432,7 +441,7 @@ STDMETHODIMP CefIAccessible::get_accKeyboardShortcut(VARIANT varChild, } // Return focused element from the accessibility tree -STDMETHODIMP CefIAccessible::get_accFocus(VARIANT *pFocusChild) { +STDMETHODIMP CefIAccessible::get_accFocus(VARIANT* pFocusChild) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode(); @@ -444,8 +453,7 @@ STDMETHODIMP CefIAccessible::get_accFocus(VARIANT *pFocusChild) { if (nativeObj == this) { pFocusChild->vt = VT_I4; pFocusChild->lVal = CHILDID_SELF; - } - else { + } else { pFocusChild->vt = VT_DISPATCH; pFocusChild->pdispVal = nativeObj; pFocusChild->pdispVal->AddRef(); @@ -458,7 +466,7 @@ STDMETHODIMP CefIAccessible::get_accFocus(VARIANT *pFocusChild) { } // Return a selection list for multiple selection items. -STDMETHODIMP CefIAccessible::get_accSelection(VARIANT *pvarChildren) { +STDMETHODIMP CefIAccessible::get_accSelection(VARIANT* pvarChildren) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pvarChildren) @@ -505,14 +513,16 @@ STDMETHODIMP CefIAccessible::accSelect(long flagsSelect, VARIANT varChild) { } // Returns back the screen coordinates of our element or one of its childs -STDMETHODIMP CefIAccessible::accLocation(long* pxLeft, long* pyTop, - long* pcxWidth, long* pcyHeight, +STDMETHODIMP CefIAccessible::accLocation(long* pxLeft, + long* pyTop, + long* pcxWidth, + long* pcyHeight, VARIANT varChild) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pxLeft && pyTop && pcxWidth && pcyHeight && VALID_CHILDID(varChild)) { CefRect loc = node_->AxLocation(); - RECT rcItem = { loc.x, loc.y, loc.x + loc.width, loc.y + loc.height }; + RECT rcItem = {loc.x, loc.y, loc.x + loc.width, loc.y + loc.height}; HWND hwnd = node_->GetWindowHandle(); ClientToScreen(hwnd, &rcItem); @@ -529,22 +539,24 @@ STDMETHODIMP CefIAccessible::accLocation(long* pxLeft, long* pyTop, // Allow clients to move the keyboard focus within the control // Deprecated -STDMETHODIMP CefIAccessible::accNavigate(long navDir, VARIANT varStart, +STDMETHODIMP CefIAccessible::accNavigate(long navDir, + VARIANT varStart, VARIANT* pvarEndUpAt) { return E_NOTIMPL; } // Check if the coordinates provided are within our element or child items. -STDMETHODIMP CefIAccessible::accHitTest(long xLeft, long yTop, - VARIANT *pvarChild) { +STDMETHODIMP CefIAccessible::accHitTest(long xLeft, + long yTop, + VARIANT* pvarChild) { HRESULT retCode = DATACHECK(node_); if (SUCCEEDED(retCode)) { if (pvarChild) { pvarChild->vt = VT_EMPTY; CefRect loc = node_->AxLocation(); - RECT rcItem = { loc.x, loc.y, loc.x + loc.width, loc.y + loc.height }; - POINT pt = { xLeft, yTop }; + RECT rcItem = {loc.x, loc.y, loc.x + loc.width, loc.y + loc.height}; + POINT pt = {xLeft, yTop}; ClientToScreen(node_->GetWindowHandle(), &rcItem); @@ -594,11 +606,11 @@ STDMETHODIMP CefIAccessible::put_accValue(VARIANT varChild, BSTR szValue) { } // Return E_NOTIMPL as no help file/ topic -STDMETHODIMP CefIAccessible::get_accHelp(VARIANT varChild, BSTR *pszHelp) { +STDMETHODIMP CefIAccessible::get_accHelp(VARIANT varChild, BSTR* pszHelp) { return E_NOTIMPL; } -STDMETHODIMP CefIAccessible::get_accHelpTopic(BSTR *pszHelpFile, +STDMETHODIMP CefIAccessible::get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, long* pidTopic) { return E_NOTIMPL; @@ -610,7 +622,8 @@ STDMETHODIMP CefIAccessible::GetTypeInfoCount(unsigned int FAR* pctinfo) { return E_NOTIMPL; } -STDMETHODIMP CefIAccessible::GetTypeInfo(unsigned int iTInfo, LCID lcid, +STDMETHODIMP CefIAccessible::GetTypeInfo(unsigned int iTInfo, + LCID lcid, ITypeInfo FAR* FAR* ppTInfo) { return E_NOTIMPL; } @@ -623,8 +636,11 @@ STDMETHODIMP CefIAccessible::GetIDsOfNames(REFIID riid, return E_NOTIMPL; } -STDMETHODIMP CefIAccessible::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS FAR* pDispParams, +STDMETHODIMP CefIAccessible::Invoke(DISPID dispIdMember, + REFIID riid, + LCID lcid, + WORD wFlags, + DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr) { @@ -662,8 +678,7 @@ CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) { namespace client { -void OsrAXNode::Destroy() { -} +void OsrAXNode::Destroy() {} CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) { return NULL; diff --git a/tests/cefclient/browser/osr_dragdrop_win.cc b/tests/cefclient/browser/osr_dragdrop_win.cc index e374df48c..206eb2452 100644 --- a/tests/cefclient/browser/osr_dragdrop_win.cc +++ b/tests/cefclient/browser/osr_dragdrop_win.cc @@ -46,7 +46,7 @@ CefRenderHandler::DragOperationsMask DropEffectToDragOperation(DWORD effect) { CefMouseEvent ToMouseEvent(POINTL p, DWORD key_state, HWND hWnd) { CefMouseEvent ev; - POINT screen_point = { p.x, p.y }; + POINT screen_point = {p.x, p.y}; ScreenToClient(hWnd, &screen_point); ev.x = screen_point.x; ev.y = screen_point.y; @@ -54,7 +54,6 @@ CefMouseEvent ToMouseEvent(POINTL p, DWORD key_state, HWND hWnd) { return ev; } - void GetStorageForBytes(STGMEDIUM* storage, const void* data, size_t bytes) { HANDLE handle = GlobalAlloc(GPTR, static_cast(bytes)); if (handle) { @@ -68,7 +67,8 @@ void GetStorageForBytes(STGMEDIUM* storage, const void* data, size_t bytes) { template void GetStorageForString(STGMEDIUM* stgmed, const std::basic_string& data) { - GetStorageForBytes(stgmed, data.c_str(), + GetStorageForBytes( + stgmed, data.c_str(), (data.size() + 1) * sizeof(std::basic_string::value_type)); } @@ -82,7 +82,7 @@ void GetStorageForFileDescriptor(STGMEDIUM* storage, descriptor->cItems = 1; descriptor->fgd[0].dwFlags = FD_LINKUI; wcsncpy_s(descriptor->fgd[0].cFileName, MAX_PATH, file_name.c_str(), - std::min(file_name.size(), static_cast(MAX_PATH - 1u))); + std::min(file_name.size(), static_cast(MAX_PATH - 1u))); storage->tymed = TYMED_HGLOBAL; storage->hGlobal = hdata; @@ -101,33 +101,33 @@ std::string HtmlToCFHtml(const std::string& html, const std::string& base_url) { #define MAKE_NUMBER_FORMAT_2(digits) "%0" #digits "u" #define NUMBER_FORMAT MAKE_NUMBER_FORMAT_1(MAX_DIGITS) - static const char* header = "Version:0.9\r\n" - "StartHTML:" NUMBER_FORMAT "\r\n" - "EndHTML:" NUMBER_FORMAT "\r\n" - "StartFragment:" NUMBER_FORMAT "\r\n" - "EndFragment:" NUMBER_FORMAT "\r\n"; + static const char* header = + "Version:0.9\r\n" + "StartHTML:" NUMBER_FORMAT + "\r\n" + "EndHTML:" NUMBER_FORMAT + "\r\n" + "StartFragment:" NUMBER_FORMAT + "\r\n" + "EndFragment:" NUMBER_FORMAT "\r\n"; static const char* source_url_prefix = "SourceURL:"; static const char* start_markup = "\r\n\r\n"; static const char* end_markup = "\r\n\r\n"; // Calculate offsets - size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 + - MAX_DIGITS * 4; + size_t start_html_offset = + strlen(header) - strlen(NUMBER_FORMAT) * 4 + MAX_DIGITS * 4; if (!base_url.empty()) { - start_html_offset += strlen(source_url_prefix) + base_url.length() - + 2; // Add 2 for \r\n. + start_html_offset += + strlen(source_url_prefix) + base_url.length() + 2; // Add 2 for \r\n. } size_t start_fragment_offset = start_html_offset + strlen(start_markup); size_t end_fragment_offset = start_fragment_offset + html.length(); size_t end_html_offset = end_fragment_offset + strlen(end_markup); char raw_result[1024]; - _snprintf(raw_result, sizeof(1024), - header, - start_html_offset, - end_html_offset, - start_fragment_offset, - end_fragment_offset); + _snprintf(raw_result, sizeof(1024), header, start_html_offset, + end_html_offset, start_fragment_offset, end_fragment_offset); std::string result = raw_result; if (!base_url.empty()) { result.append(source_url_prefix); @@ -178,15 +178,16 @@ void CFHtmlExtractMetadata(const std::string& cf_html, static std::string start_fragment_str("StartFragment:"); size_t start_fragment_start = cf_html.find(start_fragment_str); if (start_fragment_start != std::string::npos) { - *fragment_start = static_cast(atoi(cf_html.c_str() + - start_fragment_start + start_fragment_str.length())); + *fragment_start = + static_cast(atoi(cf_html.c_str() + start_fragment_start + + start_fragment_str.length())); } static std::string end_fragment_str("EndFragment:"); size_t end_fragment_start = cf_html.find(end_fragment_str); if (end_fragment_start != std::string::npos) { - *fragment_end = static_cast(atoi(cf_html.c_str() + - end_fragment_start + end_fragment_str.length())); + *fragment_end = static_cast(atoi( + cf_html.c_str() + end_fragment_start + end_fragment_str.length())); } } else { *fragment_start = cf_html.find('>', tag_start) + 1; @@ -211,8 +212,7 @@ void CFHtmlToHtml(const std::string& cf_html, const DWORD moz_url_format = ::RegisterClipboardFormat(L"text/x-moz-url"); const DWORD html_format = ::RegisterClipboardFormat(L"HTML Format"); -const DWORD file_desc_format = - ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR); +const DWORD file_desc_format = ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR); const DWORD file_contents_format = ::RegisterClipboardFormat(CFSTR_FILECONTENTS); @@ -221,7 +221,7 @@ bool DragDataToDataObject(CefRefPtr drag_data, const int kMaxDataObjects = 10; FORMATETC fmtetcs[kMaxDataObjects]; STGMEDIUM stgmeds[kMaxDataObjects]; - FORMATETC fmtetc = { 0, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + FORMATETC fmtetc = {0, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; int curr_index = 0; CefString text = drag_data->GetFragmentText(); if (!text.empty()) { @@ -262,7 +262,7 @@ bool DragDataToDataObject(CefRefPtr drag_data, fmtetcs[curr_index] = fmtetc; curr_index++; GetStorageForBytes(&stgmeds[curr_index], handler->GetData(), - handler->GetDataSize()); + handler->GetDataSize()); fmtetc.cfFormat = file_contents_format; fmtetcs[curr_index] = fmtetc; curr_index++; @@ -291,12 +291,10 @@ CefRefPtr DataObjectToDragData(IDataObject* data_object) { res = enumFormats->Next(kCelt, rgelt, &celtFetched); for (unsigned i = 0; i < celtFetched; i++) { CLIPFORMAT format = rgelt[i].cfFormat; - if (!(format == CF_UNICODETEXT || - format == CF_TEXT || - format == moz_url_format || - format == html_format || - format == CF_HDROP) - || rgelt[i].tymed != TYMED_HGLOBAL) + if (!(format == CF_UNICODETEXT || format == CF_TEXT || + format == moz_url_format || format == html_format || + format == CF_HDROP) || + rgelt[i].tymed != TYMED_HGLOBAL) continue; STGMEDIUM medium; if (data_object->GetData(&rgelt[i], &medium) == S_OK) { @@ -359,7 +357,6 @@ CefRefPtr DataObjectToDragData(IDataObject* data_object) { } // namespace - CComPtr DropTargetWin::Create(OsrDragEvents* callback, HWND hWnd) { return CComPtr(new DropTargetWin(callback, hWnd)); @@ -387,7 +384,8 @@ CefBrowserHost::DragOperationsMask DropTargetWin::StartDragging( CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) { + int x, + int y) { CComPtr dataObject; DWORD resEffect = DROPEFFECT_NONE; if (DragDataToDataObject(drag_data, &dataObject)) { @@ -456,7 +454,8 @@ HRESULT DropSourceWin::QueryContinueDrag(BOOL fEscapePressed, return S_OK; } -HRESULT DragEnumFormatEtc::CreateEnumFormatEtc(UINT cfmt, +HRESULT DragEnumFormatEtc::CreateEnumFormatEtc( + UINT cfmt, FORMATETC* afmt, IEnumFORMATETC** ppEnumFormatEtc) { if (cfmt == 0 || afmt == 0 || ppEnumFormatEtc == 0) @@ -581,14 +580,14 @@ HRESULT DataObjectWin::DUnadvise(DWORD dwConnection) { return E_NOTIMPL; } -HRESULT DataObjectWin::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise) { +HRESULT DataObjectWin::EnumDAdvise(IEnumSTATDATA** ppEnumAdvise) { return E_NOTIMPL; } HRESULT DataObjectWin::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC** ppEnumFormatEtc) { return DragEnumFormatEtc::CreateEnumFormatEtc(m_nNumFormats, m_pFormatEtc, - ppEnumFormatEtc); + ppEnumFormatEtc); } HRESULT DataObjectWin::GetData(FORMATETC* pFormatEtc, STGMEDIUM* pMedium) { @@ -604,20 +603,20 @@ HRESULT DataObjectWin::GetData(FORMATETC* pFormatEtc, STGMEDIUM* pMedium) { // copy the data into the caller's storage medium switch (m_pFormatEtc[idx].tymed) { - case TYMED_HGLOBAL: - pMedium->hGlobal = DupGlobalMem(m_pStgMedium[idx].hGlobal); - break; + case TYMED_HGLOBAL: + pMedium->hGlobal = DupGlobalMem(m_pStgMedium[idx].hGlobal); + break; - default: - return DV_E_FORMATETC; + default: + return DV_E_FORMATETC; } return S_OK; } HGLOBAL DataObjectWin::DupGlobalMem(HGLOBAL hMem) { - DWORD len = GlobalSize(hMem); - PVOID source = GlobalLock(hMem); - PVOID dest = GlobalAlloc(GMEM_FIXED, len); + DWORD len = GlobalSize(hMem); + PVOID source = GlobalLock(hMem); + PVOID dest = GlobalAlloc(GMEM_FIXED, len); memcpy(dest, source, len); GlobalUnlock(hMem); @@ -627,9 +626,9 @@ HGLOBAL DataObjectWin::DupGlobalMem(HGLOBAL hMem) { int DataObjectWin::LookupFormatEtc(FORMATETC* pFormatEtc) { // check each of our formats in turn to see if one matches for (int i = 0; i < m_nNumFormats; i++) { - if ((m_pFormatEtc[i].tymed & pFormatEtc->tymed) && - m_pFormatEtc[i].cfFormat == pFormatEtc->cfFormat && - m_pFormatEtc[i].dwAspect == pFormatEtc->dwAspect) { + if ((m_pFormatEtc[i].tymed & pFormatEtc->tymed) && + m_pFormatEtc[i].cfFormat == pFormatEtc->cfFormat && + m_pFormatEtc[i].dwAspect == pFormatEtc->dwAspect) { // return index of stored format return i; } diff --git a/tests/cefclient/browser/osr_dragdrop_win.h b/tests/cefclient/browser/osr_dragdrop_win.h index 535eeb8a6..7bb4fcba8 100644 --- a/tests/cefclient/browser/osr_dragdrop_win.h +++ b/tests/cefclient/browser/osr_dragdrop_win.h @@ -22,36 +22,34 @@ namespace client { -#define DEFAULT_QUERY_INTERFACE(__Class) \ +#define DEFAULT_QUERY_INTERFACE(__Class) \ HRESULT __stdcall QueryInterface(const IID& iid, void** object) { \ - *object = NULL; \ - if (IsEqualIID(iid, IID_IUnknown)) { \ - IUnknown* obj = this; \ - *object = obj; \ - } else if (IsEqualIID(iid, IID_ ## __Class)) { \ - __Class* obj = this; \ - *object = obj; \ - } else { \ - return E_NOINTERFACE; \ - } \ - AddRef(); \ - return S_OK; \ + *object = NULL; \ + if (IsEqualIID(iid, IID_IUnknown)) { \ + IUnknown* obj = this; \ + *object = obj; \ + } else if (IsEqualIID(iid, IID_##__Class)) { \ + __Class* obj = this; \ + *object = obj; \ + } else { \ + return E_NOINTERFACE; \ + } \ + AddRef(); \ + return S_OK; \ } -#define IUNKNOWN_IMPLEMENTATION \ - ULONG __stdcall AddRef() { \ - return ++ref_count_; \ - } \ - ULONG __stdcall Release() { \ - if (--ref_count_ == 0) { \ - delete this; \ - return 0U; \ - } \ - return ref_count_; \ - } \ - protected: \ +#define IUNKNOWN_IMPLEMENTATION \ + ULONG __stdcall AddRef() { return ++ref_count_; } \ + ULONG __stdcall Release() { \ + if (--ref_count_ == 0) { \ + delete this; \ + return 0U; \ + } \ + return ref_count_; \ + } \ + \ + protected: \ ULONG ref_count_; - class DropTargetWin : public IDropTarget { public: static CComPtr Create(OsrDragEvents* callback, HWND hWnd); @@ -60,7 +58,8 @@ class DropTargetWin : public IDropTarget { CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y); + int x, + int y); // IDropTarget implementation: HRESULT __stdcall DragEnter(IDataObject* data_object, @@ -84,9 +83,7 @@ class DropTargetWin : public IDropTarget { protected: DropTargetWin(OsrDragEvents* callback, HWND hWnd) - : ref_count_(0), - callback_(callback), - hWnd_(hWnd) {} + : ref_count_(0), callback_(callback), hWnd_(hWnd) {} virtual ~DropTargetWin() {} private: @@ -123,26 +120,26 @@ class DragEnumFormatEtc : public IEnumFORMATETC { // IEnumFormatEtc members // HRESULT __stdcall Next(ULONG celt, - FORMATETC * pFormatEtc, - ULONG * pceltFetched); + FORMATETC* pFormatEtc, + ULONG* pceltFetched); HRESULT __stdcall Skip(ULONG celt); HRESULT __stdcall Reset(void); - HRESULT __stdcall Clone(IEnumFORMATETC ** ppEnumFormatEtc); + HRESULT __stdcall Clone(IEnumFORMATETC** ppEnumFormatEtc); // // Construction / Destruction // - DragEnumFormatEtc(FORMATETC *pFormatEtc, int nNumFormats); + DragEnumFormatEtc(FORMATETC* pFormatEtc, int nNumFormats); ~DragEnumFormatEtc(); - static void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source); + static void DeepCopyFormatEtc(FORMATETC* dest, FORMATETC* source); DEFAULT_QUERY_INTERFACE(IEnumFORMATETC) IUNKNOWN_IMPLEMENTATION private: - ULONG m_nIndex; // current enumerator index - ULONG m_nNumFormats; // number of FORMATETC members + ULONG m_nIndex; // current enumerator index + ULONG m_nNumFormats; // number of FORMATETC members FORMATETC* m_pFormatEtc; // array of FORMATETC objects }; @@ -153,7 +150,7 @@ class DataObjectWin : public IDataObject { int count); // IDataObject memberS - HRESULT __stdcall GetDataHere(FORMATETC* pFormatEtc, STGMEDIUM *pmedium); + HRESULT __stdcall GetDataHere(FORMATETC* pFormatEtc, STGMEDIUM* pmedium); HRESULT __stdcall QueryGetData(FORMATETC* pFormatEtc); HRESULT __stdcall GetCanonicalFormatEtc(FORMATETC* pFormatEct, FORMATETC* pFormatEtcOut); @@ -165,11 +162,11 @@ class DataObjectWin : public IDataObject { IAdviseSink*, DWORD*); HRESULT __stdcall DUnadvise(DWORD dwConnection); - HRESULT __stdcall EnumDAdvise(IEnumSTATDATA **ppEnumAdvise); + HRESULT __stdcall EnumDAdvise(IEnumSTATDATA** ppEnumAdvise); HRESULT __stdcall EnumFormatEtc(DWORD dwDirection, - IEnumFORMATETC **ppEnumFormatEtc); - HRESULT __stdcall GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium); + IEnumFORMATETC** ppEnumFormatEtc); + HRESULT __stdcall GetData(FORMATETC* pFormatEtc, STGMEDIUM* pMedium); DEFAULT_QUERY_INTERFACE(IDataObject) IUNKNOWN_IMPLEMENTATION @@ -181,9 +178,9 @@ class DataObjectWin : public IDataObject { static HGLOBAL DupGlobalMem(HGLOBAL hMem); - int LookupFormatEtc(FORMATETC *pFormatEtc); + int LookupFormatEtc(FORMATETC* pFormatEtc); - explicit DataObjectWin(FORMATETC *fmtetc, STGMEDIUM *stgmed, int count); + explicit DataObjectWin(FORMATETC* fmtetc, STGMEDIUM* stgmed, int count); }; } // namespace client diff --git a/tests/cefclient/browser/osr_ime_handler_win.cc b/tests/cefclient/browser/osr_ime_handler_win.cc index d6e83f95f..495525e73 100644 --- a/tests/cefclient/browser/osr_ime_handler_win.cc +++ b/tests/cefclient/browser/osr_ime_handler_win.cc @@ -4,20 +4,20 @@ // Implementation based on ui/base/ime/win/imm32_manager.cc from Chromium. -#include #include +#include #include "include/base/cef_build.h" -#include "tests/cefclient/browser/resource.h" #include "tests/cefclient/browser/osr_ime_handler_win.h" +#include "tests/cefclient/browser/resource.h" #include "tests/shared/browser/geometry_util.h" #include "tests/shared/browser/main_message_loop.h" #include "tests/shared/browser/util_win.h" -#define ColorUNDERLINE 0xFF000000 // Black SkColor value for underline, - // same as Blink. -#define ColorBKCOLOR 0x00000000 // White SkColor value for background, - // same as Blink. +#define ColorUNDERLINE 0xFF000000 // Black SkColor value for underline, + // same as Blink. +#define ColorBKCOLOR 0x00000000 // White SkColor value for background, + // same as Blink. namespace client { @@ -32,7 +32,8 @@ bool IsSelectionAttribute(char attribute) { // Helper function for OsrImeHandlerWin::GetCompositionInfo() method, // to get the target range that's selected by the user in the current // composition string. -void GetCompositionSelectionRange(HIMC imc, int* target_start, +void GetCompositionSelectionRange(HIMC imc, + int* target_start, int* target_end) { int attribute_size = ::ImmGetCompositionString(imc, GCS_COMPATTR, NULL, 0); if (attribute_size > 0) { @@ -62,14 +63,14 @@ void GetCompositionUnderlines( HIMC imc, int target_start, int target_end, - std::vector &underlines) { + std::vector& underlines) { int clause_size = ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, NULL, 0); int clause_length = clause_size / sizeof(uint32); if (clause_length) { std::vector clause_data(clause_length); - ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, - &clause_data[0], clause_size); + ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, &clause_data[0], + clause_size); for (int i = 0; i < clause_length - 1; ++i) { cef_composition_underline_t underline; underline.range.from = clause_data[i]; @@ -91,13 +92,13 @@ void GetCompositionUnderlines( } // namespace OsrImeHandlerWin::OsrImeHandlerWin(HWND hwnd) - : ime_status_(false), - hwnd_(hwnd), - input_language_id_(LANG_USER_DEFAULT), - is_composing_(false), - cursor_index_(-1), - system_caret_(false) { - ime_rect_ = { -1, -1, 0, 0 }; + : ime_status_(false), + hwnd_(hwnd), + input_language_id_(LANG_USER_DEFAULT), + is_composing_(false), + cursor_index_(-1), + system_caret_(false) { + ime_rect_ = {-1, -1, 0, 0}; } OsrImeHandlerWin::~OsrImeHandlerWin() { @@ -180,8 +181,7 @@ void OsrImeHandlerWin::MoveImeWindow() { // Therefore, we do not only call ::ImmSetCandidateWindow() but also // set the positions of the temporary system caret if it exists. CANDIDATEFORM candidate_position = { - 0, CFS_CANDIDATEPOS, { rc.x, rc.y }, { 0, 0, 0, 0 } - }; + 0, CFS_CANDIDATEPOS, {rc.x, rc.y}, {0, 0, 0, 0}}; ::ImmSetCandidateWindow(imc, &candidate_position); } if (system_caret_) { @@ -205,9 +205,10 @@ void OsrImeHandlerWin::MoveImeWindow() { // ::ImmSetCandidateWindow() with its 'dwStyle' parameter CFS_EXCLUDE // Therefore, we also set this parameter here. CANDIDATEFORM exclude_rectangle = { - 0, CFS_EXCLUDE, { rc.x, rc.y }, - { rc.x, rc.y, rc.x + rc.width, rc.y + rc.height } - }; + 0, + CFS_EXCLUDE, + {rc.x, rc.y}, + {rc.x, rc.y, rc.x + rc.width, rc.y + rc.height}}; ::ImmSetCandidateWindow(imc, &exclude_rectangle); ::ImmReleaseContext(hwnd_, imc); @@ -234,12 +235,11 @@ void OsrImeHandlerWin::ResetComposition() { cursor_index_ = -1; } - void OsrImeHandlerWin::GetCompositionInfo( HIMC imc, LPARAM lparam, - CefString &composition_text, - std::vector &underlines, + CefString& composition_text, + std::vector& underlines, int& composition_start) { // We only care about GCS_COMPATTR, GCS_COMPCLAUSE and GCS_CURSORPOS, and // convert them into underlines and selection range respectively. @@ -299,7 +299,9 @@ void OsrImeHandlerWin::GetCompositionInfo( } } -bool OsrImeHandlerWin::GetString(HIMC imc, WPARAM lparam, int type, +bool OsrImeHandlerWin::GetString(HIMC imc, + WPARAM lparam, + int type, CefString& result) { if (!(lparam & type)) return false; @@ -328,8 +330,8 @@ bool OsrImeHandlerWin::GetResult(LPARAM lparam, CefString& result) { bool OsrImeHandlerWin::GetComposition( LPARAM lparam, - CefString &composition_text, - std::vector &underlines, + CefString& composition_text, + std::vector& underlines, int& composition_start) { bool ret = false; HIMC imc = ::ImmGetContext(hwnd_); diff --git a/tests/cefclient/browser/osr_ime_handler_win.h b/tests/cefclient/browser/osr_ime_handler_win.h index ed43ad208..82aced53d 100644 --- a/tests/cefclient/browser/osr_ime_handler_win.h +++ b/tests/cefclient/browser/osr_ime_handler_win.h @@ -45,8 +45,9 @@ class OsrImeHandlerWin { // Retrieves the current composition status of the ongoing composition. // Includes composition text, underline information and selection range in the // composition text. IMM32 does not support char selection. - bool GetComposition(LPARAM lparam, CefString &composition_text, - std::vector &underlines, + bool GetComposition(LPARAM lparam, + CefString& composition_text, + std::vector& underlines, int& composition_start); // Enables the IME attached to the given window. @@ -72,8 +73,9 @@ class OsrImeHandlerWin { private: // Retrieves the composition information. - void GetCompositionInfo(HIMC imm_context, LPARAM lparam, - CefString &composition_text, + void GetCompositionInfo(HIMC imm_context, + LPARAM lparam, + CefString& composition_text, std::vector& underlines, int& composition_start); diff --git a/tests/cefclient/browser/osr_renderer.cc b/tests/cefclient/browser/osr_renderer.cc index 76dcb06b4..3c1cfb702 100644 --- a/tests/cefclient/browser/osr_renderer.cc +++ b/tests/cefclient/browser/osr_renderer.cc @@ -29,10 +29,10 @@ // DCHECK on gl errors. #if DCHECK_IS_ON() -#define VERIFY_NO_ERROR { \ - int _gl_error = glGetError(); \ - DCHECK(_gl_error == GL_NO_ERROR) << \ - "glGetError returned " << _gl_error; \ +#define VERIFY_NO_ERROR \ + { \ + int _gl_error = glGetError(); \ + DCHECK(_gl_error == GL_NO_ERROR) << "glGetError returned " << _gl_error; \ } #else #define VERIFY_NO_ERROR @@ -47,8 +47,7 @@ OsrRenderer::OsrRenderer(const Settings& settings) view_width_(0), view_height_(0), spin_x_(0), - spin_y_(0) { -} + spin_y_(0) {} OsrRenderer::~OsrRenderer() { Cleanup(); @@ -58,30 +57,38 @@ void OsrRenderer::Initialize() { if (initialized_) return; - glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); VERIFY_NO_ERROR; + glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); + VERIFY_NO_ERROR; if (IsTransparent()) { - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); VERIFY_NO_ERROR; + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + VERIFY_NO_ERROR; } else { glClearColor(float(CefColorGetR(settings_.background_color)) / 255.0f, float(CefColorGetG(settings_.background_color)) / 255.0f, float(CefColorGetB(settings_.background_color)) / 255.0f, - 1.0f); VERIFY_NO_ERROR; + 1.0f); + VERIFY_NO_ERROR; } // Necessary for non-power-of-2 textures to render correctly. - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + VERIFY_NO_ERROR; // Create the texture. - glGenTextures(1, &texture_id_); VERIFY_NO_ERROR; - DCHECK_NE(texture_id_, 0U); VERIFY_NO_ERROR; + glGenTextures(1, &texture_id_); + VERIFY_NO_ERROR; + DCHECK_NE(texture_id_, 0U); + VERIFY_NO_ERROR; - glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST); VERIFY_NO_ERROR; - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - GL_NEAREST); VERIFY_NO_ERROR; - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); VERIFY_NO_ERROR; + glBindTexture(GL_TEXTURE_2D, texture_id_); + VERIFY_NO_ERROR; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + VERIFY_NO_ERROR; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + VERIFY_NO_ERROR; + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + VERIFY_NO_ERROR; initialized_ = true; } @@ -100,25 +107,30 @@ void OsrRenderer::Render() { struct { float tu, tv; float x, y, z; - } static vertices[] = { - {0.0f, 1.0f, -1.0f, -1.0f, 0.0f}, - {1.0f, 1.0f, 1.0f, -1.0f, 0.0f}, - {1.0f, 0.0f, 1.0f, 1.0f, 0.0f}, - {0.0f, 0.0f, -1.0f, 1.0f, 0.0f} - }; + } static vertices[] = {{0.0f, 1.0f, -1.0f, -1.0f, 0.0f}, + {1.0f, 1.0f, 1.0f, -1.0f, 0.0f}, + {1.0f, 0.0f, 1.0f, 1.0f, 0.0f}, + {0.0f, 0.0f, -1.0f, 1.0f, 0.0f}}; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); VERIFY_NO_ERROR; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + VERIFY_NO_ERROR; - glMatrixMode(GL_MODELVIEW); VERIFY_NO_ERROR; - glLoadIdentity(); VERIFY_NO_ERROR; + glMatrixMode(GL_MODELVIEW); + VERIFY_NO_ERROR; + glLoadIdentity(); + VERIFY_NO_ERROR; // Match GL units to screen coordinates. - glViewport(0, 0, view_width_, view_height_); VERIFY_NO_ERROR; - glMatrixMode(GL_PROJECTION); VERIFY_NO_ERROR; - glLoadIdentity(); VERIFY_NO_ERROR; + glViewport(0, 0, view_width_, view_height_); + VERIFY_NO_ERROR; + glMatrixMode(GL_PROJECTION); + VERIFY_NO_ERROR; + glLoadIdentity(); + VERIFY_NO_ERROR; // Draw the background gradient. - glPushAttrib(GL_ALL_ATTRIB_BITS); VERIFY_NO_ERROR; + glPushAttrib(GL_ALL_ATTRIB_BITS); + VERIFY_NO_ERROR; // Don't check for errors until glEnd(). glBegin(GL_QUADS); glColor4f(1.0, 0.0, 0.0, 1.0); // red @@ -127,40 +139,53 @@ void OsrRenderer::Render() { glColor4f(0.0, 0.0, 1.0, 1.0); // blue glVertex2f(1.0, 1.0); glVertex2f(-1.0, 1.0); - glEnd(); VERIFY_NO_ERROR; - glPopAttrib(); VERIFY_NO_ERROR; + glEnd(); + VERIFY_NO_ERROR; + glPopAttrib(); + VERIFY_NO_ERROR; // Rotate the view based on the mouse spin. if (spin_x_ != 0) { - glRotatef(-spin_x_, 1.0f, 0.0f, 0.0f); VERIFY_NO_ERROR; + glRotatef(-spin_x_, 1.0f, 0.0f, 0.0f); + VERIFY_NO_ERROR; } if (spin_y_ != 0) { - glRotatef(-spin_y_, 0.0f, 1.0f, 0.0f); VERIFY_NO_ERROR; + glRotatef(-spin_y_, 0.0f, 1.0f, 0.0f); + VERIFY_NO_ERROR; } if (IsTransparent()) { // Alpha blending style. Texture values have premultiplied alpha. - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); VERIFY_NO_ERROR; + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + VERIFY_NO_ERROR; // Enable alpha blending. - glEnable(GL_BLEND); VERIFY_NO_ERROR; + glEnable(GL_BLEND); + VERIFY_NO_ERROR; } // Enable 2D textures. - glEnable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + glEnable(GL_TEXTURE_2D); + VERIFY_NO_ERROR; // Draw the facets with the texture. - DCHECK_NE(texture_id_, 0U); VERIFY_NO_ERROR; - glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; - glInterleavedArrays(GL_T2F_V3F, 0, vertices); VERIFY_NO_ERROR; - glDrawArrays(GL_QUADS, 0, 4); VERIFY_NO_ERROR; + DCHECK_NE(texture_id_, 0U); + VERIFY_NO_ERROR; + glBindTexture(GL_TEXTURE_2D, texture_id_); + VERIFY_NO_ERROR; + glInterleavedArrays(GL_T2F_V3F, 0, vertices); + VERIFY_NO_ERROR; + glDrawArrays(GL_QUADS, 0, 4); + VERIFY_NO_ERROR; // Disable 2D textures. - glDisable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + glDisable(GL_TEXTURE_2D); + VERIFY_NO_ERROR; if (IsTransparent()) { // Disable alpha blending. - glDisable(GL_BLEND); VERIFY_NO_ERROR; + glDisable(GL_BLEND); + VERIFY_NO_ERROR; } // Draw a rectangle around the update region. @@ -180,30 +205,39 @@ void OsrRenderer::Render() { bottom -= 1; #endif - glPushAttrib(GL_ALL_ATTRIB_BITS); VERIFY_NO_ERROR - glMatrixMode(GL_PROJECTION); VERIFY_NO_ERROR; - glPushMatrix(); VERIFY_NO_ERROR; - glLoadIdentity(); VERIFY_NO_ERROR; - glOrtho(0, view_width_, view_height_, 0, 0, 1); VERIFY_NO_ERROR; + glPushAttrib(GL_ALL_ATTRIB_BITS); + VERIFY_NO_ERROR + glMatrixMode(GL_PROJECTION); + VERIFY_NO_ERROR; + glPushMatrix(); + VERIFY_NO_ERROR; + glLoadIdentity(); + VERIFY_NO_ERROR; + glOrtho(0, view_width_, view_height_, 0, 0, 1); + VERIFY_NO_ERROR; - glLineWidth(1); VERIFY_NO_ERROR; - glColor3f(1.0f, 0.0f, 0.0f); VERIFY_NO_ERROR; + glLineWidth(1); + VERIFY_NO_ERROR; + glColor3f(1.0f, 0.0f, 0.0f); + VERIFY_NO_ERROR; // Don't check for errors until glEnd(). glBegin(GL_LINE_STRIP); - glVertex2i(left, top); + glVertex2i(left, top); glVertex2i(right, top); glVertex2i(right, bottom); glVertex2i(left, bottom); glVertex2i(left, top); - glEnd(); VERIFY_NO_ERROR; + glEnd(); + VERIFY_NO_ERROR; - glPopMatrix(); VERIFY_NO_ERROR; - glPopAttrib(); VERIFY_NO_ERROR; + glPopMatrix(); + VERIFY_NO_ERROR; + glPopAttrib(); + VERIFY_NO_ERROR; } } -void OsrRenderer::OnPopupShow(CefRefPtr browser, - bool show) { +void OsrRenderer::OnPopupShow(CefRefPtr browser, bool show) { if (!show) { // Clear the popup rectangle. ClearPopupRects(); @@ -246,20 +280,25 @@ void OsrRenderer::ClearPopupRects() { void OsrRenderer::OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, - const void* buffer, int width, int height) { + const void* buffer, + int width, + int height) { if (!initialized_) Initialize(); if (IsTransparent()) { // Enable alpha blending. - glEnable(GL_BLEND); VERIFY_NO_ERROR; + glEnable(GL_BLEND); + VERIFY_NO_ERROR; } // Enable 2D textures. - glEnable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + glEnable(GL_TEXTURE_2D); + VERIFY_NO_ERROR; DCHECK_NE(texture_id_, 0U); - glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; + glBindTexture(GL_TEXTURE_2D, texture_id_); + VERIFY_NO_ERROR; if (type == PET_VIEW) { int old_width = view_width_; @@ -271,17 +310,20 @@ void OsrRenderer::OnPaint(CefRefPtr browser, if (settings_.show_update_rect) update_rect_ = dirtyRects[0]; - glPixelStorei(GL_UNPACK_ROW_LENGTH, view_width_); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_ROW_LENGTH, view_width_); + VERIFY_NO_ERROR; if (old_width != view_width_ || old_height != view_height_ || (dirtyRects.size() == 1 && dirtyRects[0] == CefRect(0, 0, view_width_, view_height_))) { // Update/resize the whole texture. - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); VERIFY_NO_ERROR; - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); VERIFY_NO_ERROR; - glTexImage2D( - GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0, - GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + VERIFY_NO_ERROR; + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0, + GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer); + VERIFY_NO_ERROR; } else { // Update just the dirty rectangles. CefRenderHandler::RectList::const_iterator i = dirtyRects.begin(); @@ -289,11 +331,14 @@ void OsrRenderer::OnPaint(CefRefPtr browser, const CefRect& rect = *i; DCHECK(rect.x + rect.width <= view_width_); DCHECK(rect.y + rect.height <= view_height_); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, rect.x); VERIFY_NO_ERROR; - glPixelStorei(GL_UNPACK_SKIP_ROWS, rect.y); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_PIXELS, rect.x); + VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, rect.y); + VERIFY_NO_ERROR; glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.width, rect.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, - buffer); VERIFY_NO_ERROR; + buffer); + VERIFY_NO_ERROR; } } } else if (type == PET_POPUP && popup_rect_.width > 0 && @@ -318,19 +363,25 @@ void OsrRenderer::OnPaint(CefRefPtr browser, h -= y + h - view_height_; // Update the popup rectangle. - glPixelStorei(GL_UNPACK_ROW_LENGTH, width); VERIFY_NO_ERROR; - glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels); VERIFY_NO_ERROR; - glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_ROW_LENGTH, width); + VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels); + VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows); + VERIFY_NO_ERROR; glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_BGRA, - GL_UNSIGNED_INT_8_8_8_8_REV, buffer); VERIFY_NO_ERROR; + GL_UNSIGNED_INT_8_8_8_8_REV, buffer); + VERIFY_NO_ERROR; } // Disable 2D textures. - glDisable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + glDisable(GL_TEXTURE_2D); + VERIFY_NO_ERROR; if (IsTransparent()) { // Disable alpha blending. - glDisable(GL_BLEND); VERIFY_NO_ERROR; + glDisable(GL_BLEND); + VERIFY_NO_ERROR; } } diff --git a/tests/cefclient/browser/osr_renderer.h b/tests/cefclient/browser/osr_renderer.h index 9ee24f437..95d23fe07 100644 --- a/tests/cefclient/browser/osr_renderer.h +++ b/tests/cefclient/browser/osr_renderer.h @@ -34,15 +34,15 @@ class OsrRenderer { void Render(); // Forwarded from CefRenderHandler callbacks. - void OnPopupShow(CefRefPtr browser, - bool show); + void OnPopupShow(CefRefPtr browser, bool show); // |rect| must be in pixel coordinates. - void OnPopupSize(CefRefPtr browser, - const CefRect& rect); + void OnPopupSize(CefRefPtr browser, const CefRect& rect); void OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, - const void* buffer, int width, int height); + const void* buffer, + int width, + int height); // Apply spin. void SetSpin(float spinX, float spinY); @@ -79,4 +79,3 @@ class OsrRenderer { } // namespace client #endif // CEF_TESTS_CEFCLIENT_BROWSER_OSR_RENDERER_H_ - diff --git a/tests/cefclient/browser/osr_window_win.cc b/tests/cefclient/browser/osr_window_win.cc index 4d2a211a3..af42fc1f1 100644 --- a/tests/cefclient/browser/osr_window_win.cc +++ b/tests/cefclient/browser/osr_window_win.cc @@ -10,13 +10,13 @@ #endif #include "include/base/cef_build.h" -#include "tests/shared/browser/geometry_util.h" -#include "tests/shared/browser/main_message_loop.h" #include "tests/cefclient/browser/main_context.h" #include "tests/cefclient/browser/osr_accessibility_helper.h" #include "tests/cefclient/browser/osr_accessibility_node.h" #include "tests/cefclient/browser/osr_ime_handler_win.h" #include "tests/cefclient/browser/resource.h" +#include "tests/shared/browser/geometry_util.h" +#include "tests/shared/browser/main_message_loop.h" #include "tests/shared/browser/util_win.h" namespace client { @@ -32,8 +32,7 @@ const int kRenderDelay = 1000 / 30; class ScopedGLContext { public: ScopedGLContext(HDC hdc, HGLRC hglrc, bool swap_buffers) - : hdc_(hdc), - swap_buffers_(swap_buffers) { + : hdc_(hdc), swap_buffers_(swap_buffers) { BOOL result = wglMakeCurrent(hdc, hglrc); ALLOW_UNUSED_LOCAL(result); DCHECK(result); @@ -54,7 +53,6 @@ class ScopedGLContext { } // namespace - OsrWindowWin::OsrWindowWin(Delegate* delegate, const OsrRenderer::Settings& settings) : delegate_(delegate), @@ -111,19 +109,21 @@ void OsrWindowWin::CreateBrowser(HWND parent_hwnd, } void OsrWindowWin::ShowPopup(HWND parent_hwnd, - int x, int y, size_t width, size_t height) { + int x, + int y, + size_t width, + size_t height) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, base::Bind(&OsrWindowWin::ShowPopup, this, - parent_hwnd, x, y, width, height)); + CefPostTask(TID_UI, base::Bind(&OsrWindowWin::ShowPopup, this, parent_hwnd, + x, y, width, height)); return; } DCHECK(browser_.get()); // Create the native window. - const RECT rect = {x, y, - x + static_cast(width), + const RECT rect = {x, y, x + static_cast(width), y + static_cast(height)}; Create(parent_hwnd, rect); @@ -140,7 +140,7 @@ void OsrWindowWin::Show() { CefPostTask(TID_UI, base::Bind(&OsrWindowWin::Show, this)); return; } - + if (!browser_) return; @@ -188,9 +188,8 @@ void OsrWindowWin::SetBounds(int x, int y, size_t width, size_t height) { if (hwnd_) { // Set the browser window bounds. - ::SetWindowPos(hwnd_, NULL, x, y, - static_cast(width), static_cast(height), - SWP_NOZORDER); + ::SetWindowPos(hwnd_, NULL, x, y, static_cast(width), + static_cast(height), SWP_NOZORDER); } } @@ -201,7 +200,7 @@ void OsrWindowWin::SetFocus() { return; } - if (hwnd_) { + if (hwnd_) { // Give focus to the native window. ::SetFocus(hwnd_); } @@ -235,15 +234,15 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) { const cef_color_t background_color = MainContext::Get()->GetBackgroundColor(); const HBRUSH background_brush = CreateSolidBrush( - RGB(CefColorGetR(background_color), - CefColorGetG(background_color), + RGB(CefColorGetR(background_color), CefColorGetG(background_color), CefColorGetB(background_color))); RegisterOsrClass(hInst, background_brush); // Create the native window with a border so it's easier to visually identify // OSR windows. - hwnd_ = ::CreateWindow(kWndClass, 0, + hwnd_ = ::CreateWindow( + kWndClass, 0, WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, parent_hwnd, 0, hInst, 0); @@ -386,17 +385,17 @@ void OsrWindowWin::RegisterOsrClass(HINSTANCE hInstance, WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_OWNDC; - wcex.lpfnWndProc = OsrWndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = NULL; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.style = CS_OWNDC; + wcex.lpfnWndProc = OsrWndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = NULL; + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = background_brush; - wcex.lpszMenuName = NULL; + wcex.lpszMenuName = NULL; wcex.lpszClassName = kWndClass; - wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); RegisterClassEx(&wcex); } @@ -423,7 +422,8 @@ void OsrWindowWin::OnIMEStartComposition() { } } -void OsrWindowWin::OnIMEComposition(UINT message, WPARAM wParam, +void OsrWindowWin::OnIMEComposition(UINT message, + WPARAM wParam, LPARAM lParam) { if (browser_ && ime_handler_) { CefString cTextStr; @@ -445,10 +445,10 @@ void OsrWindowWin::OnIMEComposition(UINT message, WPARAM wParam, composition_start)) { // Send the composition string to the browser. The |replacement_range| // param is not used on Windows, so provide a default invalid value. - browser_->GetHost()->ImeSetComposition(cTextStr, underlines, - CefRange(UINT32_MAX, UINT32_MAX), + browser_->GetHost()->ImeSetComposition( + cTextStr, underlines, CefRange(UINT32_MAX, UINT32_MAX), CefRange(composition_start, - static_cast(composition_start + cTextStr.length()))); + static_cast(composition_start + cTextStr.length()))); // Update the Candidate Window position. The cursor is at the end so // subtract 1. This is safe because IMM32 does not support non-zero-width @@ -470,8 +470,10 @@ void OsrWindowWin::OnIMECancelCompositionEvent() { } // static -LRESULT CALLBACK OsrWindowWin::OsrWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK OsrWindowWin::OsrWndProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { CEF_REQUIRE_UI_THREAD(); OsrWindowWin* self = GetUserDataPtr(hWnd); @@ -502,7 +504,8 @@ LRESULT CALLBACK OsrWindowWin::OsrWndProc(HWND hWnd, UINT message, // Accessibility readers will send an OBJID_CLIENT message. if (static_cast(OBJID_CLIENT) == obj_id) { if (self->accessibility_root_) { - return LresultFromObject(IID_IAccessible, wParam, + return LresultFromObject( + IID_IAccessible, wParam, static_cast(self->accessibility_root_)); } else { // Notify the renderer to enable accessibility. @@ -582,9 +585,9 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { int x = GET_X_LPARAM(lParam); int y = GET_Y_LPARAM(lParam); cancelPreviousClick = - (abs(last_click_x_ - x) > (GetSystemMetrics(SM_CXDOUBLECLK) / 2)) - || (abs(last_click_y_ - y) > (GetSystemMetrics(SM_CYDOUBLECLK) / 2)) - || ((currentTime - last_click_time_) > GetDoubleClickTime()); + (abs(last_click_x_ - x) > (GetSystemMetrics(SM_CXDOUBLECLK) / 2)) || + (abs(last_click_y_ - y) > (GetSystemMetrics(SM_CYDOUBLECLK) / 2)) || + ((currentTime - last_click_time_) > GetDoubleClickTime()); if (cancelPreviousClick && (message == WM_MOUSEMOVE || message == WM_MOUSELEAVE)) { last_click_count_ = 0; @@ -594,7 +597,7 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { } } - switch(message) { + switch (message) { case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: { @@ -609,8 +612,9 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { mouse_rotation_ = true; } else { CefBrowserHost::MouseButtonType btnType = - (message == WM_LBUTTONDOWN ? MBT_LEFT : ( - message == WM_RBUTTONDOWN ? MBT_RIGHT : MBT_MIDDLE)); + (message == WM_LBUTTONDOWN + ? MBT_LEFT + : (message == WM_RBUTTONDOWN ? MBT_RIGHT : MBT_MIDDLE)); if (!cancelPreviousClick && (btnType == last_click_button_)) { ++last_click_count_; } else { @@ -649,14 +653,14 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { int x = GET_X_LPARAM(lParam); int y = GET_Y_LPARAM(lParam); CefBrowserHost::MouseButtonType btnType = - (message == WM_LBUTTONUP ? MBT_LEFT : ( - message == WM_RBUTTONUP ? MBT_RIGHT : MBT_MIDDLE)); + (message == WM_LBUTTONUP + ? MBT_LEFT + : (message == WM_RBUTTONUP ? MBT_RIGHT : MBT_MIDDLE)); if (browser_host) { CefMouseEvent mouse_event; mouse_event.x = x; mouse_event.y = y; - if (last_mouse_down_on_view_ && - IsOverPopupWidget(x, y) && + if (last_mouse_down_on_view_ && IsOverPopupWidget(x, y) && (GetPopupXOffset() || GetPopupYOffset())) { break; } @@ -676,9 +680,8 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { // Apply rotation effect. current_mouse_pos_.x = x; current_mouse_pos_.y = y; - renderer_.IncrementSpin( - current_mouse_pos_.x - last_mouse_pos_.x, - current_mouse_pos_.y - last_mouse_pos_.y); + renderer_.IncrementSpin(current_mouse_pos_.x - last_mouse_pos_.x, + current_mouse_pos_.y - last_mouse_pos_.y); last_mouse_pos_.x = current_mouse_pos_.x; last_mouse_pos_.y = current_mouse_pos_.y; Invalidate(); @@ -785,8 +788,7 @@ void OsrWindowWin::OnKeyEvent(UINT message, WPARAM wParam, LPARAM lParam) { CefKeyEvent event; event.windows_key_code = wParam; event.native_key_code = lParam; - event.is_system_key = message == WM_SYSCHAR || - message == WM_SYSKEYDOWN || + event.is_system_key = message == WM_SYSCHAR || message == WM_SYSKEYDOWN || message == WM_SYSKEYUP; if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN) @@ -821,8 +823,7 @@ bool OsrWindowWin::IsOverPopupWidget(int x, int y) const { const CefRect& rc = renderer_.popup_rect(); int popup_right = rc.x + rc.width; int popup_bottom = rc.y + rc.height; - return (x >= rc.x) && (x < popup_right) && - (y >= rc.y) && (y < popup_bottom); + return (x >= rc.x) && (x < popup_right) && (y >= rc.y) && (y < popup_bottom); } int OsrWindowWin::GetPopupXOffset() const { @@ -857,8 +858,8 @@ void OsrWindowWin::OnAfterCreated(CefRefPtr browser) { void OsrWindowWin::OnBeforeClose(CefRefPtr browser) { CEF_REQUIRE_UI_THREAD(); // Detach |this| from the ClientHandlerOsr. - static_cast(browser_->GetHost()->GetClient().get())-> - DetachOsrDelegate(); + static_cast(browser_->GetHost()->GetClient().get()) + ->DetachOsrDelegate(); browser_ = NULL; Destroy(); } @@ -869,8 +870,7 @@ bool OsrWindowWin::GetRootScreenRect(CefRefPtr browser, return false; } -bool OsrWindowWin::GetViewRect(CefRefPtr browser, - CefRect& rect) { +bool OsrWindowWin::GetViewRect(CefRefPtr browser, CefRect& rect) { CEF_REQUIRE_UI_THREAD(); rect.x = rect.y = 0; @@ -892,10 +892,8 @@ bool OsrWindowWin::GetScreenPoint(CefRefPtr browser, return false; // Convert the point from view coordinates to actual screen coordinates. - POINT screen_pt = { - LogicalToDevice(viewX, device_scale_factor_), - LogicalToDevice(viewY, device_scale_factor_) - }; + POINT screen_pt = {LogicalToDevice(viewX, device_scale_factor_), + LogicalToDevice(viewY, device_scale_factor_)}; ClientToScreen(hwnd_, &screen_pt); screenX = screen_pt.x; screenY = screen_pt.y; @@ -921,8 +919,7 @@ bool OsrWindowWin::GetScreenInfo(CefRefPtr browser, return true; } -void OsrWindowWin::OnPopupShow(CefRefPtr browser, - bool show) { +void OsrWindowWin::OnPopupShow(CefRefPtr browser, bool show) { CEF_REQUIRE_UI_THREAD(); if (!show) { @@ -964,11 +961,10 @@ void OsrWindowWin::OnPaint(CefRefPtr browser, renderer_.Render(); } -void OsrWindowWin::OnCursorChange( - CefRefPtr browser, - CefCursorHandle cursor, - CefRenderHandler::CursorType type, - const CefCursorInfo& custom_cursor_info) { +void OsrWindowWin::OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CefRenderHandler::CursorType type, + const CefCursorInfo& custom_cursor_info) { CEF_REQUIRE_UI_THREAD(); if (!::IsWindow(hwnd_)) @@ -984,7 +980,8 @@ bool OsrWindowWin::StartDragging( CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) { + int x, + int y) { CEF_REQUIRE_UI_THREAD(); #if defined(CEF_USE_ATL) @@ -1001,8 +998,7 @@ bool OsrWindowWin::StartDragging( browser->GetHost()->DragSourceEndedAt( DeviceToLogical(pt.x, device_scale_factor_), - DeviceToLogical(pt.y, device_scale_factor_), - result); + DeviceToLogical(pt.y, device_scale_factor_), result); browser->GetHost()->DragSourceSystemDragEnded(); return true; #else @@ -1011,9 +1007,8 @@ bool OsrWindowWin::StartDragging( #endif } -void OsrWindowWin::UpdateDragCursor( - CefRefPtr browser, - CefRenderHandler::DragOperation operation) { +void OsrWindowWin::UpdateDragCursor(CefRefPtr browser, + CefRenderHandler::DragOperation operation) { CEF_REQUIRE_UI_THREAD(); #if defined(CEF_USE_ATL) @@ -1058,10 +1053,10 @@ void OsrWindowWin::UpdateAccessibilityTree(CefRefPtr value) { #if defined(CEF_USE_ATL) -CefBrowserHost::DragOperationsMask -OsrWindowWin::OnDragEnter(CefRefPtr drag_data, - CefMouseEvent ev, - CefBrowserHost::DragOperationsMask effect) { +CefBrowserHost::DragOperationsMask OsrWindowWin::OnDragEnter( + CefRefPtr drag_data, + CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) { if (browser_) { DeviceToLogical(ev, device_scale_factor_); browser_->GetHost()->DragTargetDragEnter(drag_data, ev, effect); @@ -1070,9 +1065,9 @@ OsrWindowWin::OnDragEnter(CefRefPtr drag_data, return current_drag_op_; } -CefBrowserHost::DragOperationsMask -OsrWindowWin::OnDragOver(CefMouseEvent ev, - CefBrowserHost::DragOperationsMask effect) { +CefBrowserHost::DragOperationsMask OsrWindowWin::OnDragOver( + CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) { if (browser_) { DeviceToLogical(ev, device_scale_factor_); browser_->GetHost()->DragTargetDragOver(ev, effect); @@ -1085,9 +1080,9 @@ void OsrWindowWin::OnDragLeave() { browser_->GetHost()->DragTargetDragLeave(); } -CefBrowserHost::DragOperationsMask -OsrWindowWin::OnDrop(CefMouseEvent ev, - CefBrowserHost::DragOperationsMask effect) { +CefBrowserHost::DragOperationsMask OsrWindowWin::OnDrop( + CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) { if (browser_) { DeviceToLogical(ev, device_scale_factor_); browser_->GetHost()->DragTargetDragOver(ev, effect); diff --git a/tests/cefclient/browser/osr_window_win.h b/tests/cefclient/browser/osr_window_win.h index a7df8d041..900af2d85 100644 --- a/tests/cefclient/browser/osr_window_win.h +++ b/tests/cefclient/browser/osr_window_win.h @@ -23,11 +23,12 @@ class OsrImeHandlerWin; // Represents the native parent window for an off-screen browser. This object // must live on the CEF UI thread in order to handle CefRenderHandler callbacks. // The methods of this class are thread-safe unless otherwise indicated. -class OsrWindowWin : - public base::RefCountedThreadSafe, - public ClientHandlerOsr::OsrDelegate +class OsrWindowWin + : public base::RefCountedThreadSafe, + public ClientHandlerOsr::OsrDelegate #if defined(CEF_USE_ATL) - , public OsrDragEvents + , + public OsrDragEvents #endif { public: @@ -43,8 +44,7 @@ class OsrWindowWin : }; // |delegate| must outlive this object. - OsrWindowWin(Delegate* delegate, - const OsrRenderer::Settings& settings); + OsrWindowWin(Delegate* delegate, const OsrRenderer::Settings& settings); // Create a new browser and native window. void CreateBrowser(HWND parent_hwnd, @@ -84,9 +84,10 @@ class OsrWindowWin : void NotifyNativeWindowCreated(HWND hwnd); - static void RegisterOsrClass(HINSTANCE hInstance, - HBRUSH background_brush); - static LRESULT CALLBACK OsrWndProc(HWND hWnd, UINT message, WPARAM wParam, + static void RegisterOsrClass(HINSTANCE hInstance, HBRUSH background_brush); + static LRESULT CALLBACK OsrWndProc(HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam); // WndProc message handlers. @@ -112,10 +113,8 @@ class OsrWindowWin : // ClientHandlerOsr::OsrDelegate methods. void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; - bool GetRootScreenRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, - CefRect& rect) OVERRIDE; + bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -124,8 +123,7 @@ class OsrWindowWin : bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) OVERRIDE; void OnPopupShow(CefRefPtr browser, bool show) OVERRIDE; - void OnPopupSize(CefRefPtr browser, - const CefRect& rect) OVERRIDE; + void OnPopupSize(CefRefPtr browser, const CefRect& rect) OVERRIDE; void OnPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, @@ -139,7 +137,8 @@ class OsrWindowWin : bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, - int x, int y) OVERRIDE; + int x, + int y) OVERRIDE; void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) OVERRIDE; void OnImeCompositionRangeChanged( @@ -155,10 +154,12 @@ class OsrWindowWin : CefRefPtr drag_data, CefMouseEvent ev, CefBrowserHost::DragOperationsMask effect) OVERRIDE; - CefBrowserHost::DragOperationsMask OnDragOver(CefMouseEvent ev, + CefBrowserHost::DragOperationsMask OnDragOver( + CefMouseEvent ev, CefBrowserHost::DragOperationsMask effect) OVERRIDE; void OnDragLeave() OVERRIDE; - CefBrowserHost::DragOperationsMask OnDrop(CefMouseEvent ev, + CefBrowserHost::DragOperationsMask OnDrop( + CefMouseEvent ev, CefBrowserHost::DragOperationsMask effect) OVERRIDE; #endif // defined(CEF_USE_ATL) diff --git a/tests/cefclient/browser/preferences_test.cc b/tests/cefclient/browser/preferences_test.cc index 3a1a205a3..c83e050a7 100644 --- a/tests/cefclient/browser/preferences_test.cc +++ b/tests/cefclient/browser/preferences_test.cc @@ -40,9 +40,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { public: typedef std::vector NameVector; - Handler() { - CEF_REQUIRE_UI_THREAD(); - } + Handler() { CEF_REQUIRE_UI_THREAD(); } // Called due to cefQuery execution in preferences.html. bool OnQuery(CefRefPtr browser, @@ -138,15 +136,14 @@ class Handler : public CefMessageRouterBrowserSide::Handler { NameVector changed_names; // Apply preferences. This may result in errors. - const bool success = ApplyPrefs(context, std::string(), value, error, - changed_names); + const bool success = + ApplyPrefs(context, std::string(), value, error, changed_names); // Create a message that accurately represents the result. std::string message; if (!changed_names.empty()) { std::stringstream ss; - ss << "Successfully changed " << changed_names.size() << - " preferences; "; + ss << "Successfully changed " << changed_names.size() << " preferences; "; for (size_t i = 0; i < changed_names.size(); ++i) { ss << changed_names[i]; if (i < changed_names.size() - 1) @@ -186,20 +183,20 @@ class Handler : public CefMessageRouterBrowserSide::Handler { // If spell checking is disabled via the command-line then it cannot be // enabled via preferences. dict->SetBool("spellcheck_disabled", - command_line->HasSwitch("disable-spell-checking")); + command_line->HasSwitch("disable-spell-checking")); // If proxy settings are configured via the command-line then they cannot // be modified via preferences. dict->SetBool("proxy_configured", - command_line->HasSwitch("no-proxy-server") || - command_line->HasSwitch("proxy-auto-detect") || - command_line->HasSwitch("proxy-pac-url") || - command_line->HasSwitch("proxy-server")); + command_line->HasSwitch("no-proxy-server") || + command_line->HasSwitch("proxy-auto-detect") || + command_line->HasSwitch("proxy-pac-url") || + command_line->HasSwitch("proxy-server")); // If allow running insecure content is enabled via the command-line then it // cannot be enabled via preferences. dict->SetBool("allow_running_insecure_content", - command_line->HasSwitch("allow-running-insecure-content")); + command_line->HasSwitch("allow-running-insecure-content")); // Serialize the state to JSON and return to the JavaScript caller. callback->Success(GetJSON(dict)); @@ -227,9 +224,9 @@ class Handler : public CefMessageRouterBrowserSide::Handler { cef_value_type_t value_type, CefRefPtr callback) { if (!dictionary->HasKey(key) || dictionary->GetType(key) != value_type) { - callback->Failure(kMessageFormatError, - "Missing or incorrectly formatted message key: " + - std::string(key)); + callback->Failure( + kMessageFormatError, + "Missing or incorrectly formatted message key: " + std::string(key)); return false; } return true; @@ -257,8 +254,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { dict->GetKeys(keys); for (size_t i = 0; i < keys.size(); ++i) { const std::string& key = keys[i]; - const std::string& current_name = - name.empty() ? key : name + "." + key; + const std::string& current_name = name.empty() ? key : name + "." + key; if (!ApplyPrefs(context, current_name, dict->GetValue(key), error, changed_names)) { return false; diff --git a/tests/cefclient/browser/print_handler_gtk.cc b/tests/cefclient/browser/print_handler_gtk.cc index eb3a529c6..7288a7d46 100644 --- a/tests/cefclient/browser/print_handler_gtk.cc +++ b/tests/cefclient/browser/print_handler_gtk.cc @@ -57,15 +57,12 @@ const float kLetterHeightInch = 11.0f; class StickyPrintSettingGtk { public: - StickyPrintSettingGtk() : last_used_settings_(gtk_print_settings_new()) { - } + StickyPrintSettingGtk() : last_used_settings_(gtk_print_settings_new()) {} ~StickyPrintSettingGtk() { NOTREACHED(); // The instance is intentionally leaked. } - GtkPrintSettings* settings() { - return last_used_settings_; - } + GtkPrintSettings* settings() { return last_used_settings_; } void SetLastUsedSettings(GtkPrintSettings* settings) { DCHECK(last_used_settings_); @@ -103,9 +100,7 @@ class GtkPrinterList { // Can return NULL if there's no default printer. E.g. Printer on a laptop // is "home_printer", but the laptop is at work. - GtkPrinter* default_printer() { - return default_printer_; - } + GtkPrinter* default_printer() { return default_printer_; } // Can return NULL if the printer cannot be found due to: // - Printer list out of sync with printer dialog UI. @@ -245,9 +240,8 @@ void InitPrintSettings(GtkPrintSettings* settings, dpi = kPixelsPerInch; double page_width_in_pixel = kLetterWidthInch * dpi; double page_height_in_pixel = kLetterHeightInch * dpi; - physical_size_device_units.Set( - static_cast(page_width_in_pixel), - static_cast(page_height_in_pixel)); + physical_size_device_units.Set(static_cast(page_width_in_pixel), + static_cast(page_height_in_pixel)); printable_area_device_units.Set( static_cast(kLeftMarginInInch * dpi), static_cast(kTopMarginInInch * dpi), @@ -268,22 +262,15 @@ void InitPrintSettings(GtkPrintSettings* settings, // Set before SetPrinterPrintableArea to make it flip area if necessary. print_settings->SetOrientation(orientation == GTK_PAGE_ORIENTATION_LANDSCAPE); print_settings->SetPrinterPrintableArea(physical_size_device_units, - printable_area_device_units, - true); + printable_area_device_units, true); } } // namespace - ClientPrintHandlerGtk::ClientPrintHandlerGtk() - : dialog_(NULL), - gtk_settings_(NULL), - page_setup_(NULL), - printer_(NULL) { -} + : dialog_(NULL), gtk_settings_(NULL), page_setup_(NULL), printer_(NULL) {} -void ClientPrintHandlerGtk::OnPrintStart(CefRefPtr browser) { -} +void ClientPrintHandlerGtk::OnPrintStart(CefRefPtr browser) {} void ClientPrintHandlerGtk::OnPrintSettings( CefRefPtr settings, @@ -293,8 +280,7 @@ void ClientPrintHandlerGtk::OnPrintSettings( DCHECK(!printer_); // |gtk_settings_| is a new copy. - gtk_settings_ = - gtk_print_settings_copy(GetLastUsedSettings()->settings()); + gtk_settings_ = gtk_print_settings_copy(GetLastUsedSettings()->settings()); page_setup_ = gtk_page_setup_new(); } else { if (!gtk_settings_) { @@ -346,9 +332,8 @@ void ClientPrintHandlerGtk::OnPrintSettings( page_setup_ = gtk_page_setup_new(); gtk_print_settings_set_orientation( - gtk_settings_, - settings->IsLandscape() ? GTK_PAGE_ORIENTATION_LANDSCAPE : - GTK_PAGE_ORIENTATION_PORTRAIT); + gtk_settings_, settings->IsLandscape() ? GTK_PAGE_ORIENTATION_LANDSCAPE + : GTK_PAGE_ORIENTATION_PORTRAIT); delete printer_list; } @@ -368,17 +353,14 @@ bool ClientPrintHandlerGtk::OnPrintDialog( g_signal_connect(dialog_, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); - // Set modal so user cannot focus the same tab and press print again. gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE); // Since we only generate PDF, only show printers that support PDF. // TODO(thestig) Add more capabilities to support? GtkPrintCapabilities cap = static_cast( - GTK_PRINT_CAPABILITY_GENERATE_PDF | - GTK_PRINT_CAPABILITY_PAGE_SET | - GTK_PRINT_CAPABILITY_COPIES | - GTK_PRINT_CAPABILITY_COLLATE | + GTK_PRINT_CAPABILITY_GENERATE_PDF | GTK_PRINT_CAPABILITY_PAGE_SET | + GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | GTK_PRINT_CAPABILITY_REVERSE); gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(dialog_), cap); @@ -412,12 +394,8 @@ bool ClientPrintHandlerGtk::OnPrintJob( GetLastUsedSettings()->SetLastUsedSettings(gtk_settings_); GtkPrintJob* print_job = gtk_print_job_new( - document_name.ToString().c_str(), - printer_, - gtk_settings_, - page_setup_); - gtk_print_job_set_source_file(print_job, - pdf_file_path.ToString().c_str(), + document_name.ToString().c_str(), printer_, gtk_settings_, page_setup_); + gtk_print_job_set_source_file(print_job, pdf_file_path.ToString().c_str(), NULL); gtk_print_job_send(print_job, OnJobCompletedThunk, this, NULL); @@ -454,7 +432,7 @@ CefSize ClientPrintHandlerGtk::GetPdfPaperSize(int device_units_per_inch) { return CefSize(width * device_units_per_inch, height * device_units_per_inch); } -void ClientPrintHandlerGtk::OnDialogResponse(GtkDialog *dialog, +void ClientPrintHandlerGtk::OnDialogResponse(GtkDialog* dialog, gint response_id) { int num_matched_handlers = g_signal_handlers_disconnect_by_func( dialog_, reinterpret_cast(&OnDialogResponseThunk), this); @@ -466,8 +444,8 @@ void ClientPrintHandlerGtk::OnDialogResponse(GtkDialog *dialog, case GTK_RESPONSE_OK: { if (gtk_settings_) g_object_unref(gtk_settings_); - gtk_settings_ = gtk_print_unix_dialog_get_settings( - GTK_PRINT_UNIX_DIALOG(dialog_)); + gtk_settings_ = + gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(dialog_)); if (printer_) g_object_unref(printer_); @@ -477,8 +455,8 @@ void ClientPrintHandlerGtk::OnDialogResponse(GtkDialog *dialog, if (page_setup_) g_object_unref(page_setup_); - page_setup_ = gtk_print_unix_dialog_get_page_setup( - GTK_PRINT_UNIX_DIALOG(dialog_)); + page_setup_ = + gtk_print_unix_dialog_get_page_setup(GTK_PRINT_UNIX_DIALOG(dialog_)); g_object_ref(page_setup_); // Handle page ranges. @@ -525,9 +503,7 @@ void ClientPrintHandlerGtk::OnDialogResponse(GtkDialog *dialog, return; } case GTK_RESPONSE_APPLY: - default: { - NOTREACHED(); - } + default: { NOTREACHED(); } } } diff --git a/tests/cefclient/browser/print_handler_gtk.h b/tests/cefclient/browser/print_handler_gtk.h index 11618e67d..53046612c 100644 --- a/tests/cefclient/browser/print_handler_gtk.h +++ b/tests/cefclient/browser/print_handler_gtk.h @@ -22,9 +22,8 @@ class ClientPrintHandlerGtk : public CefPrintHandler { void OnPrintStart(CefRefPtr browser) OVERRIDE; void OnPrintSettings(CefRefPtr settings, bool get_defaults) OVERRIDE; - bool OnPrintDialog( - bool has_selection, - CefRefPtr callback) OVERRIDE; + bool OnPrintDialog(bool has_selection, + CefRefPtr callback) OVERRIDE; bool OnPrintJob(const CefString& document_name, const CefString& pdf_file_path, CefRefPtr callback) OVERRIDE; @@ -32,12 +31,10 @@ class ClientPrintHandlerGtk : public CefPrintHandler { CefSize GetPdfPaperSize(int device_units_per_inch) OVERRIDE; private: - void OnDialogResponse(GtkDialog *dialog, - gint response_id); - void OnJobCompleted(GtkPrintJob* print_job, - GError* error); + void OnDialogResponse(GtkDialog* dialog, gint response_id); + void OnJobCompleted(GtkPrintJob* print_job, GError* error); - static void OnDialogResponseThunk(GtkDialog *dialog, + static void OnDialogResponseThunk(GtkDialog* dialog, gint response_id, ClientPrintHandlerGtk* handler) { handler->OnDialogResponse(dialog, response_id); @@ -45,8 +42,8 @@ class ClientPrintHandlerGtk : public CefPrintHandler { static void OnJobCompletedThunk(GtkPrintJob* print_job, void* handler, GError* error) { - static_cast(handler)-> - OnJobCompleted(print_job, error); + static_cast(handler)->OnJobCompleted(print_job, + error); } // Print dialog settings. ClientPrintHandlerGtk owns |dialog_| and holds diff --git a/tests/cefclient/browser/resource.h b/tests/cefclient/browser/resource.h index 6990bec57..bb58d1704 100644 --- a/tests/cefclient/browser/resource.h +++ b/tests/cefclient/browser/resource.h @@ -6,73 +6,73 @@ // Microsoft Visual C++ generated include file. // Used by cefclient.rc // -#define BINARY 256 -#define IDC_MYICON 2 -#define IDD_CEFCLIENT_DIALOG 102 -#define IDS_APP_TITLE 103 -#define IDD_ABOUTBOX 103 -#define IDM_ABOUT 104 -#define IDM_EXIT 105 -#define IDI_CEFCLIENT 107 -#define IDI_SMALL 108 -#define IDC_CEFCLIENT 109 -#define IDR_MAINFRAME 128 -#define IDC_NAV_BACK 200 -#define IDC_NAV_FORWARD 201 -#define IDC_NAV_RELOAD 202 -#define IDC_NAV_STOP 203 -#define ID_QUIT 32500 -#define ID_FIND 32501 -#define ID_TESTS_FIRST 32700 -#define ID_TESTS_GETSOURCE 32700 -#define ID_TESTS_GETTEXT 32701 -#define ID_TESTS_OTHER_TESTS 32702 -#define ID_TESTS_PLUGIN_INFO 32703 -#define ID_TESTS_WINDOW_NEW 32704 -#define ID_TESTS_WINDOW_POPUP 32705 -#define ID_TESTS_PRINT 32706 -#define ID_TESTS_REQUEST 32707 -#define ID_TESTS_TRACING_BEGIN 32708 -#define ID_TESTS_TRACING_END 32709 -#define ID_TESTS_ZOOM_IN 32710 -#define ID_TESTS_ZOOM_OUT 32711 -#define ID_TESTS_ZOOM_RESET 32712 -#define ID_TESTS_OSR_FPS 32713 -#define ID_TESTS_OSR_DSF 32714 -#define ID_TESTS_PRINT_TO_PDF 32715 -#define ID_TESTS_LAST 32715 -#define IDC_STATIC -1 -#define IDS_BINDING_HTML 1000 -#define IDS_DIALOGS_HTML 1001 -#define IDS_DRAGGABLE_HTML 1002 -#define IDS_DRM_HTML 1003 -#define IDS_LOCALSTORAGE_HTML 1004 -#define IDS_LOGO_PNG 1005 -#define IDS_MENU_ICON_1X_PNG 1006 -#define IDS_MENU_ICON_2X_PNG 1007 -#define IDS_OSRTEST_HTML 1008 -#define IDS_OTHER_TESTS_HTML 1009 -#define IDS_PDF_HTML 1010 -#define IDS_PDF_PDF 1011 -#define IDS_PERFORMANCE_HTML 1012 -#define IDS_PERFORMANCE2_HTML 1013 -#define IDS_PREFERENCES_HTML 1014 -#define IDS_RESPONSE_FILTER_HTML 1015 -#define IDS_TRANSPARENCY_HTML 1016 -#define IDS_URLREQUEST_HTML 1017 -#define IDS_WINDOW_HTML 1018 -#define IDS_WINDOW_ICON_1X_PNG 1019 -#define IDS_WINDOW_ICON_2X_PNG 1020 -#define IDS_XMLHTTPREQUEST_HTML 1021 +#define BINARY 256 +#define IDC_MYICON 2 +#define IDD_CEFCLIENT_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_CEFCLIENT 107 +#define IDI_SMALL 108 +#define IDC_CEFCLIENT 109 +#define IDR_MAINFRAME 128 +#define IDC_NAV_BACK 200 +#define IDC_NAV_FORWARD 201 +#define IDC_NAV_RELOAD 202 +#define IDC_NAV_STOP 203 +#define ID_QUIT 32500 +#define ID_FIND 32501 +#define ID_TESTS_FIRST 32700 +#define ID_TESTS_GETSOURCE 32700 +#define ID_TESTS_GETTEXT 32701 +#define ID_TESTS_OTHER_TESTS 32702 +#define ID_TESTS_PLUGIN_INFO 32703 +#define ID_TESTS_WINDOW_NEW 32704 +#define ID_TESTS_WINDOW_POPUP 32705 +#define ID_TESTS_PRINT 32706 +#define ID_TESTS_REQUEST 32707 +#define ID_TESTS_TRACING_BEGIN 32708 +#define ID_TESTS_TRACING_END 32709 +#define ID_TESTS_ZOOM_IN 32710 +#define ID_TESTS_ZOOM_OUT 32711 +#define ID_TESTS_ZOOM_RESET 32712 +#define ID_TESTS_OSR_FPS 32713 +#define ID_TESTS_OSR_DSF 32714 +#define ID_TESTS_PRINT_TO_PDF 32715 +#define ID_TESTS_LAST 32715 +#define IDC_STATIC -1 +#define IDS_BINDING_HTML 1000 +#define IDS_DIALOGS_HTML 1001 +#define IDS_DRAGGABLE_HTML 1002 +#define IDS_DRM_HTML 1003 +#define IDS_LOCALSTORAGE_HTML 1004 +#define IDS_LOGO_PNG 1005 +#define IDS_MENU_ICON_1X_PNG 1006 +#define IDS_MENU_ICON_2X_PNG 1007 +#define IDS_OSRTEST_HTML 1008 +#define IDS_OTHER_TESTS_HTML 1009 +#define IDS_PDF_HTML 1010 +#define IDS_PDF_PDF 1011 +#define IDS_PERFORMANCE_HTML 1012 +#define IDS_PERFORMANCE2_HTML 1013 +#define IDS_PREFERENCES_HTML 1014 +#define IDS_RESPONSE_FILTER_HTML 1015 +#define IDS_TRANSPARENCY_HTML 1016 +#define IDS_URLREQUEST_HTML 1017 +#define IDS_WINDOW_HTML 1018 +#define IDS_WINDOW_ICON_1X_PNG 1019 +#define IDS_WINDOW_ICON_2X_PNG 1020 +#define IDS_XMLHTTPREQUEST_HTML 1021 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 130 -#define _APS_NEXT_COMMAND_VALUE 32774 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 111 +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 111 #endif #endif diff --git a/tests/cefclient/browser/resource_util_linux.cc b/tests/cefclient/browser/resource_util_linux.cc index 939cc6703..a7aa55555 100644 --- a/tests/cefclient/browser/resource_util_linux.cc +++ b/tests/cefclient/browser/resource_util_linux.cc @@ -15,7 +15,7 @@ bool GetResourceDir(std::string& dir) { char buff[1024]; // Retrieve the executable path. - ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff)-1); + ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff) - 1); if (len == -1) return false; @@ -27,10 +27,9 @@ bool GetResourceDir(std::string& dir) { return false; // Add "cefclient_files" to the path. - strcpy(pos+1, "cefclient_files"); // NOLINT(runtime/printf) + strcpy(pos + 1, "cefclient_files"); dir = std::string(buff); return true; } } // namespace client - diff --git a/tests/cefclient/browser/resource_util_win_idmap.cc b/tests/cefclient/browser/resource_util_win_idmap.cc index cd08ec6b5..d2348b0cc 100644 --- a/tests/cefclient/browser/resource_util_win_idmap.cc +++ b/tests/cefclient/browser/resource_util_win_idmap.cc @@ -14,35 +14,35 @@ int GetResourceId(const char* resource_name) { char* name; int id; } resource_map[] = { - {"binding.html", IDS_BINDING_HTML}, - {"dialogs.html", IDS_DIALOGS_HTML}, - {"draggable.html", IDS_DRAGGABLE_HTML}, - {"drm.html", IDS_DRM_HTML}, - {"logo.png", IDS_LOGO_PNG}, - {"localstorage.html", IDS_LOCALSTORAGE_HTML}, - {"menu_icon.1x.png", IDS_MENU_ICON_1X_PNG}, - {"menu_icon.2x.png", IDS_MENU_ICON_2X_PNG}, - {"osr_test.html", IDS_OSRTEST_HTML}, - {"other_tests.html", IDS_OTHER_TESTS_HTML}, - {"pdf.html", IDS_PDF_HTML}, - {"pdf.pdf", IDS_PDF_PDF}, - {"performance.html", IDS_PERFORMANCE_HTML}, - {"performance2.html", IDS_PERFORMANCE2_HTML}, - {"preferences.html", IDS_PREFERENCES_HTML}, - {"response_filter.html", IDS_RESPONSE_FILTER_HTML}, - {"transparency.html", IDS_TRANSPARENCY_HTML}, - {"urlrequest.html", IDS_URLREQUEST_HTML}, - {"window.html", IDS_WINDOW_HTML}, - {"window_icon.1x.png", IDS_WINDOW_ICON_1X_PNG}, - {"window_icon.2x.png", IDS_WINDOW_ICON_2X_PNG}, - {"xmlhttprequest.html", IDS_XMLHTTPREQUEST_HTML}, + {"binding.html", IDS_BINDING_HTML}, + {"dialogs.html", IDS_DIALOGS_HTML}, + {"draggable.html", IDS_DRAGGABLE_HTML}, + {"drm.html", IDS_DRM_HTML}, + {"logo.png", IDS_LOGO_PNG}, + {"localstorage.html", IDS_LOCALSTORAGE_HTML}, + {"menu_icon.1x.png", IDS_MENU_ICON_1X_PNG}, + {"menu_icon.2x.png", IDS_MENU_ICON_2X_PNG}, + {"osr_test.html", IDS_OSRTEST_HTML}, + {"other_tests.html", IDS_OTHER_TESTS_HTML}, + {"pdf.html", IDS_PDF_HTML}, + {"pdf.pdf", IDS_PDF_PDF}, + {"performance.html", IDS_PERFORMANCE_HTML}, + {"performance2.html", IDS_PERFORMANCE2_HTML}, + {"preferences.html", IDS_PREFERENCES_HTML}, + {"response_filter.html", IDS_RESPONSE_FILTER_HTML}, + {"transparency.html", IDS_TRANSPARENCY_HTML}, + {"urlrequest.html", IDS_URLREQUEST_HTML}, + {"window.html", IDS_WINDOW_HTML}, + {"window_icon.1x.png", IDS_WINDOW_ICON_1X_PNG}, + {"window_icon.2x.png", IDS_WINDOW_ICON_2X_PNG}, + {"xmlhttprequest.html", IDS_XMLHTTPREQUEST_HTML}, }; - for (int i = 0; i < sizeof(resource_map)/sizeof(_resource_map); ++i) { + for (int i = 0; i < sizeof(resource_map) / sizeof(_resource_map); ++i) { if (!strcmp(resource_map[i].name, resource_name)) return resource_map[i].id; } - + return 0; } diff --git a/tests/cefclient/browser/response_filter_test.cc b/tests/cefclient/browser/response_filter_test.cc index 3dfc8a660..15f12429e 100644 --- a/tests/cefclient/browser/response_filter_test.cc +++ b/tests/cefclient/browser/response_filter_test.cc @@ -33,8 +33,7 @@ class FindReplaceResponseFilter : public CefResponseFilter { FindReplaceResponseFilter() : find_match_offset_(0U), replace_overflow_size_(0U), - replace_count_(0U) { - } + replace_count_(0U) {} bool InitFilter() OVERRIDE { const size_t find_size = sizeof(kFindString) - 1; @@ -122,8 +121,8 @@ class FindReplaceResponseFilter : public CefResponseFilter { // If a match is currently in-progress we need more data. Otherwise, we're // done. - return find_match_offset_ > 0 ? - RESPONSE_FILTER_NEED_MORE_DATA : RESPONSE_FILTER_DONE; + return find_match_offset_ > 0 ? RESPONSE_FILTER_NEED_MORE_DATA + : RESPONSE_FILTER_DONE; } private: @@ -176,9 +175,7 @@ class PassThruResponseFilter : public CefResponseFilter { public: PassThruResponseFilter() {} - bool InitFilter() OVERRIDE { - return true; - } + bool InitFilter() OVERRIDE { return true; } FilterStatus Filter(void* data_in, size_t data_in_size, diff --git a/tests/cefclient/browser/root_window.h b/tests/cefclient/browser/root_window.h index fee654c5e..a6ba3c7d4 100644 --- a/tests/cefclient/browser/root_window.h +++ b/tests/cefclient/browser/root_window.h @@ -18,8 +18,8 @@ namespace client { // Represents a top-level native window in the browser process. While references // to this object are thread-safe the methods must be called on the main thread // unless otherwise indicated. -class RootWindow : - public base::RefCountedThreadSafe { +class RootWindow + : public base::RefCountedThreadSafe { public: // This interface is implemented by the owner of the RootWindow. The methods // of this class will be called on the main thread. diff --git a/tests/cefclient/browser/root_window_gtk.cc b/tests/cefclient/browser/root_window_gtk.cc index 87671b066..d39e651ba 100644 --- a/tests/cefclient/browser/root_window_gtk.cc +++ b/tests/cefclient/browser/root_window_gtk.cc @@ -64,8 +64,7 @@ RootWindowGtk::RootWindowGtk() menubar_height_(0), force_close_(false), window_destroyed_(false), - browser_destroyed_(false) { -} + browser_destroyed_(false) {} RootWindowGtk::~RootWindowGtk() { REQUIRE_MAIN_THREAD(); @@ -133,8 +132,8 @@ void RootWindowGtk::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), - windowInfo, client, settings); + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, + client, settings); } void RootWindowGtk::Show(ShowMode mode) { @@ -258,7 +257,7 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings) { gtk_window_set_default_size(GTK_WINDOW(window_), width, height); g_signal_connect(G_OBJECT(window_), "focus-in-event", G_CALLBACK(&RootWindowGtk::WindowFocusIn), this); - g_signal_connect(G_OBJECT(window_), "window-state-event", + g_signal_connect(G_OBJECT(window_), "window-state-event", G_CALLBACK(&RootWindowGtk::WindowState), this); g_signal_connect(G_OBJECT(window_), "configure-event", G_CALLBACK(&RootWindowGtk::WindowConfigure), this); @@ -466,7 +465,7 @@ gboolean RootWindowGtk::WindowState(GtkWidget* widget, } // static -gboolean RootWindowGtk::WindowConfigure(GtkWindow* window, +gboolean RootWindowGtk::WindowConfigure(GtkWindow* window, GdkEvent* event, RootWindowGtk* self) { // Called when size, position or stack order changes. @@ -559,8 +558,7 @@ void RootWindowGtk::ToolbarSizeAllocated(GtkWidget* widget, } // static -void RootWindowGtk::BackButtonClicked(GtkButton* button, - RootWindowGtk* self) { +void RootWindowGtk::BackButtonClicked(GtkButton* button, RootWindowGtk* self) { CefRefPtr browser = self->GetBrowser(); if (browser.get()) browser->GoBack(); @@ -575,8 +573,7 @@ void RootWindowGtk::ForwardButtonClicked(GtkButton* button, } // static -void RootWindowGtk::StopButtonClicked(GtkButton* button, - RootWindowGtk* self) { +void RootWindowGtk::StopButtonClicked(GtkButton* button, RootWindowGtk* self) { CefRefPtr browser = self->GetBrowser(); if (browser.get()) browser->StopLoad(); @@ -591,8 +588,7 @@ void RootWindowGtk::ReloadButtonClicked(GtkButton* button, } // static -void RootWindowGtk::URLEntryActivate(GtkEntry* entry, - RootWindowGtk* self) { +void RootWindowGtk::URLEntryActivate(GtkEntry* entry, RootWindowGtk* self) { CefRefPtr browser = self->GetBrowser(); if (browser.get()) { const gchar* url = gtk_entry_get_text(entry); @@ -613,13 +609,10 @@ gboolean RootWindowGtk::URLEntryButtonPress(GtkWidget* widget, ::Window xwindow = GDK_WINDOW_XID(gdk_window); // Retrieve the atoms required by the below XSendEvent call. - const char* kAtoms[] = { - "WM_PROTOCOLS", - "WM_TAKE_FOCUS" - }; + const char* kAtoms[] = {"WM_PROTOCOLS", "WM_TAKE_FOCUS"}; Atom atoms[2]; - int result = XInternAtoms(xdisplay, const_cast(kAtoms), 2, false, - atoms); + int result = + XInternAtoms(xdisplay, const_cast(kAtoms), 2, false, atoms); if (!result) NOTREACHED(); @@ -645,24 +638,24 @@ GtkWidget* RootWindowGtk::CreateMenuBar() { // Create the test menu. GtkWidget* test_menu = CreateMenu(menu_bar, "Tests"); - AddMenuEntry(test_menu, "Get Source", ID_TESTS_GETSOURCE); - AddMenuEntry(test_menu, "Get Text", ID_TESTS_GETTEXT); - AddMenuEntry(test_menu, "New Window", ID_TESTS_WINDOW_NEW); - AddMenuEntry(test_menu, "Popup Window", ID_TESTS_WINDOW_POPUP); - AddMenuEntry(test_menu, "Request", ID_TESTS_REQUEST); - AddMenuEntry(test_menu, "Plugin Info", ID_TESTS_PLUGIN_INFO); - AddMenuEntry(test_menu, "Zoom In", ID_TESTS_ZOOM_IN); - AddMenuEntry(test_menu, "Zoom Out", ID_TESTS_ZOOM_OUT); - AddMenuEntry(test_menu, "Zoom Reset", ID_TESTS_ZOOM_RESET); + AddMenuEntry(test_menu, "Get Source", ID_TESTS_GETSOURCE); + AddMenuEntry(test_menu, "Get Text", ID_TESTS_GETTEXT); + AddMenuEntry(test_menu, "New Window", ID_TESTS_WINDOW_NEW); + AddMenuEntry(test_menu, "Popup Window", ID_TESTS_WINDOW_POPUP); + AddMenuEntry(test_menu, "Request", ID_TESTS_REQUEST); + AddMenuEntry(test_menu, "Plugin Info", ID_TESTS_PLUGIN_INFO); + AddMenuEntry(test_menu, "Zoom In", ID_TESTS_ZOOM_IN); + AddMenuEntry(test_menu, "Zoom Out", ID_TESTS_ZOOM_OUT); + AddMenuEntry(test_menu, "Zoom Reset", ID_TESTS_ZOOM_RESET); if (with_osr_) { - AddMenuEntry(test_menu, "Set FPS", ID_TESTS_OSR_FPS); + AddMenuEntry(test_menu, "Set FPS", ID_TESTS_OSR_FPS); AddMenuEntry(test_menu, "Set Scale Factor", ID_TESTS_OSR_DSF); } AddMenuEntry(test_menu, "Begin Tracing", ID_TESTS_TRACING_BEGIN); - AddMenuEntry(test_menu, "End Tracing", ID_TESTS_TRACING_END); - AddMenuEntry(test_menu, "Print", ID_TESTS_PRINT); - AddMenuEntry(test_menu, "Print to PDF", ID_TESTS_PRINT_TO_PDF); - AddMenuEntry(test_menu, "Other Tests", ID_TESTS_OTHER_TESTS); + AddMenuEntry(test_menu, "End Tracing", ID_TESTS_TRACING_END); + AddMenuEntry(test_menu, "Print", ID_TESTS_PRINT); + AddMenuEntry(test_menu, "Print to PDF", ID_TESTS_PRINT_TO_PDF); + AddMenuEntry(test_menu, "Other Tests", ID_TESTS_OTHER_TESTS); return menu_bar; } diff --git a/tests/cefclient/browser/root_window_gtk.h b/tests/cefclient/browser/root_window_gtk.h index fc34a54f3..36b2834e9 100644 --- a/tests/cefclient/browser/root_window_gtk.h +++ b/tests/cefclient/browser/root_window_gtk.h @@ -18,8 +18,7 @@ namespace client { // GTK implementation of a top-level native window in the browser process. // The methods of this class must be called on the main thread unless otherwise // indicated. -class RootWindowGtk : public RootWindow, - public BrowserWindow::Delegate { +class RootWindowGtk : public RootWindow, public BrowserWindow::Delegate { public: // Constructor may be called on any thread. RootWindowGtk(); @@ -77,7 +76,7 @@ class RootWindowGtk : public RootWindow, static gboolean WindowState(GtkWidget* widget, GdkEventWindowState* event, RootWindowGtk* self); - static gboolean WindowConfigure(GtkWindow* window, + static gboolean WindowConfigure(GtkWindow* window, GdkEvent* event, RootWindowGtk* self); static void WindowDestroy(GtkWidget* widget, RootWindowGtk* self); @@ -94,25 +93,19 @@ class RootWindowGtk : public RootWindow, static void MenubarSizeAllocated(GtkWidget* widget, GtkAllocation* allocation, RootWindowGtk* self); - static gboolean MenuItemActivated(GtkWidget* widget, - RootWindowGtk* self); + static gboolean MenuItemActivated(GtkWidget* widget, RootWindowGtk* self); // Signal handlers for the GTK toolbar. static void ToolbarSizeAllocated(GtkWidget* widget, GtkAllocation* allocation, RootWindowGtk* self); - static void BackButtonClicked(GtkButton* button, - RootWindowGtk* self); - static void ForwardButtonClicked(GtkButton* button, - RootWindowGtk* self); - static void StopButtonClicked(GtkButton* button, - RootWindowGtk* self); - static void ReloadButtonClicked(GtkButton* button, - RootWindowGtk* self); + static void BackButtonClicked(GtkButton* button, RootWindowGtk* self); + static void ForwardButtonClicked(GtkButton* button, RootWindowGtk* self); + static void StopButtonClicked(GtkButton* button, RootWindowGtk* self); + static void ReloadButtonClicked(GtkButton* button, RootWindowGtk* self); // Signal handlers for the GTK URL entry field. - static void URLEntryActivate(GtkEntry* entry, - RootWindowGtk* self); + static void URLEntryActivate(GtkEntry* entry, RootWindowGtk* self); static gboolean URLEntryButtonPress(GtkWidget* widget, GdkEventButton* event, RootWindowGtk* self); diff --git a/tests/cefclient/browser/root_window_mac.h b/tests/cefclient/browser/root_window_mac.h index d4b1bf1e8..4c43b4cc1 100644 --- a/tests/cefclient/browser/root_window_mac.h +++ b/tests/cefclient/browser/root_window_mac.h @@ -27,8 +27,7 @@ namespace client { // OS X implementation of a top-level native window in the browser process. // The methods of this class must be called on the main thread unless otherwise // indicated. -class RootWindowMac : public RootWindow, - public BrowserWindow::Delegate { +class RootWindowMac : public RootWindow, public BrowserWindow::Delegate { public: // Constructor may be called on any thread. RootWindowMac(); diff --git a/tests/cefclient/browser/root_window_mac.mm b/tests/cefclient/browser/root_window_mac.mm index 585b4b5af..3064e0970 100644 --- a/tests/cefclient/browser/root_window_mac.mm +++ b/tests/cefclient/browser/root_window_mac.mm @@ -19,15 +19,15 @@ // Receives notifications from controls and the browser window. Will delete // itself when done. -@interface RootWindowDelegate : NSObject { +@interface RootWindowDelegate : NSObject { @private NSWindow* window_; client::RootWindowMac* root_window_; bool force_close_; } -@property (nonatomic, readonly) client::RootWindowMac* root_window; -@property (nonatomic, readwrite) bool force_close; +@property(nonatomic, readonly) client::RootWindowMac* root_window; +@property(nonatomic, readwrite) bool force_close; - (id)initWithWindow:(NSWindow*)window andRootWindow:(client::RootWindowMac*)root_window; @@ -35,7 +35,7 @@ - (IBAction)goForward:(id)sender; - (IBAction)reload:(id)sender; - (IBAction)stopLoading:(id)sender; -- (IBAction)takeURLStringValueFrom:(NSTextField *)sender; +- (IBAction)takeURLStringValueFrom:(NSTextField*)sender; @end @implementation RootWindowDelegate @@ -53,15 +53,15 @@ // Register for application hide/unhide notifications. [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(applicationDidHide:) - name:NSApplicationDidHideNotification - object:nil]; + addObserver:self + selector:@selector(applicationDidHide:) + name:NSApplicationDidHideNotification + object:nil]; [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(applicationDidUnhide:) - name:NSApplicationDidUnhideNotification - object:nil]; + addObserver:self + selector:@selector(applicationDidUnhide:) + name:NSApplicationDidUnhideNotification + object:nil]; } return self; } @@ -96,12 +96,12 @@ browser->StopLoad(); } -- (IBAction)takeURLStringValueFrom:(NSTextField *)sender { +- (IBAction)takeURLStringValueFrom:(NSTextField*)sender { CefRefPtr browser = root_window_->GetBrowser(); if (!browser.get()) return; - NSString *url = [sender stringValue]; + NSString* url = [sender stringValue]; // if it doesn't already have a prefix, add http. If we can't parse it, // just don't bother rather than making things worse. @@ -128,21 +128,21 @@ } // Called when we have been minimized. -- (void)windowDidMiniaturize:(NSNotification *)notification { +- (void)windowDidMiniaturize:(NSNotification*)notification { client::BrowserWindow* browser_window = root_window_->browser_window(); if (browser_window) browser_window->Hide(); } // Called when we have been unminimized. -- (void)windowDidDeminiaturize:(NSNotification *)notification { +- (void)windowDidDeminiaturize:(NSNotification*)notification { client::BrowserWindow* browser_window = root_window_->browser_window(); if (browser_window) browser_window->Show(); } // Called when the application has been hidden. -- (void)applicationDidHide:(NSNotification *)notification { +- (void)applicationDidHide:(NSNotification*)notification { // If the window is miniaturized then nothing has really changed. if (![window_ isMiniaturized]) { client::BrowserWindow* browser_window = root_window_->browser_window(); @@ -152,7 +152,7 @@ } // Called when the application has been unhidden. -- (void)applicationDidUnhide:(NSNotification *)notification { +- (void)applicationDidUnhide:(NSNotification*)notification { // If the window is miniaturized then nothing has really changed. if (![window_ isMiniaturized]) { client::BrowserWindow* browser_window = root_window_->browser_window(); @@ -206,16 +206,15 @@ @end - namespace client { namespace { // Sizes for URL bar layout. -#define BUTTON_HEIGHT 22 -#define BUTTON_WIDTH 72 -#define BUTTON_MARGIN 8 -#define URLBAR_HEIGHT 32 +#define BUTTON_HEIGHT 22 +#define BUTTON_WIDTH 72 +#define BUTTON_MARGIN 8 +#define URLBAR_HEIGHT 32 NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) { NSButton* button = [[[NSButton alloc] initWithFrame:*rect] autorelease]; @@ -249,8 +248,7 @@ RootWindowMac::RootWindowMac() stop_button_(nil), url_textfield_(nil), window_destroyed_(false), - browser_destroyed_(false) { -} + browser_destroyed_(false) {} RootWindowMac::~RootWindowMac() { REQUIRE_MAIN_THREAD(); @@ -318,8 +316,8 @@ void RootWindowMac::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), - windowInfo, client, settings); + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, + client, settings); } void RootWindowMac::Show(ShowMode mode) { @@ -327,7 +325,7 @@ void RootWindowMac::Show(ShowMode mode) { if (!window_) return; - + const bool is_visible = [window_ isVisible]; const bool is_minimized = [window_ isMiniaturized]; const bool is_maximized = [window_ isZoomed]; @@ -348,7 +346,7 @@ void RootWindowMac::Show(ShowMode mode) { // Window visibility may change after (for example) deminiaturizing the // window. if (![window_ isVisible]) - [window_ makeKeyAndOrderFront: nil]; + [window_ makeKeyAndOrderFront:nil]; if (mode == ShowMinimized) [window_ performMiniaturize:nil]; @@ -381,8 +379,8 @@ void RootWindowMac::SetBounds(int x, int y, size_t width, size_t height) { // Desired content rectangle. NSRect content_rect; content_rect.size.width = static_cast(width); - content_rect.size.height = static_cast(height) + - (with_controls_ ? URLBAR_HEIGHT : 0); + content_rect.size.height = + static_cast(height) + (with_controls_ ? URLBAR_HEIGHT : 0); // Convert to a frame rectangle. NSRect frame_rect = [window_ frameRectForContentRect:content_rect]; @@ -468,14 +466,12 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { NSRect window_rect = NSMakeRect(x, screen_rect.size.height - y, width, height); window_ = [[UnderlayOpenGLHostingWindow alloc] - initWithContentRect:window_rect - styleMask:(NSTitledWindowMask | - NSClosableWindowMask | - NSMiniaturizableWindowMask | - NSResizableWindowMask | - NSUnifiedTitleAndToolbarWindowMask ) - backing:NSBackingStoreBuffered - defer:NO]; + initWithContentRect:window_rect + styleMask:(NSTitledWindowMask | NSClosableWindowMask | + NSMiniaturizableWindowMask | NSResizableWindowMask | + NSUnifiedTitleAndToolbarWindowMask) + backing:NSBackingStoreBuffered + defer:NO]; [window_ setTitle:@"cefclient"]; // Create the delegate for control and browser window events. @@ -489,12 +485,18 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { [window_ setReleasedWhenClosed:NO]; const cef_color_t background_color = MainContext::Get()->GetBackgroundColor(); - [window_ setBackgroundColor: - [NSColor colorWithCalibratedRed: - float(CefColorGetR(background_color)) / 255.0f - green:float(CefColorGetG(background_color)) / 255.0f - blue:float(CefColorGetB(background_color)) / 255.0f - alpha:1.f]]; + [window_ + setBackgroundColor:[NSColor + colorWithCalibratedRed:float(CefColorGetR( + background_color)) / + 255.0f + green:float(CefColorGetG( + background_color)) / + 255.0f + blue:float(CefColorGetB( + background_color)) / + 255.0f + alpha:1.f]]; NSView* contentView = [window_ contentView]; NSRect contentBounds = [contentView bounds]; @@ -510,7 +512,7 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { // Create the buttons. NSRect button_rect = contentBounds; button_rect.origin.y = window_rect.size.height - URLBAR_HEIGHT + - (URLBAR_HEIGHT - BUTTON_HEIGHT) / 2; + (URLBAR_HEIGHT - BUTTON_HEIGHT) / 2; button_rect.size.height = BUTTON_HEIGHT; button_rect.origin.x += BUTTON_MARGIN; button_rect.size.width = BUTTON_WIDTH; @@ -539,12 +541,12 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) { // Create the URL text field. button_rect.origin.x += BUTTON_MARGIN; - button_rect.size.width = [contentView bounds].size.width - - button_rect.origin.x - BUTTON_MARGIN; + button_rect.size.width = + [contentView bounds].size.width - button_rect.origin.x - BUTTON_MARGIN; url_textfield_ = [[NSTextField alloc] initWithFrame:button_rect]; [contentView addSubview:url_textfield_]; - [url_textfield_ setAutoresizingMask: - (NSViewWidthSizable | NSViewMinYMargin)]; + [url_textfield_ + setAutoresizingMask:(NSViewWidthSizable | NSViewMinYMargin)]; [url_textfield_ setTarget:delegate]; [url_textfield_ setAction:@selector(takeURLStringValueFrom:)]; [url_textfield_ setEnabled:NO]; diff --git a/tests/cefclient/browser/root_window_manager.cc b/tests/cefclient/browser/root_window_manager.cc index cddc5cec2..dff8b5775 100644 --- a/tests/cefclient/browser/root_window_manager.cc +++ b/tests/cefclient/browser/root_window_manager.cc @@ -90,8 +90,8 @@ scoped_refptr RootWindowManager::CreateRootWindowAsPopup( scoped_refptr root_window = RootWindow::Create(MainContext::Get()->UseViews()); - root_window->InitAsPopup(this, with_controls, with_osr, - popupFeatures, windowInfo, client, settings); + root_window->InitAsPopup(this, with_controls, with_osr, popupFeatures, + windowInfo, client, settings); // Store a reference to the root window on the main thread. OnRootWindowCreated(root_window); @@ -115,9 +115,8 @@ scoped_refptr RootWindowManager::GetWindowForBrowser( void RootWindowManager::CloseAllWindows(bool force) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&RootWindowManager::CloseAllWindows, base::Unretained(this), - force)); + MAIN_POST_CLOSURE(base::Bind(&RootWindowManager::CloseAllWindows, + base::Unretained(this), force)); return; } @@ -133,9 +132,8 @@ void RootWindowManager::OnRootWindowCreated( scoped_refptr root_window) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&RootWindowManager::OnRootWindowCreated, - base::Unretained(this), root_window)); + MAIN_POST_CLOSURE(base::Bind(&RootWindowManager::OnRootWindowCreated, + base::Unretained(this), root_window)); return; } @@ -162,8 +160,8 @@ CefRefPtr RootWindowManager::GetRequestContext( // Give each browser a unique cache path. This will create completely // isolated context objects. std::stringstream ss; - ss << command_line->GetSwitchValue(switches::kCachePath).ToString() << - time(NULL); + ss << command_line->GetSwitchValue(switches::kCachePath).ToString() + << time(NULL); CefString(&settings.cache_path) = ss.str(); } } @@ -174,9 +172,8 @@ CefRefPtr RootWindowManager::GetRequestContext( // All browsers will share the global request context. if (!shared_request_context_.get()) { - shared_request_context_ = - CefRequestContext::CreateContext(CefRequestContext::GetGlobalContext(), - new ClientRequestContextHandler); + shared_request_context_ = CefRequestContext::CreateContext( + CefRequestContext::GetGlobalContext(), new ClientRequestContextHandler); } return shared_request_context_; } diff --git a/tests/cefclient/browser/root_window_manager.h b/tests/cefclient/browser/root_window_manager.h index 9e7fd2c0b..4670973dc 100644 --- a/tests/cefclient/browser/root_window_manager.h +++ b/tests/cefclient/browser/root_window_manager.h @@ -28,11 +28,10 @@ class RootWindowManager : public RootWindow::Delegate { // If |with_osr| is true the window will use off-screen rendering. // If |bounds| is empty the default window size and location will be used. // This method can be called from anywhere to create a new top-level window. - scoped_refptr CreateRootWindow( - bool with_controls, - bool with_osr, - const CefRect& bounds, - const std::string& url); + scoped_refptr CreateRootWindow(bool with_controls, + bool with_osr, + const CefRect& bounds, + const std::string& url); // Create a new native popup window. // If |with_controls| is true the window will show controls. @@ -76,7 +75,7 @@ class RootWindowManager : public RootWindow::Delegate { bool request_context_shared_cache_; // Existing root windows. Only accessed on the main thread. - typedef std::set > RootWindowSet; + typedef std::set> RootWindowSet; RootWindowSet root_windows_; // Singleton window used as the temporary parent for popup browsers. diff --git a/tests/cefclient/browser/root_window_views.cc b/tests/cefclient/browser/root_window_views.cc index 41efc35c7..2b2274e80 100644 --- a/tests/cefclient/browser/root_window_views.cc +++ b/tests/cefclient/browser/root_window_views.cc @@ -6,8 +6,8 @@ #include "include/base/cef_bind.h" #include "include/base/cef_build.h" -#include "include/wrapper/cef_helpers.h" #include "include/cef_app.h" +#include "include/wrapper/cef_helpers.h" #include "tests/cefclient/browser/client_handler_std.h" namespace client { @@ -18,8 +18,7 @@ RootWindowViews::RootWindowViews() is_popup_(false), initialized_(false), window_destroyed_(false), - browser_destroyed_(false) { -} + browser_destroyed_(false) {} RootWindowViews::~RootWindowViews() { REQUIRE_MAIN_THREAD(); @@ -114,8 +113,8 @@ void RootWindowViews::Hide() { void RootWindowViews::SetBounds(int x, int y, size_t width, size_t height) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::SetBounds, this, x, y, width, height)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::SetBounds, this, x, y, + width, height)); return; } @@ -128,8 +127,7 @@ void RootWindowViews::SetBounds(int x, int y, size_t width, size_t height) { void RootWindowViews::Close(bool force) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::Close, this, force)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::Close, this, force)); return; } @@ -250,8 +248,7 @@ void RootWindowViews::OnBrowserClosed(CefRefPtr browser) { void RootWindowViews::OnSetAddress(const std::string& url) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnSetAddress, this, url)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::OnSetAddress, this, url)); return; } @@ -274,7 +271,7 @@ void RootWindowViews::OnSetFavicon(CefRefPtr image) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnSetFavicon, this, image)); + base::Bind(&RootWindowViews::OnSetFavicon, this, image)); return; } @@ -285,8 +282,8 @@ void RootWindowViews::OnSetFavicon(CefRefPtr image) { void RootWindowViews::OnSetFullscreen(bool fullscreen) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnSetFullscreen, this, fullscreen)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::OnSetFullscreen, this, + fullscreen)); return; } @@ -299,9 +296,8 @@ void RootWindowViews::OnSetLoadingState(bool isLoading, bool canGoForward) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnSetLoadingState, this, isLoading, - canGoBack, canGoForward)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::OnSetLoadingState, this, + isLoading, canGoBack, canGoForward)); return; } @@ -320,8 +316,8 @@ void RootWindowViews::OnSetDraggableRegions( const std::vector& regions) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnSetDraggableRegions, this, regions)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::OnSetDraggableRegions, + this, regions)); return; } @@ -332,8 +328,7 @@ void RootWindowViews::OnSetDraggableRegions( void RootWindowViews::OnTakeFocus(bool next) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::OnTakeFocus, this, next)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::OnTakeFocus, this, next)); return; } @@ -354,14 +349,12 @@ void RootWindowViews::CreateClientHandler(const std::string& url) { client_handler_->set_download_favicon_images(true); } -void RootWindowViews::InitOnMainThread( - const CefBrowserSettings& settings, - const std::string& startup_url) { +void RootWindowViews::InitOnMainThread(const CefBrowserSettings& settings, + const std::string& startup_url) { if (!CURRENTLY_ON_MAIN_THREAD()) { // Execute this method on the main thread. - MAIN_POST_CLOSURE( - base::Bind(&RootWindowViews::InitOnMainThread, this, settings, - startup_url)); + MAIN_POST_CLOSURE(base::Bind(&RootWindowViews::InitOnMainThread, this, + settings, startup_url)); return; } @@ -374,9 +367,8 @@ void RootWindowViews::CreateViewsWindow( CefRefPtr request_context) { if (!CefCurrentlyOn(TID_UI)) { // Execute this method on the UI thread. - CefPostTask(TID_UI, - base::Bind(&RootWindowViews::CreateViewsWindow, this, settings, - startup_url, request_context)); + CefPostTask(TID_UI, base::Bind(&RootWindowViews::CreateViewsWindow, this, + settings, startup_url, request_context)); return; } diff --git a/tests/cefclient/browser/root_window_win.cc b/tests/cefclient/browser/root_window_win.cc index 3122e934a..bd66c6bc0 100644 --- a/tests/cefclient/browser/root_window_win.cc +++ b/tests/cefclient/browser/root_window_win.cc @@ -18,17 +18,19 @@ #include "tests/shared/browser/util_win.h" #include "tests/shared/common/client_switches.h" -#define MAX_URL_LENGTH 255 -#define BUTTON_WIDTH 72 -#define URLBAR_HEIGHT 24 +#define MAX_URL_LENGTH 255 +#define BUTTON_WIDTH 72 +#define URLBAR_HEIGHT 24 namespace client { namespace { // Message handler for the About box. -INT_PTR CALLBACK AboutWndProc(HWND hDlg, UINT message, - WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK AboutWndProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: @@ -173,8 +175,8 @@ void RootWindowWin::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), - windowInfo, client, settings); + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, + client, settings); } void RootWindowWin::Show(ShowMode mode) { @@ -210,9 +212,8 @@ void RootWindowWin::SetBounds(int x, int y, size_t width, size_t height) { REQUIRE_MAIN_THREAD(); if (hwnd_) { - SetWindowPos(hwnd_, NULL, - x, y, static_cast(width), static_cast(height), - SWP_NOZORDER); + SetWindowPos(hwnd_, NULL, x, y, static_cast(width), + static_cast(height), SWP_NOZORDER); } } @@ -277,8 +278,7 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) { const cef_color_t background_color = MainContext::Get()->GetBackgroundColor(); const HBRUSH background_brush = CreateSolidBrush( - RGB(CefColorGetR(background_color), - CefColorGetG(background_color), + RGB(CefColorGetR(background_color), CefColorGetG(background_color), CefColorGetB(background_color))); // Register the window class. @@ -308,10 +308,8 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) { } // Create the main window initially hidden. - hwnd_ = CreateWindow(window_class.c_str(), window_title.c_str(), - dwStyle, - x, y, width, height, - NULL, NULL, hInstance, NULL); + hwnd_ = CreateWindow(window_class.c_str(), window_title.c_str(), dwStyle, x, + y, width, height, NULL, NULL, hInstance, NULL); CHECK(hwnd_); // Associate |this| with the main window. @@ -326,59 +324,55 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) { const int button_width = GetButtonWidth(); const int urlbar_height = GetURLBarHeight(); - const int font_height = - LogicalToDevice(14, client::GetDeviceScaleFactor()); + const int font_height = LogicalToDevice(14, client::GetDeviceScaleFactor()); // Create a scaled font. - font_ = ::CreateFont( - -font_height, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial"); + font_ = + ::CreateFont(-font_height, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, + DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial"); back_hwnd_ = CreateWindow( - L"BUTTON", L"Back", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, - x_offset, 0, button_width, urlbar_height, - hwnd_, reinterpret_cast(IDC_NAV_BACK), hInstance, 0); + L"BUTTON", L"Back", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, + x_offset, 0, button_width, urlbar_height, hwnd_, + reinterpret_cast(IDC_NAV_BACK), hInstance, 0); CHECK(back_hwnd_); SendMessage(back_hwnd_, WM_SETFONT, reinterpret_cast(font_), TRUE); x_offset += button_width; - forward_hwnd_ = CreateWindow( - L"BUTTON", L"Forward", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, - x_offset, 0, button_width, urlbar_height, - hwnd_, reinterpret_cast(IDC_NAV_FORWARD), hInstance, 0); + forward_hwnd_ = + CreateWindow(L"BUTTON", L"Forward", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, + x_offset, 0, button_width, urlbar_height, hwnd_, + reinterpret_cast(IDC_NAV_FORWARD), hInstance, 0); CHECK(forward_hwnd_); - SendMessage(forward_hwnd_, WM_SETFONT, - reinterpret_cast(font_), TRUE); + SendMessage(forward_hwnd_, WM_SETFONT, reinterpret_cast(font_), + TRUE); x_offset += button_width; - reload_hwnd_ = CreateWindow( - L"BUTTON", L"Reload", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| WS_DISABLED, - x_offset, 0, button_width, urlbar_height, - hwnd_, reinterpret_cast(IDC_NAV_RELOAD), hInstance, 0); + reload_hwnd_ = + CreateWindow(L"BUTTON", L"Reload", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, + x_offset, 0, button_width, urlbar_height, hwnd_, + reinterpret_cast(IDC_NAV_RELOAD), hInstance, 0); CHECK(reload_hwnd_); - SendMessage(reload_hwnd_, WM_SETFONT, - reinterpret_cast(font_), TRUE); + SendMessage(reload_hwnd_, WM_SETFONT, reinterpret_cast(font_), + TRUE); x_offset += button_width; stop_hwnd_ = CreateWindow( - L"BUTTON", L"Stop", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, - x_offset, 0, button_width, urlbar_height, - hwnd_, reinterpret_cast(IDC_NAV_STOP), hInstance, 0); + L"BUTTON", L"Stop", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED, + x_offset, 0, button_width, urlbar_height, hwnd_, + reinterpret_cast(IDC_NAV_STOP), hInstance, 0); CHECK(stop_hwnd_); SendMessage(stop_hwnd_, WM_SETFONT, reinterpret_cast(font_), TRUE); x_offset += button_width; - edit_hwnd_ = CreateWindow( - L"EDIT", 0, - WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | - ES_AUTOHSCROLL| WS_DISABLED, - x_offset, 0, rect.right - button_width * 4, urlbar_height, - hwnd_, 0, hInstance, 0); + edit_hwnd_ = CreateWindow(L"EDIT", 0, + WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_DISABLED, + x_offset, 0, rect.right - button_width * 4, + urlbar_height, hwnd_, 0, hInstance, 0); SendMessage(edit_hwnd_, WM_SETFONT, reinterpret_cast(font_), TRUE); CHECK(edit_hwnd_); @@ -408,18 +402,15 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) { if (!is_popup_) { // Create the browser window. - CefRect cef_rect(rect.left, rect.top, - rect.right - rect.left, + CefRect cef_rect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); browser_window_->CreateBrowser(hwnd_, cef_rect, settings, delegate_->GetRequestContext(this)); } else { // With popups we already have a browser window. Parent the browser window // to the root window and show it in the correct location. - browser_window_->ShowPopup(hwnd_, - rect.left, rect.top, - rect.right - rect.left, - rect.bottom - rect.top); + browser_window_->ShowPopup(hwnd_, rect.left, rect.top, + rect.right - rect.left, rect.bottom - rect.top); } // Show this window. @@ -440,24 +431,26 @@ void RootWindowWin::RegisterRootClass(HINSTANCE hInstance, wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = RootWndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CEFCLIENT)); - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = RootWndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CEFCLIENT)); + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = background_brush; - wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CEFCLIENT); + wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CEFCLIENT); wcex.lpszClassName = window_class.c_str(); - wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); RegisterClassEx(&wcex); } // static -LRESULT CALLBACK RootWindowWin::EditWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK RootWindowWin::EditWndProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { REQUIRE_MAIN_THREAD(); RootWindowWin* self = GetUserDataPtr(hWnd); @@ -470,7 +463,7 @@ LRESULT CALLBACK RootWindowWin::EditWndProc(HWND hWnd, UINT message, // When the user hits the enter key load the URL. CefRefPtr browser = self->GetBrowser(); if (browser) { - wchar_t strPtr[MAX_URL_LENGTH+1] = {0}; + wchar_t strPtr[MAX_URL_LENGTH + 1] = {0}; *((LPWORD)strPtr) = MAX_URL_LENGTH; LRESULT strLen = SendMessage(hWnd, EM_GETLINE, 0, (LPARAM)strPtr); if (strLen > 0) { @@ -492,8 +485,10 @@ LRESULT CALLBACK RootWindowWin::EditWndProc(HWND hWnd, UINT message, } // static -LRESULT CALLBACK RootWindowWin::FindWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK RootWindowWin::FindWndProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { REQUIRE_MAIN_THREAD(); RootWindowWin* self = GetUserDataPtr(hWnd); @@ -503,8 +498,8 @@ LRESULT CALLBACK RootWindowWin::FindWndProc(HWND hWnd, UINT message, switch (message) { case WM_ACTIVATE: // Set this dialog as current when activated. - MainMessageLoop::Get()->SetCurrentModelessDialog( - wParam == 0 ? NULL : hWnd); + MainMessageLoop::Get()->SetCurrentModelessDialog(wParam == 0 ? NULL + : hWnd); return FALSE; case WM_NCDESTROY: // Clear the reference to |self|. @@ -517,8 +512,10 @@ LRESULT CALLBACK RootWindowWin::FindWndProc(HWND hWnd, UINT message, } // static -LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) { +LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { REQUIRE_MAIN_THREAD(); RootWindowWin* self = GetUserDataPtr(hWnd); @@ -599,7 +596,7 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd, UINT message, LRESULT hit = DefWindowProc(hWnd, message, wParam, lParam); if (hit == HTCLIENT) { POINTS points = MAKEPOINTS(lParam); - POINT point = { points.x, points.y }; + POINT point = {points.x, points.y}; ::ScreenToClient(hWnd, &point); if (::PtInRegion(self->draggable_region_, point.x, point.y)) { // If cursor is inside a draggable region return HTCAPTION to allow @@ -663,18 +660,19 @@ void RootWindowWin::OnSize(bool minimized) { if (browser_hwnd) { // Resize both the browser and the URL edit field. HDWP hdwp = BeginDeferWindowPos(2); - hdwp = DeferWindowPos(hdwp, edit_hwnd_, NULL, urloffset, - 0, rect.right - urloffset, urlbar_height, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, browser_hwnd, NULL, - rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, SWP_NOZORDER); + hdwp = + DeferWindowPos(hdwp, edit_hwnd_, NULL, urloffset, 0, + rect.right - urloffset, urlbar_height, SWP_NOZORDER); + hdwp = DeferWindowPos(hdwp, browser_hwnd, NULL, rect.left, rect.top, + rect.right - rect.left, rect.bottom - rect.top, + SWP_NOZORDER); BOOL result = EndDeferWindowPos(hdwp); ALLOW_UNUSED_LOCAL(result); DCHECK(result); } else { // Resize just the URL edit field. - SetWindowPos(edit_hwnd_, NULL, urloffset, - 0, rect.right - urloffset, urlbar_height, SWP_NOZORDER); + SetWindowPos(edit_hwnd_, NULL, urloffset, 0, rect.right - urloffset, + urlbar_height, SWP_NOZORDER); } } else if (browser_window_) { // Size the browser window to the whole client area. @@ -711,7 +709,7 @@ bool RootWindowWin::OnCommand(UINT id) { case ID_FIND: OnFind(); return true; - case IDC_NAV_BACK: // Back button + case IDC_NAV_BACK: // Back button if (CefRefPtr browser = GetBrowser()) browser->GoBack(); return true; @@ -768,7 +766,7 @@ void RootWindowWin::OnFindEvent() { find_what_last_.clear(); find_next_ = false; } - } else if ((find_state_.Flags & FR_FINDNEXT) && browser) { + } else if ((find_state_.Flags & FR_FINDNEXT) && browser) { // Search for the requested string. bool match_case = ((find_state_.Flags & FR_MATCHCASE) ? true : false); const std::wstring& find_what = find_buff_; @@ -895,19 +893,19 @@ namespace { LPCWSTR kParentWndProc = L"CefParentWndProc"; LPCWSTR kDraggableRegion = L"CefDraggableRegion"; -LRESULT CALLBACK SubclassedWindowProc( - HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - WNDPROC hParentWndProc = reinterpret_cast( - ::GetPropW(hWnd, kParentWndProc)); - HRGN hRegion = reinterpret_cast( - ::GetPropW(hWnd, kDraggableRegion)); +LRESULT CALLBACK SubclassedWindowProc(HWND hWnd, + UINT message, + WPARAM wParam, + LPARAM lParam) { + WNDPROC hParentWndProc = + reinterpret_cast(::GetPropW(hWnd, kParentWndProc)); + HRGN hRegion = reinterpret_cast(::GetPropW(hWnd, kDraggableRegion)); if (message == WM_NCHITTEST) { - LRESULT hit = CallWindowProc( - hParentWndProc, hWnd, message, wParam, lParam); + LRESULT hit = CallWindowProc(hParentWndProc, hWnd, message, wParam, lParam); if (hit == HTCLIENT) { POINTS points = MAKEPOINTS(lParam); - POINT point = { points.x, points.y }; + POINT point = {points.x, points.y}; ::ScreenToClient(hWnd, &point); if (::PtInRegion(hRegion, point.x, point.y)) { // Let the parent window handle WM_NCHITTEST by returning HTTRANSPARENT @@ -939,14 +937,14 @@ void SubclassWindow(HWND hWnd, HRGN hRegion) { } void UnSubclassWindow(HWND hWnd) { - LONG_PTR hParentWndProc = reinterpret_cast( - ::GetPropW(hWnd, kParentWndProc)); + LONG_PTR hParentWndProc = + reinterpret_cast(::GetPropW(hWnd, kParentWndProc)); if (hParentWndProc) { - LONG_PTR hPreviousWndProc = - SetWindowLongPtr(hWnd, GWLP_WNDPROC, hParentWndProc); - ALLOW_UNUSED_LOCAL(hPreviousWndProc); - DCHECK_EQ(hPreviousWndProc, - reinterpret_cast(SubclassedWindowProc)); + LONG_PTR hPreviousWndProc = + SetWindowLongPtr(hWnd, GWLP_WNDPROC, hParentWndProc); + ALLOW_UNUSED_LOCAL(hPreviousWndProc); + DCHECK_EQ(hPreviousWndProc, + reinterpret_cast(SubclassedWindowProc)); } ::RemovePropW(hWnd, kParentWndProc); @@ -974,24 +972,22 @@ void RootWindowWin::OnSetDraggableRegions( // Determine new draggable region. std::vector::const_iterator it = regions.begin(); - for (;it != regions.end(); ++it) { - HRGN region = ::CreateRectRgn( - it->bounds.x, it->bounds.y, - it->bounds.x + it->bounds.width, - it->bounds.y + it->bounds.height); - ::CombineRgn( - draggable_region_, draggable_region_, region, - it->draggable ? RGN_OR : RGN_DIFF); + for (; it != regions.end(); ++it) { + HRGN region = ::CreateRectRgn(it->bounds.x, it->bounds.y, + it->bounds.x + it->bounds.width, + it->bounds.y + it->bounds.height); + ::CombineRgn(draggable_region_, draggable_region_, region, + it->draggable ? RGN_OR : RGN_DIFF); ::DeleteObject(region); } // Subclass child window procedures in order to do hit-testing. // This will be a no-op, if it is already subclassed. if (hwnd_) { - WNDENUMPROC proc = !regions.empty() ? - SubclassWindowsProc : UnSubclassWindowsProc; - ::EnumChildWindows( - hwnd_, proc, reinterpret_cast(draggable_region_)); + WNDENUMPROC proc = + !regions.empty() ? SubclassWindowsProc : UnSubclassWindowsProc; + ::EnumChildWindows(hwnd_, proc, + reinterpret_cast(draggable_region_)); } } diff --git a/tests/cefclient/browser/root_window_win.h b/tests/cefclient/browser/root_window_win.h index b99e5d925..570e108c5 100644 --- a/tests/cefclient/browser/root_window_win.h +++ b/tests/cefclient/browser/root_window_win.h @@ -7,6 +7,7 @@ #pragma once #include + #include #include @@ -20,8 +21,7 @@ namespace client { // Windows implementation of a top-level native window in the browser process. // The methods of this class must be called on the main thread unless otherwise // indicated. -class RootWindowWin : public RootWindow, - public BrowserWindow::Delegate { +class RootWindowWin : public RootWindow, public BrowserWindow::Delegate { public: // Constructor may be called on any thread. RootWindowWin(); @@ -60,15 +60,21 @@ class RootWindowWin : public RootWindow, HBRUSH background_brush); // Window procedure for the edit field. - static LRESULT CALLBACK EditWndProc(HWND hWnd, UINT message, WPARAM wParam, + static LRESULT CALLBACK EditWndProc(HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam); // Window procedure for the find dialog. - static LRESULT CALLBACK FindWndProc(HWND hWnd, UINT message, WPARAM wParam, + static LRESULT CALLBACK FindWndProc(HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam); // Window procedure for the root window. - static LRESULT CALLBACK RootWndProc(HWND hWnd, UINT message, WPARAM wParam, + static LRESULT CALLBACK RootWndProc(HWND hWnd, + UINT message, + WPARAM wParam, LPARAM lParam); // Event handlers. diff --git a/tests/cefclient/browser/scheme_test.cc b/tests/cefclient/browser/scheme_test.cc index 0a0788277..4aab1e5e4 100644 --- a/tests/cefclient/browser/scheme_test.cc +++ b/tests/cefclient/browser/scheme_test.cc @@ -10,9 +10,9 @@ #include "include/cef_browser.h" #include "include/cef_callback.h" #include "include/cef_frame.h" +#include "include/cef_request.h" #include "include/cef_resource_handler.h" #include "include/cef_response.h" -#include "include/cef_request.h" #include "include/cef_scheme.h" #include "include/wrapper/cef_helpers.h" #include "tests/cefclient/browser/test_runner.h" @@ -29,8 +29,7 @@ class ClientSchemeHandler : public CefResourceHandler { ClientSchemeHandler() : offset_(0) {} virtual bool ProcessRequest(CefRefPtr request, - CefRefPtr callback) - OVERRIDE { + CefRefPtr callback) OVERRIDE { CEF_REQUIRE_IO_THREAD(); bool handled = false; @@ -38,23 +37,25 @@ class ClientSchemeHandler : public CefResourceHandler { std::string url = request->GetURL(); if (strstr(url.c_str(), "handler.html") != NULL) { // Build the response html - data_ = "Client Scheme Handler" - "" - "This contents of this page page are served by the " - "ClientSchemeHandler class handling the client:// protocol." - "
    You should see an image:" - "
    ";
    +      data_ =
    +          "Client Scheme Handler"
    +          ""
    +          "This contents of this page page are served by the "
    +          "ClientSchemeHandler class handling the client:// protocol."
    +          "
    You should see an image:" + "
    ";
     
           // Output a string representation of the request
           const std::string& dump = test_runner::DumpRequestContents(request);
           data_.append(dump);
     
    -      data_.append("

    Try the test form:" - "
    " - "" - "" - "" - "
    "); + data_.append( + "

    Try the test form:" + "
    " + "" + "" + "" + "
    "); handled = true; @@ -92,15 +93,12 @@ class ClientSchemeHandler : public CefResourceHandler { response_length = data_.length(); } - virtual void Cancel() OVERRIDE { - CEF_REQUIRE_IO_THREAD(); - } + virtual void Cancel() OVERRIDE { CEF_REQUIRE_IO_THREAD(); } virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, - CefRefPtr callback) - OVERRIDE { + CefRefPtr callback) OVERRIDE { CEF_REQUIRE_IO_THREAD(); bool has_data = false; @@ -132,11 +130,11 @@ class ClientSchemeHandler : public CefResourceHandler { class ClientSchemeHandlerFactory : public CefSchemeHandlerFactory { public: // Return a new scheme handler instance to handle the request. - virtual CefRefPtr Create(CefRefPtr browser, - CefRefPtr frame, - const CefString& scheme_name, - CefRefPtr request) - OVERRIDE { + virtual CefRefPtr Create( + CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) OVERRIDE { CEF_REQUIRE_IO_THREAD(); return new ClientSchemeHandler(); } @@ -148,7 +146,7 @@ class ClientSchemeHandlerFactory : public CefSchemeHandlerFactory { void RegisterSchemeHandlers() { CefRegisterSchemeHandlerFactory("client", "tests", - new ClientSchemeHandlerFactory()); + new ClientSchemeHandlerFactory()); } } // namespace scheme_test diff --git a/tests/cefclient/browser/temp_window_mac.mm b/tests/cefclient/browser/temp_window_mac.mm index b65f92b75..d6091c15e 100644 --- a/tests/cefclient/browser/temp_window_mac.mm +++ b/tests/cefclient/browser/temp_window_mac.mm @@ -17,8 +17,7 @@ TempWindowMac* g_temp_window = NULL; } // namespace -TempWindowMac::TempWindowMac() - : window_(nil) { +TempWindowMac::TempWindowMac() : window_(nil) { DCHECK(!g_temp_window); g_temp_window = this; diff --git a/tests/cefclient/browser/temp_window_win.cc b/tests/cefclient/browser/temp_window_win.cc index 8d62dd4f1..9d98eebc8 100644 --- a/tests/cefclient/browser/temp_window_win.cc +++ b/tests/cefclient/browser/temp_window_win.cc @@ -26,18 +26,15 @@ HWND CreateTempWindow() { RegisterClassEx(&wc); // Create a 1x1 pixel hidden window. - return CreateWindow(kWndClass, 0, - WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, - 0, 0, 1, 1, - NULL, NULL, hInstance, NULL); + return CreateWindow(kWndClass, 0, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, 0, 0, + 1, 1, NULL, NULL, hInstance, NULL); } TempWindowWin* g_temp_window = NULL; } // namespace -TempWindowWin::TempWindowWin() - : hwnd_(NULL) { +TempWindowWin::TempWindowWin() : hwnd_(NULL) { DCHECK(!g_temp_window); g_temp_window = this; diff --git a/tests/cefclient/browser/temp_window_x11.cc b/tests/cefclient/browser/temp_window_x11.cc index 5e8af83d0..ca9dad789 100644 --- a/tests/cefclient/browser/temp_window_x11.cc +++ b/tests/cefclient/browser/temp_window_x11.cc @@ -13,25 +13,21 @@ namespace client { namespace { - // Create the temp window. ::Window CreateTempWindow() { ::Display* xdisplay = cef_get_xdisplay(); ::Window parent_xwindow = DefaultRootWindow(xdisplay); - + XSetWindowAttributes swa; memset(&swa, 0, sizeof(swa)); swa.background_pixmap = None; swa.override_redirect = false; - return XCreateWindow( - xdisplay, parent_xwindow, - 0, 0, 1, 1, // size (1x1px) - 0, // border width - CopyFromParent, // depth - InputOutput, - CopyFromParent, // visual - CWBackPixmap | CWOverrideRedirect, - &swa); + return XCreateWindow(xdisplay, parent_xwindow, 0, 0, 1, 1, // size (1x1px) + 0, // border width + CopyFromParent, // depth + InputOutput, + CopyFromParent, // visual + CWBackPixmap | CWOverrideRedirect, &swa); } // Close the temp window. @@ -44,8 +40,7 @@ TempWindowX11* g_temp_window = NULL; } // namespace -TempWindowX11::TempWindowX11() - : xwindow_(kNullWindowHandle) { +TempWindowX11::TempWindowX11() : xwindow_(kNullWindowHandle) { DCHECK(!g_temp_window); g_temp_window = this; @@ -56,7 +51,7 @@ TempWindowX11::TempWindowX11() TempWindowX11::~TempWindowX11() { g_temp_window = NULL; DCHECK(xwindow_); - + CloseTempWindow(xwindow_); } diff --git a/tests/cefclient/browser/test_runner.cc b/tests/cefclient/browser/test_runner.cc index 424e12e39..0438d824b 100644 --- a/tests/cefclient/browser/test_runner.cc +++ b/tests/cefclient/browser/test_runner.cc @@ -34,7 +34,8 @@ namespace { const char kTestOrigin[] = "http://tests/"; // Replace all instances of |from| with |to| in |str|. -std::string StringReplace(const std::string& str, const std::string& from, +std::string StringReplace(const std::string& str, + const std::string& from, const std::string& to) { std::string result = str; std::string::size_type pos = 0; @@ -58,10 +59,11 @@ void RunGetSourceTest(CefRefPtr browser) { std::string source = StringReplace(string, "<", "<"); source = StringReplace(source, ">", ">"); std::stringstream ss; - ss << "Source:
    " << source <<
    -            "
    "; + ss << "Source:
    " << source
    +         << "
    "; browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/getsource"); } + private: CefRefPtr browser_; IMPLEMENT_REFCOUNTING(Visitor); @@ -78,10 +80,11 @@ void RunGetTextTest(CefRefPtr browser) { std::string text = StringReplace(string, "<", "<"); text = StringReplace(text, ">", ">"); std::stringstream ss; - ss << "Text:
    " << text <<
    -            "
    "; + ss << "Text:
    " << text
    +         << "
    "; browser_->GetMainFrame()->LoadString(ss.str(), "http://tests/gettext"); } + private: CefRefPtr browser_; IMPLEMENT_REFCOUNTING(Visitor); @@ -108,8 +111,7 @@ void RunRequestTest(CefRefPtr browser) { // Add a custom header CefRequest::HeaderMap headerMap; - headerMap.insert( - std::make_pair("X-My-Header", "My Header Value")); + headerMap.insert(std::make_pair("X-My-Header", "My Header Value")); request->SetHeaderMap(headerMap); // Load the request @@ -118,10 +120,10 @@ void RunRequestTest(CefRefPtr browser) { void RunNewWindowTest(CefRefPtr browser) { MainContext::Get()->GetRootWindowManager()->CreateRootWindow( - true, // Show controls. + true, // Show controls. browser->GetHost()->IsWindowRenderingDisabled(), - CefRect(), // Use default system size. - std::string()); // Use default URL. + CefRect(), // Use default system size. + std::string()); // Use default URL. } void RunPopupWindowTest(CefRefPtr browser) { @@ -132,11 +134,11 @@ void RunPopupWindowTest(CefRefPtr browser) { void RunPluginInfoTest(CefRefPtr browser) { class Visitor : public CefWebPluginInfoVisitor { public: - explicit Visitor(CefRefPtr browser) - : browser_(browser) { - html_ = "Plugin Info Test" - "" - "\nInstalled plugins:"; + explicit Visitor(CefRefPtr browser) : browser_(browser) { + html_ = + "Plugin Info Test" + "" + "\nInstalled plugins:"; } ~Visitor() { html_ += "\n"; @@ -145,12 +147,13 @@ void RunPluginInfoTest(CefRefPtr browser) { browser_->GetMainFrame()->LoadString(html_, "http://tests/plugin_info"); } - virtual bool Visit(CefRefPtr info, int count, int total) - OVERRIDE { - html_ += "\n

    Name: " + info->GetName().ToString() + - "\n
    Description: " + info->GetDescription().ToString() + - "\n
    Version: " + info->GetVersion().ToString() + - "\n
    Path: " + info->GetPath().ToString(); + virtual bool Visit(CefRefPtr info, + int count, + int total) OVERRIDE { + html_ += "\n

    Name: " + info->GetName().ToString() + + "\n
    Description: " + info->GetDescription().ToString() + + "\n
    Version: " + info->GetVersion().ToString() + + "\n
    Path: " + info->GetPath().ToString(); return true; } @@ -170,8 +173,7 @@ void ModifyZoom(CefRefPtr browser, double delta) { return; } - browser->GetHost()->SetZoomLevel( - browser->GetHost()->GetZoomLevel() + delta); + browser->GetHost()->SetZoomLevel(browser->GetHost()->GetZoomLevel() + delta); } const char kPrompt[] = "Prompt."; @@ -234,8 +236,8 @@ class PromptHandler : public CefMessageRouterBrowserSide::Handler { } static void SetDSFOnMainThread(CefRefPtr browser, float dsf) { - RootWindow::GetForBrowser(browser->GetIdentifier())-> - SetDeviceScaleFactor(dsf); + RootWindow::GetForBrowser(browser->GetIdentifier()) + ->SetDeviceScaleFactor(dsf); } }; @@ -247,9 +249,9 @@ void Prompt(CefRefPtr browser, // 1. Show a prompt() dialog via JavaScript. // 2. Pass the result to window.cefQuery(). // 3. Handle the result in PromptHandler::OnQuery. - const std::string& code = - "window.cefQuery({'request': '" + std::string(kPrompt) + type + - ":' + prompt('" + label + "', '" + default_value + "')});"; + const std::string& code = "window.cefQuery({'request': '" + + std::string(kPrompt) + type + ":' + prompt('" + + label + "', '" + default_value + "')});"; browser->GetMainFrame()->ExecuteJavaScript( code, browser->GetMainFrame()->GetURL(), 0); } @@ -277,8 +279,8 @@ void PromptDSF(CefRefPtr browser) { // Format the default value string. std::stringstream ss; - ss << RootWindow::GetForBrowser(browser->GetIdentifier())-> - GetDeviceScaleFactor(); + ss << RootWindow::GetForBrowser(browser->GetIdentifier()) + ->GetDeviceScaleFactor(); Prompt(browser, kPromptDSF, "Enter Device Scale Factor", ss.str()); } @@ -300,11 +302,9 @@ void EndTracing(CefRefPtr browser) { return; } - class Client : public CefEndTracingCallback, - public CefRunFileDialogCallback { + class Client : public CefEndTracingCallback, public CefRunFileDialogCallback { public: - explicit Client(CefRefPtr browser) - : browser_(browser) { + explicit Client(CefRefPtr browser) : browser_(browser) { RunDialog(); } @@ -316,12 +316,12 @@ void EndTracing(CefRefPtr browser) { // Results in a call to OnFileDialogDismissed. browser_->GetHost()->RunFileDialog( - static_cast( - FILE_DIALOG_SAVE | FILE_DIALOG_OVERWRITEPROMPT_FLAG), + static_cast(FILE_DIALOG_SAVE | + FILE_DIALOG_OVERWRITEPROMPT_FLAG), CefString(), // title path, std::vector(), // accept_filters - 0, // selected_accept_filter + 0, // selected_accept_filter this); } @@ -337,8 +337,7 @@ void EndTracing(CefRefPtr browser) { } } - void OnEndTracingComplete( - const CefString& tracing_file) OVERRIDE { + void OnEndTracingComplete(const CefString& tracing_file) OVERRIDE { Alert(browser_, "File \"" + tracing_file.ToString() + "\" saved successfully."); } @@ -359,11 +358,9 @@ void PrintToPDF(CefRefPtr browser) { return; } - class Client : public CefPdfPrintCallback, - public CefRunFileDialogCallback { + class Client : public CefPdfPrintCallback, public CefRunFileDialogCallback { public: - explicit Client(CefRefPtr browser) - : browser_(browser) { + explicit Client(CefRefPtr browser) : browser_(browser) { RunDialog(); } @@ -378,11 +375,10 @@ void PrintToPDF(CefRefPtr browser) { // Results in a call to OnFileDialogDismissed. browser_->GetHost()->RunFileDialog( - static_cast( - FILE_DIALOG_SAVE | FILE_DIALOG_OVERWRITEPROMPT_FLAG), + static_cast(FILE_DIALOG_SAVE | + FILE_DIALOG_OVERWRITEPROMPT_FLAG), CefString(), // title - path, - accept_filters, + path, accept_filters, 0, // selected_accept_filter this); } @@ -404,8 +400,8 @@ void PrintToPDF(CefRefPtr browser) { } void OnPdfPrintFinished(const CefString& path, bool ok) OVERRIDE { - Alert(browser_, "File \"" + path.ToString() +"\" " + - (ok ? "saved successfully." : "failed to save.")); + Alert(browser_, "File \"" + path.ToString() + "\" " + + (ok ? "saved successfully." : "failed to save.")); } private: @@ -424,8 +420,7 @@ void RunOtherTests(CefRefPtr browser) { // Provider that dumps the request contents. class RequestDumpResourceProvider : public CefResourceManager::Provider { public: - explicit RequestDumpResourceProvider(const std::string& url) - : url_(url) { + explicit RequestDumpResourceProvider(const std::string& url) : url_(url) { DCHECK(!url.empty()); } @@ -439,12 +434,10 @@ class RequestDumpResourceProvider : public CefResourceManager::Provider { } const std::string& dump = DumpRequestContents(request->request()); - std::string str = "
    " + dump +
    -                      "
    "; - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(str.c_str())), - str.size()); + std::string str = + "
    " + dump + "
    "; + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(str.c_str())), str.size()); DCHECK(stream.get()); request->Continue(new CefStreamResourceHandler("text/html", stream)); return true; @@ -500,7 +493,7 @@ void RunTest(CefRefPtr browser, int id) { switch (id) { case ID_TESTS_GETSOURCE: - RunGetSourceTest(browser); + RunGetSourceTest(browser); break; case ID_TESTS_GETTEXT: RunGetTextTest(browser); @@ -562,8 +555,8 @@ std::string DumpRequestContents(CefRefPtr request) { ss << "\nHeaders:"; CefRequest::HeaderMap::const_iterator it = headerMap.begin(); for (; it != headerMap.end(); ++it) { - ss << "\n\t" << std::string((*it).first) << ": " << - std::string((*it).second); + ss << "\n\t" << std::string((*it).first) << ": " + << std::string((*it).second); } } @@ -588,7 +581,7 @@ std::string DumpRequestContents(CefRefPtr request) { char* bytes = new char[size]; element->GetBytes(size, bytes); ss << std::string(bytes, size); - delete [] bytes; + delete[] bytes; } } else if (element->GetType() == PDE_TYPE_FILE) { ss << "\n\tFile: " << std::string(element->GetFile()); @@ -600,15 +593,17 @@ std::string DumpRequestContents(CefRefPtr request) { return ss.str(); } -std::string GetDataURI(const std::string& data, - const std::string& mime_type) { +std::string GetDataURI(const std::string& data, const std::string& mime_type) { return "data:" + mime_type + ";base64," + - CefURIEncode(CefBase64Encode(data.data(), data.size()), false).ToString(); + CefURIEncode(CefBase64Encode(data.data(), data.size()), false) + .ToString(); } std::string GetErrorString(cef_errorcode_t code) { - // Case condition that returns |code| as a string. - #define CASE(code) case code: return #code +// Case condition that returns |code| as a string. +#define CASE(code) \ + case code: \ + return #code switch (code) { CASE(ERR_NONE); @@ -679,20 +674,20 @@ void SetupResourceManager(CefRefPtr resource_manager) { // Add provider for resource dumps. resource_manager->AddProvider( - new RequestDumpResourceProvider(test_origin + "request.html"), - 0, std::string()); + new RequestDumpResourceProvider(test_origin + "request.html"), 0, + std::string()); - // Add provider for bundled resource files. +// Add provider for bundled resource files. #if defined(OS_WIN) // Read resources from the binary. - resource_manager->AddProvider(CreateBinaryResourceProvider(test_origin), - 100, std::string()); + resource_manager->AddProvider(CreateBinaryResourceProvider(test_origin), 100, + std::string()); #elif defined(OS_POSIX) // Read resources from a directory on disk. std::string resource_dir; if (GetResourceDir(resource_dir)) { - resource_manager->AddDirectoryProvider(test_origin, resource_dir, - 100, std::string()); + resource_manager->AddDirectoryProvider(test_origin, resource_dir, 100, + std::string()); } #endif } diff --git a/tests/cefclient/browser/test_runner.h b/tests/cefclient/browser/test_runner.h index 090e05e4d..b2a499017 100644 --- a/tests/cefclient/browser/test_runner.h +++ b/tests/cefclient/browser/test_runner.h @@ -24,8 +24,7 @@ void RunTest(CefRefPtr browser, int id); std::string DumpRequestContents(CefRefPtr request); // Returns a data: URI with the specified contents. -std::string GetDataURI(const std::string& data, - const std::string& mime_type); +std::string GetDataURI(const std::string& data, const std::string& mime_type); // Returns the string representation of the specified error code. std::string GetErrorString(cef_errorcode_t code); diff --git a/tests/cefclient/browser/text_input_client_osr_mac.h b/tests/cefclient/browser/text_input_client_osr_mac.h index 02c336220..9f6cbca6c 100644 --- a/tests/cefclient/browser/text_input_client_osr_mac.h +++ b/tests/cefclient/browser/text_input_client_osr_mac.h @@ -7,8 +7,8 @@ #pragma once #import -#include #include +#include #include "include/cef_browser.h" #include "include/cef_render_handler.h" diff --git a/tests/cefclient/browser/text_input_client_osr_mac.mm b/tests/cefclient/browser/text_input_client_osr_mac.mm index a1dada00f..822287f5d 100644 --- a/tests/cefclient/browser/text_input_client_osr_mac.mm +++ b/tests/cefclient/browser/text_input_client_osr_mac.mm @@ -5,23 +5,25 @@ // Implementation based on // content/browser/renderer_host/render_widget_host_view_mac.mm from Chromium. -#include "text_input_client_osr_mac.h" #include "include/cef_client.h" +#include "text_input_client_osr_mac.h" -#define ColorBLACK 0xFF000000 // Same as Blink SKColor. +#define ColorBLACK 0xFF000000 // Same as Blink SKColor. namespace { // TODO(suzhe): Upstream this function. -cef_color_t CefColorFromNSColor(NSColor *color) { +cef_color_t CefColorFromNSColor(NSColor* color) { CGFloat r, g, b, a; [color getRed:&r green:&g blue:&b alpha:&a]; - return - std::max(0, std::min(static_cast(lroundf(255.0f * a)), 255)) << 24 | - std::max(0, std::min(static_cast(lroundf(255.0f * r)), 255)) << 16 | - std::max(0, std::min(static_cast(lroundf(255.0f * g)), 255)) << 8 | - std::max(0, std::min(static_cast(lroundf(255.0f * b)), 255)); + return std::max(0, std::min(static_cast(lroundf(255.0f * a)), 255)) + << 24 | + std::max(0, std::min(static_cast(lroundf(255.0f * r)), 255)) + << 16 | + std::max(0, std::min(static_cast(lroundf(255.0f * g)), 255)) + << 8 | + std::max(0, std::min(static_cast(lroundf(255.0f * b)), 255)); } // Extract underline information from an attributed string. Mostly copied from @@ -33,19 +35,18 @@ void ExtractUnderlines(NSAttributedString* string, while (i < length) { NSRange range; NSDictionary* attrs = [string attributesAtIndex:i - longestEffectiveRange:&range - inRange:NSMakeRange(i, length - i)]; - NSNumber *style = [attrs objectForKey: NSUnderlineStyleAttributeName]; + longestEffectiveRange:&range + inRange:NSMakeRange(i, length - i)]; + NSNumber* style = [attrs objectForKey:NSUnderlineStyleAttributeName]; if (style) { cef_color_t color = ColorBLACK; - if (NSColor *colorAttr = + if (NSColor* colorAttr = [attrs objectForKey:NSUnderlineColorAttributeName]) { color = CefColorFromNSColor( [colorAttr colorUsingColorSpaceName:NSDeviceRGBColorSpace]); } cef_composition_underline_t line = { - {range.location, NSMaxRange(range)}, color, 0, [style intValue] > 1 - }; + {range.location, NSMaxRange(range)}, color, 0, [style intValue] > 1}; underlines->push_back(line); } i = range.location + range.length; @@ -75,12 +76,11 @@ extern NSString* NSTextInputReplacementRangeAttributeName; - (NSArray*)validAttributesForMarkedText { if (!validAttributesForMarkedText_) { - validAttributesForMarkedText_ = [[NSArray alloc] initWithObjects: - NSUnderlineStyleAttributeName, - NSUnderlineColorAttributeName, - NSMarkedClauseSegmentAttributeName, - NSTextInputReplacementRangeAttributeName, - nil]; + validAttributesForMarkedText_ = [[NSArray alloc] + initWithObjects:NSUnderlineStyleAttributeName, + NSUnderlineColorAttributeName, + NSMarkedClauseSegmentAttributeName, + NSTextInputReplacementRangeAttributeName, nil]; } return validAttributesForMarkedText_; } @@ -105,10 +105,8 @@ extern NSString* NSTextInputReplacementRangeAttributeName; if (handlingKeyDown_) { textToBeInserted_.append([im_text UTF8String]); } else { - cef_range_t range = { - replacementRange.location, - NSMaxRange(replacementRange) - }; + cef_range_t range = {replacementRange.location, + NSMaxRange(replacementRange)}; browser_->GetHost()->ImeCommitText([im_text UTF8String], range, 0); } @@ -141,9 +139,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName; ExtractUnderlines(aString, &underlines_); } else { // Use a thin black underline by default. - cef_composition_underline_t line = { - {0, length}, ColorBLACK, 0, false - }; + cef_composition_underline_t line = {{0, length}, ColorBLACK, 0, false}; underlines_.push_back(line); } @@ -153,17 +149,15 @@ extern NSString* NSTextInputReplacementRangeAttributeName; // ongoing composition. Our input method backend will automatically cancel an // ongoing composition when we send empty text. if (handlingKeyDown_) { - setMarkedTextReplacementRange_ = { - replacementRange.location, - NSMaxRange(replacementRange) - }; + setMarkedTextReplacementRange_ = {replacementRange.location, + NSMaxRange(replacementRange)}; } else if (!handlingKeyDown_) { CefRange replacement_range(replacementRange.location, NSMaxRange(replacementRange)); CefRange selection_range(newSelRange.location, NSMaxRange(newSelRange)); - browser_->GetHost()->ImeSetComposition( - markedText_, underlines_, replacement_range, selection_range); + browser_->GetHost()->ImeSetComposition(markedText_, underlines_, + replacement_range, selection_range); } } @@ -185,15 +179,16 @@ extern NSString* NSTextInputReplacementRangeAttributeName; unmarkTextCalled_ = YES; } -- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range - actualRange:(NSRangePointer)actualRange { +- (NSAttributedString*)attributedSubstringForProposedRange:(NSRange)range + actualRange: + (NSRangePointer)actualRange { // Modify the attributed string if required. // Not implemented here as we do not want to control the IME window view. return nil; } - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange - actualRange:(NSRangePointer)actualRange { + actualRange:(NSRangePointer)actualRange { NSRect rect; NSUInteger location = theRange.location; @@ -206,7 +201,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName; if (location >= markedRange_.location) location -= markedRange_.location; - if(location < composition_bounds_.size()) { + if (location < composition_bounds_.size()) { const CefRect& rc = composition_bounds_[location]; rect = NSMakeRect(rc.x, rc.y, rc.width, rc.height); } @@ -231,8 +226,8 @@ extern NSString* NSTextInputReplacementRangeAttributeName; - (NSRect)firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePointer)actualRange { - NSRect rect = [self firstViewRectForCharacterRange:theRange - actualRange:actualRange]; + NSRect rect = + [self firstViewRectForCharacterRange:theRange actualRange:actualRange]; // Convert into screen coordinates for return. rect = [self screenRectFromViewRect:rect]; @@ -285,7 +280,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName; // Don't send a CHAR event for non-char keys like arrows, function keys and // clear. if (keyEvent.modifiers & (EVENTFLAG_IS_KEY_PAD)) { - if(keyEvent.native_key_code == 71) + if (keyEvent.native_key_code == 71) return; } @@ -297,9 +292,9 @@ extern NSString* NSTextInputReplacementRangeAttributeName; // to the browser using ImeCommitText(). BOOL textInserted = NO; if (textToBeInserted_.length() > - ((hasMarkedText_ || oldHasMarkedText_) ? 0u : 1u)) { - browser_->GetHost()->ImeCommitText( - textToBeInserted_, CefRange(UINT32_MAX, UINT32_MAX), 0); + ((hasMarkedText_ || oldHasMarkedText_) ? 0u : 1u)) { + browser_->GetHost()->ImeCommitText(textToBeInserted_, + CefRange(UINT32_MAX, UINT32_MAX), 0); textToBeInserted_.clear(); } @@ -324,7 +319,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName; } - (void)ChangeCompositionRange:(CefRange)range - character_bounds:(const CefRenderHandler::RectList&) bounds { + character_bounds:(const CefRenderHandler::RectList&)bounds { composition_range_ = range; markedRange_ = NSMakeRange(range.from, range.to - range.from); composition_bounds_ = bounds; @@ -334,11 +329,11 @@ extern NSString* NSTextInputReplacementRangeAttributeName; if (!hasMarkedText_) return; - // Cancel the ongoing composition. [NSInputManager markedTextAbandoned:] - // doesn't call any NSTextInput functions, such as setMarkedText or - // insertText. - // TODO(erikchen): NSInputManager is deprecated since OSX 10.6. Switch to - // NSTextInputContext. http://www.crbug.com/479010. +// Cancel the ongoing composition. [NSInputManager markedTextAbandoned:] +// doesn't call any NSTextInput functions, such as setMarkedText or +// insertText. +// TODO(erikchen): NSInputManager is deprecated since OSX 10.6. Switch to +// NSTextInputContext. http://www.crbug.com/479010. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" NSInputManager* currentInputManager = [NSInputManager currentInputManager]; diff --git a/tests/cefclient/browser/urlrequest_test.cc b/tests/cefclient/browser/urlrequest_test.cc index 5410726ea..4e6219c5f 100644 --- a/tests/cefclient/browser/urlrequest_test.cc +++ b/tests/cefclient/browser/urlrequest_test.cc @@ -26,10 +26,10 @@ class RequestClient : public CefURLRequestClient { public: // Callback to be executed on request completion. typedef base::Callback Callback; + const std::string& /*download_data*/)> + Callback; - explicit RequestClient(const Callback& callback) - : callback_(callback) { + explicit RequestClient(const Callback& callback) : callback_(callback) { CEF_REQUIRE_UI_THREAD(); DCHECK(!callback_.is_null()); } @@ -50,13 +50,11 @@ class RequestClient : public CefURLRequestClient { void OnUploadProgress(CefRefPtr request, int64 current, - int64 total) OVERRIDE { - } + int64 total) OVERRIDE {} void OnDownloadProgress(CefRefPtr request, int64 current, - int64 total) OVERRIDE { - } + int64 total) OVERRIDE {} void OnDownloadData(CefRefPtr request, const void* data, @@ -65,14 +63,14 @@ class RequestClient : public CefURLRequestClient { download_data_ += std::string(static_cast(data), data_length); } - bool GetAuthCredentials(bool isProxy, - const CefString& host, - int port, - const CefString& realm, - const CefString& scheme, - CefRefPtr callback) OVERRIDE { - return false; - } + bool GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) OVERRIDE { + return false; + } private: Callback callback_; @@ -85,13 +83,9 @@ class RequestClient : public CefURLRequestClient { // Handle messages in the browser process. Only accessed on the UI thread. class Handler : public CefMessageRouterBrowserSide::Handler { public: - Handler() { - CEF_REQUIRE_UI_THREAD(); - } + Handler() { CEF_REQUIRE_UI_THREAD(); } - ~Handler() { - CancelPendingRequest(); - } + ~Handler() { CancelPendingRequest(); } // Called due to cefQuery execution in urlrequest.html. bool OnQuery(CefRefPtr browser, @@ -131,9 +125,8 @@ class Handler : public CefMessageRouterBrowserSide::Handler { base::Bind(&Handler::OnRequestComplete, base::Unretained(this)); // Create and start the new CefURLRequest. - urlrequest_ = CefURLRequest::Create(cef_request, - new RequestClient(request_callback), - NULL); + urlrequest_ = CefURLRequest::Create( + cef_request, new RequestClient(request_callback), NULL); return true; } @@ -164,7 +157,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler { void OnRequestComplete(CefURLRequest::ErrorCode error_code, const std::string& download_data) { CEF_REQUIRE_UI_THREAD(); - + if (error_code == ERR_NONE) callback_->Success(download_data); else diff --git a/tests/cefclient/browser/views_menu_bar.cc b/tests/cefclient/browser/views_menu_bar.cc index b01e46bd3..c1e4ebdb3 100644 --- a/tests/cefclient/browser/views_menu_bar.cc +++ b/tests/cefclient/browser/views_menu_bar.cc @@ -42,12 +42,11 @@ base::char16 GetMnemonic(const base::string16& title) { } // namespace -ViewsMenuBar::ViewsMenuBar(Delegate* delegate, - int menu_id_start) - : delegate_(delegate), - id_start_(menu_id_start), - id_next_(menu_id_start), - last_nav_with_keyboard_(false) { +ViewsMenuBar::ViewsMenuBar(Delegate* delegate, int menu_id_start) + : delegate_(delegate), + id_start_(menu_id_start), + id_next_(menu_id_start), + last_nav_with_keyboard_(false) { DCHECK(delegate_); DCHECK_GT(id_start_, 0); } @@ -93,7 +92,7 @@ CefRefPtr ViewsMenuBar::CreateMenuModel(const CefString& label, base::char16 mnemonic = GetMnemonic(label); if (mnemonic != 0) mnemonics_.insert(std::make_pair(mnemonic, new_menu_id)); - + return model; } diff --git a/tests/cefclient/browser/views_menu_bar.h b/tests/cefclient/browser/views_menu_bar.h index 0d146261d..2e6c656bc 100644 --- a/tests/cefclient/browser/views_menu_bar.h +++ b/tests/cefclient/browser/views_menu_bar.h @@ -21,8 +21,7 @@ namespace client { // Implements a menu bar which is composed of CefMenuButtons positioned in a // row with automatic switching between them via mouse/keyboard. All methods // must be called on the browser process UI thread. -class ViewsMenuBar : public CefMenuButtonDelegate, - public CefMenuModelDelegate { +class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate { public: // Delegate methods will be called on the browser process UI thread. class Delegate { @@ -30,7 +29,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, // Called when a menu command is selected. virtual void MenuBarExecuteCommand(CefRefPtr menu_model, int command_id, - cef_event_flags_t event_flags) =0; + cef_event_flags_t event_flags) = 0; protected: virtual ~Delegate() {} @@ -40,8 +39,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, // |menu_id_start| is the ID for the first CefMenuButton in the bar. An ID // range starting with |menu_id_start| and extending for a reasonable distance // should be reserved in the client for MenuBar usage. - ViewsMenuBar(Delegate* delegate, - int menu_id_start); + ViewsMenuBar(Delegate* delegate, int menu_id_start); // Returns true if |menu_id| exists in the menu bar. bool HasMenuId(int menu_id) const; @@ -51,8 +49,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, // Create a new menu with the specified |label|. If |menu_id| is non-NULL it // will be populated with the new menu ID. - CefRefPtr CreateMenuModel(const CefString& label, - int* menu_id); + CefRefPtr CreateMenuModel(const CefString& label, int* menu_id); // Returns the menu with the specified |menu_id|, or NULL if no such menu // exists. @@ -109,7 +106,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, const int id_start_; int id_next_; CefRefPtr panel_; - std::vector > models_; + std::vector> models_; bool last_nav_with_keyboard_; // Map of mnemonic to MenuButton ID. diff --git a/tests/cefclient/browser/views_style.cc b/tests/cefclient/browser/views_style.cc index 999deba20..830b7ceee 100644 --- a/tests/cefclient/browser/views_style.cc +++ b/tests/cefclient/browser/views_style.cc @@ -28,16 +28,15 @@ void MaybeInitialize() { g_background_color = MainContext::Get()->GetBackgroundColor(); if (g_background_color != 0) { // Use a slightly modified shade of the background color for hover. - g_background_hover_color = CefColorSetARGB(255, - GetShade(CefColorGetR(g_background_color)), - GetShade(CefColorGetG(g_background_color)), - GetShade(CefColorGetB(g_background_color))); + g_background_hover_color = + CefColorSetARGB(255, GetShade(CefColorGetR(g_background_color)), + GetShade(CefColorGetG(g_background_color)), + GetShade(CefColorGetB(g_background_color))); // Invert the background color for text. - g_text_color = CefColorSetARGB(255, - 255 - CefColorGetR(g_background_color), - 255 - CefColorGetG(g_background_color), - 255 - CefColorGetB(g_background_color)); + g_text_color = CefColorSetARGB(255, 255 - CefColorGetR(g_background_color), + 255 - CefColorGetG(g_background_color), + 255 - CefColorGetB(g_background_color)); } initialized = true; diff --git a/tests/cefclient/browser/views_window.cc b/tests/cefclient/browser/views_window.cc index 459a10a6f..4180f60e1 100644 --- a/tests/cefclient/browser/views_window.cc +++ b/tests/cefclient/browser/views_window.cc @@ -8,9 +8,9 @@ #include "include/base/cef_bind.h" #include "include/base/cef_build.h" +#include "include/cef_app.h" #include "include/views/cef_box_layout.h" #include "include/wrapper/cef_helpers.h" -#include "include/cef_app.h" #include "tests/cefclient/browser/resource.h" #include "tests/cefclient/browser/views_style.h" #include "tests/shared/browser/resource_util.h" @@ -18,7 +18,7 @@ #if !defined(OS_WIN) #define VK_RETURN 0x0D -#define VK_MENU 0x12 // ALT key. +#define VK_MENU 0x12 // ALT key. #endif namespace client { @@ -41,7 +41,7 @@ enum ControlIds { ID_TOP_MENU_LAST = ID_TOP_MENU_FIRST + 10, }; -typedef std::vector > LabelButtons; +typedef std::vector> LabelButtons; // Make all |buttons| the same size. void MakeButtonsSameSize(const LabelButtons& buttons) { @@ -66,28 +66,28 @@ void MakeButtonsSameSize(const LabelButtons& buttons) { } void AddTestMenuItems(CefRefPtr test_menu) { - test_menu->AddItem(ID_TESTS_GETSOURCE, "Get Source"); - test_menu->AddItem(ID_TESTS_GETTEXT, "Get Text"); - test_menu->AddItem(ID_TESTS_WINDOW_NEW, "New Window"); - test_menu->AddItem(ID_TESTS_WINDOW_POPUP, "Popup Window"); - test_menu->AddItem(ID_TESTS_REQUEST, "Request"); - test_menu->AddItem(ID_TESTS_PLUGIN_INFO, "Plugin Info"); - test_menu->AddItem(ID_TESTS_ZOOM_IN, "Zoom In"); - test_menu->AddItem(ID_TESTS_ZOOM_OUT, "Zoom Out"); - test_menu->AddItem(ID_TESTS_ZOOM_RESET, "Zoom Reset"); - test_menu->AddItem(ID_TESTS_TRACING_BEGIN, "Begin Tracing"); - test_menu->AddItem(ID_TESTS_TRACING_END, "End Tracing"); - test_menu->AddItem(ID_TESTS_PRINT, "Print"); - test_menu->AddItem(ID_TESTS_PRINT_TO_PDF, "Print to PDF"); - test_menu->AddItem(ID_TESTS_OTHER_TESTS, "Other Tests"); + test_menu->AddItem(ID_TESTS_GETSOURCE, "Get Source"); + test_menu->AddItem(ID_TESTS_GETTEXT, "Get Text"); + test_menu->AddItem(ID_TESTS_WINDOW_NEW, "New Window"); + test_menu->AddItem(ID_TESTS_WINDOW_POPUP, "Popup Window"); + test_menu->AddItem(ID_TESTS_REQUEST, "Request"); + test_menu->AddItem(ID_TESTS_PLUGIN_INFO, "Plugin Info"); + test_menu->AddItem(ID_TESTS_ZOOM_IN, "Zoom In"); + test_menu->AddItem(ID_TESTS_ZOOM_OUT, "Zoom Out"); + test_menu->AddItem(ID_TESTS_ZOOM_RESET, "Zoom Reset"); + test_menu->AddItem(ID_TESTS_TRACING_BEGIN, "Begin Tracing"); + test_menu->AddItem(ID_TESTS_TRACING_END, "End Tracing"); + test_menu->AddItem(ID_TESTS_PRINT, "Print"); + test_menu->AddItem(ID_TESTS_PRINT_TO_PDF, "Print to PDF"); + test_menu->AddItem(ID_TESTS_OTHER_TESTS, "Other Tests"); } void AddFileMenuItems(CefRefPtr file_menu) { file_menu->AddItem(ID_QUIT, "E&xit"); // Show the accelerator shortcut text in the menu. - file_menu->SetAcceleratorAt(file_menu->GetCount() - 1, - 'X', false, false, true); + file_menu->SetAcceleratorAt(file_menu->GetCount() - 1, 'X', false, false, + true); } } // namespace @@ -339,8 +339,7 @@ bool ViewsWindow::OnKeyEvent(CefRefPtr textfield, DCHECK_EQ(ID_URL_TEXTFIELD, textfield->GetID()); // Trigger when the return key is pressed. - if (window_ && browser_view_ && - event.type == KEYEVENT_RAWKEYDOWN && + if (window_ && browser_view_ && event.type == KEYEVENT_RAWKEYDOWN && event.windows_key_code == VK_RETURN) { CefRefPtr browser = browser_view_->GetBrowser(); if (browser) { @@ -403,7 +402,7 @@ void ViewsWindow::OnWindowCreated(CefRefPtr window) { // Choose a reasonable minimum window size. minimum_window_size_ = CefSize(100, 100); } - + // Show the Window. window_->Show(); @@ -463,7 +462,7 @@ bool ViewsWindow::OnKeyEvent(CefRefPtr window, // ALT key is pressed. int last_focused_view = last_focused_view_; bool menu_had_focus = menu_has_focus_; - + // Toggle menu button focusable. SetMenuFocusable(!menu_has_focus_); @@ -573,7 +572,7 @@ CefRefPtr ViewsWindow::CreateBrowseButton( CefRefPtr button = CefLabelButton::CreateLabelButton(this, label, with_frame); button->SetID(id); - button->SetEnabled(false); // Disabled by default. + button->SetEnabled(false); // Disabled by default. button->SetFocusable(false); // Don't give focus to the button. if (!with_frame) { diff --git a/tests/cefclient/browser/views_window.h b/tests/cefclient/browser/views_window.h index de9852c2c..18ff68245 100644 --- a/tests/cefclient/browser/views_window.h +++ b/tests/cefclient/browser/views_window.h @@ -9,9 +9,9 @@ #include #include "include/cef_menu_model_delegate.h" -#include "include/views/cef_button_delegate.h" #include "include/views/cef_browser_view.h" #include "include/views/cef_browser_view_delegate.h" +#include "include/views/cef_button_delegate.h" #include "include/views/cef_label_button.h" #include "include/views/cef_menu_button.h" #include "include/views/cef_menu_button_delegate.h" @@ -37,20 +37,20 @@ class ViewsWindow : public CefBrowserViewDelegate, class Delegate { public: // Return true if the window should show controls. - virtual bool WithControls() =0; + virtual bool WithControls() = 0; // Return the initial window bounds. - virtual CefRect GetWindowBounds() =0; + virtual CefRect GetWindowBounds() = 0; // Called when the ViewsWindow is created. - virtual void OnViewsWindowCreated(CefRefPtr window) =0; + virtual void OnViewsWindowCreated(CefRefPtr window) = 0; // Called when the ViewsWindow is destroyed. All references to |window| // should be released in this callback. - virtual void OnViewsWindowDestroyed(CefRefPtr window) =0; + virtual void OnViewsWindowDestroyed(CefRefPtr window) = 0; // Return the Delegate for the popup window controlled by |client|. - virtual Delegate* GetDelegateForPopup(CefRefPtr client) =0; + virtual Delegate* GetDelegateForPopup(CefRefPtr client) = 0; // Called to execute a test. See resource.h for |test_id| values. virtual void OnTest(int test_id) = 0; @@ -81,18 +81,15 @@ class ViewsWindow : public CefBrowserViewDelegate, void SetTitle(const std::string& title); void SetFavicon(CefRefPtr image); void SetFullscreen(bool fullscreen); - void SetLoadingState(bool isLoading, - bool canGoBack, - bool canGoForward); + void SetLoadingState(bool isLoading, bool canGoBack, bool canGoForward); void SetDraggableRegions(const std::vector& regions); void TakeFocus(bool next); void OnBeforeContextMenu(CefRefPtr model); // CefBrowserViewDelegate methods: - bool OnPopupBrowserViewCreated( - CefRefPtr browser_view, - CefRefPtr popup_browser_view, - bool is_devtools) OVERRIDE; + bool OnPopupBrowserViewCreated(CefRefPtr browser_view, + CefRefPtr popup_browser_view, + bool is_devtools) OVERRIDE; // CefButtonDelegate methods: void OnButtonPressed(CefRefPtr button) OVERRIDE; @@ -131,8 +128,7 @@ class ViewsWindow : public CefBrowserViewDelegate, private: // |delegate| is guaranteed to outlive this object. // |browser_view| may be NULL, in which case SetBrowserView() will be called. - ViewsWindow(Delegate* delegate, - CefRefPtr browser_view); + ViewsWindow(Delegate* delegate, CefRefPtr browser_view); void SetBrowserView(CefRefPtr browser_view); diff --git a/tests/cefclient/browser/window_test.cc b/tests/cefclient/browser/window_test.cc index 76ff9803f..e2032e62e 100644 --- a/tests/cefclient/browser/window_test.cc +++ b/tests/cefclient/browser/window_test.cc @@ -58,9 +58,7 @@ scoped_ptr CreateWindowTestRunner() { // Handle messages in the browser process. class Handler : public CefMessageRouterBrowserSide::Handler { public: - Handler() - : runner_(CreateWindowTestRunner()) { - } + Handler() : runner_(CreateWindowTestRunner()) {} // Called due to cefBroadcast execution in window.html. virtual bool OnQuery(CefRefPtr browser, diff --git a/tests/cefclient/browser/window_test_runner.h b/tests/cefclient/browser/window_test_runner.h index 7e474629a..26a5324c2 100644 --- a/tests/cefclient/browser/window_test_runner.h +++ b/tests/cefclient/browser/window_test_runner.h @@ -16,7 +16,10 @@ namespace window_test { class WindowTestRunner { public: virtual void SetPos(CefRefPtr browser, - int x, int y, int width, int height) = 0; + int x, + int y, + int width, + int height) = 0; virtual void Minimize(CefRefPtr browser) = 0; virtual void Maximize(CefRefPtr browser) = 0; virtual void Restore(CefRefPtr browser) = 0; diff --git a/tests/cefclient/browser/window_test_runner_gtk.cc b/tests/cefclient/browser/window_test_runner_gtk.cc index edea69acf..6dfe6a514 100644 --- a/tests/cefclient/browser/window_test_runner_gtk.cc +++ b/tests/cefclient/browser/window_test_runner_gtk.cc @@ -35,11 +35,13 @@ bool IsMaximized(GtkWindow* window) { } // namespace -WindowTestRunnerGtk::WindowTestRunnerGtk() { -} +WindowTestRunnerGtk::WindowTestRunnerGtk() {} void WindowTestRunnerGtk::SetPos(CefRefPtr browser, - int x, int y, int width, int height) { + int x, + int y, + int width, + int height) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); diff --git a/tests/cefclient/browser/window_test_runner_gtk.h b/tests/cefclient/browser/window_test_runner_gtk.h index a225a45cb..c920fdb23 100644 --- a/tests/cefclient/browser/window_test_runner_gtk.h +++ b/tests/cefclient/browser/window_test_runner_gtk.h @@ -17,7 +17,10 @@ class WindowTestRunnerGtk : public WindowTestRunner { WindowTestRunnerGtk(); void SetPos(CefRefPtr browser, - int x, int y, int width, int height) OVERRIDE; + int x, + int y, + int width, + int height) OVERRIDE; void Minimize(CefRefPtr browser) OVERRIDE; void Maximize(CefRefPtr browser) OVERRIDE; void Restore(CefRefPtr browser) OVERRIDE; diff --git a/tests/cefclient/browser/window_test_runner_mac.h b/tests/cefclient/browser/window_test_runner_mac.h index faf73d834..199d04afa 100644 --- a/tests/cefclient/browser/window_test_runner_mac.h +++ b/tests/cefclient/browser/window_test_runner_mac.h @@ -17,7 +17,10 @@ class WindowTestRunnerMac : public WindowTestRunner { WindowTestRunnerMac(); void SetPos(CefRefPtr browser, - int x, int y, int width, int height) OVERRIDE; + int x, + int y, + int width, + int height) OVERRIDE; void Minimize(CefRefPtr browser) OVERRIDE; void Maximize(CefRefPtr browser) OVERRIDE; void Restore(CefRefPtr browser) OVERRIDE; diff --git a/tests/cefclient/browser/window_test_runner_mac.mm b/tests/cefclient/browser/window_test_runner_mac.mm index 61d95ae37..243d17dda 100644 --- a/tests/cefclient/browser/window_test_runner_mac.mm +++ b/tests/cefclient/browser/window_test_runner_mac.mm @@ -21,11 +21,13 @@ NSWindow* GetWindow(CefRefPtr browser) { } // namespace -WindowTestRunnerMac::WindowTestRunnerMac() { -} +WindowTestRunnerMac::WindowTestRunnerMac() {} void WindowTestRunnerMac::SetPos(CefRefPtr browser, - int x, int y, int width, int height) { + int x, + int y, + int width, + int height) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); @@ -48,8 +50,7 @@ void WindowTestRunnerMac::SetPos(CefRefPtr browser, CefRect display_rect( visibleFrame.origin.x, frame.size.height - visibleFrame.size.height - visibleFrame.origin.y, - visibleFrame.size.width, - visibleFrame.size.height); + visibleFrame.size.width, visibleFrame.size.height); CefRect window_rect(x, y, width, height); ModifyBounds(display_rect, window_rect); diff --git a/tests/cefclient/browser/window_test_runner_views.cc b/tests/cefclient/browser/window_test_runner_views.cc index ef7a8f946..03aecf4dc 100644 --- a/tests/cefclient/browser/window_test_runner_views.cc +++ b/tests/cefclient/browser/window_test_runner_views.cc @@ -29,11 +29,13 @@ CefRefPtr GetWindow(CefRefPtr browser) { } // namespace -WindowTestRunnerViews::WindowTestRunnerViews() { -} +WindowTestRunnerViews::WindowTestRunnerViews() {} void WindowTestRunnerViews::SetPos(CefRefPtr browser, - int x, int y, int width, int height) { + int x, + int y, + int width, + int height) { CefRefPtr window = GetWindow(browser); CefRect window_bounds(x, y, width, height); diff --git a/tests/cefclient/browser/window_test_runner_views.h b/tests/cefclient/browser/window_test_runner_views.h index 0b11b29e7..81334e499 100644 --- a/tests/cefclient/browser/window_test_runner_views.h +++ b/tests/cefclient/browser/window_test_runner_views.h @@ -17,7 +17,10 @@ class WindowTestRunnerViews : public WindowTestRunner { WindowTestRunnerViews(); void SetPos(CefRefPtr browser, - int x, int y, int width, int height) OVERRIDE; + int x, + int y, + int width, + int height) OVERRIDE; void Minimize(CefRefPtr browser) OVERRIDE; void Maximize(CefRefPtr browser) OVERRIDE; void Restore(CefRefPtr browser) OVERRIDE; diff --git a/tests/cefclient/browser/window_test_runner_win.cc b/tests/cefclient/browser/window_test_runner_win.cc index 5d36e373c..de03c96ee 100644 --- a/tests/cefclient/browser/window_test_runner_win.cc +++ b/tests/cefclient/browser/window_test_runner_win.cc @@ -28,7 +28,10 @@ void Toggle(HWND root_hwnd, UINT nCmdShow) { } void SetPosImpl(CefRefPtr browser, - int x, int y, int width, int height) { + int x, + int y, + int width, + int height) { HWND root_hwnd = GetRootHwnd(browser); if (!root_hwnd) return; @@ -38,18 +41,16 @@ void SetPosImpl(CefRefPtr browser, ::GetWindowPlacement(root_hwnd, &placement); // Retrieve information about the display that contains the window. - HMONITOR monitor = MonitorFromRect(&placement.rcNormalPosition, - MONITOR_DEFAULTTONEAREST); + HMONITOR monitor = + MonitorFromRect(&placement.rcNormalPosition, MONITOR_DEFAULTTONEAREST); MONITORINFO info; info.cbSize = sizeof(info); GetMonitorInfo(monitor, &info); // Make sure the window is inside the display. - CefRect display_rect( - info.rcWork.left, - info.rcWork.top, - info.rcWork.right - info.rcWork.left, - info.rcWork.bottom - info.rcWork.top); + CefRect display_rect(info.rcWork.left, info.rcWork.top, + info.rcWork.right - info.rcWork.left, + info.rcWork.bottom - info.rcWork.top); CefRect window_rect(x, y, width, height); WindowTestRunner::ModifyBounds(display_rect, window_rect); @@ -92,11 +93,13 @@ void RestoreImpl(CefRefPtr browser) { } // namespace -WindowTestRunnerWin::WindowTestRunnerWin() { -} +WindowTestRunnerWin::WindowTestRunnerWin() {} void WindowTestRunnerWin::SetPos(CefRefPtr browser, - int x, int y, int width, int height) { + int x, + int y, + int width, + int height) { if (CURRENTLY_ON_MAIN_THREAD()) { SetPosImpl(browser, x, y, width, height); } else { diff --git a/tests/cefclient/browser/window_test_runner_win.h b/tests/cefclient/browser/window_test_runner_win.h index a3aee6db4..14ff9f73b 100644 --- a/tests/cefclient/browser/window_test_runner_win.h +++ b/tests/cefclient/browser/window_test_runner_win.h @@ -18,7 +18,10 @@ class WindowTestRunnerWin : public WindowTestRunner { WindowTestRunnerWin(); void SetPos(CefRefPtr browser, - int x, int y, int width, int height) OVERRIDE; + int x, + int y, + int width, + int height) OVERRIDE; void Minimize(CefRefPtr browser) OVERRIDE; void Maximize(CefRefPtr browser) OVERRIDE; void Restore(CefRefPtr browser) OVERRIDE; diff --git a/tests/cefclient/cefclient_gtk.cc b/tests/cefclient/cefclient_gtk.cc index a4ba96ada..c351c9f55 100644 --- a/tests/cefclient/cefclient_gtk.cc +++ b/tests/cefclient/cefclient_gtk.cc @@ -30,18 +30,18 @@ namespace client { namespace { -int XErrorHandlerImpl(Display *display, XErrorEvent *event) { - LOG(WARNING) - << "X error received: " - << "type " << event->type << ", " - << "serial " << event->serial << ", " - << "error_code " << static_cast(event->error_code) << ", " - << "request_code " << static_cast(event->request_code) << ", " - << "minor_code " << static_cast(event->minor_code); +int XErrorHandlerImpl(Display* display, XErrorEvent* event) { + LOG(WARNING) << "X error received: " + << "type " << event->type << ", " + << "serial " << event->serial << ", " + << "error_code " << static_cast(event->error_code) << ", " + << "request_code " << static_cast(event->request_code) + << ", " + << "minor_code " << static_cast(event->minor_code); return 0; } -int XIOErrorHandlerImpl(Display *display) { +int XIOErrorHandlerImpl(Display* display) { return 0; } @@ -123,8 +123,8 @@ int RunMain(int argc, char* argv[]) { context->GetRootWindowManager()->CreateRootWindow( !command_line->HasSwitch(switches::kHideControls), // Show controls. settings.windowless_rendering_enabled ? true : false, - CefRect(), // Use default system size. - std::string()); // Use default URL. + CefRect(), // Use default system size. + std::string()); // Use default URL. // Run the message loop. This will block until Quit() is called. int result = message_loop->Run(); @@ -142,7 +142,6 @@ int RunMain(int argc, char* argv[]) { } // namespace } // namespace client - // Program entry point function. int main(int argc, char* argv[]) { return client::RunMain(argc, argv); diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index fa10b9ccb..fde1c81b5 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -218,10 +218,10 @@ NSMenuItem* GetMenuItemWithAction(NSMenu* menu, SEL action_selector) { // Create the first window. client::MainContext::Get()->GetRootWindowManager()->CreateRootWindow( - with_controls_, // Show controls. - with_osr_, // Use off-screen rendering. - CefRect(), // Use default system size. - std::string()); // Use default URL. + with_controls_, // Show controls. + with_osr_, // Use off-screen rendering. + CefRect(), // Use default system size. + std::string()); // Use default URL. } - (void)tryToTerminateApplication:(NSApplication*)app { @@ -321,13 +321,13 @@ NSMenuItem* GetMenuItemWithAction(NSMenu* menu, SEL action_selector) { CefRefPtr browser = root_window->GetBrowser(); if (browser.get()) { - browser->GetHost()->SetAccessibilityState(bEnable ? - STATE_ENABLED : STATE_DISABLED); + browser->GetHost()->SetAccessibilityState(bEnable ? STATE_ENABLED + : STATE_DISABLED); } } - (NSApplicationTerminateReply)applicationShouldTerminate: - (NSApplication *)sender { + (NSApplication*)sender { return NSTerminateNow; } @@ -402,7 +402,6 @@ int RunMain(int argc, char* argv[]) { } // namespace } // namespace client - // Program entry point function. int main(int argc, char* argv[]) { return client::RunMain(argc, argv); diff --git a/tests/cefclient/cefclient_win.cc b/tests/cefclient/cefclient_win.cc index e05d0f976..3761c8430 100644 --- a/tests/cefclient/cefclient_win.cc +++ b/tests/cefclient/cefclient_win.cc @@ -98,8 +98,8 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) { context->GetRootWindowManager()->CreateRootWindow( !command_line->HasSwitch(switches::kHideControls), // Show controls. settings.windowless_rendering_enabled ? true : false, - CefRect(), // Use default system size. - std::string()); // Use default URL. + CefRect(), // Use default system size. + std::string()); // Use default URL. // Run the message loop. This will block until Quit() is called by the // RootWindowManager after all windows have been destroyed. @@ -118,12 +118,11 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) { } // namespace } // namespace client - // Program entry point function. int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) { + LPTSTR lpCmdLine, + int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); return client::RunMain(hInstance, nCmdShow); diff --git a/tests/cefclient/renderer/client_renderer.cc b/tests/cefclient/renderer/client_renderer.cc index b04554b13..5bed20eb3 100644 --- a/tests/cefclient/renderer/client_renderer.cc +++ b/tests/cefclient/renderer/client_renderer.cc @@ -22,13 +22,10 @@ const char kFocusedNodeChangedMessage[] = "ClientRenderer.FocusedNodeChanged"; class ClientRenderDelegate : public ClientAppRenderer::Delegate { public: - ClientRenderDelegate() - : last_node_is_editable_(false) { - } + ClientRenderDelegate() : last_node_is_editable_(false) {} - void OnRenderThreadCreated( - CefRefPtr app, - CefRefPtr extra_info) OVERRIDE { + void OnRenderThreadCreated(CefRefPtr app, + CefRefPtr extra_info) OVERRIDE { if (CefCrashReportingEnabled()) { // Set some crash keys for testing purposes. Keys must be defined in the // "crash_reporter.cfg" file. See cef_crash_util.h for details. @@ -48,14 +45,14 @@ class ClientRenderDelegate : public ClientAppRenderer::Delegate { CefRefPtr browser, CefRefPtr frame, CefRefPtr context) OVERRIDE { - message_router_->OnContextCreated(browser, frame, context); + message_router_->OnContextCreated(browser, frame, context); } void OnContextReleased(CefRefPtr app, CefRefPtr browser, CefRefPtr frame, CefRefPtr context) OVERRIDE { - message_router_->OnContextReleased(browser, frame, context); + message_router_->OnContextReleased(browser, frame, context); } void OnFocusedNodeChanged(CefRefPtr app, @@ -73,13 +70,12 @@ class ClientRenderDelegate : public ClientAppRenderer::Delegate { } } - bool OnProcessMessageReceived( - CefRefPtr app, - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) OVERRIDE { - return message_router_->OnProcessMessageReceived( - browser, source_process, message); + bool OnProcessMessageReceived(CefRefPtr app, + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) OVERRIDE { + return message_router_->OnProcessMessageReceived(browser, source_process, + message); } private: diff --git a/tests/cefclient/renderer/performance_test.cc b/tests/cefclient/renderer/performance_test.cc index d6b31d69a..31a0e45a2 100644 --- a/tests/cefclient/renderer/performance_test.cc +++ b/tests/cefclient/renderer/performance_test.cc @@ -29,8 +29,7 @@ const char kPerfTestReturnValue[] = "PerfTestReturnValue"; class V8Handler : public CefV8Handler { public: - V8Handler() { - } + V8Handler() {} virtual bool Execute(const CefString& name, CefRefPtr object, @@ -129,8 +128,7 @@ class V8Handler : public CefV8Handler { // Handle bindings in the render process. class RenderDelegate : public ClientAppRenderer::Delegate { public: - RenderDelegate() { - } + RenderDelegate() {} virtual void OnContextCreated(CefRefPtr app, CefRefPtr browser, @@ -142,14 +140,14 @@ class RenderDelegate : public ClientAppRenderer::Delegate { // Bind test functions. object->SetValue(kGetPerfTests, - CefV8Value::CreateFunction(kGetPerfTests, handler), - V8_PROPERTY_ATTRIBUTE_READONLY); + CefV8Value::CreateFunction(kGetPerfTests, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); object->SetValue(kRunPerfTest, - CefV8Value::CreateFunction(kRunPerfTest, handler), - V8_PROPERTY_ATTRIBUTE_READONLY); + CefV8Value::CreateFunction(kRunPerfTest, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); object->SetValue(kPerfTestReturnValue, - CefV8Value::CreateFunction(kPerfTestReturnValue, handler), - V8_PROPERTY_ATTRIBUTE_READONLY); + CefV8Value::CreateFunction(kPerfTestReturnValue, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); } private: diff --git a/tests/cefclient/renderer/performance_test_setup.h b/tests/cefclient/renderer/performance_test_setup.h index 664a8cffc..7427a5558 100644 --- a/tests/cefclient/renderer/performance_test_setup.h +++ b/tests/cefclient/renderer/performance_test_setup.h @@ -6,8 +6,8 @@ #define CEF_TESTS_CEFCLIENT_RENDERER_PERFORMANCE_TEST_SETUP_H_ #pragma once -#include "include/base/cef_macros.h" #include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" namespace client { namespace performance_test { @@ -20,7 +20,7 @@ extern const int kDefaultIterations; // Entry in test array. #define PERF_TEST_ENTRY_EX(name, iterations) \ - { #name, PERF_TEST_NAME(name), iterations } + { #name, PERF_TEST_NAME(name), iterations } #define PERF_TEST_ENTRY(name) PERF_TEST_ENTRY_EX(name, kDefaultIterations) // Test function declaration. @@ -28,15 +28,14 @@ extern const int kDefaultIterations; #define PERF_TEST_PARAM_ITERATIONS iterations #define PERF_TEST_PARAMS int PERF_TEST_PARAM_ITERATIONS #define PERF_TEST_FUNC(name) \ - PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS) + PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS) // Typedef for test pointers. typedef PERF_TEST_RESULT(PerfTest(PERF_TEST_PARAMS)); class CefTimer { public: - CefTimer() : running_(false) { - } + CefTimer() : running_(false) {} bool IsRunning() { return running_; } @@ -67,25 +66,24 @@ class CefTimer { // Peform test iterations using a user-provided timing result variable. #define PERF_ITERATIONS_START_EX() \ - { \ - CefTimer _timer; \ - _timer.Start(); \ - for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) { - + { \ + CefTimer _timer; \ + _timer.Start(); \ + for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) { #define PERF_ITERATIONS_END_EX(result) \ - } \ - _timer.Stop(); \ - result = _timer.Delta(); \ - } + } \ + _timer.Stop(); \ + result = _timer.Delta(); \ + } // Perform test iterations and return the timing result. #define PERF_ITERATIONS_START() \ - int64 _result = 0; \ - PERF_ITERATIONS_START_EX() + int64 _result = 0; \ + PERF_ITERATIONS_START_EX() -#define PERF_ITERATIONS_END() \ - PERF_ITERATIONS_END_EX(_result) \ - return _result; +#define PERF_ITERATIONS_END() \ + PERF_ITERATIONS_END_EX(_result) \ + return _result; // Perf test entry structure. struct PerfTestEntry { diff --git a/tests/cefclient/renderer/performance_test_tests.cc b/tests/cefclient/renderer/performance_test_tests.cc index 3f76b78f6..59476a3ec 100644 --- a/tests/cefclient/renderer/performance_test_tests.cc +++ b/tests/cefclient/renderer/performance_test_tests.cc @@ -93,7 +93,9 @@ PERF_TEST_FUNC(V8FunctionCreate) { CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) OVERRIDE { return false; } + CefString& exception) OVERRIDE { + return false; + } IMPLEMENT_REFCOUNTING(Handler); }; @@ -113,7 +115,9 @@ PERF_TEST_FUNC(V8FunctionExecute) { CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) OVERRIDE { return true; } + CefString& exception) OVERRIDE { + return true; + } IMPLEMENT_REFCOUNTING(Handler); }; @@ -136,7 +140,9 @@ PERF_TEST_FUNC(V8FunctionExecuteWithContext) { CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) OVERRIDE { return true; } + CefString& exception) OVERRIDE { + return true; + } IMPLEMENT_REFCOUNTING(Handler); }; @@ -218,8 +224,7 @@ PERF_TEST_FUNC(V8ObjectCreateWithInterceptor) { CefRefPtr interceptor = new Interceptor(); PERF_ITERATIONS_START() - CefRefPtr value = CefV8Value::CreateObject(NULL, - interceptor); + CefRefPtr value = CefV8Value::CreateObject(NULL, interceptor); PERF_ITERATIONS_END() } @@ -335,32 +340,31 @@ PERF_TEST_FUNC(V8ContextEval) { } // namespace - // Test function entries. const PerfTestEntry kPerfTests[] = { - PERF_TEST_ENTRY(V8NullCreate), - PERF_TEST_ENTRY(V8BoolCreate), - PERF_TEST_ENTRY(V8IntCreate), - PERF_TEST_ENTRY(V8UIntCreate), - PERF_TEST_ENTRY(V8DoubleCreate), - PERF_TEST_ENTRY(V8DateCreate), - PERF_TEST_ENTRY(V8StringCreate), - PERF_TEST_ENTRY(V8ArrayCreate), - PERF_TEST_ENTRY(V8ArraySetValue), - PERF_TEST_ENTRY(V8ArrayGetValue), - PERF_TEST_ENTRY(V8FunctionCreate), - PERF_TEST_ENTRY(V8FunctionExecute), - PERF_TEST_ENTRY(V8FunctionExecuteWithContext), - PERF_TEST_ENTRY(V8ObjectCreate), - PERF_TEST_ENTRY(V8ObjectCreateWithAccessor), - PERF_TEST_ENTRY(V8ObjectCreateWithInterceptor), - PERF_TEST_ENTRY(V8ObjectSetValue), - PERF_TEST_ENTRY(V8ObjectGetValue), - PERF_TEST_ENTRY(V8ObjectSetValueWithAccessor), - PERF_TEST_ENTRY(V8ObjectGetValueWithAccessor), - PERF_TEST_ENTRY(V8ContextEnterExit), - PERF_TEST_ENTRY(V8ContextEval), + PERF_TEST_ENTRY(V8NullCreate), + PERF_TEST_ENTRY(V8BoolCreate), + PERF_TEST_ENTRY(V8IntCreate), + PERF_TEST_ENTRY(V8UIntCreate), + PERF_TEST_ENTRY(V8DoubleCreate), + PERF_TEST_ENTRY(V8DateCreate), + PERF_TEST_ENTRY(V8StringCreate), + PERF_TEST_ENTRY(V8ArrayCreate), + PERF_TEST_ENTRY(V8ArraySetValue), + PERF_TEST_ENTRY(V8ArrayGetValue), + PERF_TEST_ENTRY(V8FunctionCreate), + PERF_TEST_ENTRY(V8FunctionExecute), + PERF_TEST_ENTRY(V8FunctionExecuteWithContext), + PERF_TEST_ENTRY(V8ObjectCreate), + PERF_TEST_ENTRY(V8ObjectCreateWithAccessor), + PERF_TEST_ENTRY(V8ObjectCreateWithInterceptor), + PERF_TEST_ENTRY(V8ObjectSetValue), + PERF_TEST_ENTRY(V8ObjectGetValue), + PERF_TEST_ENTRY(V8ObjectSetValueWithAccessor), + PERF_TEST_ENTRY(V8ObjectGetValueWithAccessor), + PERF_TEST_ENTRY(V8ContextEnterExit), + PERF_TEST_ENTRY(V8ContextEval), }; const int kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0])); diff --git a/tests/cefsimple/cefsimple_linux.cc b/tests/cefsimple/cefsimple_linux.cc index ca1654f8f..41774defb 100644 --- a/tests/cefsimple/cefsimple_linux.cc +++ b/tests/cefsimple/cefsimple_linux.cc @@ -10,29 +10,28 @@ namespace { -int XErrorHandlerImpl(Display *display, XErrorEvent *event) { - LOG(WARNING) - << "X error received: " - << "type " << event->type << ", " - << "serial " << event->serial << ", " - << "error_code " << static_cast(event->error_code) << ", " - << "request_code " << static_cast(event->request_code) << ", " - << "minor_code " << static_cast(event->minor_code); +int XErrorHandlerImpl(Display* display, XErrorEvent* event) { + LOG(WARNING) << "X error received: " + << "type " << event->type << ", " + << "serial " << event->serial << ", " + << "error_code " << static_cast(event->error_code) << ", " + << "request_code " << static_cast(event->request_code) + << ", " + << "minor_code " << static_cast(event->minor_code); return 0; } -int XIOErrorHandlerImpl(Display *display) { +int XIOErrorHandlerImpl(Display* display) { return 0; } } // namespace - // Entry point function for all processes. int main(int argc, char* argv[]) { // Provide CEF with command-line arguments. CefMainArgs main_args(argc, argv); - + // CEF applications have multiple sub-processes (render, plugin, GPU, etc) // that share the same executable. This function checks the command-line and, // if this is a sub-process, executes the appropriate logic. diff --git a/tests/cefsimple/cefsimple_mac.mm b/tests/cefsimple/cefsimple_mac.mm index e9c10cc1c..57d597638 100644 --- a/tests/cefsimple/cefsimple_mac.mm +++ b/tests/cefsimple/cefsimple_mac.mm @@ -5,10 +5,10 @@ #import -#include "tests/cefsimple/simple_app.h" -#include "tests/cefsimple/simple_handler.h" #include "include/cef_application_mac.h" #include "include/wrapper/cef_helpers.h" +#include "tests/cefsimple/simple_app.h" +#include "tests/cefsimple/simple_handler.h" // Receives notifications from the application. @interface SimpleAppDelegate : NSObject @@ -18,7 +18,7 @@ // Provide the CefAppProtocol implementation required by CEF. @interface SimpleApplication : NSApplication { -@private + @private BOOL handlingSendEvent_; } @end @@ -102,12 +102,11 @@ } - (NSApplicationTerminateReply)applicationShouldTerminate: - (NSApplication *)sender { + (NSApplication*)sender { return NSTerminateNow; } @end - // Entry point function for the browser process. int main(int argc, char* argv[]) { // Provide CEF with command-line arguments. @@ -129,7 +128,7 @@ int main(int argc, char* argv[]) { // Initialize CEF for the browser process. CefInitialize(main_args, settings, app.get(), NULL); - + // Create the application delegate. NSObject* delegate = [[SimpleAppDelegate alloc] init]; [delegate performSelectorOnMainThread:@selector(createApplication:) diff --git a/tests/cefsimple/cefsimple_win.cc b/tests/cefsimple/cefsimple_win.cc index 1d0de68ab..a5ba95c43 100644 --- a/tests/cefsimple/cefsimple_win.cc +++ b/tests/cefsimple/cefsimple_win.cc @@ -4,9 +4,8 @@ #include -#include "tests/cefsimple/simple_app.h" #include "include/cef_sandbox_win.h" - +#include "tests/cefsimple/simple_app.h" // When generating projects with CMake the CEF_USE_SANDBOX value will be defined // automatically if using the required compiler version. Pass -DUSE_SANDBOX=OFF @@ -20,12 +19,11 @@ #pragma comment(lib, "cef_sandbox.lib") #endif - // Entry point function for all processes. int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) { + LPTSTR lpCmdLine, + int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); diff --git a/tests/cefsimple/resource.h b/tests/cefsimple/resource.h index 19093ded4..ba1f3a9e0 100644 --- a/tests/cefsimple/resource.h +++ b/tests/cefsimple/resource.h @@ -7,20 +7,20 @@ // Used by cefsimple.rc // -#define IDI_CEFSIMPLE 100 -#define IDI_SMALL 101 +#define IDI_CEFSIMPLE 100 +#define IDI_SMALL 101 // Avoid files associated with MacOS #define _X86_ // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 32700 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 102 +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 32700 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 102 #endif #endif diff --git a/tests/cefsimple/simple_app.cc b/tests/cefsimple/simple_app.cc index 24e2ead10..5b0a7ef54 100644 --- a/tests/cefsimple/simple_app.cc +++ b/tests/cefsimple/simple_app.cc @@ -6,12 +6,12 @@ #include -#include "tests/cefsimple/simple_handler.h" #include "include/cef_browser.h" #include "include/cef_command_line.h" #include "include/views/cef_browser_view.h" #include "include/views/cef_window.h" #include "include/wrapper/cef_helpers.h" +#include "tests/cefsimple/simple_handler.h" namespace { @@ -20,8 +20,7 @@ namespace { class SimpleWindowDelegate : public CefWindowDelegate { public: explicit SimpleWindowDelegate(CefRefPtr browser_view) - : browser_view_(browser_view) { - } + : browser_view_(browser_view) {} void OnWindowCreated(CefRefPtr window) OVERRIDE { // Add the browser view and show the window. @@ -53,8 +52,7 @@ class SimpleWindowDelegate : public CefWindowDelegate { } // namespace -SimpleApp::SimpleApp() { -} +SimpleApp::SimpleApp() {} void SimpleApp::OnContextInitialized() { CEF_REQUIRE_UI_THREAD(); diff --git a/tests/cefsimple/simple_app.h b/tests/cefsimple/simple_app.h index c40b9cc68..8ed996960 100644 --- a/tests/cefsimple/simple_app.h +++ b/tests/cefsimple/simple_app.h @@ -8,14 +8,15 @@ #include "include/cef_app.h" // Implement application-level callbacks for the browser process. -class SimpleApp : public CefApp, - public CefBrowserProcessHandler { +class SimpleApp : public CefApp, public CefBrowserProcessHandler { public: SimpleApp(); // CefApp methods: virtual CefRefPtr GetBrowserProcessHandler() - OVERRIDE { return this; } + OVERRIDE { + return this; + } // CefBrowserProcessHandler methods: virtual void OnContextInitialized() OVERRIDE; diff --git a/tests/cefsimple/simple_handler.cc b/tests/cefsimple/simple_handler.cc index 0280bf515..1029904ae 100644 --- a/tests/cefsimple/simple_handler.cc +++ b/tests/cefsimple/simple_handler.cc @@ -21,8 +21,7 @@ SimpleHandler* g_instance = NULL; } // namespace SimpleHandler::SimpleHandler(bool use_views) - : use_views_(use_views), - is_closing_(false) { + : use_views_(use_views), is_closing_(false) { DCHECK(!g_instance); g_instance = this; } @@ -110,17 +109,17 @@ void SimpleHandler::OnLoadError(CefRefPtr browser, // Display a load error message. std::stringstream ss; ss << "" - "

    Failed to load URL " << std::string(failedUrl) << - " with error " << std::string(errorText) << " (" << errorCode << - ").

    "; + "

    Failed to load URL " + << std::string(failedUrl) << " with error " << std::string(errorText) + << " (" << errorCode << ").

    "; frame->LoadString(ss.str(), failedUrl); } void SimpleHandler::CloseAllBrowsers(bool force_close) { if (!CefCurrentlyOn(TID_UI)) { // Execute on the UI thread. - CefPostTask(TID_UI, - base::Bind(&SimpleHandler::CloseAllBrowsers, this, force_close)); + CefPostTask(TID_UI, base::Bind(&SimpleHandler::CloseAllBrowsers, this, + force_close)); return; } diff --git a/tests/cefsimple/simple_handler.h b/tests/cefsimple/simple_handler.h index 8ddaedba7..10194f06d 100644 --- a/tests/cefsimple/simple_handler.h +++ b/tests/cefsimple/simple_handler.h @@ -27,9 +27,7 @@ class SimpleHandler : public CefClient, virtual CefRefPtr GetLifeSpanHandler() OVERRIDE { return this; } - virtual CefRefPtr GetLoadHandler() OVERRIDE { - return this; - } + virtual CefRefPtr GetLoadHandler() OVERRIDE { return this; } // CefDisplayHandler methods: virtual void OnTitleChange(CefRefPtr browser, @@ -61,7 +59,7 @@ class SimpleHandler : public CefClient, const bool use_views_; // List of existing browser windows. Only accessed on the CEF UI thread. - typedef std::list > BrowserList; + typedef std::list> BrowserList; BrowserList browser_list_; bool is_closing_; diff --git a/tests/cefsimple/simple_handler_linux.cc b/tests/cefsimple/simple_handler_linux.cc index 25adea79d..c4b677e68 100644 --- a/tests/cefsimple/simple_handler_linux.cc +++ b/tests/cefsimple/simple_handler_linux.cc @@ -24,23 +24,15 @@ void SimpleHandler::PlatformTitleChange(CefRefPtr browser, DCHECK(window != kNullWindowHandle); // Retrieve the atoms required by the below XChangeProperty call. - const char* kAtoms[] = { - "_NET_WM_NAME", - "UTF8_STRING" - }; + const char* kAtoms[] = {"_NET_WM_NAME", "UTF8_STRING"}; Atom atoms[2]; - int result = XInternAtoms(display, const_cast(kAtoms), 2, false, - atoms); + int result = + XInternAtoms(display, const_cast(kAtoms), 2, false, atoms); if (!result) NOTREACHED(); // Set the window title. - XChangeProperty(display, - window, - atoms[0], - atoms[1], - 8, - PropModeReplace, + XChangeProperty(display, window, atoms[0], atoms[1], 8, PropModeReplace, reinterpret_cast(titleStr.c_str()), titleStr.size()); @@ -50,4 +42,3 @@ void SimpleHandler::PlatformTitleChange(CefRefPtr browser, // fallback to the UTF8 property above. XStoreName(display, browser->GetHost()->GetWindowHandle(), titleStr.c_str()); } - diff --git a/tests/cefsimple/simple_handler_win.cc b/tests/cefsimple/simple_handler_win.cc index 3577663de..23f05333e 100644 --- a/tests/cefsimple/simple_handler_win.cc +++ b/tests/cefsimple/simple_handler_win.cc @@ -4,8 +4,8 @@ #include "tests/cefsimple/simple_handler.h" -#include #include +#include #include "include/cef_browser.h" diff --git a/tests/ceftests/accessibility_unittest.cc b/tests/ceftests/accessibility_unittest.cc index fb5c50a9b..ec30b716e 100644 --- a/tests/ceftests/accessibility_unittest.cc +++ b/tests/ceftests/accessibility_unittest.cc @@ -11,7 +11,6 @@ #include "tests/ceftests/test_util.h" #include "tests/gtest/include/gtest/gtest.h" - namespace { const char kTestUrl[] = "https://tests/AccessibilityTestHandler"; @@ -39,18 +38,13 @@ class AccessibilityTestHandler : public TestHandler, public CefAccessibilityHandler { public: AccessibilityTestHandler(const AccessibilityTestType& type) - : test_type_(type), - edit_box_id_(-1), - accessibility_disabled_(false) { - } + : test_type_(type), edit_box_id_(-1), accessibility_disabled_(false) {} CefRefPtr GetAccessibilityHandler() override { return this; } - CefRefPtr GetRenderHandler() OVERRIDE { - return this; - } + CefRefPtr GetRenderHandler() OVERRIDE { return this; } // Cef Renderer Handler Methods bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE { @@ -59,18 +53,18 @@ class AccessibilityTestHandler : public TestHandler, } bool GetScreenInfo(CefRefPtr browser, - CefScreenInfo& screen_info) override { - screen_info.rect = CefRect(0, 0, kOsrWidth, kOsrHeight); - screen_info.available_rect = screen_info.rect; - return true; + CefScreenInfo& screen_info) override { + screen_info.rect = CefRect(0, 0, kOsrWidth, kOsrHeight); + screen_info.available_rect = screen_info.rect; + return true; } void OnPaint(CefRefPtr browser, - CefRenderHandler::PaintElementType type, - const CefRenderHandler::RectList& dirtyRects, - const void* buffer, - int width, - int height) OVERRIDE { + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const void* buffer, + int width, + int height) OVERRIDE { // Do nothing. } @@ -97,7 +91,8 @@ class AccessibilityTestHandler : public TestHandler, ""; html += kTipText; - html += "" + html += + "" ""; @@ -115,16 +110,18 @@ class AccessibilityTestHandler : public TestHandler, int httpStatusCode) override { // Enable Accessibility browser->GetHost()->SetAccessibilityState(STATE_ENABLED); - switch(test_type_) { + switch (test_type_) { case TEST_ENABLE_ACCESSIBILITY: { // This should trigger OnAccessibilityTreeChange // And update will be validated } break; case TEST_DISABLE_ACCESSIBILITY: { // Post a delayed task to disable Accessibility - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::DisableAccessibility, - this, browser), 200); + CefPostDelayedTask( + TID_UI, + base::Bind(&AccessibilityTestHandler::DisableAccessibility, this, + browser), + 200); } break; // Delayed task will posted later after we have initial details case TEST_FOCUS_CHANGE: { @@ -135,7 +132,7 @@ class AccessibilityTestHandler : public TestHandler, } void OnAccessibilityTreeChange(CefRefPtr value) OVERRIDE { - switch(test_type_) { + switch (test_type_) { case TEST_ENABLE_ACCESSIBILITY: { TestEnableAccessibilityUpdate(value); } break; @@ -164,7 +161,8 @@ class AccessibilityTestHandler : public TestHandler, // Post a delayed task to hide the span and trigger location change CefPostDelayedTask(TID_UI, base::Bind(&AccessibilityTestHandler::HideEditBox, - this, GetBrowser()), 200); + this, GetBrowser()), + 200); } } break; case TEST_FOCUS_CHANGE: { @@ -186,9 +184,11 @@ class AccessibilityTestHandler : public TestHandler, SetEditBoxIdAndRect(dict->GetDictionary("update")); EXPECT_TRUE(edit_box_id_ != -1); - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::SetFocusOnEditBox, - this, GetBrowser()), 200); + CefPostDelayedTask( + TID_UI, + base::Bind(&AccessibilityTestHandler::SetFocusOnEditBox, this, + GetBrowser()), + 200); } else { EXPECT_TRUE(value.get()); // Change has a valid non empty list @@ -205,13 +205,13 @@ class AccessibilityTestHandler : public TestHandler, dict->GetString("event_type").ToString().c_str()); // And Focus is set to expected element edit_box - EXPECT_TRUE(edit_box_id_ == dict->GetInt("id") ); + EXPECT_TRUE(edit_box_id_ == dict->GetInt("id")); // Now Post a delayed task to destroy the test giving // sufficient time for any accessibility updates to come through - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::DestroyTest, - this), 500); + CefPostDelayedTask( + TID_UI, base::Bind(&AccessibilityTestHandler::DestroyTest, this), + 500); } } break; } @@ -252,9 +252,9 @@ class AccessibilityTestHandler : public TestHandler, // Now Post a delayed task to destroy the test // giving sufficient time for any accessibility updates to come through - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::DestroyTest, - this), 500); + CefPostDelayedTask( + TID_UI, base::Bind(&AccessibilityTestHandler::DestroyTest, this), + 500); } } @@ -263,8 +263,8 @@ class AccessibilityTestHandler : public TestHandler, // Set focus on edit box // This should trigger Location update if enabled browser->GetMainFrame()->ExecuteJavaScript( - "document.getElementById('editbox').style.display = 'none';", - kTestUrl, 0); + "document.getElementById('editbox').style.display = 'none';", kTestUrl, + 0); } void SetFocusOnEditBox(CefRefPtr browser) { @@ -282,9 +282,8 @@ class AccessibilityTestHandler : public TestHandler, // Now Post a delayed task to destroy the test // giving sufficient time for any accessibility updates to come through - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::DestroyTest, - this), 500); + CefPostDelayedTask( + TID_UI, base::Bind(&AccessibilityTestHandler::DestroyTest, this), 500); } void TestEnableAccessibilityUpdate(CefRefPtr value) { @@ -304,8 +303,7 @@ class AccessibilityTestHandler : public TestHandler, CefRefPtr update = dict->GetDictionary("update"); EXPECT_TRUE(update.get()); EXPECT_TRUE(update->GetBool("has_tree_data")); - CefRefPtr treeData = - update->GetDictionary("tree_data"); + CefRefPtr treeData = update->GetDictionary("tree_data"); // Validate title and Url EXPECT_STREQ("AccessibilityTest", @@ -319,7 +317,7 @@ class AccessibilityTestHandler : public TestHandler, // Update has a valid root CefRefPtr root; - for(size_t index = 0; indexGetSize(); index++) { + for (size_t index = 0; index < nodes->GetSize(); index++) { CefRefPtr node = nodes->GetDictionary(index); if (node->GetString("role").ToString() == "rootWebArea") { root = node; @@ -335,7 +333,7 @@ class AccessibilityTestHandler : public TestHandler, // A parent Group div containing the child. CefRefPtr group; - for(size_t index = 0; indexGetSize(); index++) { + for (size_t index = 0; index < nodes->GetSize(); index++) { CefRefPtr node = nodes->GetDictionary(index); if (node->GetString("role").ToString() == "group") { group = node; @@ -356,7 +354,7 @@ class AccessibilityTestHandler : public TestHandler, // A parent Group div containing the child. CefRefPtr tip, editbox, button; - for(size_t index = 0; indexGetSize(); index++) { + for (size_t index = 0; index < nodes->GetSize(); index++) { CefRefPtr node = nodes->GetDictionary(index); if (node->GetInt("id") == tipId) { tip = node; @@ -373,14 +371,12 @@ class AccessibilityTestHandler : public TestHandler, // Validate tooltip color property is Red. CefRefPtr tipattr = tip->GetDictionary("attributes"); EXPECT_TRUE(tipattr.get()); - EXPECT_STREQ("0xFFFF0000", - tipattr->GetString("color").ToString().c_str()); + EXPECT_STREQ("0xFFFF0000", tipattr->GetString("color").ToString().c_str()); EXPECT_TRUE(editbox.get()); - EXPECT_STREQ("textField", - editbox->GetString("role").ToString().c_str()); + EXPECT_STREQ("textField", editbox->GetString("role").ToString().c_str()); CefRefPtr editattr = - editbox->GetDictionary("attributes"); + editbox->GetDictionary("attributes"); // Validate ARIA Description tags for tipIdare associated with editbox. EXPECT_TRUE(editattr.get()); EXPECT_EQ(tipId, editattr->GetList("describedbyIds")->GetInt(0)); @@ -392,9 +388,8 @@ class AccessibilityTestHandler : public TestHandler, // Now Post a delayed task to destroy the test // giving sufficient time for any accessibility updates to come through - CefPostDelayedTask(TID_UI, - base::Bind(&AccessibilityTestHandler::DestroyTest, - this), 500); + CefPostDelayedTask( + TID_UI, base::Bind(&AccessibilityTestHandler::DestroyTest, this), 500); } // Find Edit box Id in accessibility tree. @@ -406,7 +401,7 @@ class AccessibilityTestHandler : public TestHandler, EXPECT_GT(nodes->GetSize(), (size_t)0); // Find accessibility id for the text field. - for(size_t index = 0; indexGetSize(); index++) { + for (size_t index = 0; index < nodes->GetSize(); index++) { CefRefPtr node = nodes->GetDictionary(index); if (node->GetString("role").ToString() == "textField") { edit_box_id_ = node->GetInt("id"); @@ -441,7 +436,7 @@ TEST(AccessibilityTest, EnableAccessibility) { TEST(AccessibilityTest, DisableAccessibility) { CefRefPtr handler = - new AccessibilityTestHandler(TEST_DISABLE_ACCESSIBILITY); + new AccessibilityTestHandler(TEST_DISABLE_ACCESSIBILITY); handler->ExecuteTest(); EXPECT_TRUE(true); ReleaseAndWaitForDestructor(handler); @@ -449,7 +444,7 @@ TEST(AccessibilityTest, DisableAccessibility) { TEST(AccessibilityTest, FocusChange) { CefRefPtr handler = - new AccessibilityTestHandler(TEST_FOCUS_CHANGE); + new AccessibilityTestHandler(TEST_FOCUS_CHANGE); handler->ExecuteTest(); EXPECT_TRUE(true); ReleaseAndWaitForDestructor(handler); @@ -457,7 +452,7 @@ TEST(AccessibilityTest, FocusChange) { TEST(AccessibilityTest, LocationChange) { CefRefPtr handler = - new AccessibilityTestHandler(TEST_LOCATION_CHANGE); + new AccessibilityTestHandler(TEST_LOCATION_CHANGE); handler->ExecuteTest(); EXPECT_TRUE(true); ReleaseAndWaitForDestructor(handler); diff --git a/tests/ceftests/browser_info_map_unittest.cc b/tests/ceftests/browser_info_map_unittest.cc index f29b9ae4f..1f5d88b2b 100644 --- a/tests/ceftests/browser_info_map_unittest.cc +++ b/tests/ceftests/browser_info_map_unittest.cc @@ -17,9 +17,7 @@ struct MyObject { int g_destruct_ct = 0; struct MyObjectTraits { - static void Destruct(MyObject info) { - g_destruct_ct++; - } + static void Destruct(MyObject info) { g_destruct_ct++; } }; typedef CefBrowserInfoMap MyObjectMap; @@ -45,16 +43,14 @@ class MyVisitor : public MyObjectMap::Visitor { // Based on test configuration remove no objects, all objects, or only the // specified object. - *remove = remove_ || (browser_id == remove_browser_id_ && - info_id == remove_info_id_); + *remove = remove_ || + (browser_id == remove_browser_id_ && info_id == remove_info_id_); return true; } // Returns true if the specified info was passed to OnNextInfo. Removes the // record if found. - bool Exists(int browser_id, - InfoIdType info_id, - InfoObjectType info) { + bool Exists(int browser_id, InfoIdType info_id, InfoObjectType info) { InfoList::iterator it = info_list_.begin(); for (; it != info_list_.end(); ++it) { const Info& found_info = *it; @@ -680,15 +676,12 @@ TEST(BrowserInfoMapTest, FindAllAndRemoveOneByBrowser) { EXPECT_EQ(3, g_destruct_ct); } - namespace { class MyHeapObject { public: MyHeapObject(int* destroy_ct) : destroy_ct_(destroy_ct) {} - ~MyHeapObject() { - (*destroy_ct_)++; - } + ~MyHeapObject() { (*destroy_ct_)++; } private: int* destroy_ct_; diff --git a/tests/ceftests/client_app_delegates.cc b/tests/ceftests/client_app_delegates.cc index c818925ce..782bc1598 100644 --- a/tests/ceftests/client_app_delegates.cc +++ b/tests/ceftests/client_app_delegates.cc @@ -10,116 +10,112 @@ using client::ClientAppRenderer; void CreateBrowserDelegates(ClientAppBrowser::DelegateSet& delegates) { // Bring in the Frame tests. - extern void CreateFrameBrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreateFrameBrowserTests(ClientAppBrowser::DelegateSet & + delegates); CreateFrameBrowserTests(delegates); // Bring in the Navigation tests. - extern void CreateNavigationBrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreateNavigationBrowserTests(ClientAppBrowser::DelegateSet & + delegates); CreateNavigationBrowserTests(delegates); // Bring in the plugin tests. - extern void CreatePluginBrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreatePluginBrowserTests(ClientAppBrowser::DelegateSet & + delegates); CreatePluginBrowserTests(delegates); // Bring in the preference tests. - extern void CreatePreferenceBrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreatePreferenceBrowserTests(ClientAppBrowser::DelegateSet & + delegates); CreatePreferenceBrowserTests(delegates); // Bring in the RequestHandler tests. - extern void CreateRequestHandlerBrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreateRequestHandlerBrowserTests(ClientAppBrowser::DelegateSet & + delegates); CreateRequestHandlerBrowserTests(delegates); // Bring in the V8 tests. - extern void CreateV8BrowserTests( - ClientAppBrowser::DelegateSet& delegates); + extern void CreateV8BrowserTests(ClientAppBrowser::DelegateSet & delegates); CreateV8BrowserTests(delegates); } void CreateRenderDelegates(ClientAppRenderer::DelegateSet& delegates) { // Bring in the Frame tests. - extern void CreateFrameRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateFrameRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateFrameRendererTests(delegates); // Bring in the DOM tests. - extern void CreateDOMRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateDOMRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateDOMRendererTests(delegates); // Bring in the message router tests. - extern void CreateMessageRouterRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateMessageRouterRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateMessageRouterRendererTests(delegates); // Bring in the Navigation tests. - extern void CreateNavigationRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateNavigationRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateNavigationRendererTests(delegates); // Bring in the process message tests. - extern void CreateProcessMessageRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateProcessMessageRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateProcessMessageRendererTests(delegates); // Bring in the RequestHandler tests. - extern void CreateRequestHandlerRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateRequestHandlerRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateRequestHandlerRendererTests(delegates); // Bring in the Request tests. - extern void CreateRequestRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateRequestRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateRequestRendererTests(delegates); // Bring in the routing test handler delegate. - extern void CreateRoutingTestHandlerDelegate( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateRoutingTestHandlerDelegate(ClientAppRenderer::DelegateSet & + delegates); CreateRoutingTestHandlerDelegate(delegates); // Bring in the thread tests. - extern void CreateThreadRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateThreadRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateThreadRendererTests(delegates); // Bring in the URLRequest tests. - extern void CreateURLRequestRendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateURLRequestRendererTests(ClientAppRenderer::DelegateSet & + delegates); CreateURLRequestRendererTests(delegates); // Bring in the V8 tests. - extern void CreateV8RendererTests( - ClientAppRenderer::DelegateSet& delegates); + extern void CreateV8RendererTests(ClientAppRenderer::DelegateSet & delegates); CreateV8RendererTests(delegates); } -void RegisterCustomSchemes( - CefRawPtr registrar, - std::vector& cookiable_schemes) { +void RegisterCustomSchemes(CefRawPtr registrar, + std::vector& cookiable_schemes) { // Bring in the scheme handler tests. extern void RegisterSchemeHandlerCustomSchemes( CefRawPtr registrar, - std::vector& cookiable_schemes); + std::vector & cookiable_schemes); RegisterSchemeHandlerCustomSchemes(registrar, cookiable_schemes); // Bring in the cookie tests. extern void RegisterCookieCustomSchemes( CefRawPtr registrar, - std::vector& cookiable_schemes); + std::vector & cookiable_schemes); RegisterCookieCustomSchemes(registrar, cookiable_schemes); // Bring in the URLRequest tests. extern void RegisterURLRequestCustomSchemes( CefRawPtr registrar, - std::vector& cookiable_schemes); + std::vector & cookiable_schemes); RegisterURLRequestCustomSchemes(registrar, cookiable_schemes); } - namespace client { // static @@ -145,4 +141,3 @@ void ClientApp::RegisterCustomSchemes( } } // namespace client - diff --git a/tests/ceftests/command_line_unittest.cc b/tests/ceftests/command_line_unittest.cc index 84ca67fe0..f7c3c374e 100644 --- a/tests/ceftests/command_line_unittest.cc +++ b/tests/ceftests/command_line_unittest.cc @@ -85,18 +85,13 @@ TEST(CommandLineTest, Init) { EXPECT_TRUE(command_line.get() != NULL); #if defined(OS_WIN) - command_line->InitFromString("test.exe --switch1 -switch2=val2 /switch3=val3 " - "-switch4=\"val 4\" arg1 \"arg 2\""); + command_line->InitFromString( + "test.exe --switch1 -switch2=val2 /switch3=val3 " + "-switch4=\"val 4\" arg1 \"arg 2\""); #else - const char* args[] = { - "test.exe", - "--switch1", - "-switch2=val2", - "-switch3=val3", - "-switch4=val 4", - "arg1", - "arg 2" - }; + const char* args[] = {"test.exe", "--switch1", "-switch2=val2", + "-switch3=val3", "-switch4=val 4", "arg1", + "arg 2"}; command_line->InitFromArgv(sizeof(args) / sizeof(char*), args); #endif diff --git a/tests/ceftests/cookie_unittest.cc b/tests/ceftests/cookie_unittest.cc index dcd78b7dc..e85672056 100644 --- a/tests/ceftests/cookie_unittest.cc +++ b/tests/ceftests/cookie_unittest.cc @@ -31,11 +31,9 @@ typedef std::vector CookieVector; class TestCompletionCallback : public CefCompletionCallback { public: explicit TestCompletionCallback(CefRefPtr event) - : event_(event) {} + : event_(event) {} - void OnComplete() override { - event_->Signal(); - } + void OnComplete() override { event_->Signal(); } private: CefRefPtr event_; @@ -47,9 +45,8 @@ class TestCompletionCallback : public CefCompletionCallback { class TestSetCookieCallback : public CefSetCookieCallback { public: TestSetCookieCallback(bool expected_success, - CefRefPtr event) - : expected_success_(expected_success), - event_(event) {} + CefRefPtr event) + : expected_success_(expected_success), event_(event) {} void OnComplete(bool success) override { EXPECT_EQ(expected_success_, success); @@ -68,8 +65,7 @@ class TestDeleteCookiesCallback : public CefDeleteCookiesCallback { public: TestDeleteCookiesCallback(int expected_num_deleted, CefRefPtr event) - : expected_num_deleted_(expected_num_deleted), - event_(event) {} + : expected_num_deleted_(expected_num_deleted), event_(event) {} void OnComplete(int num_deleted) override { if (expected_num_deleted_ != kIgnoreNumDeleted) @@ -87,17 +83,15 @@ class TestDeleteCookiesCallback : public CefDeleteCookiesCallback { class TestVisitor : public CefCookieVisitor { public: - TestVisitor(CookieVector* cookies, bool deleteCookies, + TestVisitor(CookieVector* cookies, + bool deleteCookies, CefRefPtr event) - : cookies_(cookies), - delete_cookies_(deleteCookies), - event_(event) { - } - ~TestVisitor() override { - event_->Signal(); - } + : cookies_(cookies), delete_cookies_(deleteCookies), event_(event) {} + ~TestVisitor() override { event_->Signal(); } - bool Visit(const CefCookie& cookie, int count, int total, + bool Visit(const CefCookie& cookie, + int count, + int total, bool& deleteCookie) override { cookies_->push_back(cookie); if (delete_cookies_) @@ -114,7 +108,8 @@ class TestVisitor : public CefCookieVisitor { // Set the cookies. void SetCookies(CefRefPtr manager, - const CefString& url, const CookieVector& cookies, + const CefString& url, + const CookieVector& cookies, bool expected_success, CefRefPtr event) { CookieVector::const_iterator it = cookies.begin(); @@ -127,7 +122,8 @@ void SetCookies(CefRefPtr manager, // Delete the cookie. void DeleteCookies(CefRefPtr manager, - const CefString& url, const CefString& cookie_name, + const CefString& url, + const CefString& cookie_name, int expected_num_deleted, CefRefPtr event) { EXPECT_TRUE(manager->DeleteCookies( @@ -139,7 +135,8 @@ void DeleteCookies(CefRefPtr manager, // Create a test cookie. If |withDomain| is true a domain cookie will be // created, otherwise a host cookie will be created. void CreateCookie(CefRefPtr manager, - CefCookie& cookie, bool withDomain, + CefCookie& cookie, + bool withDomain, bool sessionCookie, CefRefPtr event) { CefString(&cookie.name).FromASCII("my_cookie"); @@ -165,13 +162,15 @@ void CreateCookie(CefRefPtr manager, // is a domain cookie, otherwise a host cookie. if |deleteCookies| is true // the cookie will be deleted when it's retrieved. void GetCookie(CefRefPtr manager, - const CefCookie& cookie, bool withDomain, - CefRefPtr event, bool deleteCookies) { + const CefCookie& cookie, + bool withDomain, + CefRefPtr event, + bool deleteCookies) { CookieVector cookies; // Get the cookie and delete it. - EXPECT_TRUE(manager->VisitUrlCookies(kTestUrl, false, - new TestVisitor(&cookies, deleteCookies, event))); + EXPECT_TRUE(manager->VisitUrlCookies( + kTestUrl, false, new TestVisitor(&cookies, deleteCookies, event))); event->Wait(); EXPECT_EQ(1U, cookies.size()); @@ -204,8 +203,8 @@ void VisitUrlCookies(CefRefPtr manager, CookieVector& cookies, bool deleteCookies, CefRefPtr event) { - EXPECT_TRUE(manager->VisitUrlCookies(url, includeHttpOnly, - new TestVisitor(&cookies, deleteCookies, event))); + EXPECT_TRUE(manager->VisitUrlCookies( + url, includeHttpOnly, new TestVisitor(&cookies, deleteCookies, event))); event->Wait(); } @@ -222,16 +221,17 @@ void VisitAllCookies(CefRefPtr manager, // Verify that no cookies exist. If |withUrl| is true it will only check for // cookies matching the URL. void VerifyNoCookies(CefRefPtr manager, - CefRefPtr event, bool withUrl) { + CefRefPtr event, + bool withUrl) { CookieVector cookies; // Verify that the cookie has been deleted. if (withUrl) { - EXPECT_TRUE(manager->VisitUrlCookies(kTestUrl, false, - new TestVisitor(&cookies, false, event))); + EXPECT_TRUE(manager->VisitUrlCookies( + kTestUrl, false, new TestVisitor(&cookies, false, event))); } else { - EXPECT_TRUE(manager->VisitAllCookies( - new TestVisitor(&cookies, false, event))); + EXPECT_TRUE( + manager->VisitAllCookies(new TestVisitor(&cookies, false, event))); } event->Wait(); @@ -387,7 +387,7 @@ void TestAllCookies(CefRefPtr manager, CefString(&cookie1.value).FromASCII("My Value 1"); cookies.push_back(cookie1); - SetCookies(manager, kUrl1, cookies, true, event); + SetCookies(manager, kUrl1, cookies, true, event); cookies.clear(); CefCookie cookie2; @@ -396,7 +396,7 @@ void TestAllCookies(CefRefPtr manager, CefString(&cookie2.value).FromASCII("My Value 2"); cookies.push_back(cookie2); - SetCookies(manager, kUrl2, cookies, true, event); + SetCookies(manager, kUrl2, cookies, true, event); cookies.clear(); // Verify that all system cookies can be retrieved. @@ -517,9 +517,8 @@ TEST(CookieTest, DomainCookieInMemory) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(CefString(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + CefString(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -536,9 +535,8 @@ TEST(CookieTest, DomainCookieOnDisk) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -568,9 +566,8 @@ TEST(CookieTest, HostCookieInMemory) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(CefString(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + CefString(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -587,9 +584,8 @@ TEST(CookieTest, HostCookieOnDisk) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -619,9 +615,8 @@ TEST(CookieTest, MultipleCookiesInMemory) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(CefString(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + CefString(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -638,9 +633,8 @@ TEST(CookieTest, MultipleCookiesOnDisk) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -668,9 +662,8 @@ TEST(CookieTest, AllCookiesInMemory) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(CefString(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + CefString(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -686,9 +679,8 @@ TEST(CookieTest, AllCookiesOnDisk) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -719,9 +711,8 @@ TEST(CookieTest, ChangeDirectoryCreated) { CefRefPtr event = CefWaitableEvent::CreateWaitableEvent(true, false); - CefRefPtr manager = - CefCookieManager::CreateManager(CefString(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + CefString(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -737,9 +728,8 @@ TEST(CookieTest, SessionCookieNoPersist) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), false, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), false, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -752,7 +742,7 @@ TEST(CookieTest, SessionCookieNoPersist) { // Flush the cookie store to disk. manager->FlushStore(new TestCompletionCallback(event)); event->Wait(); - + // Create a new manager to read the same cookie store. manager = CefCookieManager::CreateManager(temp_dir.GetPath(), false, new TestCompletionCallback(event)); @@ -772,9 +762,8 @@ TEST(CookieTest, SessionCookieWillPersist) { // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); - CefRefPtr manager = - CefCookieManager::CreateManager(temp_dir.GetPath(), true, - new TestCompletionCallback(event)); + CefRefPtr manager = CefCookieManager::CreateManager( + temp_dir.GetPath(), true, new TestCompletionCallback(event)); event->Wait(); EXPECT_TRUE(manager.get()); @@ -787,7 +776,7 @@ TEST(CookieTest, SessionCookieWillPersist) { // Flush the cookie store to disk. manager->FlushStore(new TestCompletionCallback(event)); event->Wait(); - + // Create a new manager to read the same cookie store. manager = CefCookieManager::CreateManager(temp_dir.GetPath(), true, new TestCompletionCallback(event)); @@ -798,7 +787,6 @@ TEST(CookieTest, SessionCookieWillPersist) { GetCookie(manager, cookie, true, event, false); } - namespace { const char* kCookieJSUrl1 = "http://tests/cookie1.html"; @@ -826,13 +814,9 @@ class CookieTestJSHandler : public TestHandler { } } - void SetURL(const std::string& url) { - url_ = url; - } + void SetURL(const std::string& url) { url_ = url; } - void Detach() { - handler_ = NULL; - } + void Detach() { handler_ = NULL; } private: std::string url_; @@ -883,7 +867,7 @@ class CookieTestJSHandler : public TestHandler { void LoadNextURL(CefRefPtr frame) { if (!CefCurrentlyOn(TID_UI)) { CefPostTask(TID_UI, - base::Bind(&CookieTestJSHandler::LoadNextURL, this, frame)); + base::Bind(&CookieTestJSHandler::LoadNextURL, this, frame)); return; } @@ -893,8 +877,7 @@ class CookieTestJSHandler : public TestHandler { void CompleteTest() { if (!CefCurrentlyOn(TID_UI)) { - CefPostTask(TID_UI, - base::Bind(&CookieTestJSHandler::CompleteTest, this)); + CefPostTask(TID_UI, base::Bind(&CookieTestJSHandler::CompleteTest, this)); return; } @@ -908,11 +891,11 @@ class CookieTestJSHandler : public TestHandler { if (url == kCookieJSUrl1) { got_load_end1_.yes(); VerifyCookie(manager1_, url, "name1", "value1", &got_cookie1_, - base::Bind(&CookieTestJSHandler::LoadNextURL, this, frame)); + base::Bind(&CookieTestJSHandler::LoadNextURL, this, frame)); } else { got_load_end2_.yes(); VerifyCookie(manager2_, url, "name2", "value2", &got_cookie2_, - base::Bind(&CookieTestJSHandler::CompleteTest, this)); + base::Bind(&CookieTestJSHandler::CompleteTest, this)); } } @@ -932,9 +915,9 @@ class CookieTestJSHandler : public TestHandler { const base::Closure& continue_callback) { if (!CefCurrentlyOn(TID_FILE)) { CefPostTask(TID_FILE, - base::Bind(&CookieTestJSHandler::VerifyCookie, this, manager, url, - name, value, base::Unretained(callback), - continue_callback)); + base::Bind(&CookieTestJSHandler::VerifyCookie, this, manager, + url, name, value, base::Unretained(callback), + continue_callback)); return; } @@ -985,7 +968,6 @@ TEST(CookieTest, GetCookieManagerJS) { ReleaseAndWaitForDestructor(handler); } - namespace { class CookieTestSchemeHandler : public TestHandler { @@ -993,8 +975,7 @@ class CookieTestSchemeHandler : public TestHandler { class SchemeHandler : public CefResourceHandler { public: explicit SchemeHandler(CookieTestSchemeHandler* handler) - : handler_(handler), - offset_(0) {} + : handler_(handler), offset_(0) {} bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override { @@ -1017,7 +998,6 @@ class CookieTestSchemeHandler : public TestHandler { CefRequest::HeaderMap::iterator it = headerMap.find("Cookie"); if (it != headerMap.end() && it->second == "name2=value2") handler_->got_process_request_cookie_.yes(); - } callback->Continue(); return true; @@ -1060,8 +1040,7 @@ class CookieTestSchemeHandler : public TestHandler { return has_data; } - void Cancel() override { - } + void Cancel() override {} private: CookieTestSchemeHandler* handler_; @@ -1091,7 +1070,7 @@ class CookieTestSchemeHandler : public TestHandler { if (it != headerMap.end() && it->second == "name2=value2") handler_->got_create_cookie_.yes(); } - + return new SchemeHandler(handler_); } @@ -1121,13 +1100,9 @@ class CookieTestSchemeHandler : public TestHandler { } } - void SetURL(const std::string& url) { - url_ = url; - } + void SetURL(const std::string& url) { url_ = url; } - void Detach() { - handler_ = NULL; - } + void Detach() { handler_ = NULL; } private: std::string url_; @@ -1164,8 +1139,8 @@ class CookieTestSchemeHandler : public TestHandler { CefRequestContext::CreateContext(settings, context_handler_.get()); // Register the scheme handler. - request_context->RegisterSchemeHandlerFactory(scheme_, "cookie-tests", - new SchemeHandlerFactory(this)); + request_context->RegisterSchemeHandlerFactory( + scheme_, "cookie-tests", new SchemeHandlerFactory(this)); // Create the browser. CreateBrowser(url1_, request_context); @@ -1177,8 +1152,8 @@ class CookieTestSchemeHandler : public TestHandler { // Go to the next URL. void LoadNextURL(CefRefPtr frame, const std::string& url) { if (!CefCurrentlyOn(TID_UI)) { - CefPostTask(TID_UI, - base::Bind(&CookieTestSchemeHandler::LoadNextURL, this, frame, url)); + CefPostTask(TID_UI, base::Bind(&CookieTestSchemeHandler::LoadNextURL, + this, frame, url)); return; } @@ -1188,8 +1163,8 @@ class CookieTestSchemeHandler : public TestHandler { void CompleteTest(CefRefPtr browser) { if (!CefCurrentlyOn(TID_UI)) { - CefPostTask(TID_UI, - base::Bind(&CookieTestSchemeHandler::CompleteTest, this, browser)); + CefPostTask(TID_UI, base::Bind(&CookieTestSchemeHandler::CompleteTest, + this, browser)); return; } @@ -1207,26 +1182,27 @@ class CookieTestSchemeHandler : public TestHandler { if (url == url1_) { got_load_end1_.yes(); VerifyCookie(manager1_, url, "name1", "value1", &got_cookie1_, - base::Bind(&CookieTestSchemeHandler::LoadNextURL, this, frame, - url2_)); + base::Bind(&CookieTestSchemeHandler::LoadNextURL, this, + frame, url2_)); } else if (url == url2_) { got_load_end2_.yes(); VerifyCookie(manager2_, url, "name2", "value2", &got_cookie2_, - base::Bind(&CookieTestSchemeHandler::LoadNextURL, this, frame, - url3_)); + base::Bind(&CookieTestSchemeHandler::LoadNextURL, this, + frame, url3_)); } else { got_load_end3_.yes(); - VerifyCookie(manager2_, url, "name2", "value2", &got_cookie3_, + VerifyCookie( + manager2_, url, "name2", "value2", &got_cookie3_, base::Bind(&CookieTestSchemeHandler::CompleteTest, this, browser)); } } - void DestroyTest() override { - context_handler_->Detach(); - context_handler_ = NULL; + void DestroyTest() override { + context_handler_->Detach(); + context_handler_ = NULL; - TestHandler::DestroyTest(); - } + TestHandler::DestroyTest(); + } // Verify that the cookie was set successfully. void VerifyCookie(CefRefPtr manager, @@ -1237,14 +1213,14 @@ class CookieTestSchemeHandler : public TestHandler { const base::Closure& continue_callback) { if (!CefCurrentlyOn(TID_FILE)) { CefPostTask(TID_FILE, - base::Bind(&CookieTestSchemeHandler::VerifyCookie, this, manager, url, - name, value, base::Unretained(callback), - continue_callback)); + base::Bind(&CookieTestSchemeHandler::VerifyCookie, this, + manager, url, name, value, + base::Unretained(callback), continue_callback)); return; } CefRefPtr event = - CefWaitableEvent::CreateWaitableEvent(true, false); + CefWaitableEvent::CreateWaitableEvent(true, false); CookieVector cookies; // Get the cookie. @@ -1335,9 +1311,8 @@ TEST(CookieTest, GetCookieManagerCustom) { // Entry point for registering custom schemes. // Called from client_app_delegates.cc. -void RegisterCookieCustomSchemes( - CefRawPtr registrar, - std::vector& cookiable_schemes) { +void RegisterCookieCustomSchemes(CefRawPtr registrar, + std::vector& cookiable_schemes) { // Used by GetCookieManagerCustom test. registrar->AddCustomScheme("ccustom", true, false, false, false, true, false); } diff --git a/tests/ceftests/dialog_unittest.cc b/tests/ceftests/dialog_unittest.cc index 64f9841a1..f6d1af711 100644 --- a/tests/ceftests/dialog_unittest.cc +++ b/tests/ceftests/dialog_unittest.cc @@ -16,12 +16,12 @@ class DialogTestHandler : public TestHandler { public: struct TestConfig { explicit TestConfig(FileDialogMode dialog_mode) - : mode(dialog_mode), - title("Test Title"), - default_file_name("Test File Name"), - selected_accept_filter(1), // Something other than 0 for testing. - callback_async(false), - callback_cancel(false) { + : mode(dialog_mode), + title("Test Title"), + default_file_name("Test File Name"), + selected_accept_filter(1), // Something other than 0 for testing. + callback_async(false), + callback_cancel(false) { accept_types.push_back("text/*"); accept_types.push_back(".js"); accept_types.push_back(".css"); @@ -40,9 +40,7 @@ class DialogTestHandler : public TestHandler { class Callback : public CefRunFileDialogCallback { public: - explicit Callback(DialogTestHandler* handler) - : handler_(handler) { - } + explicit Callback(DialogTestHandler* handler) : handler_(handler) {} void OnFileDialogDismissed( int selected_accept_filter, @@ -68,9 +66,7 @@ class DialogTestHandler : public TestHandler { IMPLEMENT_REFCOUNTING(Callback); }; - explicit DialogTestHandler(const TestConfig& config) - : config_(config) { - } + explicit DialogTestHandler(const TestConfig& config) : config_(config) {} void RunTest() override { AddResource(kTestUrl, "TEST", "text/html"); @@ -85,12 +81,10 @@ class DialogTestHandler : public TestHandler { void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) override { - browser->GetHost()->RunFileDialog(config_.mode, - config_.title, - config_.default_file_name, - config_.accept_types, - config_.selected_accept_filter, - new Callback(this)); + browser->GetHost()->RunFileDialog( + config_.mode, config_.title, config_.default_file_name, + config_.accept_types, config_.selected_accept_filter, + new Callback(this)); } void ExecuteCallback(CefRefPtr callback) { @@ -102,14 +96,13 @@ class DialogTestHandler : public TestHandler { } // CefDialogHandler - bool OnFileDialog( - CefRefPtr browser, - FileDialogMode mode, - const CefString& title, - const CefString& default_file_name, - const std::vector& accept_types, - int selected_accept_filter, - CefRefPtr callback) override { + bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_name, + const std::vector& accept_types, + int selected_accept_filter, + CefRefPtr callback) override { got_onfiledialog_.yes(); std::string url = browser->GetMainFrame()->GetURL(); @@ -122,8 +115,8 @@ class DialogTestHandler : public TestHandler { TestStringVectorEqual(config_.accept_types, accept_types); if (config_.callback_async) { - CefPostTask(TID_UI, - base::Bind(&DialogTestHandler::ExecuteCallback, this, callback)); + CefPostTask(TID_UI, base::Bind(&DialogTestHandler::ExecuteCallback, this, + callback)); } else { ExecuteCallback(callback); } @@ -163,10 +156,9 @@ TEST(DialogTest, FileEmptyParams) { } TEST(DialogTest, FileAdditionalFlags) { - DialogTestHandler::TestConfig config( - static_cast(FILE_DIALOG_OPEN | - FILE_DIALOG_HIDEREADONLY_FLAG | - FILE_DIALOG_OVERWRITEPROMPT_FLAG)); + DialogTestHandler::TestConfig config(static_cast( + FILE_DIALOG_OPEN | FILE_DIALOG_HIDEREADONLY_FLAG | + FILE_DIALOG_OVERWRITEPROMPT_FLAG)); config.title.clear(); config.default_file_name.clear(); config.accept_types.clear(); diff --git a/tests/ceftests/display_unittest.cc b/tests/ceftests/display_unittest.cc index a940c61d2..19aea6eba 100644 --- a/tests/ceftests/display_unittest.cc +++ b/tests/ceftests/display_unittest.cc @@ -28,21 +28,20 @@ const char kTitleStr3[] = "Title 3"; class TitleTestHandler : public TestHandler { public: TitleTestHandler() - : step_(0), - got_title_change_(false), - got_loading_state_change_(false) {} + : step_(0), got_title_change_(false), got_loading_state_change_(false) {} void RunTest() override { // Add the resources that we will navigate to/from. AddResource(kTitleUrl1, - "" + std::string(kTitleStr1) + - "Nav1", "text/html"); + "" + std::string(kTitleStr1) + + "Nav1", + "text/html"); AddResource(kTitleUrl2, - "" + std::string(kTitleStr2) + - "Nav2" + - "" + - "", "text/html"); + "" + std::string(kTitleStr2) + + "Nav2" + + "" + "", + "text/html"); // Create the browser. CreateBrowser(kTitleUrl1); @@ -115,7 +114,7 @@ class TitleTestHandler : public TestHandler { browser->GetMainFrame()->ExecuteJavaScript("setTitle()", kTitleUrl2, 0); break; default: - EXPECT_TRUE(false); // Not reached. + EXPECT_TRUE(false); // Not reached. } } diff --git a/tests/ceftests/dom_unittest.cc b/tests/ceftests/dom_unittest.cc index 90fd6200d..ac4cb2422 100644 --- a/tests/ceftests/dom_unittest.cc +++ b/tests/ceftests/dom_unittest.cc @@ -22,9 +22,7 @@ enum DOMTestType { class TestDOMVisitor : public CefDOMVisitor { public: explicit TestDOMVisitor(CefRefPtr browser, DOMTestType test_type) - : browser_(browser), - test_type_(test_type) { - } + : browser_(browser), test_type_(test_type) {} void TestHeadNodeStructure(CefRefPtr headNode) { EXPECT_TRUE(headNode.get()); @@ -186,8 +184,8 @@ class TestDOMVisitor : public CefDOMVisitor { CefRefPtr h1Node = bodyNode->GetFirstChild(); ASSERT_EQ(h1Node->GetAsMarkup(), - "

    Hello From
    " - "Main Frame

    "); + "

    Hello From
    " + "Main Frame

    "); CefRefPtr textNode = h1Node->GetFirstChild(); ASSERT_EQ(textNode->GetValue(), "Hello From"); @@ -200,8 +198,8 @@ class TestDOMVisitor : public CefDOMVisitor { EXPECT_EQ(brNode->GetElementAttribute("class"), "a_different_class"); ASSERT_EQ(h1Node->GetAsMarkup(), - "

    A Different Message From
    Main Frame

    "); + "

    A Different Message From
    Main Frame

    "); ASSERT_FALSE(h1Node->SetValue("Something Different")); } @@ -237,14 +235,12 @@ class TestDOMVisitor : public CefDOMVisitor { // Used in the render process. class DOMRendererTest : public ClientAppRenderer::Delegate { public: - DOMRendererTest() { - } + DOMRendererTest() {} - bool OnProcessMessageReceived( - CefRefPtr app, - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { + bool OnProcessMessageReceived(CefRefPtr app, + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { if (message->GetName() == kTestMessage) { EXPECT_EQ(message->GetArgumentList()->GetSize(), (size_t)1); int test_type = message->GetArgumentList()->GetInt(0); @@ -263,21 +259,19 @@ class DOMRendererTest : public ClientAppRenderer::Delegate { // Used in the browser process. class TestDOMHandler : public TestHandler { public: - explicit TestDOMHandler(DOMTestType test) - : test_type_(test) { - } + explicit TestDOMHandler(DOMTestType test) : test_type_(test) {} void RunTest() override { std::stringstream mainHtml; - mainHtml << - "" - "The Title" - "" - "

    Hello From
    " - "Main Frame

    " - "
    " - "" - ""; + mainHtml << "" + "The Title" + "" + "

    Hello From
    " + "Main Frame

    " + "
    " + "" + ""; AddResource(kTestUrl, mainHtml.str(), "text/html"); CreateBrowser(kTestUrl); @@ -298,12 +292,11 @@ class TestDOMHandler : public TestHandler { } } - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { EXPECT_STREQ(message->GetName().ToString().c_str(), kTestMessage); - + got_message_.yes(); if (message->GetArgumentList()->GetBool(0)) @@ -326,8 +319,7 @@ class TestDOMHandler : public TestHandler { // Test DOM structure reading. TEST(DOMTest, Read) { - CefRefPtr handler = - new TestDOMHandler(DOM_TEST_STRUCTURE); + CefRefPtr handler = new TestDOMHandler(DOM_TEST_STRUCTURE); handler->ExecuteTest(); EXPECT_TRUE(handler->got_message_); @@ -338,8 +330,7 @@ TEST(DOMTest, Read) { // Test DOM modifications. TEST(DOMTest, Modify) { - CefRefPtr handler = - new TestDOMHandler(DOM_TEST_MODIFY); + CefRefPtr handler = new TestDOMHandler(DOM_TEST_MODIFY); handler->ExecuteTest(); EXPECT_TRUE(handler->got_message_); diff --git a/tests/ceftests/download_unittest.cc b/tests/ceftests/download_unittest.cc index 24a3ccd9a..3e1ebc9ca 100644 --- a/tests/ceftests/download_unittest.cc +++ b/tests/ceftests/download_unittest.cc @@ -21,7 +21,7 @@ const char kTestContentDisposition[] = const char kTestMimeType[] = "text/plain"; const char kTestContent[] = "Download test text"; -typedef base::Callback/*callback*/)> DelayCallback; +typedef base::Callback /*callback*/)> DelayCallback; class DownloadSchemeHandler : public CefResourceHandler { public: @@ -45,10 +45,10 @@ class DownloadSchemeHandler : public CefResourceHandler { content_disposition_ = kTestContentDisposition; should_delay_ = true; } else { - EXPECT_TRUE(false); // Not reached. + EXPECT_TRUE(false); // Not reached. return false; } - + callback->Continue(); return true; } @@ -98,8 +98,7 @@ class DownloadSchemeHandler : public CefResourceHandler { return has_data; } - void Cancel() override { - } + void Cancel() override {} private: DelayCallback delay_callback_; @@ -117,14 +116,13 @@ class DownloadSchemeHandlerFactory : public CefSchemeHandlerFactory { public: DownloadSchemeHandlerFactory(const DelayCallback& delay_callback, TrackCallback* got_download_request) - : delay_callback_(delay_callback), - got_download_request_(got_download_request) {} + : delay_callback_(delay_callback), + got_download_request_(got_download_request) {} - CefRefPtr Create( - CefRefPtr browser, - CefRefPtr frame, - const CefString& scheme_name, - CefRefPtr request) override { + CefRefPtr Create(CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) override { return new DownloadSchemeHandler(delay_callback_, got_download_request_); } @@ -143,15 +141,15 @@ class DownloadTestHandler : public TestHandler { PENDING, }; - DownloadTestHandler(TestMode test_mode) - : test_mode_(test_mode) {} + DownloadTestHandler(TestMode test_mode) : test_mode_(test_mode) {} void RunTest() override { DelayCallback delay_callback; if (test_mode_ == NAVIGATED || test_mode_ == PENDING) delay_callback = base::Bind(&DownloadTestHandler::OnDelayCallback, this); - CefRegisterSchemeHandlerFactory("http", kTestDomain, + CefRegisterSchemeHandlerFactory( + "http", kTestDomain, new DownloadSchemeHandlerFactory(delay_callback, &got_download_request_)); @@ -188,8 +186,8 @@ class DownloadTestHandler : public TestHandler { // Callback from the scheme handler when the download request is delayed. void OnDelayCallback(CefRefPtr callback) { if (!CefCurrentlyOn(TID_UI)) { - CefPostTask(TID_UI, - base::Bind(&DownloadTestHandler::OnDelayCallback, this, callback)); + CefPostTask(TID_UI, base::Bind(&DownloadTestHandler::OnDelayCallback, + this, callback)); return; } @@ -239,19 +237,20 @@ class DownloadTestHandler : public TestHandler { download_id_ = download_item->GetId(); EXPECT_LT(0U, download_id_); - + EXPECT_TRUE(download_item->IsValid()); EXPECT_TRUE(download_item->IsInProgress()); EXPECT_FALSE(download_item->IsComplete()); EXPECT_FALSE(download_item->IsCanceled()); - EXPECT_EQ(static_cast(sizeof(kTestContent)-1), - download_item->GetTotalBytes()); + EXPECT_EQ(static_cast(sizeof(kTestContent) - 1), + download_item->GetTotalBytes()); EXPECT_EQ(0UL, download_item->GetFullPath().length()); EXPECT_STREQ(kTestDownloadUrl, download_item->GetURL().ToString().c_str()); EXPECT_EQ(0UL, download_item->GetSuggestedFileName().length()); EXPECT_STREQ(kTestContentDisposition, - download_item->GetContentDisposition().ToString().c_str()); - EXPECT_STREQ(kTestMimeType, download_item->GetMimeType().ToString().c_str()); + download_item->GetContentDisposition().ToString().c_str()); + EXPECT_STREQ(kTestMimeType, + download_item->GetMimeType().ToString().c_str()); callback->Continue(test_path_, false); @@ -261,10 +260,9 @@ class DownloadTestHandler : public TestHandler { ContinuePendingIfReady(); } - void OnDownloadUpdated( - CefRefPtr browser, - CefRefPtr download_item, - CefRefPtr callback) override { + void OnDownloadUpdated(CefRefPtr browser, + CefRefPtr download_item, + CefRefPtr callback) override { EXPECT_TRUE(CefCurrentlyOn(TID_UI)); got_on_download_updated_.yes(); @@ -283,9 +281,9 @@ class DownloadTestHandler : public TestHandler { EXPECT_FALSE(download_item->IsCanceled()); EXPECT_STREQ(kTestDownloadUrl, download_item->GetURL().ToString().c_str()); EXPECT_STREQ(kTestContentDisposition, - download_item->GetContentDisposition().ToString().c_str()); + download_item->GetContentDisposition().ToString().c_str()); EXPECT_STREQ(kTestMimeType, - download_item->GetMimeType().ToString().c_str()); + download_item->GetMimeType().ToString().c_str()); std::string full_path = download_item->GetFullPath(); if (!full_path.empty()) { @@ -298,10 +296,10 @@ class DownloadTestHandler : public TestHandler { EXPECT_FALSE(download_item->IsInProgress()); EXPECT_EQ(100, download_item->GetPercentComplete()); - EXPECT_EQ(static_cast(sizeof(kTestContent)-1), - download_item->GetReceivedBytes()); - EXPECT_EQ(static_cast(sizeof(kTestContent)-1), - download_item->GetTotalBytes()); + EXPECT_EQ(static_cast(sizeof(kTestContent) - 1), + download_item->GetReceivedBytes()); + EXPECT_EQ(static_cast(sizeof(kTestContent) - 1), + download_item->GetTotalBytes()); DestroyTest(); } else { @@ -332,7 +330,8 @@ class DownloadTestHandler : public TestHandler { void DestroyTest() override { if (!temp_dir_.IsEmpty()) { // Clean up temp_dir_ on the FILE thread before destroying the test. - CefPostTask(TID_FILE, + CefPostTask( + TID_FILE, base::Bind(&DownloadTestHandler::VerifyResultsOnFileThread, this)); return; } diff --git a/tests/ceftests/draggable_regions_unittest.cc b/tests/ceftests/draggable_regions_unittest.cc index aedf220fb..1a179453c 100644 --- a/tests/ceftests/draggable_regions_unittest.cc +++ b/tests/ceftests/draggable_regions_unittest.cc @@ -23,8 +23,7 @@ const char kTestHTMLWithRegions[] = ""; const char kTestURLWithoutRegions[] = "http://test.com/no-regions"; -const char kTestHTMLWithoutRegions[] = - "Hello World!"; +const char kTestHTMLWithoutRegions[] = "Hello World!"; const char kTestURLWithChangingRegions[] = "http://test.com/changing-regions"; const char kTestHTMLWithChangingRegions[] = @@ -50,8 +49,7 @@ const char kTestHTMLWithChangingRegions[] = class DraggableRegionsTestHandler : public TestHandler { public: - DraggableRegionsTestHandler() - : step_(kStepWithRegions) {} + DraggableRegionsTestHandler() : step_(kStepWithRegions) {} void RunTest() override { // Add HTML documents with and without draggable regions. @@ -136,8 +134,9 @@ class DraggableRegionsTestHandler : public TestHandler { step_ = kStepWithoutRegions; frame->LoadURL(kTestURLWithoutRegions); // Needed because this test doesn't call OnDraggableRegionsChanged. - CefPostDelayedTask(TID_UI, - base::Bind(&DraggableRegionsTestHandler::DestroyTest, this), 500); + CefPostDelayedTask( + TID_UI, base::Bind(&DraggableRegionsTestHandler::DestroyTest, this), + 500); break; case kStepWithoutRegions: { // Should not be reached. diff --git a/tests/ceftests/file_util.cc b/tests/ceftests/file_util.cc index 1936c148b..bb2e98af7 100644 --- a/tests/ceftests/file_util.cc +++ b/tests/ceftests/file_util.cc @@ -32,7 +32,8 @@ const char kPathSep = '\\'; const char kPathSep = '/'; #endif -bool ReadFileToString(const std::string& path, std::string* contents, +bool ReadFileToString(const std::string& path, + std::string* contents, size_t max_size) { if (!AllowFileIO()) return false; diff --git a/tests/ceftests/file_util.h b/tests/ceftests/file_util.h index 83b4ac127..89d656b67 100644 --- a/tests/ceftests/file_util.h +++ b/tests/ceftests/file_util.h @@ -22,7 +22,8 @@ extern const char kPathSep; // is useful for its side effect of priming the disk cache (could be used for // unit tests). Calling this function on the browser process UI or IO threads is // not allowed. -bool ReadFileToString(const std::string& path, std::string* contents, +bool ReadFileToString(const std::string& path, + std::string* contents, size_t max_size = std::numeric_limits::max()); // Writes the given buffer into the file, overwriting any data that was diff --git a/tests/ceftests/file_util_unittest.cc b/tests/ceftests/file_util_unittest.cc index fe4a34678..463d620bb 100644 --- a/tests/ceftests/file_util_unittest.cc +++ b/tests/ceftests/file_util_unittest.cc @@ -19,15 +19,18 @@ TEST(FileUtil, JoinPath) { // Should always be 1 kPathSep character between paths. EXPECT_STREQ(expected.c_str(), file_util::JoinPath("path1", "path2").c_str()); + EXPECT_STREQ( + expected.c_str(), + file_util::JoinPath(std::string("path1") + file_util::kPathSep, "path2") + .c_str()); + EXPECT_STREQ( + expected.c_str(), + file_util::JoinPath("path1", file_util::kPathSep + std::string("path2")) + .c_str()); EXPECT_STREQ(expected.c_str(), - file_util::JoinPath(std::string("path1") + file_util::kPathSep, - "path2").c_str()); - EXPECT_STREQ(expected.c_str(), - file_util::JoinPath("path1", - file_util::kPathSep + std::string("path2")).c_str()); - EXPECT_STREQ(expected.c_str(), - file_util::JoinPath(std::string("path1") + file_util::kPathSep, - file_util::kPathSep + std::string("path2")).c_str()); + file_util::JoinPath(std::string("path1") + file_util::kPathSep, + file_util::kPathSep + std::string("path2")) + .c_str()); } TEST(FileUtil, WriteAndReadFile) { diff --git a/tests/ceftests/frame_unittest.cc b/tests/ceftests/frame_unittest.cc index faa5e68be..13ed8bb10 100644 --- a/tests/ceftests/frame_unittest.cc +++ b/tests/ceftests/frame_unittest.cc @@ -71,7 +71,7 @@ namespace { // // Run with the `--single-process` command-line flag to see expectation failures // from the renderer process. -// +// // All known factory IDs. enum FrameNavFactoryId { @@ -105,28 +105,31 @@ const int kMaxMultiNavNavigations = 3; bool g_frame_nav_test = false; FrameNavFactoryId g_frame_nav_factory_id = FNF_ID_INVALID; - // Abstract base class representing expectations that result from a navigation. class FrameNavExpectations { public: typedef base::Callback)> CompletionCallback; FrameNavExpectations(int nav, bool renderer) - : nav_(nav), - renderer_(renderer) { - } + : nav_(nav), renderer_(renderer) {} virtual ~FrameNavExpectations() {} // Browser and renderer notifications. virtual bool OnLoadingStateChange(CefRefPtr browser, - bool isLoading) { return true; } + bool isLoading) { + return true; + } virtual bool OnLoadStart(CefRefPtr browser, - CefRefPtr frame) { return true; } + CefRefPtr frame) { + return true; + } virtual bool OnLoadEnd(CefRefPtr browser, - CefRefPtr frame) { return true; } + CefRefPtr frame) { + return true; + } // Final expectations check before this object is deleted. - virtual bool Finalize() =0; + virtual bool Finalize() = 0; // Signal that all expectations are completed. Should be called as a result of // notifications. @@ -134,7 +137,7 @@ class FrameNavExpectations { if (!completion_callback_.is_null()) { // Execute the callback asynchronously to avoid any issues with what's // currently on the stack. - CefPostTask((renderer_ ? TID_RENDERER: TID_UI), + CefPostTask((renderer_ ? TID_RENDERER : TID_UI), base::Bind(completion_callback_, browser)); completion_callback_.Reset(); } @@ -164,12 +167,11 @@ class FrameNavExpectations { class FrameNavExpectationsBrowser : public FrameNavExpectations { public: explicit FrameNavExpectationsBrowser(int nav) - : FrameNavExpectations(nav, false) { - } + : FrameNavExpectations(nav, false) {} // Loading information. - virtual std::string GetMainURL() =0; - virtual std::string GetContentForURL(const std::string& url) =0; + virtual std::string GetMainURL() = 0; + virtual std::string GetContentForURL(const std::string& url) = 0; // Browser-only notifications. virtual bool OnAfterCreated(CefRefPtr browser) { @@ -194,22 +196,22 @@ class FrameNavExpectationsBrowser : public FrameNavExpectations { // Called when the renderer signals completion. virtual bool OnRendererComplete(CefRefPtr browser, int renderer_nav, - bool renderer_result) =0; + bool renderer_result) = 0; }; // Renderer process expectations abstract base class. class FrameNavExpectationsRenderer : public FrameNavExpectations { public: explicit FrameNavExpectationsRenderer(int nav) - : FrameNavExpectations(nav, true) { - } + : FrameNavExpectations(nav, true) {} // Renderer-only notifications. virtual bool OnBeforeNavigation(CefRefPtr browser, - CefRefPtr frame) { return true; } + CefRefPtr frame) { + return true; + } }; - // Abstract base class for the factory that creates expectations objects. class FrameNavExpectationsFactory { public: @@ -217,7 +219,7 @@ class FrameNavExpectationsFactory { virtual ~FrameNavExpectationsFactory() {} // Returns the unique ID for this factory type. - virtual FrameNavFactoryId GetID() const =0; + virtual FrameNavFactoryId GetID() const = 0; }; // Browser process expectations factory abstact base class. @@ -226,15 +228,15 @@ class FrameNavExpectationsFactoryBrowser : public FrameNavExpectationsFactory { FrameNavExpectationsFactoryBrowser() {} // Create a new factory instance of the specified type. - static scoped_ptr - FromID(FrameNavFactoryId id); + static scoped_ptr FromID( + FrameNavFactoryId id); // Returns true if there will be more navigations in the browser process // handler. - virtual bool HasMoreNavigations() const =0; + virtual bool HasMoreNavigations() const = 0; // Verify final expectations results. - virtual bool Finalize() =0; + virtual bool Finalize() = 0; scoped_ptr Create( int nav, @@ -247,7 +249,7 @@ class FrameNavExpectationsFactoryBrowser : public FrameNavExpectationsFactory { protected: // Implement in the test-specific factory instance. - virtual scoped_ptr Create(int nav) =0; + virtual scoped_ptr Create(int nav) = 0; }; // Renderer process expectations factory abstact base class. @@ -256,8 +258,8 @@ class FrameNavExpectationsFactoryRenderer : public FrameNavExpectationsFactory { FrameNavExpectationsFactoryRenderer() {} // Create a new factory instance of the specified type. - static scoped_ptr - FromID(FrameNavFactoryId id); + static scoped_ptr FromID( + FrameNavFactoryId id); scoped_ptr Create( int nav, @@ -270,10 +272,9 @@ class FrameNavExpectationsFactoryRenderer : public FrameNavExpectationsFactory { protected: // Implement in the test-specific factory instance. - virtual scoped_ptr Create(int nav) =0; + virtual scoped_ptr Create(int nav) = 0; }; - // Browser side app delegate. class FrameNavBrowserTest : public ClientAppBrowser::Delegate { public: @@ -301,13 +302,10 @@ class FrameNavBrowserTest : public ClientAppBrowser::Delegate { class FrameNavRendererTest : public ClientAppRenderer::Delegate, public CefLoadHandler { public: - FrameNavRendererTest() - : run_test_(false), - nav_(0) {} + FrameNavRendererTest() : run_test_(false), nav_(0) {} - void OnRenderThreadCreated( - CefRefPtr app, - CefRefPtr extra_info) override { + void OnRenderThreadCreated(CefRefPtr app, + CefRefPtr extra_info) override { // The g_* values will be set when running in single-process mode. if (!g_frame_nav_test) { // Check that the test should be run. @@ -325,8 +323,9 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate, CefCommandLine::GetGlobalCommandLine(); if (command_line->HasSwitch(kTestFactoryIdArg)) { factory_id = static_cast( - atoi(command_line->GetSwitchValue( - kTestFactoryIdArg).ToString().c_str())); + atoi(command_line->GetSwitchValue(kTestFactoryIdArg) + .ToString() + .c_str())); if (factory_id == FNF_ID_INVALID) return; } @@ -344,13 +343,13 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate, return this; } - void OnLoadingStateChange(CefRefPtr browser, - bool isLoading, - bool canGoBack, - bool canGoForward) override { + void OnLoadingStateChange(CefRefPtr browser, + bool isLoading, + bool canGoBack, + bool canGoForward) override { CreateExpectationsIfNecessary(); - EXPECT_TRUE(expectations_->OnLoadingStateChange(browser, isLoading)) << - "isLoading = " << isLoading << ", nav = " << nav_; + EXPECT_TRUE(expectations_->OnLoadingStateChange(browser, isLoading)) + << "isLoading = " << isLoading << ", nav = " << nav_; } void OnLoadStart(CefRefPtr browser, @@ -377,8 +376,8 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate, return false; CreateExpectationsIfNecessary(); - EXPECT_TRUE(expectations_->OnBeforeNavigation(browser, frame)) << - "nav = " << nav_; + EXPECT_TRUE(expectations_->OnBeforeNavigation(browser, frame)) + << "nav = " << nav_; return false; } @@ -389,8 +388,7 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate, if (expectations_) return; expectations_ = factory_->Create( - nav_, - base::Bind(&FrameNavRendererTest::SendTestResults, this)); + nav_, base::Bind(&FrameNavRendererTest::SendTestResults, this)); } // Send the test results. @@ -444,8 +442,7 @@ class FrameNavTestHandler : public TestHandler { void RunTest() override { // Create the first expectations object. expectations_ = factory_->Create( - nav_, - base::Bind(&FrameNavTestHandler::RunNextNav, this)); + nav_, base::Bind(&FrameNavTestHandler::RunNextNav, this)); // Create the browser with the initial URL. CreateBrowser(expectations_->GetMainURL()); @@ -471,8 +468,7 @@ class FrameNavTestHandler : public TestHandler { // Create the next expectations object. expectations_ = factory_->Create( - nav_, - base::Bind(&FrameNavTestHandler::RunNextNav, this)); + nav_, base::Bind(&FrameNavTestHandler::RunNextNav, this)); // Load the main URL. browser->GetMainFrame()->LoadURL(expectations_->GetMainURL()); @@ -488,18 +484,17 @@ class FrameNavTestHandler : public TestHandler { CefRefPtr browser, CefRefPtr frame, CefRefPtr request) override { - EXPECT_TRUE(expectations_->GetResourceHandler(browser, frame)) << - "nav = " << nav_; + EXPECT_TRUE(expectations_->GetResourceHandler(browser, frame)) + << "nav = " << nav_; const std::string& url = request->GetURL(); const std::string& content = expectations_->GetContentForURL(url); EXPECT_TRUE(!content.empty()) << "nav = " << nav_; - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(content.c_str())), - content.length()); - return new CefStreamResourceHandler("text/html", stream); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(content.c_str())), + content.length()); + return new CefStreamResourceHandler("text/html", stream); } bool OnBeforeBrowse(CefRefPtr browser, @@ -507,8 +502,8 @@ class FrameNavTestHandler : public TestHandler { CefRefPtr request, bool is_redirect) override { EXPECT_TRUE( - expectations_->OnBeforeBrowse(browser, frame, request->GetURL())) << - "nav = " << nav_; + expectations_->OnBeforeBrowse(browser, frame, request->GetURL())) + << "nav = " << nav_; return false; } @@ -517,8 +512,9 @@ class FrameNavTestHandler : public TestHandler { bool isLoading, bool canGoBack, bool canGoForward) override { - EXPECT_TRUE(expectations_->OnLoadingStateChange(browser, isLoading)) << - "isLoading = " << isLoading << ", nav = " << nav_;; + EXPECT_TRUE(expectations_->OnLoadingStateChange(browser, isLoading)) + << "isLoading = " << isLoading << ", nav = " << nav_; + ; } void OnLoadStart(CefRefPtr browser, @@ -533,17 +529,17 @@ class FrameNavTestHandler : public TestHandler { EXPECT_TRUE(expectations_->OnLoadEnd(browser, frame)) << "nav = " << nav_; } - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { if (message->GetName().ToString() == kFrameNavMsg) { // Test that the renderer side succeeded. CefRefPtr args = message->GetArgumentList(); EXPECT_TRUE(args.get()); - - EXPECT_TRUE(expectations_->OnRendererComplete(browser, - args->GetInt(0), args->GetBool(1))) << "nav = " << nav_; + + EXPECT_TRUE(expectations_->OnRendererComplete(browser, args->GetInt(0), + args->GetBool(1))) + << "nav = " << nav_; return true; } @@ -575,29 +571,27 @@ class FrameNavTestHandler : public TestHandler { }; // Helper for defining frame tests. -#define FRAME_TEST(name, factory_id) \ - TEST(FrameTest, name) { \ - CefRefPtr handler = \ - new FrameNavTestHandler(factory_id); \ - handler->ExecuteTest(); \ - ReleaseAndWaitForDestructor(handler); \ - } - +#define FRAME_TEST(name, factory_id) \ + TEST(FrameTest, name) { \ + CefRefPtr handler = \ + new FrameNavTestHandler(factory_id); \ + handler->ExecuteTest(); \ + ReleaseAndWaitForDestructor(handler); \ + } // Browser process expectations for a single navigation. -class FrameNavExpectationsBrowserSingleNav : - public FrameNavExpectationsBrowser { +class FrameNavExpectationsBrowserSingleNav + : public FrameNavExpectationsBrowser { public: explicit FrameNavExpectationsBrowserSingleNav(int nav) - : FrameNavExpectationsBrowser(nav) { - } + : FrameNavExpectationsBrowser(nav) {} ~FrameNavExpectationsBrowserSingleNav() override { EXPECT_TRUE(got_finalize_); } bool OnLoadingStateChange(CefRefPtr browser, - bool isLoading) override { + bool isLoading) override { if (isLoading) { EXPECT_FALSE(got_loading_state_change_start_); got_loading_state_change_start_.yes(); @@ -691,12 +685,11 @@ class FrameNavExpectationsBrowserSingleNav : }; // Renderer process expectations for a single navigation. -class FrameNavExpectationsRendererSingleNav : - public FrameNavExpectationsRenderer { +class FrameNavExpectationsRendererSingleNav + : public FrameNavExpectationsRenderer { public: explicit FrameNavExpectationsRendererSingleNav(int nav) - : FrameNavExpectationsRenderer(nav) { - } + : FrameNavExpectationsRenderer(nav) {} ~FrameNavExpectationsRendererSingleNav() override { EXPECT_TRUE(got_finalize_); @@ -766,14 +759,13 @@ class FrameNavExpectationsRendererSingleNav : }; // Test that the single nav harness works. -class FrameNavExpectationsBrowserTestSingleNavHarness : - public FrameNavExpectationsBrowserSingleNav { +class FrameNavExpectationsBrowserTestSingleNavHarness + : public FrameNavExpectationsBrowserSingleNav { public: typedef FrameNavExpectationsBrowserSingleNav parent; explicit FrameNavExpectationsBrowserTestSingleNavHarness(int nav) - : parent(nav) { - } + : parent(nav) {} ~FrameNavExpectationsBrowserTestSingleNavHarness() override { EXPECT_TRUE(got_finalize_); @@ -809,14 +801,13 @@ class FrameNavExpectationsBrowserTestSingleNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsRendererTestSingleNavHarness : - public FrameNavExpectationsRendererSingleNav { +class FrameNavExpectationsRendererTestSingleNavHarness + : public FrameNavExpectationsRendererSingleNav { public: typedef FrameNavExpectationsRendererSingleNav parent; explicit FrameNavExpectationsRendererTestSingleNavHarness(int nav) - : parent(nav) { - } + : parent(nav) {} ~FrameNavExpectationsRendererTestSingleNavHarness() override { EXPECT_TRUE(got_finalize_); @@ -832,8 +823,8 @@ class FrameNavExpectationsRendererTestSingleNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsFactoryBrowserTestSingleNavHarness : - public FrameNavExpectationsFactoryBrowser { +class FrameNavExpectationsFactoryBrowserTestSingleNavHarness + : public FrameNavExpectationsFactoryBrowser { public: FrameNavExpectationsFactoryBrowserTestSingleNavHarness() {} @@ -841,9 +832,7 @@ class FrameNavExpectationsFactoryBrowserTestSingleNavHarness : EXPECT_TRUE(got_finalize_); } - FrameNavFactoryId GetID() const override { - return FNF_ID_SINGLE_NAV_HARNESS; - } + FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV_HARNESS; } bool HasMoreNavigations() const override { EXPECT_FALSE(got_get_browser_navigation_count_); @@ -875,14 +864,12 @@ class FrameNavExpectationsFactoryBrowserTestSingleNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsFactoryRendererTestSingleNavHarness : - public FrameNavExpectationsFactoryRenderer { +class FrameNavExpectationsFactoryRendererTestSingleNavHarness + : public FrameNavExpectationsFactoryRenderer { public: FrameNavExpectationsFactoryRendererTestSingleNavHarness() {} - FrameNavFactoryId GetID() const override { - return FNF_ID_SINGLE_NAV_HARNESS; - } + FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV_HARNESS; } protected: scoped_ptr Create(int nav) override { @@ -896,7 +883,6 @@ class FrameNavExpectationsFactoryRendererTestSingleNavHarness : // Test that the single nav harness works. FRAME_TEST(SingleNavHarness, FNF_ID_SINGLE_NAV_HARNESS) - namespace { bool VerifySingleBrowserFrame(CefRefPtr browser, @@ -920,8 +906,8 @@ bool VerifySingleBrowserFrame(CefRefPtr browser, frame->GetBrowser()->GetIdentifier()); const std::string& frame_url = frame->GetURL(); - V_EXPECT_TRUE(frame_url == expected_url) << "frame_url = " << frame_url << - ", expected_url = " << expected_url; + V_EXPECT_TRUE(frame_url == expected_url) + << "frame_url = " << frame_url << ", expected_url = " << expected_url; V_RETURN(); } @@ -935,8 +921,8 @@ bool VerifySingleBrowserFrames(CefRefPtr browser, // |frame| may be NULL for callbacks that don't specify one. if (frame.get()) { - V_EXPECT_TRUE(VerifySingleBrowserFrame(browser, frame, - frame_should_exist, expected_url)); + V_EXPECT_TRUE(VerifySingleBrowserFrame(browser, frame, frame_should_exist, + expected_url)); } CefRefPtr main_frame = browser->GetMainFrame(); @@ -974,18 +960,14 @@ bool VerifySingleBrowserFrames(CefRefPtr browser, } // Test that single navigation works. -class FrameNavExpectationsBrowserTestSingleNav : - public FrameNavExpectationsBrowserSingleNav { +class FrameNavExpectationsBrowserTestSingleNav + : public FrameNavExpectationsBrowserSingleNav { public: typedef FrameNavExpectationsBrowserSingleNav parent; - explicit FrameNavExpectationsBrowserTestSingleNav(int nav) - : parent(nav) { - } + explicit FrameNavExpectationsBrowserTestSingleNav(int nav) : parent(nav) {} - std::string GetMainURL() override { - return kFrameNavOrigin0; - } + std::string GetMainURL() override { return kFrameNavOrigin0; } std::string GetContentForURL(const std::string& url) override { return "Nav"; @@ -996,11 +978,11 @@ class FrameNavExpectationsBrowserTestSingleNav : V_DECLARE(); if (isLoading) { // No frame exists before the first load. - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, false, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, false, std::string())); } else { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, kFrameNavOrigin0)); } V_EXPECT_TRUE(parent::OnLoadingStateChange(browser, isLoading)); V_RETURN(); @@ -1009,8 +991,8 @@ class FrameNavExpectationsBrowserTestSingleNav : bool OnLoadStart(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, kFrameNavOrigin0)); V_EXPECT_TRUE(parent::OnLoadStart(browser, frame)); V_RETURN(); } @@ -1018,16 +1000,16 @@ class FrameNavExpectationsBrowserTestSingleNav : bool OnLoadEnd(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, kFrameNavOrigin0)); V_EXPECT_TRUE(parent::OnLoadEnd(browser, frame)); V_RETURN(); } bool OnAfterCreated(CefRefPtr browser) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, false, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, false, std::string())); V_EXPECT_TRUE(parent::OnAfterCreated(browser)); V_RETURN(); } @@ -1036,8 +1018,8 @@ class FrameNavExpectationsBrowserTestSingleNav : CefRefPtr frame, const std::string& url) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, std::string())); V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame, url)); V_RETURN(); } @@ -1045,8 +1027,8 @@ class FrameNavExpectationsBrowserTestSingleNav : bool GetResourceHandler(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, std::string())); V_EXPECT_TRUE(parent::GetResourceHandler(browser, frame)); V_RETURN(); } @@ -1057,30 +1039,26 @@ class FrameNavExpectationsBrowserTestSingleNav : return parent::OnRendererComplete(browser, renderer_nav, renderer_result); } - bool Finalize() override { - return parent::Finalize(); - } + bool Finalize() override { return parent::Finalize(); } }; -class FrameNavExpectationsRendererTestSingleNav : - public FrameNavExpectationsRendererSingleNav { +class FrameNavExpectationsRendererTestSingleNav + : public FrameNavExpectationsRendererSingleNav { public: typedef FrameNavExpectationsRendererSingleNav parent; - explicit FrameNavExpectationsRendererTestSingleNav(int nav) - : parent(nav) { - } + explicit FrameNavExpectationsRendererTestSingleNav(int nav) : parent(nav) {} bool OnLoadingStateChange(CefRefPtr browser, bool isLoading) override { V_DECLARE(); // A frame should always exist in the renderer process. if (isLoading) { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, std::string())); } else { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, kFrameNavOrigin0)); } V_EXPECT_TRUE(parent::OnLoadingStateChange(browser, isLoading)); V_RETURN(); @@ -1089,8 +1067,8 @@ class FrameNavExpectationsRendererTestSingleNav : bool OnLoadStart(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, kFrameNavOrigin0)); V_EXPECT_TRUE(parent::OnLoadStart(browser, frame)); V_RETURN(); } @@ -1098,33 +1076,25 @@ class FrameNavExpectationsRendererTestSingleNav : bool OnLoadEnd(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - kFrameNavOrigin0)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, kFrameNavOrigin0)); V_EXPECT_TRUE(parent::OnLoadEnd(browser, frame)); V_RETURN(); } - bool Finalize() override { - return parent::Finalize(); - } + bool Finalize() override { return parent::Finalize(); } }; -class FrameNavExpectationsFactoryBrowserTestSingleNav : - public FrameNavExpectationsFactoryBrowser { +class FrameNavExpectationsFactoryBrowserTestSingleNav + : public FrameNavExpectationsFactoryBrowser { public: FrameNavExpectationsFactoryBrowserTestSingleNav() {} - FrameNavFactoryId GetID() const override { - return FNF_ID_SINGLE_NAV; - } + FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV; } - bool HasMoreNavigations() const override { - return false; - } + bool HasMoreNavigations() const override { return false; } - bool Finalize() override { - return true; - } + bool Finalize() override { return true; } protected: scoped_ptr Create(int nav) override { @@ -1133,14 +1103,12 @@ class FrameNavExpectationsFactoryBrowserTestSingleNav : } }; -class FrameNavExpectationsFactoryRendererTestSingleNav : - public FrameNavExpectationsFactoryRenderer { +class FrameNavExpectationsFactoryRendererTestSingleNav + : public FrameNavExpectationsFactoryRenderer { public: FrameNavExpectationsFactoryRendererTestSingleNav() {} - FrameNavFactoryId GetID() const override { - return FNF_ID_SINGLE_NAV; - } + FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV; } protected: scoped_ptr Create(int nav) override { @@ -1154,23 +1122,20 @@ class FrameNavExpectationsFactoryRendererTestSingleNav : // Test that single navigation works. FRAME_TEST(SingleNav, FNF_ID_SINGLE_NAV) - namespace { // Browser process expectations for a multiple navigations. -class FrameNavExpectationsBrowserMultiNav : - public FrameNavExpectationsBrowser { +class FrameNavExpectationsBrowserMultiNav : public FrameNavExpectationsBrowser { public: explicit FrameNavExpectationsBrowserMultiNav(int nav) - : FrameNavExpectationsBrowser(nav) { - } + : FrameNavExpectationsBrowser(nav) {} ~FrameNavExpectationsBrowserMultiNav() override { EXPECT_TRUE(got_finalize_); } // Returns true if all navigation is done. - virtual bool IsNavigationDone() const =0; + virtual bool IsNavigationDone() const = 0; bool OnLoadingStateChange(CefRefPtr browser, bool isLoading) override { @@ -1212,19 +1177,18 @@ class FrameNavExpectationsBrowserMultiNav : }; // Renderer process expectations for a multiple navigations. -class FrameNavExpectationsRendererMultiNav : - public FrameNavExpectationsRenderer { +class FrameNavExpectationsRendererMultiNav + : public FrameNavExpectationsRenderer { public: explicit FrameNavExpectationsRendererMultiNav(int nav) - : FrameNavExpectationsRenderer(nav) { - } + : FrameNavExpectationsRenderer(nav) {} ~FrameNavExpectationsRendererMultiNav() override { EXPECT_TRUE(got_finalize_); } // Returns true if all navigation is done. - virtual bool IsNavigationDone() const =0; + virtual bool IsNavigationDone() const = 0; bool OnLoadingStateChange(CefRefPtr browser, bool isLoading) override { @@ -1257,7 +1221,6 @@ class FrameNavExpectationsRendererMultiNav : TrackCallback got_finalize_; }; - // Create a URL containing the nav number. std::string GetMultiNavURL(const std::string& origin, int nav) { std::stringstream ss; @@ -1282,15 +1245,13 @@ std::string GetOriginFromMultiNavURL(const std::string& url) { } // Test that the multi nav harness works. -class FrameNavExpectationsBrowserTestMultiNavHarness : - public FrameNavExpectationsBrowserMultiNav { +class FrameNavExpectationsBrowserTestMultiNavHarness + : public FrameNavExpectationsBrowserMultiNav { public: typedef FrameNavExpectationsBrowserMultiNav parent; explicit FrameNavExpectationsBrowserTestMultiNavHarness(int nav) - : parent(nav), - navigation_done_count_(0) { - } + : parent(nav), navigation_done_count_(0) {} ~FrameNavExpectationsBrowserTestMultiNavHarness() override { EXPECT_TRUE(got_finalize_); @@ -1377,15 +1338,13 @@ class FrameNavExpectationsBrowserTestMultiNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsRendererTestMultiNavHarness : - public FrameNavExpectationsRendererMultiNav { +class FrameNavExpectationsRendererTestMultiNavHarness + : public FrameNavExpectationsRendererMultiNav { public: typedef FrameNavExpectationsRendererMultiNav parent; explicit FrameNavExpectationsRendererTestMultiNavHarness(int nav) - : parent(nav), - navigation_done_count_(0) { - } + : parent(nav), navigation_done_count_(0) {} ~FrameNavExpectationsRendererTestMultiNavHarness() override { EXPECT_TRUE(got_finalize_); @@ -1431,20 +1390,17 @@ class FrameNavExpectationsRendererTestMultiNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsFactoryBrowserTestMultiNavHarness : - public FrameNavExpectationsFactoryBrowser { +class FrameNavExpectationsFactoryBrowserTestMultiNavHarness + : public FrameNavExpectationsFactoryBrowser { public: FrameNavExpectationsFactoryBrowserTestMultiNavHarness() - : get_browser_navigation_count_(0), - create_count_(0) {} + : get_browser_navigation_count_(0), create_count_(0) {} ~FrameNavExpectationsFactoryBrowserTestMultiNavHarness() override { EXPECT_TRUE(got_finalize_); } - FrameNavFactoryId GetID() const override { - return FNF_ID_MULTI_NAV_HARNESS; - } + FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV_HARNESS; } bool HasMoreNavigations() const override { get_browser_navigation_count_++; @@ -1474,14 +1430,12 @@ class FrameNavExpectationsFactoryBrowserTestMultiNavHarness : TrackCallback got_finalize_; }; -class FrameNavExpectationsFactoryRendererTestMultiNavHarness : - public FrameNavExpectationsFactoryRenderer { +class FrameNavExpectationsFactoryRendererTestMultiNavHarness + : public FrameNavExpectationsFactoryRenderer { public: FrameNavExpectationsFactoryRendererTestMultiNavHarness() {} - FrameNavFactoryId GetID() const override { - return FNF_ID_MULTI_NAV_HARNESS; - } + FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV_HARNESS; } protected: scoped_ptr Create(int nav) override { @@ -1495,18 +1449,15 @@ class FrameNavExpectationsFactoryRendererTestMultiNavHarness : // Test that the multiple nav harness works. FRAME_TEST(MultiNavHarness, FNF_ID_MULTI_NAV_HARNESS) - namespace { // Test that multiple navigation works. -class FrameNavExpectationsBrowserTestMultiNav : - public FrameNavExpectationsBrowserMultiNav { +class FrameNavExpectationsBrowserTestMultiNav + : public FrameNavExpectationsBrowserMultiNav { public: typedef FrameNavExpectationsBrowserMultiNav parent; - explicit FrameNavExpectationsBrowserTestMultiNav(int nav) - : parent(nav) { - } + explicit FrameNavExpectationsBrowserTestMultiNav(int nav) : parent(nav) {} std::string GetMainURL() override { return GetMultiNavURL(kFrameNavOrigin0, nav()); @@ -1528,15 +1479,15 @@ class FrameNavExpectationsBrowserTestMultiNav : V_DECLARE(); // A frame should exist in all cases except for the very first load. if (isLoading && nav() == 0) { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, false, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, false, std::string())); } else if (isLoading) { // Expect the URL from the previous load. - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - GetPreviousMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, GetPreviousMainURL())); } else { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, GetMainURL())); } V_EXPECT_TRUE(parent::OnLoadingStateChange(browser, isLoading)); V_RETURN(); @@ -1545,8 +1496,8 @@ class FrameNavExpectationsBrowserTestMultiNav : bool OnLoadStart(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, GetMainURL())); V_EXPECT_TRUE(parent::OnLoadStart(browser, frame)); V_RETURN(); } @@ -1555,16 +1506,16 @@ class FrameNavExpectationsBrowserTestMultiNav : CefRefPtr frame) override { got_load_end_.yes(); V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, GetMainURL())); V_EXPECT_TRUE(parent::OnLoadEnd(browser, frame)); V_RETURN(); } bool OnAfterCreated(CefRefPtr browser) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, false, - std::string())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, false, std::string())); V_EXPECT_TRUE(parent::OnAfterCreated(browser)); V_RETURN(); } @@ -1576,8 +1527,8 @@ class FrameNavExpectationsBrowserTestMultiNav : std::string expected_url; if (nav() > 0) expected_url = GetPreviousMainURL(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - expected_url)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, expected_url)); V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame, url)); V_RETURN(); } @@ -1588,8 +1539,8 @@ class FrameNavExpectationsBrowserTestMultiNav : std::string expected_url; if (nav() > 0) expected_url = GetPreviousMainURL(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - expected_url)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, expected_url)); V_EXPECT_TRUE(parent::GetResourceHandler(browser, frame)); V_RETURN(); } @@ -1600,8 +1551,8 @@ class FrameNavExpectationsBrowserTestMultiNav : got_renderer_complete_.yes(); V_DECLARE(); V_EXPECT_TRUE(nav() == renderer_nav); - V_EXPECT_TRUE(parent::OnRendererComplete(browser, renderer_nav, - renderer_result)); + V_EXPECT_TRUE( + parent::OnRendererComplete(browser, renderer_nav, renderer_result)); V_RETURN(); } @@ -1626,14 +1577,12 @@ class FrameNavExpectationsBrowserTestMultiNav : TrackCallback got_renderer_complete_; }; -class FrameNavExpectationsRendererTestMultiNav : - public FrameNavExpectationsRendererMultiNav { +class FrameNavExpectationsRendererTestMultiNav + : public FrameNavExpectationsRendererMultiNav { public: typedef FrameNavExpectationsRendererMultiNav parent; - explicit FrameNavExpectationsRendererTestMultiNav(int nav) - : parent(nav) { - } + explicit FrameNavExpectationsRendererTestMultiNav(int nav) : parent(nav) {} bool IsNavigationDone() const override { return got_load_state_change_done_ && got_load_end_; @@ -1649,11 +1598,11 @@ class FrameNavExpectationsRendererTestMultiNav : std::string expected_url; if (nav() > 0) expected_url = GetPreviousMainURL(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - expected_url)); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, expected_url)); } else { - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, NULL, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, NULL, true, GetMainURL())); } V_EXPECT_TRUE(parent::OnLoadingStateChange(browser, isLoading)); V_RETURN(); @@ -1662,8 +1611,8 @@ class FrameNavExpectationsRendererTestMultiNav : bool OnLoadStart(CefRefPtr browser, CefRefPtr frame) override { V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, GetMainURL())); V_EXPECT_TRUE(parent::OnLoadStart(browser, frame)); V_RETURN(); } @@ -1672,8 +1621,8 @@ class FrameNavExpectationsRendererTestMultiNav : CefRefPtr frame) override { got_load_end_.yes(); V_DECLARE(); - V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true, - GetMainURL())); + V_EXPECT_TRUE( + VerifySingleBrowserFrames(browser, frame, true, GetMainURL())); V_EXPECT_TRUE(parent::OnLoadEnd(browser, frame)); V_RETURN(); } @@ -1700,15 +1649,12 @@ class FrameNavExpectationsRendererTestMultiNav : TrackCallback got_load_end_; }; -class FrameNavExpectationsFactoryBrowserTestMultiNav : - public FrameNavExpectationsFactoryBrowser { +class FrameNavExpectationsFactoryBrowserTestMultiNav + : public FrameNavExpectationsFactoryBrowser { public: - FrameNavExpectationsFactoryBrowserTestMultiNav() - : nav_count_(0) {} + FrameNavExpectationsFactoryBrowserTestMultiNav() : nav_count_(0) {} - FrameNavFactoryId GetID() const override { - return FNF_ID_MULTI_NAV; - } + FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV; } bool HasMoreNavigations() const override { return (nav_count_ < kMaxMultiNavNavigations); @@ -1731,14 +1677,12 @@ class FrameNavExpectationsFactoryBrowserTestMultiNav : int nav_count_; }; -class FrameNavExpectationsFactoryRendererTestMultiNav : - public FrameNavExpectationsFactoryRenderer { +class FrameNavExpectationsFactoryRendererTestMultiNav + : public FrameNavExpectationsFactoryRenderer { public: FrameNavExpectationsFactoryRendererTestMultiNav() {} - FrameNavFactoryId GetID() const override { - return FNF_ID_MULTI_NAV; - } + FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV; } protected: scoped_ptr Create(int nav) override { @@ -1752,7 +1696,6 @@ class FrameNavExpectationsFactoryRendererTestMultiNav : // Test that multiple navigation works. FRAME_TEST(MultiNav, FNF_ID_MULTI_NAV) - namespace { const char kFrame0Name[] = ""; @@ -1799,7 +1742,7 @@ bool VerifyBrowserIframe(CefRefPtr browser, V_EXPECT_TRUE(frame1id > 0); frame2id = frame2->GetIdentifier(); V_EXPECT_TRUE(frame2id > 0); - + // Verify that the current frame has the correct id. if (frame_number == 0) { V_EXPECT_TRUE(frame->GetIdentifier() == frame0id); @@ -1850,31 +1793,32 @@ bool VerifyBrowserIframe(CefRefPtr browser, } // Test that nested iframes work. -class FrameNavExpectationsBrowserTestNestedIframes : - public FrameNavExpectationsBrowserMultiNav { +class FrameNavExpectationsBrowserTestNestedIframes + : public FrameNavExpectationsBrowserMultiNav { public: typedef FrameNavExpectationsBrowserMultiNav parent; FrameNavExpectationsBrowserTestNestedIframes(int nav, bool same_origin) - : parent(nav), - same_origin_(same_origin) { + : parent(nav), same_origin_(same_origin) { // In the browser process we can rely on the |nav| value to determine the // origin. if (same_origin) { origin_ = kFrameNavOrigin0; - } else switch (nav) { - case 0: - origin_ = kFrameNavOrigin0; - break; - case 1: - origin_ = kFrameNavOrigin1; - break; - case 2: - origin_ = kFrameNavOrigin2; - break; - default: - EXPECT_TRUE(false); // Not reached. - break; + } else { + switch (nav) { + case 0: + origin_ = kFrameNavOrigin0; + break; + case 1: + origin_ = kFrameNavOrigin1; + break; + case 2: + origin_ = kFrameNavOrigin2; + break; + default: + EXPECT_TRUE(false); // Not reached. + break; + } } } @@ -1888,13 +1832,11 @@ class FrameNavExpectationsBrowserTestNestedIframes : switch (frame_number) { case 0: // Frame 0. Contains a named iframe. - return "Nav1" - "" - "", - "text/html"); - AddResource(std::string(kTypeTestOrigin) + "sub.html", - "Sub", - "text/html"); + "" + "" + "" + "" + "" + "

    Main

    " + "" + "" + "" + "", + "text/html"); + AddResource(std::string(kTypeTestOrigin) + "sub.html", "Sub", + "text/html"); AddResource(std::string(kTypeTestOrigin) + "style.css", - "@font-face {" - " font-family: custom_font;" - " src: url('font.ttf');" - "}" - "p {" - " font-family: custom_font;" - "}", - "text/css"); - AddResource(std::string(kTypeTestOrigin) + "script.js", - "", - "text/javascript"); - AddResource(std::string(kTypeTestOrigin) + "image.png", - "", - "image/png"); - AddResource(std::string(kTypeTestOrigin) + "font.ttf", - "", - "font/ttf"); - AddResource(std::string(kTypeTestOrigin) + "xhr.html", - "XHR", - "text/html"); + "@font-face {" + " font-family: custom_font;" + " src: url('font.ttf');" + "}" + "p {" + " font-family: custom_font;" + "}", + "text/css"); + AddResource(std::string(kTypeTestOrigin) + "script.js", "", + "text/javascript"); + AddResource(std::string(kTypeTestOrigin) + "image.png", "", + "image/png"); + AddResource(std::string(kTypeTestOrigin) + "font.ttf", "", + "font/ttf"); + AddResource(std::string(kTypeTestOrigin) + "xhr.html", "XHR", + "text/html"); CreateBrowser(std::string(kTypeTestOrigin) + "main.html"); @@ -561,7 +549,7 @@ class TypeTestHandler : public TestHandler { CefRefPtr request, CefRefPtr callback) override { load_expectations_.GotRequest(request); - + return RV_CONTINUE; } @@ -574,16 +562,15 @@ class TypeTestHandler : public TestHandler { completed_browser_side_ = true; // Destroy the test on the UI thread. CefPostTask(TID_UI, - base::Bind(&TypeTestHandler::DestroyTestIfComplete, this)); + base::Bind(&TypeTestHandler::DestroyTestIfComplete, this)); } return TestHandler::GetResourceHandler(browser, frame, request); } - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { const std::string& msg_name = message->GetName(); if (msg_name == kTypeTestCompleteMsg) { // Test that the renderer side succeeded. @@ -639,13 +626,11 @@ class TypeTestHandler : public TestHandler { // Verify the order of navigation-related callbacks. TEST(RequestTest, ResourceAndTransitionType) { - CefRefPtr handler = - new TypeTestHandler(); + CefRefPtr handler = new TypeTestHandler(); handler->ExecuteTest(); ReleaseAndWaitForDestructor(handler); } - // Entry point for creating request renderer test objects. // Called from client_app_delegates.cc. void CreateRequestRendererTests(ClientAppRenderer::DelegateSet& delegates) { diff --git a/tests/ceftests/resource.h b/tests/ceftests/resource.h index 28c5063e8..f87af0ff6 100644 --- a/tests/ceftests/resource.h +++ b/tests/ceftests/resource.h @@ -6,21 +6,21 @@ // Microsoft Visual C++ generated include file. // Used by cefclient.rc // -#define BINARY 256 -#define IDS_OSRTEST_HTML 1000 -#define IDS_PDF_HTML 1001 -#define IDS_PDF_PDF 1002 -#define IDS_WINDOW_ICON_1X_PNG 1003 -#define IDS_WINDOW_ICON_2X_PNG 1004 +#define BINARY 256 +#define IDS_OSRTEST_HTML 1000 +#define IDS_PDF_HTML 1001 +#define IDS_PDF_PDF 1002 +#define IDS_WINDOW_ICON_1X_PNG 1003 +#define IDS_WINDOW_ICON_2X_PNG 1004 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 130 -#define _APS_NEXT_COMMAND_VALUE 32774 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 111 +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 111 #endif #endif diff --git a/tests/ceftests/resource_manager_unittest.cc b/tests/ceftests/resource_manager_unittest.cc index 02312e869..58b36582f 100644 --- a/tests/ceftests/resource_manager_unittest.cc +++ b/tests/ceftests/resource_manager_unittest.cc @@ -16,32 +16,32 @@ namespace { -std::string CreateMessage(const std::string& name, - const std::string& value) { +std::string CreateMessage(const std::string& name, const std::string& value) { return name + ":" + value; } // The returned contents execute a JavaScript callback containing |message|. std::string CreateContents(const std::string& message) { - return "" + message + ""; + return "" + message + + ""; } void WriteFile(const std::string& path, const std::string& contents) { int contents_size = static_cast(contents.size()); - int write_ct = - file_util::WriteFile(path, contents.data(), contents_size); + int write_ct = file_util::WriteFile(path, contents.data(), contents_size); EXPECT_EQ(contents_size, write_ct); } CefRefPtr CreateContentsResourceHandler( const std::string& message) { const std::string& contents = CreateContents(message); - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(contents.data())), - contents.length()); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(contents.data())), + contents.length()); return new CefStreamResourceHandler("text/html", stream); } @@ -55,8 +55,7 @@ class ResourceManagerTestHandler : public RoutingTestHandler { State() : manager_(new CefResourceManager()), expected_message_ct_(0), - timeout_(0) { - } + timeout_(0) {} CefRefPtr manager_; @@ -76,8 +75,7 @@ class ResourceManagerTestHandler : public RoutingTestHandler { }; explicit ResourceManagerTestHandler(State* state) - : state_(state), - current_url_(0) { + : state_(state), current_url_(0) { EXPECT_TRUE(state_); EXPECT_TRUE(state_->manager_.get()); EXPECT_TRUE(!state_->urls_.empty()); @@ -127,8 +125,8 @@ class ResourceManagerTestHandler : public RoutingTestHandler { state_->messages_.push_back(request); callback->Success(""); - CefPostTask(TID_UI, - base::Bind(&ResourceManagerTestHandler::Continue, this, browser)); + CefPostTask(TID_UI, base::Bind(&ResourceManagerTestHandler::Continue, this, + browser)); return true; } @@ -194,10 +192,7 @@ class TestProvider : public CefResourceManager::Provider { std::string request_url_; }; - explicit TestProvider(State* state) - : state_(state) { - EXPECT_TRUE(state_); - } + explicit TestProvider(State* state) : state_(state) { EXPECT_TRUE(state_); } ~TestProvider() { CEF_REQUIRE_IO_THREAD(); @@ -215,8 +210,8 @@ class TestProvider : public CefResourceManager::Provider { return false; } - void OnRequestCanceled(scoped_refptr request) - override { + void OnRequestCanceled( + scoped_refptr request) override { CEF_REQUIRE_IO_THREAD(); EXPECT_TRUE(state_->got_on_request_); EXPECT_FALSE(state_->got_on_request_canceled_); @@ -233,7 +228,7 @@ class TestProvider : public CefResourceManager::Provider { // Test that that the URL retrieved via Request::url() is parsed as expected. // Fragment or query components in any order should be removed. -void TestUrlParsing(const char *kUrl) { +void TestUrlParsing(const char* kUrl) { const char kRequestUrl[] = "http://test.com/ResourceManagerTest"; ResourceManagerTestHandler::State state; @@ -306,13 +301,8 @@ class SimpleTestProvider : public TestProvider { DO_NOTHING, }; - SimpleTestProvider(State* state, - Mode mode, - CefResourceManager* manager) - : TestProvider(state), - mode_(mode), - manager_(manager) { - } + SimpleTestProvider(State* state, Mode mode, CefResourceManager* manager) + : TestProvider(state), mode_(mode), manager_(manager) {} bool OnRequest(scoped_refptr request) override { TestProvider::OnRequest(request); @@ -351,13 +341,13 @@ TEST(ResourceManagerTest, ProviderNotHandled) { TestProvider::State provider_state2; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::NOT_HANDLED, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state1, SimpleTestProvider::NOT_HANDLED, + NULL), + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::NOT_HANDLED, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::NOT_HANDLED, + NULL), + 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -394,13 +384,13 @@ TEST(ResourceManagerTest, ProviderContinue) { TestProvider::State provider_state2; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::CONTINUE, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state1, SimpleTestProvider::CONTINUE, + NULL), + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::CONTINUE, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::CONTINUE, + NULL), + 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -437,13 +427,12 @@ TEST(ResourceManagerTest, ProviderStop) { TestProvider::State provider_state2; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::STOP, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state1, SimpleTestProvider::STOP, NULL), + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::CONTINUE, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::CONTINUE, + NULL), + 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -483,17 +472,17 @@ TEST(ResourceManagerTest, ProviderRemove) { TestProvider::State provider_state3; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::REMOVE, state.manager_.get()), - 0, kProviderId); + new SimpleTestProvider(&provider_state1, SimpleTestProvider::REMOVE, + state.manager_.get()), + 0, kProviderId); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::CONTINUE, NULL), - 0, kProviderId); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::CONTINUE, + NULL), + 0, kProviderId); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state3, - SimpleTestProvider::CONTINUE, NULL), - 1, std::string()); + new SimpleTestProvider(&provider_state3, SimpleTestProvider::CONTINUE, + NULL), + 1, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -538,18 +527,17 @@ TEST(ResourceManagerTest, ProviderRemoveAll) { TestProvider::State provider_state3; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::REMOVE_ALL, + new SimpleTestProvider(&provider_state1, SimpleTestProvider::REMOVE_ALL, state.manager_.get()), - 0, std::string()); + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::CONTINUE, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::CONTINUE, + NULL), + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state3, - SimpleTestProvider::CONTINUE, NULL),\ - 1, std::string()); + new SimpleTestProvider(&provider_state3, SimpleTestProvider::CONTINUE, + NULL), + 1, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -595,13 +583,13 @@ TEST(ResourceManagerTest, ProviderDoNothing) { TestProvider::State provider_state2; state.manager_->AddProvider( - new SimpleTestProvider(&provider_state1, - SimpleTestProvider::DO_NOTHING, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state1, SimpleTestProvider::DO_NOTHING, + NULL), + 0, std::string()); state.manager_->AddProvider( - new SimpleTestProvider(&provider_state2, - SimpleTestProvider::DO_NOTHING, NULL), - 0, std::string()); + new SimpleTestProvider(&provider_state2, SimpleTestProvider::DO_NOTHING, + NULL), + 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -647,10 +635,10 @@ TEST(ResourceManagerTest, ContentProvider) { state.urls_.push_back(kUrl3); // Only the first 2 URLs will be handled. - state.manager_->AddContentProvider(kUrl1, - CreateContents(success1_message), "text/html", 0, std::string()); - state.manager_->AddContentProvider(kUrl2, - CreateContents(success2_message), "text/html", 0, std::string()); + state.manager_->AddContentProvider(kUrl1, CreateContents(success1_message), + "text/html", 0, std::string()); + state.manager_->AddContentProvider(kUrl2, CreateContents(success2_message), + "text/html", 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -695,15 +683,15 @@ TEST(ResourceManagerTest, DirectoryProvider) { // Write the files to disk. const std::string& temp_dir = scoped_dir.GetPath(); WriteFile(file_util::JoinPath(temp_dir, kFile1), - CreateContents(success1_message)); + CreateContents(success1_message)); WriteFile(file_util::JoinPath(temp_dir, kFile2), - CreateContents(success2_message)); + CreateContents(success2_message)); // Also include a subdirectory. const std::string& sub_dir = file_util::JoinPath(temp_dir, "sub"); EXPECT_TRUE(CefCreateDirectory(sub_dir)); WriteFile(file_util::JoinPath(sub_dir, kFile3), - CreateContents(success3_message)); + CreateContents(success3_message)); state.manager_->AddDirectoryProvider(kUrlBase, temp_dir, 0, std::string()); @@ -757,15 +745,15 @@ TEST(ResourceManagerTest, ArchiveProvider) { const std::string& file_dir = file_util::JoinPath(temp_dir, "files"); EXPECT_TRUE(CefCreateDirectory(file_dir)); WriteFile(file_util::JoinPath(file_dir, kFile1), - CreateContents(success1_message)); + CreateContents(success1_message)); WriteFile(file_util::JoinPath(file_dir, kFile2), - CreateContents(success2_message)); + CreateContents(success2_message)); // Also include a subdirectory. const std::string& sub_dir = file_util::JoinPath(file_dir, "sub"); EXPECT_TRUE(CefCreateDirectory(sub_dir)); WriteFile(file_util::JoinPath(sub_dir, kFile3), - CreateContents(success3_message)); + CreateContents(success3_message)); const std::string& archive_path = file_util::JoinPath(temp_dir, "archive.zip"); @@ -773,8 +761,8 @@ TEST(ResourceManagerTest, ArchiveProvider) { // Create the archive file. EXPECT_TRUE(CefZipDirectory(file_dir, archive_path, false)); - state.manager_->AddArchiveProvider(kUrlBase, archive_path, std::string(), - 0, std::string()); + state.manager_->AddArchiveProvider(kUrlBase, archive_path, std::string(), 0, + std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -803,8 +791,7 @@ namespace { class OneShotProvider : public CefResourceManager::Provider { public: explicit OneShotProvider(const std::string& content) - : done_(false), - content_(content) { + : done_(false), content_(content) { EXPECT_FALSE(content.empty()); } @@ -818,10 +805,9 @@ class OneShotProvider : public CefResourceManager::Provider { done_ = true; - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(content_.data())), - content_.length()); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(content_.data())), + content_.length()); request->Continue(new CefStreamResourceHandler("text/html", stream)); return true; @@ -860,17 +846,15 @@ TEST(ResourceManagerTest, ProviderOrder) { // Resulting order should be sequential; success1 .. success4. state.manager_->AddProvider( - new OneShotProvider(CreateContents(success2_message)), - 0, std::string()); + new OneShotProvider(CreateContents(success2_message)), 0, std::string()); state.manager_->AddProvider( - new OneShotProvider(CreateContents(success1_message)), - -100, std::string()); + new OneShotProvider(CreateContents(success1_message)), -100, + std::string()); state.manager_->AddProvider( - new OneShotProvider(CreateContents(success4_message)), - 100, std::string()); + new OneShotProvider(CreateContents(success4_message)), 100, + std::string()); state.manager_->AddProvider( - new OneShotProvider(CreateContents(success3_message)), - 0, std::string()); + new OneShotProvider(CreateContents(success3_message)), 0, std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -896,8 +880,7 @@ namespace { // Content provider that returns the path component as the result. class EchoProvider : public CefResourceManager::Provider { public: - EchoProvider(const std::string& base_url) - : base_url_(base_url) { + EchoProvider(const std::string& base_url) : base_url_(base_url) { EXPECT_TRUE(!base_url_.empty()); } @@ -916,15 +899,15 @@ class EchoProvider : public CefResourceManager::Provider { int delay = atoi(url.substr(base_url_.size()).data()); EXPECT_GE(delay, 0); - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(content.data())), - content.length()); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(content.data())), + content.length()); - CefPostDelayedTask(TID_IO, + CefPostDelayedTask( + TID_IO, base::Bind(&CefResourceManager::Request::Continue, request, new CefStreamResourceHandler("text/html", stream)), - delay); + delay); return true; } @@ -956,8 +939,8 @@ TEST(ResourceManagerTest, ManyRequests) { } ss << ""; - state.manager_->AddContentProvider(kUrl, ss.str(), "text/html", - 0, std::string()); + state.manager_->AddContentProvider(kUrl, ss.str(), "text/html", 0, + std::string()); state.manager_->AddProvider(new EchoProvider(kBaseUrl), 0, std::string()); CefRefPtr handler = @@ -992,21 +975,20 @@ class OneShotRemovalProvider : public TestProvider { CefResourceManager* manager, const std::string& identifier, bool remove_before_continue) - : TestProvider(state), - content_(content), - manager_(manager), - identifier_(identifier), - remove_before_continue_(remove_before_continue) { + : TestProvider(state), + content_(content), + manager_(manager), + identifier_(identifier), + remove_before_continue_(remove_before_continue) { EXPECT_FALSE(content.empty()); } bool OnRequest(scoped_refptr request) override { TestProvider::OnRequest(request); - CefRefPtr stream = - CefStreamReader::CreateForData( - static_cast(const_cast(content_.data())), - content_.length()); + CefRefPtr stream = CefStreamReader::CreateForData( + static_cast(const_cast(content_.data())), + content_.length()); if (remove_before_continue_) { // Removing the provider before continuing should trigger a call to @@ -1388,14 +1370,12 @@ namespace { // Test the URL filter capability. class UrlFilterTestProvider : public TestProvider { public: - UrlFilterTestProvider( - State* state, - const std::string& expected_url, - const std::string& expected_url_after_filter) + UrlFilterTestProvider(State* state, + const std::string& expected_url, + const std::string& expected_url_after_filter) : TestProvider(state), expected_url_(expected_url), - expected_url_after_filter_(expected_url_after_filter) { - } + expected_url_after_filter_(expected_url_after_filter) {} bool OnRequest(scoped_refptr request) override { TestProvider::OnRequest(request); @@ -1540,7 +1520,7 @@ TEST(ResourceManagerTest, UrlFilterWithFragment) { const char kUrl[] = "http://test.com/ResourceManagerTest#fragment"; const char kExpectedUrl[] = "http://test.com/ResourceManagerTestRewrite"; const char kExpectedUrlAfterFilter[] = - "http://test.com/ResourceManagerTestRewrite#fragment"; + "http://test.com/ResourceManagerTestRewrite#fragment"; ResourceManagerTestHandler::State state; state.urls_.push_back(kUrl); @@ -1589,11 +1569,8 @@ namespace { // Test the mime type resolver capability. class MimeTypeTestProvider : public TestProvider { public: - MimeTypeTestProvider(State* state, - const std::string& expected_mime_type) - : TestProvider(state), - expected_mime_type_(expected_mime_type) { - } + MimeTypeTestProvider(State* state, const std::string& expected_mime_type) + : TestProvider(state), expected_mime_type_(expected_mime_type) {} bool OnRequest(scoped_refptr request) override { TestProvider::OnRequest(request); @@ -1633,11 +1610,11 @@ TEST(ResourceManagerTest, MimeTypeResolver) { TestProvider::State provider_state2; state.manager_->AddProvider( - new MimeTypeTestProvider(&provider_state1, kExpectedMimeType), - 0, std::string()); + new MimeTypeTestProvider(&provider_state1, kExpectedMimeType), 0, + std::string()); state.manager_->AddProvider( - new MimeTypeTestProvider(&provider_state2, kExpectedMimeType), - 0, std::string()); + new MimeTypeTestProvider(&provider_state2, kExpectedMimeType), 0, + std::string()); CefRefPtr handler = new ResourceManagerTestHandler(&state); @@ -1676,8 +1653,7 @@ class AddingTestProvider : public TestProvider { : TestProvider(state), new_state_(new_state), manager_(manager), - before_(before) { - } + before_(before) {} bool OnRequest(scoped_refptr request) override { TestProvider::OnRequest(request); diff --git a/tests/ceftests/resource_util_linux.cc b/tests/ceftests/resource_util_linux.cc index 742d454c5..6409a0d67 100644 --- a/tests/ceftests/resource_util_linux.cc +++ b/tests/ceftests/resource_util_linux.cc @@ -15,7 +15,7 @@ bool GetResourceDir(std::string& dir) { char buff[1024]; // Retrieve the executable path. - ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff)-1); + ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff) - 1); if (len == -1) return false; @@ -27,10 +27,9 @@ bool GetResourceDir(std::string& dir) { return false; // Add "ceftests_files" to the path. - strcpy(pos+1, "ceftests_files"); // NOLINT(runtime/printf) + strcpy(pos + 1, "ceftests_files"); dir = std::string(buff); return true; } } // namespace client - diff --git a/tests/ceftests/resource_util_win_idmap.cc b/tests/ceftests/resource_util_win_idmap.cc index dc648f387..6cb66e4c1 100644 --- a/tests/ceftests/resource_util_win_idmap.cc +++ b/tests/ceftests/resource_util_win_idmap.cc @@ -14,18 +14,18 @@ int GetResourceId(const char* resource_name) { char* name; int id; } resource_map[] = { - {"osr_test.html", IDS_OSRTEST_HTML}, - {"pdf.html", IDS_PDF_HTML}, - {"pdf.pdf", IDS_PDF_PDF}, - {"window_icon.1x.png", IDS_WINDOW_ICON_1X_PNG}, - {"window_icon.2x.png", IDS_WINDOW_ICON_2X_PNG}, + {"osr_test.html", IDS_OSRTEST_HTML}, + {"pdf.html", IDS_PDF_HTML}, + {"pdf.pdf", IDS_PDF_PDF}, + {"window_icon.1x.png", IDS_WINDOW_ICON_1X_PNG}, + {"window_icon.2x.png", IDS_WINDOW_ICON_2X_PNG}, }; - for (int i = 0; i < sizeof(resource_map)/sizeof(_resource_map); ++i) { + for (int i = 0; i < sizeof(resource_map) / sizeof(_resource_map); ++i) { if (!strcmp(resource_map[i].name, resource_name)) return resource_map[i].id; } - + return 0; } diff --git a/tests/ceftests/routing_test_handler.cc b/tests/ceftests/routing_test_handler.cc index 2f7f1249d..e0b14ac9b 100644 --- a/tests/ceftests/routing_test_handler.cc +++ b/tests/ceftests/routing_test_handler.cc @@ -30,23 +30,22 @@ class RoutingRenderDelegate : public ClientAppRenderer::Delegate { CefRefPtr browser, CefRefPtr frame, CefRefPtr context) override { - message_router_->OnContextCreated(browser, frame, context); + message_router_->OnContextCreated(browser, frame, context); } void OnContextReleased(CefRefPtr app, CefRefPtr browser, CefRefPtr frame, CefRefPtr context) override { - message_router_->OnContextReleased(browser, frame, context); + message_router_->OnContextReleased(browser, frame, context); } - bool OnProcessMessageReceived( - CefRefPtr app, - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { - return message_router_->OnProcessMessageReceived( - browser, source_process, message); + bool OnProcessMessageReceived(CefRefPtr app, + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { + return message_router_->OnProcessMessageReceived(browser, source_process, + message); } private: @@ -57,8 +56,7 @@ class RoutingRenderDelegate : public ClientAppRenderer::Delegate { } // namespace -RoutingTestHandler::RoutingTestHandler() { -} +RoutingTestHandler::RoutingTestHandler() {} void RoutingTestHandler::OnAfterCreated(CefRefPtr browser) { if (!message_router_.get()) { @@ -94,8 +92,8 @@ bool RoutingTestHandler::OnProcessMessageReceived( CefRefPtr browser, CefProcessId source_process, CefRefPtr message) { - return message_router_->OnProcessMessageReceived( - browser, source_process, message); + return message_router_->OnProcessMessageReceived(browser, source_process, + message); } // Entry point for creating the test delegate. diff --git a/tests/ceftests/routing_test_handler.h b/tests/ceftests/routing_test_handler.h index 261aea08a..a973ea6fe 100644 --- a/tests/ceftests/routing_test_handler.h +++ b/tests/ceftests/routing_test_handler.h @@ -12,33 +12,29 @@ // Extends TestHandler to provide message routing functionality. The // RoutingTestHandler implementation must be called from subclass // overrides unless otherwise indicated. -class RoutingTestHandler : - public TestHandler, - public CefMessageRouterBrowserSide::Handler { +class RoutingTestHandler : public TestHandler, + public CefMessageRouterBrowserSide::Handler { public: RoutingTestHandler(); void OnAfterCreated(CefRefPtr browser) override; void OnBeforeClose(CefRefPtr browser) override; - void OnRenderProcessTerminated( - CefRefPtr browser, - TerminationStatus status) override; + void OnRenderProcessTerminated(CefRefPtr browser, + TerminationStatus status) override; // Only call this method if the navigation isn't canceled. bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, - bool is_redirect) override; + bool is_redirect) override; // Returns true if the router handled the navigation. - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override; + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override; private: CefRefPtr message_router_; }; - #endif // CEF_TESTS_UNITTESTS_ROUTING_TEST_HANDLER_H_ diff --git a/tests/ceftests/run_all_unittests.cc b/tests/ceftests/run_all_unittests.cc index 7069efaf2..42d05fa0b 100644 --- a/tests/ceftests/run_all_unittests.cc +++ b/tests/ceftests/run_all_unittests.cc @@ -19,8 +19,8 @@ #include "include/cef_app.h" #include "include/cef_task.h" #include "include/cef_thread.h" -#include "include/wrapper/cef_helpers.h" #include "include/wrapper/cef_closure_task.h" +#include "include/wrapper/cef_helpers.h" #include "tests/ceftests/test_handler.h" #include "tests/ceftests/test_suite.h" #include "tests/shared/browser/client_app_browser.h" @@ -74,25 +74,24 @@ void ContinueOnUIThread(CefRefPtr test_task_runner) { } #if defined(OS_LINUX) -int XErrorHandlerImpl(Display *display, XErrorEvent *event) { - LOG(WARNING) - << "X error received: " - << "type " << event->type << ", " - << "serial " << event->serial << ", " - << "error_code " << static_cast(event->error_code) << ", " - << "request_code " << static_cast(event->request_code) << ", " - << "minor_code " << static_cast(event->minor_code); +int XErrorHandlerImpl(Display* display, XErrorEvent* event) { + LOG(WARNING) << "X error received: " + << "type " << event->type << ", " + << "serial " << event->serial << ", " + << "error_code " << static_cast(event->error_code) << ", " + << "request_code " << static_cast(event->request_code) + << ", " + << "minor_code " << static_cast(event->minor_code); return 0; } -int XIOErrorHandlerImpl(Display *display) { +int XIOErrorHandlerImpl(Display* display) { return 0; } #endif // defined(OS_LINUX) } // namespace - int main(int argc, char* argv[]) { // Create the singleton test suite object. CefTestSuite test_suite(argc, argv); @@ -186,7 +185,7 @@ int main(int argc, char* argv[]) { // Start the tests from the UI thread so that any pending UI tasks get a // chance to execute first. CefPostTask(TID_UI, - base::Bind(&ContinueOnUIThread, thread->GetTaskRunner())); + base::Bind(&ContinueOnUIThread, thread->GetTaskRunner())); // Run the CEF message loop. message_loop->Run(); diff --git a/tests/ceftests/run_all_unittests_mac.mm b/tests/ceftests/run_all_unittests_mac.mm index 3bec6a435..2c8c17be1 100644 --- a/tests/ceftests/run_all_unittests_mac.mm +++ b/tests/ceftests/run_all_unittests_mac.mm @@ -10,7 +10,7 @@ static NSAutoreleasePool* g_autopool = nil; // Provide the CefAppProtocol implementation required by CEF. @interface TestApplication : NSApplication { -@private + @private BOOL handlingSendEvent_; } @end @@ -33,7 +33,7 @@ static NSAutoreleasePool* g_autopool = nil; void PlatformInit() { // Initialize the AutoRelease pool. g_autopool = [[NSAutoreleasePool alloc] init]; - + // Initialize the TestApplication instance. [TestApplication sharedApplication]; } @@ -42,4 +42,3 @@ void PlatformCleanup() { // Release the AutoRelease pool. [g_autopool release]; } - diff --git a/tests/ceftests/scheme_handler_unittest.cc b/tests/ceftests/scheme_handler_unittest.cc index f0a711c59..4ca29fe3d 100644 --- a/tests/ceftests/scheme_handler_unittest.cc +++ b/tests/ceftests/scheme_handler_unittest.cc @@ -5,8 +5,8 @@ #include #include "include/base/cef_bind.h" -#include "include/cef_origin_whitelist.h" #include "include/cef_callback.h" +#include "include/cef_origin_whitelist.h" #include "include/cef_scheme.h" #include "include/wrapper/cef_closure_task.h" #include "tests/ceftests/test_handler.h" @@ -16,11 +16,7 @@ namespace { class TestResults { public: - TestResults() - : status_code(0), - sub_status_code(0), - delay(0) { - } + TestResults() : status_code(0), sub_status_code(0), delay(0) {} void reset() { url.clear(); @@ -72,16 +68,8 @@ class TestResults { // Delay for returning scheme handler results. int delay; - TrackCallback - got_request, - got_read, - got_output, - got_redirect, - got_error, - got_sub_redirect, - got_sub_request, - got_sub_read, - got_sub_success; + TrackCallback got_request, got_read, got_output, got_redirect, got_error, + got_sub_redirect, got_sub_request, got_sub_read, got_sub_success; }; // Current scheme handler object. Used when destroying the test from @@ -91,8 +79,7 @@ TestSchemeHandler* g_current_handler = NULL; class TestSchemeHandler : public TestHandler { public: - explicit TestSchemeHandler(TestResults* tr) - : test_results_(tr) { + explicit TestSchemeHandler(TestResults* tr) : test_results_(tr) { g_current_handler = this; } @@ -112,9 +99,7 @@ class TestSchemeHandler : public TestHandler { // Necessary to make the method public in order to destroy the test from // ClientSchemeHandler::ProcessRequest(). - void DestroyTest() override { - TestHandler::DestroyTest(); - } + void DestroyTest() override { TestHandler::DestroyTest(); } cef_return_value_t OnBeforeResourceLoad( CefRefPtr browser, @@ -186,11 +171,7 @@ class TestSchemeHandler : public TestHandler { class ClientSchemeHandler : public CefResourceHandler { public: explicit ClientSchemeHandler(TestResults* tr) - : test_results_(tr), - offset_(0), - is_sub_(false), - has_delayed_(false) { - } + : test_results_(tr), offset_(0), is_sub_(false), has_delayed_(false) {} bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override { @@ -199,8 +180,8 @@ class ClientSchemeHandler : public CefResourceHandler { bool handled = false; std::string url = request->GetURL(); - is_sub_ = (!test_results_->sub_url.empty() && - test_results_->sub_url == url); + is_sub_ = + (!test_results_->sub_url.empty() && test_results_->sub_url == url); if (is_sub_) { test_results_->got_sub_request.yes(); @@ -233,16 +214,15 @@ class ClientSchemeHandler : public CefResourceHandler { } else { // Value from CefSettings.accept_language set in // CefTestSuite::GetSettings(). - EXPECT_STREQ(CEF_SETTINGS_ACCEPT_LANGUAGE, - accept_language.data()); + EXPECT_STREQ(CEF_SETTINGS_ACCEPT_LANGUAGE, accept_language.data()); } if (handled) { if (test_results_->delay > 0) { // Continue after the delay. CefPostDelayedTask(TID_IO, - base::Bind(&CefCallback::Continue, callback.get()), - test_results_->delay); + base::Bind(&CefCallback::Continue, callback.get()), + test_results_->delay); } else { // Continue immediately. callback->Continue(); @@ -293,9 +273,7 @@ class ClientSchemeHandler : public CefResourceHandler { } } - void Cancel() override { - EXPECT_TRUE(CefCurrentlyOn(TID_IO)); - } + void Cancel() override { EXPECT_TRUE(CefCurrentlyOn(TID_IO)); } bool ReadResponse(void* data_out, int bytes_to_read, @@ -307,11 +285,11 @@ class ClientSchemeHandler : public CefResourceHandler { if (!has_delayed_) { // Continue after a delay. CefPostDelayedTask(TID_IO, - base::Bind(&ClientSchemeHandler::ContinueAfterDelay, - this, callback), - test_results_->delay); - bytes_read = 0; - return true; + base::Bind(&ClientSchemeHandler::ContinueAfterDelay, + this, callback), + test_results_->delay); + bytes_read = 0; + return true; } has_delayed_ = false; @@ -360,15 +338,12 @@ class ClientSchemeHandler : public CefResourceHandler { class ClientSchemeHandlerFactory : public CefSchemeHandlerFactory { public: - explicit ClientSchemeHandlerFactory(TestResults* tr) - : test_results_(tr) { - } + explicit ClientSchemeHandlerFactory(TestResults* tr) : test_results_(tr) {} - CefRefPtr Create( - CefRefPtr browser, - CefRefPtr frame, - const CefString& scheme_name, - CefRefPtr request) override { + CefRefPtr Create(CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) override { EXPECT_TRUE(CefCurrentlyOn(TID_IO)); return new ClientSchemeHandler(test_results_); } @@ -385,8 +360,8 @@ TestResults g_TestResults; void RegisterTestScheme(const std::string& scheme, const std::string& domain) { g_TestResults.reset(); - EXPECT_TRUE(CefRegisterSchemeHandlerFactory(scheme, domain, - new ClientSchemeHandlerFactory(&g_TestResults))); + EXPECT_TRUE(CefRegisterSchemeHandlerFactory( + scheme, domain, new ClientSchemeHandlerFactory(&g_TestResults))); WaitForIOThread(); } @@ -396,8 +371,7 @@ void ClearTestSchemes() { } struct XHRTestSettings { - XHRTestSettings() - : synchronous(true) {} + XHRTestSettings() : synchronous(true) {} std::string url; std::string sub_url; @@ -431,20 +405,25 @@ void SetUpXHR(const XHRTestSettings& settings) { ss << "var result = 'FAILURE';" "try {" " xhr = new XMLHttpRequest();" - " xhr.open(\"GET\", \"" << request_url.c_str() << "\", false);" + " xhr.open(\"GET\", \"" + << request_url.c_str() + << "\", false);" " xhr.send();" " result = xhr.responseText;" "} catch(e) {}" "onResult(result)"; } else { ss << "xhr = new XMLHttpRequest();" - "xhr.open(\"GET\", \"" << request_url.c_str() << "\", true);" + "xhr.open(\"GET\", \"" + << request_url.c_str() + << "\", true);" "xhr.onload = function(e) {" " if (xhr.readyState === 4) {" " if (xhr.status === 200) {" " onResult(xhr.responseText);" " } else {" - " console.log('XMLHttpRequest failed with status ' + xhr.status);" + " console.log('XMLHttpRequest failed with status ' + " + "xhr.status);" " onResult('FAILURE');" " }" " }" @@ -466,7 +445,8 @@ void SetUpXHR(const XHRTestSettings& settings) { g_TestResults.exit_url = "http://tests/exit"; } -void SetUpXSS(const std::string& url, const std::string& sub_url, +void SetUpXSS(const std::string& url, + const std::string& sub_url, const std::string& domain = std::string()) { // 1. Load |url| which contains an iframe. // 2. The iframe loads |xss_url|. @@ -480,8 +460,9 @@ void SetUpXSS(const std::string& url, const std::string& sub_url, g_TestResults.sub_url = sub_url; ss << "" - "" "" - "" - "", "text/html"); - AddResource(kV8ContextChildTestUrl, "" - "CHILD", - "text/html"); + AddResource(kV8ContextParentTestUrl, + "" + "" + "", + "text/html"); + AddResource(kV8ContextChildTestUrl, + "" + "CHILD", + "text/html"); CreateBrowser(kV8ContextParentTestUrl); } else if (test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION || test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS) { - AddResource(kV8OnUncaughtExceptionTestUrl, "" - "

    OnUncaughtException

    " - "\n" - "\n", - "text/html"); + AddResource(kV8OnUncaughtExceptionTestUrl, + "" + "

    OnUncaughtException

    " + "\n" + "\n", + "text/html"); CreateBrowser(kV8OnUncaughtExceptionTestUrl); } else { EXPECT_TRUE(test_url_ != NULL); - AddResource(test_url_, "" - "TEST", "text/html"); + AddResource(test_url_, + "" + "TEST", + "text/html"); CreateBrowser(test_url_); } @@ -2753,7 +2751,8 @@ class V8TestHandler : public TestHandler { CefBrowserSettings settings; #if defined(OS_WIN) - windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools"); + windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), + "DevTools"); #endif browser->GetHost()->ShowDevTools(windowInfo, this, settings, @@ -2767,15 +2766,14 @@ class V8TestHandler : public TestHandler { url.find("http://tests/") != std::string::npos) { // Run the test. CefRefPtr return_msg = - CefProcessMessage::Create(kV8RunTestMsg); + CefProcessMessage::Create(kV8RunTestMsg); EXPECT_TRUE(browser->SendProcessMessage(PID_RENDERER, return_msg)); } } - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) override { + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override { EXPECT_TRUE(browser.get()); EXPECT_EQ(PID_RENDERER, source_process); EXPECT_TRUE(message.get()); @@ -2805,7 +2803,6 @@ class V8TestHandler : public TestHandler { } // namespace - // Entry point for creating V8 browser test objects. // Called from client_app_delegates.cc. void CreateV8BrowserTests(ClientAppBrowser::DelegateSet& delegates) { @@ -2818,23 +2815,19 @@ void CreateV8RendererTests(ClientAppRenderer::DelegateSet& delegates) { delegates.insert(new V8RendererTest); } - // Helpers for defining V8 tests. -#define V8_TEST_EX(name, test_mode, test_url) \ - TEST(V8Test, name) { \ - g_current_test_mode = test_mode; \ - CefRefPtr handler = \ - new V8TestHandler(test_mode, test_url); \ - handler->ExecuteTest(); \ - EXPECT_TRUE(handler->got_message_); \ - EXPECT_TRUE(handler->got_success_); \ - g_current_test_mode = V8TEST_NONE; \ - ReleaseAndWaitForDestructor(handler); \ +#define V8_TEST_EX(name, test_mode, test_url) \ + TEST(V8Test, name) { \ + g_current_test_mode = test_mode; \ + CefRefPtr handler = new V8TestHandler(test_mode, test_url); \ + handler->ExecuteTest(); \ + EXPECT_TRUE(handler->got_message_); \ + EXPECT_TRUE(handler->got_success_); \ + g_current_test_mode = V8TEST_NONE; \ + ReleaseAndWaitForDestructor(handler); \ } -#define V8_TEST(name, test_mode) \ - V8_TEST_EX(name, test_mode, kV8TestUrl) - +#define V8_TEST(name, test_mode) V8_TEST_EX(name, test_mode, kV8TestUrl) // Define the tests. V8_TEST(NullCreate, V8TEST_NULL_CREATE); @@ -2874,11 +2867,11 @@ V8_TEST(FunctionHandlerEmptyString, V8TEST_FUNCTION_HANDLER_EMPTY_STRING); V8_TEST(ContextEval, V8TEST_CONTEXT_EVAL); V8_TEST(ContextEvalException, V8TEST_CONTEXT_EVAL_EXCEPTION); V8_TEST_EX(ContextEvalCspBypassUnsafeEval, - V8TEST_CONTEXT_EVAL_CSP_BYPASS_UNSAFE_EVAL, - kV8ContextEvalCspBypassUnsafeEval); + V8TEST_CONTEXT_EVAL_CSP_BYPASS_UNSAFE_EVAL, + kV8ContextEvalCspBypassUnsafeEval); V8_TEST_EX(ContextEvalCspBypassSandbox, - V8TEST_CONTEXT_EVAL_CSP_BYPASS_SANDBOX, - kV8ContextEvalCspBypassSandbox); + V8TEST_CONTEXT_EVAL_CSP_BYPASS_SANDBOX, + kV8ContextEvalCspBypassSandbox); V8_TEST_EX(ContextEntered, V8TEST_CONTEXT_ENTERED, NULL); V8_TEST(ContextInvalid, V8TEST_CONTEXT_INVALID); V8_TEST_EX(Binding, V8TEST_BINDING, kV8BindingTestUrl); diff --git a/tests/ceftests/values_unittest.cc b/tests/ceftests/values_unittest.cc index 061569634..fa91ad989 100644 --- a/tests/ceftests/values_unittest.cc +++ b/tests/ceftests/values_unittest.cc @@ -38,7 +38,6 @@ const int kIntValue = 12; const double kDoubleValue = 4.5432; const char* kStringValue = "My string value"; - // BINARY TEST HELPERS // Test a binary value. @@ -48,24 +47,24 @@ void TestBinary(CefRefPtr value, char* data, size_t data_size) { EXPECT_EQ(data_size, value->GetSize()); - char* buff = new char[data_size+1]; + char* buff = new char[data_size + 1]; char old_char; // Test full read. - memset(buff, 0, data_size+1); + memset(buff, 0, data_size + 1); EXPECT_EQ(data_size, value->GetData(buff, data_size, 0)); EXPECT_TRUE(!strcmp(buff, data)); // Test partial read with offset. - memset(buff, 0, data_size+1); + memset(buff, 0, data_size + 1); old_char = data[15]; data[15] = 0; EXPECT_EQ(10U, value->GetData(buff, 10, 5)); - EXPECT_TRUE(!strcmp(buff, data+5)); + EXPECT_TRUE(!strcmp(buff, data + 5)); data[15] = old_char; // Test that changes to the original data have no effect. - memset(buff, 0, data_size+1); + memset(buff, 0, data_size + 1); old_char = data[0]; data[0] = '.'; EXPECT_EQ(1U, value->GetData(buff, 1, 0)); @@ -76,20 +75,16 @@ void TestBinary(CefRefPtr value, char* data, size_t data_size) { CefRefPtr copy = value->Copy(); TestBinaryEqual(copy, value); - delete [] buff; + delete[] buff; } // Used to test access of binary data on a different thread. class BinaryTask : public CefTask { public: BinaryTask(CefRefPtr value, char* data, size_t data_size) - : value_(value), - data_(data), - data_size_(data_size) {} + : value_(value), data_(data), data_size_(data_size) {} - void Execute() override { - TestBinary(value_, data_, data_size_); - } + void Execute() override { TestBinary(value_, data_, data_size_); } private: CefRefPtr value_; @@ -99,7 +94,6 @@ class BinaryTask : public CefTask { IMPLEMENT_REFCOUNTING(BinaryTask); }; - // DICTIONARY TEST HELPERS // Test dictionary null value. @@ -148,7 +142,8 @@ void TestDictionaryString(CefRefPtr value) { // Test dictionary binary value. void TestDictionaryBinary(CefRefPtr value, - char* binary_data, size_t binary_data_size, + char* binary_data, + size_t binary_data_size, CefRefPtr& binary_value) { binary_value = CefBinaryValue::Create(binary_data, binary_data_size); EXPECT_TRUE(binary_value.get()); @@ -216,7 +211,8 @@ void TestDictionaryList(CefRefPtr value, // Test dictionary value. void TestDictionary(CefRefPtr value, - char* binary_data, size_t binary_data_size) { + char* binary_data, + size_t binary_data_size) { CefRefPtr binary_value; CefRefPtr dictionary_value; CefRefPtr list_value; @@ -288,11 +284,12 @@ void TestDictionary(CefRefPtr value, // Used to test access of dictionary data on a different thread. class DictionaryTask : public CefTask { public: - DictionaryTask(CefRefPtr value, char* binary_data, + DictionaryTask(CefRefPtr value, + char* binary_data, size_t binary_data_size) - : value_(value), - binary_data_(binary_data), - binary_data_size_(binary_data_size) {} + : value_(value), + binary_data_(binary_data), + binary_data_size_(binary_data_size) {} void Execute() override { TestDictionary(value_, binary_data_, binary_data_size_); @@ -306,7 +303,6 @@ class DictionaryTask : public CefTask { IMPLEMENT_REFCOUNTING(DictionaryTask); }; - // LIST TEST HELPERS // Test list null value. @@ -359,8 +355,10 @@ void TestListString(CefRefPtr value, size_t index) { } // Test list binary value. -void TestListBinary(CefRefPtr value, size_t index, - char* binary_data, size_t binary_data_size, +void TestListBinary(CefRefPtr value, + size_t index, + char* binary_data, + size_t binary_data_size, CefRefPtr& binary_value) { binary_value = CefBinaryValue::Create(binary_data, binary_data_size); EXPECT_TRUE(binary_value.get()); @@ -381,7 +379,8 @@ void TestListBinary(CefRefPtr value, size_t index, } // Test list dictionary value. -void TestListDictionary(CefRefPtr value, size_t index, +void TestListDictionary(CefRefPtr value, + size_t index, CefRefPtr& dictionary_value) { dictionary_value = CefDictionaryValue::Create(); EXPECT_TRUE(dictionary_value.get()); @@ -407,7 +406,8 @@ void TestListDictionary(CefRefPtr value, size_t index, } // Test list list value. -void TestListList(CefRefPtr value, size_t index, +void TestListList(CefRefPtr value, + size_t index, CefRefPtr& list_value) { list_value = CefListValue::Create(); EXPECT_TRUE(list_value.get()); @@ -434,7 +434,8 @@ void TestListList(CefRefPtr value, size_t index, // Test list value. void TestList(CefRefPtr value, - char* binary_data, size_t binary_data_size) { + char* binary_data, + size_t binary_data_size) { CefRefPtr binary_value; CefRefPtr dictionary_value; CefRefPtr list_value; @@ -458,7 +459,7 @@ void TestList(CefRefPtr value, TestListString(value, kStringIndex); EXPECT_EQ(VTYPE_NULL, value->GetType(kBinaryIndex)); TestListBinary(value, kBinaryIndex, binary_data, binary_data_size, - binary_value); + binary_value); EXPECT_EQ(VTYPE_NULL, value->GetType(kDictionaryIndex)); TestListDictionary(value, kDictionaryIndex, dictionary_value); EXPECT_EQ(VTYPE_NULL, value->GetType(kListIndex)); @@ -553,15 +554,14 @@ void TestList(CefRefPtr value, // Used to test access of list data on a different thread. class ListTask : public CefTask { public: - ListTask(CefRefPtr value, char* binary_data, - size_t binary_data_size) - : value_(value), - binary_data_(binary_data), - binary_data_size_(binary_data_size) {} + ListTask(CefRefPtr value, + char* binary_data, + size_t binary_data_size) + : value_(value), + binary_data_(binary_data), + binary_data_size_(binary_data_size) {} - void Execute() override { - TestList(value_, binary_data_, binary_data_size_); - } + void Execute() override { TestList(value_, binary_data_, binary_data_size_); } private: CefRefPtr value_; @@ -571,7 +571,6 @@ class ListTask : public CefTask { IMPLEMENT_REFCOUNTING(ListTask); }; - void CreateAndCompareCopy(CefRefPtr value) { CefRefPtr value2 = value->Copy(); EXPECT_TRUE(value->IsEqual(value)); @@ -625,19 +624,18 @@ CefRefPtr CreateDictionaryValue() { } // namespace - // Test binary value access. TEST(ValuesTest, BinaryAccess) { char data[] = "This is my test data"; CefRefPtr value = - CefBinaryValue::Create(data, sizeof(data)-1); + CefBinaryValue::Create(data, sizeof(data) - 1); EXPECT_TRUE(value.get()); EXPECT_TRUE(value->IsValid()); EXPECT_FALSE(value->IsOwned()); // Test on this thread. - TestBinary(value, data, sizeof(data)-1); + TestBinary(value, data, sizeof(data) - 1); } // Test binary value access on a different thread. @@ -645,13 +643,13 @@ TEST(ValuesTest, BinaryAccessOtherThread) { char data[] = "This is my test data"; CefRefPtr value = - CefBinaryValue::Create(data, sizeof(data)-1); + CefBinaryValue::Create(data, sizeof(data) - 1); EXPECT_TRUE(value.get()); EXPECT_TRUE(value->IsValid()); EXPECT_FALSE(value->IsOwned()); // Test on a different thread. - CefPostTask(TID_UI, new BinaryTask(value, data, sizeof(data)-1)); + CefPostTask(TID_UI, new BinaryTask(value, data, sizeof(data) - 1)); WaitForUIThread(); } @@ -666,7 +664,7 @@ TEST(ValuesTest, DictionaryAccess) { char binary_data[] = "This is my test data"; // Test on this thread. - TestDictionary(value, binary_data, sizeof(binary_data)-1); + TestDictionary(value, binary_data, sizeof(binary_data) - 1); } // Test dictionary value access on a different thread. @@ -681,7 +679,7 @@ TEST(ValuesTest, DictionaryAccessOtherThread) { // Test on a different thread. CefPostTask(TID_UI, - new DictionaryTask(value, binary_data, sizeof(binary_data)-1)); + new DictionaryTask(value, binary_data, sizeof(binary_data) - 1)); WaitForUIThread(); } @@ -735,7 +733,7 @@ TEST(ValuesTest, ListAccess) { char binary_data[] = "This is my test data"; // Test on this thread. - TestList(value, binary_data, sizeof(binary_data)-1); + TestList(value, binary_data, sizeof(binary_data) - 1); } // Test list value access on a different thread. @@ -749,7 +747,8 @@ TEST(ValuesTest, ListAccessOtherThread) { char binary_data[] = "This is my test data"; // Test on a different thread. - CefPostTask(TID_UI, new ListTask(value, binary_data, sizeof(binary_data)-1)); + CefPostTask(TID_UI, + new ListTask(value, binary_data, sizeof(binary_data) - 1)); WaitForUIThread(); } diff --git a/tests/ceftests/views/button_unittest.cc b/tests/ceftests/views/button_unittest.cc index 35a7f2a56..7ce4d5ca1 100644 --- a/tests/ceftests/views/button_unittest.cc +++ b/tests/ceftests/views/button_unittest.cc @@ -96,8 +96,7 @@ void VerifyMenuButtonStyle(CefRefPtr button) { class EmptyMenuButtonDelegate : public CefMenuButtonDelegate { public: - EmptyMenuButtonDelegate() { - } + EmptyMenuButtonDelegate() {} void OnMenuButtonPressed(CefRefPtr menu_button, const CefPoint& screen_point) override { @@ -114,9 +113,8 @@ class EmptyMenuButtonDelegate : public CefMenuButtonDelegate { }; void LabelButtonStyle(bool with_frame) { - CefRefPtr button = - CefLabelButton::CreateLabelButton(new EmptyMenuButtonDelegate(), - kButtonText, with_frame); + CefRefPtr button = CefLabelButton::CreateLabelButton( + new EmptyMenuButtonDelegate(), kButtonText, with_frame); VerifyLabelButtonStyle(button); } @@ -129,10 +127,8 @@ void LabelButtonStyleFramelessImpl() { } void MenuButtonStyle(bool with_frame, bool with_menu_marker) { - CefRefPtr button = - CefMenuButton::CreateMenuButton(new EmptyMenuButtonDelegate(), - kButtonText, with_frame, - with_menu_marker); + CefRefPtr button = CefMenuButton::CreateMenuButton( + new EmptyMenuButtonDelegate(), kButtonText, with_frame, with_menu_marker); VerifyMenuButtonStyle(button); } @@ -162,7 +158,6 @@ BUTTON_TEST(MenuButtonStyleFramedNoMarker); BUTTON_TEST(MenuButtonStyleFramelessWithMarker); BUTTON_TEST(MenuButtonStyleFramelessNoMarker); - namespace { // Mouse click delay in MS. @@ -172,8 +167,7 @@ const int kButtonID = 1; class TestButtonDelegate : public CefButtonDelegate { public: - TestButtonDelegate() { - } + TestButtonDelegate() {} void OnButtonPressed(CefRefPtr button) override { EXPECT_TRUE(button.get()); @@ -194,8 +188,8 @@ void ClickButton(CefRefPtr window, int button_id) { // Determine the middle of the button in screen coordinates. const CefRect& bounds = button->GetBoundsInScreen(); - const CefPoint& click_point = CefPoint(bounds.x + bounds.width / 2, - bounds.y + bounds.height / 2); + const CefPoint& click_point = + CefPoint(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2); // Click the button. window->SendMouseMove(click_point.x, click_point.y); @@ -251,9 +245,8 @@ void LabelButtonClick(CefRefPtr event, bool with_button_image, bool with_window_frame) { TestWindowDelegate::Config config; - config.on_window_created = - base::Bind(RunLabelButtonClick, with_button_frame, with_button_text, - with_button_image); + config.on_window_created = base::Bind(RunLabelButtonClick, with_button_frame, + with_button_text, with_button_image); config.frameless = !with_window_frame; config.close_window = false; TestWindowDelegate::RunTest(event, config); @@ -361,7 +354,6 @@ BUTTON_TEST_ASYNC(LabelButtonClickFramelessNoTextNoImageFramedWindow); BUTTON_TEST_ASYNC(LabelButtonClickFramelessNoTextWithImageFramelessWindow); BUTTON_TEST_ASYNC(LabelButtonClickFramelessNoTextNoImageFramelessWindow); - namespace { const int kMenuItemID = 2; @@ -371,8 +363,8 @@ void ClickMenuItem(CefRefPtr menu_button) { // Determine the lower-right corner of the menu button, then offset a bit to // hit the first menu item. const CefRect& bounds = menu_button->GetBoundsInScreen(); - const CefPoint& click_point = CefPoint(bounds.x + bounds.width + 10, - bounds.y + bounds.height + 10); + const CefPoint& click_point = + CefPoint(bounds.x + bounds.width + 10, bounds.y + bounds.height + 10); // Click the menu item. CefRefPtr window = menu_button->GetWindow(); @@ -383,8 +375,7 @@ void ClickMenuItem(CefRefPtr menu_button) { class TestMenuButtonDelegate : public CefMenuButtonDelegate, public CefMenuModelDelegate { public: - TestMenuButtonDelegate() { - } + TestMenuButtonDelegate() {} void OnMenuButtonPressed(CefRefPtr menu_button, const CefPoint& screen_point) override { @@ -473,8 +464,7 @@ class TestMenuButtonDelegate : public CefMenuButtonDelegate, menu_button->ShowMenu(model, screen_point, CEF_MENU_ANCHOR_TOPLEFT); } - void OnButtonPressed(CefRefPtr button) override { - } + void OnButtonPressed(CefRefPtr button) override {} void ExecuteCommand(CefRefPtr menu_model, int command_id, @@ -515,7 +505,7 @@ void RunMenuButtonClick(bool with_frame, EXPECT_STREQ(kButtonText, button->GetText().ToString().c_str()); else EXPECT_TRUE(button->GetText().empty()); - + if (with_image) AddImage(button); diff --git a/tests/ceftests/views/panel_unittest.cc b/tests/ceftests/views/panel_unittest.cc index 96c233cf6..50d8add43 100644 --- a/tests/ceftests/views/panel_unittest.cc +++ b/tests/ceftests/views/panel_unittest.cc @@ -4,9 +4,9 @@ #include "include/views/cef_box_layout.h" #include "include/views/cef_fill_layout.h" +#include "include/views/cef_layout.h" #include "include/views/cef_panel.h" #include "include/views/cef_panel_delegate.h" -#include "include/views/cef_layout.h" #include "include/views/cef_window.h" #include "tests/ceftests/thread_helper.h" #include "tests/gtest/include/gtest/gtest.h" @@ -84,7 +84,6 @@ void CreatePanelWithDelegateImpl() { PANEL_TEST(CreatePanelNoDelegate); PANEL_TEST(CreatePanelWithDelegate); - namespace { class ParentPanelDelegate : public CefPanelDelegate { @@ -112,21 +111,17 @@ class ParentPanelDelegate : public CefPanelDelegate { bool added, CefRefPtr child) { EXPECT_LT(callback_index, static_cast(changed_.size())); - EXPECT_TRUE(view->IsSame(changed_[callback_index].view_)) << - "callback_index " << callback_index; - EXPECT_EQ(added, changed_[callback_index].added_) << - "callback_index " << callback_index; - EXPECT_TRUE(child->IsSame(changed_[callback_index].child_)) << - "callback_index " << callback_index; + EXPECT_TRUE(view->IsSame(changed_[callback_index].view_)) + << "callback_index " << callback_index; + EXPECT_EQ(added, changed_[callback_index].added_) + << "callback_index " << callback_index; + EXPECT_TRUE(child->IsSame(changed_[callback_index].child_)) + << "callback_index " << callback_index; } - void Reset() { - changed_.clear(); - } + void Reset() { changed_.clear(); } - bool IsReset() const { - return changed_.empty(); - } + bool IsReset() const { return changed_.empty(); } struct Changed { CefRefPtr view_; @@ -134,7 +129,7 @@ class ParentPanelDelegate : public CefPanelDelegate { CefRefPtr child_; }; std::vector changed_; - + private: IMPLEMENT_REFCOUNTING(ParentPanelDelegate); DISALLOW_COPY_AND_ASSIGN(ParentPanelDelegate); @@ -142,8 +137,7 @@ class ParentPanelDelegate : public CefPanelDelegate { class ChildPanelDelegate : public CefPanelDelegate { public: - ChildPanelDelegate() { - } + ChildPanelDelegate() {} void OnParentViewChanged(CefRefPtr view, bool added, @@ -161,9 +155,7 @@ class ChildPanelDelegate : public CefPanelDelegate { EXPECT_FALSE(true); // Not reached. } - void Verify(CefRefPtr view, - bool added, - CefRefPtr parent) { + void Verify(CefRefPtr view, bool added, CefRefPtr parent) { EXPECT_TRUE(on_parent_view_changed_); EXPECT_TRUE(view->IsSame(view_)); EXPECT_EQ(added, added_); @@ -177,9 +169,7 @@ class ChildPanelDelegate : public CefPanelDelegate { parent_ = nullptr; } - bool IsReset() const { - return !on_parent_view_changed_; - } + bool IsReset() const { return !on_parent_view_changed_; } bool on_parent_view_changed_ = false; CefRefPtr view_; @@ -434,7 +424,7 @@ void ChildOrderImpl() { parent_delegate->Reset(); EXPECT_EQ(3U, parent_panel->GetChildViewCount()); - + // ChildAddAt() will verify these results but let's check again just to make // sure. EXPECT_TRUE(child_panel3->IsSame(parent_panel->GetChildViewAt(0))); @@ -470,7 +460,7 @@ void ChildVisibleImpl() { EXPECT_TRUE(parent_panel->IsVisible()); EXPECT_TRUE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + parent_panel->AddChildView(child_panel1); parent_panel->AddChildView(child_panel2); @@ -481,28 +471,28 @@ void ChildVisibleImpl() { EXPECT_TRUE(parent_panel->IsVisible()); EXPECT_TRUE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + child_panel1->SetVisible(false); // Child1 not visible. EXPECT_TRUE(parent_panel->IsVisible()); EXPECT_FALSE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + child_panel1->SetVisible(true); // Everything visible. EXPECT_TRUE(parent_panel->IsVisible()); EXPECT_TRUE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + parent_panel->SetVisible(false); // Children visible. EXPECT_FALSE(parent_panel->IsVisible()); EXPECT_TRUE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + parent_panel->SetVisible(true); // Everything visible. @@ -525,7 +515,7 @@ void ChildDrawnImpl() { EXPECT_TRUE(parent_panel->IsVisible()); EXPECT_TRUE(child_panel1->IsVisible()); EXPECT_TRUE(child_panel2->IsVisible()); - + parent_panel->AddChildView(child_panel1); parent_panel->AddChildView(child_panel2); @@ -596,7 +586,6 @@ PANEL_TEST(ChildOrder); PANEL_TEST(ChildVisible); PANEL_TEST(ChildDrawn); - namespace { class SizingPanelDelegate : public CefPanelDelegate { @@ -642,10 +631,8 @@ class SizingPanelDelegate : public CefPanelDelegate { } bool IsReset() const { - return !got_get_preferred_size_ && - !got_get_minimum_size_ && - !got_get_maximum_size_ && - !got_get_height_for_width_; + return !got_get_preferred_size_ && !got_get_minimum_size_ && + !got_get_maximum_size_ && !got_get_height_for_width_; } CefSize preferred_size_; @@ -758,7 +745,6 @@ void SizeWithDelegateImpl() { PANEL_TEST(SizeNoDelegate); PANEL_TEST(SizeWithDelegate); - namespace { void FillLayoutCreateImpl() { @@ -933,7 +919,6 @@ PANEL_TEST(FillLayoutSizeHierarchy); PANEL_TEST(FillLayoutSizeHierarchyFromParentWithDelegate); PANEL_TEST(FillLayoutSizeHierarchyFromChildWithDelegate); - namespace { void BoxLayoutCreateImpl() { @@ -1078,8 +1063,8 @@ void BoxLayoutSizeHierarchyVerticalStretch(bool with_delegate) { CefRect expected_child1_bounds(0, 0, kBLParentSize, kBLChildSize); CefRect expected_child2_bounds(0, kBLChildSize, kBLParentSize, kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyVerticalStretchImpl() { @@ -1107,8 +1092,8 @@ void BoxLayoutSizeHierarchyHorizontalStretch(bool with_delegate) { CefRect expected_child1_bounds(0, 0, kBLChildSize, kBLParentSize); CefRect expected_child2_bounds(kBLChildSize, 0, kBLChildSize, kBLParentSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyHorizontalStretchImpl() { @@ -1135,11 +1120,11 @@ void BoxLayoutSizeHierarchyVerticalCenter(bool with_delegate) { int xoffset = (kBLParentSize - kBLChildSize) / 2; CefRect expected_child1_bounds(xoffset, 0, kBLChildSize, kBLChildSize); - CefRect expected_child2_bounds(xoffset, kBLChildSize, - kBLChildSize, kBLChildSize); + CefRect expected_child2_bounds(xoffset, kBLChildSize, kBLChildSize, + kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyVerticalCenterImpl() { @@ -1167,11 +1152,11 @@ void BoxLayoutSizeHierarchyHorizontalCenter(bool with_delegate) { int yoffset = (kBLParentSize - kBLChildSize) / 2; CefRect expected_child1_bounds(0, yoffset, kBLChildSize, kBLChildSize); - CefRect expected_child2_bounds(kBLChildSize, yoffset, - kBLChildSize, kBLChildSize); + CefRect expected_child2_bounds(kBLChildSize, yoffset, kBLChildSize, + kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyHorizontalCenterImpl() { @@ -1199,13 +1184,12 @@ void BoxLayoutSizeHierarchyVerticalCenterCenter(bool with_delegate) { int xoffset = (kBLParentSize - kBLChildSize) / 2; int yoffset = (kBLParentSize - (kBLChildSize * 2)) / 2; - CefRect expected_child1_bounds(xoffset, yoffset, - kBLChildSize, kBLChildSize); - CefRect expected_child2_bounds(xoffset, yoffset + kBLChildSize, - kBLChildSize, kBLChildSize); + CefRect expected_child1_bounds(xoffset, yoffset, kBLChildSize, kBLChildSize); + CefRect expected_child2_bounds(xoffset, yoffset + kBLChildSize, kBLChildSize, + kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyVerticalCenterCenterImpl() { @@ -1235,13 +1219,12 @@ void BoxLayoutSizeHierarchyHorizontalCenterCenter(bool with_delegate) { int xoffset = (kBLParentSize - (kBLChildSize * 2)) / 2; int yoffset = (kBLParentSize - kBLChildSize) / 2; - CefRect expected_child1_bounds(xoffset, yoffset, - kBLChildSize, kBLChildSize); - CefRect expected_child2_bounds(xoffset + kBLChildSize, yoffset, - kBLChildSize, kBLChildSize); + CefRect expected_child1_bounds(xoffset, yoffset, kBLChildSize, kBLChildSize); + CefRect expected_child2_bounds(xoffset + kBLChildSize, yoffset, kBLChildSize, + kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds); } void BoxLayoutSizeHierarchyHorizontalCenterCenterImpl() { @@ -1268,11 +1251,11 @@ void BoxLayoutSizeHierarchyVerticalStretchFlexOne(bool with_delegate) { CefRect expected_child1_bounds(0, 0, kBLParentSize, kBLParentSize - kBLChildSize); - CefRect expected_child2_bounds(0, kBLParentSize - kBLChildSize, - kBLParentSize, kBLChildSize); + CefRect expected_child2_bounds(0, kBLParentSize - kBLChildSize, kBLParentSize, + kBLChildSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds, 1, 0); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds, 1, 0); } void BoxLayoutSizeHierarchyVerticalStretchFlexOneImpl() { @@ -1300,11 +1283,11 @@ void BoxLayoutSizeHierarchyHorizontalStretchFlexOne(bool with_delegate) { CefRect expected_child1_bounds(0, 0, kBLParentSize - kBLChildSize, kBLParentSize); - CefRect expected_child2_bounds(kBLParentSize - kBLChildSize, 0, - kBLChildSize, kBLParentSize); + CefRect expected_child2_bounds(kBLParentSize - kBLChildSize, 0, kBLChildSize, + kBLParentSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds, 1, 0); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds, 1, 0); } void BoxLayoutSizeHierarchyHorizontalStretchFlexOneImpl() { @@ -1334,8 +1317,8 @@ void BoxLayoutSizeHierarchyVerticalStretchFlexBoth(bool with_delegate) { CefRect expected_child2_bounds(0, kBLParentSize / 2, kBLParentSize, kBLParentSize / 2); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds, 1, 1); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds, 1, 1); } void BoxLayoutSizeHierarchyVerticalStretchFlexBothImpl() { @@ -1365,8 +1348,8 @@ void BoxLayoutSizeHierarchyHorizontalStretchFlexBoth(bool with_delegate) { CefRect expected_child2_bounds(kBLParentSize / 2, 0, kBLParentSize / 2, kBLParentSize); - BoxLayoutSizeHierarchy(with_delegate, settings, - expected_child1_bounds, expected_child2_bounds, 1, 1); + BoxLayoutSizeHierarchy(with_delegate, settings, expected_child1_bounds, + expected_child2_bounds, 1, 1); } void BoxLayoutSizeHierarchyHorizontalStretchFlexBothImpl() { diff --git a/tests/ceftests/views/scroll_view_unittest.cc b/tests/ceftests/views/scroll_view_unittest.cc index 5deacb2db..fe0aa344b 100644 --- a/tests/ceftests/views/scroll_view_unittest.cc +++ b/tests/ceftests/views/scroll_view_unittest.cc @@ -13,7 +13,7 @@ #include "tests/gtest/include/gtest/gtest.h" #define SCROLL_VIEW_TEST_ASYNC(name) \ - UI_THREAD_TEST_ASYNC(ViewsScrollViewTest, name) + UI_THREAD_TEST_ASYNC(ViewsScrollViewTest, name) namespace { @@ -25,8 +25,7 @@ const int kContentPanelSize = TestWindowDelegate::kWSize + 200; class TestScrollViewDelegate : public CefViewDelegate { public: - TestScrollViewDelegate() { - } + TestScrollViewDelegate() {} CefSize GetPreferredSize(CefRefPtr view) override { EXPECT_EQ(kScrollViewID, view->GetID()); @@ -43,8 +42,7 @@ class TestScrollViewDelegate : public CefViewDelegate { class TestPanelDelegate : public CefPanelDelegate { public: - TestPanelDelegate() { - } + TestPanelDelegate() {} CefSize GetPreferredSize(CefRefPtr view) override { EXPECT_EQ(kContentPanelID, view->GetID()); @@ -59,8 +57,7 @@ class TestPanelDelegate : public CefPanelDelegate { DISALLOW_COPY_AND_ASSIGN(TestPanelDelegate); }; -void RunScrollViewLayout(bool with_delegate, - CefRefPtr window) { +void RunScrollViewLayout(bool with_delegate, CefRefPtr window) { CefRefPtr scroll_view_delegate; CefRefPtr panel_delegate; if (with_delegate) { @@ -128,11 +125,11 @@ void RunScrollViewLayout(bool with_delegate, // Verify visible content panel region. const CefRect& visible_rect = scroll_view->GetVisibleContentRect(); EXPECT_EQ(CefRect(0, 0, scroll_view_bounds.width - sb_width, - scroll_view_bounds.height - sb_height), visible_rect); + scroll_view_bounds.height - sb_height), + visible_rect); } -void ScrollViewLayout(CefRefPtr event, - bool with_delegate) { +void ScrollViewLayout(CefRefPtr event, bool with_delegate) { TestWindowDelegate::Config config; config.on_window_created = base::Bind(RunScrollViewLayout, with_delegate); TestWindowDelegate::RunTest(event, config); diff --git a/tests/ceftests/views/test_window_delegate.cc b/tests/ceftests/views/test_window_delegate.cc index 29b13a42a..6487c4e6a 100644 --- a/tests/ceftests/views/test_window_delegate.cc +++ b/tests/ceftests/views/test_window_delegate.cc @@ -24,8 +24,7 @@ const int TestWindowDelegate::kWSize = 400; // static void TestWindowDelegate::RunTest(CefRefPtr event, const Config& config) { - CefWindow::CreateTopLevelWindow( - new TestWindowDelegate(event, config)); + CefWindow::CreateTopLevelWindow(new TestWindowDelegate(event, config)); } void TestWindowDelegate::OnWindowCreated(CefRefPtr window) { @@ -73,15 +72,15 @@ void TestWindowDelegate::OnWindowCreated(CefRefPtr window) { if (config_.close_window) { // Close the window asynchronously. - CefPostTask(TID_UI, - base::Bind(&TestWindowDelegate::OnCloseWindow, this)); + CefPostTask(TID_UI, base::Bind(&TestWindowDelegate::OnCloseWindow, this)); } else if (!CefCommandLine::GetGlobalCommandLine()->HasSwitch( "disable-test-timeout")) { // Timeout the test after a reasonable delay. Use a WeakPtr so that the // delayed task doesn't keep this object alive. CefPostDelayedTask(TID_UI, - base::Bind(&TestWindowDelegate::OnTimeoutWindow, - weak_ptr_factory_.GetWeakPtr()), kTestTimeout); + base::Bind(&TestWindowDelegate::OnTimeoutWindow, + weak_ptr_factory_.GetWeakPtr()), + kTestTimeout); } } @@ -128,10 +127,7 @@ bool TestWindowDelegate::OnKeyEvent(CefRefPtr window, TestWindowDelegate::TestWindowDelegate(CefRefPtr event, const Config& config) - : event_(event), - config_(config), - weak_ptr_factory_(this) { -} + : event_(event), config_(config), weak_ptr_factory_(this) {} TestWindowDelegate::~TestWindowDelegate() { // Complete the test (signal the event) asynchronously so objects on the call diff --git a/tests/ceftests/views/test_window_delegate.h b/tests/ceftests/views/test_window_delegate.h index bff26d72d..a06dbdc2b 100644 --- a/tests/ceftests/views/test_window_delegate.h +++ b/tests/ceftests/views/test_window_delegate.h @@ -16,8 +16,8 @@ class TestWindowDelegate : public CefWindowDelegate { // Test execution callback. typedef base::Callback)> OnWindowCreatedCallback; typedef base::Callback)> OnWindowDestroyedCallback; - typedef base::Callback,int)> OnAcceleratorCallback; - typedef base::Callback,const CefKeyEvent&)> + typedef base::Callback, int)> OnAcceleratorCallback; + typedef base::Callback, const CefKeyEvent&)> OnKeyEventCallback; struct Config { @@ -36,8 +36,7 @@ class TestWindowDelegate : public CefWindowDelegate { // without a frame. If |close_window| is true the Window will be closed // immediately after |window_test| returns. Otherwise, the caller is // responsible for closing the Window passed to |window_test|. - static void RunTest(CefRefPtr event, - const Config& config); + static void RunTest(CefRefPtr event, const Config& config); // CefWindowDelegate methods: void OnWindowCreated(CefRefPtr window) override; @@ -49,8 +48,7 @@ class TestWindowDelegate : public CefWindowDelegate { const CefKeyEvent& event) override; private: - TestWindowDelegate(CefRefPtr event, - const Config& config); + TestWindowDelegate(CefRefPtr event, const Config& config); ~TestWindowDelegate() override; void OnCloseWindow(); diff --git a/tests/ceftests/views/textfield_unittest.cc b/tests/ceftests/views/textfield_unittest.cc index 7008af62c..a57509de9 100644 --- a/tests/ceftests/views/textfield_unittest.cc +++ b/tests/ceftests/views/textfield_unittest.cc @@ -12,22 +12,22 @@ #include "tests/gtest/include/gtest/gtest.h" // See ui/events/keycodes/keyboard_codes.h -#define VKEY_UNKNOWN 0 +#define VKEY_UNKNOWN 0 #if defined(OS_WIN) -#define VKEY_A 'A' -#define VKEY_SPACE VK_SPACE -#define VKEY_RETURN VK_RETURN +#define VKEY_A 'A' +#define VKEY_SPACE VK_SPACE +#define VKEY_RETURN VK_RETURN #elif defined(OS_POSIX) -#define VKEY_A 0x41 -#define VKEY_SPACE 0x20 -#define VKEY_RETURN 0x0D +#define VKEY_A 0x41 +#define VKEY_SPACE 0x20 +#define VKEY_RETURN 0x0D #else #error "Unsupported platform" #endif #define TEXTFIELD_TEST(name) UI_THREAD_TEST(ViewsTextfieldTest, name) #define TEXTFIELD_TEST_ASYNC(name) \ - UI_THREAD_TEST_ASYNC(ViewsTextfieldTest, name) + UI_THREAD_TEST_ASYNC(ViewsTextfieldTest, name) namespace { @@ -59,9 +59,9 @@ void TextfieldContentsImpl() { // Test select range. EXPECT_FALSE(textfield->HasSelection()); - EXPECT_EQ(CefRange(static_cast(cursor_pos), - static_cast(cursor_pos)), - textfield->GetSelectedRange()); + EXPECT_EQ( + CefRange(static_cast(cursor_pos), static_cast(cursor_pos)), + textfield->GetSelectedRange()); textfield->SelectRange(CefRange(0, static_cast(cursor_pos))); EXPECT_TRUE(textfield->HasSelection()); EXPECT_EQ(CefRange(0, static_cast(cursor_pos)), @@ -91,9 +91,9 @@ void TextfieldContentsImpl() { // Test clear selection. textfield->ClearSelection(); EXPECT_FALSE(textfield->HasSelection()); - EXPECT_EQ(CefRange(static_cast(cursor_pos), - static_cast(cursor_pos)), - textfield->GetSelectedRange()); + EXPECT_EQ( + CefRange(static_cast(cursor_pos), static_cast(cursor_pos)), + textfield->GetSelectedRange()); EXPECT_EQ(cursor_pos, textfield->GetCursorPosition()); // Test selection with command. @@ -166,7 +166,6 @@ void TextfieldStyleImpl() { TEXTFIELD_TEST(TextfieldContents); TEXTFIELD_TEST(TextfieldStyle); - namespace { const int kTextfieldID = 1; @@ -190,8 +189,7 @@ void TranslateKey(int c, int* keycode, uint32* modifiers) { class TestTextfieldDelegate : public CefTextfieldDelegate { public: - TestTextfieldDelegate() { - } + TestTextfieldDelegate() {} bool OnKeyEvent(CefRefPtr textfield, const CefKeyEvent& event) override { @@ -201,8 +199,8 @@ class TestTextfieldDelegate : public CefTextfieldDelegate { if (event.type == KEYEVENT_RAWKEYDOWN && event.windows_key_code == VKEY_RETURN) { // Got the whole string. Finish the test asynchronously. - CefPostTask(TID_UI, - base::Bind(&TestTextfieldDelegate::FinishTest, this, textfield)); + CefPostTask(TID_UI, base::Bind(&TestTextfieldDelegate::FinishTest, this, + textfield)); return true; } @@ -242,8 +240,8 @@ class TestTextfieldDelegate : public CefTextfieldDelegate { }; void RunTextfieldKeyEvent(CefRefPtr window) { - CefRefPtr textfield = CefTextfield::CreateTextfield( - new TestTextfieldDelegate()); + CefRefPtr textfield = + CefTextfield::CreateTextfield(new TestTextfieldDelegate()); textfield->SetID(kTextfieldID); EXPECT_TRUE(textfield->AsTextfield()); diff --git a/tests/ceftests/views/window_unittest.cc b/tests/ceftests/views/window_unittest.cc index d8d70a349..b596051f8 100644 --- a/tests/ceftests/views/window_unittest.cc +++ b/tests/ceftests/views/window_unittest.cc @@ -4,8 +4,8 @@ #include "include/base/cef_bind.h" #include "include/views/cef_box_layout.h" -#include "include/views/cef_panel.h" #include "include/views/cef_layout.h" +#include "include/views/cef_panel.h" #include "include/wrapper/cef_closure_task.h" #include "tests/ceftests/image_util.h" #include "tests/ceftests/thread_helper.h" @@ -15,7 +15,7 @@ #define WINDOW_TEST_ASYNC(name) UI_THREAD_TEST_ASYNC(ViewsWindowTest, name) #if !defined(OS_WIN) -#define VK_MENU 0x12 // ALT key. +#define VK_MENU 0x12 // ALT key. #endif namespace { @@ -86,7 +86,7 @@ void CreateBoxLayout(CefRefPtr parent) { panel_child2->SetBackgroundColor(CefColorSetARGB(255, 0, 255, 0)); EXPECT_TRUE(panel_child2->IsVisible()); EXPECT_FALSE(panel_child2->IsDrawn()); - + // Set to BoxLayout. Default layout is vertical with children stretched along // the horizontal axis. CefBoxLayoutSettings settings; @@ -109,8 +109,8 @@ void CreateBoxLayout(CefRefPtr parent) { parent->Layout(); // The children should each take up 50% of the client area. - ExpectCloseRects(CefRect(0, 0, kWSize, kWSize / 2), - panel_child1->GetBounds(), 1); + ExpectCloseRects(CefRect(0, 0, kWSize, kWSize / 2), panel_child1->GetBounds(), + 1); ExpectCloseRects(CefRect(0, kWSize / 2, kWSize, kWSize / 2), panel_child2->GetBounds(), 1); } diff --git a/tests/ceftests/waitable_event_unittest.cc b/tests/ceftests/waitable_event_unittest.cc index 8ba6c8d76..4e55655c7 100644 --- a/tests/ceftests/waitable_event_unittest.cc +++ b/tests/ceftests/waitable_event_unittest.cc @@ -67,8 +67,9 @@ TEST(WaitableEventTest, WaitAndDelete) { CefRefPtr thread = CefThread::CreateThread("waitable_event_test"); thread->GetTaskRunner()->PostDelayedTask( - CefCreateClosureTask(base::Bind(SignalEvent, - base::Unretained(event.get()))), 10); + CefCreateClosureTask( + base::Bind(SignalEvent, base::Unretained(event.get()))), + 10); event->Wait(); event = nullptr; diff --git a/tests/ceftests/webui_unittest.cc b/tests/ceftests/webui_unittest.cc index 83ca24e09..9612b40fe 100644 --- a/tests/ceftests/webui_unittest.cc +++ b/tests/ceftests/webui_unittest.cc @@ -16,9 +16,7 @@ typedef std::vector UrlList; class WebUITestHandler : public TestHandler { public: explicit WebUITestHandler(const UrlList& url_list) - : url_list_(url_list), - url_index_(0U), - expected_error_code_(ERR_NONE) { + : url_list_(url_list), url_index_(0U), expected_error_code_(ERR_NONE) { CHECK(!url_list_.empty()); } @@ -44,8 +42,8 @@ class WebUITestHandler : public TestHandler { if (++url_index_ == url_list_.size()) { next_action = base::Bind(&WebUITestHandler::DestroyTest, this); } else { - next_action = base::Bind(&WebUITestHandler::LoadURL, this, - url_list_[url_index_]); + next_action = + base::Bind(&WebUITestHandler::LoadURL, this, url_list_[url_index_]); } // Wait a bit for the WebUI content to finish loading before performing the @@ -79,8 +77,8 @@ class WebUITestHandler : public TestHandler { const CefString& errorText, const CefString& failedUrl) override { got_load_error_.yes(); - EXPECT_EQ(expected_error_code_, errorCode) << - "failedUrl = " << failedUrl.ToString(); + EXPECT_EQ(expected_error_code_, errorCode) + << "failedUrl = " << failedUrl.ToString(); } void DestroyTest() override { @@ -105,7 +103,6 @@ class WebUITestHandler : public TestHandler { } // namespace - // Test hosts with special behaviors. // Non-existing URLs should redirect to chrome://version/. @@ -140,7 +137,6 @@ TEST(WebUITest, network_error) { ReleaseAndWaitForDestructor(handler); } - // Test hosts with a single URL. namespace { @@ -159,11 +155,11 @@ void RunWebUITest(const std::string& url) { } // namespace -#define WEBUI_TEST(name) \ - TEST(WebUITest, name) { \ - std::string name_str = #name; \ +#define WEBUI_TEST(name) \ + TEST(WebUITest, name) { \ + std::string name_str = #name; \ std::replace(name_str.begin(), name_str.end(), '_', '-'); \ - RunWebUITest("chrome://" + name_str + "/"); \ + RunWebUITest("chrome://" + name_str + "/"); \ } WEBUI_TEST(appcache_internals); @@ -185,7 +181,6 @@ WEBUI_TEST(view_http_cache); WEBUI_TEST(webrtc_internals); WEBUI_TEST(webui_hosts); - // Test hosts with multiple URLs. TEST(WebUITest, net_internals) { diff --git a/tests/ceftests/xml_reader_unittest.cc b/tests/ceftests/xml_reader_unittest.cc index 43bbc0da7..ec79258d8 100644 --- a/tests/ceftests/xml_reader_unittest.cc +++ b/tests/ceftests/xml_reader_unittest.cc @@ -39,9 +39,8 @@ TEST(XmlReaderTest, Read) { ASSERT_TRUE(stream.get() != NULL); // Create the XML reader. - CefRefPtr reader( - CefXmlReader::Create(stream, XML_ENCODING_NONE, - "http://www.example.org/example.xml")); + CefRefPtr reader(CefXmlReader::Create( + stream, XML_ENCODING_NONE, "http://www.example.org/example.xml")); ASSERT_TRUE(reader.get() != NULL); // Move to the processing instruction node. @@ -74,7 +73,7 @@ TEST(XmlReaderTest, Read) { ASSERT_EQ(reader->GetAttribute(0), "http://www.example.org/ns"); ASSERT_EQ(reader->GetAttribute("xmlns:ns"), "http://www.example.org/ns"); ASSERT_EQ(reader->GetAttribute("ns", "http://www.w3.org/2000/xmlns/"), - "http://www.example.org/ns"); + "http://www.example.org/ns"); // Move to the whitespace node. ASSERT_TRUE(reader->MoveToNextNode()); @@ -267,8 +266,8 @@ TEST(XmlReaderTest, Read) { ASSERT_FALSE(reader->HasValue()); ASSERT_EQ(reader->GetInnerXml(), "this is mixed content &EA;"); ASSERT_EQ(reader->GetOuterXml(), - "" - "this is mixed content &EA;"); + "" + "this is mixed content &EA;"); // Move to the element node. ASSERT_TRUE(reader->MoveToNextNode()); @@ -361,11 +360,11 @@ TEST(XmlReaderTest, Read) { ASSERT_EQ(reader->GetAttribute(0), "value C1"); ASSERT_EQ(reader->GetAttribute("ns:attr1"), "value C1"); ASSERT_EQ(reader->GetAttribute("attr1", "http://www.example.org/ns"), - "value C1"); + "value C1"); ASSERT_EQ(reader->GetAttribute(1), "value C2"); ASSERT_EQ(reader->GetAttribute("ns:attr2"), "value C2"); ASSERT_EQ(reader->GetAttribute("attr2", "http://www.example.org/ns"), - "value C2"); + "value C2"); // Move to the ns:attr1 attribute. ASSERT_TRUE(reader->MoveToFirstAttribute()); @@ -498,8 +497,8 @@ TEST(XmlReaderTest, Read) { // Test XML read error handling. TEST(XmlReaderTest, ReadError) { char test_str[] = - "\n" - "\n"; + "\n" + "\n"; // Create the stream reader. CefRefPtr stream( @@ -507,9 +506,8 @@ TEST(XmlReaderTest, ReadError) { ASSERT_TRUE(stream.get() != NULL); // Create the XML reader. - CefRefPtr reader( - CefXmlReader::Create(stream, XML_ENCODING_NONE, - "http://www.example.org/example.xml")); + CefRefPtr reader(CefXmlReader::Create( + stream, XML_ENCODING_NONE, "http://www.example.org/example.xml")); ASSERT_TRUE(reader.get() != NULL); // Move to the processing instruction node and generate parser error. @@ -527,7 +525,7 @@ TEST(XmlReaderTest, ObjectLoad) { // Create the XML reader. CefRefPtr object(new CefXmlObject("object")); ASSERT_TRUE(object->Load(stream, XML_ENCODING_NONE, - "http://www.example.org/example.xml", NULL)); + "http://www.example.org/example.xml", NULL)); ASSERT_FALSE(object->HasAttributes()); ASSERT_TRUE(object->HasChildren()); @@ -570,8 +568,7 @@ TEST(XmlReaderTest, ObjectLoad) { obj_child = obj_child->FindChild("ns:objB_4"); ASSERT_TRUE(obj_child.get()); ASSERT_TRUE(obj_child->HasValue()); - ASSERT_EQ(obj_child->GetValue(), - "this is mixed content EA Value"); + ASSERT_EQ(obj_child->GetValue(), "this is mixed content EA Value"); } else if (ct == 2) { // ns:objC ASSERT_EQ(obj_child->GetName(), "ns:objC"); @@ -616,9 +613,10 @@ TEST(XmlReaderTest, ObjectLoadError) { // Create the XML reader. CefRefPtr object(new CefXmlObject("object")); ASSERT_FALSE(object->Load(stream, XML_ENCODING_NONE, - "http://www.example.org/example.xml", &error_str)); + "http://www.example.org/example.xml", + &error_str)); ASSERT_EQ(error_str, - "Opening and ending tag mismatch: foo line 2 and obj, line 3"); + "Opening and ending tag mismatch: foo line 2 and obj, line 3"); } // Test value following child error. @@ -635,8 +633,8 @@ TEST(XmlReaderTest, ObjectLoadError) { // Create the XML reader. CefRefPtr object(new CefXmlObject("object")); ASSERT_FALSE(object->Load(stream, XML_ENCODING_NONE, - "http://www.example.org/example.xml", &error_str)); - ASSERT_EQ(error_str, - "Value following child element, line 4"); + "http://www.example.org/example.xml", + &error_str)); + ASSERT_EQ(error_str, "Value following child element, line 4"); } } diff --git a/tests/ceftests/zip_reader_unittest.cc b/tests/ceftests/zip_reader_unittest.cc index fd7d57317..5deca0593 100644 --- a/tests/ceftests/zip_reader_unittest.cc +++ b/tests/ceftests/zip_reader_unittest.cc @@ -9,7 +9,7 @@ namespace { - unsigned char g_test_zip[] = { +unsigned char g_test_zip[] = { 0x50, 0x4b, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x7f, 0x57, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61, @@ -119,8 +119,7 @@ namespace { 0x65, 0x2f, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x32, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x32, 0x61, 0x2e, 0x74, 0x78, 0x74, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x09, 0x00, 0x9d, 0x02, - 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 - }; + 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}; } // namespace @@ -175,7 +174,7 @@ TEST(ZipReaderTest, Read) { ASSERT_TRUE(reader->MoveToNextFile()); ASSERT_EQ(reader->GetFileName(), - "test_archive/folder 1/folder 1a/file 1a1.txt"); + "test_archive/folder 1/folder 1a/file 1a1.txt"); ASSERT_EQ(reader->GetFileSize(), 21); ASSERT_TRUE(reader->OpenFile("")); ASSERT_EQ(reader->ReadFile(buff, sizeof(buff)), 21); @@ -236,7 +235,7 @@ TEST(ZipReaderTest, ReadArchive) { ASSERT_EQ(file->GetDataSize(), (size_t)20); ASSERT_TRUE(!strncmp(reinterpret_cast(file->GetData()), - "Contents of file 2A.", 20)); + "Contents of file 2A.", 20)); // Test stream reading. CefRefPtr reader(file->GetStreamReader()); diff --git a/tests/shared/browser/client_app_browser.cc b/tests/shared/browser/client_app_browser.cc index ae0abb8af..d688ff8f0 100644 --- a/tests/shared/browser/client_app_browser.cc +++ b/tests/shared/browser/client_app_browser.cc @@ -69,7 +69,7 @@ void ClientAppBrowser::OnContextInitialized() { } void ClientAppBrowser::OnBeforeChildProcessLaunch( - CefRefPtr command_line) { + CefRefPtr command_line) { DelegateSet::iterator it = delegates_.begin(); for (; it != delegates_.end(); ++it) (*it)->OnBeforeChildProcessLaunch(this, command_line); diff --git a/tests/shared/browser/client_app_browser.h b/tests/shared/browser/client_app_browser.h index a64ee4ae0..1f259945d 100644 --- a/tests/shared/browser/client_app_browser.h +++ b/tests/shared/browser/client_app_browser.h @@ -13,8 +13,7 @@ namespace client { // Client app implementation for the browser process. -class ClientAppBrowser : public ClientApp, - public CefBrowserProcessHandler { +class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler { public: // Interface for browser delegates. All Delegates must be returned via // CreateDelegates. Do not perform work in the Delegate @@ -36,7 +35,7 @@ class ClientAppBrowser : public ClientApp, CefRefPtr extra_info) {} }; - typedef std::set > DelegateSet; + typedef std::set> DelegateSet; ClientAppBrowser(); diff --git a/tests/shared/browser/main_message_loop.h b/tests/shared/browser/main_message_loop.h index 59dc72c6c..ac0101285 100644 --- a/tests/shared/browser/main_message_loop.h +++ b/tests/shared/browser/main_message_loop.h @@ -61,15 +61,14 @@ class MainMessageLoop { }; #define CURRENTLY_ON_MAIN_THREAD() \ - client::MainMessageLoop::Get()->RunsTasksOnCurrentThread() + client::MainMessageLoop::Get()->RunsTasksOnCurrentThread() #define REQUIRE_MAIN_THREAD() DCHECK(CURRENTLY_ON_MAIN_THREAD()) -#define MAIN_POST_TASK(task) \ - client::MainMessageLoop::Get()->PostTask(task) +#define MAIN_POST_TASK(task) client::MainMessageLoop::Get()->PostTask(task) #define MAIN_POST_CLOSURE(closure) \ - client::MainMessageLoop::Get()->PostClosure(closure) + client::MainMessageLoop::Get()->PostClosure(closure) // Use this struct in conjuction with RefCountedThreadSafe to ensure that an // object is deleted on the main thread. For example: @@ -92,7 +91,7 @@ class MainMessageLoop { // foo = NULL; // Deletion of |foo| will occur on the main thread. // struct DeleteOnMainThread { - template + template static void Destruct(const T* x) { if (CURRENTLY_ON_MAIN_THREAD()) { delete x; diff --git a/tests/shared/browser/main_message_loop_external_pump.cc b/tests/shared/browser/main_message_loop_external_pump.cc index d64f6dc03..bca6fdb23 100644 --- a/tests/shared/browser/main_message_loop_external_pump.cc +++ b/tests/shared/browser/main_message_loop_external_pump.cc @@ -24,11 +24,10 @@ const int64 kMaxTimerDelay = 1000 / 30; // 30fps client::MainMessageLoopExternalPump* g_external_message_pump = NULL; -} // namespace +} // namespace MainMessageLoopExternalPump::MainMessageLoopExternalPump() - : is_active_(false), - reentrancy_detected_(false) { + : is_active_(false), reentrancy_detected_(false) { DCHECK(!g_external_message_pump); g_external_message_pump = this; } diff --git a/tests/shared/browser/main_message_loop_external_pump_linux.cc b/tests/shared/browser/main_message_loop_external_pump_linux.cc index f3b609b8b..1afe8feb0 100644 --- a/tests/shared/browser/main_message_loop_external_pump_linux.cc +++ b/tests/shared/browser/main_message_loop_external_pump_linux.cc @@ -22,25 +22,27 @@ #if !defined(HANDLE_EINTR) #if !DCHECK_IS_ON() -#define HANDLE_EINTR(x) ({ \ - decltype(x) eintr_wrapper_result; \ - do { \ - eintr_wrapper_result = (x); \ - } while (eintr_wrapper_result == -1 && errno == EINTR); \ - eintr_wrapper_result; \ -}) +#define HANDLE_EINTR(x) \ + ({ \ + decltype(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + } while (eintr_wrapper_result == -1 && errno == EINTR); \ + eintr_wrapper_result; \ + }) #else -#define HANDLE_EINTR(x) ({ \ - int eintr_wrapper_counter = 0; \ - decltype(x) eintr_wrapper_result; \ - do { \ - eintr_wrapper_result = (x); \ - } while (eintr_wrapper_result == -1 && errno == EINTR && \ - eintr_wrapper_counter++ < 100); \ - eintr_wrapper_result; \ -}) +#define HANDLE_EINTR(x) \ + ({ \ + int eintr_wrapper_counter = 0; \ + decltype(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + } while (eintr_wrapper_result == -1 && errno == EINTR && \ + eintr_wrapper_counter++ < 100); \ + eintr_wrapper_result; \ + }) #endif // !DCHECK_IS_ON() #endif // !defined(HANDLE_EINTR) @@ -114,8 +116,8 @@ int GetTimeIntervalMilliseconds(const CefTime& from) { // Be careful here. CefTime has a precision of microseconds, but we want a // value in milliseconds. If there are 5.5ms left, should the delay be 5 or // 6? It should be 6 to avoid executing delayed work too early. - int delay = static_cast( - ceil((from.GetDoubleT() - now.GetDoubleT()) * 1000.0)); + int delay = + static_cast(ceil((from.GetDoubleT() - now.GetDoubleT()) * 1000.0)); // If this value is negative, then we need to run delayed work soon. return delay < 0 ? 0 : delay; @@ -125,8 +127,7 @@ struct WorkSource : public GSource { MainMessageLoopExternalPumpLinux* pump; }; -gboolean WorkSourcePrepare(GSource* source, - gint* timeout_ms) { +gboolean WorkSourcePrepare(GSource* source, gint* timeout_ms) { *timeout_ms = static_cast(source)->pump->HandlePrepare(); // We always return FALSE, so that our timeout is honored. If we were // to return TRUE, the timeout would be considered to be 0 and the poll @@ -142,31 +143,26 @@ gboolean WorkSourceCheck(GSource* source) { gboolean WorkSourceDispatch(GSource* source, GSourceFunc unused_func, gpointer unused_data) { - static_cast(source)->pump->HandleDispatch(); // Always return TRUE so our source stays registered. return TRUE; } // I wish these could be const, but g_source_new wants non-const. -GSourceFuncs WorkSourceFuncs = { - WorkSourcePrepare, - WorkSourceCheck, - WorkSourceDispatch, - NULL -}; +GSourceFuncs WorkSourceFuncs = {WorkSourcePrepare, WorkSourceCheck, + WorkSourceDispatch, NULL}; MainMessageLoopExternalPumpLinux::MainMessageLoopExternalPumpLinux() - : should_quit_(false), - context_(g_main_context_default()), - wakeup_gpollfd_(new GPollFD) { + : should_quit_(false), + context_(g_main_context_default()), + wakeup_gpollfd_(new GPollFD) { // Create our wakeup pipe, which is used to flag when work was scheduled. int fds[2]; int ret = pipe(fds); DCHECK_EQ(ret, 0); (void)ret; // Prevent warning in release mode. - wakeup_pipe_read_ = fds[0]; + wakeup_pipe_read_ = fds[0]; wakeup_pipe_write_ = fds[1]; wakeup_gpollfd_->fd = wakeup_pipe_read_; wakeup_gpollfd_->events = G_IO_IN; @@ -231,7 +227,7 @@ void MainMessageLoopExternalPumpLinux::OnScheduleMessagePumpWork( // variables as we would then need locks all over. This ensures that if we // are sleeping in a poll that we will wake up. if (HANDLE_EINTR(write(wakeup_pipe_write_, &delay_ms, sizeof(int64))) != - sizeof(int64)) { + sizeof(int64)) { NOTREACHED() << "Could not write to the UI message loop wakeup pipe!"; } } @@ -293,11 +289,10 @@ bool MainMessageLoopExternalPumpLinux::IsTimerPending() { return GetTimeIntervalMilliseconds(delayed_work_time_) > 0; } -} // namespace +} // namespace // static -scoped_ptr -MainMessageLoopExternalPump::Create() { +scoped_ptr MainMessageLoopExternalPump::Create() { return scoped_ptr( new MainMessageLoopExternalPumpLinux()); } diff --git a/tests/shared/browser/main_message_loop_external_pump_mac.mm b/tests/shared/browser/main_message_loop_external_pump_mac.mm index 995367e6a..fd1fae10a 100644 --- a/tests/shared/browser/main_message_loop_external_pump_mac.mm +++ b/tests/shared/browser/main_message_loop_external_pump_mac.mm @@ -4,8 +4,8 @@ #include "tests/shared/browser/main_message_loop_external_pump.h" -#import #import +#import #include "include/cef_app.h" @@ -82,8 +82,7 @@ class MainMessageLoopExternalPumpMac : public MainMessageLoopExternalPump { namespace client { MainMessageLoopExternalPumpMac::MainMessageLoopExternalPumpMac() - : owner_thread_([[NSThread currentThread] retain]), - timer_(nil) { + : owner_thread_([[NSThread currentThread] retain]), timer_(nil) { event_handler_ = [[[EventHandler alloc] initWithPump:this] retain]; } @@ -111,9 +110,9 @@ int MainMessageLoopExternalPumpMac::Run() { // Do some work. CefDoMessageLoopWork(); - + // Sleep to allow the CEF proc to do work. - [NSThread sleepForTimeInterval: 0.05]; + [NSThread sleepForTimeInterval:0.05]; } return 0; @@ -141,16 +140,16 @@ void MainMessageLoopExternalPumpMac::SetTimer(int64 delay_ms) { DCHECK(!timer_); const double delay_s = static_cast(delay_ms) / 1000.0; - timer_ = [[NSTimer timerWithTimeInterval: delay_s - target: event_handler_ - selector: @selector(timerTimeout:) - userInfo: nil - repeats: NO] retain]; + timer_ = [[NSTimer timerWithTimeInterval:delay_s + target:event_handler_ + selector:@selector(timerTimeout:) + userInfo:nil + repeats:NO] retain]; // Add the timer to default and tracking runloop modes. NSRunLoop* owner_runloop = [NSRunLoop currentRunLoop]; - [owner_runloop addTimer: timer_ forMode: NSRunLoopCommonModes]; - [owner_runloop addTimer: timer_ forMode: NSEventTrackingRunLoopMode]; + [owner_runloop addTimer:timer_ forMode:NSRunLoopCommonModes]; + [owner_runloop addTimer:timer_ forMode:NSEventTrackingRunLoopMode]; } void MainMessageLoopExternalPumpMac::KillTimer() { @@ -162,8 +161,7 @@ void MainMessageLoopExternalPumpMac::KillTimer() { } // static -scoped_ptr -MainMessageLoopExternalPump::Create() { +scoped_ptr MainMessageLoopExternalPump::Create() { return scoped_ptr( new MainMessageLoopExternalPumpMac()); } diff --git a/tests/shared/browser/main_message_loop_external_pump_win.cc b/tests/shared/browser/main_message_loop_external_pump_win.cc index 6df423755..496bcdd83 100644 --- a/tests/shared/browser/main_message_loop_external_pump_win.cc +++ b/tests/shared/browser/main_message_loop_external_pump_win.cc @@ -36,7 +36,9 @@ class MainMessageLoopExternalPumpWin : public MainMessageLoopExternalPump { bool IsTimerPending() OVERRIDE { return timer_pending_; } private: - static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, + static LRESULT CALLBACK WndProc(HWND hwnd, + UINT msg, + WPARAM wparam, LPARAM lparam); // True if a timer event is currently pending. @@ -47,8 +49,7 @@ class MainMessageLoopExternalPumpWin : public MainMessageLoopExternalPump { }; MainMessageLoopExternalPumpWin::MainMessageLoopExternalPumpWin() - : timer_pending_(false), - main_thread_target_(NULL) { + : timer_pending_(false), main_thread_target_(NULL) { HINSTANCE hInstance = GetModuleHandle(NULL); const wchar_t* const kClassName = L"CEFMainTargetHWND"; @@ -60,8 +61,9 @@ MainMessageLoopExternalPumpWin::MainMessageLoopExternalPumpWin() RegisterClassEx(&wcex); // Create the message handling window. - main_thread_target_ = CreateWindowW(kClassName, NULL, WS_OVERLAPPEDWINDOW, - 0, 0, 0, 0, HWND_MESSAGE , NULL, hInstance, NULL); + main_thread_target_ = + CreateWindowW(kClassName, NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, + HWND_MESSAGE, NULL, hInstance, NULL); DCHECK(main_thread_target_); SetUserDataPtr(main_thread_target_, this); } @@ -91,11 +93,11 @@ int MainMessageLoopExternalPumpWin::Run() { for (int i = 0; i < 10; ++i) { // Do some work. CefDoMessageLoopWork(); - + // Sleep to allow the CEF proc to do work. Sleep(50); } - + return 0; } @@ -120,8 +122,10 @@ void MainMessageLoopExternalPumpWin::KillTimer() { } // static -LRESULT CALLBACK MainMessageLoopExternalPumpWin::WndProc( - HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { +LRESULT CALLBACK MainMessageLoopExternalPumpWin::WndProc(HWND hwnd, + UINT msg, + WPARAM wparam, + LPARAM lparam) { if (msg == WM_TIMER || msg == kMsgHaveWork) { MainMessageLoopExternalPumpWin* message_loop = GetUserDataPtr(hwnd); @@ -137,11 +141,10 @@ LRESULT CALLBACK MainMessageLoopExternalPumpWin::WndProc( return DefWindowProc(hwnd, msg, wparam, lparam); } -} // namespace +} // namespace // static -scoped_ptr -MainMessageLoopExternalPump::Create() { +scoped_ptr MainMessageLoopExternalPump::Create() { return scoped_ptr( new MainMessageLoopExternalPumpWin()); } diff --git a/tests/shared/browser/main_message_loop_std.cc b/tests/shared/browser/main_message_loop_std.cc index 16067be14..d329f908e 100644 --- a/tests/shared/browser/main_message_loop_std.cc +++ b/tests/shared/browser/main_message_loop_std.cc @@ -8,8 +8,7 @@ namespace client { -MainMessageLoopStd::MainMessageLoopStd() { -} +MainMessageLoopStd::MainMessageLoopStd() {} int MainMessageLoopStd::Run() { CefRunMessageLoop(); diff --git a/tests/shared/browser/resource_util_linux.cc b/tests/shared/browser/resource_util_linux.cc index 45d406801..7ec263e31 100644 --- a/tests/shared/browser/resource_util_linux.cc +++ b/tests/shared/browser/resource_util_linux.cc @@ -15,7 +15,7 @@ bool GetResourceDir(std::string& dir) { char buff[1024]; // Retrieve the executable path. - ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff)-1); + ssize_t len = readlink("/proc/self/exe", buff, sizeof(buff) - 1); if (len == -1) return false; @@ -27,10 +27,9 @@ bool GetResourceDir(std::string& dir) { return false; // Add "files" to the path. - strcpy(pos+1, "files"); // NOLINT(runtime/printf) + strcpy(pos + 1, "files"); dir = std::string(buff); return true; } } // namespace client - diff --git a/tests/shared/browser/resource_util_posix.cc b/tests/shared/browser/resource_util_posix.cc index ce7c8ba9e..d1e055702 100644 --- a/tests/shared/browser/resource_util_posix.cc +++ b/tests/shared/browser/resource_util_posix.cc @@ -49,7 +49,7 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) { CefRefPtr GetBinaryResourceReader(const char* resource_name) { std::string path; - if (!GetResourceDir(path)) + if (!GetResourceDir(path)) return NULL; path.append("/"); diff --git a/tests/shared/browser/resource_util_win.cc b/tests/shared/browser/resource_util_win.cc index 21d11c6b6..284526d2c 100644 --- a/tests/shared/browser/resource_util_win.cc +++ b/tests/shared/browser/resource_util_win.cc @@ -13,10 +13,10 @@ namespace client { namespace { -bool LoadBinaryResource(int binaryId, DWORD &dwSize, LPBYTE &pBytes) { +bool LoadBinaryResource(int binaryId, DWORD& dwSize, LPBYTE& pBytes) { HINSTANCE hInst = GetModuleHandle(NULL); - HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(binaryId), - MAKEINTRESOURCE(256)); + HRSRC hRes = + FindResource(hInst, MAKEINTRESOURCE(binaryId), MAKEINTRESOURCE(256)); if (hRes) { HGLOBAL hGlob = LoadResource(hInst, hRes); if (hGlob) { @@ -34,7 +34,7 @@ bool LoadBinaryResource(int binaryId, DWORD &dwSize, LPBYTE &pBytes) { class BinaryResourceProvider : public CefResourceManager::Provider { public: explicit BinaryResourceProvider(const std::string& url_path) - : url_path_(url_path) { + : url_path_(url_path) { DCHECK(!url_path.empty()); } @@ -55,8 +55,7 @@ class BinaryResourceProvider : public CefResourceManager::Provider { GetBinaryResourceReader(relative_path.data()); if (stream.get()) { handler = new CefStreamResourceHandler( - request->mime_type_resolver().Run(url), - stream); + request->mime_type_resolver().Run(url), stream); } } diff --git a/tests/shared/browser/util_win.cc b/tests/shared/browser/util_win.cc index 468a1a7ca..a4b7b9928 100644 --- a/tests/shared/browser/util_win.cc +++ b/tests/shared/browser/util_win.cc @@ -10,8 +10,8 @@ namespace client { void SetUserDataPtr(HWND hWnd, void* ptr) { SetLastError(ERROR_SUCCESS); - LONG_PTR result = ::SetWindowLongPtr( - hWnd, GWLP_USERDATA, reinterpret_cast(ptr)); + LONG_PTR result = + ::SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast(ptr)); CHECK(result != 0 || GetLastError() == ERROR_SUCCESS); } @@ -19,14 +19,14 @@ WNDPROC SetWndProcPtr(HWND hWnd, WNDPROC wndProc) { WNDPROC old = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_WNDPROC)); CHECK(old != NULL); - LONG_PTR result = ::SetWindowLongPtr( - hWnd, GWLP_WNDPROC, reinterpret_cast(wndProc)); + LONG_PTR result = ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, + reinterpret_cast(wndProc)); CHECK(result != 0 || GetLastError() == ERROR_SUCCESS); return old; } std::wstring GetResourceString(UINT id) { - #define MAX_LOADSTRING 100 +#define MAX_LOADSTRING 100 TCHAR buff[MAX_LOADSTRING] = {0}; LoadString(::GetModuleHandle(NULL), id, buff, MAX_LOADSTRING); return buff; @@ -71,66 +71,66 @@ int GetCefKeyboardModifiers(WPARAM wparam, LPARAM lparam) { modifiers |= EVENTFLAG_CAPS_LOCK_ON; switch (wparam) { - case VK_RETURN: - if ((lparam >> 16) & KF_EXTENDED) + case VK_RETURN: + if ((lparam >> 16) & KF_EXTENDED) + modifiers |= EVENTFLAG_IS_KEY_PAD; + break; + case VK_INSERT: + case VK_DELETE: + case VK_HOME: + case VK_END: + case VK_PRIOR: + case VK_NEXT: + case VK_UP: + case VK_DOWN: + case VK_LEFT: + case VK_RIGHT: + if (!((lparam >> 16) & KF_EXTENDED)) + modifiers |= EVENTFLAG_IS_KEY_PAD; + break; + case VK_NUMLOCK: + case VK_NUMPAD0: + case VK_NUMPAD1: + case VK_NUMPAD2: + case VK_NUMPAD3: + case VK_NUMPAD4: + case VK_NUMPAD5: + case VK_NUMPAD6: + case VK_NUMPAD7: + case VK_NUMPAD8: + case VK_NUMPAD9: + case VK_DIVIDE: + case VK_MULTIPLY: + case VK_SUBTRACT: + case VK_ADD: + case VK_DECIMAL: + case VK_CLEAR: modifiers |= EVENTFLAG_IS_KEY_PAD; - break; - case VK_INSERT: - case VK_DELETE: - case VK_HOME: - case VK_END: - case VK_PRIOR: - case VK_NEXT: - case VK_UP: - case VK_DOWN: - case VK_LEFT: - case VK_RIGHT: - if (!((lparam >> 16) & KF_EXTENDED)) - modifiers |= EVENTFLAG_IS_KEY_PAD; - break; - case VK_NUMLOCK: - case VK_NUMPAD0: - case VK_NUMPAD1: - case VK_NUMPAD2: - case VK_NUMPAD3: - case VK_NUMPAD4: - case VK_NUMPAD5: - case VK_NUMPAD6: - case VK_NUMPAD7: - case VK_NUMPAD8: - case VK_NUMPAD9: - case VK_DIVIDE: - case VK_MULTIPLY: - case VK_SUBTRACT: - case VK_ADD: - case VK_DECIMAL: - case VK_CLEAR: - modifiers |= EVENTFLAG_IS_KEY_PAD; - break; - case VK_SHIFT: - if (IsKeyDown(VK_LSHIFT)) + break; + case VK_SHIFT: + if (IsKeyDown(VK_LSHIFT)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (IsKeyDown(VK_RSHIFT)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_CONTROL: + if (IsKeyDown(VK_LCONTROL)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (IsKeyDown(VK_RCONTROL)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_MENU: + if (IsKeyDown(VK_LMENU)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (IsKeyDown(VK_RMENU)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_LWIN: modifiers |= EVENTFLAG_IS_LEFT; - else if (IsKeyDown(VK_RSHIFT)) + break; + case VK_RWIN: modifiers |= EVENTFLAG_IS_RIGHT; - break; - case VK_CONTROL: - if (IsKeyDown(VK_LCONTROL)) - modifiers |= EVENTFLAG_IS_LEFT; - else if (IsKeyDown(VK_RCONTROL)) - modifiers |= EVENTFLAG_IS_RIGHT; - break; - case VK_MENU: - if (IsKeyDown(VK_LMENU)) - modifiers |= EVENTFLAG_IS_LEFT; - else if (IsKeyDown(VK_RMENU)) - modifiers |= EVENTFLAG_IS_RIGHT; - break; - case VK_LWIN: - modifiers |= EVENTFLAG_IS_LEFT; - break; - case VK_RWIN: - modifiers |= EVENTFLAG_IS_RIGHT; - break; + break; } return modifiers; } diff --git a/tests/shared/common/client_app.cc b/tests/shared/common/client_app.cc index 4ca5df9ad..1a76d4b87 100644 --- a/tests/shared/common/client_app.cc +++ b/tests/shared/common/client_app.cc @@ -19,9 +19,7 @@ const char kZygoteProcess[] = "zygote"; } // namespace - -ClientApp::ClientApp() { -} +ClientApp::ClientApp() {} // static ClientApp::ProcessType ClientApp::GetProcessType( diff --git a/tests/shared/common/client_app_other.cc b/tests/shared/common/client_app_other.cc index 354cbb11e..9f6a0c4f4 100644 --- a/tests/shared/common/client_app_other.cc +++ b/tests/shared/common/client_app_other.cc @@ -8,7 +8,6 @@ namespace client { -ClientAppOther::ClientAppOther() { -} +ClientAppOther::ClientAppOther() {} } // namespace client diff --git a/tests/shared/process_helper_mac.cc b/tests/shared/process_helper_mac.cc index d94e322b1..dd49db336 100644 --- a/tests/shared/process_helper_mac.cc +++ b/tests/shared/process_helper_mac.cc @@ -30,7 +30,6 @@ int RunMain(int argc, char* argv[]) { } // namespace client - // Process entry point. int main(int argc, char* argv[]) { return client::RunMain(argc, argv); diff --git a/tests/shared/renderer/client_app_renderer.cc b/tests/shared/renderer/client_app_renderer.cc index e195e31c0..d976b325f 100644 --- a/tests/shared/renderer/client_app_renderer.cc +++ b/tests/shared/renderer/client_app_renderer.cc @@ -109,8 +109,8 @@ bool ClientAppRenderer::OnProcessMessageReceived( DelegateSet::iterator it = delegates_.begin(); for (; it != delegates_.end() && !handled; ++it) { - handled = (*it)->OnProcessMessageReceived(this, browser, source_process, - message); + handled = + (*it)->OnProcessMessageReceived(this, browser, source_process, message); } return handled; diff --git a/tests/shared/renderer/client_app_renderer.h b/tests/shared/renderer/client_app_renderer.h index 3edef9498..458aa488b 100644 --- a/tests/shared/renderer/client_app_renderer.h +++ b/tests/shared/renderer/client_app_renderer.h @@ -13,8 +13,7 @@ namespace client { // Client app implementation for the renderer process. -class ClientAppRenderer : public ClientApp, - public CefRenderProcessHandler { +class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler { public: // Interface for renderer delegates. All Delegates must be returned via // CreateDelegates. Do not perform work in the Delegate @@ -81,7 +80,7 @@ class ClientAppRenderer : public ClientApp, } }; - typedef std::set > DelegateSet; + typedef std::set> DelegateSet; ClientAppRenderer(); @@ -120,10 +119,9 @@ class ClientAppRenderer : public ClientApp, void OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) OVERRIDE; - bool OnProcessMessageReceived( - CefRefPtr browser, - CefProcessId source_process, - CefRefPtr message) OVERRIDE; + bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) OVERRIDE; private: // Set of supported Delegates.