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