Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM RTCConfiguration.webidl BY Codegen.py - DO NOT EDIT */
#include <type_traits>
#include "AtomList.h"
#include "MainThreadUtils.h"
#include "RTCConfigurationBinding.h"
#include "js/Array.h"
#include "js/CallAndConstruct.h"
#include "js/Exception.h"
#include "js/ForOfIterator.h"
#include "js/MapAndSet.h"
#include "js/Object.h"
#include "js/PropertyAndElement.h"
#include "js/PropertyDescriptor.h"
#include "js/experimental/JitInfo.h"
#include "jsapi.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/dom/BindingCallContext.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/SimpleGlobalObject.h"
namespace mozilla {
namespace dom {
namespace binding_detail {}; // Just to make sure it's known as a namespace
using namespace mozilla::dom::binding_detail;
namespace binding_detail {
const nsLiteralCString EnumStrings<RTCIceCredentialType>::Values[1] = {
"password"_ns,
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCIceCredentialType aArgument, JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<RTCIceCredentialType>::Values));
JSString* resultStr =
JS_NewStringCopyN(aCx, binding_detail::EnumStrings<RTCIceCredentialType>::Values[uint32_t(aArgument)].BeginReading(),
binding_detail::EnumStrings<RTCIceCredentialType>::Values[uint32_t(aArgument)].Length());
if (!resultStr) {
return false;
}
aValue.setString(resultStr);
return true;
}
namespace binding_detail {
const nsLiteralCString EnumStrings<RTCIceTransportPolicy>::Values[2] = {
"relay"_ns,
"all"_ns,
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCIceTransportPolicy aArgument, JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<RTCIceTransportPolicy>::Values));
JSString* resultStr =
JS_NewStringCopyN(aCx, binding_detail::EnumStrings<RTCIceTransportPolicy>::Values[uint32_t(aArgument)].BeginReading(),
binding_detail::EnumStrings<RTCIceTransportPolicy>::Values[uint32_t(aArgument)].Length());
if (!resultStr) {
return false;
}
aValue.setString(resultStr);
return true;
}
namespace binding_detail {
const nsLiteralCString EnumStrings<RTCBundlePolicy>::Values[3] = {
"balanced"_ns,
"max-compat"_ns,
"max-bundle"_ns,
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, RTCBundlePolicy aArgument, JS::MutableHandle<JS::Value> aValue)
{
MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<RTCBundlePolicy>::Values));
JSString* resultStr =
JS_NewStringCopyN(aCx, binding_detail::EnumStrings<RTCBundlePolicy>::Values[uint32_t(aArgument)].BeginReading(),
binding_detail::EnumStrings<RTCBundlePolicy>::Values[uint32_t(aArgument)].Length());
if (!resultStr) {
return false;
}
aValue.setString(resultStr);
return true;
}
RTCIceServer::RTCIceServer()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
RTCIceServer::InitIds(JSContext* cx, RTCIceServerAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->username_id.init(cx, "username") ||
!atomsCache->urls_id.init(cx, "urls") ||
!atomsCache->url_id.init(cx, "url") ||
!atomsCache->credentialType_id.init(cx, "credentialType") ||
!atomsCache->credential_id.init(cx, "credential")) {
return false;
}
return true;
}
bool
RTCIceServer::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
RTCIceServerAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<RTCIceServerAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->credential_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mCredential.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mCredential.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->credentialType_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
{
int index;
if (!binding_detail::FindEnumStringIndex<true>(cx, temp.ref(),
binding_detail::EnumStrings<RTCIceCredentialType>::Values,
"RTCIceCredentialType", "'credentialType' member of RTCIceServer",
&index)) {
return false;
}
MOZ_ASSERT(index >= 0);
mCredentialType = static_cast<RTCIceCredentialType>(index);
}
} else {
mCredentialType = RTCIceCredentialType::Password;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->url_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mUrl.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mUrl.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->urls_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mUrls.Construct();
if (!(mUrls.Value()).Init(cx, temp.ref(), "'urls' member of RTCIceServer", passedToJSImpl)) {
return false;
}
mIsAnyMemberPresent = true;
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->username_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mUsername.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mUsername.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
return true;
}
bool
RTCIceServer::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
bool
RTCIceServer::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
{
RTCIceServerAtoms* atomsCache = GetAtomCache<RTCIceServerAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
if (!obj) {
return false;
}
rval.set(JS::ObjectValue(*obj));
if (mCredential.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mCredential.InternalValue();
if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->credential_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
RTCIceCredentialType const & currentValue = mCredentialType;
if (!ToJSValue(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->credentialType_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
if (mUrl.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mUrl.InternalValue();
if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->url_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
if (mUrls.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
OwningStringOrStringSequence const & currentValue = mUrls.InternalValue();
if (!currentValue.ToJSVal(cx, obj, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->urls_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
if (mUsername.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mUsername.InternalValue();
if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->username_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
return true;
}
void
RTCIceServer::TraceDictionary(JSTracer* trc)
{
}
RTCIceServer&
RTCIceServer::operator=(const RTCIceServer& aOther)
{
DictionaryBase::operator=(aOther);
mCredential.Reset();
if (aOther.mCredential.WasPassed()) {
mCredential.Construct(aOther.mCredential.Value());
}
mCredentialType = aOther.mCredentialType;
mUrl.Reset();
if (aOther.mUrl.WasPassed()) {
mUrl.Construct(aOther.mUrl.Value());
}
mUrls.Reset();
if (aOther.mUrls.WasPassed()) {
mUrls.Construct(aOther.mUrls.Value());
}
mUsername.Reset();
if (aOther.mUsername.WasPassed()) {
mUsername.Construct(aOther.mUsername.Value());
}
return *this;
}
RTCConfiguration::RTCConfiguration()
{
// Safe to pass a null context if we pass a null value
Init(nullptr, JS::NullHandleValue);
}
bool
RTCConfiguration::InitIds(JSContext* cx, RTCConfigurationAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->sdpSemantics_id.init(cx, "sdpSemantics") ||
!atomsCache->peerIdentity_id.init(cx, "peerIdentity") ||
!atomsCache->iceTransportPolicy_id.init(cx, "iceTransportPolicy") ||
!atomsCache->iceServers_id.init(cx, "iceServers") ||
!atomsCache->certificates_id.init(cx, "certificates") ||
!atomsCache->bundlePolicy_id.init(cx, "bundlePolicy")) {
return false;
}
return true;
}
bool
RTCConfiguration::Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
// Also evaluate isNullOrUndefined in order to avoid false-positive
// checkers by static analysis tools
MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
RTCConfigurationAtoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<RTCConfigurationAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
}
if (!IsConvertibleToDictionary(val)) {
return cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>(sourceDescription, "dictionary");
}
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->bundlePolicy_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
{
int index;
if (!binding_detail::FindEnumStringIndex<true>(cx, temp.ref(),
binding_detail::EnumStrings<RTCBundlePolicy>::Values,
"RTCBundlePolicy", "'bundlePolicy' member of RTCConfiguration",
&index)) {
return false;
}
MOZ_ASSERT(index >= 0);
mBundlePolicy = static_cast<RTCBundlePolicy>(index);
}
} else {
mBundlePolicy = RTCBundlePolicy::Balanced;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->certificates_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (temp.ref().isObject()) {
JS::ForOfIterator iter(cx);
if (!iter.init(temp.ref(), JS::ForOfIterator::AllowNonIterable)) {
return false;
}
if (!iter.valueIsIterable()) {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'certificates' member of RTCConfiguration", "sequence");
return false;
}
Sequence<OwningNonNull<mozilla::dom::RTCCertificate>> &arr = mCertificates;
JS::Rooted<JS::Value> temp(cx);
while (true) {
bool done;
if (!iter.next(&temp, &done)) {
return false;
}
if (done) {
break;
}
OwningNonNull<mozilla::dom::RTCCertificate>* slotPtr = arr.AppendElement(mozilla::fallible);
if (!slotPtr) {
JS_ReportOutOfMemory(cx);
return false;
}
OwningNonNull<mozilla::dom::RTCCertificate>& slot = *slotPtr;
if (temp.isObject()) {
static_assert(IsRefcounted<mozilla::dom::RTCCertificate>::value, "We can only store refcounted classes.");
{
// Our JSContext should be in the right global to do unwrapping in.
nsresult rv = UnwrapObject<prototypes::id::RTCCertificate, mozilla::dom::RTCCertificate>(&temp, slot, cx);
if (NS_FAILED(rv)) {
cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of 'certificates' member of RTCConfiguration", "RTCCertificate");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of 'certificates' member of RTCConfiguration");
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'certificates' member of RTCConfiguration", "sequence");
return false;
}
} else {
/* mCertificates array is already empty; nothing to do */
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->iceServers_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (temp.ref().isObject()) {
JS::ForOfIterator iter(cx);
if (!iter.init(temp.ref(), JS::ForOfIterator::AllowNonIterable)) {
return false;
}
if (!iter.valueIsIterable()) {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'iceServers' member of RTCConfiguration", "sequence");
return false;
}
Sequence<RTCIceServer> &arr = mIceServers;
JS::Rooted<JS::Value> temp(cx);
while (true) {
bool done;
if (!iter.next(&temp, &done)) {
return false;
}
if (done) {
break;
}
RTCIceServer* slotPtr = arr.AppendElement(mozilla::fallible);
if (!slotPtr) {
JS_ReportOutOfMemory(cx);
return false;
}
RTCIceServer& slot = *slotPtr;
if (!slot.Init(cx, temp, "Element of 'iceServers' member of RTCConfiguration", passedToJSImpl)) {
return false;
}
}
} else {
cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("'iceServers' member of RTCConfiguration", "sequence");
return false;
}
} else {
/* mIceServers array is already empty; nothing to do */
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->iceTransportPolicy_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
{
int index;
if (!binding_detail::FindEnumStringIndex<true>(cx, temp.ref(),
binding_detail::EnumStrings<RTCIceTransportPolicy>::Values,
"RTCIceTransportPolicy", "'iceTransportPolicy' member of RTCConfiguration",
&index)) {
return false;
}
MOZ_ASSERT(index >= 0);
mIceTransportPolicy = static_cast<RTCIceTransportPolicy>(index);
}
} else {
mIceTransportPolicy = RTCIceTransportPolicy::All;
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->peerIdentity_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
if (!ConvertJSValueToString(cx, temp.ref(), eNull, eNull, mPeerIdentity)) {
return false;
}
} else {
mPeerIdentity.SetIsVoid(true);
}
mIsAnyMemberPresent = true;
if (!isNull) {
if (!JS_GetPropertyById(cx, *object, atomsCache->sdpSemantics_id, temp.ptr())) {
return false;
}
}
if (!isNull && !temp->isUndefined()) {
mSdpSemantics.Construct();
if (!ConvertJSValueToString(cx, temp.ref(), eStringify, eStringify, (mSdpSemantics.Value()))) {
return false;
}
mIsAnyMemberPresent = true;
}
return true;
}
bool
RTCConfiguration::Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription, bool passedToJSImpl)
{
// We don't want to use sourceDescription for our context here;
// that's not really what it's formatted for.
BindingCallContext cx(cx_, nullptr);
return Init(cx, val, sourceDescription, passedToJSImpl);
}
bool
RTCConfiguration::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
{
RTCConfigurationAtoms* atomsCache = GetAtomCache<RTCConfigurationAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
if (!obj) {
return false;
}
rval.set(JS::ObjectValue(*obj));
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
RTCBundlePolicy const & currentValue = mBundlePolicy;
if (!ToJSValue(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->bundlePolicy_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
Sequence<OwningNonNull<mozilla::dom::RTCCertificate>> const & currentValue = mCertificates;
uint32_t length = currentValue.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!GetOrCreateDOMReflector(cx, currentValue[sequenceIdx0], &tmp)) {
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
temp.setObject(*returnArray);
if (!JS_DefinePropertyById(cx, obj, atomsCache->certificates_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
Sequence<RTCIceServer> const & currentValue = mIceServers;
uint32_t length = currentValue.Length();
JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
if (!returnArray) {
return false;
}
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
if (!currentValue[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
return false;
}
break;
} while (false);
if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
JSPROP_ENUMERATE)) {
return false;
}
}
}
temp.setObject(*returnArray);
if (!JS_DefinePropertyById(cx, obj, atomsCache->iceServers_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
RTCIceTransportPolicy const & currentValue = mIceTransportPolicy;
if (!ToJSValue(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->iceTransportPolicy_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mPeerIdentity;
if (!xpc::StringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->peerIdentity_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
if (mSdpSemantics.WasPassed()) {
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mSdpSemantics.InternalValue();
if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->sdpSemantics_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
}
return true;
}
void
RTCConfiguration::TraceDictionary(JSTracer* trc)
{
}
RTCConfiguration&
RTCConfiguration::operator=(const RTCConfiguration& aOther)
{
DictionaryBase::operator=(aOther);
mBundlePolicy = aOther.mBundlePolicy;
mCertificates = aOther.mCertificates;
mIceServers = aOther.mIceServers;
mIceTransportPolicy = aOther.mIceTransportPolicy;
mPeerIdentity = aOther.mPeerIdentity;
mSdpSemantics.Reset();
if (aOther.mSdpSemantics.WasPassed()) {
mSdpSemantics.Construct(aOther.mSdpSemantics.Value());
}
return *this;
}
} // namespace dom
} // namespace mozilla