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