Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et tw=80 : */ |
michael@0 | 3 | |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef mozilla_net_HttpChannelCallbackWrapper_h |
michael@0 | 9 | #define mozilla_net_HttpChannelCallbackWrapper_h |
michael@0 | 10 | |
michael@0 | 11 | #include "nsIInterfaceRequestor.h" |
michael@0 | 12 | #include "nsIChannelEventSink.h" |
michael@0 | 13 | #include "nsIRedirectResultListener.h" |
michael@0 | 14 | |
michael@0 | 15 | class nsIParentChannel; |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | namespace net { |
michael@0 | 19 | |
michael@0 | 20 | class HttpChannelParent; |
michael@0 | 21 | |
michael@0 | 22 | class HttpChannelParentListener : public nsIInterfaceRequestor |
michael@0 | 23 | , public nsIChannelEventSink |
michael@0 | 24 | , public nsIRedirectResultListener |
michael@0 | 25 | , public nsIStreamListener |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | NS_DECL_ISUPPORTS |
michael@0 | 29 | NS_DECL_NSIINTERFACEREQUESTOR |
michael@0 | 30 | NS_DECL_NSICHANNELEVENTSINK |
michael@0 | 31 | NS_DECL_NSIREDIRECTRESULTLISTENER |
michael@0 | 32 | NS_DECL_NSIREQUESTOBSERVER |
michael@0 | 33 | NS_DECL_NSISTREAMLISTENER |
michael@0 | 34 | |
michael@0 | 35 | HttpChannelParentListener(HttpChannelParent* aInitialChannel); |
michael@0 | 36 | virtual ~HttpChannelParentListener(); |
michael@0 | 37 | |
michael@0 | 38 | // For channel diversion from child to parent. |
michael@0 | 39 | nsresult DivertTo(nsIStreamListener *aListener); |
michael@0 | 40 | nsresult SuspendForDiversion(); |
michael@0 | 41 | |
michael@0 | 42 | private: |
michael@0 | 43 | // Private partner function to SuspendForDiversion. |
michael@0 | 44 | nsresult ResumeForDiversion(); |
michael@0 | 45 | |
michael@0 | 46 | // Can be the original HttpChannelParent that created this object (normal |
michael@0 | 47 | // case), a different {HTTP|FTP}ChannelParent that we've been redirected to, |
michael@0 | 48 | // or some other listener that we have been diverted to via |
michael@0 | 49 | // nsIDivertableChannel. |
michael@0 | 50 | nsCOMPtr<nsIStreamListener> mNextListener; |
michael@0 | 51 | uint32_t mRedirectChannelId; |
michael@0 | 52 | // When set, no OnStart/OnData/OnStop calls should be received. |
michael@0 | 53 | bool mSuspendedForDiversion; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | } // namespace net |
michael@0 | 57 | } // namespace mozilla |
michael@0 | 58 | |
michael@0 | 59 | #endif // mozilla_net_HttpChannelParent_h |