2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-01-18 04:27:53 +03:00
|
|
|
|
2013-09-23 07:35:05 +04:00
|
|
|
#include "nsISupports.idl"
|
2003-01-18 04:27:53 +03:00
|
|
|
|
|
|
|
interface nsIInputStream;
|
2013-09-23 07:35:05 +04:00
|
|
|
interface nsIURI;
|
2003-01-18 04:27:53 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* nsIInputStreamChannel
|
|
|
|
*
|
|
|
|
* This interface provides methods to initialize an input stream channel.
|
|
|
|
* The input stream channel serves as a data pump for an input stream.
|
|
|
|
*/
|
2015-08-19 20:43:30 +03:00
|
|
|
[scriptable, uuid(ea730238-4bfd-4015-8489-8f264d05b343)]
|
2005-11-12 21:17:19 +03:00
|
|
|
interface nsIInputStreamChannel : nsISupports
|
2003-01-18 04:27:53 +03:00
|
|
|
{
|
|
|
|
/**
|
2005-11-12 21:17:19 +03:00
|
|
|
* Sets the URI for this channel. This must be called before the
|
|
|
|
* channel is opened, and it may only be called once.
|
2003-01-18 04:27:53 +03:00
|
|
|
*/
|
|
|
|
void setURI(in nsIURI aURI);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/set the content stream
|
|
|
|
*
|
|
|
|
* This stream contains the data that will be pushed to the channel's
|
|
|
|
* stream listener. If the stream is non-blocking and supports the
|
|
|
|
* nsIAsyncInputStream interface, then the stream will be read directly.
|
|
|
|
* Otherwise, the stream will be read on a background thread.
|
|
|
|
*
|
2005-11-12 21:17:19 +03:00
|
|
|
* This attribute must be set before the channel is opened, and it may
|
|
|
|
* only be set once.
|
2003-10-09 05:54:07 +04:00
|
|
|
*
|
|
|
|
* @throws NS_ERROR_IN_PROGRESS if the setter is called after the channel
|
|
|
|
* has been opened.
|
2003-01-18 04:27:53 +03:00
|
|
|
*/
|
|
|
|
attribute nsIInputStream contentStream;
|
2013-06-29 07:04:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/set the srcdoc data string. When the input stream channel is
|
|
|
|
* created to load a srcdoc iframe, this is set to hold the value of the
|
|
|
|
* srcdoc attribute.
|
|
|
|
*
|
|
|
|
* This should be the same value used to create contentStream, but this is
|
|
|
|
* not checked.
|
|
|
|
*
|
|
|
|
* Changing the value of this attribute will not otherwise affect the
|
|
|
|
* functionality of the channel or input stream.
|
|
|
|
*/
|
|
|
|
attribute AString srcdocData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if srcdocData has been set within the channel.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isSrcdocChannel;
|
2015-08-19 20:43:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The base URI to be used for the channel. Used when the base URI cannot
|
|
|
|
* be inferred by other means, for example when this is a srcdoc channel.
|
|
|
|
*/
|
|
|
|
attribute nsIURI baseURI;
|
2003-01-18 04:27:53 +03:00
|
|
|
};
|