/work/obj-fuzz/ipc/ipdl/PHandlerServiceChild.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/dom/PHandlerServiceChild.h" |
8 | | |
9 | | #include "mozilla/dom/PContentChild.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | |
18 | | auto PHandlerServiceChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | MOZ_IMPLICIT PHandlerServiceChild::PHandlerServiceChild() : |
23 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
24 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
25 | 0 | { |
26 | 0 | MOZ_COUNT_CTOR(PHandlerServiceChild); |
27 | 0 | } |
28 | | |
29 | | PHandlerServiceChild::~PHandlerServiceChild() |
30 | 0 | { |
31 | 0 | MOZ_COUNT_DTOR(PHandlerServiceChild); |
32 | 0 | } |
33 | | |
34 | | auto PHandlerServiceChild::Manager() const -> PContentChild* |
35 | 0 | { |
36 | 0 | return static_cast<PContentChild*>(IProtocol::Manager()); |
37 | 0 | } |
38 | | |
39 | | auto PHandlerServiceChild::SendFillHandlerInfo( |
40 | | const HandlerInfo& aHandlerInfoData, |
41 | | const nsCString& aOverrideType, |
42 | | HandlerInfo* handlerInfoData) -> bool |
43 | 0 | { |
44 | 0 | IPC::Message* msg__ = PHandlerService::Msg_FillHandlerInfo(Id()); |
45 | 0 |
|
46 | 0 | WriteIPDLParam(msg__, this, aHandlerInfoData); |
47 | 0 | // Sentinel = 'aHandlerInfoData' |
48 | 0 | (msg__)->WriteSentinel(818541303); |
49 | 0 | WriteIPDLParam(msg__, this, aOverrideType); |
50 | 0 | // Sentinel = 'aOverrideType' |
51 | 0 | (msg__)->WriteSentinel(923193756); |
52 | 0 |
|
53 | 0 |
|
54 | 0 |
|
55 | 0 | Message reply__; |
56 | 0 |
|
57 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
58 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
59 | 0 | } |
60 | 0 | AUTO_PROFILER_LABEL("PHandlerService::Msg_FillHandlerInfo", OTHER); |
61 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
62 | 0 | mozilla::ipc::LogicError("Transition error"); |
63 | 0 | } |
64 | 0 |
|
65 | 0 | bool sendok__; |
66 | 0 | { |
67 | 0 | AUTO_PROFILER_TRACING("IPC", "PHandlerService::Msg_FillHandlerInfo"); |
68 | 0 | sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__))); |
69 | 0 | } |
70 | 0 | if ((!(sendok__))) { |
71 | 0 | return false; |
72 | 0 | } |
73 | 0 | |
74 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
75 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
76 | 0 | } |
77 | 0 |
|
78 | 0 | PickleIterator iter__(reply__); |
79 | 0 |
|
80 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, handlerInfoData)))) { |
81 | 0 | FatalError("Error deserializing 'HandlerInfo'"); |
82 | 0 | return false; |
83 | 0 | } |
84 | 0 | // Sentinel = 'handlerInfoData' |
85 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 49315047)))) { |
86 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'HandlerInfo'"); |
87 | 0 | return false; |
88 | 0 | } |
89 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
90 | 0 |
|
91 | 0 | return true; |
92 | 0 | } |
93 | | |
94 | | auto PHandlerServiceChild::SendExistsForProtocol( |
95 | | const nsCString& aProtocolScheme, |
96 | | bool* exists) -> bool |
97 | 0 | { |
98 | 0 | IPC::Message* msg__ = PHandlerService::Msg_ExistsForProtocol(Id()); |
99 | 0 |
|
100 | 0 | WriteIPDLParam(msg__, this, aProtocolScheme); |
101 | 0 | // Sentinel = 'aProtocolScheme' |
102 | 0 | (msg__)->WriteSentinel(1503147699); |
103 | 0 |
|
104 | 0 |
|
105 | 0 |
|
106 | 0 | Message reply__; |
107 | 0 |
|
108 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
109 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
110 | 0 | } |
111 | 0 | AUTO_PROFILER_LABEL("PHandlerService::Msg_ExistsForProtocol", OTHER); |
112 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
113 | 0 | mozilla::ipc::LogicError("Transition error"); |
114 | 0 | } |
115 | 0 |
|
116 | 0 | bool sendok__; |
117 | 0 | { |
118 | 0 | AUTO_PROFILER_TRACING("IPC", "PHandlerService::Msg_ExistsForProtocol"); |
119 | 0 | sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__))); |
120 | 0 | } |
121 | 0 | if ((!(sendok__))) { |
122 | 0 | return false; |
123 | 0 | } |
124 | 0 | |
125 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
126 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
127 | 0 | } |
128 | 0 |
|
129 | 0 | PickleIterator iter__(reply__); |
130 | 0 |
|
131 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, exists)))) { |
132 | 0 | FatalError("Error deserializing 'bool'"); |
133 | 0 | return false; |
134 | 0 | } |
135 | 0 | // Sentinel = 'exists' |
136 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 351132806)))) { |
137 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
138 | 0 | return false; |
139 | 0 | } |
140 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
141 | 0 |
|
142 | 0 | return true; |
143 | 0 | } |
144 | | |
145 | | auto PHandlerServiceChild::SendExists( |
146 | | const HandlerInfo& aHandlerInfo, |
147 | | bool* exists) -> bool |
148 | 0 | { |
149 | 0 | IPC::Message* msg__ = PHandlerService::Msg_Exists(Id()); |
150 | 0 |
|
151 | 0 | WriteIPDLParam(msg__, this, aHandlerInfo); |
152 | 0 | // Sentinel = 'aHandlerInfo' |
153 | 0 | (msg__)->WriteSentinel(1227275979); |
154 | 0 |
|
155 | 0 |
|
156 | 0 |
|
157 | 0 | Message reply__; |
158 | 0 |
|
159 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
160 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
161 | 0 | } |
162 | 0 | AUTO_PROFILER_LABEL("PHandlerService::Msg_Exists", OTHER); |
163 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
164 | 0 | mozilla::ipc::LogicError("Transition error"); |
165 | 0 | } |
166 | 0 |
|
167 | 0 | bool sendok__; |
168 | 0 | { |
169 | 0 | AUTO_PROFILER_TRACING("IPC", "PHandlerService::Msg_Exists"); |
170 | 0 | sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__))); |
171 | 0 | } |
172 | 0 | if ((!(sendok__))) { |
173 | 0 | return false; |
174 | 0 | } |
175 | 0 | |
176 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
177 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
178 | 0 | } |
179 | 0 |
|
180 | 0 | PickleIterator iter__(reply__); |
181 | 0 |
|
182 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, exists)))) { |
183 | 0 | FatalError("Error deserializing 'bool'"); |
184 | 0 | return false; |
185 | 0 | } |
186 | 0 | // Sentinel = 'exists' |
187 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 351132806)))) { |
188 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
189 | 0 | return false; |
190 | 0 | } |
191 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
192 | 0 |
|
193 | 0 | return true; |
194 | 0 | } |
195 | | |
196 | | auto PHandlerServiceChild::SendGetTypeFromExtension( |
197 | | const nsCString& aFileExtension, |
198 | | nsCString* type) -> bool |
199 | 0 | { |
200 | 0 | IPC::Message* msg__ = PHandlerService::Msg_GetTypeFromExtension(Id()); |
201 | 0 |
|
202 | 0 | WriteIPDLParam(msg__, this, aFileExtension); |
203 | 0 | // Sentinel = 'aFileExtension' |
204 | 0 | (msg__)->WriteSentinel(2406627352); |
205 | 0 |
|
206 | 0 |
|
207 | 0 |
|
208 | 0 | Message reply__; |
209 | 0 |
|
210 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
211 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
212 | 0 | } |
213 | 0 | AUTO_PROFILER_LABEL("PHandlerService::Msg_GetTypeFromExtension", OTHER); |
214 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
215 | 0 | mozilla::ipc::LogicError("Transition error"); |
216 | 0 | } |
217 | 0 |
|
218 | 0 | bool sendok__; |
219 | 0 | { |
220 | 0 | AUTO_PROFILER_TRACING("IPC", "PHandlerService::Msg_GetTypeFromExtension"); |
221 | 0 | sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__))); |
222 | 0 | } |
223 | 0 | if ((!(sendok__))) { |
224 | 0 | return false; |
225 | 0 | } |
226 | 0 | |
227 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
228 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
229 | 0 | } |
230 | 0 |
|
231 | 0 | PickleIterator iter__(reply__); |
232 | 0 |
|
233 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, type)))) { |
234 | 0 | FatalError("Error deserializing 'nsCString'"); |
235 | 0 | return false; |
236 | 0 | } |
237 | 0 | // Sentinel = 'type' |
238 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 2982068540)))) { |
239 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
240 | 0 | return false; |
241 | 0 | } |
242 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
243 | 0 |
|
244 | 0 | return true; |
245 | 0 | } |
246 | | |
247 | | auto PHandlerServiceChild::Send__delete__(PHandlerServiceChild* actor) -> bool |
248 | 0 | { |
249 | 0 | if ((!(actor))) { |
250 | 0 | return false; |
251 | 0 | } |
252 | 0 | |
253 | 0 | IPC::Message* msg__ = PHandlerService::Msg___delete__((actor)->Id()); |
254 | 0 |
|
255 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
256 | 0 | WriteIPDLParam(msg__, actor, actor); |
257 | 0 | // Sentinel = 'actor' |
258 | 0 | (msg__)->WriteSentinel(875202478); |
259 | 0 |
|
260 | 0 |
|
261 | 0 |
|
262 | 0 | if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) { |
263 | 0 | mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
264 | 0 | } |
265 | 0 | AUTO_PROFILER_LABEL("PHandlerService::Msg___delete__", OTHER); |
266 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
267 | 0 | mozilla::ipc::LogicError("Transition error"); |
268 | 0 | } |
269 | 0 |
|
270 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
271 | 0 |
|
272 | 0 | IProtocol* mgr = (actor)->Manager(); |
273 | 0 | (actor)->DestroySubtree(Deletion); |
274 | 0 | (actor)->DeallocSubtree(); |
275 | 0 | (mgr)->RemoveManagee(PHandlerServiceMsgStart, actor); |
276 | 0 | return sendok__; |
277 | 0 | } |
278 | | |
279 | | auto PHandlerServiceChild::RemoveManagee( |
280 | | int32_t aProtocolId, |
281 | | IProtocol* aListener) -> void |
282 | 0 | { |
283 | 0 | FatalError("unreached"); |
284 | 0 | return; |
285 | 0 | } |
286 | | |
287 | | auto PHandlerServiceChild::OnMessageReceived(const Message& msg__) -> PHandlerServiceChild::Result |
288 | | { |
289 | | switch ((msg__).type()) { |
290 | | case PHandlerService::Reply___delete____ID: |
291 | | { |
292 | | return MsgProcessed; |
293 | | } |
294 | | default: |
295 | | { |
296 | | return MsgNotKnown; |
297 | | } |
298 | | } |
299 | | } |
300 | | |
301 | | auto PHandlerServiceChild::OnMessageReceived( |
302 | | const Message& msg__, |
303 | | Message*& reply__) -> PHandlerServiceChild::Result |
304 | 0 | { |
305 | 0 | return MsgNotKnown; |
306 | 0 | } |
307 | | |
308 | | auto PHandlerServiceChild::OnCallReceived( |
309 | | const Message& msg__, |
310 | | Message*& reply__) -> PHandlerServiceChild::Result |
311 | 0 | { |
312 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
313 | 0 | return MsgNotKnown; |
314 | 0 | } |
315 | | |
316 | | auto PHandlerServiceChild::GetProtocolTypeId() -> int32_t |
317 | 0 | { |
318 | 0 | return PHandlerServiceMsgStart; |
319 | 0 | } |
320 | | |
321 | | auto PHandlerServiceChild::DestroySubtree(ActorDestroyReason why) -> void |
322 | 0 | { |
323 | 0 | // Unregister from our manager. |
324 | 0 | Unregister(Id()); |
325 | 0 |
|
326 | 0 | // Reject owning pending responses. |
327 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
328 | 0 |
|
329 | 0 | // Finally, destroy "us". |
330 | 0 | ActorDestroy(why); |
331 | 0 | } |
332 | | |
333 | | auto PHandlerServiceChild::DeallocSubtree() -> void |
334 | 0 | { |
335 | 0 | } |
336 | | |
337 | | |
338 | | |
339 | | } // namespace dom |
340 | | } // namespace mozilla |
341 | | namespace mozilla { |
342 | | namespace ipc { |
343 | | auto IPDLParamTraits<mozilla::dom::PHandlerServiceChild>::Write( |
344 | | IPC::Message* aMsg, |
345 | | mozilla::ipc::IProtocol* aActor, |
346 | | const paramType& aVar) -> void |
347 | 0 | { |
348 | 0 | int32_t id; |
349 | 0 | if ((!(aVar))) { |
350 | 0 | id = 0; |
351 | 0 | } |
352 | 0 | else { |
353 | 0 | id = (aVar)->Id(); |
354 | 0 | if ((1) == (id)) { |
355 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
356 | 0 | } |
357 | 0 | } |
358 | 0 | WriteIPDLParam(aMsg, aActor, id); |
359 | 0 | } |
360 | | |
361 | | auto IPDLParamTraits<mozilla::dom::PHandlerServiceChild>::Read( |
362 | | const IPC::Message* aMsg, |
363 | | PickleIterator* aIter, |
364 | | mozilla::ipc::IProtocol* aActor, |
365 | | paramType* aVar) -> bool |
366 | 0 | { |
367 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PHandlerService", PHandlerServiceMsgStart); |
368 | 0 | if ((actor).isNothing()) { |
369 | 0 | return false; |
370 | 0 | } |
371 | 0 | |
372 | 0 | (*(aVar)) = static_cast<mozilla::dom::PHandlerServiceChild*>((actor).value()); |
373 | 0 | return true; |
374 | 0 | } |
375 | | |
376 | | } // namespace ipc |
377 | | } // namespace mozilla |