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