|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 |
|
7 interface nsIInputStream; |
|
8 interface nsIURI; |
|
9 |
|
10 /** |
|
11 * nsIInputStreamChannel |
|
12 * |
|
13 * This interface provides methods to initialize an input stream channel. |
|
14 * The input stream channel serves as a data pump for an input stream. |
|
15 */ |
|
16 [scriptable, uuid(17a17ce4-9a07-43fb-a0a3-947a6e21476c)] |
|
17 interface nsIInputStreamChannel : nsISupports |
|
18 { |
|
19 /** |
|
20 * Sets the URI for this channel. This must be called before the |
|
21 * channel is opened, and it may only be called once. |
|
22 */ |
|
23 void setURI(in nsIURI aURI); |
|
24 |
|
25 /** |
|
26 * Get/set the content stream |
|
27 * |
|
28 * This stream contains the data that will be pushed to the channel's |
|
29 * stream listener. If the stream is non-blocking and supports the |
|
30 * nsIAsyncInputStream interface, then the stream will be read directly. |
|
31 * Otherwise, the stream will be read on a background thread. |
|
32 * |
|
33 * This attribute must be set before the channel is opened, and it may |
|
34 * only be set once. |
|
35 * |
|
36 * @throws NS_ERROR_IN_PROGRESS if the setter is called after the channel |
|
37 * has been opened. |
|
38 */ |
|
39 attribute nsIInputStream contentStream; |
|
40 |
|
41 /** |
|
42 * Get/set the srcdoc data string. When the input stream channel is |
|
43 * created to load a srcdoc iframe, this is set to hold the value of the |
|
44 * srcdoc attribute. |
|
45 * |
|
46 * This should be the same value used to create contentStream, but this is |
|
47 * not checked. |
|
48 * |
|
49 * Changing the value of this attribute will not otherwise affect the |
|
50 * functionality of the channel or input stream. |
|
51 */ |
|
52 attribute AString srcdocData; |
|
53 |
|
54 /** |
|
55 * Returns true if srcdocData has been set within the channel. |
|
56 */ |
|
57 readonly attribute boolean isSrcdocChannel; |
|
58 |
|
59 /** |
|
60 * The base URI to be used for the channel. Used when the base URI cannot |
|
61 * be inferred by other means, for example when this is a srcdoc channel. |
|
62 */ |
|
63 attribute nsIURI baseURI; |
|
64 }; |