Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / netwerk / base / nsITraceableChannel.idl
blob4d325d4fcbeabc310a517e05b8a76eb4388d461d
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 "nsISupports.idl"
8 interface nsIStreamListener;
10 /**
11 * A channel implementing this interface allows one to intercept its data by
12 * inserting intermediate stream listeners.
14 [scriptable, uuid(68167b0b-ef34-4d79-a09a-8045f7c5140e)]
15 interface nsITraceableChannel : nsISupports
18 * Replace the channel's listener with a new one, and return the listener
19 * the channel used to have. The new listener intercepts OnStartRequest,
20 * OnDataAvailable and OnStopRequest calls and must pass them to
21 * the original listener after examination. If multiple callers replace
22 * the channel's listener, a chain of listeners is created.
23 * The caller of setNewListener has no way to control at which place
24 * in the chain its listener is placed.
26 * @param aMustApplyContentConversion Pass true if the new listener requires
27 * content conversion to already be applied by the channel.
29 * Note: The caller of setNewListener must not delay passing
30 * OnStartRequest to the original listener.
32 * Note2: A channel may restrict when the listener can be replaced.
33 * It is not recommended to allow listener replacement after OnStartRequest
34 * has been called.
36 nsIStreamListener setNewListener(in nsIStreamListener aListener, [optional] in boolean aMustApplyContentConversion);