/work/obj-fuzz/ipc/ipdl/PPluginScriptableObject.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/plugins/PPluginInstanceParent.h" |
8 | | #include "mozilla/plugins/PPluginInstanceChild.h" |
9 | | #include "mozilla/plugins/PPluginScriptableObject.h" |
10 | | |
11 | | namespace mozilla { |
12 | | namespace plugins { |
13 | | namespace PPluginScriptableObject { |
14 | | |
15 | | nsresult |
16 | | CreateEndpoints( |
17 | | base::ProcessId aParentDestPid, |
18 | | base::ProcessId aChildDestPid, |
19 | | mozilla::ipc::Endpoint<mozilla::plugins::PPluginScriptableObjectParent>* aParent, |
20 | | mozilla::ipc::Endpoint<mozilla::plugins::PPluginScriptableObjectChild>* aChild) |
21 | 0 | { |
22 | 0 | return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild); |
23 | 0 | } |
24 | | IPC::Message* |
25 | | Msg___delete__(int32_t routingId) |
26 | 0 | { |
27 | 0 | return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
28 | 0 | } |
29 | | IPC::Message* |
30 | | Reply___delete__(int32_t routingId) |
31 | 0 | { |
32 | 0 | return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
33 | 0 | } |
34 | | IPC::Message* |
35 | | Msg_NPN_Evaluate(int32_t routingId) |
36 | 0 | { |
37 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_NPN_Evaluate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
38 | 0 | } |
39 | | IPC::Message* |
40 | | Reply_NPN_Evaluate(int32_t routingId) |
41 | 0 | { |
42 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_NPN_Evaluate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
43 | 0 | } |
44 | | IPC::Message* |
45 | | Msg_Invalidate(int32_t routingId) |
46 | 0 | { |
47 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Invalidate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
48 | 0 | } |
49 | | IPC::Message* |
50 | | Reply_Invalidate(int32_t routingId) |
51 | 0 | { |
52 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_Invalidate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
53 | 0 | } |
54 | | IPC::Message* |
55 | | Msg_HasMethod(int32_t routingId) |
56 | 0 | { |
57 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_HasMethod__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
58 | 0 | } |
59 | | IPC::Message* |
60 | | Reply_HasMethod(int32_t routingId) |
61 | 0 | { |
62 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_HasMethod__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
63 | 0 | } |
64 | | IPC::Message* |
65 | | Msg_Invoke(int32_t routingId) |
66 | 0 | { |
67 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Invoke__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
68 | 0 | } |
69 | | IPC::Message* |
70 | | Reply_Invoke(int32_t routingId) |
71 | 0 | { |
72 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_Invoke__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
73 | 0 | } |
74 | | IPC::Message* |
75 | | Msg_InvokeDefault(int32_t routingId) |
76 | 0 | { |
77 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_InvokeDefault__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
78 | 0 | } |
79 | | IPC::Message* |
80 | | Reply_InvokeDefault(int32_t routingId) |
81 | 0 | { |
82 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_InvokeDefault__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
83 | 0 | } |
84 | | IPC::Message* |
85 | | Msg_HasProperty(int32_t routingId) |
86 | 0 | { |
87 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_HasProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
88 | 0 | } |
89 | | IPC::Message* |
90 | | Reply_HasProperty(int32_t routingId) |
91 | 0 | { |
92 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_HasProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
93 | 0 | } |
94 | | IPC::Message* |
95 | | Msg_SetProperty(int32_t routingId) |
96 | 0 | { |
97 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_SetProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
98 | 0 | } |
99 | | IPC::Message* |
100 | | Reply_SetProperty(int32_t routingId) |
101 | 0 | { |
102 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_SetProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
103 | 0 | } |
104 | | IPC::Message* |
105 | | Msg_RemoveProperty(int32_t routingId) |
106 | 0 | { |
107 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_RemoveProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
108 | 0 | } |
109 | | IPC::Message* |
110 | | Reply_RemoveProperty(int32_t routingId) |
111 | 0 | { |
112 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_RemoveProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
113 | 0 | } |
114 | | IPC::Message* |
115 | | Msg_Enumerate(int32_t routingId) |
116 | 0 | { |
117 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Enumerate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
118 | 0 | } |
119 | | IPC::Message* |
120 | | Reply_Enumerate(int32_t routingId) |
121 | 0 | { |
122 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_Enumerate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
123 | 0 | } |
124 | | IPC::Message* |
125 | | Msg_Construct(int32_t routingId) |
126 | 0 | { |
127 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Construct__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
128 | 0 | } |
129 | | IPC::Message* |
130 | | Reply_Construct(int32_t routingId) |
131 | 0 | { |
132 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_Construct__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
133 | 0 | } |
134 | | IPC::Message* |
135 | | Msg_Protect(int32_t routingId) |
136 | 0 | { |
137 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Protect__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
138 | 0 | } |
139 | | IPC::Message* |
140 | | Msg_Unprotect(int32_t routingId) |
141 | 0 | { |
142 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Unprotect__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
143 | 0 | } |
144 | | IPC::Message* |
145 | | Msg_GetParentProperty(int32_t routingId) |
146 | 0 | { |
147 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_GetParentProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
148 | 0 | } |
149 | | IPC::Message* |
150 | | Reply_GetParentProperty(int32_t routingId) |
151 | 0 | { |
152 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_GetParentProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
153 | 0 | } |
154 | | IPC::Message* |
155 | | Msg_GetChildProperty(int32_t routingId) |
156 | 0 | { |
157 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_GetChildProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::NOT_REPLY)); |
158 | 0 | } |
159 | | IPC::Message* |
160 | | Reply_GetChildProperty(int32_t routingId) |
161 | 0 | { |
162 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_GetChildProperty__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::INTERRUPT, IPC::Message::REPLY)); |
163 | 0 | } |
164 | | |
165 | | } // namespace PPluginScriptableObject |
166 | | } // namespace plugins |
167 | | } // namespace mozilla |
168 | | |
169 | | //----------------------------------------------------------------------------- |
170 | | // Method definitions for the IPDL type |union Variant| |
171 | | // |
172 | | namespace mozilla { |
173 | | namespace plugins { |
174 | | auto Variant::MaybeDestroy(Type aNewType) -> bool |
175 | 0 | { |
176 | 0 | if ((mType) == (T__None)) { |
177 | 0 | return true; |
178 | 0 | } |
179 | 0 | if ((mType) == (aNewType)) { |
180 | 0 | return false; |
181 | 0 | } |
182 | 0 | switch (mType) { |
183 | 0 | case Tvoid_t: |
184 | 0 | { |
185 | 0 | (ptr_void_t())->~void_t__tdef(); |
186 | 0 | break; |
187 | 0 | } |
188 | 0 | case Tnull_t: |
189 | 0 | { |
190 | 0 | (ptr_null_t())->~null_t__tdef(); |
191 | 0 | break; |
192 | 0 | } |
193 | 0 | case Tbool: |
194 | 0 | { |
195 | 0 | (ptr_bool())->~bool__tdef(); |
196 | 0 | break; |
197 | 0 | } |
198 | 0 | case Tint: |
199 | 0 | { |
200 | 0 | (ptr_int())->~int__tdef(); |
201 | 0 | break; |
202 | 0 | } |
203 | 0 | case Tdouble: |
204 | 0 | { |
205 | 0 | (ptr_double())->~double__tdef(); |
206 | 0 | break; |
207 | 0 | } |
208 | 0 | case TnsCString: |
209 | 0 | { |
210 | 0 | (ptr_nsCString())->~nsCString__tdef(); |
211 | 0 | break; |
212 | 0 | } |
213 | 0 | case TPPluginScriptableObjectParent: |
214 | 0 | { |
215 | 0 | (ptr_PPluginScriptableObjectParent())->~PPluginScriptableObjectParent__tdef(); |
216 | 0 | break; |
217 | 0 | } |
218 | 0 | case TPPluginScriptableObjectChild: |
219 | 0 | { |
220 | 0 | (ptr_PPluginScriptableObjectChild())->~PPluginScriptableObjectChild__tdef(); |
221 | 0 | break; |
222 | 0 | } |
223 | 0 | default: |
224 | 0 | { |
225 | 0 | mozilla::ipc::LogicError("not reached"); |
226 | 0 | break; |
227 | 0 | } |
228 | 0 | } |
229 | 0 | return true; |
230 | 0 | } |
231 | | |
232 | | MOZ_IMPLICIT Variant::Variant(const void_t& aOther) |
233 | 0 | { |
234 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther); |
235 | 0 | mType = Tvoid_t; |
236 | 0 | } |
237 | | |
238 | | MOZ_IMPLICIT Variant::Variant(void_t&& aOther) |
239 | 0 | { |
240 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther)); |
241 | 0 | mType = Tvoid_t; |
242 | 0 | } |
243 | | |
244 | | MOZ_IMPLICIT Variant::Variant(const null_t& aOther) |
245 | 0 | { |
246 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(aOther); |
247 | 0 | mType = Tnull_t; |
248 | 0 | } |
249 | | |
250 | | MOZ_IMPLICIT Variant::Variant(null_t&& aOther) |
251 | 0 | { |
252 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move(aOther)); |
253 | 0 | mType = Tnull_t; |
254 | 0 | } |
255 | | |
256 | | MOZ_IMPLICIT Variant::Variant(const bool& aOther) |
257 | 0 | { |
258 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool(aOther); |
259 | 0 | mType = Tbool; |
260 | 0 | } |
261 | | |
262 | | MOZ_IMPLICIT Variant::Variant(bool&& aOther) |
263 | 0 | { |
264 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool(std::move(aOther)); |
265 | 0 | mType = Tbool; |
266 | 0 | } |
267 | | |
268 | | MOZ_IMPLICIT Variant::Variant(const int& aOther) |
269 | 0 | { |
270 | 0 | new (mozilla::KnownNotNull, ptr_int()) int(aOther); |
271 | 0 | mType = Tint; |
272 | 0 | } |
273 | | |
274 | | MOZ_IMPLICIT Variant::Variant(int&& aOther) |
275 | 0 | { |
276 | 0 | new (mozilla::KnownNotNull, ptr_int()) int(std::move(aOther)); |
277 | 0 | mType = Tint; |
278 | 0 | } |
279 | | |
280 | | MOZ_IMPLICIT Variant::Variant(const double& aOther) |
281 | 0 | { |
282 | 0 | new (mozilla::KnownNotNull, ptr_double()) double(aOther); |
283 | 0 | mType = Tdouble; |
284 | 0 | } |
285 | | |
286 | | MOZ_IMPLICIT Variant::Variant(double&& aOther) |
287 | 0 | { |
288 | 0 | new (mozilla::KnownNotNull, ptr_double()) double(std::move(aOther)); |
289 | 0 | mType = Tdouble; |
290 | 0 | } |
291 | | |
292 | | MOZ_IMPLICIT Variant::Variant(const nsCString& aOther) |
293 | 0 | { |
294 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(aOther); |
295 | 0 | mType = TnsCString; |
296 | 0 | } |
297 | | |
298 | | MOZ_IMPLICIT Variant::Variant(nsCString&& aOther) |
299 | 0 | { |
300 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move(aOther)); |
301 | 0 | mType = TnsCString; |
302 | 0 | } |
303 | | |
304 | | MOZ_IMPLICIT Variant::Variant(PPluginScriptableObjectParent* aOther) |
305 | 0 | { |
306 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*(const_cast<PPluginScriptableObjectParent*>(aOther)); |
307 | 0 | mType = TPPluginScriptableObjectParent; |
308 | 0 | } |
309 | | |
310 | | MOZ_IMPLICIT Variant::Variant(PPluginScriptableObjectChild* aOther) |
311 | 0 | { |
312 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*(const_cast<PPluginScriptableObjectChild*>(aOther)); |
313 | 0 | mType = TPPluginScriptableObjectChild; |
314 | 0 | } |
315 | | |
316 | | MOZ_IMPLICIT Variant::Variant(const Variant& aOther) |
317 | 0 | { |
318 | 0 | (aOther).AssertSanity(); |
319 | 0 | switch ((aOther).type()) { |
320 | 0 | case Tvoid_t: |
321 | 0 | { |
322 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t()); |
323 | 0 | break; |
324 | 0 | } |
325 | 0 | case Tnull_t: |
326 | 0 | { |
327 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t((aOther).get_null_t()); |
328 | 0 | break; |
329 | 0 | } |
330 | 0 | case Tbool: |
331 | 0 | { |
332 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool((aOther).get_bool()); |
333 | 0 | break; |
334 | 0 | } |
335 | 0 | case Tint: |
336 | 0 | { |
337 | 0 | new (mozilla::KnownNotNull, ptr_int()) int((aOther).get_int()); |
338 | 0 | break; |
339 | 0 | } |
340 | 0 | case Tdouble: |
341 | 0 | { |
342 | 0 | new (mozilla::KnownNotNull, ptr_double()) double((aOther).get_double()); |
343 | 0 | break; |
344 | 0 | } |
345 | 0 | case TnsCString: |
346 | 0 | { |
347 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString()); |
348 | 0 | break; |
349 | 0 | } |
350 | 0 | case TPPluginScriptableObjectParent: |
351 | 0 | { |
352 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*(const_cast<PPluginScriptableObjectParent*>((aOther).get_PPluginScriptableObjectParent())); |
353 | 0 | break; |
354 | 0 | } |
355 | 0 | case TPPluginScriptableObjectChild: |
356 | 0 | { |
357 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*(const_cast<PPluginScriptableObjectChild*>((aOther).get_PPluginScriptableObjectChild())); |
358 | 0 | break; |
359 | 0 | } |
360 | 0 | case T__None: |
361 | 0 | { |
362 | 0 | break; |
363 | 0 | } |
364 | 0 | default: |
365 | 0 | { |
366 | 0 | mozilla::ipc::LogicError("unreached"); |
367 | 0 | return; |
368 | 0 | } |
369 | 0 | } |
370 | 0 | mType = (aOther).type(); |
371 | 0 | } |
372 | | |
373 | | MOZ_IMPLICIT Variant::Variant(Variant&& aOther) |
374 | 0 | { |
375 | 0 | (aOther).AssertSanity(); |
376 | 0 | Type t = (aOther).type(); |
377 | 0 | switch (t) { |
378 | 0 | case Tvoid_t: |
379 | 0 | { |
380 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t())); |
381 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
382 | 0 | break; |
383 | 0 | } |
384 | 0 | case Tnull_t: |
385 | 0 | { |
386 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move((aOther).get_null_t())); |
387 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
388 | 0 | break; |
389 | 0 | } |
390 | 0 | case Tbool: |
391 | 0 | { |
392 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool(std::move((aOther).get_bool())); |
393 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
394 | 0 | break; |
395 | 0 | } |
396 | 0 | case Tint: |
397 | 0 | { |
398 | 0 | new (mozilla::KnownNotNull, ptr_int()) int(std::move((aOther).get_int())); |
399 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
400 | 0 | break; |
401 | 0 | } |
402 | 0 | case Tdouble: |
403 | 0 | { |
404 | 0 | new (mozilla::KnownNotNull, ptr_double()) double(std::move((aOther).get_double())); |
405 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
406 | 0 | break; |
407 | 0 | } |
408 | 0 | case TnsCString: |
409 | 0 | { |
410 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move((aOther).get_nsCString())); |
411 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
412 | 0 | break; |
413 | 0 | } |
414 | 0 | case TPPluginScriptableObjectParent: |
415 | 0 | { |
416 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*(const_cast<PPluginScriptableObjectParent*>(std::move((aOther).get_PPluginScriptableObjectParent()))); |
417 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
418 | 0 | break; |
419 | 0 | } |
420 | 0 | case TPPluginScriptableObjectChild: |
421 | 0 | { |
422 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*(const_cast<PPluginScriptableObjectChild*>(std::move((aOther).get_PPluginScriptableObjectChild()))); |
423 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
424 | 0 | break; |
425 | 0 | } |
426 | 0 | case T__None: |
427 | 0 | { |
428 | 0 | break; |
429 | 0 | } |
430 | 0 | default: |
431 | 0 | { |
432 | 0 | mozilla::ipc::LogicError("unreached"); |
433 | 0 | return; |
434 | 0 | } |
435 | 0 | } |
436 | 0 | (aOther).mType = T__None; |
437 | 0 | mType = t; |
438 | 0 | } |
439 | | |
440 | | Variant::~Variant() |
441 | 0 | { |
442 | 0 | static_cast<void>(MaybeDestroy(T__None)); |
443 | 0 | } |
444 | | |
445 | | auto Variant::operator=(const void_t& aRhs) -> Variant& |
446 | 0 | { |
447 | 0 | if (MaybeDestroy(Tvoid_t)) { |
448 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
449 | 0 | } |
450 | 0 | (*(ptr_void_t())) = aRhs; |
451 | 0 | mType = Tvoid_t; |
452 | 0 | return (*(this)); |
453 | 0 | } |
454 | | |
455 | | auto Variant::operator=(void_t&& aRhs) -> Variant& |
456 | 0 | { |
457 | 0 | if (MaybeDestroy(Tvoid_t)) { |
458 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
459 | 0 | } |
460 | 0 | (*(ptr_void_t())) = std::move(aRhs); |
461 | 0 | mType = Tvoid_t; |
462 | 0 | return (*(this)); |
463 | 0 | } |
464 | | |
465 | | auto Variant::operator=(const null_t& aRhs) -> Variant& |
466 | 0 | { |
467 | 0 | if (MaybeDestroy(Tnull_t)) { |
468 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
469 | 0 | } |
470 | 0 | (*(ptr_null_t())) = aRhs; |
471 | 0 | mType = Tnull_t; |
472 | 0 | return (*(this)); |
473 | 0 | } |
474 | | |
475 | | auto Variant::operator=(null_t&& aRhs) -> Variant& |
476 | 0 | { |
477 | 0 | if (MaybeDestroy(Tnull_t)) { |
478 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
479 | 0 | } |
480 | 0 | (*(ptr_null_t())) = std::move(aRhs); |
481 | 0 | mType = Tnull_t; |
482 | 0 | return (*(this)); |
483 | 0 | } |
484 | | |
485 | | auto Variant::operator=(const bool& aRhs) -> Variant& |
486 | 0 | { |
487 | 0 | if (MaybeDestroy(Tbool)) { |
488 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool; |
489 | 0 | } |
490 | 0 | (*(ptr_bool())) = aRhs; |
491 | 0 | mType = Tbool; |
492 | 0 | return (*(this)); |
493 | 0 | } |
494 | | |
495 | | auto Variant::operator=(bool&& aRhs) -> Variant& |
496 | 0 | { |
497 | 0 | if (MaybeDestroy(Tbool)) { |
498 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool; |
499 | 0 | } |
500 | 0 | (*(ptr_bool())) = std::move(aRhs); |
501 | 0 | mType = Tbool; |
502 | 0 | return (*(this)); |
503 | 0 | } |
504 | | |
505 | | auto Variant::operator=(const int& aRhs) -> Variant& |
506 | 0 | { |
507 | 0 | if (MaybeDestroy(Tint)) { |
508 | 0 | new (mozilla::KnownNotNull, ptr_int()) int; |
509 | 0 | } |
510 | 0 | (*(ptr_int())) = aRhs; |
511 | 0 | mType = Tint; |
512 | 0 | return (*(this)); |
513 | 0 | } |
514 | | |
515 | | auto Variant::operator=(int&& aRhs) -> Variant& |
516 | 0 | { |
517 | 0 | if (MaybeDestroy(Tint)) { |
518 | 0 | new (mozilla::KnownNotNull, ptr_int()) int; |
519 | 0 | } |
520 | 0 | (*(ptr_int())) = std::move(aRhs); |
521 | 0 | mType = Tint; |
522 | 0 | return (*(this)); |
523 | 0 | } |
524 | | |
525 | | auto Variant::operator=(const double& aRhs) -> Variant& |
526 | 0 | { |
527 | 0 | if (MaybeDestroy(Tdouble)) { |
528 | 0 | new (mozilla::KnownNotNull, ptr_double()) double; |
529 | 0 | } |
530 | 0 | (*(ptr_double())) = aRhs; |
531 | 0 | mType = Tdouble; |
532 | 0 | return (*(this)); |
533 | 0 | } |
534 | | |
535 | | auto Variant::operator=(double&& aRhs) -> Variant& |
536 | 0 | { |
537 | 0 | if (MaybeDestroy(Tdouble)) { |
538 | 0 | new (mozilla::KnownNotNull, ptr_double()) double; |
539 | 0 | } |
540 | 0 | (*(ptr_double())) = std::move(aRhs); |
541 | 0 | mType = Tdouble; |
542 | 0 | return (*(this)); |
543 | 0 | } |
544 | | |
545 | | auto Variant::operator=(const nsCString& aRhs) -> Variant& |
546 | 0 | { |
547 | 0 | if (MaybeDestroy(TnsCString)) { |
548 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString; |
549 | 0 | } |
550 | 0 | (*(ptr_nsCString())) = aRhs; |
551 | 0 | mType = TnsCString; |
552 | 0 | return (*(this)); |
553 | 0 | } |
554 | | |
555 | | auto Variant::operator=(nsCString&& aRhs) -> Variant& |
556 | 0 | { |
557 | 0 | if (MaybeDestroy(TnsCString)) { |
558 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString; |
559 | 0 | } |
560 | 0 | (*(ptr_nsCString())) = std::move(aRhs); |
561 | 0 | mType = TnsCString; |
562 | 0 | return (*(this)); |
563 | 0 | } |
564 | | |
565 | | auto Variant::operator=(PPluginScriptableObjectParent* aRhs) -> Variant& |
566 | 0 | { |
567 | 0 | if (MaybeDestroy(TPPluginScriptableObjectParent)) { |
568 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*; |
569 | 0 | } |
570 | 0 | (*(ptr_PPluginScriptableObjectParent())) = const_cast<PPluginScriptableObjectParent*>(aRhs); |
571 | 0 | mType = TPPluginScriptableObjectParent; |
572 | 0 | return (*(this)); |
573 | 0 | } |
574 | | |
575 | | auto Variant::operator=(PPluginScriptableObjectChild* aRhs) -> Variant& |
576 | 0 | { |
577 | 0 | if (MaybeDestroy(TPPluginScriptableObjectChild)) { |
578 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*; |
579 | 0 | } |
580 | 0 | (*(ptr_PPluginScriptableObjectChild())) = const_cast<PPluginScriptableObjectChild*>(aRhs); |
581 | 0 | mType = TPPluginScriptableObjectChild; |
582 | 0 | return (*(this)); |
583 | 0 | } |
584 | | |
585 | | auto Variant::operator=(const Variant& aRhs) -> Variant& |
586 | 0 | { |
587 | 0 | (aRhs).AssertSanity(); |
588 | 0 | Type t = (aRhs).type(); |
589 | 0 | switch (t) { |
590 | 0 | case Tvoid_t: |
591 | 0 | { |
592 | 0 | if (MaybeDestroy(t)) { |
593 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
594 | 0 | } |
595 | 0 | (*(ptr_void_t())) = (aRhs).get_void_t(); |
596 | 0 | break; |
597 | 0 | } |
598 | 0 | case Tnull_t: |
599 | 0 | { |
600 | 0 | if (MaybeDestroy(t)) { |
601 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
602 | 0 | } |
603 | 0 | (*(ptr_null_t())) = (aRhs).get_null_t(); |
604 | 0 | break; |
605 | 0 | } |
606 | 0 | case Tbool: |
607 | 0 | { |
608 | 0 | if (MaybeDestroy(t)) { |
609 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool; |
610 | 0 | } |
611 | 0 | (*(ptr_bool())) = (aRhs).get_bool(); |
612 | 0 | break; |
613 | 0 | } |
614 | 0 | case Tint: |
615 | 0 | { |
616 | 0 | if (MaybeDestroy(t)) { |
617 | 0 | new (mozilla::KnownNotNull, ptr_int()) int; |
618 | 0 | } |
619 | 0 | (*(ptr_int())) = (aRhs).get_int(); |
620 | 0 | break; |
621 | 0 | } |
622 | 0 | case Tdouble: |
623 | 0 | { |
624 | 0 | if (MaybeDestroy(t)) { |
625 | 0 | new (mozilla::KnownNotNull, ptr_double()) double; |
626 | 0 | } |
627 | 0 | (*(ptr_double())) = (aRhs).get_double(); |
628 | 0 | break; |
629 | 0 | } |
630 | 0 | case TnsCString: |
631 | 0 | { |
632 | 0 | if (MaybeDestroy(t)) { |
633 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString; |
634 | 0 | } |
635 | 0 | (*(ptr_nsCString())) = (aRhs).get_nsCString(); |
636 | 0 | break; |
637 | 0 | } |
638 | 0 | case TPPluginScriptableObjectParent: |
639 | 0 | { |
640 | 0 | if (MaybeDestroy(t)) { |
641 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*; |
642 | 0 | } |
643 | 0 | (*(ptr_PPluginScriptableObjectParent())) = const_cast<PPluginScriptableObjectParent*>((aRhs).get_PPluginScriptableObjectParent()); |
644 | 0 | break; |
645 | 0 | } |
646 | 0 | case TPPluginScriptableObjectChild: |
647 | 0 | { |
648 | 0 | if (MaybeDestroy(t)) { |
649 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*; |
650 | 0 | } |
651 | 0 | (*(ptr_PPluginScriptableObjectChild())) = const_cast<PPluginScriptableObjectChild*>((aRhs).get_PPluginScriptableObjectChild()); |
652 | 0 | break; |
653 | 0 | } |
654 | 0 | case T__None: |
655 | 0 | { |
656 | 0 | static_cast<void>(MaybeDestroy(t)); |
657 | 0 | break; |
658 | 0 | } |
659 | 0 | default: |
660 | 0 | { |
661 | 0 | mozilla::ipc::LogicError("unreached"); |
662 | 0 | break; |
663 | 0 | } |
664 | 0 | } |
665 | 0 | mType = t; |
666 | 0 | return (*(this)); |
667 | 0 | } |
668 | | |
669 | | auto Variant::operator=(Variant&& aRhs) -> Variant& |
670 | 0 | { |
671 | 0 | (aRhs).AssertSanity(); |
672 | 0 | Type t = (aRhs).type(); |
673 | 0 | switch (t) { |
674 | 0 | case Tvoid_t: |
675 | 0 | { |
676 | 0 | if (MaybeDestroy(t)) { |
677 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
678 | 0 | } |
679 | 0 | (*(ptr_void_t())) = std::move((aRhs).get_void_t()); |
680 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
681 | 0 | break; |
682 | 0 | } |
683 | 0 | case Tnull_t: |
684 | 0 | { |
685 | 0 | if (MaybeDestroy(t)) { |
686 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
687 | 0 | } |
688 | 0 | (*(ptr_null_t())) = std::move((aRhs).get_null_t()); |
689 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
690 | 0 | break; |
691 | 0 | } |
692 | 0 | case Tbool: |
693 | 0 | { |
694 | 0 | if (MaybeDestroy(t)) { |
695 | 0 | new (mozilla::KnownNotNull, ptr_bool()) bool; |
696 | 0 | } |
697 | 0 | (*(ptr_bool())) = std::move((aRhs).get_bool()); |
698 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
699 | 0 | break; |
700 | 0 | } |
701 | 0 | case Tint: |
702 | 0 | { |
703 | 0 | if (MaybeDestroy(t)) { |
704 | 0 | new (mozilla::KnownNotNull, ptr_int()) int; |
705 | 0 | } |
706 | 0 | (*(ptr_int())) = std::move((aRhs).get_int()); |
707 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
708 | 0 | break; |
709 | 0 | } |
710 | 0 | case Tdouble: |
711 | 0 | { |
712 | 0 | if (MaybeDestroy(t)) { |
713 | 0 | new (mozilla::KnownNotNull, ptr_double()) double; |
714 | 0 | } |
715 | 0 | (*(ptr_double())) = std::move((aRhs).get_double()); |
716 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
717 | 0 | break; |
718 | 0 | } |
719 | 0 | case TnsCString: |
720 | 0 | { |
721 | 0 | if (MaybeDestroy(t)) { |
722 | 0 | new (mozilla::KnownNotNull, ptr_nsCString()) nsCString; |
723 | 0 | } |
724 | 0 | (*(ptr_nsCString())) = std::move((aRhs).get_nsCString()); |
725 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
726 | 0 | break; |
727 | 0 | } |
728 | 0 | case TPPluginScriptableObjectParent: |
729 | 0 | { |
730 | 0 | if (MaybeDestroy(t)) { |
731 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*; |
732 | 0 | } |
733 | 0 | (*(ptr_PPluginScriptableObjectParent())) = const_cast<PPluginScriptableObjectParent*>(std::move((aRhs).get_PPluginScriptableObjectParent())); |
734 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
735 | 0 | break; |
736 | 0 | } |
737 | 0 | case TPPluginScriptableObjectChild: |
738 | 0 | { |
739 | 0 | if (MaybeDestroy(t)) { |
740 | 0 | new (mozilla::KnownNotNull, ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*; |
741 | 0 | } |
742 | 0 | (*(ptr_PPluginScriptableObjectChild())) = const_cast<PPluginScriptableObjectChild*>(std::move((aRhs).get_PPluginScriptableObjectChild())); |
743 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
744 | 0 | break; |
745 | 0 | } |
746 | 0 | case T__None: |
747 | 0 | { |
748 | 0 | static_cast<void>(MaybeDestroy(t)); |
749 | 0 | break; |
750 | 0 | } |
751 | 0 | default: |
752 | 0 | { |
753 | 0 | mozilla::ipc::LogicError("unreached"); |
754 | 0 | break; |
755 | 0 | } |
756 | 0 | } |
757 | 0 | (aRhs).mType = T__None; |
758 | 0 | mType = t; |
759 | 0 | return (*(this)); |
760 | 0 | } |
761 | | |
762 | | auto Variant::operator==(const void_t& aRhs) const -> bool |
763 | 0 | { |
764 | 0 | return (get_void_t()) == (aRhs); |
765 | 0 | } |
766 | | |
767 | | auto Variant::operator==(const null_t& aRhs) const -> bool |
768 | 0 | { |
769 | 0 | return (get_null_t()) == (aRhs); |
770 | 0 | } |
771 | | |
772 | | auto Variant::operator==(const bool& aRhs) const -> bool |
773 | 0 | { |
774 | 0 | return (get_bool()) == (aRhs); |
775 | 0 | } |
776 | | |
777 | | auto Variant::operator==(const int& aRhs) const -> bool |
778 | 0 | { |
779 | 0 | return (get_int()) == (aRhs); |
780 | 0 | } |
781 | | |
782 | | auto Variant::operator==(const double& aRhs) const -> bool |
783 | 0 | { |
784 | 0 | return (get_double()) == (aRhs); |
785 | 0 | } |
786 | | |
787 | | auto Variant::operator==(const nsCString& aRhs) const -> bool |
788 | 0 | { |
789 | 0 | return (get_nsCString()) == (aRhs); |
790 | 0 | } |
791 | | |
792 | | auto Variant::operator==(PPluginScriptableObjectParent* aRhs) const -> bool |
793 | 0 | { |
794 | 0 | return (get_PPluginScriptableObjectParent()) == (aRhs); |
795 | 0 | } |
796 | | |
797 | | auto Variant::operator==(PPluginScriptableObjectChild* aRhs) const -> bool |
798 | 0 | { |
799 | 0 | return (get_PPluginScriptableObjectChild()) == (aRhs); |
800 | 0 | } |
801 | | |
802 | | auto Variant::operator==(const Variant& aRhs) const -> bool |
803 | 0 | { |
804 | 0 | if ((type()) != ((aRhs).type())) { |
805 | 0 | return false; |
806 | 0 | } |
807 | 0 | |
808 | 0 | switch (type()) { |
809 | 0 | case Tvoid_t: |
810 | 0 | { |
811 | 0 | return (get_void_t()) == ((aRhs).get_void_t()); |
812 | 0 | } |
813 | 0 | case Tnull_t: |
814 | 0 | { |
815 | 0 | return (get_null_t()) == ((aRhs).get_null_t()); |
816 | 0 | } |
817 | 0 | case Tbool: |
818 | 0 | { |
819 | 0 | return (get_bool()) == ((aRhs).get_bool()); |
820 | 0 | } |
821 | 0 | case Tint: |
822 | 0 | { |
823 | 0 | return (get_int()) == ((aRhs).get_int()); |
824 | 0 | } |
825 | 0 | case Tdouble: |
826 | 0 | { |
827 | 0 | return (get_double()) == ((aRhs).get_double()); |
828 | 0 | } |
829 | 0 | case TnsCString: |
830 | 0 | { |
831 | 0 | return (get_nsCString()) == ((aRhs).get_nsCString()); |
832 | 0 | } |
833 | 0 | case TPPluginScriptableObjectParent: |
834 | 0 | { |
835 | 0 | return (get_PPluginScriptableObjectParent()) == ((aRhs).get_PPluginScriptableObjectParent()); |
836 | 0 | } |
837 | 0 | case TPPluginScriptableObjectChild: |
838 | 0 | { |
839 | 0 | return (get_PPluginScriptableObjectChild()) == ((aRhs).get_PPluginScriptableObjectChild()); |
840 | 0 | } |
841 | 0 | default: |
842 | 0 | { |
843 | 0 | mozilla::ipc::LogicError("unreached"); |
844 | 0 | return false; |
845 | 0 | } |
846 | 0 | } |
847 | 0 | } |
848 | | |
849 | | auto Variant::get(void_t* aOutValue) const -> void |
850 | 0 | { |
851 | 0 | (*(aOutValue)) = get_void_t(); |
852 | 0 | } |
853 | | |
854 | | auto Variant::get(null_t* aOutValue) const -> void |
855 | 0 | { |
856 | 0 | (*(aOutValue)) = get_null_t(); |
857 | 0 | } |
858 | | |
859 | | auto Variant::get(bool* aOutValue) const -> void |
860 | 0 | { |
861 | 0 | (*(aOutValue)) = get_bool(); |
862 | 0 | } |
863 | | |
864 | | auto Variant::get(int* aOutValue) const -> void |
865 | 0 | { |
866 | 0 | (*(aOutValue)) = get_int(); |
867 | 0 | } |
868 | | |
869 | | auto Variant::get(double* aOutValue) const -> void |
870 | 0 | { |
871 | 0 | (*(aOutValue)) = get_double(); |
872 | 0 | } |
873 | | |
874 | | auto Variant::get(nsCString* aOutValue) const -> void |
875 | 0 | { |
876 | 0 | (*(aOutValue)) = get_nsCString(); |
877 | 0 | } |
878 | | |
879 | | auto Variant::get(PPluginScriptableObjectParent** aOutValue) const -> void |
880 | 0 | { |
881 | 0 | (*(aOutValue)) = get_PPluginScriptableObjectParent(); |
882 | 0 | } |
883 | | |
884 | | auto Variant::get(PPluginScriptableObjectChild** aOutValue) const -> void |
885 | 0 | { |
886 | 0 | (*(aOutValue)) = get_PPluginScriptableObjectChild(); |
887 | 0 | } |
888 | | |
889 | | } // namespace plugins |
890 | | } // namespace mozilla |
891 | | |
892 | | namespace mozilla { |
893 | | namespace ipc { |
894 | | auto IPDLParamTraits<mozilla::plugins::Variant>::Write( |
895 | | IPC::Message* aMsg, |
896 | | mozilla::ipc::IProtocol* aActor, |
897 | | const paramType& aVar) -> void |
898 | 0 | { |
899 | 0 | typedef mozilla::plugins::Variant union__; |
900 | 0 | int type; |
901 | 0 | type = (aVar).type(); |
902 | 0 | WriteIPDLParam(aMsg, aActor, type); |
903 | 0 | // Sentinel = 'Variant' |
904 | 0 | (aMsg)->WriteSentinel(2341468588); |
905 | 0 |
|
906 | 0 | switch (type) { |
907 | 0 | case union__::Tvoid_t: |
908 | 0 | { |
909 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_void_t()); |
910 | 0 | // Sentinel = 'Tvoid_t' |
911 | 0 | (aMsg)->WriteSentinel(3041273328); |
912 | 0 | return; |
913 | 0 | } |
914 | 0 | case union__::Tnull_t: |
915 | 0 | { |
916 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_null_t()); |
917 | 0 | // Sentinel = 'Tnull_t' |
918 | 0 | (aMsg)->WriteSentinel(3731137201); |
919 | 0 | return; |
920 | 0 | } |
921 | 0 | case union__::Tbool: |
922 | 0 | { |
923 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_bool()); |
924 | 0 | // Sentinel = 'Tbool' |
925 | 0 | (aMsg)->WriteSentinel(1958350201); |
926 | 0 | return; |
927 | 0 | } |
928 | 0 | case union__::Tint: |
929 | 0 | { |
930 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_int()); |
931 | 0 | // Sentinel = 'Tint' |
932 | 0 | (aMsg)->WriteSentinel(1229956739); |
933 | 0 | return; |
934 | 0 | } |
935 | 0 | case union__::Tdouble: |
936 | 0 | { |
937 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_double()); |
938 | 0 | // Sentinel = 'Tdouble' |
939 | 0 | (aMsg)->WriteSentinel(3456933244); |
940 | 0 | return; |
941 | 0 | } |
942 | 0 | case union__::TnsCString: |
943 | 0 | { |
944 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_nsCString()); |
945 | 0 | // Sentinel = 'TnsCString' |
946 | 0 | (aMsg)->WriteSentinel(2427411293); |
947 | 0 | return; |
948 | 0 | } |
949 | 0 | case union__::TPPluginScriptableObjectParent: |
950 | 0 | { |
951 | 0 | if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) { |
952 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_PPluginScriptableObjectParent()); |
953 | 0 | // Sentinel = 'TPPluginScriptableObjectParent' |
954 | 0 | (aMsg)->WriteSentinel(4046794731); |
955 | 0 | } |
956 | 0 | else { |
957 | 0 | (aActor)->FatalError("wrong side!"); |
958 | 0 | } |
959 | 0 | return; |
960 | 0 | } |
961 | 0 | case union__::TPPluginScriptableObjectChild: |
962 | 0 | { |
963 | 0 | if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) { |
964 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).get_PPluginScriptableObjectChild()); |
965 | 0 | // Sentinel = 'TPPluginScriptableObjectChild' |
966 | 0 | (aMsg)->WriteSentinel(4061745976); |
967 | 0 | } |
968 | 0 | else { |
969 | 0 | (aActor)->FatalError("wrong side!"); |
970 | 0 | } |
971 | 0 | return; |
972 | 0 | } |
973 | 0 | default: |
974 | 0 | { |
975 | 0 | (aActor)->FatalError("unknown union type"); |
976 | 0 | return; |
977 | 0 | } |
978 | 0 | } |
979 | 0 | } |
980 | | |
981 | | auto IPDLParamTraits<mozilla::plugins::Variant>::Read( |
982 | | const IPC::Message* aMsg, |
983 | | PickleIterator* aIter, |
984 | | mozilla::ipc::IProtocol* aActor, |
985 | | paramType* aVar) -> bool |
986 | 0 | { |
987 | 0 | typedef mozilla::plugins::Variant union__; |
988 | 0 | int type; |
989 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) { |
990 | 0 | (aActor)->FatalError("Error deserializing type of union Variant"); |
991 | 0 | return false; |
992 | 0 | } |
993 | 0 | // Sentinel = 'Variant' |
994 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 2341468588)))) { |
995 | 0 | mozilla::ipc::SentinelReadError("Error deserializing type of union Variant"); |
996 | 0 | return false; |
997 | 0 | } |
998 | 0 | |
999 | 0 | switch (type) { |
1000 | 0 | case union__::Tvoid_t: |
1001 | 0 | { |
1002 | 0 | mozilla::void_t tmp = mozilla::void_t(); |
1003 | 0 | (*(aVar)) = tmp; |
1004 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_void_t())))))) { |
1005 | 0 | (aActor)->FatalError("Error deserializing variant Tvoid_t of union Variant"); |
1006 | 0 | return false; |
1007 | 0 | } |
1008 | 0 | // Sentinel = 'Tvoid_t' |
1009 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3041273328)))) { |
1010 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union Variant"); |
1011 | 0 | return false; |
1012 | 0 | } |
1013 | 0 | return true; |
1014 | 0 | } |
1015 | 0 | case union__::Tnull_t: |
1016 | 0 | { |
1017 | 0 | mozilla::null_t tmp = mozilla::null_t(); |
1018 | 0 | (*(aVar)) = tmp; |
1019 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_null_t())))))) { |
1020 | 0 | (aActor)->FatalError("Error deserializing variant Tnull_t of union Variant"); |
1021 | 0 | return false; |
1022 | 0 | } |
1023 | 0 | // Sentinel = 'Tnull_t' |
1024 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3731137201)))) { |
1025 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tnull_t of union Variant"); |
1026 | 0 | return false; |
1027 | 0 | } |
1028 | 0 | return true; |
1029 | 0 | } |
1030 | 0 | case union__::Tbool: |
1031 | 0 | { |
1032 | 0 | bool tmp = bool(); |
1033 | 0 | (*(aVar)) = tmp; |
1034 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_bool())))))) { |
1035 | 0 | (aActor)->FatalError("Error deserializing variant Tbool of union Variant"); |
1036 | 0 | return false; |
1037 | 0 | } |
1038 | 0 | // Sentinel = 'Tbool' |
1039 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1958350201)))) { |
1040 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tbool of union Variant"); |
1041 | 0 | return false; |
1042 | 0 | } |
1043 | 0 | return true; |
1044 | 0 | } |
1045 | 0 | case union__::Tint: |
1046 | 0 | { |
1047 | 0 | int tmp = int(); |
1048 | 0 | (*(aVar)) = tmp; |
1049 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_int())))))) { |
1050 | 0 | (aActor)->FatalError("Error deserializing variant Tint of union Variant"); |
1051 | 0 | return false; |
1052 | 0 | } |
1053 | 0 | // Sentinel = 'Tint' |
1054 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1229956739)))) { |
1055 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tint of union Variant"); |
1056 | 0 | return false; |
1057 | 0 | } |
1058 | 0 | return true; |
1059 | 0 | } |
1060 | 0 | case union__::Tdouble: |
1061 | 0 | { |
1062 | 0 | double tmp = double(); |
1063 | 0 | (*(aVar)) = tmp; |
1064 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_double())))))) { |
1065 | 0 | (aActor)->FatalError("Error deserializing variant Tdouble of union Variant"); |
1066 | 0 | return false; |
1067 | 0 | } |
1068 | 0 | // Sentinel = 'Tdouble' |
1069 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3456933244)))) { |
1070 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tdouble of union Variant"); |
1071 | 0 | return false; |
1072 | 0 | } |
1073 | 0 | return true; |
1074 | 0 | } |
1075 | 0 | case union__::TnsCString: |
1076 | 0 | { |
1077 | 0 | nsCString tmp = nsCString(); |
1078 | 0 | (*(aVar)) = tmp; |
1079 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_nsCString())))))) { |
1080 | 0 | (aActor)->FatalError("Error deserializing variant TnsCString of union Variant"); |
1081 | 0 | return false; |
1082 | 0 | } |
1083 | 0 | // Sentinel = 'TnsCString' |
1084 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 2427411293)))) { |
1085 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant TnsCString of union Variant"); |
1086 | 0 | return false; |
1087 | 0 | } |
1088 | 0 | return true; |
1089 | 0 | } |
1090 | 0 | case union__::TPPluginScriptableObjectParent: |
1091 | 0 | { |
1092 | 0 | if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) { |
1093 | 0 | { |
1094 | 0 | (aActor)->FatalError("wrong side!"); |
1095 | 0 | return false; |
1096 | 0 | } |
1097 | 0 | } |
1098 | 0 | mozilla::plugins::PPluginScriptableObjectChild* tmp = nullptr; |
1099 | 0 | (*(aVar)) = tmp; |
1100 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PPluginScriptableObjectChild())))))) { |
1101 | 0 | (aActor)->FatalError("Error deserializing variant TPPluginScriptableObjectParent of union Variant"); |
1102 | 0 | return false; |
1103 | 0 | } |
1104 | 0 | // Sentinel = 'TPPluginScriptableObjectParent' |
1105 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 4046794731)))) { |
1106 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant TPPluginScriptableObjectParent of union Variant"); |
1107 | 0 | return false; |
1108 | 0 | } |
1109 | 0 | return true; |
1110 | 0 | } |
1111 | 0 | case union__::TPPluginScriptableObjectChild: |
1112 | 0 | { |
1113 | 0 | if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) { |
1114 | 0 | { |
1115 | 0 | (aActor)->FatalError("wrong side!"); |
1116 | 0 | return false; |
1117 | 0 | } |
1118 | 0 | } |
1119 | 0 | mozilla::plugins::PPluginScriptableObjectParent* tmp = nullptr; |
1120 | 0 | (*(aVar)) = tmp; |
1121 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PPluginScriptableObjectParent())))))) { |
1122 | 0 | (aActor)->FatalError("Error deserializing variant TPPluginScriptableObjectChild of union Variant"); |
1123 | 0 | return false; |
1124 | 0 | } |
1125 | 0 | // Sentinel = 'TPPluginScriptableObjectChild' |
1126 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 4061745976)))) { |
1127 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant TPPluginScriptableObjectChild of union Variant"); |
1128 | 0 | return false; |
1129 | 0 | } |
1130 | 0 | return true; |
1131 | 0 | } |
1132 | 0 | default: |
1133 | 0 | { |
1134 | 0 | (aActor)->FatalError("unknown union type"); |
1135 | 0 | return false; |
1136 | 0 | } |
1137 | 0 | } |
1138 | 0 | } |
1139 | | |
1140 | | } // namespace ipc |
1141 | | } // namespace mozilla |