Bug 1845134 - Part 4: Update existing ui-icons to use the latest source from acorn...
[gecko.git] / netwerk / base / nsIStreamListener.idl
blob68ade60cd14f1464c855e2fa4b4c151e07c76078
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
29 * NOTE: The aInputStream parameter must implement readSegments.
31 * An exception thrown from onDataAvailable has the side-effect of
32 * causing the request to be canceled.
34 void onDataAvailable(in nsIRequest aRequest,
35 in nsIInputStream aInputStream,
36 in unsigned long long aOffset,
37 in unsigned long aCount);