diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /netwerk/base/nsIStreamListenerTee.idl | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/base/nsIStreamListenerTee.idl')
-rw-r--r-- | netwerk/base/nsIStreamListenerTee.idl | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/netwerk/base/nsIStreamListenerTee.idl b/netwerk/base/nsIStreamListenerTee.idl new file mode 100644 index 0000000000..d51bdf3c46 --- /dev/null +++ b/netwerk/base/nsIStreamListenerTee.idl @@ -0,0 +1,50 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIStreamListener.idl" + +interface nsIOutputStream; +interface nsIRequestObserver; +interface nsIEventTarget; + +/** + * As data "flows" into a stream listener tee, it is copied to the output stream + * and then forwarded to the real listener. + */ +[scriptable, uuid(62b27fc1-6e8c-4225-8ad0-b9d44252973a)] +interface nsIStreamListenerTee : nsIStreamListener +{ + /** + * Initalize the tee. + * + * @param listener + * the original listener the tee will propagate onStartRequest, + * onDataAvailable and onStopRequest notifications to, exceptions from + * the listener will be propagated back to the channel + * @param sink + * the stream the data coming from the channel will be written to, + * should be blocking + * @param requestObserver + * optional parameter, listener that gets only onStartRequest and + * onStopRequest notifications; exceptions threw within this optional + * observer are also propagated to the channel, but exceptions from + * the original listener (listener parameter) are privileged + */ + void init(in nsIStreamListener listener, + in nsIOutputStream sink, + [optional] in nsIRequestObserver requestObserver); + + /** + * Initalize the tee like above, but with the extra parameter to make it + * possible to copy the output asynchronously + * @param anEventTarget + * if set, this event-target is used to copy data to the output stream, + * giving an asynchronous tee + */ + void initAsync(in nsIStreamListener listener, + in nsIEventTarget eventTarget, + in nsIOutputStream sink, + [optional] in nsIRequestObserver requestObserver); + +}; |