1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/browser/webBrowser/nsIWebBrowserStream.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIURI; 1.12 + 1.13 +/** 1.14 + * This interface provides a way to stream data to the web browser. This allows 1.15 + * loading of data from sources which can not be accessed using URIs and 1.16 + * nsIWebNavigation. 1.17 + */ 1.18 +[scriptable, uuid(86d02f0e-219b-4cfc-9c88-bd98d2cce0b8)] 1.19 +interface nsIWebBrowserStream : nsISupports 1.20 +{ 1.21 + /** 1.22 + * Prepare to load a stream of data. When this function returns successfully, 1.23 + * it must be paired by a call to closeStream. 1.24 + * 1.25 + * @param aBaseURI 1.26 + * The base URI of the data. Must not be null. Relative 1.27 + * URIs will be resolved relative to this URI. 1.28 + * @param aContentType 1.29 + * ASCII string giving the content type of the data. If rendering 1.30 + * content of this type is not supported, this method fails. 1.31 + * This string may include a charset declaration, for example: 1.32 + * text/html;charset=ISO-8859-1 1.33 + * 1.34 + * @throw NS_ERROR_NOT_AVAILABLE 1.35 + * The requested content type is not supported. 1.36 + * @throw NS_ERROR_IN_PROGRESS 1.37 + * openStream was called twice without an intermediate closeStream. 1.38 + */ 1.39 + void openStream(in nsIURI aBaseURI, in ACString aContentType); 1.40 + 1.41 + /** 1.42 + * Append data to this stream. 1.43 + * @param aData The data to append 1.44 + * @param aLen Length of the data to append. 1.45 + * 1.46 + * @note To append more than 4 GB of data, call this method multiple times. 1.47 + */ 1.48 + void appendToStream([const, array, size_is(aLen)] in octet aData, 1.49 + in unsigned long aLen); 1.50 + 1.51 + /** 1.52 + * Notifies the browser that all the data has been appended. This may notify 1.53 + * the user that the browser is "done loading" in some form. 1.54 + * 1.55 + * @throw NS_ERROR_UNEXPECTED 1.56 + * This method was called without a preceding openStream. 1.57 + */ 1.58 + void closeStream(); 1.59 +};