Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPStorageChild.h"
8 :
9 : #include "mozilla/gmp/PGMPChild.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace gmp {
16 :
17 :
18 0 : auto PGMPStorageChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19 : {
20 0 : }
21 :
22 0 : MOZ_IMPLICIT PGMPStorageChild::PGMPStorageChild() :
23 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24 0 : mState(PGMPStorage::__Dead)
25 : {
26 0 : MOZ_COUNT_CTOR(PGMPStorageChild);
27 0 : }
28 :
29 0 : PGMPStorageChild::~PGMPStorageChild()
30 : {
31 0 : MOZ_COUNT_DTOR(PGMPStorageChild);
32 0 : }
33 :
34 0 : auto PGMPStorageChild::Manager() const -> PGMPChild*
35 : {
36 0 : return static_cast<PGMPChild*>(IProtocol::Manager());
37 : }
38 :
39 0 : auto PGMPStorageChild::SendOpen(const nsCString& aRecordName) -> bool
40 : {
41 0 : IPC::Message* msg__ = PGMPStorage::Msg_Open(Id());
42 :
43 0 : Write(aRecordName, msg__);
44 : // Sentinel = 'aRecordName'
45 0 : (msg__)->WriteSentinel(4079879416);
46 :
47 :
48 :
49 :
50 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
51 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
52 : }
53 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_Open", OTHER);
54 0 : PGMPStorage::Transition(PGMPStorage::Msg_Open__ID, (&(mState)));
55 :
56 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
57 0 : return sendok__;
58 : }
59 :
60 0 : auto PGMPStorageChild::SendRead(const nsCString& aRecordName) -> bool
61 : {
62 0 : IPC::Message* msg__ = PGMPStorage::Msg_Read(Id());
63 :
64 0 : Write(aRecordName, msg__);
65 : // Sentinel = 'aRecordName'
66 0 : (msg__)->WriteSentinel(4079879416);
67 :
68 :
69 :
70 :
71 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
72 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
73 : }
74 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_Read", OTHER);
75 0 : PGMPStorage::Transition(PGMPStorage::Msg_Read__ID, (&(mState)));
76 :
77 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
78 0 : return sendok__;
79 : }
80 :
81 0 : auto PGMPStorageChild::SendWrite(
82 : const nsCString& aRecordName,
83 : const nsTArray<uint8_t>& aBytes) -> bool
84 : {
85 0 : IPC::Message* msg__ = PGMPStorage::Msg_Write(Id());
86 :
87 0 : Write(aRecordName, msg__);
88 : // Sentinel = 'aRecordName'
89 0 : (msg__)->WriteSentinel(4079879416);
90 0 : Write(aBytes, msg__);
91 : // Sentinel = 'aBytes'
92 0 : (msg__)->WriteSentinel(4118068628);
93 :
94 :
95 :
96 :
97 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
98 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
99 : }
100 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_Write", OTHER);
101 0 : PGMPStorage::Transition(PGMPStorage::Msg_Write__ID, (&(mState)));
102 :
103 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
104 0 : return sendok__;
105 : }
106 :
107 0 : auto PGMPStorageChild::SendClose(const nsCString& aRecordName) -> bool
108 : {
109 0 : IPC::Message* msg__ = PGMPStorage::Msg_Close(Id());
110 :
111 0 : Write(aRecordName, msg__);
112 : // Sentinel = 'aRecordName'
113 0 : (msg__)->WriteSentinel(4079879416);
114 :
115 :
116 :
117 :
118 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
119 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
120 : }
121 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_Close", OTHER);
122 0 : PGMPStorage::Transition(PGMPStorage::Msg_Close__ID, (&(mState)));
123 :
124 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
125 0 : return sendok__;
126 : }
127 :
128 0 : auto PGMPStorageChild::Send__delete__(PGMPStorageChild* actor) -> bool
129 : {
130 0 : if ((!(actor))) {
131 0 : return false;
132 : }
133 :
134 0 : IPC::Message* msg__ = PGMPStorage::Msg___delete__((actor)->Id());
135 :
136 0 : (actor)->Write(actor, msg__, false);
137 : // Sentinel = 'actor'
138 0 : (msg__)->WriteSentinel(875202478);
139 :
140 :
141 :
142 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
143 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
144 : }
145 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg___delete__", OTHER);
146 0 : PGMPStorage::Transition(PGMPStorage::Msg___delete____ID, (&((actor)->mState)));
147 :
148 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
149 :
150 0 : IProtocol* mgr = (actor)->Manager();
151 0 : (actor)->DestroySubtree(Deletion);
152 0 : (actor)->DeallocSubtree();
153 0 : (mgr)->RemoveManagee(PGMPStorageMsgStart, actor);
154 0 : return sendok__;
155 : }
156 :
157 0 : auto PGMPStorageChild::RemoveManagee(
158 : int32_t aProtocolId,
159 : ProtocolBase* aListener) -> void
160 : {
161 0 : FatalError("unreached");
162 0 : return;
163 : }
164 :
165 0 : auto PGMPStorageChild::OnMessageReceived(const Message& msg__) -> PGMPStorageChild::Result
166 : {
167 0 : switch ((msg__).type()) {
168 : case PGMPStorage::Msg_OpenComplete__ID:
169 : {
170 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
171 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
172 : }
173 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_OpenComplete", OTHER);
174 :
175 0 : PickleIterator iter__(msg__);
176 0 : nsCString aRecordName;
177 : GMPErr aStatus;
178 :
179 0 : if ((!(Read((&(aRecordName)), (&(msg__)), (&(iter__)))))) {
180 0 : FatalError("Error deserializing 'nsCString'");
181 0 : return MsgValueError;
182 : }
183 : // Sentinel = 'aRecordName'
184 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4079879416)))) {
185 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
186 0 : return MsgValueError;
187 : }
188 0 : if ((!(Read((&(aStatus)), (&(msg__)), (&(iter__)))))) {
189 0 : FatalError("Error deserializing 'GMPErr'");
190 0 : return MsgValueError;
191 : }
192 : // Sentinel = 'aStatus'
193 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 236002576)))) {
194 0 : mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
195 0 : return MsgValueError;
196 : }
197 0 : (msg__).EndRead(iter__, (msg__).type());
198 0 : PGMPStorage::Transition(PGMPStorage::Msg_OpenComplete__ID, (&(mState)));
199 0 : if ((!(RecvOpenComplete(mozilla::Move(aRecordName), mozilla::Move(aStatus))))) {
200 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
201 : // Error handled in mozilla::ipc::IPCResult
202 0 : return MsgProcessingError;
203 : }
204 :
205 0 : return MsgProcessed;
206 : }
207 : case PGMPStorage::Msg_ReadComplete__ID:
208 : {
209 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
210 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
211 : }
212 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_ReadComplete", OTHER);
213 :
214 0 : PickleIterator iter__(msg__);
215 0 : nsCString aRecordName;
216 : GMPErr aStatus;
217 0 : nsTArray<uint8_t> aBytes;
218 :
219 0 : if ((!(Read((&(aRecordName)), (&(msg__)), (&(iter__)))))) {
220 0 : FatalError("Error deserializing 'nsCString'");
221 0 : return MsgValueError;
222 : }
223 : // Sentinel = 'aRecordName'
224 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4079879416)))) {
225 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
226 0 : return MsgValueError;
227 : }
228 0 : if ((!(Read((&(aStatus)), (&(msg__)), (&(iter__)))))) {
229 0 : FatalError("Error deserializing 'GMPErr'");
230 0 : return MsgValueError;
231 : }
232 : // Sentinel = 'aStatus'
233 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 236002576)))) {
234 0 : mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
235 0 : return MsgValueError;
236 : }
237 0 : if ((!(Read((&(aBytes)), (&(msg__)), (&(iter__)))))) {
238 0 : FatalError("Error deserializing 'nsTArray'");
239 0 : return MsgValueError;
240 : }
241 : // Sentinel = 'aBytes'
242 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4118068628)))) {
243 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
244 0 : return MsgValueError;
245 : }
246 0 : (msg__).EndRead(iter__, (msg__).type());
247 0 : PGMPStorage::Transition(PGMPStorage::Msg_ReadComplete__ID, (&(mState)));
248 0 : if ((!(RecvReadComplete(mozilla::Move(aRecordName), mozilla::Move(aStatus), mozilla::Move(aBytes))))) {
249 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
250 : // Error handled in mozilla::ipc::IPCResult
251 0 : return MsgProcessingError;
252 : }
253 :
254 0 : return MsgProcessed;
255 : }
256 : case PGMPStorage::Msg_WriteComplete__ID:
257 : {
258 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
259 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
260 : }
261 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_WriteComplete", OTHER);
262 :
263 0 : PickleIterator iter__(msg__);
264 0 : nsCString aRecordName;
265 : GMPErr aStatus;
266 :
267 0 : if ((!(Read((&(aRecordName)), (&(msg__)), (&(iter__)))))) {
268 0 : FatalError("Error deserializing 'nsCString'");
269 0 : return MsgValueError;
270 : }
271 : // Sentinel = 'aRecordName'
272 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4079879416)))) {
273 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
274 0 : return MsgValueError;
275 : }
276 0 : if ((!(Read((&(aStatus)), (&(msg__)), (&(iter__)))))) {
277 0 : FatalError("Error deserializing 'GMPErr'");
278 0 : return MsgValueError;
279 : }
280 : // Sentinel = 'aStatus'
281 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 236002576)))) {
282 0 : mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
283 0 : return MsgValueError;
284 : }
285 0 : (msg__).EndRead(iter__, (msg__).type());
286 0 : PGMPStorage::Transition(PGMPStorage::Msg_WriteComplete__ID, (&(mState)));
287 0 : if ((!(RecvWriteComplete(mozilla::Move(aRecordName), mozilla::Move(aStatus))))) {
288 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
289 : // Error handled in mozilla::ipc::IPCResult
290 0 : return MsgProcessingError;
291 : }
292 :
293 0 : return MsgProcessed;
294 : }
295 : case PGMPStorage::Msg_Shutdown__ID:
296 : {
297 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPStorageChild")) {
298 0 : mozilla::ipc::LogMessageForProtocol("PGMPStorageChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
299 : }
300 0 : AUTO_PROFILER_LABEL("PGMPStorage::Msg_Shutdown", OTHER);
301 :
302 0 : PGMPStorage::Transition(PGMPStorage::Msg_Shutdown__ID, (&(mState)));
303 0 : if ((!(RecvShutdown()))) {
304 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
305 : // Error handled in mozilla::ipc::IPCResult
306 0 : return MsgProcessingError;
307 : }
308 :
309 0 : return MsgProcessed;
310 : }
311 : case PGMPStorage::Reply___delete____ID:
312 : {
313 0 : return MsgProcessed;
314 : }
315 : default:
316 : {
317 0 : return MsgNotKnown;
318 : }
319 : }
320 : }
321 :
322 0 : auto PGMPStorageChild::OnMessageReceived(
323 : const Message& msg__,
324 : Message*& reply__) -> PGMPStorageChild::Result
325 : {
326 0 : return MsgNotKnown;
327 : }
328 :
329 0 : auto PGMPStorageChild::OnCallReceived(
330 : const Message& msg__,
331 : Message*& reply__) -> PGMPStorageChild::Result
332 : {
333 0 : return MsgNotKnown;
334 : }
335 :
336 0 : auto PGMPStorageChild::GetProtocolTypeId() -> int32_t
337 : {
338 0 : return PGMPStorageMsgStart;
339 : }
340 :
341 0 : auto PGMPStorageChild::ProtocolName() const -> const char*
342 : {
343 0 : return "PGMPStorageChild";
344 : }
345 :
346 0 : auto PGMPStorageChild::DestroySubtree(ActorDestroyReason why) -> void
347 : {
348 : // Unregister from our manager.
349 0 : Unregister(Id());
350 :
351 : // Reject owning pending promises.
352 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
353 :
354 : // Finally, destroy "us".
355 0 : ActorDestroy(why);
356 0 : }
357 :
358 0 : auto PGMPStorageChild::DeallocSubtree() -> void
359 : {
360 0 : }
361 :
362 0 : auto PGMPStorageChild::Write(
363 : const PGMPStorageChild* v__,
364 : Message* msg__,
365 : bool nullable__) -> void
366 : {
367 : int32_t id;
368 0 : if ((!(v__))) {
369 0 : if ((!(nullable__))) {
370 0 : FatalError("NULL actor value passed to non-nullable param");
371 : }
372 0 : id = 0;
373 : }
374 : else {
375 0 : id = (v__)->Id();
376 0 : if ((1) == (id)) {
377 0 : FatalError("actor has been |delete|d");
378 : }
379 : }
380 :
381 0 : Write(id, msg__);
382 0 : }
383 :
384 0 : auto PGMPStorageChild::Read(
385 : PGMPStorageChild** v__,
386 : const Message* msg__,
387 : PickleIterator* iter__,
388 : bool nullable__) -> bool
389 : {
390 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPStorage", PGMPStorageMsgStart);
391 0 : if ((actor).isNothing()) {
392 0 : return false;
393 : }
394 :
395 0 : (*(v__)) = static_cast<PGMPStorageChild*>((actor).value());
396 0 : return true;
397 : }
398 :
399 :
400 :
401 : } // namespace gmp
402 : } // namespace mozilla
|