Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/psm/PPSMContentDownloaderParent.h"
8 :
9 : #include "mozilla/dom/PContentParent.h"
10 : #include "mozilla/net/PChannelDiverterParent.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace psm {
17 :
18 :
19 :
20 0 : MOZ_IMPLICIT PPSMContentDownloaderParent::PPSMContentDownloaderParent() :
21 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
22 0 : mState(PPSMContentDownloader::__Dead)
23 : {
24 0 : MOZ_COUNT_CTOR(PPSMContentDownloaderParent);
25 0 : }
26 :
27 0 : PPSMContentDownloaderParent::~PPSMContentDownloaderParent()
28 : {
29 0 : MOZ_COUNT_DTOR(PPSMContentDownloaderParent);
30 0 : }
31 :
32 0 : auto PPSMContentDownloaderParent::Manager() const -> PContentParent*
33 : {
34 0 : return static_cast<PContentParent*>(IProtocol::Manager());
35 : }
36 :
37 0 : auto PPSMContentDownloaderParent::Send__delete__(PPSMContentDownloaderParent* actor) -> bool
38 : {
39 0 : if ((!(actor))) {
40 0 : return false;
41 : }
42 :
43 0 : IPC::Message* msg__ = PPSMContentDownloader::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("PPSMContentDownloaderParent")) {
52 0 : mozilla::ipc::LogMessageForProtocol("PPSMContentDownloaderParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
53 : }
54 0 : AUTO_PROFILER_LABEL("PPSMContentDownloader::Msg___delete__", OTHER);
55 0 : PPSMContentDownloader::Transition(PPSMContentDownloader::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(PPSMContentDownloaderMsgStart, actor);
63 0 : return sendok__;
64 : }
65 :
66 0 : auto PPSMContentDownloaderParent::RemoveManagee(
67 : int32_t aProtocolId,
68 : ProtocolBase* aListener) -> void
69 : {
70 0 : FatalError("unreached");
71 0 : return;
72 : }
73 :
74 0 : auto PPSMContentDownloaderParent::OnMessageReceived(const Message& msg__) -> PPSMContentDownloaderParent::Result
75 : {
76 0 : switch ((msg__).type()) {
77 : case PPSMContentDownloader::Msg_OnStartRequest__ID:
78 : {
79 0 : if (mozilla::ipc::LoggingEnabledFor("PPSMContentDownloaderParent")) {
80 0 : mozilla::ipc::LogMessageForProtocol("PPSMContentDownloaderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
81 : }
82 0 : AUTO_PROFILER_LABEL("PPSMContentDownloader::Msg_OnStartRequest", OTHER);
83 :
84 0 : PickleIterator iter__(msg__);
85 : uint32_t contentLength;
86 :
87 0 : if ((!(Read((&(contentLength)), (&(msg__)), (&(iter__)))))) {
88 0 : FatalError("Error deserializing 'uint32_t'");
89 0 : return MsgValueError;
90 : }
91 : // Sentinel = 'contentLength'
92 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2619011242)))) {
93 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
94 0 : return MsgValueError;
95 : }
96 0 : (msg__).EndRead(iter__, (msg__).type());
97 0 : PPSMContentDownloader::Transition(PPSMContentDownloader::Msg_OnStartRequest__ID, (&(mState)));
98 0 : if ((!(RecvOnStartRequest(mozilla::Move(contentLength))))) {
99 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
100 : // Error handled in mozilla::ipc::IPCResult
101 0 : return MsgProcessingError;
102 : }
103 :
104 0 : return MsgProcessed;
105 : }
106 : case PPSMContentDownloader::Msg_OnDataAvailable__ID:
107 : {
108 0 : if (mozilla::ipc::LoggingEnabledFor("PPSMContentDownloaderParent")) {
109 0 : mozilla::ipc::LogMessageForProtocol("PPSMContentDownloaderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
110 : }
111 0 : AUTO_PROFILER_LABEL("PPSMContentDownloader::Msg_OnDataAvailable", OTHER);
112 :
113 0 : PickleIterator iter__(msg__);
114 0 : nsCString data;
115 : uint64_t offset;
116 : uint32_t count;
117 :
118 0 : if ((!(Read((&(data)), (&(msg__)), (&(iter__)))))) {
119 0 : FatalError("Error deserializing 'nsCString'");
120 0 : return MsgValueError;
121 : }
122 : // Sentinel = 'data'
123 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
124 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
125 0 : return MsgValueError;
126 : }
127 0 : if ((!(Read((&(offset)), (&(msg__)), (&(iter__)))))) {
128 0 : FatalError("Error deserializing 'uint64_t'");
129 0 : return MsgValueError;
130 : }
131 : // Sentinel = 'offset'
132 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1369947863)))) {
133 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
134 0 : return MsgValueError;
135 : }
136 0 : if ((!(Read((&(count)), (&(msg__)), (&(iter__)))))) {
137 0 : FatalError("Error deserializing 'uint32_t'");
138 0 : return MsgValueError;
139 : }
140 : // Sentinel = 'count'
141 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2126421856)))) {
142 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
143 0 : return MsgValueError;
144 : }
145 0 : (msg__).EndRead(iter__, (msg__).type());
146 0 : PPSMContentDownloader::Transition(PPSMContentDownloader::Msg_OnDataAvailable__ID, (&(mState)));
147 0 : if ((!(RecvOnDataAvailable(mozilla::Move(data), mozilla::Move(offset), mozilla::Move(count))))) {
148 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
149 : // Error handled in mozilla::ipc::IPCResult
150 0 : return MsgProcessingError;
151 : }
152 :
153 0 : return MsgProcessed;
154 : }
155 : case PPSMContentDownloader::Msg_OnStopRequest__ID:
156 : {
157 0 : if (mozilla::ipc::LoggingEnabledFor("PPSMContentDownloaderParent")) {
158 0 : mozilla::ipc::LogMessageForProtocol("PPSMContentDownloaderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
159 : }
160 0 : AUTO_PROFILER_LABEL("PPSMContentDownloader::Msg_OnStopRequest", OTHER);
161 :
162 0 : PickleIterator iter__(msg__);
163 : nsresult code;
164 :
165 0 : if ((!(Read((&(code)), (&(msg__)), (&(iter__)))))) {
166 0 : FatalError("Error deserializing 'nsresult'");
167 0 : return MsgValueError;
168 : }
169 : // Sentinel = 'code'
170 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3318913027)))) {
171 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
172 0 : return MsgValueError;
173 : }
174 0 : (msg__).EndRead(iter__, (msg__).type());
175 0 : PPSMContentDownloader::Transition(PPSMContentDownloader::Msg_OnStopRequest__ID, (&(mState)));
176 0 : if ((!(RecvOnStopRequest(mozilla::Move(code))))) {
177 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
178 : // Error handled in mozilla::ipc::IPCResult
179 0 : return MsgProcessingError;
180 : }
181 :
182 0 : return MsgProcessed;
183 : }
184 : case PPSMContentDownloader::Msg_DivertToParentUsing__ID:
185 : {
186 0 : if (mozilla::ipc::LoggingEnabledFor("PPSMContentDownloaderParent")) {
187 0 : mozilla::ipc::LogMessageForProtocol("PPSMContentDownloaderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
188 : }
189 0 : AUTO_PROFILER_LABEL("PPSMContentDownloader::Msg_DivertToParentUsing", OTHER);
190 :
191 0 : PickleIterator iter__(msg__);
192 : PChannelDiverterParent* diverter;
193 :
194 0 : if ((!(Read((&(diverter)), (&(msg__)), (&(iter__)), false)))) {
195 0 : FatalError("Error deserializing 'PChannelDiverterParent'");
196 0 : return MsgValueError;
197 : }
198 : // Sentinel = 'diverter'
199 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1783530825)))) {
200 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PChannelDiverterParent'");
201 0 : return MsgValueError;
202 : }
203 0 : (msg__).EndRead(iter__, (msg__).type());
204 0 : PPSMContentDownloader::Transition(PPSMContentDownloader::Msg_DivertToParentUsing__ID, (&(mState)));
205 0 : if ((!(RecvDivertToParentUsing(mozilla::Move(diverter))))) {
206 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
207 : // Error handled in mozilla::ipc::IPCResult
208 0 : return MsgProcessingError;
209 : }
210 :
211 0 : return MsgProcessed;
212 : }
213 : case PPSMContentDownloader::Reply___delete____ID:
214 : {
215 0 : return MsgProcessed;
216 : }
217 : default:
218 : {
219 0 : return MsgNotKnown;
220 : }
221 : }
222 : }
223 :
224 0 : auto PPSMContentDownloaderParent::OnMessageReceived(
225 : const Message& msg__,
226 : Message*& reply__) -> PPSMContentDownloaderParent::Result
227 : {
228 0 : return MsgNotKnown;
229 : }
230 :
231 0 : auto PPSMContentDownloaderParent::OnCallReceived(
232 : const Message& msg__,
233 : Message*& reply__) -> PPSMContentDownloaderParent::Result
234 : {
235 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
236 : return MsgNotKnown;
237 : }
238 :
239 0 : auto PPSMContentDownloaderParent::GetProtocolTypeId() -> int32_t
240 : {
241 0 : return PPSMContentDownloaderMsgStart;
242 : }
243 :
244 0 : auto PPSMContentDownloaderParent::ProtocolName() const -> const char*
245 : {
246 0 : return "PPSMContentDownloaderParent";
247 : }
248 :
249 0 : auto PPSMContentDownloaderParent::DestroySubtree(ActorDestroyReason why) -> void
250 : {
251 : // Unregister from our manager.
252 0 : Unregister(Id());
253 :
254 : // Reject owning pending promises.
255 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
256 :
257 : // Finally, destroy "us".
258 0 : ActorDestroy(why);
259 0 : }
260 :
261 0 : auto PPSMContentDownloaderParent::DeallocSubtree() -> void
262 : {
263 0 : }
264 :
265 0 : auto PPSMContentDownloaderParent::Write(
266 : const PPSMContentDownloaderParent* v__,
267 : Message* msg__,
268 : bool nullable__) -> void
269 : {
270 : int32_t id;
271 0 : if ((!(v__))) {
272 0 : if ((!(nullable__))) {
273 0 : FatalError("NULL actor value passed to non-nullable param");
274 : }
275 0 : id = 0;
276 : }
277 : else {
278 0 : id = (v__)->Id();
279 0 : if ((1) == (id)) {
280 0 : FatalError("actor has been |delete|d");
281 : }
282 : }
283 :
284 0 : Write(id, msg__);
285 0 : }
286 :
287 0 : auto PPSMContentDownloaderParent::Read(
288 : PPSMContentDownloaderParent** v__,
289 : const Message* msg__,
290 : PickleIterator* iter__,
291 : bool nullable__) -> bool
292 : {
293 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PPSMContentDownloader", PPSMContentDownloaderMsgStart);
294 0 : if ((actor).isNothing()) {
295 0 : return false;
296 : }
297 :
298 0 : (*(v__)) = static_cast<PPSMContentDownloaderParent*>((actor).value());
299 0 : return true;
300 : }
301 :
302 0 : auto PPSMContentDownloaderParent::Write(
303 : const PChannelDiverterParent* v__,
304 : Message* msg__,
305 : bool nullable__) -> void
306 : {
307 : int32_t id;
308 0 : if ((!(v__))) {
309 0 : if ((!(nullable__))) {
310 0 : FatalError("NULL actor value passed to non-nullable param");
311 : }
312 0 : id = 0;
313 : }
314 : else {
315 0 : id = (v__)->Id();
316 0 : if ((1) == (id)) {
317 0 : FatalError("actor has been |delete|d");
318 : }
319 : }
320 :
321 0 : Write(id, msg__);
322 0 : }
323 :
324 0 : auto PPSMContentDownloaderParent::Read(
325 : PChannelDiverterParent** v__,
326 : const Message* msg__,
327 : PickleIterator* iter__,
328 : bool nullable__) -> bool
329 : {
330 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PChannelDiverter", PChannelDiverterMsgStart);
331 0 : if ((actor).isNothing()) {
332 0 : return false;
333 : }
334 :
335 0 : (*(v__)) = static_cast<PChannelDiverterParent*>((actor).value());
336 0 : return true;
337 : }
338 :
339 :
340 :
341 : } // namespace psm
342 : } // namespace mozilla
|