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