diff --git a/include/base/cef_bind.h b/include/base/cef_bind.h index 7211ebf03..66022ff34 100644 --- a/include/base/cef_bind.h +++ b/include/base/cef_bind.h @@ -97,20 +97,20 @@ namespace base { /// Bind as OnceCallback. /// template -inline OnceCallback> BindOnce( +inline OnceCallback> BindOnce( Functor&& functor, Args&&... args) { - static_assert(!internal::IsOnceCallback>() || + static_assert(!cef_internal::IsOnceCallback>() || (std::is_rvalue_reference() && !std::is_const>()), "BindOnce requires non-const rvalue for OnceCallback binding." " I.e.: base::BindOnce(std::move(callback))."); static_assert( conjunction< - internal::AssertBindArgIsNotBasePassed>...>::value, + cef_internal::AssertBindArgIsNotBasePassed>...>::value, "Use std::move() instead of base::Passed() with base::BindOnce()"); - return internal::BindImpl(std::forward(functor), + return cef_internal::BindImpl(std::forward(functor), std::forward(args)...); } @@ -118,13 +118,13 @@ inline OnceCallback> BindOnce( /// Bind as RepeatingCallback. /// template -inline RepeatingCallback> +inline RepeatingCallback> BindRepeating(Functor&& functor, Args&&... args) { static_assert( - !internal::IsOnceCallback>(), + !cef_internal::IsOnceCallback>(), "BindRepeating cannot bind OnceCallback. Use BindOnce with std::move()."); - return internal::BindImpl(std::forward(functor), + return cef_internal::BindImpl(std::forward(functor), std::forward(args)...); } @@ -175,8 +175,8 @@ RepeatingCallback BindRepeating( /// to compile because Foo does not support the AddRef() and Release() methods. /// template -inline internal::UnretainedWrapper Unretained(T* o) { - return internal::UnretainedWrapper(o); +inline cef_internal::UnretainedWrapper Unretained(T* o) { + return cef_internal::UnretainedWrapper(o); } /// @@ -201,12 +201,12 @@ inline internal::UnretainedWrapper Unretained(T* o) { /// /// template -inline internal::RetainedRefWrapper RetainedRef(T* o) { - return internal::RetainedRefWrapper(o); +inline cef_internal::RetainedRefWrapper RetainedRef(T* o) { + return cef_internal::RetainedRefWrapper(o); } template -inline internal::RetainedRefWrapper RetainedRef(scoped_refptr o) { - return internal::RetainedRefWrapper(std::move(o)); +inline cef_internal::RetainedRefWrapper RetainedRef(scoped_refptr o) { + return cef_internal::RetainedRefWrapper(std::move(o)); } /// @@ -234,14 +234,14 @@ inline internal::RetainedRefWrapper RetainedRef(scoped_refptr o) { /// reference to the callback is deleted. /// template -inline internal::OwnedWrapper Owned(T* o) { - return internal::OwnedWrapper(o); +inline cef_internal::OwnedWrapper Owned(T* o) { + return cef_internal::OwnedWrapper(o); } template -inline internal::OwnedWrapper Owned( +inline cef_internal::OwnedWrapper Owned( std::unique_ptr&& ptr) { - return internal::OwnedWrapper(std::move(ptr)); + return cef_internal::OwnedWrapper(std::move(ptr)); } /// @@ -277,8 +277,8 @@ inline internal::OwnedWrapper Owned( /// an object owned by the callback. /// template -internal::OwnedRefWrapper> OwnedRef(T&& t) { - return internal::OwnedRefWrapper>(std::forward(t)); +cef_internal::OwnedRefWrapper> OwnedRef(T&& t) { + return cef_internal::OwnedRefWrapper>(std::forward(t)); } /// @@ -329,12 +329,12 @@ internal::OwnedRefWrapper> OwnedRef(T&& t) { /// template ::value>* = nullptr> -inline internal::PassedWrapper Passed(T&& scoper) { - return internal::PassedWrapper(std::move(scoper)); +inline cef_internal::PassedWrapper Passed(T&& scoper) { + return cef_internal::PassedWrapper(std::move(scoper)); } template -inline internal::PassedWrapper Passed(T* scoper) { - return internal::PassedWrapper(std::move(*scoper)); +inline cef_internal::PassedWrapper Passed(T* scoper) { + return cef_internal::PassedWrapper(std::move(*scoper)); } /// @@ -357,8 +357,8 @@ inline internal::PassedWrapper Passed(T* scoper) { /// /// template -inline internal::IgnoreResultHelper IgnoreResult(T data) { - return internal::IgnoreResultHelper(std::move(data)); +inline cef_internal::IgnoreResultHelper IgnoreResult(T data) { + return cef_internal::IgnoreResultHelper(std::move(data)); } #if defined(OS_APPLE) && !HAS_FEATURE(objc_arc) diff --git a/include/base/cef_callback.h b/include/base/cef_callback.h index 7034ff925..456afd399 100644 --- a/include/base/cef_callback.h +++ b/include/base/cef_callback.h @@ -83,18 +83,18 @@ namespace base { template -class OnceCallback : public internal::CallbackBase { +class OnceCallback : public cef_internal::CallbackBase { public: using ResultType = R; using RunType = R(Args...); - using PolymorphicInvoke = R (*)(internal::BindStateBase*, - internal::PassingType...); + using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*, + cef_internal::PassingType...); constexpr OnceCallback() = default; OnceCallback(std::nullptr_t) = delete; - explicit OnceCallback(internal::BindStateBase* bind_state) - : internal::CallbackBase(bind_state) {} + explicit OnceCallback(cef_internal::BindStateBase* bind_state) + : cef_internal::CallbackBase(bind_state) {} OnceCallback(const OnceCallback&) = delete; OnceCallback& operator=(const OnceCallback&) = delete; @@ -103,10 +103,10 @@ class OnceCallback : public internal::CallbackBase { OnceCallback& operator=(OnceCallback&&) noexcept = default; OnceCallback(RepeatingCallback other) - : internal::CallbackBase(std::move(other)) {} + : cef_internal::CallbackBase(std::move(other)) {} OnceCallback& operator=(RepeatingCallback other) { - static_cast(*this) = std::move(other); + static_cast(*this) = std::move(other); return *this; } @@ -142,7 +142,7 @@ class OnceCallback : public internal::CallbackBase { OnceCallback Then(OnceCallback then) && { CHECK(then); return BindOnce( - internal::ThenHelper< + cef_internal::ThenHelper< OnceCallback, OnceCallback>::CreateTrampoline(), std::move(*this), std::move(then)); } @@ -155,7 +155,7 @@ class OnceCallback : public internal::CallbackBase { RepeatingCallback then) && { CHECK(then); return BindOnce( - internal::ThenHelper< + cef_internal::ThenHelper< OnceCallback, RepeatingCallback>::CreateTrampoline(), std::move(*this), std::move(then)); @@ -163,18 +163,18 @@ class OnceCallback : public internal::CallbackBase { }; template -class RepeatingCallback : public internal::CallbackBaseCopyable { +class RepeatingCallback : public cef_internal::CallbackBaseCopyable { public: using ResultType = R; using RunType = R(Args...); - using PolymorphicInvoke = R (*)(internal::BindStateBase*, - internal::PassingType...); + using PolymorphicInvoke = R (*)(cef_internal::BindStateBase*, + cef_internal::PassingType...); constexpr RepeatingCallback() = default; RepeatingCallback(std::nullptr_t) = delete; - explicit RepeatingCallback(internal::BindStateBase* bind_state) - : internal::CallbackBaseCopyable(bind_state) {} + explicit RepeatingCallback(cef_internal::BindStateBase* bind_state) + : cef_internal::CallbackBaseCopyable(bind_state) {} // Copyable and movable. RepeatingCallback(const RepeatingCallback&) = default; @@ -224,7 +224,7 @@ class RepeatingCallback : public internal::CallbackBaseCopyable { RepeatingCallback then) const& { CHECK(then); return BindRepeating( - internal::ThenHelper< + cef_internal::ThenHelper< RepeatingCallback, RepeatingCallback>::CreateTrampoline(), *this, std::move(then)); @@ -235,7 +235,7 @@ class RepeatingCallback : public internal::CallbackBaseCopyable { RepeatingCallback then) && { CHECK(then); return BindRepeating( - internal::ThenHelper< + cef_internal::ThenHelper< RepeatingCallback, RepeatingCallback>::CreateTrampoline(), std::move(*this), std::move(then)); diff --git a/include/base/internal/cef_bind_internal.h b/include/base/internal/cef_bind_internal.h index 5f993e398..d81c363dc 100644 --- a/include/base/internal/cef_bind_internal.h +++ b/include/base/internal/cef_bind_internal.h @@ -97,7 +97,7 @@ struct BindUnwrapTraits; template struct CallbackCancellationTraits; -namespace internal { +namespace cef_internal { template struct FunctorTraits; @@ -1259,7 +1259,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) { std::forward(functor), std::forward(args)...)); } -} // namespace internal +} // namespace cef_internal // An injection point to control |this| pointer behavior on a method invocation. // If IsWeakReceiver<> is true_type for |T| and |T| is used for a receiver of a @@ -1303,30 +1303,30 @@ struct BindUnwrapTraits { }; template -struct BindUnwrapTraits> { - static T* Unwrap(const internal::UnretainedWrapper& o) { return o.get(); } +struct BindUnwrapTraits> { + static T* Unwrap(const cef_internal::UnretainedWrapper& o) { return o.get(); } }; template -struct BindUnwrapTraits> { - static T* Unwrap(const internal::RetainedRefWrapper& o) { return o.get(); } +struct BindUnwrapTraits> { + static T* Unwrap(const cef_internal::RetainedRefWrapper& o) { return o.get(); } }; template -struct BindUnwrapTraits> { - static T* Unwrap(const internal::OwnedWrapper& o) { +struct BindUnwrapTraits> { + static T* Unwrap(const cef_internal::OwnedWrapper& o) { return o.get(); } }; template -struct BindUnwrapTraits> { - static T& Unwrap(const internal::OwnedRefWrapper& o) { return o.get(); } +struct BindUnwrapTraits> { + static T& Unwrap(const cef_internal::OwnedRefWrapper& o) { return o.get(); } }; template -struct BindUnwrapTraits> { - static T Unwrap(const internal::PassedWrapper& o) { return o.Take(); } +struct BindUnwrapTraits> { + static T Unwrap(const cef_internal::PassedWrapper& o) { return o.Take(); } }; #if defined(OS_WIN) @@ -1351,7 +1351,7 @@ struct CallbackCancellationTraits< Functor, std::tuple, std::enable_if_t< - internal::IsWeakMethod::is_method, + cef_internal::IsWeakMethod::is_method, BoundArgs...>::value>> { static constexpr bool is_cancellable = true; diff --git a/include/base/internal/cef_callback_internal.h b/include/base/internal/cef_callback_internal.h index 8be0a531e..f3435e9f7 100644 --- a/include/base/internal/cef_callback_internal.h +++ b/include/base/internal/cef_callback_internal.h @@ -43,7 +43,7 @@ namespace base { struct FakeBindState; -namespace internal { +namespace cef_internal { class BindStateBase; class FinallyExecutorCommon; @@ -269,7 +269,7 @@ struct ThenHelper, } }; -} // namespace internal +} // namespace cef_internal } // namespace base #endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ 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 61d341cea..124a329ae 100644 --- a/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h +++ b/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h @@ -47,7 +47,7 @@ namespace base { // This is a base internal implementation file used by task.h and callback.h. // Not for public consumption, so we wrap it in namespace internal. -namespace internal { +namespace cef_internal { template struct IsRefCountedType : std::false_type {}; @@ -68,7 +68,7 @@ struct NeedsScopedRefptrButGetsRawPtr "NeedsScopedRefptrButGetsRawPtr requires non-reference type."); }; -} // namespace internal +} // namespace cef_internal } // namespace base diff --git a/include/base/internal/cef_scoped_block_mac.h b/include/base/internal/cef_scoped_block_mac.h index 474db2b63..e57ca5227 100644 --- a/include/base/internal/cef_scoped_block_mac.h +++ b/include/base/internal/cef_scoped_block_mac.h @@ -44,7 +44,7 @@ namespace base { namespace mac { -namespace internal { +namespace cef_internal { template struct ScopedBlockTraits { @@ -53,12 +53,12 @@ struct ScopedBlockTraits { static void Release(B block) { Block_release(block); } }; -} // namespace internal +} // namespace cef_internal // ScopedBlock<> is patterned after ScopedCFTypeRef<>, but uses Block_copy() and // Block_release() instead of CFRetain() and CFRelease(). template -using ScopedBlock = ScopedTypeRef>; +using ScopedBlock = ScopedTypeRef>; } // namespace mac } // namespace base diff --git a/libcef_dll/base/cef_callback_internal.cc b/libcef_dll/base/cef_callback_internal.cc index 6a381b152..5651187f0 100644 --- a/libcef_dll/base/cef_callback_internal.cc +++ b/libcef_dll/base/cef_callback_internal.cc @@ -7,7 +7,7 @@ #include "include/base/cef_logging.h" namespace base { -namespace internal { +namespace cef_internal { namespace { @@ -97,5 +97,5 @@ CallbackBaseCopyable& CallbackBaseCopyable::operator=( CallbackBaseCopyable& CallbackBaseCopyable::operator=( CallbackBaseCopyable&& c) noexcept = default; -} // namespace internal +} // namespace cef_internal } // namespace base