Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM MediaRecorder.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_MediaRecorderBinding_h
4 : #define mozilla_dom_MediaRecorderBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jspubtd.h"
8 : #include "mozilla/ErrorResult.h"
9 : #include "mozilla/dom/BindingDeclarations.h"
10 : #include "mozilla/dom/Nullable.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class MediaRecorder;
16 : struct MediaRecorderAtoms;
17 : struct MediaRecorderOptionsAtoms;
18 : struct NativePropertyHooks;
19 : class ProtoAndIfaceCache;
20 :
21 : } // namespace dom
22 : } // namespace mozilla
23 :
24 : namespace mozilla {
25 : namespace dom {
26 :
27 : enum class RecordingState : uint8_t {
28 : Inactive,
29 : Recording,
30 : Paused,
31 : EndGuard_
32 : };
33 :
34 : namespace RecordingStateValues {
35 : extern const EnumEntry strings[4];
36 : } // namespace RecordingStateValues
37 :
38 : bool
39 : ToJSValue(JSContext* aCx, RecordingState aArgument, JS::MutableHandle<JS::Value> aValue);
40 :
41 :
42 0 : struct MediaRecorderOptions : public DictionaryBase
43 : {
44 : MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mAudioBitsPerSecond;
45 : MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mBitsPerSecond;
46 : MOZ_INIT_OUTSIDE_CTOR nsString mMimeType;
47 : MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mVideoBitsPerSecond;
48 :
49 : MediaRecorderOptions();
50 :
51 0 : explicit inline MediaRecorderOptions(const FastDictionaryInitializer& )
52 0 : {
53 : // Do nothing here; this is used by our "Fast" subclass
54 0 : }
55 :
56 : explicit inline MediaRecorderOptions(const MediaRecorderOptions& aOther)
57 : {
58 : *this = aOther;
59 : }
60 :
61 : bool
62 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
63 :
64 : bool
65 : Init(const nsAString& aJSON);
66 :
67 : bool
68 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
69 :
70 : bool
71 : ToJSON(nsAString& aJSON) const;
72 :
73 : void
74 : TraceDictionary(JSTracer* trc);
75 :
76 : MediaRecorderOptions&
77 : operator=(const MediaRecorderOptions& aOther);
78 :
79 : private:
80 : static bool
81 : InitIds(JSContext* cx, MediaRecorderOptionsAtoms* atomsCache);
82 : };
83 :
84 : namespace binding_detail {
85 0 : struct FastMediaRecorderOptions : public MediaRecorderOptions
86 : {
87 0 : inline FastMediaRecorderOptions()
88 0 : : MediaRecorderOptions(FastDictionaryInitializer())
89 : {
90 : // Doesn't matter what int we pass to the parent constructor
91 0 : }
92 : };
93 : } // namespace binding_detail
94 :
95 :
96 : namespace MediaRecorderBinding {
97 :
98 : typedef mozilla::dom::MediaRecorder NativeType;
99 :
100 : JSObject*
101 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
102 :
103 : const JSClass*
104 : GetJSClass();
105 :
106 : bool
107 : Wrap(JSContext* aCx, mozilla::dom::MediaRecorder* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
108 :
109 : template <class T>
110 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
111 : {
112 0 : JS::Rooted<JSObject*> reflector(aCx);
113 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
114 : }
115 :
116 : // We declare this as an array so that retrieving a pointer to this
117 : // binding's property hooks only requires compile/link-time resolvable
118 : // address arithmetic. Declaring it as a pointer instead would require
119 : // doing a run-time load to fetch a pointer to this binding's property
120 : // hooks. And then structures which embedded a pointer to this structure
121 : // would require a run-time load for proper initialization, which would
122 : // then induce static constructors. Lots of static constructors.
123 : extern const NativePropertyHooks sNativePropertyHooks[];
124 :
125 : void
126 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
127 :
128 : JS::Handle<JSObject*>
129 : GetProtoObjectHandle(JSContext* aCx);
130 :
131 : JS::Handle<JSObject*>
132 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
133 :
134 : JSObject*
135 : GetConstructorObject(JSContext* aCx);
136 :
137 : } // namespace MediaRecorderBinding
138 :
139 :
140 :
141 : } // namespace dom
142 : } // namespace mozilla
143 :
144 : #endif // mozilla_dom_MediaRecorderBinding_h
|