netwerk/base/public/nsITraceableChannel.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:93bc1158e37e
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/. */
5
6 #include "nsISupports.idl"
7
8 interface nsIStreamListener;
9
10 /**
11 * A channel implementing this interface allows one to intercept its data by
12 * inserting intermediate stream listeners.
13 */
14 [scriptable, uuid(68167b0b-ef34-4d79-a09a-8045f7c5140e)]
15 interface nsITraceableChannel : nsISupports
16 {
17 /*
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.
25 *
26 * Note: The caller of setNewListener must not delay passing
27 * OnStartRequest to the original listener.
28 *
29 * Note2: A channel may restrict when the listener can be replaced.
30 * It is not recommended to allow listener replacement after OnStartRequest
31 * has been called.
32 */
33 nsIStreamListener setNewListener(in nsIStreamListener aListener);
34 };

mercurial