1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PBrowserStreamChild_h
7 : #define PBrowserStreamChild_h
8 :
9 : #include "mozilla/plugins/PBrowserStream.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*/ PBrowserStreamChild :
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::Buffer Buffer;
43 : typedef mozilla::plugins::IPCByteRanges IPCByteRanges;
44 : typedef mozilla::plugins::PPluginInstanceChild PPluginInstanceChild;
45 : typedef base::ProcessId ProcessId;
46 : typedef mozilla::ipc::ProtocolId ProtocolId;
47 : typedef mozilla::ipc::Transport Transport;
48 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
49 :
50 : typedef PBrowserStream::State State;
51 :
52 : virtual bool
53 : RecvWrite(
54 : const int32_t& offset,
55 : const Buffer& data,
56 : const uint32_t& newlength) = 0;
57 : virtual bool
58 : RecvNPP_StreamAsFile(const nsCString& fname) = 0;
59 : virtual bool
60 : RecvNPP_DestroyStream(const NPReason& reason) = 0;
61 : virtual bool
62 : Recv__delete__();
63 :
64 : virtual void
65 : ActorDestroy(ActorDestroyReason why);
66 :
67 : public:
68 : typedef IPC::Message Message;
69 : typedef mozilla::ipc::RPCChannel Channel;
70 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
71 : typedef base::ProcessHandle ProcessHandle;
72 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
73 : typedef mozilla::ipc::SharedMemory SharedMemory;
74 : typedef mozilla::ipc::Trigger Trigger;
75 :
76 : public:
77 : PBrowserStreamChild();
78 :
79 : virtual ~PBrowserStreamChild();
80 :
81 : PPluginInstanceChild*
82 : Manager();
83 :
84 : PBrowserStream::State
85 : state();
86 :
87 : bool
88 : CallNPN_RequestRead(
89 : const IPCByteRanges& ranges,
90 : NPError* result);
91 :
92 : bool
93 : SendNPN_DestroyStream(const NPReason& reason);
94 :
95 : bool
96 : SendStreamDestroyed();
97 :
98 : virtual int32
99 : Register(ChannelListener* aRouted);
100 : virtual int32
101 : RegisterID(
102 : ChannelListener* aRouted,
103 : int32 aId);
104 : virtual ChannelListener*
105 : Lookup(int32 aId);
106 : virtual void
107 : Unregister(int32 aId);
108 : virtual void
109 : RemoveManagee(
110 : int32 aProtocolId,
111 : ChannelListener* aListener);
112 : virtual Shmem::SharedMemory*
113 : CreateSharedMemory(
114 : size_t aSize,
115 : Shmem::SharedMemory::SharedMemoryType type,
116 : bool unsafe,
117 : Shmem::id_t* aId);
118 : virtual bool
119 : AdoptSharedMemory(
120 : Shmem::SharedMemory* segment,
121 : Shmem::id_t* aId);
122 : virtual Shmem::SharedMemory*
123 : LookupSharedMemory(Shmem::id_t aId);
124 : virtual bool
125 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
126 : virtual bool
127 : DestroySharedMemory(Shmem& aShmem);
128 : virtual ProcessHandle
129 : OtherProcess() const;
130 : virtual AsyncChannel*
131 : GetIPCChannel();
132 :
133 : virtual Result
134 : OnMessageReceived(const Message& __msg);
135 :
136 : virtual Result
137 : OnMessageReceived(
138 : const Message& __msg,
139 : Message*& __reply);
140 :
141 : virtual Result
142 : OnCallReceived(
143 : const Message& __msg,
144 : Message*& __reply);
145 :
146 : void
147 : OnProcessingError(Result code);
148 :
149 : bool
150 : OnReplyTimeout();
151 :
152 : void
153 : OnChannelClose();
154 :
155 : void
156 : OnChannelError();
157 :
158 : void
159 : OnChannelConnected(int32 pid);
160 :
161 : // Methods for managing shmem
162 : bool
163 : AllocShmem(
164 : size_t aSize,
165 : Shmem::SharedMemory::SharedMemoryType aType,
166 : Shmem* aMem);
167 :
168 : bool
169 : AllocUnsafeShmem(
170 : size_t aSize,
171 : Shmem::SharedMemory::SharedMemoryType aType,
172 : Shmem* aMem);
173 :
174 : bool
175 : AdoptShmem(
176 : Shmem& aMem,
177 : Shmem* aOutMem);
178 :
179 : bool
180 : DeallocShmem(Shmem& aMem);
181 :
182 : private:
183 : virtual void
184 : FatalError(const char* const msg) const;
185 :
186 : void
187 : DestroySubtree(ActorDestroyReason why);
188 :
189 : void
190 : DeallocSubtree();
191 :
192 : template<typename T>
193 : void
194 0 : Write(
195 : const T& __v,
196 : Message* __msg)
197 : {
198 0 : IPC::WriteParam(__msg, __v);
199 0 : }
200 :
201 : template<typename T>
202 : bool
203 0 : Read(
204 : T* __v,
205 : const Message* __msg,
206 : void** __iter)
207 : {
208 0 : return IPC::ReadParam(__msg, __iter, __v);
209 : }
210 :
211 : void
212 : Write(
213 : PBrowserStreamChild* __v,
214 : Message* __msg,
215 : bool __nullable);
216 :
217 : bool
218 : Read(
219 : PBrowserStreamChild** __v,
220 : const Message* __msg,
221 : void** __iter,
222 : bool __nullable) NS_WARN_UNUSED_RESULT;
223 :
224 : Channel* mChannel;
225 : int32 mId;
226 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
227 : State mState;
228 : };
229 :
230 :
231 : } // namespace plugins
232 : } // namespace mozilla
233 :
234 : #if 0
235 :
236 : //-----------------------------------------------------------------------------
237 : // Skeleton implementation of abstract actor class
238 :
239 : // Header file contents
240 : namespace mozilla {
241 : namespace plugins {
242 : class BrowserStreamChild :
243 : public PBrowserStreamChild
244 : {
245 : virtual bool
246 : RecvWrite(
247 : const int32_t& offset,
248 : const Buffer& data,
249 : const uint32_t& newlength);
250 :
251 : virtual bool
252 : RecvNPP_StreamAsFile(const nsCString& fname);
253 :
254 : virtual bool
255 : RecvNPP_DestroyStream(const NPReason& reason);
256 :
257 : BrowserStreamChild();
258 : virtual ~BrowserStreamChild();
259 : };
260 : } // namespace plugins
261 : } // namespace mozilla
262 :
263 :
264 : // C++ file contents
265 : namespace mozilla {
266 : namespace plugins {
267 : bool
268 : BrowserStreamChild::RecvWrite(
269 : const int32_t& offset,
270 : const Buffer& data,
271 : const uint32_t& newlength)
272 : {
273 : return false;
274 : }
275 :
276 : bool
277 : BrowserStreamChild::RecvNPP_StreamAsFile(const nsCString& fname)
278 : {
279 : return false;
280 : }
281 :
282 : bool
283 : BrowserStreamChild::RecvNPP_DestroyStream(const NPReason& reason)
284 : {
285 : return false;
286 : }
287 :
288 : BrowserStreamChild::BrowserStreamChild()
289 : {
290 : MOZ_COUNT_CTOR(BrowserStreamChild);
291 : }
292 :
293 : BrowserStreamChild::~BrowserStreamChild()
294 : {
295 : MOZ_COUNT_DTOR(BrowserStreamChild);
296 : }
297 :
298 : } // namespace plugins
299 : } // namespace mozilla
300 : #endif // if 0
301 :
302 : #endif // ifndef PBrowserStreamChild_h
|