Generated file

Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM CollectorLogAnalyzer.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_COLLECTORLOGANALYZERBINDING_H_
#define DOM_COLLECTORLOGANALYZERBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
class CollectorLogAnalyzer;
namespace dom {
struct CollectorLogEdge;
struct CollectorLogEdgeAtoms;
struct CollectorLogNode;
struct CollectorLogNodeAdjacentsAtoms;
struct CollectorLogNodeAtoms;
struct CollectorLogRootPathAtoms;
struct CollectorLogWeakMapPath;
struct CollectorLogWeakMapPathAtoms;
class CollectorNodeFlags;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class CollectorLogRootKind : uint8_t {
None,
Soft,
Hard,
};
namespace binding_detail {
template <> struct EnumStrings<CollectorLogRootKind> {
static constexpr nsLiteralCString Values[3] {
"none"_ns,
"soft"_ns,
"hard"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, CollectorLogRootKind aArgument, JS::MutableHandle<JS::Value> aValue);
struct MOZ_EMPTY_BASES CollectorLogNode : public MaybeEmptyDictionaryBase
{
uint16_t mFlags = {};
uint64_t mIndex = {};
MOZ_INIT_OUTSIDE_CTOR nsCString mLabel;
MOZ_INIT_OUTSIDE_CTOR nsCString mPtr;
int64_t mReferenceCount = {};
CollectorLogNode();
explicit inline CollectorLogNode(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectorLogNode(CollectorLogNode&& aOther) = default;
explicit inline CollectorLogNode(const CollectorLogNode& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectorLogNode&
operator=(const CollectorLogNode& aOther);
private:
static bool
InitIds(JSContext* cx, CollectorLogNodeAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastCollectorLogNode : public CollectorLogNode
{
inline FastCollectorLogNode()
: CollectorLogNode(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct MOZ_EMPTY_BASES CollectorLogEdge : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsCString mLabel;
MOZ_INIT_OUTSIDE_CTOR CollectorLogNode mOther;
CollectorLogEdge();
explicit inline CollectorLogEdge(const FastDictionaryInitializer& )
: mOther(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectorLogEdge(CollectorLogEdge&& aOther) = default;
explicit inline CollectorLogEdge(const CollectorLogEdge& aOther)
: mOther(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectorLogEdge&
operator=(const CollectorLogEdge& aOther);
private:
static bool
InitIds(JSContext* cx, CollectorLogEdgeAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastCollectorLogEdge : public CollectorLogEdge
{
inline FastCollectorLogEdge()
: CollectorLogEdge(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct MOZ_EMPTY_BASES CollectorLogNodeAdjacents : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<CollectorLogEdge> mFromSelf;
MOZ_INIT_OUTSIDE_CTOR Sequence<CollectorLogEdge> mToSelf;
CollectorLogNodeAdjacents();
explicit inline CollectorLogNodeAdjacents(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectorLogNodeAdjacents(CollectorLogNodeAdjacents&& aOther) = default;
explicit inline CollectorLogNodeAdjacents(const CollectorLogNodeAdjacents& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectorLogNodeAdjacents&
operator=(const CollectorLogNodeAdjacents& aOther);
private:
static bool
InitIds(JSContext* cx, CollectorLogNodeAdjacentsAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastCollectorLogNodeAdjacents : public CollectorLogNodeAdjacents
{
inline FastCollectorLogNodeAdjacents()
: CollectorLogNodeAdjacents(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct MOZ_EMPTY_BASES CollectorLogWeakMapPath : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR CollectorLogNode mKey;
MOZ_INIT_OUTSIDE_CTOR Sequence<CollectorLogEdge> mPath;
CollectorLogWeakMapPath();
explicit inline CollectorLogWeakMapPath(const FastDictionaryInitializer& )
: mKey(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectorLogWeakMapPath(CollectorLogWeakMapPath&& aOther) = default;
explicit inline CollectorLogWeakMapPath(const CollectorLogWeakMapPath& aOther)
: mKey(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectorLogWeakMapPath&
operator=(const CollectorLogWeakMapPath& aOther);
private:
static bool
InitIds(JSContext* cx, CollectorLogWeakMapPathAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastCollectorLogWeakMapPath : public CollectorLogWeakMapPath
{
inline FastCollectorLogWeakMapPath()
: CollectorLogWeakMapPath(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct MOZ_EMPTY_BASES CollectorLogRootPath : public DictionaryBase
{
CollectorLogRootKind mKind = {};
MOZ_INIT_OUTSIDE_CTOR Sequence<CollectorLogEdge> mPath;
MOZ_INIT_OUTSIDE_CTOR Sequence<CollectorLogWeakMapPath> mWeakMapPaths;
CollectorLogRootPath();
explicit inline CollectorLogRootPath(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectorLogRootPath(CollectorLogRootPath&& aOther) = default;
explicit inline CollectorLogRootPath(const CollectorLogRootPath& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectorLogRootPath&
operator=(const CollectorLogRootPath& aOther);
private:
static bool
InitIds(JSContext* cx, CollectorLogRootPathAtoms* atomsCache);
};
namespace binding_detail {
struct MOZ_EMPTY_BASES FastCollectorLogRootPath : public CollectorLogRootPath
{
inline FastCollectorLogRootPath()
: CollectorLogRootPath(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace CollectorLogAnalyzer_Binding {
typedef mozilla::CollectorLogAnalyzer NativeType;
constexpr uint32_t MAX_QUERY_RESULTS = 500;
constexpr uint32_t SAMPLE_COUNT = 20;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::CollectorLogAnalyzer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::CollectorLogAnalyzer,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace CollectorLogAnalyzer_Binding
namespace CollectorNodeFlags_Binding {
typedef mozilla::dom::CollectorNodeFlags NativeType;
constexpr uint8_t GARBAGE = 1;
constexpr uint8_t INCREMENTAL_ROOT = 2;
constexpr uint8_t ROOT = 4;
constexpr uint8_t SOFT_ROOT = 8;
constexpr uint8_t CC_MANAGED = 16;
constexpr uint8_t GC_MARKED = 32;
constexpr uint8_t GC_GRAY = 64;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::CollectorNodeFlags,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace CollectorNodeFlags_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::CollectorLogRootKind>
{
static constexpr dom::CollectorLogRootKind value = dom::CollectorLogRootKind::Hard;
static_assert(static_cast<uint8_t>(dom::CollectorLogRootKind::None) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::CollectorLogRootKind>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_COLLECTORLOGANALYZERBINDING_H_