Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/loader/PScriptCacheParent.h"
8 : #include "mozilla/TimeStamp.h"
9 :
10 : #include "mozilla/dom/PContentParent.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace loader {
17 :
18 :
19 0 : auto PScriptCacheParent::Recv__delete__(nsTArray<ScriptData>&& scripts) -> mozilla::ipc::IPCResult
20 : {
21 0 : return IPC_OK();
22 : }
23 :
24 :
25 2 : MOZ_IMPLICIT PScriptCacheParent::PScriptCacheParent() :
26 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
27 2 : mState(PScriptCache::__Dead)
28 : {
29 2 : MOZ_COUNT_CTOR(PScriptCacheParent);
30 2 : }
31 :
32 2 : PScriptCacheParent::~PScriptCacheParent()
33 : {
34 1 : MOZ_COUNT_DTOR(PScriptCacheParent);
35 1 : }
36 :
37 2 : auto PScriptCacheParent::Manager() const -> PContentParent*
38 : {
39 2 : return static_cast<PContentParent*>(IProtocol::Manager());
40 : }
41 :
42 0 : auto PScriptCacheParent::RemoveManagee(
43 : int32_t aProtocolId,
44 : ProtocolBase* aListener) -> void
45 : {
46 0 : FatalError("unreached");
47 0 : return;
48 : }
49 :
50 1 : auto PScriptCacheParent::OnMessageReceived(const Message& msg__) -> PScriptCacheParent::Result
51 : {
52 1 : switch ((msg__).type()) {
53 : case PScriptCache::Msg___delete____ID:
54 : {
55 1 : if (mozilla::ipc::LoggingEnabledFor("PScriptCacheParent")) {
56 0 : mozilla::ipc::LogMessageForProtocol("PScriptCacheParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
57 : }
58 2 : AUTO_PROFILER_LABEL("PScriptCache::Msg___delete__", OTHER);
59 :
60 1 : PickleIterator iter__(msg__);
61 : PScriptCacheParent* actor;
62 2 : nsTArray<ScriptData> scripts;
63 :
64 1 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
65 0 : FatalError("Error deserializing 'PScriptCacheParent'");
66 0 : return MsgValueError;
67 : }
68 : // Sentinel = 'actor'
69 1 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
70 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PScriptCacheParent'");
71 0 : return MsgValueError;
72 : }
73 1 : if ((!(Read((&(scripts)), (&(msg__)), (&(iter__)))))) {
74 0 : FatalError("Error deserializing 'nsTArray'");
75 0 : return MsgValueError;
76 : }
77 : // Sentinel = 'scripts'
78 1 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3650495447)))) {
79 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
80 0 : return MsgValueError;
81 : }
82 1 : (msg__).EndRead(iter__, (msg__).type());
83 1 : PScriptCache::Transition(PScriptCache::Msg___delete____ID, (&(mState)));
84 1 : if ((!(Recv__delete__(mozilla::Move(scripts))))) {
85 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
86 : // Error handled in mozilla::ipc::IPCResult
87 0 : return MsgProcessingError;
88 : }
89 :
90 :
91 1 : IProtocol* mgr = (actor)->Manager();
92 1 : (actor)->DestroySubtree(Deletion);
93 1 : (actor)->DeallocSubtree();
94 1 : (mgr)->RemoveManagee(PScriptCacheMsgStart, actor);
95 :
96 1 : return MsgProcessed;
97 : }
98 : default:
99 : {
100 0 : return MsgNotKnown;
101 : }
102 : }
103 : }
104 :
105 0 : auto PScriptCacheParent::OnMessageReceived(
106 : const Message& msg__,
107 : Message*& reply__) -> PScriptCacheParent::Result
108 : {
109 0 : return MsgNotKnown;
110 : }
111 :
112 0 : auto PScriptCacheParent::OnCallReceived(
113 : const Message& msg__,
114 : Message*& reply__) -> PScriptCacheParent::Result
115 : {
116 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
117 : return MsgNotKnown;
118 : }
119 :
120 1 : auto PScriptCacheParent::GetProtocolTypeId() -> int32_t
121 : {
122 1 : return PScriptCacheMsgStart;
123 : }
124 :
125 0 : auto PScriptCacheParent::ProtocolName() const -> const char*
126 : {
127 0 : return "PScriptCacheParent";
128 : }
129 :
130 1 : auto PScriptCacheParent::DestroySubtree(ActorDestroyReason why) -> void
131 : {
132 : // Unregister from our manager.
133 1 : Unregister(Id());
134 :
135 : // Reject owning pending promises.
136 1 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
137 :
138 : // Finally, destroy "us".
139 1 : ActorDestroy(why);
140 1 : }
141 :
142 1 : auto PScriptCacheParent::DeallocSubtree() -> void
143 : {
144 1 : }
145 :
146 0 : auto PScriptCacheParent::Write(
147 : const PScriptCacheParent* v__,
148 : Message* msg__,
149 : bool nullable__) -> void
150 : {
151 : int32_t id;
152 0 : if ((!(v__))) {
153 0 : if ((!(nullable__))) {
154 0 : FatalError("NULL actor value passed to non-nullable param");
155 : }
156 0 : id = 0;
157 : }
158 : else {
159 0 : id = (v__)->Id();
160 0 : if ((1) == (id)) {
161 0 : FatalError("actor has been |delete|d");
162 : }
163 : }
164 :
165 0 : Write(id, msg__);
166 0 : }
167 :
168 1 : auto PScriptCacheParent::Read(
169 : PScriptCacheParent** v__,
170 : const Message* msg__,
171 : PickleIterator* iter__,
172 : bool nullable__) -> bool
173 : {
174 2 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PScriptCache", PScriptCacheMsgStart);
175 1 : if ((actor).isNothing()) {
176 0 : return false;
177 : }
178 :
179 1 : (*(v__)) = static_cast<PScriptCacheParent*>((actor).value());
180 1 : return true;
181 : }
182 :
183 0 : auto PScriptCacheParent::Write(
184 : const nsTArray<ScriptData>& v__,
185 : Message* msg__) -> void
186 : {
187 0 : uint32_t length = (v__).Length();
188 0 : Write(length, msg__);
189 : // Sentinel = ('length', 'ScriptData[]')
190 0 : (msg__)->WriteSentinel(808572254);
191 :
192 0 : for (auto& elem : v__) {
193 0 : Write(elem, msg__);
194 : // Sentinel = 'ScriptData[]'
195 0 : (msg__)->WriteSentinel(2208750817);
196 : }
197 0 : }
198 :
199 1 : auto PScriptCacheParent::Read(
200 : nsTArray<ScriptData>* v__,
201 : const Message* msg__,
202 : PickleIterator* iter__) -> bool
203 : {
204 2 : nsTArray<ScriptData> fa;
205 : uint32_t length;
206 1 : if ((!(Read((&(length)), msg__, iter__)))) {
207 0 : mozilla::ipc::ArrayLengthReadError("ScriptData[]");
208 0 : return false;
209 : }
210 : // Sentinel = ('length', 'ScriptData[]')
211 1 : if ((!((msg__)->ReadSentinel(iter__, 808572254)))) {
212 0 : mozilla::ipc::SentinelReadError("ScriptData[]");
213 0 : return false;
214 : }
215 :
216 1 : ScriptData* elems = (fa).AppendElements(length);
217 43 : for (uint32_t i = 0; (i) < (length); (++(i))) {
218 42 : if ((!(Read((&(elems[i])), msg__, iter__)))) {
219 0 : FatalError("Error deserializing 'ScriptData[i]'");
220 0 : return false;
221 : }
222 : // Sentinel = 'ScriptData[]'
223 42 : if ((!((msg__)->ReadSentinel(iter__, 2208750817)))) {
224 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ScriptData[i]'");
225 0 : return false;
226 : }
227 : }
228 1 : (v__)->SwapElements(fa);
229 1 : return true;
230 : }
231 :
232 0 : auto PScriptCacheParent::Write(
233 : const ScriptData& v__,
234 : Message* msg__) -> void
235 : {
236 0 : Write((v__).url(), msg__);
237 : // Sentinel = 'url'
238 0 : (msg__)->WriteSentinel(1453210600);
239 0 : Write((v__).cachePath(), msg__);
240 : // Sentinel = 'cachePath'
241 0 : (msg__)->WriteSentinel(1354325578);
242 0 : Write((v__).loadTime(), msg__);
243 : // Sentinel = 'loadTime'
244 0 : (msg__)->WriteSentinel(60950471);
245 0 : Write((v__).xdrData(), msg__);
246 : // Sentinel = 'xdrData'
247 0 : (msg__)->WriteSentinel(1812663329);
248 0 : }
249 :
250 42 : auto PScriptCacheParent::Read(
251 : ScriptData* v__,
252 : const Message* msg__,
253 : PickleIterator* iter__) -> bool
254 : {
255 42 : if ((!(Read((&((v__)->url())), msg__, iter__)))) {
256 0 : FatalError("Error deserializing 'url' (nsCString) member of 'ScriptData'");
257 0 : return false;
258 : }
259 : // Sentinel = 'url'
260 42 : if ((!((msg__)->ReadSentinel(iter__, 1453210600)))) {
261 0 : mozilla::ipc::SentinelReadError("Error deserializing 'url' (nsCString) member of 'ScriptData'");
262 0 : return false;
263 : }
264 42 : if ((!(Read((&((v__)->cachePath())), msg__, iter__)))) {
265 0 : FatalError("Error deserializing 'cachePath' (nsCString) member of 'ScriptData'");
266 0 : return false;
267 : }
268 : // Sentinel = 'cachePath'
269 42 : if ((!((msg__)->ReadSentinel(iter__, 1354325578)))) {
270 0 : mozilla::ipc::SentinelReadError("Error deserializing 'cachePath' (nsCString) member of 'ScriptData'");
271 0 : return false;
272 : }
273 42 : if ((!(Read((&((v__)->loadTime())), msg__, iter__)))) {
274 0 : FatalError("Error deserializing 'loadTime' (TimeStamp) member of 'ScriptData'");
275 0 : return false;
276 : }
277 : // Sentinel = 'loadTime'
278 42 : if ((!((msg__)->ReadSentinel(iter__, 60950471)))) {
279 0 : mozilla::ipc::SentinelReadError("Error deserializing 'loadTime' (TimeStamp) member of 'ScriptData'");
280 0 : return false;
281 : }
282 42 : if ((!(Read((&((v__)->xdrData())), msg__, iter__)))) {
283 0 : FatalError("Error deserializing 'xdrData' (uint8_t[]) member of 'ScriptData'");
284 0 : return false;
285 : }
286 : // Sentinel = 'xdrData'
287 42 : if ((!((msg__)->ReadSentinel(iter__, 1812663329)))) {
288 0 : mozilla::ipc::SentinelReadError("Error deserializing 'xdrData' (uint8_t[]) member of 'ScriptData'");
289 0 : return false;
290 : }
291 42 : return true;
292 : }
293 :
294 :
295 :
296 : } // namespace loader
297 : } // namespace mozilla
|