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