/work/obj-fuzz/ipc/ipdl/PExternalHelperAppChild.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/PExternalHelperAppChild.h" |
8 | | |
9 | | #include "mozilla/dom/PBrowserChild.h" |
10 | | #include "mozilla/dom/PContentChild.h" |
11 | | #include "mozilla/net/PChannelDiverterChild.h" |
12 | | |
13 | | #include "nsIFile.h" |
14 | | #include "GeckoProfiler.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | |
20 | | auto PExternalHelperAppChild::Recv__delete__() -> mozilla::ipc::IPCResult |
21 | 0 | { |
22 | 0 | return IPC_OK(); |
23 | 0 | } |
24 | | |
25 | | auto PExternalHelperAppChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
26 | 0 | { |
27 | 0 | } |
28 | | |
29 | | MOZ_IMPLICIT PExternalHelperAppChild::PExternalHelperAppChild() : |
30 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
31 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
32 | 0 | { |
33 | 0 | MOZ_COUNT_CTOR(PExternalHelperAppChild); |
34 | 0 | } |
35 | | |
36 | | PExternalHelperAppChild::~PExternalHelperAppChild() |
37 | 0 | { |
38 | 0 | MOZ_COUNT_DTOR(PExternalHelperAppChild); |
39 | 0 | } |
40 | | |
41 | | auto PExternalHelperAppChild::Manager() const -> PContentChild* |
42 | 0 | { |
43 | 0 | return static_cast<PContentChild*>(IProtocol::Manager()); |
44 | 0 | } |
45 | | |
46 | | auto PExternalHelperAppChild::SendOnStartRequest( |
47 | | const nsCString& entityID, |
48 | | PBrowserChild* windowContext) -> bool |
49 | 0 | { |
50 | 0 | IPC::Message* msg__ = PExternalHelperApp::Msg_OnStartRequest(Id()); |
51 | 0 |
|
52 | 0 | WriteIPDLParam(msg__, this, entityID); |
53 | 0 | // Sentinel = 'entityID' |
54 | 0 | (msg__)->WriteSentinel(245743354); |
55 | 0 | MOZ_RELEASE_ASSERT(windowContext, "NULL actor value passed to non-nullable param"); |
56 | 0 | WriteIPDLParam(msg__, this, windowContext); |
57 | 0 | // Sentinel = 'windowContext' |
58 | 0 | (msg__)->WriteSentinel(3429612728); |
59 | 0 |
|
60 | 0 |
|
61 | 0 |
|
62 | 0 |
|
63 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
64 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
65 | 0 | } |
66 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnStartRequest", OTHER); |
67 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
68 | 0 | mozilla::ipc::LogicError("Transition error"); |
69 | 0 | } |
70 | 0 |
|
71 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
72 | 0 | return sendok__; |
73 | 0 | } |
74 | | |
75 | | auto PExternalHelperAppChild::SendOnDataAvailable( |
76 | | const nsCString& data, |
77 | | const uint64_t& offset, |
78 | | const uint32_t& count) -> bool |
79 | 0 | { |
80 | 0 | IPC::Message* msg__ = PExternalHelperApp::Msg_OnDataAvailable(Id()); |
81 | 0 |
|
82 | 0 | WriteIPDLParam(msg__, this, data); |
83 | 0 | // Sentinel = 'data' |
84 | 0 | (msg__)->WriteSentinel(843352540); |
85 | 0 | WriteIPDLParam(msg__, this, offset); |
86 | 0 | // Sentinel = 'offset' |
87 | 0 | (msg__)->WriteSentinel(1369947863); |
88 | 0 | WriteIPDLParam(msg__, this, count); |
89 | 0 | // Sentinel = 'count' |
90 | 0 | (msg__)->WriteSentinel(2126421856); |
91 | 0 |
|
92 | 0 |
|
93 | 0 |
|
94 | 0 |
|
95 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
96 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
97 | 0 | } |
98 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnDataAvailable", OTHER); |
99 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
100 | 0 | mozilla::ipc::LogicError("Transition error"); |
101 | 0 | } |
102 | 0 |
|
103 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
104 | 0 | return sendok__; |
105 | 0 | } |
106 | | |
107 | | auto PExternalHelperAppChild::SendOnStopRequest(const nsresult& code) -> bool |
108 | 0 | { |
109 | 0 | IPC::Message* msg__ = PExternalHelperApp::Msg_OnStopRequest(Id()); |
110 | 0 |
|
111 | 0 | WriteIPDLParam(msg__, this, code); |
112 | 0 | // Sentinel = 'code' |
113 | 0 | (msg__)->WriteSentinel(3318913027); |
114 | 0 |
|
115 | 0 |
|
116 | 0 |
|
117 | 0 |
|
118 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
119 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
120 | 0 | } |
121 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnStopRequest", OTHER); |
122 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
123 | 0 | mozilla::ipc::LogicError("Transition error"); |
124 | 0 | } |
125 | 0 |
|
126 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
127 | 0 | return sendok__; |
128 | 0 | } |
129 | | |
130 | | auto PExternalHelperAppChild::SendDivertToParentUsing( |
131 | | PChannelDiverterChild* diverter, |
132 | | PBrowserChild* windowContext) -> bool |
133 | 0 | { |
134 | 0 | IPC::Message* msg__ = PExternalHelperApp::Msg_DivertToParentUsing(Id()); |
135 | 0 |
|
136 | 0 | MOZ_RELEASE_ASSERT(diverter, "NULL actor value passed to non-nullable param"); |
137 | 0 | WriteIPDLParam(msg__, this, diverter); |
138 | 0 | // Sentinel = 'diverter' |
139 | 0 | (msg__)->WriteSentinel(1783530825); |
140 | 0 | MOZ_RELEASE_ASSERT(windowContext, "NULL actor value passed to non-nullable param"); |
141 | 0 | WriteIPDLParam(msg__, this, windowContext); |
142 | 0 | // Sentinel = 'windowContext' |
143 | 0 | (msg__)->WriteSentinel(3429612728); |
144 | 0 |
|
145 | 0 |
|
146 | 0 |
|
147 | 0 |
|
148 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
149 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
150 | 0 | } |
151 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_DivertToParentUsing", OTHER); |
152 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
153 | 0 | mozilla::ipc::LogicError("Transition error"); |
154 | 0 | } |
155 | 0 |
|
156 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
157 | 0 | return sendok__; |
158 | 0 | } |
159 | | |
160 | | auto PExternalHelperAppChild::RemoveManagee( |
161 | | int32_t aProtocolId, |
162 | | IProtocol* aListener) -> void |
163 | 0 | { |
164 | 0 | FatalError("unreached"); |
165 | 0 | return; |
166 | 0 | } |
167 | | |
168 | | auto PExternalHelperAppChild::OnMessageReceived(const Message& msg__) -> PExternalHelperAppChild::Result |
169 | 0 | { |
170 | 0 | switch ((msg__).type()) { |
171 | 0 | case PExternalHelperApp::Msg_Cancel__ID: |
172 | 0 | { |
173 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
174 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
175 | 0 | } |
176 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_Cancel", OTHER); |
177 | 0 |
|
178 | 0 | PickleIterator iter__(msg__); |
179 | 0 | nsresult aStatus; |
180 | 0 |
|
181 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aStatus)))))) { |
182 | 0 | FatalError("Error deserializing 'nsresult'"); |
183 | 0 | return MsgValueError; |
184 | 0 | } |
185 | 0 | // Sentinel = 'aStatus' |
186 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 236002576)))) { |
187 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'"); |
188 | 0 | return MsgValueError; |
189 | 0 | } |
190 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
191 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
192 | 0 | FatalError("Transition error"); |
193 | 0 | return MsgValueError; |
194 | 0 | } |
195 | 0 | if ((!(RecvCancel(aStatus)))) { |
196 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
197 | 0 | // Error handled in mozilla::ipc::IPCResult |
198 | 0 | return MsgProcessingError; |
199 | 0 | } |
200 | 0 | |
201 | 0 | return MsgProcessed; |
202 | 0 | } |
203 | 0 | case PExternalHelperApp::Msg___delete____ID: |
204 | 0 | { |
205 | 0 | if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppChild")) { |
206 | 0 | mozilla::ipc::LogMessageForProtocol("PExternalHelperAppChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
207 | 0 | } |
208 | 0 | AUTO_PROFILER_LABEL("PExternalHelperApp::Msg___delete__", OTHER); |
209 | 0 |
|
210 | 0 | PickleIterator iter__(msg__); |
211 | 0 | PExternalHelperAppChild* actor; |
212 | 0 |
|
213 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
214 | 0 | FatalError("Error deserializing 'PExternalHelperAppChild'"); |
215 | 0 | return MsgValueError; |
216 | 0 | } |
217 | 0 | if ((!((*((&(actor))))))) { |
218 | 0 | FatalError("Error deserializing 'PExternalHelperAppChild'"); |
219 | 0 | return MsgValueError; |
220 | 0 | } |
221 | 0 | // Sentinel = 'actor' |
222 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
223 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PExternalHelperAppChild'"); |
224 | 0 | return MsgValueError; |
225 | 0 | } |
226 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
227 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
228 | 0 | FatalError("Transition error"); |
229 | 0 | return MsgValueError; |
230 | 0 | } |
231 | 0 | if ((!(Recv__delete__()))) { |
232 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
233 | 0 | // Error handled in mozilla::ipc::IPCResult |
234 | 0 | return MsgProcessingError; |
235 | 0 | } |
236 | 0 | |
237 | 0 | |
238 | 0 | IProtocol* mgr = (actor)->Manager(); |
239 | 0 | (actor)->DestroySubtree(Deletion); |
240 | 0 | (actor)->DeallocSubtree(); |
241 | 0 | (mgr)->RemoveManagee(PExternalHelperAppMsgStart, actor); |
242 | 0 |
|
243 | 0 | return MsgProcessed; |
244 | 0 | } |
245 | 0 | default: |
246 | 0 | { |
247 | 0 | return MsgNotKnown; |
248 | 0 | } |
249 | 0 | } |
250 | 0 | } |
251 | | |
252 | | auto PExternalHelperAppChild::OnMessageReceived( |
253 | | const Message& msg__, |
254 | | Message*& reply__) -> PExternalHelperAppChild::Result |
255 | 0 | { |
256 | 0 | return MsgNotKnown; |
257 | 0 | } |
258 | | |
259 | | auto PExternalHelperAppChild::OnCallReceived( |
260 | | const Message& msg__, |
261 | | Message*& reply__) -> PExternalHelperAppChild::Result |
262 | 0 | { |
263 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
264 | 0 | return MsgNotKnown; |
265 | 0 | } |
266 | | |
267 | | auto PExternalHelperAppChild::GetProtocolTypeId() -> int32_t |
268 | 0 | { |
269 | 0 | return PExternalHelperAppMsgStart; |
270 | 0 | } |
271 | | |
272 | | auto PExternalHelperAppChild::DestroySubtree(ActorDestroyReason why) -> void |
273 | 0 | { |
274 | 0 | // Unregister from our manager. |
275 | 0 | Unregister(Id()); |
276 | 0 |
|
277 | 0 | // Reject owning pending responses. |
278 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
279 | 0 |
|
280 | 0 | // Finally, destroy "us". |
281 | 0 | ActorDestroy(why); |
282 | 0 | } |
283 | | |
284 | | auto PExternalHelperAppChild::DeallocSubtree() -> void |
285 | 0 | { |
286 | 0 | } |
287 | | |
288 | | |
289 | | |
290 | | } // namespace dom |
291 | | } // namespace mozilla |
292 | | namespace mozilla { |
293 | | namespace ipc { |
294 | | auto IPDLParamTraits<mozilla::dom::PExternalHelperAppChild>::Write( |
295 | | IPC::Message* aMsg, |
296 | | mozilla::ipc::IProtocol* aActor, |
297 | | const paramType& aVar) -> void |
298 | 0 | { |
299 | 0 | int32_t id; |
300 | 0 | if ((!(aVar))) { |
301 | 0 | id = 0; |
302 | 0 | } |
303 | 0 | else { |
304 | 0 | id = (aVar)->Id(); |
305 | 0 | if ((1) == (id)) { |
306 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
307 | 0 | } |
308 | 0 | } |
309 | 0 | WriteIPDLParam(aMsg, aActor, id); |
310 | 0 | } |
311 | | |
312 | | auto IPDLParamTraits<mozilla::dom::PExternalHelperAppChild>::Read( |
313 | | const IPC::Message* aMsg, |
314 | | PickleIterator* aIter, |
315 | | mozilla::ipc::IProtocol* aActor, |
316 | | paramType* aVar) -> bool |
317 | 0 | { |
318 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PExternalHelperApp", PExternalHelperAppMsgStart); |
319 | 0 | if ((actor).isNothing()) { |
320 | 0 | return false; |
321 | 0 | } |
322 | 0 | |
323 | 0 | (*(aVar)) = static_cast<mozilla::dom::PExternalHelperAppChild*>((actor).value()); |
324 | 0 | return true; |
325 | 0 | } |
326 | | |
327 | | } // namespace ipc |
328 | | } // namespace mozilla |