RedirectChannelRegistrar.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef RedirectChannelRegistrar_h__
  5. #define RedirectChannelRegistrar_h__
  6. #include "nsIRedirectChannelRegistrar.h"
  7. #include "nsIChannel.h"
  8. #include "nsIParentChannel.h"
  9. #include "nsInterfaceHashtable.h"
  10. #include "mozilla/Attributes.h"
  11. #include "mozilla/Mutex.h"
  12. namespace mozilla {
  13. namespace net {
  14. class RedirectChannelRegistrar final : public nsIRedirectChannelRegistrar
  15. {
  16. NS_DECL_ISUPPORTS
  17. NS_DECL_NSIREDIRECTCHANNELREGISTRAR
  18. RedirectChannelRegistrar();
  19. private:
  20. ~RedirectChannelRegistrar() {}
  21. protected:
  22. typedef nsInterfaceHashtable<nsUint32HashKey, nsIChannel>
  23. ChannelHashtable;
  24. typedef nsInterfaceHashtable<nsUint32HashKey, nsIParentChannel>
  25. ParentChannelHashtable;
  26. ChannelHashtable mRealChannels;
  27. ParentChannelHashtable mParentChannels;
  28. uint32_t mId;
  29. Mutex mLock;
  30. };
  31. } // namespace net
  32. } // namespace mozilla
  33. #endif