1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsITraceableChannel.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIStreamListener; 1.12 + 1.13 +/** 1.14 + * A channel implementing this interface allows one to intercept its data by 1.15 + * inserting intermediate stream listeners. 1.16 + */ 1.17 +[scriptable, uuid(68167b0b-ef34-4d79-a09a-8045f7c5140e)] 1.18 +interface nsITraceableChannel : nsISupports 1.19 +{ 1.20 + /* 1.21 + * Replace the channel's listener with a new one, and return the listener 1.22 + * the channel used to have. The new listener intercepts OnStartRequest, 1.23 + * OnDataAvailable and OnStopRequest calls and must pass them to 1.24 + * the original listener after examination. If multiple callers replace 1.25 + * the channel's listener, a chain of listeners is created. 1.26 + * The caller of setNewListener has no way to control at which place 1.27 + * in the chain its listener is placed. 1.28 + * 1.29 + * Note: The caller of setNewListener must not delay passing 1.30 + * OnStartRequest to the original listener. 1.31 + * 1.32 + * Note2: A channel may restrict when the listener can be replaced. 1.33 + * It is not recommended to allow listener replacement after OnStartRequest 1.34 + * has been called. 1.35 + */ 1.36 + nsIStreamListener setNewListener(in nsIStreamListener aListener); 1.37 +};