nsURILoader.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsURILoader_h__
  6. #define nsURILoader_h__
  7. #include "nsCURILoader.h"
  8. #include "nsISupportsUtils.h"
  9. #include "nsCOMArray.h"
  10. #include "nsCOMPtr.h"
  11. #include "nsIInterfaceRequestor.h"
  12. #include "nsIInterfaceRequestorUtils.h"
  13. #include "nsString.h"
  14. #include "nsIWeakReference.h"
  15. #include "mozilla/Attributes.h"
  16. #include "mozilla/Logging.h"
  17. class nsDocumentOpenInfo;
  18. class nsURILoader final : public nsIURILoader
  19. {
  20. public:
  21. NS_DECL_NSIURILOADER
  22. NS_DECL_ISUPPORTS
  23. nsURILoader();
  24. protected:
  25. ~nsURILoader();
  26. /**
  27. * Equivalent to nsIURILoader::openChannel, but allows specifying whether the
  28. * channel is opened already.
  29. */
  30. MOZ_MUST_USE nsresult OpenChannel(nsIChannel* channel,
  31. uint32_t aFlags,
  32. nsIInterfaceRequestor* aWindowContext,
  33. bool aChannelOpen,
  34. nsIStreamListener** aListener);
  35. /**
  36. * we shouldn't need to have an owning ref count on registered
  37. * content listeners because they are supposed to unregister themselves
  38. * when they go away. This array stores weak references
  39. */
  40. nsCOMArray<nsIWeakReference> m_listeners;
  41. /**
  42. * Logging. The module is called "URILoader"
  43. */
  44. static mozilla::LazyLogModule mLog;
  45. friend class nsDocumentOpenInfo;
  46. };
  47. #endif /* nsURILoader_h__ */