|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ |
|
3 |
|
4 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
7 |
|
8 include protocol PNecko; |
|
9 include InputStreamParams; |
|
10 include URIParams; |
|
11 |
|
12 //FIXME: bug #792908 (NeckoChannelParams already included by PNecko) |
|
13 include NeckoChannelParams; |
|
14 include protocol PBlob; //FIXME: bug #792908 |
|
15 |
|
16 using PRTime from "prtime.h"; |
|
17 |
|
18 namespace mozilla { |
|
19 namespace net { |
|
20 |
|
21 async protocol PFTPChannel |
|
22 { |
|
23 manager PNecko; |
|
24 |
|
25 parent: |
|
26 // Note: channels are opened during construction, so no open method here: |
|
27 // see PNecko.ipdl |
|
28 |
|
29 __delete__(); |
|
30 |
|
31 Cancel(nsresult status); |
|
32 Suspend(); |
|
33 Resume(); |
|
34 |
|
35 // Divert OnDataAvailable to the parent. |
|
36 DivertOnDataAvailable(nsCString data, |
|
37 uint64_t offset, |
|
38 uint32_t count); |
|
39 |
|
40 // Divert OnStopRequest to the parent. |
|
41 DivertOnStopRequest(nsresult statusCode); |
|
42 |
|
43 // Child has no more events/messages to divert to the parent. |
|
44 DivertComplete(); |
|
45 |
|
46 child: |
|
47 OnStartRequest(nsresult aChannelStatus, |
|
48 int64_t aContentLength, |
|
49 nsCString aContentType, |
|
50 PRTime aLastModified, |
|
51 nsCString aEntityID, |
|
52 URIParams aURI); |
|
53 OnDataAvailable(nsresult channelStatus, |
|
54 nsCString data, |
|
55 uint64_t offset, |
|
56 uint32_t count); |
|
57 OnStopRequest(nsresult channelStatus); |
|
58 FailedAsyncOpen(nsresult statusCode); |
|
59 |
|
60 // Parent has been suspended for diversion; no more events to be enqueued. |
|
61 FlushedForDiversion(); |
|
62 |
|
63 // Child should resume processing the ChannelEventQueue, i.e. diverting any |
|
64 // OnDataAvailable and OnStopRequest messages in the queue back to the parent. |
|
65 DivertMessages(); |
|
66 |
|
67 DeleteSelf(); |
|
68 }; |
|
69 |
|
70 } // namespace net |
|
71 } // namespace mozilla |
|
72 |