michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIInputStream; michael@0: interface nsIURI; michael@0: michael@0: /** michael@0: * nsIInputStreamChannel michael@0: * michael@0: * This interface provides methods to initialize an input stream channel. michael@0: * The input stream channel serves as a data pump for an input stream. michael@0: */ michael@0: [scriptable, uuid(17a17ce4-9a07-43fb-a0a3-947a6e21476c)] michael@0: interface nsIInputStreamChannel : nsISupports michael@0: { michael@0: /** michael@0: * Sets the URI for this channel. This must be called before the michael@0: * channel is opened, and it may only be called once. michael@0: */ michael@0: void setURI(in nsIURI aURI); michael@0: michael@0: /** michael@0: * Get/set the content stream michael@0: * michael@0: * This stream contains the data that will be pushed to the channel's michael@0: * stream listener. If the stream is non-blocking and supports the michael@0: * nsIAsyncInputStream interface, then the stream will be read directly. michael@0: * Otherwise, the stream will be read on a background thread. michael@0: * michael@0: * This attribute must be set before the channel is opened, and it may michael@0: * only be set once. michael@0: * michael@0: * @throws NS_ERROR_IN_PROGRESS if the setter is called after the channel michael@0: * has been opened. michael@0: */ michael@0: attribute nsIInputStream contentStream; michael@0: michael@0: /** michael@0: * Get/set the srcdoc data string. When the input stream channel is michael@0: * created to load a srcdoc iframe, this is set to hold the value of the michael@0: * srcdoc attribute. michael@0: * michael@0: * This should be the same value used to create contentStream, but this is michael@0: * not checked. michael@0: * michael@0: * Changing the value of this attribute will not otherwise affect the michael@0: * functionality of the channel or input stream. michael@0: */ michael@0: attribute AString srcdocData; michael@0: michael@0: /** michael@0: * Returns true if srcdocData has been set within the channel. michael@0: */ michael@0: readonly attribute boolean isSrcdocChannel; michael@0: michael@0: /** michael@0: * The base URI to be used for the channel. Used when the base URI cannot michael@0: * be inferred by other means, for example when this is a srcdoc channel. michael@0: */ michael@0: attribute nsIURI baseURI; michael@0: };