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