Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM PeerConnectionImplEnums.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #include "PeerConnectionImplEnumsBinding.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 PCImplSignalingStateValues {
12 : extern const EnumEntry strings[8] = {
13 : {"SignalingInvalid", 16},
14 : {"SignalingStable", 15},
15 : {"SignalingHaveLocalOffer", 23},
16 : {"SignalingHaveRemoteOffer", 24},
17 : {"SignalingHaveLocalPranswer", 26},
18 : {"SignalingHaveRemotePranswer", 27},
19 : {"SignalingClosed", 15},
20 : { nullptr, 0 }
21 : };
22 : } // namespace PCImplSignalingStateValues
23 :
24 : bool
25 0 : ToJSValue(JSContext* aCx, PCImplSignalingState aArgument, JS::MutableHandle<JS::Value> aValue)
26 : {
27 0 : MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCImplSignalingStateValues::strings));
28 : JSString* resultStr =
29 0 : JS_NewStringCopyN(aCx, PCImplSignalingStateValues::strings[uint32_t(aArgument)].value,
30 0 : PCImplSignalingStateValues::strings[uint32_t(aArgument)].length);
31 0 : if (!resultStr) {
32 0 : return false;
33 : }
34 0 : aValue.setString(resultStr);
35 0 : return true;
36 : }
37 :
38 :
39 : namespace PCImplSipccStateValues {
40 : extern const EnumEntry strings[4] = {
41 : {"Idle", 4},
42 : {"Starting", 8},
43 : {"Started", 7},
44 : { nullptr, 0 }
45 : };
46 : } // namespace PCImplSipccStateValues
47 :
48 : bool
49 0 : ToJSValue(JSContext* aCx, PCImplSipccState aArgument, JS::MutableHandle<JS::Value> aValue)
50 : {
51 0 : MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCImplSipccStateValues::strings));
52 : JSString* resultStr =
53 0 : JS_NewStringCopyN(aCx, PCImplSipccStateValues::strings[uint32_t(aArgument)].value,
54 0 : PCImplSipccStateValues::strings[uint32_t(aArgument)].length);
55 0 : if (!resultStr) {
56 0 : return false;
57 : }
58 0 : aValue.setString(resultStr);
59 0 : return true;
60 : }
61 :
62 :
63 : namespace PCImplIceConnectionStateValues {
64 : extern const EnumEntry strings[8] = {
65 : {"new", 3},
66 : {"checking", 8},
67 : {"connected", 9},
68 : {"completed", 9},
69 : {"failed", 6},
70 : {"disconnected", 12},
71 : {"closed", 6},
72 : { nullptr, 0 }
73 : };
74 : } // namespace PCImplIceConnectionStateValues
75 :
76 : bool
77 0 : ToJSValue(JSContext* aCx, PCImplIceConnectionState aArgument, JS::MutableHandle<JS::Value> aValue)
78 : {
79 0 : MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCImplIceConnectionStateValues::strings));
80 : JSString* resultStr =
81 0 : JS_NewStringCopyN(aCx, PCImplIceConnectionStateValues::strings[uint32_t(aArgument)].value,
82 0 : PCImplIceConnectionStateValues::strings[uint32_t(aArgument)].length);
83 0 : if (!resultStr) {
84 0 : return false;
85 : }
86 0 : aValue.setString(resultStr);
87 0 : return true;
88 : }
89 :
90 :
91 : namespace PCImplIceGatheringStateValues {
92 : extern const EnumEntry strings[4] = {
93 : {"new", 3},
94 : {"gathering", 9},
95 : {"complete", 8},
96 : { nullptr, 0 }
97 : };
98 : } // namespace PCImplIceGatheringStateValues
99 :
100 : bool
101 0 : ToJSValue(JSContext* aCx, PCImplIceGatheringState aArgument, JS::MutableHandle<JS::Value> aValue)
102 : {
103 0 : MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCImplIceGatheringStateValues::strings));
104 : JSString* resultStr =
105 0 : JS_NewStringCopyN(aCx, PCImplIceGatheringStateValues::strings[uint32_t(aArgument)].value,
106 0 : PCImplIceGatheringStateValues::strings[uint32_t(aArgument)].length);
107 0 : if (!resultStr) {
108 0 : return false;
109 : }
110 0 : aValue.setString(resultStr);
111 0 : return true;
112 : }
113 :
114 :
115 : } // namespace dom
116 : } // namespace mozilla
|