|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 %{C++ |
|
9 template<class T> class nsTArray; |
|
10 template<class T> class nsCOMArray; |
|
11 class nsCString; |
|
12 %} |
|
13 [ptr] native StringArray(nsTArray<nsCString>); |
|
14 [ref] native securityMessagesArray(nsCOMArray<nsISecurityConsoleMessage>); |
|
15 |
|
16 interface nsISocketTransport; |
|
17 interface nsIAsyncInputStream; |
|
18 interface nsIAsyncOutputStream; |
|
19 interface nsIURI; |
|
20 interface nsIProxyInfo; |
|
21 interface nsISecurityConsoleMessage; |
|
22 |
|
23 /** |
|
24 * The callback interface for nsIHttpChannelInternal::HTTPUpgrade() |
|
25 */ |
|
26 |
|
27 [scriptable, uuid(4b967b6d-cd1c-49ae-a457-23ff76f5a2e8)] |
|
28 interface nsIHttpUpgradeListener : nsISupports |
|
29 { |
|
30 void onTransportAvailable(in nsISocketTransport aTransport, |
|
31 in nsIAsyncInputStream aSocketIn, |
|
32 in nsIAsyncOutputStream aSocketOut); |
|
33 }; |
|
34 |
|
35 /** |
|
36 * Dumping ground for http. This interface will never be frozen. If you are |
|
37 * using any feature exposed by this interface, be aware that this interface |
|
38 * will change and you will be broken. You have been warned. |
|
39 */ |
|
40 [scriptable, uuid(b733194f-6751-4876-a444-bca4ba3f2fcb)] |
|
41 interface nsIHttpChannelInternal : nsISupports |
|
42 { |
|
43 /** |
|
44 * An http channel can own a reference to the document URI |
|
45 */ |
|
46 attribute nsIURI documentURI; |
|
47 |
|
48 /** |
|
49 * Get the major/minor version numbers for the request |
|
50 */ |
|
51 void getRequestVersion(out unsigned long major, out unsigned long minor); |
|
52 |
|
53 /** |
|
54 * Get the major/minor version numbers for the response |
|
55 */ |
|
56 void getResponseVersion(out unsigned long major, out unsigned long minor); |
|
57 |
|
58 /* |
|
59 * Retrieves all security messages from the security message queue |
|
60 * and empties the queue after retrieval |
|
61 */ |
|
62 [noscript] void takeAllSecurityMessages(in securityMessagesArray aMessages); |
|
63 |
|
64 /** |
|
65 * Helper method to set a cookie with a consumer-provided |
|
66 * cookie header, _but_ using the channel's other information |
|
67 * (URI's, prompters, date headers etc). |
|
68 * |
|
69 * @param aCookieHeader |
|
70 * The cookie header to be parsed. |
|
71 */ |
|
72 void setCookie(in string aCookieHeader); |
|
73 |
|
74 /** |
|
75 * Setup this channel as an application cache fallback channel. |
|
76 */ |
|
77 void setupFallbackChannel(in string aFallbackKey); |
|
78 |
|
79 /** |
|
80 * Force relevant cookies to be sent with this load even if normally they |
|
81 * wouldn't be. |
|
82 */ |
|
83 attribute boolean forceAllowThirdPartyCookie; |
|
84 |
|
85 /** |
|
86 * True iff the channel has been canceled. |
|
87 */ |
|
88 readonly attribute boolean canceled; |
|
89 |
|
90 /** |
|
91 * External handlers may set this to true to notify the channel |
|
92 * that it is open on behalf of a download. |
|
93 */ |
|
94 attribute boolean channelIsForDownload; |
|
95 |
|
96 /** |
|
97 * The local IP address to which this channel is bound, in the |
|
98 * format produced by PR_NetAddrToString. May be IPv4 or IPv6. |
|
99 * Note: in the presence of NAT, this may not be the same as the |
|
100 * address that the remote host thinks it's talking to. |
|
101 * |
|
102 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's |
|
103 * endpoints are not yet determined, or in any case when |
|
104 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. |
|
105 */ |
|
106 readonly attribute AUTF8String localAddress; |
|
107 |
|
108 /** |
|
109 * The local port number to which this channel is bound. |
|
110 * |
|
111 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's |
|
112 * endpoints are not yet determined, or in any case when |
|
113 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. |
|
114 */ |
|
115 readonly attribute int32_t localPort; |
|
116 |
|
117 /** |
|
118 * The IP address of the remote host that this channel is |
|
119 * connected to, in the format produced by PR_NetAddrToString. |
|
120 * |
|
121 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's |
|
122 * endpoints are not yet determined, or in any case when |
|
123 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. |
|
124 */ |
|
125 readonly attribute AUTF8String remoteAddress; |
|
126 |
|
127 /** |
|
128 * The remote port number that this channel is connected to. |
|
129 * |
|
130 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's |
|
131 * endpoints are not yet determined, or in any case when |
|
132 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. |
|
133 */ |
|
134 readonly attribute int32_t remotePort; |
|
135 |
|
136 /** |
|
137 * Transfer chain of redirected cache-keys. |
|
138 */ |
|
139 [noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys); |
|
140 |
|
141 /** |
|
142 * HTTPUpgrade allows for the use of HTTP to bootstrap another protocol |
|
143 * via the RFC 2616 Upgrade request header in conjunction with a 101 level |
|
144 * response. The nsIHttpUpgradeListener will have its |
|
145 * onTransportAvailable() method invoked if a matching 101 is processed. |
|
146 * The arguments to onTransportAvailable provide the new protocol the low |
|
147 * level tranport streams that are no longer used by HTTP. |
|
148 * |
|
149 * The onStartRequest and onStopRequest events are still delivered and the |
|
150 * listener gets full control over the socket if and when onTransportAvailable |
|
151 * is delievered. |
|
152 * |
|
153 * @param aProtocolName |
|
154 * The value of the HTTP Upgrade request header |
|
155 * @param aListener |
|
156 * The callback object used to handle a successful upgrade |
|
157 */ |
|
158 void HTTPUpgrade(in ACString aProtocolName, |
|
159 in nsIHttpUpgradeListener aListener); |
|
160 |
|
161 /** |
|
162 * Enable/Disable Spdy negotiation on per channel basis. |
|
163 * The network.http.spdy.enabled preference is still a pre-requisite |
|
164 * for starting spdy. |
|
165 */ |
|
166 attribute boolean allowSpdy; |
|
167 |
|
168 /** |
|
169 * Set (e.g., by the docshell) to indicate whether or not the channel |
|
170 * corresponds to content that should be given a degree of network exclusivity |
|
171 * with respect to other members of its load group. |
|
172 * Examples are js from the HTML head and css which are latency |
|
173 * sensitive and should not compete with images for bandwidth. Default false. |
|
174 */ |
|
175 attribute boolean loadAsBlocking; |
|
176 |
|
177 /** |
|
178 * If set, this channel will load in parallel with the rest of the load |
|
179 * group even if a blocking subset of the group would normally be given |
|
180 * exclusivity. Default false. |
|
181 */ |
|
182 attribute boolean loadUnblocked; |
|
183 |
|
184 /** |
|
185 * This attribute en/disables the timeout for the first byte of an HTTP |
|
186 * response. Enabled by default. |
|
187 */ |
|
188 attribute boolean responseTimeoutEnabled; |
|
189 |
|
190 /** |
|
191 * Get value of the URI passed to nsIHttpChannel.redirectTo() if any. |
|
192 * May return null when redirectTo() has not been called. |
|
193 */ |
|
194 readonly attribute nsIURI apiRedirectToURI; |
|
195 }; |