Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/PContentPermissionRequestParent.h"
8 :
9 : #include "mozilla/dom/PContentParent.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 :
18 :
19 0 : MOZ_IMPLICIT PContentPermissionRequestParent::PContentPermissionRequestParent() :
20 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
21 0 : mState(PContentPermissionRequest::__Dead)
22 : {
23 0 : MOZ_COUNT_CTOR(PContentPermissionRequestParent);
24 0 : }
25 :
26 0 : PContentPermissionRequestParent::~PContentPermissionRequestParent()
27 : {
28 0 : MOZ_COUNT_DTOR(PContentPermissionRequestParent);
29 0 : }
30 :
31 0 : auto PContentPermissionRequestParent::Manager() const -> PContentParent*
32 : {
33 0 : return static_cast<PContentParent*>(IProtocol::Manager());
34 : }
35 :
36 0 : auto PContentPermissionRequestParent::SendGetVisibility() -> bool
37 : {
38 0 : IPC::Message* msg__ = PContentPermissionRequest::Msg_GetVisibility(Id());
39 :
40 :
41 :
42 :
43 :
44 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
45 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
46 : }
47 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg_GetVisibility", OTHER);
48 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg_GetVisibility__ID, (&(mState)));
49 :
50 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
51 0 : return sendok__;
52 : }
53 :
54 0 : auto PContentPermissionRequestParent::SendNotifyResult(
55 : const bool& allow,
56 : const nsTArray<PermissionChoice>& choices) -> bool
57 : {
58 0 : IPC::Message* msg__ = PContentPermissionRequest::Msg_NotifyResult(Id());
59 :
60 0 : Write(allow, msg__);
61 : // Sentinel = 'allow'
62 0 : (msg__)->WriteSentinel(3737033206);
63 0 : Write(choices, msg__);
64 : // Sentinel = 'choices'
65 0 : (msg__)->WriteSentinel(3898211695);
66 :
67 :
68 :
69 :
70 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
71 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
72 : }
73 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg_NotifyResult", OTHER);
74 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg_NotifyResult__ID, (&(mState)));
75 :
76 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
77 0 : return sendok__;
78 : }
79 :
80 0 : auto PContentPermissionRequestParent::Send__delete__(PContentPermissionRequestParent* actor) -> bool
81 : {
82 0 : if ((!(actor))) {
83 0 : return false;
84 : }
85 :
86 0 : IPC::Message* msg__ = PContentPermissionRequest::Msg___delete__((actor)->Id());
87 :
88 0 : (actor)->Write(actor, msg__, false);
89 : // Sentinel = 'actor'
90 0 : (msg__)->WriteSentinel(875202478);
91 :
92 :
93 :
94 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
95 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
96 : }
97 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg___delete__", OTHER);
98 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg___delete____ID, (&((actor)->mState)));
99 :
100 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
101 :
102 0 : IProtocol* mgr = (actor)->Manager();
103 0 : (actor)->DestroySubtree(Deletion);
104 0 : (actor)->DeallocSubtree();
105 0 : (mgr)->RemoveManagee(PContentPermissionRequestMsgStart, actor);
106 0 : return sendok__;
107 : }
108 :
109 0 : auto PContentPermissionRequestParent::RemoveManagee(
110 : int32_t aProtocolId,
111 : ProtocolBase* aListener) -> void
112 : {
113 0 : FatalError("unreached");
114 0 : return;
115 : }
116 :
117 0 : auto PContentPermissionRequestParent::OnMessageReceived(const Message& msg__) -> PContentPermissionRequestParent::Result
118 : {
119 0 : switch ((msg__).type()) {
120 : case PContentPermissionRequest::Msg_prompt__ID:
121 : {
122 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
123 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
124 : }
125 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg_prompt", OTHER);
126 :
127 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg_prompt__ID, (&(mState)));
128 0 : if ((!(Recvprompt()))) {
129 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
130 : // Error handled in mozilla::ipc::IPCResult
131 0 : return MsgProcessingError;
132 : }
133 :
134 0 : return MsgProcessed;
135 : }
136 : case PContentPermissionRequest::Msg_NotifyVisibility__ID:
137 : {
138 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
139 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
140 : }
141 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg_NotifyVisibility", OTHER);
142 :
143 0 : PickleIterator iter__(msg__);
144 : bool visibility;
145 :
146 0 : if ((!(Read((&(visibility)), (&(msg__)), (&(iter__)))))) {
147 0 : FatalError("Error deserializing 'bool'");
148 0 : return MsgValueError;
149 : }
150 : // Sentinel = 'visibility'
151 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1487550798)))) {
152 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
153 0 : return MsgValueError;
154 : }
155 0 : (msg__).EndRead(iter__, (msg__).type());
156 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg_NotifyVisibility__ID, (&(mState)));
157 0 : if ((!(RecvNotifyVisibility(mozilla::Move(visibility))))) {
158 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
159 : // Error handled in mozilla::ipc::IPCResult
160 0 : return MsgProcessingError;
161 : }
162 :
163 0 : return MsgProcessed;
164 : }
165 : case PContentPermissionRequest::Msg_Destroy__ID:
166 : {
167 0 : if (mozilla::ipc::LoggingEnabledFor("PContentPermissionRequestParent")) {
168 0 : mozilla::ipc::LogMessageForProtocol("PContentPermissionRequestParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
169 : }
170 0 : AUTO_PROFILER_LABEL("PContentPermissionRequest::Msg_Destroy", OTHER);
171 :
172 0 : PContentPermissionRequest::Transition(PContentPermissionRequest::Msg_Destroy__ID, (&(mState)));
173 0 : if ((!(RecvDestroy()))) {
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 PContentPermissionRequest::Reply___delete____ID:
182 : {
183 0 : return MsgProcessed;
184 : }
185 : default:
186 : {
187 0 : return MsgNotKnown;
188 : }
189 : }
190 : }
191 :
192 0 : auto PContentPermissionRequestParent::OnMessageReceived(
193 : const Message& msg__,
194 : Message*& reply__) -> PContentPermissionRequestParent::Result
195 : {
196 0 : return MsgNotKnown;
197 : }
198 :
199 0 : auto PContentPermissionRequestParent::OnCallReceived(
200 : const Message& msg__,
201 : Message*& reply__) -> PContentPermissionRequestParent::Result
202 : {
203 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
204 : return MsgNotKnown;
205 : }
206 :
207 0 : auto PContentPermissionRequestParent::GetProtocolTypeId() -> int32_t
208 : {
209 0 : return PContentPermissionRequestMsgStart;
210 : }
211 :
212 0 : auto PContentPermissionRequestParent::ProtocolName() const -> const char*
213 : {
214 0 : return "PContentPermissionRequestParent";
215 : }
216 :
217 0 : auto PContentPermissionRequestParent::DestroySubtree(ActorDestroyReason why) -> void
218 : {
219 : // Unregister from our manager.
220 0 : Unregister(Id());
221 :
222 : // Reject owning pending promises.
223 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
224 :
225 : // Finally, destroy "us".
226 0 : ActorDestroy(why);
227 0 : }
228 :
229 0 : auto PContentPermissionRequestParent::DeallocSubtree() -> void
230 : {
231 0 : }
232 :
233 0 : auto PContentPermissionRequestParent::Write(
234 : const nsTArray<PermissionChoice>& v__,
235 : Message* msg__) -> void
236 : {
237 0 : uint32_t length = (v__).Length();
238 0 : Write(length, msg__);
239 : // Sentinel = ('length', 'PermissionChoice[]')
240 0 : (msg__)->WriteSentinel(2926411159);
241 :
242 0 : for (auto& elem : v__) {
243 0 : Write(elem, msg__);
244 : // Sentinel = 'PermissionChoice[]'
245 0 : (msg__)->WriteSentinel(2153190994);
246 : }
247 0 : }
248 :
249 0 : auto PContentPermissionRequestParent::Read(
250 : nsTArray<PermissionChoice>* v__,
251 : const Message* msg__,
252 : PickleIterator* iter__) -> bool
253 : {
254 0 : nsTArray<PermissionChoice> fa;
255 : uint32_t length;
256 0 : if ((!(Read((&(length)), msg__, iter__)))) {
257 0 : mozilla::ipc::ArrayLengthReadError("PermissionChoice[]");
258 0 : return false;
259 : }
260 : // Sentinel = ('length', 'PermissionChoice[]')
261 0 : if ((!((msg__)->ReadSentinel(iter__, 2926411159)))) {
262 0 : mozilla::ipc::SentinelReadError("PermissionChoice[]");
263 0 : return false;
264 : }
265 :
266 0 : PermissionChoice* elems = (fa).AppendElements(length);
267 0 : for (uint32_t i = 0; (i) < (length); (++(i))) {
268 0 : if ((!(Read((&(elems[i])), msg__, iter__)))) {
269 0 : FatalError("Error deserializing 'PermissionChoice[i]'");
270 0 : return false;
271 : }
272 : // Sentinel = 'PermissionChoice[]'
273 0 : if ((!((msg__)->ReadSentinel(iter__, 2153190994)))) {
274 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PermissionChoice[i]'");
275 0 : return false;
276 : }
277 : }
278 0 : (v__)->SwapElements(fa);
279 0 : return true;
280 : }
281 :
282 0 : auto PContentPermissionRequestParent::Write(
283 : const PermissionChoice& v__,
284 : Message* msg__) -> void
285 : {
286 0 : Write((v__).type(), msg__);
287 : // Sentinel = 'type'
288 0 : (msg__)->WriteSentinel(2982068540);
289 0 : Write((v__).choice(), msg__);
290 : // Sentinel = 'choice'
291 0 : (msg__)->WriteSentinel(1920600143);
292 0 : }
293 :
294 0 : auto PContentPermissionRequestParent::Read(
295 : PermissionChoice* v__,
296 : const Message* msg__,
297 : PickleIterator* iter__) -> bool
298 : {
299 0 : if ((!(Read((&((v__)->type())), msg__, iter__)))) {
300 0 : FatalError("Error deserializing 'type' (nsCString) member of 'PermissionChoice'");
301 0 : return false;
302 : }
303 : // Sentinel = 'type'
304 0 : if ((!((msg__)->ReadSentinel(iter__, 2982068540)))) {
305 0 : mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsCString) member of 'PermissionChoice'");
306 0 : return false;
307 : }
308 0 : if ((!(Read((&((v__)->choice())), msg__, iter__)))) {
309 0 : FatalError("Error deserializing 'choice' (nsString) member of 'PermissionChoice'");
310 0 : return false;
311 : }
312 : // Sentinel = 'choice'
313 0 : if ((!((msg__)->ReadSentinel(iter__, 1920600143)))) {
314 0 : mozilla::ipc::SentinelReadError("Error deserializing 'choice' (nsString) member of 'PermissionChoice'");
315 0 : return false;
316 : }
317 0 : return true;
318 : }
319 :
320 0 : auto PContentPermissionRequestParent::Write(
321 : const PContentPermissionRequestParent* v__,
322 : Message* msg__,
323 : bool nullable__) -> void
324 : {
325 : int32_t id;
326 0 : if ((!(v__))) {
327 0 : if ((!(nullable__))) {
328 0 : FatalError("NULL actor value passed to non-nullable param");
329 : }
330 0 : id = 0;
331 : }
332 : else {
333 0 : id = (v__)->Id();
334 0 : if ((1) == (id)) {
335 0 : FatalError("actor has been |delete|d");
336 : }
337 : }
338 :
339 0 : Write(id, msg__);
340 0 : }
341 :
342 0 : auto PContentPermissionRequestParent::Read(
343 : PContentPermissionRequestParent** v__,
344 : const Message* msg__,
345 : PickleIterator* iter__,
346 : bool nullable__) -> bool
347 : {
348 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PContentPermissionRequest", PContentPermissionRequestMsgStart);
349 0 : if ((actor).isNothing()) {
350 0 : return false;
351 : }
352 :
353 0 : (*(v__)) = static_cast<PContentPermissionRequestParent*>((actor).value());
354 0 : return true;
355 : }
356 :
357 :
358 :
359 : } // namespace dom
360 : } // namespace mozilla
|