1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PStreamNotifyChild_h
7 : #define PStreamNotifyChild_h
8 :
9 : #include "mozilla/plugins/PStreamNotify.h"
10 : namespace mozilla {
11 : namespace plugins {
12 : class PPluginInstanceChild;
13 : } // namespace plugins
14 : } // namespace mozilla
15 :
16 : #ifdef DEBUG
17 : #include "prenv.h"
18 : #endif // DEBUG
19 : #include "base/id_map.h"
20 : #include "mozilla/ipc/RPCChannel.h"
21 :
22 :
23 : namespace mozilla {
24 : namespace plugins {
25 : class PPluginInstanceChild;
26 : } // namespace plugins
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace plugins {
31 :
32 :
33 : class /*NS_ABSTRACT_CLASS*/ PStreamNotifyChild :
34 : protected mozilla::ipc::RPCChannel::RPCListener,
35 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
36 : {
37 : friend class mozilla::plugins::PPluginInstanceChild;
38 :
39 : protected:
40 : typedef mozilla::ipc::ActorHandle ActorHandle;
41 : typedef mozilla::ipc::Shmem Shmem;
42 : typedef mozilla::plugins::PPluginInstanceChild PPluginInstanceChild;
43 : typedef base::ProcessId ProcessId;
44 : typedef mozilla::ipc::ProtocolId ProtocolId;
45 : typedef mozilla::ipc::Transport Transport;
46 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
47 :
48 : typedef PStreamNotify::State State;
49 :
50 : virtual bool
51 : RecvRedirectNotify(
52 : const nsCString& url,
53 : const int32_t& status) = 0;
54 : virtual bool
55 : Recv__delete__(const NPReason& reason);
56 :
57 : virtual void
58 : ActorDestroy(ActorDestroyReason why);
59 :
60 : public:
61 : typedef IPC::Message Message;
62 : typedef mozilla::ipc::RPCChannel Channel;
63 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
64 : typedef base::ProcessHandle ProcessHandle;
65 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
66 : typedef mozilla::ipc::SharedMemory SharedMemory;
67 : typedef mozilla::ipc::Trigger Trigger;
68 :
69 : public:
70 : PStreamNotifyChild();
71 :
72 : virtual ~PStreamNotifyChild();
73 :
74 : PPluginInstanceChild*
75 : Manager();
76 :
77 : PStreamNotify::State
78 : state();
79 :
80 : bool
81 : SendRedirectNotifyResponse(const bool& allow);
82 :
83 : virtual int32
84 : Register(ChannelListener* aRouted);
85 : virtual int32
86 : RegisterID(
87 : ChannelListener* aRouted,
88 : int32 aId);
89 : virtual ChannelListener*
90 : Lookup(int32 aId);
91 : virtual void
92 : Unregister(int32 aId);
93 : virtual void
94 : RemoveManagee(
95 : int32 aProtocolId,
96 : ChannelListener* aListener);
97 : virtual Shmem::SharedMemory*
98 : CreateSharedMemory(
99 : size_t aSize,
100 : Shmem::SharedMemory::SharedMemoryType type,
101 : bool unsafe,
102 : Shmem::id_t* aId);
103 : virtual bool
104 : AdoptSharedMemory(
105 : Shmem::SharedMemory* segment,
106 : Shmem::id_t* aId);
107 : virtual Shmem::SharedMemory*
108 : LookupSharedMemory(Shmem::id_t aId);
109 : virtual bool
110 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
111 : virtual bool
112 : DestroySharedMemory(Shmem& aShmem);
113 : virtual ProcessHandle
114 : OtherProcess() const;
115 : virtual AsyncChannel*
116 : GetIPCChannel();
117 :
118 : virtual Result
119 : OnMessageReceived(const Message& __msg);
120 :
121 : virtual Result
122 : OnMessageReceived(
123 : const Message& __msg,
124 : Message*& __reply);
125 :
126 : virtual Result
127 : OnCallReceived(
128 : const Message& __msg,
129 : Message*& __reply);
130 :
131 : void
132 : OnProcessingError(Result code);
133 :
134 : bool
135 : OnReplyTimeout();
136 :
137 : void
138 : OnChannelClose();
139 :
140 : void
141 : OnChannelError();
142 :
143 : void
144 : OnChannelConnected(int32 pid);
145 :
146 : // Methods for managing shmem
147 : bool
148 : AllocShmem(
149 : size_t aSize,
150 : Shmem::SharedMemory::SharedMemoryType aType,
151 : Shmem* aMem);
152 :
153 : bool
154 : AllocUnsafeShmem(
155 : size_t aSize,
156 : Shmem::SharedMemory::SharedMemoryType aType,
157 : Shmem* aMem);
158 :
159 : bool
160 : AdoptShmem(
161 : Shmem& aMem,
162 : Shmem* aOutMem);
163 :
164 : bool
165 : DeallocShmem(Shmem& aMem);
166 :
167 : private:
168 : virtual void
169 : FatalError(const char* const msg) const;
170 :
171 : void
172 : DestroySubtree(ActorDestroyReason why);
173 :
174 : void
175 : DeallocSubtree();
176 :
177 : template<typename T>
178 : void
179 0 : Write(
180 : const T& __v,
181 : Message* __msg)
182 : {
183 0 : IPC::WriteParam(__msg, __v);
184 0 : }
185 :
186 : template<typename T>
187 : bool
188 0 : Read(
189 : T* __v,
190 : const Message* __msg,
191 : void** __iter)
192 : {
193 0 : return IPC::ReadParam(__msg, __iter, __v);
194 : }
195 :
196 : void
197 : Write(
198 : PStreamNotifyChild* __v,
199 : Message* __msg,
200 : bool __nullable);
201 :
202 : bool
203 : Read(
204 : PStreamNotifyChild** __v,
205 : const Message* __msg,
206 : void** __iter,
207 : bool __nullable) NS_WARN_UNUSED_RESULT;
208 :
209 : Channel* mChannel;
210 : int32 mId;
211 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
212 : State mState;
213 : };
214 :
215 :
216 : } // namespace plugins
217 : } // namespace mozilla
218 :
219 : #if 0
220 :
221 : //-----------------------------------------------------------------------------
222 : // Skeleton implementation of abstract actor class
223 :
224 : // Header file contents
225 : namespace mozilla {
226 : namespace plugins {
227 : class StreamNotifyChild :
228 : public PStreamNotifyChild
229 : {
230 : virtual bool
231 : RecvRedirectNotify(
232 : const nsCString& url,
233 : const int32_t& status);
234 :
235 : StreamNotifyChild();
236 : virtual ~StreamNotifyChild();
237 : };
238 : } // namespace plugins
239 : } // namespace mozilla
240 :
241 :
242 : // C++ file contents
243 : namespace mozilla {
244 : namespace plugins {
245 : bool
246 : StreamNotifyChild::RecvRedirectNotify(
247 : const nsCString& url,
248 : const int32_t& status)
249 : {
250 : return false;
251 : }
252 :
253 : StreamNotifyChild::StreamNotifyChild()
254 : {
255 : MOZ_COUNT_CTOR(StreamNotifyChild);
256 : }
257 :
258 : StreamNotifyChild::~StreamNotifyChild()
259 : {
260 : MOZ_COUNT_DTOR(StreamNotifyChild);
261 : }
262 :
263 : } // namespace plugins
264 : } // namespace mozilla
265 : #endif // if 0
266 :
267 : #endif // ifndef PStreamNotifyChild_h
|