nsViewSourceChannel.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  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 nsViewSourceChannel_h___
  6. #define nsViewSourceChannel_h___
  7. #include "nsString.h"
  8. #include "nsCOMPtr.h"
  9. #include "nsIViewSourceChannel.h"
  10. #include "nsIURI.h"
  11. #include "nsIStreamListener.h"
  12. #include "nsIHttpChannel.h"
  13. #include "nsIHttpChannelInternal.h"
  14. #include "nsICachingChannel.h"
  15. #include "nsIApplicationCacheChannel.h"
  16. #include "nsIFormPOSTActionChannel.h"
  17. #include "mozilla/Attributes.h"
  18. class nsViewSourceChannel final : public nsIViewSourceChannel,
  19. public nsIStreamListener,
  20. public nsIHttpChannel,
  21. public nsIHttpChannelInternal,
  22. public nsICachingChannel,
  23. public nsIApplicationCacheChannel,
  24. public nsIFormPOSTActionChannel
  25. {
  26. public:
  27. NS_DECL_ISUPPORTS
  28. NS_DECL_NSIREQUEST
  29. NS_DECL_NSICHANNEL
  30. NS_DECL_NSIVIEWSOURCECHANNEL
  31. NS_DECL_NSISTREAMLISTENER
  32. NS_DECL_NSIREQUESTOBSERVER
  33. NS_DECL_NSIHTTPCHANNEL
  34. NS_FORWARD_SAFE_NSICACHEINFOCHANNEL(mCacheInfoChannel)
  35. NS_FORWARD_SAFE_NSICACHINGCHANNEL(mCachingChannel)
  36. NS_FORWARD_SAFE_NSIAPPLICATIONCACHECHANNEL(mApplicationCacheChannel)
  37. NS_FORWARD_SAFE_NSIAPPLICATIONCACHECONTAINER(mApplicationCacheChannel)
  38. NS_FORWARD_SAFE_NSIUPLOADCHANNEL(mUploadChannel)
  39. NS_FORWARD_SAFE_NSIFORMPOSTACTIONCHANNEL(mPostChannel)
  40. NS_FORWARD_SAFE_NSIHTTPCHANNELINTERNAL(mHttpChannelInternal)
  41. // nsViewSourceChannel methods:
  42. nsViewSourceChannel()
  43. : mIsDocument(false)
  44. , mOpened(false) {}
  45. nsresult Init(nsIURI* uri);
  46. nsresult InitSrcdoc(nsIURI* aURI,
  47. nsIURI* aBaseURI,
  48. const nsAString &aSrcdoc,
  49. nsILoadInfo* aLoadInfo);
  50. protected:
  51. ~nsViewSourceChannel() {}
  52. nsCOMPtr<nsIChannel> mChannel;
  53. nsCOMPtr<nsIHttpChannel> mHttpChannel;
  54. nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal;
  55. nsCOMPtr<nsICachingChannel> mCachingChannel;
  56. nsCOMPtr<nsICacheInfoChannel> mCacheInfoChannel;
  57. nsCOMPtr<nsIApplicationCacheChannel> mApplicationCacheChannel;
  58. nsCOMPtr<nsIUploadChannel> mUploadChannel;
  59. nsCOMPtr<nsIFormPOSTActionChannel> mPostChannel;
  60. nsCOMPtr<nsIStreamListener> mListener;
  61. nsCOMPtr<nsIURI> mOriginalURI;
  62. nsCOMPtr<nsIURI> mBaseURI;
  63. nsCString mContentType;
  64. bool mIsDocument; // keeps track of the LOAD_DOCUMENT_URI flag
  65. bool mOpened;
  66. bool mIsSrcdocChannel;
  67. };
  68. #endif /* nsViewSourceChannel_h___ */