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