Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/ipc/PTestShellChild.h"
8 :
9 : #include "mozilla/dom/PContentChild.h"
10 : #include "mozilla/ipc/PTestShellCommandChild.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace ipc {
17 :
18 :
19 0 : auto PTestShellChild::Recv__delete__() -> mozilla::ipc::IPCResult
20 : {
21 0 : return IPC_OK();
22 : }
23 :
24 0 : auto PTestShellChild::RecvPTestShellCommandConstructor(
25 : PTestShellCommandChild* actor,
26 : const nsString& aCommand) -> mozilla::ipc::IPCResult
27 : {
28 0 : return IPC_OK();
29 : }
30 :
31 0 : auto PTestShellChild::ActorDestroy(ActorDestroyReason aWhy) -> void
32 : {
33 0 : }
34 :
35 0 : MOZ_IMPLICIT PTestShellChild::PTestShellChild() :
36 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
37 0 : mState(PTestShell::__Dead)
38 : {
39 0 : MOZ_COUNT_CTOR(PTestShellChild);
40 0 : }
41 :
42 0 : PTestShellChild::~PTestShellChild()
43 : {
44 0 : MOZ_COUNT_DTOR(PTestShellChild);
45 0 : }
46 :
47 0 : auto PTestShellChild::Manager() const -> PContentChild*
48 : {
49 0 : return static_cast<PContentChild*>(IProtocol::Manager());
50 : }
51 :
52 0 : auto PTestShellChild::ManagedPTestShellCommandChild(nsTArray<PTestShellCommandChild*>& aArr) const -> void
53 : {
54 0 : (mManagedPTestShellCommandChild).ToArray(aArr);
55 0 : }
56 :
57 0 : auto PTestShellChild::ManagedPTestShellCommandChild() const -> const ManagedContainer<PTestShellCommandChild>&
58 : {
59 0 : return mManagedPTestShellCommandChild;
60 : }
61 :
62 0 : auto PTestShellChild::RemoveManagee(
63 : int32_t aProtocolId,
64 : ProtocolBase* aListener) -> void
65 : {
66 0 : switch (aProtocolId) {
67 : case PTestShellCommandMsgStart:
68 : {
69 0 : PTestShellCommandChild* actor = static_cast<PTestShellCommandChild*>(aListener);
70 0 : auto& container = mManagedPTestShellCommandChild;
71 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
72 :
73 0 : (container).RemoveEntry(actor);
74 0 : DeallocPTestShellCommandChild(actor);
75 0 : return;
76 : }
77 : default:
78 : {
79 0 : FatalError("unreached");
80 0 : return;
81 : }
82 : }
83 : }
84 :
85 0 : auto PTestShellChild::OnMessageReceived(const Message& msg__) -> PTestShellChild::Result
86 : {
87 0 : switch ((msg__).type()) {
88 : case PTestShell::Msg___delete____ID:
89 : {
90 0 : if (mozilla::ipc::LoggingEnabledFor("PTestShellChild")) {
91 0 : mozilla::ipc::LogMessageForProtocol("PTestShellChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
92 : }
93 0 : AUTO_PROFILER_LABEL("PTestShell::Msg___delete__", OTHER);
94 :
95 0 : PickleIterator iter__(msg__);
96 : PTestShellChild* actor;
97 :
98 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
99 0 : FatalError("Error deserializing 'PTestShellChild'");
100 0 : return MsgValueError;
101 : }
102 : // Sentinel = 'actor'
103 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
104 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PTestShellChild'");
105 0 : return MsgValueError;
106 : }
107 0 : (msg__).EndRead(iter__, (msg__).type());
108 0 : PTestShell::Transition(PTestShell::Msg___delete____ID, (&(mState)));
109 0 : if ((!(Recv__delete__()))) {
110 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
111 : // Error handled in mozilla::ipc::IPCResult
112 0 : return MsgProcessingError;
113 : }
114 :
115 :
116 0 : IProtocol* mgr = (actor)->Manager();
117 0 : (actor)->DestroySubtree(Deletion);
118 0 : (actor)->DeallocSubtree();
119 0 : (mgr)->RemoveManagee(PTestShellMsgStart, actor);
120 :
121 0 : return MsgProcessed;
122 : }
123 : case PTestShell::Msg_ExecuteCommand__ID:
124 : {
125 0 : if (mozilla::ipc::LoggingEnabledFor("PTestShellChild")) {
126 0 : mozilla::ipc::LogMessageForProtocol("PTestShellChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
127 : }
128 0 : AUTO_PROFILER_LABEL("PTestShell::Msg_ExecuteCommand", OTHER);
129 :
130 0 : PickleIterator iter__(msg__);
131 0 : nsString aCommand;
132 :
133 0 : if ((!(Read((&(aCommand)), (&(msg__)), (&(iter__)))))) {
134 0 : FatalError("Error deserializing 'nsString'");
135 0 : return MsgValueError;
136 : }
137 : // Sentinel = 'aCommand'
138 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4067353464)))) {
139 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
140 0 : return MsgValueError;
141 : }
142 0 : (msg__).EndRead(iter__, (msg__).type());
143 0 : PTestShell::Transition(PTestShell::Msg_ExecuteCommand__ID, (&(mState)));
144 0 : if ((!(RecvExecuteCommand(mozilla::Move(aCommand))))) {
145 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
146 : // Error handled in mozilla::ipc::IPCResult
147 0 : return MsgProcessingError;
148 : }
149 :
150 0 : return MsgProcessed;
151 : }
152 : case PTestShell::Msg_PTestShellCommandConstructor__ID:
153 : {
154 0 : if (mozilla::ipc::LoggingEnabledFor("PTestShellChild")) {
155 0 : mozilla::ipc::LogMessageForProtocol("PTestShellChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
156 : }
157 0 : AUTO_PROFILER_LABEL("PTestShell::Msg_PTestShellCommandConstructor", OTHER);
158 :
159 0 : PickleIterator iter__(msg__);
160 : ActorHandle handle__;
161 : PTestShellCommandChild* actor;
162 0 : nsString aCommand;
163 :
164 0 : if ((!(Read((&(handle__)), (&(msg__)), (&(iter__)))))) {
165 0 : FatalError("Error deserializing 'ActorHandle'");
166 0 : return MsgValueError;
167 : }
168 : // Sentinel = 'actor'
169 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
170 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
171 0 : return MsgValueError;
172 : }
173 0 : if ((!(Read((&(aCommand)), (&(msg__)), (&(iter__)))))) {
174 0 : FatalError("Error deserializing 'nsString'");
175 0 : return MsgValueError;
176 : }
177 : // Sentinel = 'aCommand'
178 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4067353464)))) {
179 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
180 0 : return MsgValueError;
181 : }
182 0 : (msg__).EndRead(iter__, (msg__).type());
183 0 : PTestShell::Transition(PTestShell::Msg_PTestShellCommandConstructor__ID, (&(mState)));
184 0 : actor = AllocPTestShellCommandChild(aCommand);
185 0 : if ((!(actor))) {
186 0 : NS_WARNING("Error constructing actor PTestShellCommandChild");
187 0 : return MsgValueError;
188 : }
189 0 : (actor)->SetManager(this);
190 0 : RegisterID(actor, (handle__).mId);
191 0 : (actor)->SetIPCChannel(GetIPCChannel());
192 0 : (mManagedPTestShellCommandChild).PutEntry(actor);
193 0 : (actor)->mState = mozilla::ipc::PTestShellCommand::__Start;
194 :
195 0 : if ((!(RecvPTestShellCommandConstructor(mozilla::Move(actor), mozilla::Move(aCommand))))) {
196 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
197 : // Error handled in mozilla::ipc::IPCResult
198 0 : return MsgProcessingError;
199 : }
200 :
201 0 : return MsgProcessed;
202 : }
203 : default:
204 : {
205 0 : return MsgNotKnown;
206 : }
207 : }
208 : }
209 :
210 0 : auto PTestShellChild::OnMessageReceived(
211 : const Message& msg__,
212 : Message*& reply__) -> PTestShellChild::Result
213 : {
214 0 : return MsgNotKnown;
215 : }
216 :
217 0 : auto PTestShellChild::OnCallReceived(
218 : const Message& msg__,
219 : Message*& reply__) -> PTestShellChild::Result
220 : {
221 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
222 : return MsgNotKnown;
223 : }
224 :
225 0 : auto PTestShellChild::GetProtocolTypeId() -> int32_t
226 : {
227 0 : return PTestShellMsgStart;
228 : }
229 :
230 0 : auto PTestShellChild::ProtocolName() const -> const char*
231 : {
232 0 : return "PTestShellChild";
233 : }
234 :
235 0 : auto PTestShellChild::DestroySubtree(ActorDestroyReason why) -> void
236 : {
237 : // Unregister from our manager.
238 0 : Unregister(Id());
239 :
240 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
241 :
242 : {
243 : // Recursively shutting down PTestShellCommand kids
244 0 : nsTArray<PTestShellCommandChild*> kids;
245 : // Accumulate kids into a stable structure to iterate over
246 0 : ManagedPTestShellCommandChild(kids);
247 0 : for (auto& kid : kids) {
248 : // Guarding against a child removing a sibling from the list during the iteration.
249 0 : if ((mManagedPTestShellCommandChild).Contains(kid)) {
250 0 : (kid)->DestroySubtree(subtreewhy);
251 : }
252 : }
253 : }
254 :
255 : // Reject owning pending promises.
256 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
257 :
258 : // Finally, destroy "us".
259 0 : ActorDestroy(why);
260 0 : }
261 :
262 0 : auto PTestShellChild::DeallocSubtree() -> void
263 : {
264 : {
265 : // Recursively deleting PTestShellCommand kids
266 0 : for (auto iter = (mManagedPTestShellCommandChild).Iter(); (!((iter).Done())); (iter).Next()) {
267 0 : (((iter).Get())->GetKey())->DeallocSubtree();
268 : }
269 :
270 0 : for (auto iter = (mManagedPTestShellCommandChild).Iter(); (!((iter).Done())); (iter).Next()) {
271 0 : DeallocPTestShellCommandChild(((iter).Get())->GetKey());
272 : }
273 0 : (mManagedPTestShellCommandChild).Clear();
274 : }
275 0 : }
276 :
277 0 : auto PTestShellChild::Write(
278 : const PTestShellChild* v__,
279 : Message* msg__,
280 : bool nullable__) -> void
281 : {
282 : int32_t id;
283 0 : if ((!(v__))) {
284 0 : if ((!(nullable__))) {
285 0 : FatalError("NULL actor value passed to non-nullable param");
286 : }
287 0 : id = 0;
288 : }
289 : else {
290 0 : id = (v__)->Id();
291 0 : if ((1) == (id)) {
292 0 : FatalError("actor has been |delete|d");
293 : }
294 : }
295 :
296 0 : Write(id, msg__);
297 0 : }
298 :
299 0 : auto PTestShellChild::Read(
300 : PTestShellChild** v__,
301 : const Message* msg__,
302 : PickleIterator* iter__,
303 : bool nullable__) -> bool
304 : {
305 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PTestShell", PTestShellMsgStart);
306 0 : if ((actor).isNothing()) {
307 0 : return false;
308 : }
309 :
310 0 : (*(v__)) = static_cast<PTestShellChild*>((actor).value());
311 0 : return true;
312 : }
313 :
314 0 : auto PTestShellChild::Write(
315 : const PTestShellCommandChild* v__,
316 : Message* msg__,
317 : bool nullable__) -> void
318 : {
319 : int32_t id;
320 0 : if ((!(v__))) {
321 0 : if ((!(nullable__))) {
322 0 : FatalError("NULL actor value passed to non-nullable param");
323 : }
324 0 : id = 0;
325 : }
326 : else {
327 0 : id = (v__)->Id();
328 0 : if ((1) == (id)) {
329 0 : FatalError("actor has been |delete|d");
330 : }
331 : }
332 :
333 0 : Write(id, msg__);
334 0 : }
335 :
336 0 : auto PTestShellChild::Read(
337 : PTestShellCommandChild** v__,
338 : const Message* msg__,
339 : PickleIterator* iter__,
340 : bool nullable__) -> bool
341 : {
342 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PTestShellCommand", PTestShellCommandMsgStart);
343 0 : if ((actor).isNothing()) {
344 0 : return false;
345 : }
346 :
347 0 : (*(v__)) = static_cast<PTestShellCommandChild*>((actor).value());
348 0 : return true;
349 : }
350 :
351 :
352 :
353 : } // namespace ipc
354 : } // namespace mozilla
|