WyciwygChannelParent.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 mozilla_net_WyciwygChannelParent_h
  5. #define mozilla_net_WyciwygChannelParent_h
  6. #include "mozilla/net/PWyciwygChannelParent.h"
  7. #include "mozilla/net/NeckoCommon.h"
  8. #include "nsIStreamListener.h"
  9. #include "nsIWyciwygChannel.h"
  10. #include "nsIInterfaceRequestor.h"
  11. #include "nsILoadContext.h"
  12. namespace mozilla {
  13. namespace dom {
  14. class PBrowserParent;
  15. } // namespace dom
  16. namespace net {
  17. class WyciwygChannelParent : public PWyciwygChannelParent
  18. , public nsIStreamListener
  19. , public nsIInterfaceRequestor
  20. {
  21. public:
  22. NS_DECL_ISUPPORTS
  23. NS_DECL_NSIREQUESTOBSERVER
  24. NS_DECL_NSISTREAMLISTENER
  25. NS_DECL_NSIINTERFACEREQUESTOR
  26. WyciwygChannelParent();
  27. protected:
  28. virtual ~WyciwygChannelParent();
  29. virtual bool RecvInit(const URIParams& uri,
  30. const ipc::PrincipalInfo& aRequestingPrincipalInfo,
  31. const ipc::PrincipalInfo& aTriggeringPrincipalInfo,
  32. const ipc::PrincipalInfo& aPrincipalToInheritInfo,
  33. const uint32_t& aSecurityFlags,
  34. const uint32_t& aContentPolicyType) override;
  35. virtual bool RecvAsyncOpen(const URIParams& original,
  36. const uint32_t& loadFlags,
  37. const IPC::SerializedLoadContext& loadContext,
  38. const PBrowserOrId &parent) override;
  39. virtual bool RecvWriteToCacheEntry(const nsString& data) override;
  40. virtual bool RecvCloseCacheEntry(const nsresult& reason) override;
  41. virtual bool RecvSetCharsetAndSource(const int32_t& source,
  42. const nsCString& charset) override;
  43. virtual bool RecvSetSecurityInfo(const nsCString& securityInfo) override;
  44. virtual bool RecvCancel(const nsresult& statusCode) override;
  45. virtual bool RecvAppData(const IPC::SerializedLoadContext& loadContext,
  46. const PBrowserOrId &parent) override;
  47. virtual void ActorDestroy(ActorDestroyReason why) override;
  48. bool SetupAppData(const IPC::SerializedLoadContext& loadContext,
  49. const PBrowserOrId &aParent);
  50. nsCOMPtr<nsIWyciwygChannel> mChannel;
  51. bool mIPCClosed;
  52. bool mReceivedAppData;
  53. nsCOMPtr<nsILoadContext> mLoadContext;
  54. };
  55. } // namespace net
  56. } // namespace mozilla
  57. #endif // mozilla_net_WyciwygChannelParent_h