nsViewSourceHandler.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 nsViewSourceHandler_h___
  6. #define nsViewSourceHandler_h___
  7. #include "nsIProtocolHandler.h"
  8. #include "nsNetUtil.h"
  9. #include "mozilla/Attributes.h"
  10. class nsILoadInfo;
  11. namespace mozilla {
  12. namespace net {
  13. class nsViewSourceHandler final : public nsIProtocolHandler
  14. {
  15. public:
  16. NS_DECL_ISUPPORTS
  17. NS_DECL_NSIPROTOCOLHANDLER
  18. nsViewSourceHandler();
  19. // Creates a new nsViewSourceChannel to view the source of an about:srcdoc
  20. // URI with contents specified by srcdoc.
  21. nsresult NewSrcdocChannel(nsIURI *aURI,
  22. nsIURI *aBaseURI,
  23. const nsAString &aSrcdoc,
  24. nsILoadInfo *aLoadInfo,
  25. nsIChannel** outChannel);
  26. static nsViewSourceHandler* GetInstance();
  27. private:
  28. ~nsViewSourceHandler();
  29. static nsViewSourceHandler* gInstance;
  30. };
  31. } // namespace net
  32. } // namespace mozilla
  33. #endif /* !defined( nsViewSourceHandler_h___ ) */