michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _adivertablechannelparent_h_ michael@0: #define _adivertablechannelparent_h_ michael@0: michael@0: #include "nsISupports.h" michael@0: michael@0: class nsIStreamListener; michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: // To be implemented by a channel's parent actors, e.g. HttpChannelParent michael@0: // and FTPChannelParent. Used by ChannelDiverterParent to divert michael@0: // nsIStreamListener callbacks from the child process to a new michael@0: // listener in the parent process. michael@0: class ADivertableParentChannel : public nsISupports michael@0: { michael@0: public: michael@0: // Called by ChannelDiverterParent::DivertTo(nsIStreamListener*). michael@0: // The listener should now be used to received nsIStreamListener callbacks, michael@0: // i.e. OnStartRequest, OnDataAvailable and OnStopRequest, as if it had been michael@0: // passed to AsyncOpen for the channel. A reference to the listener will be michael@0: // added and kept until OnStopRequest has completed. michael@0: virtual void DivertTo(nsIStreamListener *aListener) = 0; michael@0: michael@0: // Called to suspend parent channel in ChannelDiverterParent constructor. michael@0: virtual nsresult SuspendForDiversion() = 0; michael@0: }; michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: michael@0: #endif