forked from mirrors/gecko-dev
Bug 1607595 - Remove uses of mozilla::IsBaseOf. r=froydnj
Automatically generated by: $ rg 'IsBaseOf<' | cut -d : -f 1 | xargs sed -i 's/mozilla::IsBaseOf</std::is_base_of</g' $ rg 'IsBaseOf<' | cut -d : -f 1 | xargs sed -i 's/IsBaseOf</std::is_base_of</g Differential Revision: https://phabricator.services.mozilla.com/D59013 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
40a21eea5b
commit
e363a41bd4
42 changed files with 151 additions and 148 deletions
|
|
@ -81,7 +81,7 @@ class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline ProxyAccessible* HyperTextProxyFor(T* aWrapper) {
|
inline ProxyAccessible* HyperTextProxyFor(T* aWrapper) {
|
||||||
static_assert(mozilla::IsBaseOf<IUnknown, T>::value,
|
static_assert(std::is_base_of<IUnknown, T>::value,
|
||||||
"only IAccessible* should be passed in");
|
"only IAccessible* should be passed in");
|
||||||
auto wrapper = static_cast<HyperTextProxyAccessibleWrap*>(aWrapper);
|
auto wrapper = static_cast<HyperTextProxyAccessibleWrap*>(aWrapper);
|
||||||
return wrapper->IsProxy() ? wrapper->Proxy() : nullptr;
|
return wrapper->IsProxy() ? wrapper->Proxy() : nullptr;
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,13 @@ struct DictionaryBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline typename EnableIf<IsBaseOf<DictionaryBase, T>::value, void>::Type
|
inline typename EnableIf<std::is_base_of<DictionaryBase, T>::value, void>::Type
|
||||||
ImplCycleCollectionUnlink(T& aDictionary) {
|
ImplCycleCollectionUnlink(T& aDictionary) {
|
||||||
aDictionary.UnlinkForCC();
|
aDictionary.UnlinkForCC();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline typename EnableIf<IsBaseOf<DictionaryBase, T>::value, void>::Type
|
inline typename EnableIf<std::is_base_of<DictionaryBase, T>::value, void>::Type
|
||||||
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||||
T& aDictionary, const char* aName,
|
T& aDictionary, const char* aName,
|
||||||
uint32_t aFlags = 0) {
|
uint32_t aFlags = 0) {
|
||||||
|
|
|
||||||
|
|
@ -823,7 +823,7 @@ struct IsRefcounted {
|
||||||
// This struct only works if T is fully declared (not just forward declared).
|
// This struct only works if T is fully declared (not just forward declared).
|
||||||
// The IsBaseOf check will ensure that, we don't really need it for any other
|
// The IsBaseOf check will ensure that, we don't really need it for any other
|
||||||
// reason (the static assert will of course always be true).
|
// reason (the static assert will of course always be true).
|
||||||
static_assert(!IsBaseOf<nsISupports, T>::value || IsRefcounted::value,
|
static_assert(!std::is_base_of<nsISupports, T>::value || IsRefcounted::value,
|
||||||
"Classes derived from nsISupports are refcounted!");
|
"Classes derived from nsISupports are refcounted!");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -832,7 +832,7 @@ struct IsRefcounted {
|
||||||
#undef HAS_MEMBER_TYPEDEFS
|
#undef HAS_MEMBER_TYPEDEFS
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct CheckWrapperCacheCast {
|
struct CheckWrapperCacheCast {
|
||||||
static bool Check() {
|
static bool Check() {
|
||||||
return reinterpret_cast<uintptr_t>(
|
return reinterpret_cast<uintptr_t>(
|
||||||
|
|
@ -982,13 +982,13 @@ template <class T>
|
||||||
struct TypeNeedsOuterization {
|
struct TypeNeedsOuterization {
|
||||||
// We only need to outerize Window objects, so anything inheriting from
|
// We only need to outerize Window objects, so anything inheriting from
|
||||||
// nsGlobalWindow (which inherits from EventTarget itself).
|
// nsGlobalWindow (which inherits from EventTarget itself).
|
||||||
static const bool value = IsBaseOf<nsGlobalWindowInner, T>::value ||
|
static const bool value = std::is_base_of<nsGlobalWindowInner, T>::value ||
|
||||||
IsBaseOf<nsGlobalWindowOuter, T>::value ||
|
std::is_base_of<nsGlobalWindowOuter, T>::value ||
|
||||||
IsSame<EventTarget, T>::value;
|
IsSame<EventTarget, T>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
template <typename T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <typename T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct CheckWrapperCacheTracing {
|
struct CheckWrapperCacheTracing {
|
||||||
static inline void Check(T* aObject) {}
|
static inline void Check(T* aObject) {}
|
||||||
};
|
};
|
||||||
|
|
@ -1058,7 +1058,7 @@ MOZ_ALWAYS_INLINE bool DoGetOrCreateDOMReflector(
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (IsBaseOf<nsWrapperCache, T>::value) {
|
if (std::is_base_of<nsWrapperCache, T>::value) {
|
||||||
CheckWrapperCacheTracing<T>::Check(value);
|
CheckWrapperCacheTracing<T>::Check(value);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1076,7 +1076,7 @@ MOZ_ALWAYS_INLINE bool DoGetOrCreateDOMReflector(
|
||||||
// reinterpret_castable to nsWrapperCache.
|
// reinterpret_castable to nsWrapperCache.
|
||||||
MOZ_ASSERT(clasp, "What happened here?");
|
MOZ_ASSERT(clasp, "What happened here?");
|
||||||
MOZ_ASSERT_IF(clasp->mDOMObjectIsISupports,
|
MOZ_ASSERT_IF(clasp->mDOMObjectIsISupports,
|
||||||
(IsBaseOf<nsISupports, T>::value));
|
(std::is_base_of<nsISupports, T>::value));
|
||||||
MOZ_ASSERT(CheckWrapperCacheCast<T>::Check());
|
MOZ_ASSERT(CheckWrapperCacheCast<T>::Check());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1907,9 +1907,10 @@ void DoTraceSequence(JSTracer* trc, nsTArray<T>& seq);
|
||||||
|
|
||||||
// Class used to trace sequences, with specializations for various
|
// Class used to trace sequences, with specializations for various
|
||||||
// sequence types.
|
// sequence types.
|
||||||
template <typename T, bool isDictionary = IsBaseOf<DictionaryBase, T>::value,
|
template <typename T,
|
||||||
bool isTypedArray = IsBaseOf<AllTypedArraysBase, T>::value,
|
bool isDictionary = std::is_base_of<DictionaryBase, T>::value,
|
||||||
bool isOwningUnion = IsBaseOf<AllOwningUnionBase, T>::value>
|
bool isTypedArray = std::is_base_of<AllTypedArraysBase, T>::value,
|
||||||
|
bool isOwningUnion = std::is_base_of<AllOwningUnionBase, T>::value>
|
||||||
class SequenceTracer {
|
class SequenceTracer {
|
||||||
explicit SequenceTracer() = delete; // Should never be instantiated
|
explicit SequenceTracer() = delete; // Should never be instantiated
|
||||||
};
|
};
|
||||||
|
|
@ -2529,7 +2530,7 @@ inline bool UTF8StringToJsval(JSContext* cx, const nsACString& str,
|
||||||
return NonVoidUTF8StringToJsval(cx, str, rval);
|
return NonVoidUTF8StringToJsval(cx, str, rval);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct PreserveWrapperHelper {
|
struct PreserveWrapperHelper {
|
||||||
static void PreserveWrapper(T* aObject) {
|
static void PreserveWrapper(T* aObject) {
|
||||||
aObject->PreserveWrapper(aObject, NS_CYCLE_COLLECTION_PARTICIPANT(T));
|
aObject->PreserveWrapper(aObject, NS_CYCLE_COLLECTION_PARTICIPANT(T));
|
||||||
|
|
@ -2548,7 +2549,7 @@ void PreserveWrapper(T* aObject) {
|
||||||
PreserveWrapperHelper<T>::PreserveWrapper(aObject);
|
PreserveWrapperHelper<T>::PreserveWrapper(aObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct CastingAssertions {
|
struct CastingAssertions {
|
||||||
static bool ToSupportsIsCorrect(T*) { return true; }
|
static bool ToSupportsIsCorrect(T*) { return true; }
|
||||||
static bool ToSupportsIsOnPrimaryInheritanceChain(T*, nsWrapperCache*) {
|
static bool ToSupportsIsOnPrimaryInheritanceChain(T*, nsWrapperCache*) {
|
||||||
|
|
@ -2663,7 +2664,7 @@ class MOZ_STACK_CLASS BindingJSObjectCreator {
|
||||||
struct OwnedNative {
|
struct OwnedNative {
|
||||||
// Make sure the native objects inherit from NonRefcountedDOMObject so
|
// Make sure the native objects inherit from NonRefcountedDOMObject so
|
||||||
// that we log their ctor and dtor.
|
// that we log their ctor and dtor.
|
||||||
static_assert(IsBaseOf<NonRefcountedDOMObject, T>::value,
|
static_assert(std::is_base_of<NonRefcountedDOMObject, T>::value,
|
||||||
"Non-refcounted objects with DOM bindings should inherit "
|
"Non-refcounted objects with DOM bindings should inherit "
|
||||||
"from NonRefcountedDOMObject.");
|
"from NonRefcountedDOMObject.");
|
||||||
|
|
||||||
|
|
@ -2699,7 +2700,7 @@ struct DeferredFinalizerImpl {
|
||||||
typedef SegmentedVector<SmartPtr> SmartPtrArray;
|
typedef SegmentedVector<SmartPtr> SmartPtrArray;
|
||||||
|
|
||||||
static_assert(
|
static_assert(
|
||||||
IsSame<T, nsISupports>::value || !IsBaseOf<nsISupports, T>::value,
|
IsSame<T, nsISupports>::value || !std::is_base_of<nsISupports, T>::value,
|
||||||
"nsISupports classes should all use the nsISupports instantiation");
|
"nsISupports classes should all use the nsISupports instantiation");
|
||||||
|
|
||||||
static inline void AppendAndTake(
|
static inline void AppendAndTake(
|
||||||
|
|
@ -2742,7 +2743,7 @@ struct DeferredFinalizerImpl {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct DeferredFinalizer {
|
struct DeferredFinalizer {
|
||||||
static void AddForDeferredFinalization(T* aObject) {
|
static void AddForDeferredFinalization(T* aObject) {
|
||||||
typedef DeferredFinalizerImpl<T> Impl;
|
typedef DeferredFinalizerImpl<T> Impl;
|
||||||
|
|
@ -2766,7 +2767,7 @@ static void AddForDeferredFinalization(T* aObject) {
|
||||||
// This returns T's CC participant if it participates in CC and does not inherit
|
// This returns T's CC participant if it participates in CC and does not inherit
|
||||||
// from nsISupports. Otherwise, it returns null. QI should be used to get the
|
// from nsISupports. Otherwise, it returns null. QI should be used to get the
|
||||||
// participant if T inherits from nsISupports.
|
// participant if T inherits from nsISupports.
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
class GetCCParticipant {
|
class GetCCParticipant {
|
||||||
// Helper for GetCCParticipant for classes that participate in CC.
|
// Helper for GetCCParticipant for classes that participate in CC.
|
||||||
template <class U>
|
template <class U>
|
||||||
|
|
@ -2825,8 +2826,8 @@ struct CreateGlobalOptionsWithXPConnect {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
using IsGlobalWithXPConnect =
|
using IsGlobalWithXPConnect =
|
||||||
IntegralConstant<bool, IsBaseOf<nsGlobalWindowInner, T>::value ||
|
IntegralConstant<bool, std::is_base_of<nsGlobalWindowInner, T>::value ||
|
||||||
IsBaseOf<MessageManagerGlobal, T>::value>;
|
std::is_base_of<MessageManagerGlobal, T>::value>;
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct CreateGlobalOptions : Conditional<IsGlobalWithXPConnect<T>::value,
|
struct CreateGlobalOptions : Conditional<IsGlobalWithXPConnect<T>::value,
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,7 @@ def DOMClass(descriptor):
|
||||||
return fill(
|
return fill(
|
||||||
"""
|
"""
|
||||||
{ ${protoChain} },
|
{ ${protoChain} },
|
||||||
IsBaseOf<nsISupports, ${nativeType} >::value,
|
std::is_base_of<nsISupports, ${nativeType} >::value,
|
||||||
${hooks},
|
${hooks},
|
||||||
FindAssociatedGlobalForNative<${nativeType}>::Get,
|
FindAssociatedGlobalForNative<${nativeType}>::Get,
|
||||||
GetProtoObjectHandle,
|
GetProtoObjectHandle,
|
||||||
|
|
@ -3887,7 +3887,7 @@ class CGWrapWithCacheMethod(CGAbstractMethod):
|
||||||
|
|
||||||
return fill(
|
return fill(
|
||||||
"""
|
"""
|
||||||
static_assert(!IsBaseOf<NonRefcountedDOMObject, ${nativeType}>::value,
|
static_assert(!std::is_base_of<NonRefcountedDOMObject, ${nativeType}>::value,
|
||||||
"Shouldn't have wrappercached things that are not refcounted.");
|
"Shouldn't have wrappercached things that are not refcounted.");
|
||||||
$*{assertInheritance}
|
$*{assertInheritance}
|
||||||
MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
|
MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
|
||||||
|
|
@ -13607,7 +13607,7 @@ class CGDescriptor(CGThing):
|
||||||
if descriptor.proxy:
|
if descriptor.proxy:
|
||||||
cgThings.append(CGGeneric(fill(
|
cgThings.append(CGGeneric(fill(
|
||||||
"""
|
"""
|
||||||
static_assert(IsBaseOf<nsISupports, ${nativeType} >::value,
|
static_assert(std::is_base_of<nsISupports, ${nativeType} >::value,
|
||||||
"We don't support non-nsISupports native classes for "
|
"We don't support non-nsISupports native classes for "
|
||||||
"proxy-based bindings yet");
|
"proxy-based bindings yet");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,10 @@ MOZ_MUST_USE inline bool ToJSValue(JSContext* aCx, CallbackObject& aArgument,
|
||||||
// Accept objects that inherit from nsWrapperCache (e.g. most
|
// Accept objects that inherit from nsWrapperCache (e.g. most
|
||||||
// DOM objects).
|
// DOM objects).
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE typename EnableIf<IsBaseOf<nsWrapperCache, T>::value, bool>::Type
|
MOZ_MUST_USE
|
||||||
ToJSValue(JSContext* aCx, T& aArgument, JS::MutableHandle<JS::Value> aValue) {
|
typename EnableIf<std::is_base_of<nsWrapperCache, T>::value, bool>::Type
|
||||||
|
ToJSValue(JSContext* aCx, T& aArgument,
|
||||||
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
// Make sure we're called in a compartment
|
// Make sure we're called in a compartment
|
||||||
MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
|
MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
|
||||||
|
|
||||||
|
|
@ -132,7 +134,8 @@ ToJSValue(JSContext* aCx, T& aArgument, JS::MutableHandle<JS::Value> aValue) {
|
||||||
namespace binding_detail {
|
namespace binding_detail {
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE
|
MOZ_MUST_USE
|
||||||
typename EnableIf<IsBaseOf<NonRefcountedDOMObject, T>::value, bool>::Type
|
typename EnableIf<std::is_base_of<NonRefcountedDOMObject, T>::value,
|
||||||
|
bool>::Type
|
||||||
ToJSValueFromPointerHelper(JSContext* aCx, T* aArgument,
|
ToJSValueFromPointerHelper(JSContext* aCx, T* aArgument,
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
// Make sure we're called in a compartment
|
// Make sure we're called in a compartment
|
||||||
|
|
@ -160,7 +163,8 @@ MOZ_MUST_USE
|
||||||
// nsAutoPtr.
|
// nsAutoPtr.
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE
|
MOZ_MUST_USE
|
||||||
typename EnableIf<IsBaseOf<NonRefcountedDOMObject, T>::value, bool>::Type
|
typename EnableIf<std::is_base_of<NonRefcountedDOMObject, T>::value,
|
||||||
|
bool>::Type
|
||||||
ToJSValue(JSContext* aCx, nsAutoPtr<T>&& aArgument,
|
ToJSValue(JSContext* aCx, nsAutoPtr<T>&& aArgument,
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
if (!binding_detail::ToJSValueFromPointerHelper(aCx, aArgument.get(),
|
if (!binding_detail::ToJSValueFromPointerHelper(aCx, aArgument.get(),
|
||||||
|
|
@ -177,7 +181,8 @@ MOZ_MUST_USE
|
||||||
// UniquePtr.
|
// UniquePtr.
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE
|
MOZ_MUST_USE
|
||||||
typename EnableIf<IsBaseOf<NonRefcountedDOMObject, T>::value, bool>::Type
|
typename EnableIf<std::is_base_of<NonRefcountedDOMObject, T>::value,
|
||||||
|
bool>::Type
|
||||||
ToJSValue(JSContext* aCx, UniquePtr<T>&& aArgument,
|
ToJSValue(JSContext* aCx, UniquePtr<T>&& aArgument,
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
if (!binding_detail::ToJSValueFromPointerHelper(aCx, aArgument.get(),
|
if (!binding_detail::ToJSValueFromPointerHelper(aCx, aArgument.get(),
|
||||||
|
|
@ -193,7 +198,7 @@ MOZ_MUST_USE
|
||||||
// Accept typed arrays built from appropriate nsTArray values
|
// Accept typed arrays built from appropriate nsTArray values
|
||||||
template <typename T>
|
template <typename T>
|
||||||
MOZ_MUST_USE
|
MOZ_MUST_USE
|
||||||
typename EnableIf<IsBaseOf<AllTypedArraysBase, T>::value, bool>::Type
|
typename EnableIf<std::is_base_of<AllTypedArraysBase, T>::value, bool>::Type
|
||||||
ToJSValue(JSContext* aCx, const TypedArrayCreator<T>& aArgument,
|
ToJSValue(JSContext* aCx, const TypedArrayCreator<T>& aArgument,
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
// Make sure we're called in a compartment
|
// Make sure we're called in a compartment
|
||||||
|
|
@ -210,9 +215,9 @@ MOZ_MUST_USE
|
||||||
// Accept objects that inherit from nsISupports but not nsWrapperCache (e.g.
|
// Accept objects that inherit from nsISupports but not nsWrapperCache (e.g.
|
||||||
// DOM File).
|
// DOM File).
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE typename EnableIf<!IsBaseOf<nsWrapperCache, T>::value &&
|
MOZ_MUST_USE typename EnableIf<!std::is_base_of<nsWrapperCache, T>::value &&
|
||||||
!IsBaseOf<CallbackObject, T>::value &&
|
!std::is_base_of<CallbackObject, T>::value &&
|
||||||
IsBaseOf<nsISupports, T>::value,
|
std::is_base_of<nsISupports, T>::value,
|
||||||
bool>::Type
|
bool>::Type
|
||||||
ToJSValue(JSContext* aCx, T& aArgument, JS::MutableHandle<JS::Value> aValue) {
|
ToJSValue(JSContext* aCx, T& aArgument, JS::MutableHandle<JS::Value> aValue) {
|
||||||
// Make sure we're called in a compartment
|
// Make sure we're called in a compartment
|
||||||
|
|
@ -247,9 +252,10 @@ MOZ_MUST_USE bool ToJSValue(JSContext* aCx, const NonNull<T>& aArgument,
|
||||||
|
|
||||||
// Accept WebIDL dictionaries
|
// Accept WebIDL dictionaries
|
||||||
template <class T>
|
template <class T>
|
||||||
MOZ_MUST_USE typename EnableIf<IsBaseOf<DictionaryBase, T>::value, bool>::Type
|
MOZ_MUST_USE
|
||||||
ToJSValue(JSContext* aCx, const T& aArgument,
|
typename EnableIf<std::is_base_of<DictionaryBase, T>::value, bool>::Type
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
ToJSValue(JSContext* aCx, const T& aArgument,
|
||||||
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
return aArgument.ToObjectInternal(aCx, aValue);
|
return aArgument.ToObjectInternal(aCx, aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -306,7 +312,7 @@ MOZ_MUST_USE bool ToJSValue(JSContext* aCx, ErrorResult& aArgument,
|
||||||
// Accept owning WebIDL unions.
|
// Accept owning WebIDL unions.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
MOZ_MUST_USE
|
MOZ_MUST_USE
|
||||||
typename EnableIf<IsBaseOf<AllOwningUnionBase, T>::value, bool>::Type
|
typename EnableIf<std::is_base_of<AllOwningUnionBase, T>::value, bool>::Type
|
||||||
ToJSValue(JSContext* aCx, const T& aArgument,
|
ToJSValue(JSContext* aCx, const T& aArgument,
|
||||||
JS::MutableHandle<JS::Value> aValue) {
|
JS::MutableHandle<JS::Value> aValue) {
|
||||||
JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
|
JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class CommandBufferBuilder {
|
||||||
/// This must be used between BeginCommandBuffer and EndCommandBuffer.
|
/// This must be used between BeginCommandBuffer and EndCommandBuffer.
|
||||||
template <typename T, typename... Args>
|
template <typename T, typename... Args>
|
||||||
ptrdiff_t AddCommand(Args&&... aArgs) {
|
ptrdiff_t AddCommand(Args&&... aArgs) {
|
||||||
static_assert(IsBaseOf<DrawingCommand, T>::value,
|
static_assert(std::is_base_of<DrawingCommand, T>::value,
|
||||||
"T must derive from DrawingCommand");
|
"T must derive from DrawingCommand");
|
||||||
return mCommands->mStorage.Alloc<T>(std::forward<Args>(aArgs)...);
|
return mCommands->mStorage.Alloc<T>(std::forward<Args>(aArgs)...);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -322,9 +322,8 @@ class StackFrame {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void construct(T* ptr) {
|
void construct(T* ptr) {
|
||||||
static_assert(
|
static_assert(std::is_base_of<BaseStackFrame, ConcreteStackFrame<T>>::value,
|
||||||
mozilla::IsBaseOf<BaseStackFrame, ConcreteStackFrame<T>>::value,
|
"ConcreteStackFrame<T> must inherit from BaseStackFrame");
|
||||||
"ConcreteStackFrame<T> must inherit from BaseStackFrame");
|
|
||||||
static_assert(
|
static_assert(
|
||||||
sizeof(ConcreteStackFrame<T>) == sizeof(*base()),
|
sizeof(ConcreteStackFrame<T>) == sizeof(*base()),
|
||||||
"ubi::ConcreteStackFrame<T> specializations must be the same size as "
|
"ubi::ConcreteStackFrame<T> specializations must be the same size as "
|
||||||
|
|
@ -711,7 +710,7 @@ class Node {
|
||||||
static_assert(
|
static_assert(
|
||||||
sizeof(Concrete<T>) == sizeof(*base()),
|
sizeof(Concrete<T>) == sizeof(*base()),
|
||||||
"ubi::Base specializations must be the same size as ubi::Base");
|
"ubi::Base specializations must be the same size as ubi::Base");
|
||||||
static_assert(mozilla::IsBaseOf<Base, Concrete<T>>::value,
|
static_assert(std::is_base_of<Base, Concrete<T>>::value,
|
||||||
"ubi::Concrete<T> must inherit from ubi::Base");
|
"ubi::Concrete<T> must inherit from ubi::Base");
|
||||||
Concrete<T>::construct(base(), ptr);
|
Concrete<T>::construct(base(), ptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ BinASTParserPerTokenizer<Tok>::asFinalParser() {
|
||||||
// Same as GeneralParser::asFinalParser, verify the inheritance to
|
// Same as GeneralParser::asFinalParser, verify the inheritance to
|
||||||
// make sure the static downcast works.
|
// make sure the static downcast works.
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<BinASTParserPerTokenizer<Tok>, FinalParser>::value,
|
std::is_base_of<BinASTParserPerTokenizer<Tok>, FinalParser>::value,
|
||||||
"inheritance relationship required by the static_cast<> below");
|
"inheritance relationship required by the static_cast<> below");
|
||||||
|
|
||||||
return static_cast<FinalParser*>(this);
|
return static_cast<FinalParser*>(this);
|
||||||
|
|
@ -799,7 +799,7 @@ template <typename Tok>
|
||||||
inline const typename BinASTParserPerTokenizer<Tok>::FinalParser*
|
inline const typename BinASTParserPerTokenizer<Tok>::FinalParser*
|
||||||
BinASTParserPerTokenizer<Tok>::asFinalParser() const {
|
BinASTParserPerTokenizer<Tok>::asFinalParser() const {
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<BinASTParserPerTokenizer<Tok>, FinalParser>::value,
|
std::is_base_of<BinASTParserPerTokenizer<Tok>, FinalParser>::value,
|
||||||
"inheritance relationship required by the static_cast<> below");
|
"inheritance relationship required by the static_cast<> below");
|
||||||
|
|
||||||
return static_cast<const FinalParser*>(this);
|
return static_cast<const FinalParser*>(this);
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ template <class ParseHandler, typename Unit>
|
||||||
inline typename GeneralParser<ParseHandler, Unit>::FinalParser*
|
inline typename GeneralParser<ParseHandler, Unit>::FinalParser*
|
||||||
GeneralParser<ParseHandler, Unit>::asFinalParser() {
|
GeneralParser<ParseHandler, Unit>::asFinalParser() {
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<GeneralParser<ParseHandler, Unit>, FinalParser>::value,
|
std::is_base_of<GeneralParser<ParseHandler, Unit>, FinalParser>::value,
|
||||||
"inheritance relationship required by the static_cast<> below");
|
"inheritance relationship required by the static_cast<> below");
|
||||||
|
|
||||||
return static_cast<FinalParser*>(this);
|
return static_cast<FinalParser*>(this);
|
||||||
|
|
@ -118,7 +118,7 @@ template <class ParseHandler, typename Unit>
|
||||||
inline const typename GeneralParser<ParseHandler, Unit>::FinalParser*
|
inline const typename GeneralParser<ParseHandler, Unit>::FinalParser*
|
||||||
GeneralParser<ParseHandler, Unit>::asFinalParser() const {
|
GeneralParser<ParseHandler, Unit>::asFinalParser() const {
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<GeneralParser<ParseHandler, Unit>, FinalParser>::value,
|
std::is_base_of<GeneralParser<ParseHandler, Unit>, FinalParser>::value,
|
||||||
"inheritance relationship required by the static_cast<> below");
|
"inheritance relationship required by the static_cast<> below");
|
||||||
|
|
||||||
return static_cast<const FinalParser*>(this);
|
return static_cast<const FinalParser*>(this);
|
||||||
|
|
|
||||||
|
|
@ -1825,7 +1825,7 @@ ParserAnyCharsAccess<Parser>::anyChars(const GeneralTokenStreamChars* ts) {
|
||||||
// member within.
|
// member within.
|
||||||
|
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<GeneralTokenStreamChars, TokenStreamSpecific>::value,
|
std::is_base_of<GeneralTokenStreamChars, TokenStreamSpecific>::value,
|
||||||
"the static_cast<> below assumes a base-class relationship");
|
"the static_cast<> below assumes a base-class relationship");
|
||||||
const auto* tss = static_cast<const TokenStreamSpecific*>(ts);
|
const auto* tss = static_cast<const TokenStreamSpecific*>(ts);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1902,7 +1902,7 @@ class GeneralTokenStreamChars : public SpecializedTokenStreamCharsBase<Unit> {
|
||||||
|
|
||||||
TokenStreamSpecific* asSpecific() {
|
TokenStreamSpecific* asSpecific() {
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<GeneralTokenStreamChars, TokenStreamSpecific>::value,
|
std::is_base_of<GeneralTokenStreamChars, TokenStreamSpecific>::value,
|
||||||
"static_cast below presumes an inheritance relationship");
|
"static_cast below presumes an inheritance relationship");
|
||||||
|
|
||||||
return static_cast<TokenStreamSpecific*>(this);
|
return static_cast<TokenStreamSpecific*>(this);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ struct TaggedPtr<JS::Value> {
|
||||||
static JS::Value wrap(JS::BigInt* bi) { return JS::BigIntValue(bi); }
|
static JS::Value wrap(JS::BigInt* bi) { return JS::BigIntValue(bi); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static JS::Value wrap(T* priv) {
|
static JS::Value wrap(T* priv) {
|
||||||
static_assert(mozilla::IsBaseOf<Cell, T>::value,
|
static_assert(std::is_base_of<Cell, T>::value,
|
||||||
"Type must be a GC thing derived from js::gc::Cell");
|
"Type must be a GC thing derived from js::gc::Cell");
|
||||||
return JS::PrivateGCThingValue(priv);
|
return JS::PrivateGCThingValue(priv);
|
||||||
}
|
}
|
||||||
|
|
@ -57,20 +57,20 @@ struct TaggedPtr<TaggedProto> {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct MightBeForwarded {
|
struct MightBeForwarded {
|
||||||
static_assert(mozilla::IsBaseOf<Cell, T>::value, "T must derive from Cell");
|
static_assert(std::is_base_of<Cell, T>::value, "T must derive from Cell");
|
||||||
static_assert(!mozilla::IsSame<Cell, T>::value &&
|
static_assert(!mozilla::IsSame<Cell, T>::value &&
|
||||||
!mozilla::IsSame<TenuredCell, T>::value,
|
!mozilla::IsSame<TenuredCell, T>::value,
|
||||||
"T must not be Cell or TenuredCell");
|
"T must not be Cell or TenuredCell");
|
||||||
|
|
||||||
static const bool value = mozilla::IsBaseOf<JSObject, T>::value ||
|
static const bool value = std::is_base_of<JSObject, T>::value ||
|
||||||
mozilla::IsBaseOf<Shape, T>::value ||
|
std::is_base_of<Shape, T>::value ||
|
||||||
mozilla::IsBaseOf<BaseShape, T>::value ||
|
std::is_base_of<BaseShape, T>::value ||
|
||||||
mozilla::IsBaseOf<JSString, T>::value ||
|
std::is_base_of<JSString, T>::value ||
|
||||||
mozilla::IsBaseOf<JS::BigInt, T>::value ||
|
std::is_base_of<JS::BigInt, T>::value ||
|
||||||
mozilla::IsBaseOf<JSScript, T>::value ||
|
std::is_base_of<JSScript, T>::value ||
|
||||||
mozilla::IsBaseOf<js::LazyScript, T>::value ||
|
std::is_base_of<js::LazyScript, T>::value ||
|
||||||
mozilla::IsBaseOf<js::Scope, T>::value ||
|
std::is_base_of<js::Scope, T>::value ||
|
||||||
mozilla::IsBaseOf<js::RegExpShared, T>::value;
|
std::is_base_of<js::RegExpShared, T>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
||||||
|
|
@ -3610,9 +3610,9 @@ static inline bool ShouldCheckMarkState(JSRuntime* rt, T** thingp) {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct MightBeNurseryAllocated {
|
struct MightBeNurseryAllocated {
|
||||||
static const bool value = mozilla::IsBaseOf<JSObject, T>::value ||
|
static const bool value = std::is_base_of<JSObject, T>::value ||
|
||||||
mozilla::IsBaseOf<JSString, T>::value ||
|
std::is_base_of<JSString, T>::value ||
|
||||||
mozilla::IsBaseOf<JS::BigInt, T>::value;
|
std::is_base_of<JS::BigInt, T>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ struct InternalGCPointerPolicy : public JS::GCPointerPolicy<T> {
|
||||||
using Type = typename mozilla::RemovePointer<T>::Type;
|
using Type = typename mozilla::RemovePointer<T>::Type;
|
||||||
|
|
||||||
#define IS_BASE_OF_OR(_1, BaseType, _2, _3) \
|
#define IS_BASE_OF_OR(_1, BaseType, _2, _3) \
|
||||||
mozilla::IsBaseOf<BaseType, Type>::value ||
|
std::is_base_of<BaseType, Type>::value ||
|
||||||
static_assert(
|
static_assert(
|
||||||
JS_FOR_EACH_TRACEKIND(IS_BASE_OF_OR) false,
|
JS_FOR_EACH_TRACEKIND(IS_BASE_OF_OR) false,
|
||||||
"InternalGCPointerPolicy must only be used for GC thing pointers");
|
"InternalGCPointerPolicy must only be used for GC thing pointers");
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ template <typename T>
|
||||||
struct BaseGCType {
|
struct BaseGCType {
|
||||||
using type =
|
using type =
|
||||||
typename MapTraceKindToType<JS::MapTypeToTraceKind<T>::kind>::Type;
|
typename MapTraceKindToType<JS::MapTypeToTraceKind<T>::kind>::Type;
|
||||||
static_assert(mozilla::IsBaseOf<type, T>::value, "Failed to find base type");
|
static_assert(std::is_base_of<type, T>::value, "Failed to find base type");
|
||||||
};
|
};
|
||||||
|
|
||||||
// Our barrier templates are parameterized on the pointer types so that we can
|
// Our barrier templates are parameterized on the pointer types so that we can
|
||||||
|
|
|
||||||
|
|
@ -265,11 +265,10 @@ bool JitRuntime::generateTrampolines(JSContext* cx) {
|
||||||
|
|
||||||
// The arguments rectifier has to use the same frame layout as the function
|
// The arguments rectifier has to use the same frame layout as the function
|
||||||
// frames it rectifies.
|
// frames it rectifies.
|
||||||
static_assert(mozilla::IsBaseOf<JitFrameLayout, RectifierFrameLayout>::value,
|
static_assert(std::is_base_of<JitFrameLayout, RectifierFrameLayout>::value,
|
||||||
"a rectifier frame can be used with jit frame");
|
"a rectifier frame can be used with jit frame");
|
||||||
static_assert(
|
static_assert(std::is_base_of<JitFrameLayout, WasmToJSJitFrameLayout>::value,
|
||||||
mozilla::IsBaseOf<JitFrameLayout, WasmToJSJitFrameLayout>::value,
|
"wasm frames simply are jit frames");
|
||||||
"wasm frames simply are jit frames");
|
|
||||||
static_assert(sizeof(JitFrameLayout) == sizeof(WasmToJSJitFrameLayout),
|
static_assert(sizeof(JitFrameLayout) == sizeof(WasmToJSJitFrameLayout),
|
||||||
"thus a rectifier frame can be used with a wasm frame");
|
"thus a rectifier frame can be used with a wasm frame");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ class CodeGeneratorShared : public LElementVisitor {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline size_t allocateIC(const T& cache) {
|
inline size_t allocateIC(const T& cache) {
|
||||||
static_assert(mozilla::IsBaseOf<IonIC, T>::value,
|
static_assert(std::is_base_of<IonIC, T>::value,
|
||||||
"T must inherit from IonIC");
|
"T must inherit from IonIC");
|
||||||
size_t index;
|
size_t index;
|
||||||
masm.propagateOOM(
|
masm.propagateOOM(
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ class BaseScopeData {};
|
||||||
|
|
||||||
template <class Data>
|
template <class Data>
|
||||||
inline size_t SizeOfData(uint32_t numBindings) {
|
inline size_t SizeOfData(uint32_t numBindings) {
|
||||||
static_assert(mozilla::IsBaseOf<BaseScopeData, Data>::value,
|
static_assert(std::is_base_of<BaseScopeData, Data>::value,
|
||||||
"Data must be the correct sort of data, i.e. it must "
|
"Data must be the correct sort of data, i.e. it must "
|
||||||
"inherit from BaseScopeData");
|
"inherit from BaseScopeData");
|
||||||
return sizeof(Data) +
|
return sizeof(Data) +
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ inline GCPtrShape* DictionaryShapeLink::prevPtr() {
|
||||||
template <class ObjectSubclass>
|
template <class ObjectSubclass>
|
||||||
/* static */ inline bool EmptyShape::ensureInitialCustomShape(
|
/* static */ inline bool EmptyShape::ensureInitialCustomShape(
|
||||||
JSContext* cx, Handle<ObjectSubclass*> obj) {
|
JSContext* cx, Handle<ObjectSubclass*> obj) {
|
||||||
static_assert(mozilla::IsBaseOf<JSObject, ObjectSubclass>::value,
|
static_assert(std::is_base_of<JSObject, ObjectSubclass>::value,
|
||||||
"ObjectSubclass must be a subclass of JSObject");
|
"ObjectSubclass must be a subclass of JSObject");
|
||||||
|
|
||||||
// If the provided object has a non-empty shape, it was given the cached
|
// If the provided object has a non-empty shape, it was given the cached
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ XrayTraits* GetXrayTraits(JSObject* obj);
|
||||||
|
|
||||||
template <typename Base, typename Traits>
|
template <typename Base, typename Traits>
|
||||||
class XrayWrapper : public Base {
|
class XrayWrapper : public Base {
|
||||||
static_assert(mozilla::IsBaseOf<js::BaseProxyHandler, Base>::value,
|
static_assert(std::is_base_of<js::BaseProxyHandler, Base>::value,
|
||||||
"Base *must* derive from js::BaseProxyHandler");
|
"Base *must* derive from js::BaseProxyHandler");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,8 @@ class do_QueryFrameHelper {
|
||||||
template <class Src, class Dst>
|
template <class Src, class Dst>
|
||||||
struct FastQueryFrame<
|
struct FastQueryFrame<
|
||||||
Src, Dst,
|
Src, Dst,
|
||||||
typename mozilla::EnableIf<mozilla::IsBaseOf<nsIFrame, Src>::value>::Type,
|
typename mozilla::EnableIf<std::is_base_of<nsIFrame, Src>::value>::Type,
|
||||||
typename mozilla::EnableIf<
|
typename mozilla::EnableIf<std::is_base_of<nsIFrame, Dst>::value>::Type> {
|
||||||
mozilla::IsBaseOf<nsIFrame, Dst>::value>::Type> {
|
|
||||||
static Dst* QueryFrame(Src* aFrame) {
|
static Dst* QueryFrame(Src* aFrame) {
|
||||||
return nsQueryFrame::FrameIID(aFrame->mClass) == Dst::kFrameIID
|
return nsQueryFrame::FrameIID(aFrame->mClass) == Dst::kFrameIID
|
||||||
? reinterpret_cast<Dst*>(aFrame)
|
? reinterpret_cast<Dst*>(aFrame)
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ struct AlignedChecker<AlignType, Pointee> {
|
||||||
* particular alignment).
|
* particular alignment).
|
||||||
*/
|
*/
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
inline typename EnableIf<IsSame<T, U>::value || IsBaseOf<T, U>::value ||
|
inline typename EnableIf<IsSame<T, U>::value || std::is_base_of<T, U>::value ||
|
||||||
IsVoid<T>::value,
|
IsVoid<T>::value,
|
||||||
bool>::Type
|
bool>::Type
|
||||||
IsInRange(const T* aPtr, const U* aBegin, const U* aEnd) {
|
IsInRange(const T* aPtr, const U* aBegin, const U* aEnd) {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class DoublyLinkedListElement {
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct GetDoublyLinkedListElement {
|
struct GetDoublyLinkedListElement {
|
||||||
static_assert(mozilla::IsBaseOf<DoublyLinkedListElement<T>, T>::value,
|
static_assert(std::is_base_of<DoublyLinkedListElement<T>, T>::value,
|
||||||
"You need your own specialization of GetDoublyLinkedListElement"
|
"You need your own specialization of GetDoublyLinkedListElement"
|
||||||
" or use a separate Trait.");
|
" or use a separate Trait.");
|
||||||
static DoublyLinkedListElement<T>& Get(T* aThis) { return *aThis; }
|
static DoublyLinkedListElement<T>& Get(T* aThis) { return *aThis; }
|
||||||
|
|
|
||||||
14
mfbt/Pair.h
14
mfbt/Pair.h
|
|
@ -26,13 +26,13 @@ enum StorageType { AsBase, AsMember };
|
||||||
// The extra conditions on storage for B are necessary so that PairHelper won't
|
// The extra conditions on storage for B are necessary so that PairHelper won't
|
||||||
// ambiguously inherit from either A or B, such that one or the other base class
|
// ambiguously inherit from either A or B, such that one or the other base class
|
||||||
// would be inaccessible.
|
// would be inaccessible.
|
||||||
template <typename A, typename B,
|
template <
|
||||||
detail::StorageType =
|
typename A, typename B,
|
||||||
IsEmpty<A>::value ? detail::AsBase : detail::AsMember,
|
detail::StorageType = IsEmpty<A>::value ? detail::AsBase : detail::AsMember,
|
||||||
detail::StorageType = IsEmpty<B>::value && !IsBaseOf<A, B>::value &&
|
detail::StorageType = IsEmpty<B>::value && !std::is_base_of<A, B>::value &&
|
||||||
!IsBaseOf<B, A>::value
|
!std::is_base_of<B, A>::value
|
||||||
? detail::AsBase
|
? detail::AsBase
|
||||||
: detail::AsMember>
|
: detail::AsMember>
|
||||||
struct PairHelper;
|
struct PairHelper;
|
||||||
|
|
||||||
template <typename A, typename B>
|
template <typename A, typename B>
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ template <typename T>
|
||||||
class RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount> {
|
class RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount> {
|
||||||
public:
|
public:
|
||||||
~RefCounted() {
|
~RefCounted() {
|
||||||
static_assert(IsBaseOf<RefCounted, T>::value,
|
static_assert(std::is_base_of<RefCounted, T>::value,
|
||||||
"T must derive from RefCounted<T>");
|
"T must derive from RefCounted<T>");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -266,7 +266,7 @@ class AtomicRefCounted
|
||||||
Recording> {
|
Recording> {
|
||||||
public:
|
public:
|
||||||
~AtomicRefCounted() {
|
~AtomicRefCounted() {
|
||||||
static_assert(IsBaseOf<AtomicRefCounted, T>::value,
|
static_assert(std::is_base_of<AtomicRefCounted, T>::value,
|
||||||
"T must derive from AtomicRefCounted<T>");
|
"T must derive from AtomicRefCounted<T>");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ class SupportsThreadSafeWeakPtr : public external::AtomicRefCounted<T> {
|
||||||
// that the object may be of an actual derived type U, but the weak reference
|
// that the object may be of an actual derived type U, but the weak reference
|
||||||
// is created for the supplied type T of SupportsThreadSafeWeakPtr<T>.
|
// is created for the supplied type T of SupportsThreadSafeWeakPtr<T>.
|
||||||
already_AddRefed<ThreadSafeWeakReference> getThreadSafeWeakReference() {
|
already_AddRefed<ThreadSafeWeakReference> getThreadSafeWeakReference() {
|
||||||
static_assert(IsBaseOf<SupportsThreadSafeWeakPtr<T>, T>::value,
|
static_assert(std::is_base_of<SupportsThreadSafeWeakPtr<T>, T>::value,
|
||||||
"T must derive from SupportsThreadSafeWeakPtr<T>");
|
"T must derive from SupportsThreadSafeWeakPtr<T>");
|
||||||
|
|
||||||
if (!mRef) {
|
if (!mRef) {
|
||||||
|
|
@ -312,9 +312,9 @@ class ThreadSafeWeakPtr {
|
||||||
private:
|
private:
|
||||||
// Gets a new strong reference of the proper type T to the tracked object.
|
// Gets a new strong reference of the proper type T to the tracked object.
|
||||||
already_AddRefed<T> getRefPtr() const {
|
already_AddRefed<T> getRefPtr() const {
|
||||||
static_assert(
|
static_assert(std::is_base_of<typename ThreadSafeWeakReference::ElementType,
|
||||||
IsBaseOf<typename ThreadSafeWeakReference::ElementType, T>::value,
|
T>::value,
|
||||||
"T must derive from ThreadSafeWeakReference::ElementType");
|
"T must derive from ThreadSafeWeakReference::ElementType");
|
||||||
return mRef ? mRef->getRefPtr().template downcast<T>() : nullptr;
|
return mRef ? mRef->getRefPtr().template downcast<T>() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -322,9 +322,9 @@ class ThreadSafeWeakPtr {
|
||||||
// Note that this operation is unsafe as it may cause races if downwind
|
// Note that this operation is unsafe as it may cause races if downwind
|
||||||
// code depends on the value not to change after reading.
|
// code depends on the value not to change after reading.
|
||||||
T* get() const {
|
T* get() const {
|
||||||
static_assert(
|
static_assert(std::is_base_of<typename ThreadSafeWeakReference::ElementType,
|
||||||
IsBaseOf<typename ThreadSafeWeakReference::ElementType, T>::value,
|
T>::value,
|
||||||
"T must derive from ThreadSafeWeakReference::ElementType");
|
"T must derive from ThreadSafeWeakReference::ElementType");
|
||||||
return mRef ? static_cast<T*>(mRef->get()) : nullptr;
|
return mRef ? static_cast<T*>(mRef->get()) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -728,9 +728,9 @@ struct BaseOfTester<Type, const Type> : TrueType {};
|
||||||
* class B : public A {};
|
* class B : public A {};
|
||||||
* class C {};
|
* class C {};
|
||||||
*
|
*
|
||||||
* mozilla::IsBaseOf<A, A>::value is true;
|
* std::is_base_of<A, A>::value is true;
|
||||||
* mozilla::IsBaseOf<A, B>::value is true;
|
* std::is_base_of<A, B>::value is true;
|
||||||
* mozilla::IsBaseOf<A, C>::value is false;
|
* std::is_base_of<A, C>::value is false;
|
||||||
*/
|
*/
|
||||||
template <class Base, class Derived>
|
template <class Base, class Derived>
|
||||||
struct IsBaseOf
|
struct IsBaseOf
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ template <typename T>
|
||||||
class SupportsWeakPtr {
|
class SupportsWeakPtr {
|
||||||
protected:
|
protected:
|
||||||
~SupportsWeakPtr() {
|
~SupportsWeakPtr() {
|
||||||
static_assert(IsBaseOf<SupportsWeakPtr<T>, T>::value,
|
static_assert(std::is_base_of<SupportsWeakPtr<T>, T>::value,
|
||||||
"T must derive from SupportsWeakPtr<T>");
|
"T must derive from SupportsWeakPtr<T>");
|
||||||
if (mSelfReferencingWeakPtr) {
|
if (mSelfReferencingWeakPtr) {
|
||||||
mSelfReferencingWeakPtr.mRef->detach();
|
mSelfReferencingWeakPtr.mRef->detach();
|
||||||
|
|
|
||||||
|
|
@ -427,22 +427,23 @@ struct B2 : B {};
|
||||||
struct D : private B1, private B2 {};
|
struct D : private B1, private B2 {};
|
||||||
|
|
||||||
static void StandardIsBaseOfTests() {
|
static void StandardIsBaseOfTests() {
|
||||||
static_assert((IsBaseOf<B, D>::value) == true, "IsBaseOf fails on diamond");
|
static_assert((std::is_base_of<B, D>::value) == true,
|
||||||
static_assert((IsBaseOf<const B, D>::value) == true,
|
"IsBaseOf fails on diamond");
|
||||||
|
static_assert((std::is_base_of<const B, D>::value) == true,
|
||||||
"IsBaseOf fails on diamond plus constness change");
|
"IsBaseOf fails on diamond plus constness change");
|
||||||
static_assert((IsBaseOf<B, const D>::value) == true,
|
static_assert((std::is_base_of<B, const D>::value) == true,
|
||||||
"IsBaseOf fails on diamond plus constness change");
|
"IsBaseOf fails on diamond plus constness change");
|
||||||
static_assert((IsBaseOf<B, const B>::value) == true,
|
static_assert((std::is_base_of<B, const B>::value) == true,
|
||||||
"IsBaseOf fails on constness change");
|
"IsBaseOf fails on constness change");
|
||||||
static_assert((IsBaseOf<D, B>::value) == false,
|
static_assert((std::is_base_of<D, B>::value) == false,
|
||||||
"IsBaseOf got the direction of inheritance wrong");
|
"IsBaseOf got the direction of inheritance wrong");
|
||||||
static_assert((IsBaseOf<B&, D&>::value) == false,
|
static_assert((std::is_base_of<B&, D&>::value) == false,
|
||||||
"IsBaseOf should return false on references");
|
"IsBaseOf should return false on references");
|
||||||
static_assert((IsBaseOf<B[3], D[3]>::value) == false,
|
static_assert((std::is_base_of<B[3], D[3]>::value) == false,
|
||||||
"IsBaseOf should return false on arrays");
|
"IsBaseOf should return false on arrays");
|
||||||
// We fail at the following test. To fix it, we need to specialize IsBaseOf
|
// We fail at the following test. To fix it, we need to specialize IsBaseOf
|
||||||
// for all built-in types.
|
// for all built-in types.
|
||||||
// static_assert((IsBaseOf<int, int>::value) == false);
|
// static_assert((std::is_base_of<int, int>::value) == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace CPlusPlus11IsBaseOf */
|
} /* namespace CPlusPlus11IsBaseOf */
|
||||||
|
|
@ -455,15 +456,15 @@ class E : public A {};
|
||||||
class F : public B, public E {};
|
class F : public B, public E {};
|
||||||
|
|
||||||
static void TestIsBaseOf() {
|
static void TestIsBaseOf() {
|
||||||
static_assert((IsBaseOf<A, B>::value), "A is a base of B");
|
static_assert((std::is_base_of<A, B>::value), "A is a base of B");
|
||||||
static_assert((!IsBaseOf<B, A>::value), "B is not a base of A");
|
static_assert((!std::is_base_of<B, A>::value), "B is not a base of A");
|
||||||
static_assert((IsBaseOf<A, C>::value), "A is a base of C");
|
static_assert((std::is_base_of<A, C>::value), "A is a base of C");
|
||||||
static_assert((!IsBaseOf<C, A>::value), "C is not a base of A");
|
static_assert((!std::is_base_of<C, A>::value), "C is not a base of A");
|
||||||
static_assert((IsBaseOf<A, F>::value), "A is a base of F");
|
static_assert((std::is_base_of<A, F>::value), "A is a base of F");
|
||||||
static_assert((!IsBaseOf<F, A>::value), "F is not a base of A");
|
static_assert((!std::is_base_of<F, A>::value), "F is not a base of A");
|
||||||
static_assert((!IsBaseOf<A, D>::value), "A is not a base of D");
|
static_assert((!std::is_base_of<A, D>::value), "A is not a base of D");
|
||||||
static_assert((!IsBaseOf<D, A>::value), "D is not a base of A");
|
static_assert((!std::is_base_of<D, A>::value), "D is not a base of A");
|
||||||
static_assert((IsBaseOf<B, B>::value),
|
static_assert((std::is_base_of<B, B>::value),
|
||||||
"B is the same as B (and therefore, a base of B)");
|
"B is the same as B (and therefore, a base of B)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ enum NativePtrType { OWNING, WEAK, REFPTR };
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
class NativePtrPicker {
|
class NativePtrPicker {
|
||||||
template <class I>
|
template <class I>
|
||||||
static typename EnableIf<IsBaseOf<SupportsWeakPtr<I>, I>::value,
|
static typename EnableIf<std::is_base_of<SupportsWeakPtr<I>, I>::value,
|
||||||
char (&)[NativePtrType::WEAK]>::Type
|
char (&)[NativePtrType::WEAK]>::Type
|
||||||
Test(char);
|
Test(char);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,9 +131,9 @@ class nsAppShell : public nsBaseAppShell {
|
||||||
const mozilla::TimeDuration timeout = mozilla::TimeDuration::Forever());
|
const mozilla::TimeDuration timeout = mozilla::TimeDuration::Forever());
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static typename mozilla::EnableIf<!mozilla::IsBaseOf<Event, T>::value,
|
static
|
||||||
void>::Type
|
typename mozilla::EnableIf<!std::is_base_of<Event, T>::value, void>::Type
|
||||||
SyncRunEvent(T&& lambda) {
|
SyncRunEvent(T&& lambda) {
|
||||||
SyncRunEvent(LambdaEvent<T>(std::forward<T>(lambda)));
|
SyncRunEvent(LambdaEvent<T>(std::forward<T>(lambda)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ void DropJSObjectsImpl(nsISupports* aHolder);
|
||||||
|
|
||||||
} // namespace cyclecollector
|
} // namespace cyclecollector
|
||||||
|
|
||||||
template <class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
|
template <class T, bool isISupports = std::is_base_of<nsISupports, T>::value>
|
||||||
struct HoldDropJSObjectsHelper {
|
struct HoldDropJSObjectsHelper {
|
||||||
static void Hold(T* aHolder) {
|
static void Hold(T* aHolder) {
|
||||||
cyclecollector::HoldJSObjectsImpl(aHolder,
|
cyclecollector::HoldJSObjectsImpl(aHolder,
|
||||||
|
|
|
||||||
|
|
@ -485,8 +485,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
MOZ_IMPLICIT nsCOMPtr(const nsCOMPtr<U>& aSmartPtr)
|
MOZ_IMPLICIT nsCOMPtr(const nsCOMPtr<U>& aSmartPtr)
|
||||||
: NSCAP_CTOR_BASE(aSmartPtr.get()) {
|
: NSCAP_CTOR_BASE(aSmartPtr.get()) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value,
|
static_assert(std::is_base_of<T, U>::value, "U should be a subclass of T");
|
||||||
"U should be a subclass of T");
|
|
||||||
assert_validity();
|
assert_validity();
|
||||||
if (mRawPtr) {
|
if (mRawPtr) {
|
||||||
NSCAP_ADDREF(this, mRawPtr);
|
NSCAP_ADDREF(this, mRawPtr);
|
||||||
|
|
@ -504,8 +503,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
MOZ_IMPLICIT nsCOMPtr(nsCOMPtr<U>&& aSmartPtr)
|
MOZ_IMPLICIT nsCOMPtr(nsCOMPtr<U>&& aSmartPtr)
|
||||||
: NSCAP_CTOR_BASE(aSmartPtr.forget().template downcast<T>().take()) {
|
: NSCAP_CTOR_BASE(aSmartPtr.forget().template downcast<T>().take()) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value,
|
static_assert(std::is_base_of<T, U>::value, "U should be a subclass of T");
|
||||||
"U should be a subclass of T");
|
|
||||||
assert_validity();
|
assert_validity();
|
||||||
NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
|
NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
|
|
@ -541,7 +539,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
: NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take())) {
|
: NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take())) {
|
||||||
assert_validity();
|
assert_validity();
|
||||||
// But make sure that U actually inherits from T.
|
// But make sure that U actually inherits from T.
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value, "U is not a subclass of T");
|
static_assert(std::is_base_of<T, U>::value, "U is not a subclass of T");
|
||||||
NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
|
NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
}
|
}
|
||||||
|
|
@ -552,7 +550,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
: NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take())) {
|
: NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take())) {
|
||||||
assert_validity();
|
assert_validity();
|
||||||
// But make sure that U actually inherits from T.
|
// But make sure that U actually inherits from T.
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value, "U is not a subclass of T");
|
static_assert(std::is_base_of<T, U>::value, "U is not a subclass of T");
|
||||||
NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
|
NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
}
|
}
|
||||||
|
|
@ -647,8 +645,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
template <class U>
|
template <class U>
|
||||||
nsCOMPtr<T>& operator=(const nsCOMPtr<U>& aRhs) {
|
nsCOMPtr<T>& operator=(const nsCOMPtr<U>& aRhs) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value,
|
static_assert(std::is_base_of<T, U>::value, "U should be a subclass of T");
|
||||||
"U should be a subclass of T");
|
|
||||||
assign_with_AddRef(ToSupports(static_cast<T*>(aRhs.get())));
|
assign_with_AddRef(ToSupports(static_cast<T*>(aRhs.get())));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
@ -661,8 +658,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
template <class U>
|
template <class U>
|
||||||
nsCOMPtr<T>& operator=(nsCOMPtr<U>&& aRhs) {
|
nsCOMPtr<T>& operator=(nsCOMPtr<U>&& aRhs) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value,
|
static_assert(std::is_base_of<T, U>::value, "U should be a subclass of T");
|
||||||
"U should be a subclass of T");
|
|
||||||
assign_assuming_AddRef(aRhs.forget().template downcast<T>().take());
|
assign_assuming_AddRef(aRhs.forget().template downcast<T>().take());
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
return *this;
|
return *this;
|
||||||
|
|
@ -683,7 +679,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
template <typename U>
|
template <typename U>
|
||||||
nsCOMPtr<T>& operator=(already_AddRefed<U>& aRhs) {
|
nsCOMPtr<T>& operator=(already_AddRefed<U>& aRhs) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value, "U is not a subclass of T");
|
static_assert(std::is_base_of<T, U>::value, "U is not a subclass of T");
|
||||||
assign_assuming_AddRef(static_cast<T*>(aRhs.take()));
|
assign_assuming_AddRef(static_cast<T*>(aRhs.take()));
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
return *this;
|
return *this;
|
||||||
|
|
@ -693,7 +689,7 @@ class MOZ_IS_REFPTR nsCOMPtr final
|
||||||
template <typename U>
|
template <typename U>
|
||||||
nsCOMPtr<T>& operator=(already_AddRefed<U>&& aRhs) {
|
nsCOMPtr<T>& operator=(already_AddRefed<U>&& aRhs) {
|
||||||
// Make sure that U actually inherits from T
|
// Make sure that U actually inherits from T
|
||||||
static_assert(mozilla::IsBaseOf<T, U>::value, "U is not a subclass of T");
|
static_assert(std::is_base_of<T, U>::value, "U is not a subclass of T");
|
||||||
assign_assuming_AddRef(static_cast<T*>(aRhs.take()));
|
assign_assuming_AddRef(static_cast<T*>(aRhs.take()));
|
||||||
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
NSCAP_ASSERT_NO_QUERY_NEEDED();
|
||||||
return *this;
|
return *this;
|
||||||
|
|
@ -1156,7 +1152,7 @@ template <typename U>
|
||||||
void nsCOMPtr<T>::assign_from_qi(const nsQueryInterface<U> aQI,
|
void nsCOMPtr<T>::assign_from_qi(const nsQueryInterface<U> aQI,
|
||||||
const nsIID& aIID) {
|
const nsIID& aIID) {
|
||||||
static_assert(
|
static_assert(
|
||||||
!(mozilla::IsSame<T, U>::value || mozilla::IsBaseOf<T, U>::value),
|
!(mozilla::IsSame<T, U>::value || std::is_base_of<T, U>::value),
|
||||||
"don't use do_QueryInterface for compile-time-determinable casts");
|
"don't use do_QueryInterface for compile-time-determinable casts");
|
||||||
void* newRawPtr;
|
void* newRawPtr;
|
||||||
if (NS_FAILED(aQI(aIID, &newRawPtr))) {
|
if (NS_FAILED(aQI(aIID, &newRawPtr))) {
|
||||||
|
|
@ -1170,7 +1166,7 @@ template <typename U>
|
||||||
void nsCOMPtr<T>::assign_from_qi_with_error(
|
void nsCOMPtr<T>::assign_from_qi_with_error(
|
||||||
const nsQueryInterfaceWithError<U>& aQI, const nsIID& aIID) {
|
const nsQueryInterfaceWithError<U>& aQI, const nsIID& aIID) {
|
||||||
static_assert(
|
static_assert(
|
||||||
!(mozilla::IsSame<T, U>::value || mozilla::IsBaseOf<T, U>::value),
|
!(mozilla::IsSame<T, U>::value || std::is_base_of<T, U>::value),
|
||||||
"don't use do_QueryInterface for compile-time-determinable casts");
|
"don't use do_QueryInterface for compile-time-determinable casts");
|
||||||
void* newRawPtr;
|
void* newRawPtr;
|
||||||
if (NS_FAILED(aQI(aIID, &newRawPtr))) {
|
if (NS_FAILED(aQI(aIID, &newRawPtr))) {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ nsISupports* ToSupports(
|
||||||
|
|
||||||
// The default implementation of this class template is empty, because it
|
// The default implementation of this class template is empty, because it
|
||||||
// should never be used: see the partial specializations below.
|
// should never be used: see the partial specializations below.
|
||||||
template <typename T, bool IsXPCOM = mozilla::IsBaseOf<nsISupports, T>::value>
|
template <typename T, bool IsXPCOM = std::is_base_of<nsISupports, T>::value>
|
||||||
struct CycleCollectionNoteChildImpl {};
|
struct CycleCollectionNoteChildImpl {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant,
|
||||||
|
|
||||||
// The default implementation of this class template is empty, because it
|
// The default implementation of this class template is empty, because it
|
||||||
// should never be used: see the partial specializations below.
|
// should never be used: see the partial specializations below.
|
||||||
template <typename T, bool IsXPCOM = mozilla::IsBaseOf<nsISupports, T>::value>
|
template <typename T, bool IsXPCOM = std::is_base_of<nsISupports, T>::value>
|
||||||
struct DowncastCCParticipantImpl {};
|
struct DowncastCCParticipantImpl {};
|
||||||
|
|
||||||
// Specialization for XPCOM CC participants
|
// Specialization for XPCOM CC participants
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class nsAutoOwningThread {
|
||||||
"Token '" #_type "' is not a class type.")
|
"Token '" #_type "' is not a class type.")
|
||||||
|
|
||||||
# define MOZ_ASSERT_NOT_ISUPPORTS(_type) \
|
# define MOZ_ASSERT_NOT_ISUPPORTS(_type) \
|
||||||
static_assert(!mozilla::IsBaseOf<nsISupports, _type>::value, \
|
static_assert(!std::is_base_of<nsISupports, _type>::value, \
|
||||||
"nsISupports classes don't need to call MOZ_COUNT_CTOR or " \
|
"nsISupports classes don't need to call MOZ_COUNT_CTOR or " \
|
||||||
"MOZ_COUNT_DTOR");
|
"MOZ_COUNT_DTOR");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ inline nsresult CallQueryInterface(T* aSource, DestinationType** aDestination) {
|
||||||
// the canonical nsISupports pointer with CallQueryInterface.
|
// the canonical nsISupports pointer with CallQueryInterface.
|
||||||
static_assert(
|
static_assert(
|
||||||
!(mozilla::IsSame<DestinationType, T>::value ||
|
!(mozilla::IsSame<DestinationType, T>::value ||
|
||||||
mozilla::IsBaseOf<DestinationType, T>::value) ||
|
std::is_base_of<DestinationType, T>::value) ||
|
||||||
mozilla::IsSame<DestinationType, nsISupports>::value,
|
mozilla::IsSame<DestinationType, nsISupports>::value,
|
||||||
"don't use CallQueryInterface for compile-time-determinable casts");
|
"don't use CallQueryInterface for compile-time-determinable casts");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ struct RemoveAlreadyAddRefed<already_AddRefed<T>> {
|
||||||
mozilla::IsSame<already_AddRefed<T>, decltype(_GetterProc())>::value, \
|
mozilla::IsSame<already_AddRefed<T>, decltype(_GetterProc())>::value, \
|
||||||
"Singleton constructor must return already_AddRefed"); \
|
"Singleton constructor must return already_AddRefed"); \
|
||||||
static_assert( \
|
static_assert( \
|
||||||
mozilla::IsBaseOf<_InstanceClass, T>::value, \
|
std::is_base_of<_InstanceClass, T>::value, \
|
||||||
"Singleton constructor must return correct already_AddRefed"); \
|
"Singleton constructor must return correct already_AddRefed"); \
|
||||||
inst = _GetterProc(); \
|
inst = _GetterProc(); \
|
||||||
if (nullptr == inst) { \
|
if (nullptr == inst) { \
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ class ModuleEntry(object):
|
||||||
mozilla::IsSame<already_AddRefed<T>, decltype(%(constructor)s())>::value,
|
mozilla::IsSame<already_AddRefed<T>, decltype(%(constructor)s())>::value,
|
||||||
"Singleton constructor must return already_AddRefed");
|
"Singleton constructor must return already_AddRefed");
|
||||||
static_assert(
|
static_assert(
|
||||||
mozilla::IsBaseOf<%(type)s, T>::value,
|
std::is_base_of<%(type)s, T>::value,
|
||||||
"Singleton constructor must return correct already_AddRefed");
|
"Singleton constructor must return correct already_AddRefed");
|
||||||
|
|
||||||
""" % {'type': self.type, 'constructor': self.constructor}
|
""" % {'type': self.type, 'constructor': self.constructor}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ ThreadEventQueue<InnerQueueT>::ThreadEventQueue(UniquePtr<InnerQueueT> aQueue)
|
||||||
: mBaseQueue(std::move(aQueue)),
|
: mBaseQueue(std::move(aQueue)),
|
||||||
mLock("ThreadEventQueue"),
|
mLock("ThreadEventQueue"),
|
||||||
mEventsAvailable(mLock, "EventsAvail") {
|
mEventsAvailable(mLock, "EventsAvail") {
|
||||||
static_assert(IsBaseOf<AbstractEventQueue, InnerQueueT>::value,
|
static_assert(std::is_base_of<AbstractEventQueue, InnerQueueT>::value,
|
||||||
"InnerQueueT must be an AbstractEventQueue subclass");
|
"InnerQueueT must be an AbstractEventQueue subclass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,10 @@ template <class T>
|
||||||
inline NS_HIDDEN_(void)
|
inline NS_HIDDEN_(void)
|
||||||
NS_ProxyRelease(const char* aName, nsIEventTarget* aTarget,
|
NS_ProxyRelease(const char* aName, nsIEventTarget* aTarget,
|
||||||
already_AddRefed<T> aDoomed, bool aAlwaysProxy = false) {
|
already_AddRefed<T> aDoomed, bool aAlwaysProxy = false) {
|
||||||
::detail::ProxyReleaseChooser<mozilla::IsBaseOf<nsISupports, T>::value>::
|
::detail::ProxyReleaseChooser<
|
||||||
ProxyRelease(aName, aTarget, std::move(aDoomed), aAlwaysProxy);
|
std::is_base_of<nsISupports, T>::value>::ProxyRelease(aName, aTarget,
|
||||||
|
std::move(aDoomed),
|
||||||
|
aAlwaysProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -810,7 +810,7 @@ template <typename PtrType, class C, typename R, bool Owning,
|
||||||
mozilla::RunnableKind Kind, typename... As>
|
mozilla::RunnableKind Kind, typename... As>
|
||||||
struct nsRunnableMethodTraits<PtrType, R (C::*)(As...), Owning, Kind> {
|
struct nsRunnableMethodTraits<PtrType, R (C::*)(As...), Owning, Kind> {
|
||||||
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
@ -822,7 +822,7 @@ template <typename PtrType, class C, typename R, bool Owning,
|
||||||
struct nsRunnableMethodTraits<PtrType, R (C::*)(As...) const, Owning, Kind> {
|
struct nsRunnableMethodTraits<PtrType, R (C::*)(As...) const, Owning, Kind> {
|
||||||
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
||||||
class_type;
|
class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
@ -835,7 +835,7 @@ template <typename PtrType, class C, typename R, bool Owning,
|
||||||
struct nsRunnableMethodTraits<PtrType, R (__stdcall C::*)(As...), Owning,
|
struct nsRunnableMethodTraits<PtrType, R (__stdcall C::*)(As...), Owning,
|
||||||
Kind> {
|
Kind> {
|
||||||
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
@ -846,7 +846,7 @@ template <typename PtrType, class C, typename R, bool Owning,
|
||||||
mozilla::RunnableKind Kind>
|
mozilla::RunnableKind Kind>
|
||||||
struct nsRunnableMethodTraits<PtrType, R (NS_STDCALL C::*)(), Owning, Kind> {
|
struct nsRunnableMethodTraits<PtrType, R (NS_STDCALL C::*)(), Owning, Kind> {
|
||||||
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
typedef typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
@ -859,7 +859,7 @@ struct nsRunnableMethodTraits<PtrType, R (__stdcall C::*)(As...) const, Owning,
|
||||||
Kind> {
|
Kind> {
|
||||||
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
||||||
class_type;
|
class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
@ -872,7 +872,7 @@ struct nsRunnableMethodTraits<PtrType, R (NS_STDCALL C::*)() const, Owning,
|
||||||
Kind> {
|
Kind> {
|
||||||
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
typedef const typename mozilla::RemoveRawOrSmartPointer<PtrType>::Type
|
||||||
class_type;
|
class_type;
|
||||||
static_assert(mozilla::IsBaseOf<C, class_type>::value,
|
static_assert(std::is_base_of<C, class_type>::value,
|
||||||
"Stored class must inherit from method's class");
|
"Stored class must inherit from method's class");
|
||||||
typedef R return_type;
|
typedef R return_type;
|
||||||
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
typedef nsRunnableMethod<C, R, Owning, Kind> base_type;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue