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