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