Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIURI; |
michael@0 | 9 | interface nsIRequest; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * nsIProgressEventSink |
michael@0 | 13 | * |
michael@0 | 14 | * This interface is used to asynchronously convey channel status and progress |
michael@0 | 15 | * information that is generally not critical to the processing of the channel. |
michael@0 | 16 | * The information is intended to be displayed to the user in some meaningful |
michael@0 | 17 | * way. |
michael@0 | 18 | * |
michael@0 | 19 | * An implementation of this interface can be passed to a channel via the |
michael@0 | 20 | * channel's notificationCallbacks attribute. See nsIChannel for more info. |
michael@0 | 21 | * |
michael@0 | 22 | * The channel will begin passing notifications to the progress event sink |
michael@0 | 23 | * after its asyncOpen method has been called. Notifications will cease once |
michael@0 | 24 | * the channel calls its listener's onStopRequest method or once the channel |
michael@0 | 25 | * is canceled (via nsIRequest::cancel). |
michael@0 | 26 | * |
michael@0 | 27 | * NOTE: This interface is actually not specific to channels and may be used |
michael@0 | 28 | * with other implementations of nsIRequest. |
michael@0 | 29 | */ |
michael@0 | 30 | [scriptable, uuid(D974C99E-4148-4df9-8D98-DE834A2F6462)] |
michael@0 | 31 | interface nsIProgressEventSink : nsISupports |
michael@0 | 32 | { |
michael@0 | 33 | /** |
michael@0 | 34 | * Called to notify the event sink that progress has occurred for the |
michael@0 | 35 | * given request. |
michael@0 | 36 | * |
michael@0 | 37 | * @param aRequest |
michael@0 | 38 | * the request being observed (may QI to nsIChannel). |
michael@0 | 39 | * @param aContext |
michael@0 | 40 | * if aRequest is a channel, then this parameter is the listener |
michael@0 | 41 | * context passed to nsIChannel::asyncOpen. |
michael@0 | 42 | * @param aProgress |
michael@0 | 43 | * numeric value in the range 0 to aProgressMax indicating the |
michael@0 | 44 | * number of bytes transfered thus far. |
michael@0 | 45 | * @param aProgressMax |
michael@0 | 46 | * numeric value indicating maximum number of bytes that will be |
michael@0 | 47 | * transfered (or 0xFFFFFFFFFFFFFFFF if total is unknown). |
michael@0 | 48 | */ |
michael@0 | 49 | void onProgress(in nsIRequest aRequest, |
michael@0 | 50 | in nsISupports aContext, |
michael@0 | 51 | in unsigned long long aProgress, |
michael@0 | 52 | in unsigned long long aProgressMax); |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Called to notify the event sink with a status message for the given |
michael@0 | 56 | * request. |
michael@0 | 57 | * |
michael@0 | 58 | * @param aRequest |
michael@0 | 59 | * the request being observed (may QI to nsIChannel). |
michael@0 | 60 | * @param aContext |
michael@0 | 61 | * if aRequest is a channel, then this parameter is the listener |
michael@0 | 62 | * context passed to nsIChannel::asyncOpen. |
michael@0 | 63 | * @param aStatus |
michael@0 | 64 | * status code (not necessarily an error code) indicating the |
michael@0 | 65 | * state of the channel (usually the state of the underlying |
michael@0 | 66 | * transport). see nsISocketTransport for socket specific status |
michael@0 | 67 | * codes. |
michael@0 | 68 | * @param aStatusArg |
michael@0 | 69 | * status code argument to be used with the string bundle service |
michael@0 | 70 | * to convert the status message into localized, human readable |
michael@0 | 71 | * text. the meaning of this parameter is specific to the value |
michael@0 | 72 | * of the status code. for socket status codes, this parameter |
michael@0 | 73 | * indicates the host:port associated with the status code. |
michael@0 | 74 | */ |
michael@0 | 75 | void onStatus(in nsIRequest aRequest, |
michael@0 | 76 | in nsISupports aContext, |
michael@0 | 77 | in nsresult aStatus, |
michael@0 | 78 | in wstring aStatusArg); |
michael@0 | 79 | |
michael@0 | 80 | }; |