Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsParent.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 indexedDB {
17 :
18 :
19 :
20 0 : MOZ_IMPLICIT PBackgroundIndexedDBUtilsParent::PBackgroundIndexedDBUtilsParent() :
21 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
22 0 : mState(PBackgroundIndexedDBUtils::__Dead)
23 : {
24 0 : MOZ_COUNT_CTOR(PBackgroundIndexedDBUtilsParent);
25 0 : }
26 :
27 0 : PBackgroundIndexedDBUtilsParent::~PBackgroundIndexedDBUtilsParent()
28 : {
29 0 : MOZ_COUNT_DTOR(PBackgroundIndexedDBUtilsParent);
30 0 : }
31 :
32 0 : auto PBackgroundIndexedDBUtilsParent::Manager() const -> PBackgroundParent*
33 : {
34 0 : return static_cast<PBackgroundParent*>(IProtocol::Manager());
35 : }
36 :
37 0 : auto PBackgroundIndexedDBUtilsParent::Send__delete__(PBackgroundIndexedDBUtilsParent* actor) -> bool
38 : {
39 0 : if ((!(actor))) {
40 0 : return false;
41 : }
42 :
43 0 : IPC::Message* msg__ = PBackgroundIndexedDBUtils::Msg___delete__((actor)->Id());
44 :
45 0 : (actor)->Write(actor, msg__, false);
46 : // Sentinel = 'actor'
47 0 : (msg__)->WriteSentinel(875202478);
48 :
49 :
50 :
51 0 : if (mozilla::ipc::LoggingEnabledFor("PBackgroundIndexedDBUtilsParent")) {
52 0 : mozilla::ipc::LogMessageForProtocol("PBackgroundIndexedDBUtilsParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
53 : }
54 0 : AUTO_PROFILER_LABEL("PBackgroundIndexedDBUtils::Msg___delete__", OTHER);
55 0 : PBackgroundIndexedDBUtils::Transition(PBackgroundIndexedDBUtils::Msg___delete____ID, (&((actor)->mState)));
56 :
57 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
58 :
59 0 : IProtocol* mgr = (actor)->Manager();
60 0 : (actor)->DestroySubtree(Deletion);
61 0 : (actor)->DeallocSubtree();
62 0 : (mgr)->RemoveManagee(PBackgroundIndexedDBUtilsMsgStart, actor);
63 0 : return sendok__;
64 : }
65 :
66 0 : auto PBackgroundIndexedDBUtilsParent::RemoveManagee(
67 : int32_t aProtocolId,
68 : ProtocolBase* aListener) -> void
69 : {
70 0 : FatalError("unreached");
71 0 : return;
72 : }
73 :
74 0 : auto PBackgroundIndexedDBUtilsParent::OnMessageReceived(const Message& msg__) -> PBackgroundIndexedDBUtilsParent::Result
75 : {
76 0 : switch ((msg__).type()) {
77 : case PBackgroundIndexedDBUtils::Msg_DeleteMe__ID:
78 : {
79 0 : if (mozilla::ipc::LoggingEnabledFor("PBackgroundIndexedDBUtilsParent")) {
80 0 : mozilla::ipc::LogMessageForProtocol("PBackgroundIndexedDBUtilsParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
81 : }
82 0 : AUTO_PROFILER_LABEL("PBackgroundIndexedDBUtils::Msg_DeleteMe", OTHER);
83 :
84 0 : PBackgroundIndexedDBUtils::Transition(PBackgroundIndexedDBUtils::Msg_DeleteMe__ID, (&(mState)));
85 0 : if ((!(RecvDeleteMe()))) {
86 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
87 : // Error handled in mozilla::ipc::IPCResult
88 0 : return MsgProcessingError;
89 : }
90 :
91 0 : return MsgProcessed;
92 : }
93 : case PBackgroundIndexedDBUtils::Reply___delete____ID:
94 : {
95 0 : return MsgProcessed;
96 : }
97 : default:
98 : {
99 0 : return MsgNotKnown;
100 : }
101 : }
102 : }
103 :
104 0 : auto PBackgroundIndexedDBUtilsParent::OnMessageReceived(
105 : const Message& msg__,
106 : Message*& reply__) -> PBackgroundIndexedDBUtilsParent::Result
107 : {
108 0 : switch ((msg__).type()) {
109 : case PBackgroundIndexedDBUtils::Msg_GetFileReferences__ID:
110 : {
111 0 : if (mozilla::ipc::LoggingEnabledFor("PBackgroundIndexedDBUtilsParent")) {
112 0 : mozilla::ipc::LogMessageForProtocol("PBackgroundIndexedDBUtilsParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
113 : }
114 0 : AUTO_PROFILER_LABEL("PBackgroundIndexedDBUtils::Msg_GetFileReferences", OTHER);
115 :
116 0 : PickleIterator iter__(msg__);
117 : PersistenceType persistenceType;
118 0 : nsCString origin;
119 0 : nsString databaseName;
120 : int64_t fileId;
121 :
122 0 : if ((!(Read((&(persistenceType)), (&(msg__)), (&(iter__)))))) {
123 0 : FatalError("Error deserializing 'PersistenceType'");
124 0 : return MsgValueError;
125 : }
126 : // Sentinel = 'persistenceType'
127 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3316493122)))) {
128 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PersistenceType'");
129 0 : return MsgValueError;
130 : }
131 0 : if ((!(Read((&(origin)), (&(msg__)), (&(iter__)))))) {
132 0 : FatalError("Error deserializing 'nsCString'");
133 0 : return MsgValueError;
134 : }
135 : // Sentinel = 'origin'
136 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1429924608)))) {
137 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
138 0 : return MsgValueError;
139 : }
140 0 : if ((!(Read((&(databaseName)), (&(msg__)), (&(iter__)))))) {
141 0 : FatalError("Error deserializing 'nsString'");
142 0 : return MsgValueError;
143 : }
144 : // Sentinel = 'databaseName'
145 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1222949718)))) {
146 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
147 0 : return MsgValueError;
148 : }
149 0 : if ((!(Read((&(fileId)), (&(msg__)), (&(iter__)))))) {
150 0 : FatalError("Error deserializing 'int64_t'");
151 0 : return MsgValueError;
152 : }
153 : // Sentinel = 'fileId'
154 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 108004447)))) {
155 0 : mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
156 0 : return MsgValueError;
157 : }
158 0 : (msg__).EndRead(iter__, (msg__).type());
159 0 : PBackgroundIndexedDBUtils::Transition(PBackgroundIndexedDBUtils::Msg_GetFileReferences__ID, (&(mState)));
160 0 : int32_t id__ = Id();
161 : int32_t refCnt;
162 : int32_t dBRefCnt;
163 : int32_t sliceRefCnt;
164 : bool result;
165 0 : if ((!(RecvGetFileReferences(mozilla::Move(persistenceType), mozilla::Move(origin), mozilla::Move(databaseName), mozilla::Move(fileId), (&(refCnt)), (&(dBRefCnt)), (&(sliceRefCnt)), (&(result)))))) {
166 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
167 : // Error handled in mozilla::ipc::IPCResult
168 0 : return MsgProcessingError;
169 : }
170 :
171 0 : reply__ = PBackgroundIndexedDBUtils::Reply_GetFileReferences(id__);
172 :
173 0 : Write(refCnt, reply__);
174 : // Sentinel = 'refCnt'
175 0 : (reply__)->WriteSentinel(326667022);
176 0 : Write(dBRefCnt, reply__);
177 : // Sentinel = 'dBRefCnt'
178 0 : (reply__)->WriteSentinel(1396066710);
179 0 : Write(sliceRefCnt, reply__);
180 : // Sentinel = 'sliceRefCnt'
181 0 : (reply__)->WriteSentinel(3457261421);
182 0 : Write(result, reply__);
183 : // Sentinel = 'result'
184 0 : (reply__)->WriteSentinel(3991766165);
185 0 : (reply__)->set_sync();
186 0 : (reply__)->set_reply();
187 :
188 0 : if (mozilla::ipc::LoggingEnabledFor("PBackgroundIndexedDBUtilsParent")) {
189 0 : mozilla::ipc::LogMessageForProtocol("PBackgroundIndexedDBUtilsParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
190 : }
191 0 : return MsgProcessed;
192 : }
193 : default:
194 : {
195 0 : return MsgNotKnown;
196 : }
197 : }
198 : }
199 :
200 0 : auto PBackgroundIndexedDBUtilsParent::OnCallReceived(
201 : const Message& msg__,
202 : Message*& reply__) -> PBackgroundIndexedDBUtilsParent::Result
203 : {
204 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
205 : return MsgNotKnown;
206 : }
207 :
208 0 : auto PBackgroundIndexedDBUtilsParent::GetProtocolTypeId() -> int32_t
209 : {
210 0 : return PBackgroundIndexedDBUtilsMsgStart;
211 : }
212 :
213 0 : auto PBackgroundIndexedDBUtilsParent::ProtocolName() const -> const char*
214 : {
215 0 : return "PBackgroundIndexedDBUtilsParent";
216 : }
217 :
218 0 : auto PBackgroundIndexedDBUtilsParent::DestroySubtree(ActorDestroyReason why) -> void
219 : {
220 : // Unregister from our manager.
221 0 : Unregister(Id());
222 :
223 : // Reject owning pending promises.
224 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
225 :
226 : // Finally, destroy "us".
227 0 : ActorDestroy(why);
228 0 : }
229 :
230 0 : auto PBackgroundIndexedDBUtilsParent::DeallocSubtree() -> void
231 : {
232 0 : }
233 :
234 0 : auto PBackgroundIndexedDBUtilsParent::Write(
235 : const PBackgroundIndexedDBUtilsParent* v__,
236 : Message* msg__,
237 : bool nullable__) -> void
238 : {
239 : int32_t id;
240 0 : if ((!(v__))) {
241 0 : if ((!(nullable__))) {
242 0 : FatalError("NULL actor value passed to non-nullable param");
243 : }
244 0 : id = 0;
245 : }
246 : else {
247 0 : id = (v__)->Id();
248 0 : if ((1) == (id)) {
249 0 : FatalError("actor has been |delete|d");
250 : }
251 : }
252 :
253 0 : Write(id, msg__);
254 0 : }
255 :
256 0 : auto PBackgroundIndexedDBUtilsParent::Read(
257 : PBackgroundIndexedDBUtilsParent** v__,
258 : const Message* msg__,
259 : PickleIterator* iter__,
260 : bool nullable__) -> bool
261 : {
262 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PBackgroundIndexedDBUtils", PBackgroundIndexedDBUtilsMsgStart);
263 0 : if ((actor).isNothing()) {
264 0 : return false;
265 : }
266 :
267 0 : (*(v__)) = static_cast<PBackgroundIndexedDBUtilsParent*>((actor).value());
268 0 : return true;
269 : }
270 :
271 :
272 :
273 : } // namespace indexedDB
274 : } // namespace dom
275 : } // namespace mozilla
|