Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM RTCRtpSources.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_RTCRTPSOURCESBINDING_H_
#define DOM_RTCRTPSOURCESBINDING_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"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct RTCRtpContributingSourceAtoms;
struct RTCRtpSourceEntryAtoms;
struct RTCRtpSynchronizationSourceAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class RTCRtpSourceEntryType : uint8_t {
Contributing,
Synchronization,
};
namespace binding_detail {
template <> struct EnumStrings<RTCRtpSourceEntryType> {
static const nsLiteralCString Values[2];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCRtpSourceEntryType aArgument, JS::MutableHandle<JS::Value> aValue);
struct RTCRtpContributingSource : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<double> mAudioLevel;
MOZ_INIT_OUTSIDE_CTOR uint32_t mRtpTimestamp;
MOZ_INIT_OUTSIDE_CTOR uint32_t mSource;
MOZ_INIT_OUTSIDE_CTOR double mTimestamp;
RTCRtpContributingSource();
explicit inline RTCRtpContributingSource(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpContributingSource(RTCRtpContributingSource&& aOther) = default;
explicit inline RTCRtpContributingSource(const RTCRtpContributingSource& 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);
RTCRtpContributingSource&
operator=(const RTCRtpContributingSource& aOther);
bool
operator==(const RTCRtpContributingSource& aOther) const;
private:
static bool
InitIds(JSContext* cx, RTCRtpContributingSourceAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpContributingSource : public RTCRtpContributingSource
{
inline FastRTCRtpContributingSource()
: RTCRtpContributingSource(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpSynchronizationSource : public RTCRtpContributingSource
{
MOZ_INIT_OUTSIDE_CTOR Optional<Nullable<bool>> mVoiceActivityFlag;
RTCRtpSynchronizationSource();
explicit inline RTCRtpSynchronizationSource(const FastDictionaryInitializer& )
: RTCRtpContributingSource(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpSynchronizationSource(RTCRtpSynchronizationSource&& aOther) = default;
explicit inline RTCRtpSynchronizationSource(const RTCRtpSynchronizationSource& aOther)
: RTCRtpContributingSource(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);
RTCRtpSynchronizationSource&
operator=(const RTCRtpSynchronizationSource& aOther);
bool
operator==(const RTCRtpSynchronizationSource& aOther) const;
private:
static bool
InitIds(JSContext* cx, RTCRtpSynchronizationSourceAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpSynchronizationSource : public RTCRtpSynchronizationSource
{
inline FastRTCRtpSynchronizationSource()
: RTCRtpSynchronizationSource(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCRtpSourceEntry : public RTCRtpSynchronizationSource
{
MOZ_INIT_OUTSIDE_CTOR RTCRtpSourceEntryType mSourceType;
RTCRtpSourceEntry();
explicit inline RTCRtpSourceEntry(const FastDictionaryInitializer& )
: RTCRtpSynchronizationSource(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCRtpSourceEntry(RTCRtpSourceEntry&& aOther) = default;
explicit inline RTCRtpSourceEntry(const RTCRtpSourceEntry& aOther)
: RTCRtpSynchronizationSource(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
RTCRtpSourceEntry&
operator=(const RTCRtpSourceEntry& aOther);
private:
static bool
InitIds(JSContext* cx, RTCRtpSourceEntryAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCRtpSourceEntry : public RTCRtpSourceEntry
{
inline FastRTCRtpSourceEntry()
: RTCRtpSourceEntry(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::RTCRtpSourceEntryType>
{
static constexpr dom::RTCRtpSourceEntryType value = dom::RTCRtpSourceEntryType::Synchronization;
static_assert(static_cast<uint8_t>(dom::RTCRtpSourceEntryType::Contributing) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::RTCRtpSourceEntryType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_RTCRTPSOURCESBINDING_H_