Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM PeerConnectionObserverEnums.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #include "PeerConnectionObserverEnumsBinding.h"
4 : #include "jsapi.h"
5 : #include "mozilla/dom/BindingDeclarations.h"
6 : #include "mozilla/dom/NonRefcountedDOMObject.h"
7 :
8 : namespace mozilla {
9 : namespace dom {
10 :
11 : namespace PCObserverStateTypeValues {
12 : extern const EnumEntry strings[7] = {
13 : {"None", 4},
14 : {"IceConnectionState", 18},
15 : {"IceGatheringState", 17},
16 : {"SdpState", 8},
17 : {"SipccState", 10},
18 : {"SignalingState", 14},
19 : { nullptr, 0 }
20 : };
21 : } // namespace PCObserverStateTypeValues
22 :
23 : bool
24 0 : ToJSValue(JSContext* aCx, PCObserverStateType aArgument, JS::MutableHandle<JS::Value> aValue)
25 : {
26 0 : MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCObserverStateTypeValues::strings));
27 : JSString* resultStr =
28 0 : JS_NewStringCopyN(aCx, PCObserverStateTypeValues::strings[uint32_t(aArgument)].value,
29 0 : PCObserverStateTypeValues::strings[uint32_t(aArgument)].length);
30 0 : if (!resultStr) {
31 0 : return false;
32 : }
33 0 : aValue.setString(resultStr);
34 0 : return true;
35 : }
36 :
37 :
38 : } // namespace dom
39 : } // namespace mozilla
|