netwerk/base/public/nsIStreamListener.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIStreamListener.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; 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 "nsIRequestObserver.idl"
    1.10 +
    1.11 +interface nsIInputStream;
    1.12 +
    1.13 +/**
    1.14 + * nsIStreamListener
    1.15 + */
    1.16 +[scriptable, uuid(3b4c8a77-76ba-4610-b316-678c73a3b88c)]
    1.17 +interface nsIStreamListener : nsIRequestObserver
    1.18 +{
    1.19 +    /**
    1.20 +     * Called when the next chunk of data (corresponding to the request) may
    1.21 +     * be read without blocking the calling thread.  The onDataAvailable impl
    1.22 +     * must read exactly |aCount| bytes of data before returning.
    1.23 +     *
    1.24 +     * @param aRequest request corresponding to the source of the data
    1.25 +     * @param aContext user defined context
    1.26 +     * @param aInputStream input stream containing the data chunk
    1.27 +     * @param aOffset
    1.28 +     *        Number of bytes that were sent in previous onDataAvailable calls
    1.29 +     *        for this request. In other words, the sum of all previous count
    1.30 +     *        parameters.
    1.31 +     * @param aCount number of bytes available in the stream
    1.32 +     *
    1.33 +     * NOTE: The aInputStream parameter must implement readSegments.
    1.34 +     *
    1.35 +     * An exception thrown from onDataAvailable has the side-effect of
    1.36 +     * causing the request to be canceled.
    1.37 +     */
    1.38 +    void onDataAvailable(in nsIRequest aRequest,
    1.39 +                         in nsISupports aContext, 
    1.40 +                         in nsIInputStream aInputStream,
    1.41 +                         in unsigned long long aOffset,
    1.42 +                         in unsigned long aCount);
    1.43 +};

mercurial