1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PHttpChannelParent_h
7 : #define PHttpChannelParent_h
8 :
9 : #include "mozilla/net/PHttpChannel.h"
10 : namespace mozilla {
11 : namespace net {
12 : class PNeckoParent;
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 PNeckoParent;
26 : } // namespace net
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace net {
31 :
32 :
33 : class /*NS_ABSTRACT_CLASS*/ PHttpChannelParent :
34 : protected mozilla::ipc::RPCChannel::RPCListener,
35 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
36 : {
37 : friend class mozilla::net::PNeckoParent;
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::PNeckoParent PNeckoParent;
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 PHttpChannel::State State;
51 :
52 : virtual bool
53 : RecvAsyncOpen(
54 : const URI& uri,
55 : const URI& original,
56 : const URI& doc,
57 : const URI& referrer,
58 : const PRUint32& loadFlags,
59 : const RequestHeaderTuples& requestHeaders,
60 : const nsHttpAtom& requestMethod,
61 : const InputStream& uploadStream,
62 : const bool& uploadStreamHasHeaders,
63 : const PRUint16& priority,
64 : const PRUint8& redirectionLimit,
65 : const bool& allowPipelining,
66 : const bool& forceAllowThirdPartyCookie,
67 : const bool& resumeAt,
68 : const PRUint64& startPos,
69 : const nsCString& entityID,
70 : const bool& chooseApplicationCache,
71 : const nsCString& appCacheClientID,
72 : const bool& allowSpdy) = 0;
73 : virtual bool
74 : RecvConnectChannel(const PRUint32& channelId) = 0;
75 : virtual bool
76 : RecvSetPriority(const PRUint16& priority) = 0;
77 : virtual bool
78 : RecvSetCacheTokenCachedCharset(const nsCString& charset) = 0;
79 : virtual bool
80 : RecvUpdateAssociatedContentSecurity(
81 : const PRInt32& high,
82 : const PRInt32& low,
83 : const PRInt32& broken,
84 : const PRInt32& no) = 0;
85 : virtual bool
86 : RecvSuspend() = 0;
87 : virtual bool
88 : RecvResume() = 0;
89 : virtual bool
90 : RecvCancel(const nsresult& status) = 0;
91 : virtual bool
92 : RecvRedirect2Verify(
93 : const nsresult& result,
94 : const RequestHeaderTuples& changedHeaders) = 0;
95 : virtual bool
96 : RecvDocumentChannelCleanup() = 0;
97 : virtual bool
98 : RecvMarkOfflineCacheEntryAsForeign() = 0;
99 : virtual bool
100 : Recv__delete__();
101 :
102 : virtual void
103 : ActorDestroy(ActorDestroyReason why);
104 :
105 : public:
106 : typedef IPC::Message Message;
107 : typedef mozilla::ipc::RPCChannel Channel;
108 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
109 : typedef base::ProcessHandle ProcessHandle;
110 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
111 : typedef mozilla::ipc::SharedMemory SharedMemory;
112 : typedef mozilla::ipc::Trigger Trigger;
113 :
114 : public:
115 : PHttpChannelParent();
116 :
117 : virtual ~PHttpChannelParent();
118 :
119 : PNeckoParent*
120 : Manager();
121 :
122 : PHttpChannel::State
123 : state();
124 :
125 : bool
126 : SendOnStartRequest(
127 : const nsHttpResponseHead& responseHead,
128 : const bool& useResponseHead,
129 : const nsHttpHeaderArray& requestHeaders,
130 : const bool& isFromCache,
131 : const bool& cacheEntryAvailable,
132 : const PRUint32& cacheExpirationTime,
133 : const nsCString& cachedCharset,
134 : const nsCString& securityInfoSerialization,
135 : const PRNetAddr& selfAddr,
136 : const PRNetAddr& peerAddr) NS_WARN_UNUSED_RESULT;
137 :
138 : bool
139 : SendOnTransportAndData(
140 : const nsresult& status,
141 : const PRUint64& progress,
142 : const PRUint64& progressMax,
143 : const nsCString& data,
144 : const PRUint32& offset,
145 : const PRUint32& count) NS_WARN_UNUSED_RESULT;
146 :
147 : bool
148 : SendOnStopRequest(const nsresult& statusCode) NS_WARN_UNUSED_RESULT;
149 :
150 : bool
151 : SendOnProgress(
152 : const PRUint64& progress,
153 : const PRUint64& progressMax) NS_WARN_UNUSED_RESULT;
154 :
155 : bool
156 : SendOnStatus(const nsresult& status) NS_WARN_UNUSED_RESULT;
157 :
158 : bool
159 : SendFailedAsyncOpen(const nsresult& status) NS_WARN_UNUSED_RESULT;
160 :
161 : bool
162 : SendRedirect1Begin(
163 : const PRUint32& newChannelId,
164 : const URI& newUri,
165 : const PRUint32& redirectFlags,
166 : const nsHttpResponseHead& responseHead) NS_WARN_UNUSED_RESULT;
167 :
168 : bool
169 : SendRedirect3Complete() NS_WARN_UNUSED_RESULT;
170 :
171 : bool
172 : SendAssociateApplicationCache(
173 : const nsCString& groupID,
174 : const nsCString& clientID) NS_WARN_UNUSED_RESULT;
175 :
176 : bool
177 : SendDeleteSelf() NS_WARN_UNUSED_RESULT;
178 :
179 : virtual int32
180 : Register(ChannelListener* aRouted);
181 : virtual int32
182 : RegisterID(
183 : ChannelListener* aRouted,
184 : int32 aId);
185 : virtual ChannelListener*
186 : Lookup(int32 aId);
187 : virtual void
188 : Unregister(int32 aId);
189 : virtual void
190 : RemoveManagee(
191 : int32 aProtocolId,
192 : ChannelListener* aListener);
193 : virtual Shmem::SharedMemory*
194 : CreateSharedMemory(
195 : size_t aSize,
196 : Shmem::SharedMemory::SharedMemoryType type,
197 : bool unsafe,
198 : Shmem::id_t* aId);
199 : virtual bool
200 : AdoptSharedMemory(
201 : Shmem::SharedMemory* segment,
202 : Shmem::id_t* aId);
203 : virtual Shmem::SharedMemory*
204 : LookupSharedMemory(Shmem::id_t aId);
205 : virtual bool
206 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
207 : virtual bool
208 : DestroySharedMemory(Shmem& aShmem);
209 : virtual ProcessHandle
210 : OtherProcess() const;
211 : virtual AsyncChannel*
212 : GetIPCChannel();
213 :
214 : virtual Result
215 : OnMessageReceived(const Message& __msg);
216 :
217 : virtual Result
218 : OnMessageReceived(
219 : const Message& __msg,
220 : Message*& __reply);
221 :
222 : virtual Result
223 : OnCallReceived(
224 : const Message& __msg,
225 : Message*& __reply);
226 :
227 : void
228 : OnProcessingError(Result code);
229 :
230 : bool
231 : OnReplyTimeout();
232 :
233 : void
234 : OnChannelClose();
235 :
236 : void
237 : OnChannelError();
238 :
239 : void
240 : OnChannelConnected(int32 pid);
241 :
242 : // Methods for managing shmem
243 : bool
244 : AllocShmem(
245 : size_t aSize,
246 : Shmem::SharedMemory::SharedMemoryType aType,
247 : Shmem* aMem);
248 :
249 : bool
250 : AllocUnsafeShmem(
251 : size_t aSize,
252 : Shmem::SharedMemory::SharedMemoryType aType,
253 : Shmem* aMem);
254 :
255 : bool
256 : AdoptShmem(
257 : Shmem& aMem,
258 : Shmem* aOutMem);
259 :
260 : bool
261 : DeallocShmem(Shmem& aMem);
262 :
263 : private:
264 : virtual void
265 : FatalError(const char* const msg) const;
266 :
267 : void
268 : DestroySubtree(ActorDestroyReason why);
269 :
270 : void
271 : DeallocSubtree();
272 :
273 : template<typename T>
274 : void
275 0 : Write(
276 : const T& __v,
277 : Message* __msg)
278 : {
279 0 : IPC::WriteParam(__msg, __v);
280 0 : }
281 :
282 : template<typename T>
283 : bool
284 0 : Read(
285 : T* __v,
286 : const Message* __msg,
287 : void** __iter)
288 : {
289 0 : return IPC::ReadParam(__msg, __iter, __v);
290 : }
291 :
292 : void
293 : Write(
294 : PHttpChannelParent* __v,
295 : Message* __msg,
296 : bool __nullable);
297 :
298 : bool
299 : Read(
300 : PHttpChannelParent** __v,
301 : const Message* __msg,
302 : void** __iter,
303 : bool __nullable) NS_WARN_UNUSED_RESULT;
304 :
305 : Channel* mChannel;
306 : int32 mId;
307 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
308 : State mState;
309 : };
310 :
311 :
312 : } // namespace net
313 : } // namespace mozilla
314 :
315 : #if 0
316 :
317 : //-----------------------------------------------------------------------------
318 : // Skeleton implementation of abstract actor class
319 :
320 : // Header file contents
321 : namespace mozilla {
322 : namespace net {
323 : class HttpChannelParent :
324 : public PHttpChannelParent
325 : {
326 : virtual bool
327 : RecvAsyncOpen(
328 : const URI& uri,
329 : const URI& original,
330 : const URI& doc,
331 : const URI& referrer,
332 : const PRUint32& loadFlags,
333 : const RequestHeaderTuples& requestHeaders,
334 : const nsHttpAtom& requestMethod,
335 : const InputStream& uploadStream,
336 : const bool& uploadStreamHasHeaders,
337 : const PRUint16& priority,
338 : const PRUint8& redirectionLimit,
339 : const bool& allowPipelining,
340 : const bool& forceAllowThirdPartyCookie,
341 : const bool& resumeAt,
342 : const PRUint64& startPos,
343 : const nsCString& entityID,
344 : const bool& chooseApplicationCache,
345 : const nsCString& appCacheClientID,
346 : const bool& allowSpdy);
347 :
348 : virtual bool
349 : RecvConnectChannel(const PRUint32& channelId);
350 :
351 : virtual bool
352 : RecvSetPriority(const PRUint16& priority);
353 :
354 : virtual bool
355 : RecvSetCacheTokenCachedCharset(const nsCString& charset);
356 :
357 : virtual bool
358 : RecvUpdateAssociatedContentSecurity(
359 : const PRInt32& high,
360 : const PRInt32& low,
361 : const PRInt32& broken,
362 : const PRInt32& no);
363 :
364 : virtual bool
365 : RecvSuspend();
366 :
367 : virtual bool
368 : RecvResume();
369 :
370 : virtual bool
371 : RecvCancel(const nsresult& status);
372 :
373 : virtual bool
374 : RecvRedirect2Verify(
375 : const nsresult& result,
376 : const RequestHeaderTuples& changedHeaders);
377 :
378 : virtual bool
379 : RecvDocumentChannelCleanup();
380 :
381 : virtual bool
382 : RecvMarkOfflineCacheEntryAsForeign();
383 :
384 : HttpChannelParent();
385 : virtual ~HttpChannelParent();
386 : };
387 : } // namespace net
388 : } // namespace mozilla
389 :
390 :
391 : // C++ file contents
392 : namespace mozilla {
393 : namespace net {
394 : bool
395 : HttpChannelParent::RecvAsyncOpen(
396 : const URI& uri,
397 : const URI& original,
398 : const URI& doc,
399 : const URI& referrer,
400 : const PRUint32& loadFlags,
401 : const RequestHeaderTuples& requestHeaders,
402 : const nsHttpAtom& requestMethod,
403 : const InputStream& uploadStream,
404 : const bool& uploadStreamHasHeaders,
405 : const PRUint16& priority,
406 : const PRUint8& redirectionLimit,
407 : const bool& allowPipelining,
408 : const bool& forceAllowThirdPartyCookie,
409 : const bool& resumeAt,
410 : const PRUint64& startPos,
411 : const nsCString& entityID,
412 : const bool& chooseApplicationCache,
413 : const nsCString& appCacheClientID,
414 : const bool& allowSpdy)
415 : {
416 : return false;
417 : }
418 :
419 : bool
420 : HttpChannelParent::RecvConnectChannel(const PRUint32& channelId)
421 : {
422 : return false;
423 : }
424 :
425 : bool
426 : HttpChannelParent::RecvSetPriority(const PRUint16& priority)
427 : {
428 : return false;
429 : }
430 :
431 : bool
432 : HttpChannelParent::RecvSetCacheTokenCachedCharset(const nsCString& charset)
433 : {
434 : return false;
435 : }
436 :
437 : bool
438 : HttpChannelParent::RecvUpdateAssociatedContentSecurity(
439 : const PRInt32& high,
440 : const PRInt32& low,
441 : const PRInt32& broken,
442 : const PRInt32& no)
443 : {
444 : return false;
445 : }
446 :
447 : bool
448 : HttpChannelParent::RecvSuspend()
449 : {
450 : return false;
451 : }
452 :
453 : bool
454 : HttpChannelParent::RecvResume()
455 : {
456 : return false;
457 : }
458 :
459 : bool
460 : HttpChannelParent::RecvCancel(const nsresult& status)
461 : {
462 : return false;
463 : }
464 :
465 : bool
466 : HttpChannelParent::RecvRedirect2Verify(
467 : const nsresult& result,
468 : const RequestHeaderTuples& changedHeaders)
469 : {
470 : return false;
471 : }
472 :
473 : bool
474 : HttpChannelParent::RecvDocumentChannelCleanup()
475 : {
476 : return false;
477 : }
478 :
479 : bool
480 : HttpChannelParent::RecvMarkOfflineCacheEntryAsForeign()
481 : {
482 : return false;
483 : }
484 :
485 : HttpChannelParent::HttpChannelParent()
486 : {
487 : MOZ_COUNT_CTOR(HttpChannelParent);
488 : }
489 :
490 : HttpChannelParent::~HttpChannelParent()
491 : {
492 : MOZ_COUNT_DTOR(HttpChannelParent);
493 : }
494 :
495 : } // namespace net
496 : } // namespace mozilla
497 : #endif // if 0
498 :
499 : #endif // ifndef PHttpChannelParent_h
|