michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 : */ michael@0: 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 mozilla_net_HttpChannelCallbackWrapper_h michael@0: #define mozilla_net_HttpChannelCallbackWrapper_h michael@0: michael@0: #include "nsIInterfaceRequestor.h" michael@0: #include "nsIChannelEventSink.h" michael@0: #include "nsIRedirectResultListener.h" michael@0: michael@0: class nsIParentChannel; michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: class HttpChannelParent; michael@0: michael@0: class HttpChannelParentListener : public nsIInterfaceRequestor michael@0: , public nsIChannelEventSink michael@0: , public nsIRedirectResultListener michael@0: , public nsIStreamListener michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIINTERFACEREQUESTOR michael@0: NS_DECL_NSICHANNELEVENTSINK michael@0: NS_DECL_NSIREDIRECTRESULTLISTENER michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: michael@0: HttpChannelParentListener(HttpChannelParent* aInitialChannel); michael@0: virtual ~HttpChannelParentListener(); michael@0: michael@0: // For channel diversion from child to parent. michael@0: nsresult DivertTo(nsIStreamListener *aListener); michael@0: nsresult SuspendForDiversion(); michael@0: michael@0: private: michael@0: // Private partner function to SuspendForDiversion. michael@0: nsresult ResumeForDiversion(); michael@0: michael@0: // Can be the original HttpChannelParent that created this object (normal michael@0: // case), a different {HTTP|FTP}ChannelParent that we've been redirected to, michael@0: // or some other listener that we have been diverted to via michael@0: // nsIDivertableChannel. michael@0: nsCOMPtr mNextListener; michael@0: uint32_t mRedirectChannelId; michael@0: // When set, no OnStart/OnData/OnStop calls should be received. michael@0: bool mSuspendedForDiversion; michael@0: }; michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_net_HttpChannelParent_h