1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PNeckoParent_h
7 : #define PNeckoParent_h
8 :
9 : #include "mozilla/net/PNecko.h"
10 : namespace mozilla {
11 : namespace dom {
12 : class PContentParent;
13 : } // namespace dom
14 : } // namespace mozilla
15 :
16 : namespace mozilla {
17 : namespace net {
18 : class PHttpChannelParent;
19 : } // namespace net
20 : } // namespace mozilla
21 :
22 : namespace mozilla {
23 : namespace net {
24 : class PCookieServiceParent;
25 : } // namespace net
26 : } // namespace mozilla
27 :
28 : namespace mozilla {
29 : namespace dom {
30 : class PBrowserParent;
31 : } // namespace dom
32 : } // namespace mozilla
33 :
34 : namespace mozilla {
35 : namespace net {
36 : class PWyciwygChannelParent;
37 : } // namespace net
38 : } // namespace mozilla
39 :
40 : namespace mozilla {
41 : namespace net {
42 : class PFTPChannelParent;
43 : } // namespace net
44 : } // namespace mozilla
45 :
46 : namespace mozilla {
47 : namespace net {
48 : class PWebSocketParent;
49 : } // namespace net
50 : } // namespace mozilla
51 :
52 : #ifdef DEBUG
53 : #include "prenv.h"
54 : #endif // DEBUG
55 : #include "base/id_map.h"
56 : #include "mozilla/ipc/RPCChannel.h"
57 :
58 :
59 : namespace mozilla {
60 : namespace net {
61 : class PHttpChannelParent;
62 : } // namespace net
63 : } // namespace mozilla
64 :
65 :
66 : namespace mozilla {
67 : namespace net {
68 : class PWyciwygChannelParent;
69 : } // namespace net
70 : } // namespace mozilla
71 :
72 :
73 : namespace mozilla {
74 : namespace net {
75 : class PFTPChannelParent;
76 : } // namespace net
77 : } // namespace mozilla
78 :
79 :
80 : namespace mozilla {
81 : namespace dom {
82 : class PContentParent;
83 : } // namespace dom
84 : } // namespace mozilla
85 :
86 :
87 : namespace mozilla {
88 : namespace net {
89 : class PWebSocketParent;
90 : } // namespace net
91 : } // namespace mozilla
92 :
93 :
94 : namespace mozilla {
95 : namespace net {
96 : class PCookieServiceParent;
97 : } // namespace net
98 : } // namespace mozilla
99 :
100 : namespace mozilla {
101 : namespace net {
102 :
103 :
104 : class /*NS_ABSTRACT_CLASS*/ PNeckoParent :
105 : protected mozilla::ipc::RPCChannel::RPCListener,
106 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
107 : {
108 : friend class mozilla::net::PHttpChannelParent;
109 :
110 : friend class mozilla::net::PWyciwygChannelParent;
111 :
112 : friend class mozilla::net::PFTPChannelParent;
113 :
114 : friend class mozilla::dom::PContentParent;
115 :
116 : friend class mozilla::net::PWebSocketParent;
117 :
118 : friend class mozilla::net::PCookieServiceParent;
119 :
120 : protected:
121 : typedef mozilla::ipc::ActorHandle ActorHandle;
122 : typedef mozilla::ipc::Shmem Shmem;
123 : typedef mozilla::dom::PContentParent PContentParent;
124 : typedef mozilla::net::PHttpChannelParent PHttpChannelParent;
125 : typedef mozilla::net::PCookieServiceParent PCookieServiceParent;
126 : typedef mozilla::dom::PBrowserParent PBrowserParent;
127 : typedef mozilla::net::PWyciwygChannelParent PWyciwygChannelParent;
128 : typedef mozilla::net::PFTPChannelParent PFTPChannelParent;
129 : typedef mozilla::net::PWebSocketParent PWebSocketParent;
130 : typedef base::ProcessId ProcessId;
131 : typedef mozilla::ipc::ProtocolId ProtocolId;
132 : typedef mozilla::ipc::Transport Transport;
133 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
134 :
135 : typedef PNecko::State State;
136 :
137 : virtual bool
138 : Recv__delete__();
139 : virtual bool
140 : RecvPCookieServiceConstructor(PCookieServiceParent* actor);
141 : virtual bool
142 : RecvPWyciwygChannelConstructor(PWyciwygChannelParent* actor);
143 : virtual bool
144 : RecvPFTPChannelConstructor(PFTPChannelParent* actor);
145 : virtual bool
146 : RecvPWebSocketConstructor(
147 : PWebSocketParent* actor,
148 : PBrowserParent* browser);
149 : virtual bool
150 : RecvHTMLDNSPrefetch(
151 : const nsString& hostname,
152 : const PRUint16& flags) = 0;
153 : virtual bool
154 : RecvCancelHTMLDNSPrefetch(
155 : const nsString& hostname,
156 : const PRUint16& flags,
157 : const nsresult& reason) = 0;
158 : virtual bool
159 : RecvPHttpChannelConstructor(
160 : PHttpChannelParent* actor,
161 : PBrowserParent* browser);
162 : virtual PCookieServiceParent*
163 : AllocPCookieService() = 0;
164 : virtual bool
165 : DeallocPCookieService(PCookieServiceParent* actor) = 0;
166 : virtual PWyciwygChannelParent*
167 : AllocPWyciwygChannel() = 0;
168 : virtual bool
169 : DeallocPWyciwygChannel(PWyciwygChannelParent* actor) = 0;
170 : virtual PFTPChannelParent*
171 : AllocPFTPChannel() = 0;
172 : virtual bool
173 : DeallocPFTPChannel(PFTPChannelParent* actor) = 0;
174 : virtual PWebSocketParent*
175 : AllocPWebSocket(PBrowserParent* browser) = 0;
176 : virtual bool
177 : DeallocPWebSocket(PWebSocketParent* actor) = 0;
178 : virtual PHttpChannelParent*
179 : AllocPHttpChannel(PBrowserParent* browser) = 0;
180 : virtual bool
181 : DeallocPHttpChannel(PHttpChannelParent* actor) = 0;
182 :
183 : virtual void
184 : ActorDestroy(ActorDestroyReason why);
185 :
186 : public:
187 : typedef IPC::Message Message;
188 : typedef mozilla::ipc::RPCChannel Channel;
189 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
190 : typedef base::ProcessHandle ProcessHandle;
191 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
192 : typedef mozilla::ipc::SharedMemory SharedMemory;
193 : typedef mozilla::ipc::Trigger Trigger;
194 :
195 : public:
196 : PNeckoParent();
197 :
198 : virtual ~PNeckoParent();
199 :
200 : PContentParent*
201 : Manager();
202 :
203 : void
204 : ManagedPHttpChannelParent(InfallibleTArray<PHttpChannelParent*>& aArr) const;
205 : const InfallibleTArray<PHttpChannelParent*>&
206 : ManagedPHttpChannelParent() const;
207 :
208 : void
209 : ManagedPCookieServiceParent(InfallibleTArray<PCookieServiceParent*>& aArr) const;
210 : const InfallibleTArray<PCookieServiceParent*>&
211 : ManagedPCookieServiceParent() const;
212 :
213 : void
214 : ManagedPWyciwygChannelParent(InfallibleTArray<PWyciwygChannelParent*>& aArr) const;
215 : const InfallibleTArray<PWyciwygChannelParent*>&
216 : ManagedPWyciwygChannelParent() const;
217 :
218 : void
219 : ManagedPFTPChannelParent(InfallibleTArray<PFTPChannelParent*>& aArr) const;
220 : const InfallibleTArray<PFTPChannelParent*>&
221 : ManagedPFTPChannelParent() const;
222 :
223 : void
224 : ManagedPWebSocketParent(InfallibleTArray<PWebSocketParent*>& aArr) const;
225 : const InfallibleTArray<PWebSocketParent*>&
226 : ManagedPWebSocketParent() const;
227 :
228 : PNecko::State
229 : state();
230 :
231 : PHttpChannelParent*
232 : SendPHttpChannelConstructor(PBrowserParent* browser) NS_WARN_UNUSED_RESULT;
233 :
234 : PHttpChannelParent*
235 : SendPHttpChannelConstructor(
236 : PHttpChannelParent* actor,
237 : PBrowserParent* browser) NS_WARN_UNUSED_RESULT;
238 :
239 : virtual int32
240 : Register(ChannelListener* aRouted);
241 : virtual int32
242 : RegisterID(
243 : ChannelListener* aRouted,
244 : int32 aId);
245 : virtual ChannelListener*
246 : Lookup(int32 aId);
247 : virtual void
248 : Unregister(int32 aId);
249 : virtual void
250 : RemoveManagee(
251 : int32 aProtocolId,
252 : ChannelListener* aListener);
253 : virtual Shmem::SharedMemory*
254 : CreateSharedMemory(
255 : size_t aSize,
256 : Shmem::SharedMemory::SharedMemoryType type,
257 : bool unsafe,
258 : Shmem::id_t* aId);
259 : virtual bool
260 : AdoptSharedMemory(
261 : Shmem::SharedMemory* segment,
262 : Shmem::id_t* aId);
263 : virtual Shmem::SharedMemory*
264 : LookupSharedMemory(Shmem::id_t aId);
265 : virtual bool
266 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
267 : virtual bool
268 : DestroySharedMemory(Shmem& aShmem);
269 : virtual ProcessHandle
270 : OtherProcess() const;
271 : virtual AsyncChannel*
272 : GetIPCChannel();
273 :
274 : virtual Result
275 : OnMessageReceived(const Message& __msg);
276 :
277 : virtual Result
278 : OnMessageReceived(
279 : const Message& __msg,
280 : Message*& __reply);
281 :
282 : virtual Result
283 : OnCallReceived(
284 : const Message& __msg,
285 : Message*& __reply);
286 :
287 : void
288 : OnProcessingError(Result code);
289 :
290 : bool
291 : OnReplyTimeout();
292 :
293 : void
294 : OnChannelClose();
295 :
296 : void
297 : OnChannelError();
298 :
299 : void
300 : OnChannelConnected(int32 pid);
301 :
302 : // Methods for managing shmem
303 : bool
304 : AllocShmem(
305 : size_t aSize,
306 : Shmem::SharedMemory::SharedMemoryType aType,
307 : Shmem* aMem);
308 :
309 : bool
310 : AllocUnsafeShmem(
311 : size_t aSize,
312 : Shmem::SharedMemory::SharedMemoryType aType,
313 : Shmem* aMem);
314 :
315 : bool
316 : AdoptShmem(
317 : Shmem& aMem,
318 : Shmem* aOutMem);
319 :
320 : bool
321 : DeallocShmem(Shmem& aMem);
322 :
323 : private:
324 : virtual void
325 : FatalError(const char* const msg) const;
326 :
327 : void
328 : DestroySubtree(ActorDestroyReason why);
329 :
330 : void
331 : DeallocSubtree();
332 :
333 : template<typename T>
334 : void
335 0 : Write(
336 : const T& __v,
337 : Message* __msg)
338 : {
339 0 : IPC::WriteParam(__msg, __v);
340 0 : }
341 :
342 : template<typename T>
343 : bool
344 0 : Read(
345 : T* __v,
346 : const Message* __msg,
347 : void** __iter)
348 : {
349 0 : return IPC::ReadParam(__msg, __iter, __v);
350 : }
351 :
352 : void
353 : Write(
354 : PHttpChannelParent* __v,
355 : Message* __msg,
356 : bool __nullable);
357 :
358 : bool
359 : Read(
360 : PHttpChannelParent** __v,
361 : const Message* __msg,
362 : void** __iter,
363 : bool __nullable) NS_WARN_UNUSED_RESULT;
364 :
365 : void
366 : Write(
367 : PBrowserParent* __v,
368 : Message* __msg,
369 : bool __nullable);
370 :
371 : bool
372 : Read(
373 : PBrowserParent** __v,
374 : const Message* __msg,
375 : void** __iter,
376 : bool __nullable) NS_WARN_UNUSED_RESULT;
377 :
378 : void
379 : Write(
380 : PWyciwygChannelParent* __v,
381 : Message* __msg,
382 : bool __nullable);
383 :
384 : bool
385 : Read(
386 : PWyciwygChannelParent** __v,
387 : const Message* __msg,
388 : void** __iter,
389 : bool __nullable) NS_WARN_UNUSED_RESULT;
390 :
391 : void
392 : Write(
393 : PNeckoParent* __v,
394 : Message* __msg,
395 : bool __nullable);
396 :
397 : bool
398 : Read(
399 : PNeckoParent** __v,
400 : const Message* __msg,
401 : void** __iter,
402 : bool __nullable) NS_WARN_UNUSED_RESULT;
403 :
404 : void
405 : Write(
406 : PFTPChannelParent* __v,
407 : Message* __msg,
408 : bool __nullable);
409 :
410 : bool
411 : Read(
412 : PFTPChannelParent** __v,
413 : const Message* __msg,
414 : void** __iter,
415 : bool __nullable) NS_WARN_UNUSED_RESULT;
416 :
417 : void
418 : Write(
419 : PWebSocketParent* __v,
420 : Message* __msg,
421 : bool __nullable);
422 :
423 : bool
424 : Read(
425 : PWebSocketParent** __v,
426 : const Message* __msg,
427 : void** __iter,
428 : bool __nullable) NS_WARN_UNUSED_RESULT;
429 :
430 : void
431 : Write(
432 : PCookieServiceParent* __v,
433 : Message* __msg,
434 : bool __nullable);
435 :
436 : bool
437 : Read(
438 : PCookieServiceParent** __v,
439 : const Message* __msg,
440 : void** __iter,
441 : bool __nullable) NS_WARN_UNUSED_RESULT;
442 :
443 : Channel* mChannel;
444 : int32 mId;
445 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
446 : State mState;
447 : // Sorted by pointer value
448 : InfallibleTArray<PHttpChannelParent*> mManagedPHttpChannelParent;
449 : // Sorted by pointer value
450 : InfallibleTArray<PCookieServiceParent*> mManagedPCookieServiceParent;
451 : // Sorted by pointer value
452 : InfallibleTArray<PWyciwygChannelParent*> mManagedPWyciwygChannelParent;
453 : // Sorted by pointer value
454 : InfallibleTArray<PFTPChannelParent*> mManagedPFTPChannelParent;
455 : // Sorted by pointer value
456 : InfallibleTArray<PWebSocketParent*> mManagedPWebSocketParent;
457 : };
458 :
459 :
460 : } // namespace net
461 : } // namespace mozilla
462 :
463 : #if 0
464 :
465 : //-----------------------------------------------------------------------------
466 : // Skeleton implementation of abstract actor class
467 :
468 : // Header file contents
469 : namespace mozilla {
470 : namespace net {
471 : class NeckoParent :
472 : public PNeckoParent
473 : {
474 : virtual bool
475 : RecvHTMLDNSPrefetch(
476 : const nsString& hostname,
477 : const PRUint16& flags);
478 :
479 : virtual bool
480 : RecvCancelHTMLDNSPrefetch(
481 : const nsString& hostname,
482 : const PRUint16& flags,
483 : const nsresult& reason);
484 :
485 : virtual PCookieServiceParent*
486 : AllocPCookieService();
487 :
488 : virtual bool
489 : DeallocPCookieService(PCookieServiceParent* actor);
490 :
491 : virtual PWyciwygChannelParent*
492 : AllocPWyciwygChannel();
493 :
494 : virtual bool
495 : DeallocPWyciwygChannel(PWyciwygChannelParent* actor);
496 :
497 : virtual PFTPChannelParent*
498 : AllocPFTPChannel();
499 :
500 : virtual bool
501 : DeallocPFTPChannel(PFTPChannelParent* actor);
502 :
503 : virtual PWebSocketParent*
504 : AllocPWebSocket(PBrowserParent* browser);
505 :
506 : virtual bool
507 : DeallocPWebSocket(PWebSocketParent* actor);
508 :
509 : virtual PHttpChannelParent*
510 : AllocPHttpChannel(PBrowserParent* browser);
511 :
512 : virtual bool
513 : DeallocPHttpChannel(PHttpChannelParent* actor);
514 :
515 : NeckoParent();
516 : virtual ~NeckoParent();
517 : };
518 : } // namespace net
519 : } // namespace mozilla
520 :
521 :
522 : // C++ file contents
523 : namespace mozilla {
524 : namespace net {
525 : bool
526 : NeckoParent::RecvHTMLDNSPrefetch(
527 : const nsString& hostname,
528 : const PRUint16& flags)
529 : {
530 : return false;
531 : }
532 :
533 : bool
534 : NeckoParent::RecvCancelHTMLDNSPrefetch(
535 : const nsString& hostname,
536 : const PRUint16& flags,
537 : const nsresult& reason)
538 : {
539 : return false;
540 : }
541 :
542 : PCookieServiceParent*
543 : NeckoParent::AllocPCookieService()
544 : {
545 : return 0;
546 : }
547 :
548 : bool
549 : NeckoParent::DeallocPCookieService(PCookieServiceParent* actor)
550 : {
551 : return false;
552 : }
553 :
554 : PWyciwygChannelParent*
555 : NeckoParent::AllocPWyciwygChannel()
556 : {
557 : return 0;
558 : }
559 :
560 : bool
561 : NeckoParent::DeallocPWyciwygChannel(PWyciwygChannelParent* actor)
562 : {
563 : return false;
564 : }
565 :
566 : PFTPChannelParent*
567 : NeckoParent::AllocPFTPChannel()
568 : {
569 : return 0;
570 : }
571 :
572 : bool
573 : NeckoParent::DeallocPFTPChannel(PFTPChannelParent* actor)
574 : {
575 : return false;
576 : }
577 :
578 : PWebSocketParent*
579 : NeckoParent::AllocPWebSocket(PBrowserParent* browser)
580 : {
581 : return 0;
582 : }
583 :
584 : bool
585 : NeckoParent::DeallocPWebSocket(PWebSocketParent* actor)
586 : {
587 : return false;
588 : }
589 :
590 : PHttpChannelParent*
591 : NeckoParent::AllocPHttpChannel(PBrowserParent* browser)
592 : {
593 : return 0;
594 : }
595 :
596 : bool
597 : NeckoParent::DeallocPHttpChannel(PHttpChannelParent* actor)
598 : {
599 : return false;
600 : }
601 :
602 : NeckoParent::NeckoParent()
603 : {
604 : MOZ_COUNT_CTOR(NeckoParent);
605 : }
606 :
607 : NeckoParent::~NeckoParent()
608 : {
609 : MOZ_COUNT_DTOR(NeckoParent);
610 : }
611 :
612 : } // namespace net
613 : } // namespace mozilla
614 : #endif // if 0
615 :
616 : #endif // ifndef PNeckoParent_h
|