Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM GleanMetrics.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_GLEANMETRICSBINDING_H_
#define DOM_GLEANMETRICSBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/Record.h"
namespace mozilla {
namespace dom {
struct GleanDistributionDataAtoms;
struct GleanEventRecordAtoms;
struct GleanRateDataAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
namespace glean {
class GleanBoolean;
class GleanCounter;
class GleanCustomDistribution;
class GleanDatetime;
class GleanDenominator;
class GleanEvent;
class GleanMemoryDistribution;
class GleanMetric;
class GleanNumerator;
class GleanObject;
class GleanQuantity;
class GleanRate;
class GleanString;
class GleanStringList;
class GleanText;
class GleanTimespan;
class GleanTimingDistribution;
class GleanUrl;
class GleanUuid;
} // namespace glean
} // namespace mozilla
namespace mozilla::dom {
struct GleanDistributionData : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR uint64_t mCount;
MOZ_INIT_OUTSIDE_CTOR uint64_t mSum;
MOZ_INIT_OUTSIDE_CTOR Record<nsCString, uint64_t> mValues;
GleanDistributionData();
explicit inline GleanDistributionData(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
GleanDistributionData(GleanDistributionData&& aOther) = default;
private:
GleanDistributionData(const GleanDistributionData&) = delete;
GleanDistributionData& operator=(const GleanDistributionData&) = delete;
static bool
InitIds(JSContext* cx, GleanDistributionDataAtoms* atomsCache);
public:
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
};
namespace binding_detail {
struct FastGleanDistributionData : public GleanDistributionData
{
inline FastGleanDistributionData()
: GleanDistributionData(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct GleanEventRecord : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsCString mCategory;
MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsCString, nsCString>> mExtra;
MOZ_INIT_OUTSIDE_CTOR nsCString mName;
MOZ_INIT_OUTSIDE_CTOR uint64_t mTimestamp;
GleanEventRecord();
explicit inline GleanEventRecord(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
GleanEventRecord(GleanEventRecord&& aOther) = default;
private:
GleanEventRecord(const GleanEventRecord&) = delete;
GleanEventRecord& operator=(const GleanEventRecord&) = delete;
static bool
InitIds(JSContext* cx, GleanEventRecordAtoms* atomsCache);
public:
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
};
namespace binding_detail {
struct FastGleanEventRecord : public GleanEventRecord
{
inline FastGleanEventRecord()
: GleanEventRecord(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct GleanRateData : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR int32_t mDenominator;
MOZ_INIT_OUTSIDE_CTOR int32_t mNumerator;
GleanRateData();
explicit inline GleanRateData(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
GleanRateData(GleanRateData&& aOther) = default;
explicit inline GleanRateData(const GleanRateData& 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);
GleanRateData&
operator=(const GleanRateData& aOther);
bool
operator==(const GleanRateData& aOther) const;
private:
static bool
InitIds(JSContext* cx, GleanRateDataAtoms* atomsCache);
};
namespace binding_detail {
struct FastGleanRateData : public GleanRateData
{
inline FastGleanRateData()
: GleanRateData(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace GleanBoolean_Binding {
typedef mozilla::glean::GleanBoolean NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanBoolean* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanBoolean,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanBoolean,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanBoolean_Binding
namespace GleanCounter_Binding {
typedef mozilla::glean::GleanCounter NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanCounter* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanCounter,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanCounter,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanCounter_Binding
namespace GleanCustomDistribution_Binding {
typedef mozilla::glean::GleanCustomDistribution NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanCustomDistribution* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanCustomDistribution,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanCustomDistribution,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanCustomDistribution_Binding
namespace GleanDatetime_Binding {
typedef mozilla::glean::GleanDatetime NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanDatetime* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanDatetime,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanDatetime,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanDatetime_Binding
namespace GleanDenominator_Binding {
typedef mozilla::glean::GleanDenominator NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanDenominator* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanDenominator,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanDenominator,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanDenominator_Binding
namespace GleanEvent_Binding {
typedef mozilla::glean::GleanEvent NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanEvent* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanEvent,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanEvent,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanEvent_Binding
namespace GleanMemoryDistribution_Binding {
typedef mozilla::glean::GleanMemoryDistribution NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanMemoryDistribution* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanMemoryDistribution,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanMemoryDistribution,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanMemoryDistribution_Binding
namespace GleanMetric_Binding {
typedef mozilla::glean::GleanMetric NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanMetric,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
JSObject*
GetProtoObject(JSContext* aCx);
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanMetric,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanMetric_Binding
namespace GleanNumerator_Binding {
typedef mozilla::glean::GleanNumerator NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanNumerator* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanNumerator,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanNumerator,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanNumerator_Binding
namespace GleanObject_Binding {
typedef mozilla::glean::GleanObject NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanObject* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanObject,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanObject,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanObject_Binding
namespace GleanQuantity_Binding {
typedef mozilla::glean::GleanQuantity NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanQuantity* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanQuantity,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanQuantity,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanQuantity_Binding
namespace GleanRate_Binding {
typedef mozilla::glean::GleanRate NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanRate* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanRate,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanRate,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanRate_Binding
namespace GleanString_Binding {
typedef mozilla::glean::GleanString NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanString* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanString,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanString,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanString_Binding
namespace GleanStringList_Binding {
typedef mozilla::glean::GleanStringList NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanStringList* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanStringList,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanStringList,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanStringList_Binding
namespace GleanText_Binding {
typedef mozilla::glean::GleanText NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanText* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanText,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanText,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanText_Binding
namespace GleanTimespan_Binding {
typedef mozilla::glean::GleanTimespan NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanTimespan* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanTimespan,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanTimespan,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanTimespan_Binding
namespace GleanTimingDistribution_Binding {
typedef mozilla::glean::GleanTimingDistribution NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanTimingDistribution* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanTimingDistribution,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanTimingDistribution,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanTimingDistribution_Binding
namespace GleanUrl_Binding {
typedef mozilla::glean::GleanUrl NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanUrl* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanUrl,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanUrl,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanUrl_Binding
namespace GleanUuid_Binding {
typedef mozilla::glean::GleanUuid NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::glean::GleanUuid* 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::GleanUuid,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::GleanUuid,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace GleanUuid_Binding
} // namespace mozilla::dom
#endif // DOM_GLEANMETRICSBINDING_H_