1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/PContentPermissionRequestChild.h"
8 :
9 : #include "mozilla/dom/PBrowserChild.h"
10 :
11 : typedef IPC::Message Message;
12 : typedef mozilla::ipc::RPCChannel Channel;
13 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
14 : typedef base::ProcessHandle ProcessHandle;
15 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
16 : typedef mozilla::ipc::SharedMemory SharedMemory;
17 : typedef mozilla::ipc::Trigger Trigger;
18 : typedef mozilla::ipc::ActorHandle ActorHandle;
19 : typedef mozilla::ipc::Shmem Shmem;
20 : typedef IPC::URI URI;
21 : using mozilla::dom::PBrowserChild;
22 :
23 : namespace mozilla {
24 : namespace dom {
25 :
26 :
27 : bool
28 0 : PContentPermissionRequestChild::Recv__delete__(const bool& allow)
29 : {
30 0 : return true;
31 : }
32 :
33 : void
34 0 : PContentPermissionRequestChild::ActorDestroy(ActorDestroyReason why)
35 : {
36 0 : }
37 :
38 1 : PContentPermissionRequestChild::PContentPermissionRequestChild() :
39 : mId(0),
40 1 : mState(PContentPermissionRequest::__Dead)
41 : {
42 1 : MOZ_COUNT_CTOR(PContentPermissionRequestChild);
43 1 : }
44 :
45 2 : PContentPermissionRequestChild::~PContentPermissionRequestChild()
46 : {
47 1 : MOZ_COUNT_DTOR(PContentPermissionRequestChild);
48 2 : }
49 :
50 : PBrowserChild*
51 0 : PContentPermissionRequestChild::Manager()
52 : {
53 0 : return static_cast<PBrowserChild*>(mManager);
54 : }
55 :
56 : PContentPermissionRequest::State
57 0 : PContentPermissionRequestChild::state()
58 : {
59 0 : return mState;
60 : }
61 :
62 : bool
63 0 : PContentPermissionRequestChild::Sendprompt()
64 : {
65 0 : PContentPermissionRequest::Msg_prompt* __msg = new PContentPermissionRequest::Msg_prompt();
66 :
67 :
68 0 : (__msg)->set_routing_id(mId);
69 :
70 :
71 :
72 0 : if (mozilla::ipc::LoggingEnabled()) {
73 0 : (__msg)->Log("[PContentPermissionRequestChild] Sending ", stderr);
74 : }
75 0 : if ((!(PContentPermissionRequest::Transition(mState, Trigger(Trigger::Recv, PContentPermissionRequest::Msg_prompt__ID), (&(mState)))))) {
76 0 : NS_WARNING("bad state transition!");
77 : }
78 :
79 0 : bool __sendok = (mChannel)->Send(__msg);
80 0 : return __sendok;
81 : }
82 :
83 : int32
84 0 : PContentPermissionRequestChild::Register(ChannelListener* aRouted)
85 : {
86 0 : return (mManager)->Register(aRouted);
87 : }
88 :
89 : int32
90 0 : PContentPermissionRequestChild::RegisterID(
91 : ChannelListener* aRouted,
92 : int32 aId)
93 : {
94 0 : return (mManager)->RegisterID(aRouted, aId);
95 : }
96 :
97 : ChannelListener*
98 0 : PContentPermissionRequestChild::Lookup(int32 aId)
99 : {
100 0 : return (mManager)->Lookup(aId);
101 : }
102 :
103 : void
104 0 : PContentPermissionRequestChild::Unregister(int32 aId)
105 : {
106 0 : return (mManager)->Unregister(aId);
107 : }
108 :
109 : void
110 0 : PContentPermissionRequestChild::RemoveManagee(
111 : int32 aProtocolId,
112 : ChannelListener* aListener)
113 : {
114 0 : NS_RUNTIMEABORT("unreached");
115 : return;
116 : }
117 :
118 : Shmem::SharedMemory*
119 0 : PContentPermissionRequestChild::CreateSharedMemory(
120 : size_t aSize,
121 : Shmem::SharedMemory::SharedMemoryType type,
122 : bool unsafe,
123 : Shmem::id_t* aId)
124 : {
125 0 : return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
126 : }
127 :
128 : bool
129 0 : PContentPermissionRequestChild::AdoptSharedMemory(
130 : Shmem::SharedMemory* segment,
131 : Shmem::id_t* aId)
132 : {
133 0 : return (mManager)->AdoptSharedMemory(segment, aId);
134 : }
135 :
136 : Shmem::SharedMemory*
137 0 : PContentPermissionRequestChild::LookupSharedMemory(Shmem::id_t aId)
138 : {
139 0 : return (mManager)->LookupSharedMemory(aId);
140 : }
141 :
142 : bool
143 0 : PContentPermissionRequestChild::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
144 : {
145 0 : return (mManager)->IsTrackingSharedMemory(segment);
146 : }
147 :
148 : bool
149 0 : PContentPermissionRequestChild::DestroySharedMemory(Shmem& aShmem)
150 : {
151 0 : return (mManager)->DestroySharedMemory(aShmem);
152 : }
153 :
154 : ProcessHandle
155 0 : PContentPermissionRequestChild::OtherProcess() const
156 : {
157 0 : return (mManager)->OtherProcess();
158 : }
159 :
160 : AsyncChannel*
161 0 : PContentPermissionRequestChild::GetIPCChannel()
162 : {
163 0 : return mChannel;
164 : }
165 :
166 : PContentPermissionRequestChild::Result
167 0 : PContentPermissionRequestChild::OnMessageReceived(const Message& __msg)
168 : {
169 0 : switch ((__msg).type()) {
170 : case PContentPermissionRequest::Msg___delete____ID:
171 : {
172 0 : (const_cast<Message&>(__msg)).set_name("PContentPermissionRequest::Msg___delete__");
173 0 : if (mozilla::ipc::LoggingEnabled()) {
174 0 : (static_cast<const PContentPermissionRequest::Msg___delete__*>((&(__msg))))->Log("[PContentPermissionRequestChild] Received ", stderr);
175 : }
176 :
177 0 : void* __iter = 0;
178 : PContentPermissionRequestChild* actor;
179 : bool allow;
180 :
181 0 : if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), false)))) {
182 0 : FatalError("error deserializing (better message TODO)");
183 0 : return MsgValueError;
184 : }
185 0 : if ((!(Read((&(allow)), (&(__msg)), (&(__iter)))))) {
186 0 : FatalError("error deserializing (better message TODO)");
187 0 : return MsgValueError;
188 : }
189 0 : (__msg).EndRead(__iter);
190 0 : if ((!(PContentPermissionRequest::Transition(mState, Trigger(Trigger::Send, PContentPermissionRequest::Msg___delete____ID), (&(mState)))))) {
191 0 : NS_WARNING("bad state transition!");
192 : }
193 0 : if ((!(Recv__delete__(allow)))) {
194 0 : return MsgProcessingError;
195 : }
196 :
197 0 : (actor)->DestroySubtree(Deletion);
198 0 : (actor)->DeallocSubtree();
199 0 : ((actor)->mManager)->RemoveManagee(PContentPermissionRequestMsgStart, actor);
200 :
201 :
202 0 : return MsgProcessed;
203 : }
204 : default:
205 : {
206 0 : return MsgNotKnown;
207 : }
208 : }
209 : }
210 :
211 : PContentPermissionRequestChild::Result
212 0 : PContentPermissionRequestChild::OnMessageReceived(
213 : const Message& __msg,
214 : Message*& __reply)
215 : {
216 0 : return MsgNotKnown;
217 : }
218 :
219 : PContentPermissionRequestChild::Result
220 0 : PContentPermissionRequestChild::OnCallReceived(
221 : const Message& __msg,
222 : Message*& __reply)
223 : {
224 0 : return MsgNotKnown;
225 : }
226 :
227 : void
228 0 : PContentPermissionRequestChild::OnProcessingError(Result code)
229 : {
230 0 : NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
231 0 : }
232 :
233 : bool
234 0 : PContentPermissionRequestChild::OnReplyTimeout()
235 : {
236 0 : NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
237 0 : return false;
238 : }
239 :
240 : void
241 0 : PContentPermissionRequestChild::OnChannelClose()
242 : {
243 0 : NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
244 0 : }
245 :
246 : void
247 0 : PContentPermissionRequestChild::OnChannelError()
248 : {
249 0 : NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
250 0 : }
251 :
252 : void
253 0 : PContentPermissionRequestChild::OnChannelConnected(int32 pid)
254 : {
255 0 : NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
256 0 : }
257 :
258 : bool
259 0 : PContentPermissionRequestChild::AllocShmem(
260 : size_t aSize,
261 : Shmem::SharedMemory::SharedMemoryType aType,
262 : Shmem* aMem)
263 : {
264 : Shmem::id_t aId;
265 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
266 0 : if ((!(rawmem))) {
267 0 : return false;
268 : }
269 :
270 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
271 0 : return true;
272 : }
273 :
274 : bool
275 0 : PContentPermissionRequestChild::AllocUnsafeShmem(
276 : size_t aSize,
277 : Shmem::SharedMemory::SharedMemoryType aType,
278 : Shmem* aMem)
279 : {
280 : Shmem::id_t aId;
281 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
282 0 : if ((!(rawmem))) {
283 0 : return false;
284 : }
285 :
286 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
287 0 : return true;
288 : }
289 :
290 : bool
291 0 : PContentPermissionRequestChild::AdoptShmem(
292 : Shmem& aMem,
293 : Shmem* aOutMem)
294 : {
295 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
296 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
297 0 : NS_RUNTIMEABORT("bad Shmem");
298 : }
299 :
300 : Shmem::id_t aId;
301 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
302 0 : return false;
303 : }
304 :
305 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
306 0 : return true;
307 : }
308 :
309 : bool
310 0 : PContentPermissionRequestChild::DeallocShmem(Shmem& aMem)
311 : {
312 0 : bool ok = DestroySharedMemory(aMem);
313 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
314 0 : return ok;
315 : }
316 :
317 : void
318 0 : PContentPermissionRequestChild::FatalError(const char* const msg) const
319 : {
320 : // Virtual method to prevent inlining.
321 : // This give us better error reporting.
322 : // See bug 589371
323 :
324 0 : NS_ERROR("IPDL error:");
325 0 : NS_ERROR(msg);
326 :
327 0 : NS_RUNTIMEABORT("[PContentPermissionRequestChild] abort()ing as a result");
328 0 : }
329 :
330 : void
331 0 : PContentPermissionRequestChild::DestroySubtree(ActorDestroyReason why)
332 : {
333 : // Unregister from our manager.
334 0 : Unregister(mId);
335 0 : mId = 1;
336 :
337 : // Finally, destroy "us".
338 0 : ActorDestroy(why);
339 0 : }
340 :
341 : void
342 0 : PContentPermissionRequestChild::DeallocSubtree()
343 : {
344 0 : }
345 :
346 : void
347 0 : PContentPermissionRequestChild::Write(
348 : PContentPermissionRequestChild* __v,
349 : Message* __msg,
350 : bool __nullable)
351 : {
352 : int32 id;
353 0 : if ((!(__v))) {
354 0 : if ((!(__nullable))) {
355 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
356 : }
357 0 : id = 0;
358 : }
359 : else {
360 0 : id = (__v)->mId;
361 0 : if ((1) == (id)) {
362 0 : NS_RUNTIMEABORT("actor has been |delete|d");
363 : }
364 : }
365 :
366 0 : Write(id, __msg);
367 0 : }
368 :
369 : bool
370 0 : PContentPermissionRequestChild::Read(
371 : PContentPermissionRequestChild** __v,
372 : const Message* __msg,
373 : void** __iter,
374 : bool __nullable)
375 : {
376 : int32 id;
377 0 : if ((!(Read((&(id)), __msg, __iter)))) {
378 0 : return false;
379 : }
380 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
381 0 : return false;
382 : }
383 :
384 0 : if ((0) == (id)) {
385 0 : (*(__v)) = 0;
386 : }
387 : else {
388 0 : (*(__v)) = static_cast<PContentPermissionRequestChild*>(Lookup(id));
389 0 : if ((!((*(__v))))) {
390 0 : return false;
391 : }
392 : }
393 0 : return true;
394 : }
395 :
396 :
397 :
398 : } // namespace dom
399 : } // namespace mozilla
|