/work/obj-fuzz/dist/include/mozilla/dom/TextDecoderBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM TextDecoder.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_TextDecoderBinding_h |
4 | | #define mozilla_dom_TextDecoderBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | struct NativePropertyHooks; |
18 | | class ProtoAndIfaceCache; |
19 | | struct TextDecodeOptionsAtoms; |
20 | | class TextDecoder; |
21 | | struct TextDecoderAtoms; |
22 | | struct TextDecoderOptionsAtoms; |
23 | | |
24 | | } // namespace dom |
25 | | } // namespace mozilla |
26 | | |
27 | | namespace mozilla { |
28 | | namespace dom { |
29 | | |
30 | | struct TextDecodeOptions : public DictionaryBase |
31 | | { |
32 | | MOZ_INIT_OUTSIDE_CTOR bool mStream; |
33 | | |
34 | | TextDecodeOptions(); |
35 | | |
36 | | explicit inline TextDecodeOptions(const FastDictionaryInitializer& ) |
37 | 0 | { |
38 | 0 | // Do nothing here; this is used by our "Fast" subclass |
39 | 0 | } |
40 | | |
41 | | explicit inline TextDecodeOptions(const TextDecodeOptions& aOther) |
42 | 0 | { |
43 | 0 | *this = aOther; |
44 | 0 | } |
45 | | |
46 | | bool |
47 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
48 | | |
49 | | bool |
50 | | Init(const nsAString& aJSON); |
51 | | |
52 | | bool |
53 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
54 | | |
55 | | bool |
56 | | ToJSON(nsAString& aJSON) const; |
57 | | |
58 | | void |
59 | | TraceDictionary(JSTracer* trc); |
60 | | |
61 | | TextDecodeOptions& |
62 | | operator=(const TextDecodeOptions& aOther); |
63 | | |
64 | | private: |
65 | | static bool |
66 | | InitIds(JSContext* cx, TextDecodeOptionsAtoms* atomsCache); |
67 | | }; |
68 | | |
69 | | namespace binding_detail { |
70 | | struct FastTextDecodeOptions : public TextDecodeOptions |
71 | | { |
72 | | inline FastTextDecodeOptions() |
73 | | : TextDecodeOptions(FastDictionaryInitializer()) |
74 | 0 | { |
75 | 0 | // Doesn't matter what int we pass to the parent constructor |
76 | 0 | } |
77 | | }; |
78 | | } // namespace binding_detail |
79 | | |
80 | | |
81 | | struct TextDecoderOptions : public DictionaryBase |
82 | | { |
83 | | MOZ_INIT_OUTSIDE_CTOR bool mFatal; |
84 | | MOZ_INIT_OUTSIDE_CTOR bool mIgnoreBOM; |
85 | | |
86 | | TextDecoderOptions(); |
87 | | |
88 | | explicit inline TextDecoderOptions(const FastDictionaryInitializer& ) |
89 | 0 | { |
90 | 0 | // Do nothing here; this is used by our "Fast" subclass |
91 | 0 | } |
92 | | |
93 | | explicit inline TextDecoderOptions(const TextDecoderOptions& aOther) |
94 | 0 | { |
95 | 0 | *this = aOther; |
96 | 0 | } |
97 | | |
98 | | bool |
99 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
100 | | |
101 | | bool |
102 | | Init(const nsAString& aJSON); |
103 | | |
104 | | bool |
105 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
106 | | |
107 | | bool |
108 | | ToJSON(nsAString& aJSON) const; |
109 | | |
110 | | void |
111 | | TraceDictionary(JSTracer* trc); |
112 | | |
113 | | TextDecoderOptions& |
114 | | operator=(const TextDecoderOptions& aOther); |
115 | | |
116 | | private: |
117 | | static bool |
118 | | InitIds(JSContext* cx, TextDecoderOptionsAtoms* atomsCache); |
119 | | }; |
120 | | |
121 | | namespace binding_detail { |
122 | | struct FastTextDecoderOptions : public TextDecoderOptions |
123 | | { |
124 | | inline FastTextDecoderOptions() |
125 | | : TextDecoderOptions(FastDictionaryInitializer()) |
126 | 0 | { |
127 | 0 | // Doesn't matter what int we pass to the parent constructor |
128 | 0 | } |
129 | | }; |
130 | | } // namespace binding_detail |
131 | | |
132 | | |
133 | | namespace TextDecoder_Binding { |
134 | | |
135 | | typedef mozilla::dom::TextDecoder NativeType; |
136 | | |
137 | | const JSClass* |
138 | | GetJSClass(); |
139 | | |
140 | | bool |
141 | | Wrap(JSContext* aCx, mozilla::dom::TextDecoder* aObject, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
142 | | |
143 | | // We declare this as an array so that retrieving a pointer to this |
144 | | // binding's property hooks only requires compile/link-time resolvable |
145 | | // address arithmetic. Declaring it as a pointer instead would require |
146 | | // doing a run-time load to fetch a pointer to this binding's property |
147 | | // hooks. And then structures which embedded a pointer to this structure |
148 | | // would require a run-time load for proper initialization, which would |
149 | | // then induce static constructors. Lots of static constructors. |
150 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
151 | | |
152 | | void |
153 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
154 | | |
155 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
156 | 0 | { |
157 | 0 | /* Get the interface prototype object for this class. This will create the |
158 | 0 | object as needed. */ |
159 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::TextDecoder, |
160 | 0 | &CreateInterfaceObjects, |
161 | 0 | /* aDefineOnGlobal = */ true); |
162 | 0 |
|
163 | 0 | } |
164 | | |
165 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
166 | 0 | { |
167 | 0 | /* Get the interface object for this class. This will create the object as |
168 | 0 | needed. */ |
169 | 0 |
|
170 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::TextDecoder, |
171 | 0 | &CreateInterfaceObjects, |
172 | 0 | aDefineOnGlobal); |
173 | 0 | } |
174 | | |
175 | | JSObject* |
176 | | GetConstructorObject(JSContext* aCx); |
177 | | |
178 | | } // namespace TextDecoder_Binding |
179 | | |
180 | | |
181 | | |
182 | | } // namespace dom |
183 | | } // namespace mozilla |
184 | | |
185 | | #endif // mozilla_dom_TextDecoderBinding_h |