Bug 1824856 - migrate android build-bundle tasks from firefox-android. r=bhearsum...
[gecko.git] / netwerk / ipc / ParentChannelWrapper.h
blob8d7d6dd73d80026a653d11fdf0db87607c75b807
1 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_net_ParentChannelWrapper_h
8 #define mozilla_net_ParentChannelWrapper_h
10 #include "nsIParentChannel.h"
11 #include "nsIStreamListener.h"
13 namespace mozilla {
14 namespace net {
16 class ParentChannelWrapper : public nsIParentChannel {
17 public:
18 ParentChannelWrapper(nsIChannel* aChannel, nsIStreamListener* aListener)
19 : mChannel(aChannel), mListener(aListener) {}
21 // Registers this nsIParentChannel wrapper with the RedirectChannelRegistrar
22 // and holds a reference.
23 void Register(uint64_t aRegistrarId);
25 NS_DECL_ISUPPORTS
26 NS_DECL_NSIPARENTCHANNEL
27 NS_FORWARD_NSISTREAMLISTENER(mListener->)
28 NS_FORWARD_NSIREQUESTOBSERVER(mListener->)
30 private:
31 virtual ~ParentChannelWrapper() = default;
32 const nsCOMPtr<nsIChannel> mChannel;
33 const nsCOMPtr<nsIStreamListener> mListener;
36 } // namespace net
37 } // namespace mozilla
39 #endif // mozilla_net_ParentChannelWrapper_h