nsITraceableChannel.idl (1651B)
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 * @param aMustApplyContentConversion Pass true if the new listener requires 27 * content conversion to already be applied by the channel. 28 * 29 * Note: The caller of setNewListener must not delay passing 30 * OnStartRequest to the original listener. 31 * 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. 35 */ 36 nsIStreamListener setNewListener(in nsIStreamListener aListener, [optional] in boolean aMustApplyContentConversion); 37 };