Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/PRemoteSpellcheckEngineChild.h"
8 :
9 : #include "mozilla/dom/PContentChild.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 :
16 :
17 0 : auto PRemoteSpellcheckEngineChild::ActorDestroy(ActorDestroyReason aWhy) -> void
18 : {
19 0 : }
20 :
21 0 : MOZ_IMPLICIT PRemoteSpellcheckEngineChild::PRemoteSpellcheckEngineChild() :
22 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
23 0 : mState(PRemoteSpellcheckEngine::__Dead)
24 : {
25 0 : MOZ_COUNT_CTOR(PRemoteSpellcheckEngineChild);
26 0 : }
27 :
28 0 : PRemoteSpellcheckEngineChild::~PRemoteSpellcheckEngineChild()
29 : {
30 0 : MOZ_COUNT_DTOR(PRemoteSpellcheckEngineChild);
31 0 : }
32 :
33 0 : auto PRemoteSpellcheckEngineChild::Manager() const -> PContentChild*
34 : {
35 0 : return static_cast<PContentChild*>(IProtocol::Manager());
36 : }
37 :
38 0 : auto PRemoteSpellcheckEngineChild::Send__delete__(PRemoteSpellcheckEngineChild* actor) -> bool
39 : {
40 0 : if ((!(actor))) {
41 0 : return false;
42 : }
43 :
44 0 : IPC::Message* msg__ = PRemoteSpellcheckEngine::Msg___delete__((actor)->Id());
45 :
46 0 : (actor)->Write(actor, msg__, false);
47 : // Sentinel = 'actor'
48 0 : (msg__)->WriteSentinel(875202478);
49 :
50 :
51 :
52 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
53 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54 : }
55 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg___delete__", OTHER);
56 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg___delete____ID, (&((actor)->mState)));
57 :
58 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
59 :
60 0 : IProtocol* mgr = (actor)->Manager();
61 0 : (actor)->DestroySubtree(Deletion);
62 0 : (actor)->DeallocSubtree();
63 0 : (mgr)->RemoveManagee(PRemoteSpellcheckEngineMsgStart, actor);
64 0 : return sendok__;
65 : }
66 :
67 0 : auto PRemoteSpellcheckEngineChild::SendCheck(
68 : const nsString& aWord,
69 : bool* aIsMisspelled) -> bool
70 : {
71 0 : IPC::Message* msg__ = PRemoteSpellcheckEngine::Msg_Check(Id());
72 :
73 0 : Write(aWord, msg__);
74 : // Sentinel = 'aWord'
75 0 : (msg__)->WriteSentinel(741220960);
76 :
77 0 : (msg__)->set_sync();
78 :
79 :
80 0 : Message reply__;
81 :
82 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
83 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
84 : }
85 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_Check", OTHER);
86 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg_Check__ID, (&(mState)));
87 :
88 : bool sendok__;
89 : {
90 : AutoProfilerTracing syncIPCTracer(
91 : "IPC",
92 0 : "PRemoteSpellcheckEngine::Msg_Check");
93 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
94 : }
95 0 : if ((!(sendok__))) {
96 0 : return false;
97 : }
98 :
99 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
100 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
101 : }
102 :
103 0 : PickleIterator iter__(reply__);
104 :
105 0 : if ((!(Read(aIsMisspelled, (&(reply__)), (&(iter__)))))) {
106 0 : FatalError("Error deserializing 'bool'");
107 0 : return false;
108 : }
109 : // Sentinel = 'aIsMisspelled'
110 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3664203874)))) {
111 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
112 0 : return false;
113 : }
114 0 : (reply__).EndRead(iter__, (reply__).type());
115 :
116 0 : return true;
117 : }
118 :
119 0 : auto PRemoteSpellcheckEngineChild::SendCheckAndSuggest(
120 : const nsString& aWord,
121 : bool* aIsMisspelled,
122 : nsTArray<nsString>* aSuggestions) -> bool
123 : {
124 0 : IPC::Message* msg__ = PRemoteSpellcheckEngine::Msg_CheckAndSuggest(Id());
125 :
126 0 : Write(aWord, msg__);
127 : // Sentinel = 'aWord'
128 0 : (msg__)->WriteSentinel(741220960);
129 :
130 0 : (msg__)->set_sync();
131 :
132 :
133 0 : Message reply__;
134 :
135 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
136 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
137 : }
138 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_CheckAndSuggest", OTHER);
139 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg_CheckAndSuggest__ID, (&(mState)));
140 :
141 : bool sendok__;
142 : {
143 : AutoProfilerTracing syncIPCTracer(
144 : "IPC",
145 0 : "PRemoteSpellcheckEngine::Msg_CheckAndSuggest");
146 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
147 : }
148 0 : if ((!(sendok__))) {
149 0 : return false;
150 : }
151 :
152 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
153 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
154 : }
155 :
156 0 : PickleIterator iter__(reply__);
157 :
158 0 : if ((!(Read(aIsMisspelled, (&(reply__)), (&(iter__)))))) {
159 0 : FatalError("Error deserializing 'bool'");
160 0 : return false;
161 : }
162 : // Sentinel = 'aIsMisspelled'
163 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3664203874)))) {
164 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
165 0 : return false;
166 : }
167 0 : if ((!(Read(aSuggestions, (&(reply__)), (&(iter__)))))) {
168 0 : FatalError("Error deserializing 'nsTArray'");
169 0 : return false;
170 : }
171 : // Sentinel = 'aSuggestions'
172 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 2353668628)))) {
173 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
174 0 : return false;
175 : }
176 0 : (reply__).EndRead(iter__, (reply__).type());
177 :
178 0 : return true;
179 : }
180 :
181 0 : auto PRemoteSpellcheckEngineChild::SendSetDictionary(
182 : const nsString& aDictionary,
183 : bool* success) -> bool
184 : {
185 0 : IPC::Message* msg__ = PRemoteSpellcheckEngine::Msg_SetDictionary(Id());
186 :
187 0 : Write(aDictionary, msg__);
188 : // Sentinel = 'aDictionary'
189 0 : (msg__)->WriteSentinel(1521730514);
190 :
191 0 : (msg__)->set_sync();
192 :
193 :
194 0 : Message reply__;
195 :
196 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
197 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
198 : }
199 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionary", OTHER);
200 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg_SetDictionary__ID, (&(mState)));
201 :
202 : bool sendok__;
203 : {
204 : AutoProfilerTracing syncIPCTracer(
205 : "IPC",
206 0 : "PRemoteSpellcheckEngine::Msg_SetDictionary");
207 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
208 : }
209 0 : if ((!(sendok__))) {
210 0 : return false;
211 : }
212 :
213 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
214 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
215 : }
216 :
217 0 : PickleIterator iter__(reply__);
218 :
219 0 : if ((!(Read(success, (&(reply__)), (&(iter__)))))) {
220 0 : FatalError("Error deserializing 'bool'");
221 0 : return false;
222 : }
223 : // Sentinel = 'success'
224 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3877396070)))) {
225 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
226 0 : return false;
227 : }
228 0 : (reply__).EndRead(iter__, (reply__).type());
229 :
230 0 : return true;
231 : }
232 :
233 0 : auto PRemoteSpellcheckEngineChild::SendSetDictionaryFromList(
234 : const nsTArray<nsString>& aList,
235 : const intptr_t& aPromiseId) -> bool
236 : {
237 0 : IPC::Message* msg__ = PRemoteSpellcheckEngine::Msg_SetDictionaryFromList(Id());
238 :
239 0 : Write(aList, msg__);
240 : // Sentinel = 'aList'
241 0 : (msg__)->WriteSentinel(4100027884);
242 0 : Write(aPromiseId, msg__);
243 : // Sentinel = 'aPromiseId'
244 0 : (msg__)->WriteSentinel(1396174085);
245 :
246 :
247 :
248 :
249 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
250 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
251 : }
252 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaryFromList", OTHER);
253 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg_SetDictionaryFromList__ID, (&(mState)));
254 :
255 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
256 0 : return sendok__;
257 : }
258 :
259 0 : auto PRemoteSpellcheckEngineChild::RemoveManagee(
260 : int32_t aProtocolId,
261 : ProtocolBase* aListener) -> void
262 : {
263 0 : FatalError("unreached");
264 0 : return;
265 : }
266 :
267 0 : auto PRemoteSpellcheckEngineChild::OnMessageReceived(const Message& msg__) -> PRemoteSpellcheckEngineChild::Result
268 : {
269 0 : switch ((msg__).type()) {
270 : case PRemoteSpellcheckEngine::Reply___delete____ID:
271 : {
272 0 : return MsgProcessed;
273 : }
274 : case PRemoteSpellcheckEngine::Msg_NotifyOfCurrentDictionary__ID:
275 : {
276 0 : if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngineChild")) {
277 0 : mozilla::ipc::LogMessageForProtocol("PRemoteSpellcheckEngineChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
278 : }
279 0 : AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_NotifyOfCurrentDictionary", OTHER);
280 :
281 0 : PickleIterator iter__(msg__);
282 0 : nsString aDictionary;
283 : intptr_t aPromiseId;
284 :
285 0 : if ((!(Read((&(aDictionary)), (&(msg__)), (&(iter__)))))) {
286 0 : FatalError("Error deserializing 'nsString'");
287 0 : return MsgValueError;
288 : }
289 : // Sentinel = 'aDictionary'
290 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1521730514)))) {
291 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
292 0 : return MsgValueError;
293 : }
294 0 : if ((!(Read((&(aPromiseId)), (&(msg__)), (&(iter__)))))) {
295 0 : FatalError("Error deserializing 'intptr_t'");
296 0 : return MsgValueError;
297 : }
298 : // Sentinel = 'aPromiseId'
299 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1396174085)))) {
300 0 : mozilla::ipc::SentinelReadError("Error deserializing 'intptr_t'");
301 0 : return MsgValueError;
302 : }
303 0 : (msg__).EndRead(iter__, (msg__).type());
304 0 : PRemoteSpellcheckEngine::Transition(PRemoteSpellcheckEngine::Msg_NotifyOfCurrentDictionary__ID, (&(mState)));
305 0 : if ((!(RecvNotifyOfCurrentDictionary(mozilla::Move(aDictionary), mozilla::Move(aPromiseId))))) {
306 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
307 : // Error handled in mozilla::ipc::IPCResult
308 0 : return MsgProcessingError;
309 : }
310 :
311 0 : return MsgProcessed;
312 : }
313 : default:
314 : {
315 0 : return MsgNotKnown;
316 : }
317 : }
318 : }
319 :
320 0 : auto PRemoteSpellcheckEngineChild::OnMessageReceived(
321 : const Message& msg__,
322 : Message*& reply__) -> PRemoteSpellcheckEngineChild::Result
323 : {
324 0 : return MsgNotKnown;
325 : }
326 :
327 0 : auto PRemoteSpellcheckEngineChild::OnCallReceived(
328 : const Message& msg__,
329 : Message*& reply__) -> PRemoteSpellcheckEngineChild::Result
330 : {
331 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
332 : return MsgNotKnown;
333 : }
334 :
335 0 : auto PRemoteSpellcheckEngineChild::GetProtocolTypeId() -> int32_t
336 : {
337 0 : return PRemoteSpellcheckEngineMsgStart;
338 : }
339 :
340 0 : auto PRemoteSpellcheckEngineChild::ProtocolName() const -> const char*
341 : {
342 0 : return "PRemoteSpellcheckEngineChild";
343 : }
344 :
345 0 : auto PRemoteSpellcheckEngineChild::DestroySubtree(ActorDestroyReason why) -> void
346 : {
347 : // Unregister from our manager.
348 0 : Unregister(Id());
349 :
350 : // Reject owning pending promises.
351 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
352 :
353 : // Finally, destroy "us".
354 0 : ActorDestroy(why);
355 0 : }
356 :
357 0 : auto PRemoteSpellcheckEngineChild::DeallocSubtree() -> void
358 : {
359 0 : }
360 :
361 0 : auto PRemoteSpellcheckEngineChild::Write(
362 : const PRemoteSpellcheckEngineChild* v__,
363 : Message* msg__,
364 : bool nullable__) -> void
365 : {
366 : int32_t id;
367 0 : if ((!(v__))) {
368 0 : if ((!(nullable__))) {
369 0 : FatalError("NULL actor value passed to non-nullable param");
370 : }
371 0 : id = 0;
372 : }
373 : else {
374 0 : id = (v__)->Id();
375 0 : if ((1) == (id)) {
376 0 : FatalError("actor has been |delete|d");
377 : }
378 : }
379 :
380 0 : Write(id, msg__);
381 0 : }
382 :
383 0 : auto PRemoteSpellcheckEngineChild::Read(
384 : PRemoteSpellcheckEngineChild** v__,
385 : const Message* msg__,
386 : PickleIterator* iter__,
387 : bool nullable__) -> bool
388 : {
389 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PRemoteSpellcheckEngine", PRemoteSpellcheckEngineMsgStart);
390 0 : if ((actor).isNothing()) {
391 0 : return false;
392 : }
393 :
394 0 : (*(v__)) = static_cast<PRemoteSpellcheckEngineChild*>((actor).value());
395 0 : return true;
396 : }
397 :
398 :
399 :
400 : } // namespace mozilla
|