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