netwerk/base/public/nsIStreamListenerTee.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsIStreamListener.idl"
     7 interface nsIOutputStream;
     8 interface nsIRequestObserver;
     9 interface nsIEventTarget;
    11 /**
    12  * As data "flows" into a stream listener tee, it is copied to the output stream
    13  * and then forwarded to the real listener.
    14  */
    15 [scriptable, uuid(62b27fc1-6e8c-4225-8ad0-b9d44252973a)]
    16 interface nsIStreamListenerTee : nsIStreamListener
    17 {
    18     /** 
    19      * Initalize the tee.
    20      *
    21      * @param listener
    22      *    the original listener the tee will propagate onStartRequest,
    23      *    onDataAvailable and onStopRequest notifications to, exceptions from 
    24      *    the listener will be propagated back to the channel
    25      * @param sink
    26      *    the stream the data coming from the channel will be written to,
    27      *    should be blocking
    28      * @param requestObserver
    29      *    optional parameter, listener that gets only onStartRequest and
    30      *    onStopRequest notifications; exceptions threw within this optional
    31      *    observer are also propagated to the channel, but exceptions from
    32      *    the original listener (listener parameter) are privileged 
    33      */
    34     void init(in nsIStreamListener listener,
    35               in nsIOutputStream sink,
    36               [optional] in nsIRequestObserver requestObserver);
    38     /** 
    39      * Initalize the tee like above, but with the extra parameter to make it
    40      * possible to copy the output asynchronously
    41      * @param anEventTarget
    42      *    if set, this event-target is used to copy data to the output stream,
    43      *    giving an asynchronous tee
    44     */
    45     void initAsync(in nsIStreamListener listener,
    46                    in nsIEventTarget eventTarget,
    47                    in nsIOutputStream sink,
    48                    [optional] in nsIRequestObserver requestObserver);
    50 };

mercurial