tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ParentChannelWrapper.h (1142B)


      1 /* vim: set sw=2 ts=8 et tw=80 : */
      2 
      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/. */
      6 
      7 #ifndef mozilla_net_ParentChannelWrapper_h
      8 #define mozilla_net_ParentChannelWrapper_h
      9 
     10 #include "nsIParentChannel.h"
     11 #include "nsIStreamListener.h"
     12 
     13 namespace mozilla {
     14 namespace net {
     15 
     16 class ParentChannelWrapper : public nsIParentChannel {
     17 public:
     18  ParentChannelWrapper(nsIChannel* aChannel, nsIStreamListener* aListener)
     19      : mChannel(aChannel), mListener(aListener) {}
     20 
     21  // Registers this nsIParentChannel wrapper with the RedirectChannelRegistrar
     22  // and holds a reference.
     23  void Register(uint64_t aRegistrarId);
     24 
     25  NS_DECL_ISUPPORTS
     26  NS_DECL_NSIPARENTCHANNEL
     27  NS_FORWARD_NSISTREAMLISTENER(mListener->)
     28  NS_FORWARD_NSIREQUESTOBSERVER(mListener->)
     29 
     30 private:
     31  virtual ~ParentChannelWrapper() = default;
     32  const nsCOMPtr<nsIChannel> mChannel;
     33  const nsCOMPtr<nsIStreamListener> mListener;
     34 };
     35 
     36 }  // namespace net
     37 }  // namespace mozilla
     38 
     39 #endif  // mozilla_net_ParentChannelWrapper_h