LoadContextInfo.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 nsLoadContextInfo_h__
  5. #define nsLoadContextInfo_h__
  6. #include "nsILoadContextInfo.h"
  7. class nsIChannel;
  8. class nsILoadContext;
  9. namespace mozilla {
  10. namespace net {
  11. class LoadContextInfo : public nsILoadContextInfo
  12. {
  13. public:
  14. NS_DECL_THREADSAFE_ISUPPORTS
  15. NS_DECL_NSILOADCONTEXTINFO
  16. LoadContextInfo(bool aIsAnonymous, NeckoOriginAttributes aOriginAttributes);
  17. private:
  18. virtual ~LoadContextInfo();
  19. protected:
  20. bool mIsAnonymous : 1;
  21. NeckoOriginAttributes mOriginAttributes;
  22. };
  23. class LoadContextInfoFactory : public nsILoadContextInfoFactory
  24. {
  25. virtual ~LoadContextInfoFactory() {}
  26. public:
  27. NS_DECL_ISUPPORTS // deliberately not thread-safe
  28. NS_DECL_NSILOADCONTEXTINFOFACTORY
  29. };
  30. LoadContextInfo*
  31. GetLoadContextInfo(nsIChannel *aChannel);
  32. LoadContextInfo*
  33. GetLoadContextInfo(nsILoadContext *aLoadContext,
  34. bool aIsAnonymous);
  35. LoadContextInfo*
  36. GetLoadContextInfo(nsIDOMWindow *aLoadContext,
  37. bool aIsAnonymous);
  38. LoadContextInfo*
  39. GetLoadContextInfo(nsILoadContextInfo *aInfo);
  40. LoadContextInfo*
  41. GetLoadContextInfo(bool const aIsAnonymous,
  42. NeckoOriginAttributes const &aOriginAttributes);
  43. } // namespace net
  44. } // namespace mozilla
  45. #endif