Bug 1909613 - Enable <details name=''> everywhere, r=emilio
[gecko.git] / netwerk / base / nsIStreamListener.idl
blobb7bc6c212169706ae81542ec17bbd9b4f15473da
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsIRequestObserver.idl"
8 interface nsIInputStream;
10 /**
11 * nsIStreamListener
13 [scriptable, uuid(3b4c8a77-76ba-4610-b316-678c73a3b88c)]
14 interface nsIStreamListener : nsIRequestObserver
16 /**
17 * Called when the next chunk of data (corresponding to the request) may
18 * be read without blocking the calling thread. The onDataAvailable impl
19 * must read exactly |aCount| bytes of data before returning.
21 * @param aRequest request corresponding to the source of the data
22 * @param aInputStream input stream containing the data chunk
23 * @param aOffset
24 * Number of bytes that were sent in previous onDataAvailable calls
25 * for this request. In other words, the sum of all previous count
26 * parameters.
27 * @param aCount number of bytes available in the stream. aCount may not
28 * be 0.
30 * NOTE: The aInputStream parameter must implement readSegments.
32 * An exception thrown from onDataAvailable has the side-effect of
33 * causing the request to be canceled.
35 void onDataAvailable(in nsIRequest aRequest,
36 in nsIInputStream aInputStream,
37 in unsigned long long aOffset,
38 in unsigned long aCount);