1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PFTPChannelChild_h
7 : #define PFTPChannelChild_h
8 :
9 : #include "mozilla/net/PFTPChannel.h"
10 : namespace mozilla {
11 : namespace net {
12 : class PNeckoChild;
13 : } // namespace net
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 net {
25 : class PNeckoChild;
26 : } // namespace net
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace net {
31 :
32 :
33 : class /*NS_ABSTRACT_CLASS*/ PFTPChannelChild :
34 : protected mozilla::ipc::RPCChannel::RPCListener,
35 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
36 : {
37 : friend class mozilla::net::PNeckoChild;
38 :
39 : protected:
40 : typedef mozilla::ipc::ActorHandle ActorHandle;
41 : typedef mozilla::ipc::Shmem Shmem;
42 : typedef IPC::URI URI;
43 : typedef IPC::InputStream InputStream;
44 : typedef mozilla::net::PNeckoChild PNeckoChild;
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 PFTPChannel::State State;
51 :
52 : virtual bool
53 : RecvOnStartRequest(
54 : const PRInt32& aContentLength,
55 : const nsCString& aContentType,
56 : const PRTime& aLastModified,
57 : const nsCString& aEntityID,
58 : const URI& aURI) = 0;
59 : virtual bool
60 : RecvOnDataAvailable(
61 : const nsCString& data,
62 : const PRUint32& offset,
63 : const PRUint32& count) = 0;
64 : virtual bool
65 : RecvOnStopRequest(const nsresult& statusCode) = 0;
66 : virtual bool
67 : RecvFailedAsyncOpen(const nsresult& statusCode) = 0;
68 : virtual bool
69 : RecvDeleteSelf() = 0;
70 :
71 : virtual void
72 : ActorDestroy(ActorDestroyReason why);
73 :
74 : public:
75 : typedef IPC::Message Message;
76 : typedef mozilla::ipc::RPCChannel Channel;
77 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
78 : typedef base::ProcessHandle ProcessHandle;
79 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
80 : typedef mozilla::ipc::SharedMemory SharedMemory;
81 : typedef mozilla::ipc::Trigger Trigger;
82 :
83 : public:
84 : PFTPChannelChild();
85 :
86 : virtual ~PFTPChannelChild();
87 :
88 : PNeckoChild*
89 : Manager();
90 :
91 : PFTPChannel::State
92 : state();
93 :
94 : static bool
95 : Send__delete__(PFTPChannelChild* actor);
96 :
97 : bool
98 : SendAsyncOpen(
99 : const URI& uri,
100 : const PRUint64& startPos,
101 : const nsCString& entityID,
102 : const InputStream& uploadStream);
103 :
104 : bool
105 : SendConnectChannel(const PRUint32& channelId);
106 :
107 : bool
108 : SendCancel(const nsresult& status);
109 :
110 : bool
111 : SendSuspend();
112 :
113 : bool
114 : SendResume();
115 :
116 : virtual int32
117 : Register(ChannelListener* aRouted);
118 : virtual int32
119 : RegisterID(
120 : ChannelListener* aRouted,
121 : int32 aId);
122 : virtual ChannelListener*
123 : Lookup(int32 aId);
124 : virtual void
125 : Unregister(int32 aId);
126 : virtual void
127 : RemoveManagee(
128 : int32 aProtocolId,
129 : ChannelListener* aListener);
130 : virtual Shmem::SharedMemory*
131 : CreateSharedMemory(
132 : size_t aSize,
133 : Shmem::SharedMemory::SharedMemoryType type,
134 : bool unsafe,
135 : Shmem::id_t* aId);
136 : virtual bool
137 : AdoptSharedMemory(
138 : Shmem::SharedMemory* segment,
139 : Shmem::id_t* aId);
140 : virtual Shmem::SharedMemory*
141 : LookupSharedMemory(Shmem::id_t aId);
142 : virtual bool
143 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
144 : virtual bool
145 : DestroySharedMemory(Shmem& aShmem);
146 : virtual ProcessHandle
147 : OtherProcess() const;
148 : virtual AsyncChannel*
149 : GetIPCChannel();
150 :
151 : virtual Result
152 : OnMessageReceived(const Message& __msg);
153 :
154 : virtual Result
155 : OnMessageReceived(
156 : const Message& __msg,
157 : Message*& __reply);
158 :
159 : virtual Result
160 : OnCallReceived(
161 : const Message& __msg,
162 : Message*& __reply);
163 :
164 : void
165 : OnProcessingError(Result code);
166 :
167 : bool
168 : OnReplyTimeout();
169 :
170 : void
171 : OnChannelClose();
172 :
173 : void
174 : OnChannelError();
175 :
176 : void
177 : OnChannelConnected(int32 pid);
178 :
179 : // Methods for managing shmem
180 : bool
181 : AllocShmem(
182 : size_t aSize,
183 : Shmem::SharedMemory::SharedMemoryType aType,
184 : Shmem* aMem);
185 :
186 : bool
187 : AllocUnsafeShmem(
188 : size_t aSize,
189 : Shmem::SharedMemory::SharedMemoryType aType,
190 : Shmem* aMem);
191 :
192 : bool
193 : AdoptShmem(
194 : Shmem& aMem,
195 : Shmem* aOutMem);
196 :
197 : bool
198 : DeallocShmem(Shmem& aMem);
199 :
200 : private:
201 : virtual void
202 : FatalError(const char* const msg) const;
203 :
204 : void
205 : DestroySubtree(ActorDestroyReason why);
206 :
207 : void
208 : DeallocSubtree();
209 :
210 : template<typename T>
211 : void
212 0 : Write(
213 : const T& __v,
214 : Message* __msg)
215 : {
216 0 : IPC::WriteParam(__msg, __v);
217 0 : }
218 :
219 : template<typename T>
220 : bool
221 0 : Read(
222 : T* __v,
223 : const Message* __msg,
224 : void** __iter)
225 : {
226 0 : return IPC::ReadParam(__msg, __iter, __v);
227 : }
228 :
229 : void
230 : Write(
231 : PFTPChannelChild* __v,
232 : Message* __msg,
233 : bool __nullable);
234 :
235 : bool
236 : Read(
237 : PFTPChannelChild** __v,
238 : const Message* __msg,
239 : void** __iter,
240 : bool __nullable) NS_WARN_UNUSED_RESULT;
241 :
242 : Channel* mChannel;
243 : int32 mId;
244 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
245 : State mState;
246 : };
247 :
248 :
249 : } // namespace net
250 : } // namespace mozilla
251 :
252 : #if 0
253 :
254 : //-----------------------------------------------------------------------------
255 : // Skeleton implementation of abstract actor class
256 :
257 : // Header file contents
258 : namespace mozilla {
259 : namespace net {
260 : class FTPChannelChild :
261 : public PFTPChannelChild
262 : {
263 : virtual bool
264 : RecvOnStartRequest(
265 : const PRInt32& aContentLength,
266 : const nsCString& aContentType,
267 : const PRTime& aLastModified,
268 : const nsCString& aEntityID,
269 : const URI& aURI);
270 :
271 : virtual bool
272 : RecvOnDataAvailable(
273 : const nsCString& data,
274 : const PRUint32& offset,
275 : const PRUint32& count);
276 :
277 : virtual bool
278 : RecvOnStopRequest(const nsresult& statusCode);
279 :
280 : virtual bool
281 : RecvFailedAsyncOpen(const nsresult& statusCode);
282 :
283 : virtual bool
284 : RecvDeleteSelf();
285 :
286 : FTPChannelChild();
287 : virtual ~FTPChannelChild();
288 : };
289 : } // namespace net
290 : } // namespace mozilla
291 :
292 :
293 : // C++ file contents
294 : namespace mozilla {
295 : namespace net {
296 : bool
297 : FTPChannelChild::RecvOnStartRequest(
298 : const PRInt32& aContentLength,
299 : const nsCString& aContentType,
300 : const PRTime& aLastModified,
301 : const nsCString& aEntityID,
302 : const URI& aURI)
303 : {
304 : return false;
305 : }
306 :
307 : bool
308 : FTPChannelChild::RecvOnDataAvailable(
309 : const nsCString& data,
310 : const PRUint32& offset,
311 : const PRUint32& count)
312 : {
313 : return false;
314 : }
315 :
316 : bool
317 : FTPChannelChild::RecvOnStopRequest(const nsresult& statusCode)
318 : {
319 : return false;
320 : }
321 :
322 : bool
323 : FTPChannelChild::RecvFailedAsyncOpen(const nsresult& statusCode)
324 : {
325 : return false;
326 : }
327 :
328 : bool
329 : FTPChannelChild::RecvDeleteSelf()
330 : {
331 : return false;
332 : }
333 :
334 : FTPChannelChild::FTPChannelChild()
335 : {
336 : MOZ_COUNT_CTOR(FTPChannelChild);
337 : }
338 :
339 : FTPChannelChild::~FTPChannelChild()
340 : {
341 : MOZ_COUNT_DTOR(FTPChannelChild);
342 : }
343 :
344 : } // namespace net
345 : } // namespace mozilla
346 : #endif // if 0
347 :
348 : #endif // ifndef PFTPChannelChild_h
|