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