Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/PSpeechSynthesisChild.h"
8 :
9 : #include "mozilla/dom/PContentChild.h"
10 : #include "mozilla/dom/PSpeechSynthesisRequestChild.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 :
19 0 : auto PSpeechSynthesisChild::ActorDestroy(ActorDestroyReason aWhy) -> void
20 : {
21 0 : }
22 :
23 0 : MOZ_IMPLICIT PSpeechSynthesisChild::PSpeechSynthesisChild() :
24 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
25 0 : mState(PSpeechSynthesis::__Dead)
26 : {
27 0 : MOZ_COUNT_CTOR(PSpeechSynthesisChild);
28 0 : }
29 :
30 0 : PSpeechSynthesisChild::~PSpeechSynthesisChild()
31 : {
32 0 : MOZ_COUNT_DTOR(PSpeechSynthesisChild);
33 0 : }
34 :
35 0 : auto PSpeechSynthesisChild::Manager() const -> PContentChild*
36 : {
37 0 : return static_cast<PContentChild*>(IProtocol::Manager());
38 : }
39 :
40 0 : auto PSpeechSynthesisChild::ManagedPSpeechSynthesisRequestChild(nsTArray<PSpeechSynthesisRequestChild*>& aArr) const -> void
41 : {
42 0 : (mManagedPSpeechSynthesisRequestChild).ToArray(aArr);
43 0 : }
44 :
45 0 : auto PSpeechSynthesisChild::ManagedPSpeechSynthesisRequestChild() const -> const ManagedContainer<PSpeechSynthesisRequestChild>&
46 : {
47 0 : return mManagedPSpeechSynthesisRequestChild;
48 : }
49 :
50 0 : auto PSpeechSynthesisChild::Send__delete__(PSpeechSynthesisChild* actor) -> bool
51 : {
52 0 : if ((!(actor))) {
53 0 : return false;
54 : }
55 :
56 0 : IPC::Message* msg__ = PSpeechSynthesis::Msg___delete__((actor)->Id());
57 :
58 0 : (actor)->Write(actor, msg__, false);
59 : // Sentinel = 'actor'
60 0 : (msg__)->WriteSentinel(875202478);
61 :
62 :
63 :
64 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
65 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
66 : }
67 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg___delete__", OTHER);
68 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg___delete____ID, (&((actor)->mState)));
69 :
70 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
71 :
72 0 : IProtocol* mgr = (actor)->Manager();
73 0 : (actor)->DestroySubtree(Deletion);
74 0 : (actor)->DeallocSubtree();
75 0 : (mgr)->RemoveManagee(PSpeechSynthesisMsgStart, actor);
76 0 : return sendok__;
77 : }
78 :
79 0 : auto PSpeechSynthesisChild::SendPSpeechSynthesisRequestConstructor(
80 : const nsString& aText,
81 : const nsString& aUri,
82 : const nsString& aLang,
83 : const float& aVolume,
84 : const float& aRate,
85 : const float& aPitch) -> PSpeechSynthesisRequestChild*
86 : {
87 0 : return SendPSpeechSynthesisRequestConstructor(AllocPSpeechSynthesisRequestChild(aText, aUri, aLang, aVolume, aRate, aPitch), aText, aUri, aLang, aVolume, aRate, aPitch);
88 : }
89 :
90 0 : auto PSpeechSynthesisChild::SendPSpeechSynthesisRequestConstructor(
91 : PSpeechSynthesisRequestChild* actor,
92 : const nsString& aText,
93 : const nsString& aUri,
94 : const nsString& aLang,
95 : const float& aVolume,
96 : const float& aRate,
97 : const float& aPitch) -> PSpeechSynthesisRequestChild*
98 : {
99 0 : if ((!(actor))) {
100 0 : NS_WARNING("Error constructing actor PSpeechSynthesisRequestChild");
101 0 : return nullptr;
102 : }
103 0 : (actor)->SetManager(this);
104 0 : Register(actor);
105 0 : (actor)->SetIPCChannel(GetIPCChannel());
106 0 : (mManagedPSpeechSynthesisRequestChild).PutEntry(actor);
107 0 : (actor)->mState = mozilla::dom::PSpeechSynthesisRequest::__Start;
108 :
109 0 : IPC::Message* msg__ = PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor(Id());
110 :
111 0 : Write(actor, msg__, false);
112 : // Sentinel = 'actor'
113 0 : (msg__)->WriteSentinel(875202478);
114 0 : Write(aText, msg__);
115 : // Sentinel = 'aText'
116 0 : (msg__)->WriteSentinel(711388569);
117 0 : Write(aUri, msg__);
118 : // Sentinel = 'aUri'
119 0 : (msg__)->WriteSentinel(2043506205);
120 0 : Write(aLang, msg__);
121 : // Sentinel = 'aLang'
122 0 : (msg__)->WriteSentinel(2802955996);
123 0 : Write(aVolume, msg__);
124 : // Sentinel = 'aVolume'
125 0 : (msg__)->WriteSentinel(3908369896);
126 0 : Write(aRate, msg__);
127 : // Sentinel = 'aRate'
128 0 : (msg__)->WriteSentinel(3944748486);
129 0 : Write(aPitch, msg__);
130 : // Sentinel = 'aPitch'
131 0 : (msg__)->WriteSentinel(1564848579);
132 :
133 0 : (msg__)->set_constructor();
134 :
135 :
136 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
137 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
138 : }
139 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor", OTHER);
140 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor__ID, (&(mState)));
141 :
142 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
143 0 : if ((!(sendok__))) {
144 0 : FatalError("constructor for actor failed");
145 0 : return nullptr;
146 : }
147 0 : return actor;
148 : }
149 :
150 0 : auto PSpeechSynthesisChild::RemoveManagee(
151 : int32_t aProtocolId,
152 : ProtocolBase* aListener) -> void
153 : {
154 0 : switch (aProtocolId) {
155 : case PSpeechSynthesisRequestMsgStart:
156 : {
157 0 : PSpeechSynthesisRequestChild* actor = static_cast<PSpeechSynthesisRequestChild*>(aListener);
158 0 : auto& container = mManagedPSpeechSynthesisRequestChild;
159 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
160 :
161 0 : (container).RemoveEntry(actor);
162 0 : DeallocPSpeechSynthesisRequestChild(actor);
163 0 : return;
164 : }
165 : default:
166 : {
167 0 : FatalError("unreached");
168 0 : return;
169 : }
170 : }
171 : }
172 :
173 0 : auto PSpeechSynthesisChild::OnMessageReceived(const Message& msg__) -> PSpeechSynthesisChild::Result
174 : {
175 0 : switch ((msg__).type()) {
176 : case PSpeechSynthesis::Msg_VoiceAdded__ID:
177 : {
178 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
179 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
180 : }
181 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceAdded", OTHER);
182 :
183 0 : PickleIterator iter__(msg__);
184 0 : RemoteVoice aVoice;
185 :
186 0 : if ((!(Read((&(aVoice)), (&(msg__)), (&(iter__)))))) {
187 0 : FatalError("Error deserializing 'RemoteVoice'");
188 0 : return MsgValueError;
189 : }
190 : // Sentinel = 'aVoice'
191 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3137890747)))) {
192 0 : mozilla::ipc::SentinelReadError("Error deserializing 'RemoteVoice'");
193 0 : return MsgValueError;
194 : }
195 0 : (msg__).EndRead(iter__, (msg__).type());
196 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_VoiceAdded__ID, (&(mState)));
197 0 : if ((!(RecvVoiceAdded(mozilla::Move(aVoice))))) {
198 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
199 : // Error handled in mozilla::ipc::IPCResult
200 0 : return MsgProcessingError;
201 : }
202 :
203 0 : return MsgProcessed;
204 : }
205 : case PSpeechSynthesis::Msg_VoiceRemoved__ID:
206 : {
207 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
208 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
209 : }
210 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceRemoved", OTHER);
211 :
212 0 : PickleIterator iter__(msg__);
213 0 : nsString aUri;
214 :
215 0 : if ((!(Read((&(aUri)), (&(msg__)), (&(iter__)))))) {
216 0 : FatalError("Error deserializing 'nsString'");
217 0 : return MsgValueError;
218 : }
219 : // Sentinel = 'aUri'
220 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2043506205)))) {
221 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
222 0 : return MsgValueError;
223 : }
224 0 : (msg__).EndRead(iter__, (msg__).type());
225 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_VoiceRemoved__ID, (&(mState)));
226 0 : if ((!(RecvVoiceRemoved(mozilla::Move(aUri))))) {
227 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
228 : // Error handled in mozilla::ipc::IPCResult
229 0 : return MsgProcessingError;
230 : }
231 :
232 0 : return MsgProcessed;
233 : }
234 : case PSpeechSynthesis::Msg_SetDefaultVoice__ID:
235 : {
236 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
237 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
238 : }
239 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_SetDefaultVoice", OTHER);
240 :
241 0 : PickleIterator iter__(msg__);
242 0 : nsString aUri;
243 : bool aIsDefault;
244 :
245 0 : if ((!(Read((&(aUri)), (&(msg__)), (&(iter__)))))) {
246 0 : FatalError("Error deserializing 'nsString'");
247 0 : return MsgValueError;
248 : }
249 : // Sentinel = 'aUri'
250 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2043506205)))) {
251 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
252 0 : return MsgValueError;
253 : }
254 0 : if ((!(Read((&(aIsDefault)), (&(msg__)), (&(iter__)))))) {
255 0 : FatalError("Error deserializing 'bool'");
256 0 : return MsgValueError;
257 : }
258 : // Sentinel = 'aIsDefault'
259 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1203240634)))) {
260 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
261 0 : return MsgValueError;
262 : }
263 0 : (msg__).EndRead(iter__, (msg__).type());
264 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_SetDefaultVoice__ID, (&(mState)));
265 0 : if ((!(RecvSetDefaultVoice(mozilla::Move(aUri), mozilla::Move(aIsDefault))))) {
266 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
267 : // Error handled in mozilla::ipc::IPCResult
268 0 : return MsgProcessingError;
269 : }
270 :
271 0 : return MsgProcessed;
272 : }
273 : case PSpeechSynthesis::Msg_IsSpeakingChanged__ID:
274 : {
275 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
276 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
277 : }
278 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_IsSpeakingChanged", OTHER);
279 :
280 0 : PickleIterator iter__(msg__);
281 : bool aIsSpeaking;
282 :
283 0 : if ((!(Read((&(aIsSpeaking)), (&(msg__)), (&(iter__)))))) {
284 0 : FatalError("Error deserializing 'bool'");
285 0 : return MsgValueError;
286 : }
287 : // Sentinel = 'aIsSpeaking'
288 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1494791872)))) {
289 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
290 0 : return MsgValueError;
291 : }
292 0 : (msg__).EndRead(iter__, (msg__).type());
293 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_IsSpeakingChanged__ID, (&(mState)));
294 0 : if ((!(RecvIsSpeakingChanged(mozilla::Move(aIsSpeaking))))) {
295 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
296 : // Error handled in mozilla::ipc::IPCResult
297 0 : return MsgProcessingError;
298 : }
299 :
300 0 : return MsgProcessed;
301 : }
302 : case PSpeechSynthesis::Msg_NotifyVoicesChanged__ID:
303 : {
304 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
305 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
306 : }
307 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_NotifyVoicesChanged", OTHER);
308 :
309 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_NotifyVoicesChanged__ID, (&(mState)));
310 0 : if ((!(RecvNotifyVoicesChanged()))) {
311 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
312 : // Error handled in mozilla::ipc::IPCResult
313 0 : return MsgProcessingError;
314 : }
315 :
316 0 : return MsgProcessed;
317 : }
318 : case PSpeechSynthesis::Msg_InitialVoicesAndState__ID:
319 : {
320 0 : if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesisChild")) {
321 0 : mozilla::ipc::LogMessageForProtocol("PSpeechSynthesisChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
322 : }
323 0 : AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_InitialVoicesAndState", OTHER);
324 :
325 0 : PickleIterator iter__(msg__);
326 0 : nsTArray<RemoteVoice> aVoices;
327 0 : nsTArray<nsString> aDefaults;
328 : bool aIsSpeaking;
329 :
330 0 : if ((!(Read((&(aVoices)), (&(msg__)), (&(iter__)))))) {
331 0 : FatalError("Error deserializing 'nsTArray'");
332 0 : return MsgValueError;
333 : }
334 : // Sentinel = 'aVoices'
335 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1351181827)))) {
336 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
337 0 : return MsgValueError;
338 : }
339 0 : if ((!(Read((&(aDefaults)), (&(msg__)), (&(iter__)))))) {
340 0 : FatalError("Error deserializing 'nsTArray'");
341 0 : return MsgValueError;
342 : }
343 : // Sentinel = 'aDefaults'
344 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2428457646)))) {
345 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
346 0 : return MsgValueError;
347 : }
348 0 : if ((!(Read((&(aIsSpeaking)), (&(msg__)), (&(iter__)))))) {
349 0 : FatalError("Error deserializing 'bool'");
350 0 : return MsgValueError;
351 : }
352 : // Sentinel = 'aIsSpeaking'
353 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1494791872)))) {
354 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
355 0 : return MsgValueError;
356 : }
357 0 : (msg__).EndRead(iter__, (msg__).type());
358 0 : PSpeechSynthesis::Transition(PSpeechSynthesis::Msg_InitialVoicesAndState__ID, (&(mState)));
359 0 : if ((!(RecvInitialVoicesAndState(mozilla::Move(aVoices), mozilla::Move(aDefaults), mozilla::Move(aIsSpeaking))))) {
360 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
361 : // Error handled in mozilla::ipc::IPCResult
362 0 : return MsgProcessingError;
363 : }
364 :
365 0 : return MsgProcessed;
366 : }
367 : case PSpeechSynthesis::Reply___delete____ID:
368 : {
369 0 : return MsgProcessed;
370 : }
371 : case PSpeechSynthesis::Reply_PSpeechSynthesisRequestConstructor__ID:
372 : {
373 0 : return MsgProcessed;
374 : }
375 : default:
376 : {
377 0 : return MsgNotKnown;
378 : }
379 : }
380 : }
381 :
382 0 : auto PSpeechSynthesisChild::OnMessageReceived(
383 : const Message& msg__,
384 : Message*& reply__) -> PSpeechSynthesisChild::Result
385 : {
386 0 : return MsgNotKnown;
387 : }
388 :
389 0 : auto PSpeechSynthesisChild::OnCallReceived(
390 : const Message& msg__,
391 : Message*& reply__) -> PSpeechSynthesisChild::Result
392 : {
393 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
394 : return MsgNotKnown;
395 : }
396 :
397 0 : auto PSpeechSynthesisChild::GetProtocolTypeId() -> int32_t
398 : {
399 0 : return PSpeechSynthesisMsgStart;
400 : }
401 :
402 0 : auto PSpeechSynthesisChild::ProtocolName() const -> const char*
403 : {
404 0 : return "PSpeechSynthesisChild";
405 : }
406 :
407 0 : auto PSpeechSynthesisChild::DestroySubtree(ActorDestroyReason why) -> void
408 : {
409 : // Unregister from our manager.
410 0 : Unregister(Id());
411 :
412 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
413 :
414 : {
415 : // Recursively shutting down PSpeechSynthesisRequest kids
416 0 : nsTArray<PSpeechSynthesisRequestChild*> kids;
417 : // Accumulate kids into a stable structure to iterate over
418 0 : ManagedPSpeechSynthesisRequestChild(kids);
419 0 : for (auto& kid : kids) {
420 : // Guarding against a child removing a sibling from the list during the iteration.
421 0 : if ((mManagedPSpeechSynthesisRequestChild).Contains(kid)) {
422 0 : (kid)->DestroySubtree(subtreewhy);
423 : }
424 : }
425 : }
426 :
427 : // Reject owning pending promises.
428 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
429 :
430 : // Finally, destroy "us".
431 0 : ActorDestroy(why);
432 0 : }
433 :
434 0 : auto PSpeechSynthesisChild::DeallocSubtree() -> void
435 : {
436 : {
437 : // Recursively deleting PSpeechSynthesisRequest kids
438 0 : for (auto iter = (mManagedPSpeechSynthesisRequestChild).Iter(); (!((iter).Done())); (iter).Next()) {
439 0 : (((iter).Get())->GetKey())->DeallocSubtree();
440 : }
441 :
442 0 : for (auto iter = (mManagedPSpeechSynthesisRequestChild).Iter(); (!((iter).Done())); (iter).Next()) {
443 0 : DeallocPSpeechSynthesisRequestChild(((iter).Get())->GetKey());
444 : }
445 0 : (mManagedPSpeechSynthesisRequestChild).Clear();
446 : }
447 0 : }
448 :
449 0 : auto PSpeechSynthesisChild::Write(
450 : const RemoteVoice& v__,
451 : Message* msg__) -> void
452 : {
453 0 : Write((v__).voiceURI(), msg__);
454 : // Sentinel = 'voiceURI'
455 0 : (msg__)->WriteSentinel(3433458652);
456 0 : Write((v__).name(), msg__);
457 : // Sentinel = 'name'
458 0 : (msg__)->WriteSentinel(15034981);
459 0 : Write((v__).lang(), msg__);
460 : // Sentinel = 'lang'
461 0 : (msg__)->WriteSentinel(3427407840);
462 0 : Write((v__).localService(), msg__);
463 : // Sentinel = 'localService'
464 0 : (msg__)->WriteSentinel(1349544758);
465 0 : Write((v__).queued(), msg__);
466 : // Sentinel = 'queued'
467 0 : (msg__)->WriteSentinel(2153284221);
468 0 : }
469 :
470 0 : auto PSpeechSynthesisChild::Read(
471 : RemoteVoice* v__,
472 : const Message* msg__,
473 : PickleIterator* iter__) -> bool
474 : {
475 0 : if ((!(Read((&((v__)->voiceURI())), msg__, iter__)))) {
476 0 : FatalError("Error deserializing 'voiceURI' (nsString) member of 'RemoteVoice'");
477 0 : return false;
478 : }
479 : // Sentinel = 'voiceURI'
480 0 : if ((!((msg__)->ReadSentinel(iter__, 3433458652)))) {
481 0 : mozilla::ipc::SentinelReadError("Error deserializing 'voiceURI' (nsString) member of 'RemoteVoice'");
482 0 : return false;
483 : }
484 0 : if ((!(Read((&((v__)->name())), msg__, iter__)))) {
485 0 : FatalError("Error deserializing 'name' (nsString) member of 'RemoteVoice'");
486 0 : return false;
487 : }
488 : // Sentinel = 'name'
489 0 : if ((!((msg__)->ReadSentinel(iter__, 15034981)))) {
490 0 : mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'RemoteVoice'");
491 0 : return false;
492 : }
493 0 : if ((!(Read((&((v__)->lang())), msg__, iter__)))) {
494 0 : FatalError("Error deserializing 'lang' (nsString) member of 'RemoteVoice'");
495 0 : return false;
496 : }
497 : // Sentinel = 'lang'
498 0 : if ((!((msg__)->ReadSentinel(iter__, 3427407840)))) {
499 0 : mozilla::ipc::SentinelReadError("Error deserializing 'lang' (nsString) member of 'RemoteVoice'");
500 0 : return false;
501 : }
502 0 : if ((!(Read((&((v__)->localService())), msg__, iter__)))) {
503 0 : FatalError("Error deserializing 'localService' (bool) member of 'RemoteVoice'");
504 0 : return false;
505 : }
506 : // Sentinel = 'localService'
507 0 : if ((!((msg__)->ReadSentinel(iter__, 1349544758)))) {
508 0 : mozilla::ipc::SentinelReadError("Error deserializing 'localService' (bool) member of 'RemoteVoice'");
509 0 : return false;
510 : }
511 0 : if ((!(Read((&((v__)->queued())), msg__, iter__)))) {
512 0 : FatalError("Error deserializing 'queued' (bool) member of 'RemoteVoice'");
513 0 : return false;
514 : }
515 : // Sentinel = 'queued'
516 0 : if ((!((msg__)->ReadSentinel(iter__, 2153284221)))) {
517 0 : mozilla::ipc::SentinelReadError("Error deserializing 'queued' (bool) member of 'RemoteVoice'");
518 0 : return false;
519 : }
520 0 : return true;
521 : }
522 :
523 0 : auto PSpeechSynthesisChild::Write(
524 : const PSpeechSynthesisChild* v__,
525 : Message* msg__,
526 : bool nullable__) -> void
527 : {
528 : int32_t id;
529 0 : if ((!(v__))) {
530 0 : if ((!(nullable__))) {
531 0 : FatalError("NULL actor value passed to non-nullable param");
532 : }
533 0 : id = 0;
534 : }
535 : else {
536 0 : id = (v__)->Id();
537 0 : if ((1) == (id)) {
538 0 : FatalError("actor has been |delete|d");
539 : }
540 : }
541 :
542 0 : Write(id, msg__);
543 0 : }
544 :
545 0 : auto PSpeechSynthesisChild::Read(
546 : PSpeechSynthesisChild** v__,
547 : const Message* msg__,
548 : PickleIterator* iter__,
549 : bool nullable__) -> bool
550 : {
551 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PSpeechSynthesis", PSpeechSynthesisMsgStart);
552 0 : if ((actor).isNothing()) {
553 0 : return false;
554 : }
555 :
556 0 : (*(v__)) = static_cast<PSpeechSynthesisChild*>((actor).value());
557 0 : return true;
558 : }
559 :
560 0 : auto PSpeechSynthesisChild::Write(
561 : const PSpeechSynthesisRequestChild* v__,
562 : Message* msg__,
563 : bool nullable__) -> void
564 : {
565 : int32_t id;
566 0 : if ((!(v__))) {
567 0 : if ((!(nullable__))) {
568 0 : FatalError("NULL actor value passed to non-nullable param");
569 : }
570 0 : id = 0;
571 : }
572 : else {
573 0 : id = (v__)->Id();
574 0 : if ((1) == (id)) {
575 0 : FatalError("actor has been |delete|d");
576 : }
577 : }
578 :
579 0 : Write(id, msg__);
580 0 : }
581 :
582 0 : auto PSpeechSynthesisChild::Read(
583 : PSpeechSynthesisRequestChild** v__,
584 : const Message* msg__,
585 : PickleIterator* iter__,
586 : bool nullable__) -> bool
587 : {
588 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PSpeechSynthesisRequest", PSpeechSynthesisRequestMsgStart);
589 0 : if ((actor).isNothing()) {
590 0 : return false;
591 : }
592 :
593 0 : (*(v__)) = static_cast<PSpeechSynthesisRequestChild*>((actor).value());
594 0 : return true;
595 : }
596 :
597 0 : auto PSpeechSynthesisChild::Write(
598 : const nsTArray<RemoteVoice>& v__,
599 : Message* msg__) -> void
600 : {
601 0 : uint32_t length = (v__).Length();
602 0 : Write(length, msg__);
603 : // Sentinel = ('length', 'RemoteVoice[]')
604 0 : (msg__)->WriteSentinel(3625058422);
605 :
606 0 : for (auto& elem : v__) {
607 0 : Write(elem, msg__);
608 : // Sentinel = 'RemoteVoice[]'
609 0 : (msg__)->WriteSentinel(1718242537);
610 : }
611 0 : }
612 :
613 0 : auto PSpeechSynthesisChild::Read(
614 : nsTArray<RemoteVoice>* v__,
615 : const Message* msg__,
616 : PickleIterator* iter__) -> bool
617 : {
618 0 : nsTArray<RemoteVoice> fa;
619 : uint32_t length;
620 0 : if ((!(Read((&(length)), msg__, iter__)))) {
621 0 : mozilla::ipc::ArrayLengthReadError("RemoteVoice[]");
622 0 : return false;
623 : }
624 : // Sentinel = ('length', 'RemoteVoice[]')
625 0 : if ((!((msg__)->ReadSentinel(iter__, 3625058422)))) {
626 0 : mozilla::ipc::SentinelReadError("RemoteVoice[]");
627 0 : return false;
628 : }
629 :
630 0 : RemoteVoice* elems = (fa).AppendElements(length);
631 0 : for (uint32_t i = 0; (i) < (length); (++(i))) {
632 0 : if ((!(Read((&(elems[i])), msg__, iter__)))) {
633 0 : FatalError("Error deserializing 'RemoteVoice[i]'");
634 0 : return false;
635 : }
636 : // Sentinel = 'RemoteVoice[]'
637 0 : if ((!((msg__)->ReadSentinel(iter__, 1718242537)))) {
638 0 : mozilla::ipc::SentinelReadError("Error deserializing 'RemoteVoice[i]'");
639 0 : return false;
640 : }
641 : }
642 0 : (v__)->SwapElements(fa);
643 0 : return true;
644 : }
645 :
646 :
647 :
648 : } // namespace dom
649 : } // namespace mozilla
|