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: 4; 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 "nsIRequestObserver.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIInputStream; |
michael@0 | 9 | |
michael@0 | 10 | /** |
michael@0 | 11 | * nsIStreamListener |
michael@0 | 12 | */ |
michael@0 | 13 | [scriptable, uuid(3b4c8a77-76ba-4610-b316-678c73a3b88c)] |
michael@0 | 14 | interface nsIStreamListener : nsIRequestObserver |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * Called when the next chunk of data (corresponding to the request) may |
michael@0 | 18 | * be read without blocking the calling thread. The onDataAvailable impl |
michael@0 | 19 | * must read exactly |aCount| bytes of data before returning. |
michael@0 | 20 | * |
michael@0 | 21 | * @param aRequest request corresponding to the source of the data |
michael@0 | 22 | * @param aContext user defined context |
michael@0 | 23 | * @param aInputStream input stream containing the data chunk |
michael@0 | 24 | * @param aOffset |
michael@0 | 25 | * Number of bytes that were sent in previous onDataAvailable calls |
michael@0 | 26 | * for this request. In other words, the sum of all previous count |
michael@0 | 27 | * parameters. |
michael@0 | 28 | * @param aCount number of bytes available in the stream |
michael@0 | 29 | * |
michael@0 | 30 | * NOTE: The aInputStream parameter must implement readSegments. |
michael@0 | 31 | * |
michael@0 | 32 | * An exception thrown from onDataAvailable has the side-effect of |
michael@0 | 33 | * causing the request to be canceled. |
michael@0 | 34 | */ |
michael@0 | 35 | void onDataAvailable(in nsIRequest aRequest, |
michael@0 | 36 | in nsISupports aContext, |
michael@0 | 37 | in nsIInputStream aInputStream, |
michael@0 | 38 | in unsigned long long aOffset, |
michael@0 | 39 | in unsigned long aCount); |
michael@0 | 40 | }; |