netwerk/ipc/NeckoParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/ipc/NeckoParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,172 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=8 et tw=80 : */
     1.6 +
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#include "mozilla/net/PNeckoParent.h"
    1.12 +#include "mozilla/net/NeckoCommon.h"
    1.13 +
    1.14 +#ifndef mozilla_net_NeckoParent_h
    1.15 +#define mozilla_net_NeckoParent_h
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace net {
    1.19 +
    1.20 +// Used to override channel Private Browsing status if needed.
    1.21 +enum PBOverrideStatus {
    1.22 +  kPBOverride_Unset = 0,
    1.23 +  kPBOverride_Private,
    1.24 +  kPBOverride_NotPrivate
    1.25 +};
    1.26 +
    1.27 +// Header file contents
    1.28 +class NeckoParent :
    1.29 +  public PNeckoParent
    1.30 +{
    1.31 +public:
    1.32 +  NeckoParent();
    1.33 +  virtual ~NeckoParent();
    1.34 +
    1.35 +  MOZ_WARN_UNUSED_RESULT
    1.36 +  static const char *
    1.37 +  GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
    1.38 +                      PBrowserParent* aBrowser,
    1.39 +                      uint32_t* aAppId,
    1.40 +                      bool* aInBrowserElement);
    1.41 +
    1.42 +  MOZ_WARN_UNUSED_RESULT
    1.43 +  static const char *
    1.44 +  GetValidatedAppInfo(const SerializedLoadContext& aSerialized,
    1.45 +                      PContentParent* aBrowser,
    1.46 +                      uint32_t* aAppId,
    1.47 +                      bool* aInBrowserElement);
    1.48 +
    1.49 +  /*
    1.50 +   * Creates LoadContext for parent-side of an e10s channel.
    1.51 +   *
    1.52 +   * PContentParent corresponds to the process that is requesting the load.
    1.53 +   *
    1.54 +   * Returns null if successful, or an error string if failed.
    1.55 +   */
    1.56 +  MOZ_WARN_UNUSED_RESULT
    1.57 +  static const char*
    1.58 +  CreateChannelLoadContext(PBrowserParent* aBrowser,
    1.59 +                           PContentParent* aContent,
    1.60 +                           const SerializedLoadContext& aSerialized,
    1.61 +                           nsCOMPtr<nsILoadContext> &aResult);
    1.62 +
    1.63 +  virtual void
    1.64 +  CloneManagees(ProtocolBase* aSource,
    1.65 +              mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
    1.66 +  virtual PCookieServiceParent* AllocPCookieServiceParent() MOZ_OVERRIDE;
    1.67 +  virtual bool
    1.68 +  RecvPCookieServiceConstructor(PCookieServiceParent* aActor) MOZ_OVERRIDE
    1.69 +  {
    1.70 +    return PNeckoParent::RecvPCookieServiceConstructor(aActor);
    1.71 +  }
    1.72 +
    1.73 +protected:
    1.74 +  virtual PHttpChannelParent*
    1.75 +    AllocPHttpChannelParent(PBrowserParent*, const SerializedLoadContext&,
    1.76 +                            const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
    1.77 +  virtual bool
    1.78 +    RecvPHttpChannelConstructor(
    1.79 +                      PHttpChannelParent* aActor,
    1.80 +                      PBrowserParent* aBrowser,
    1.81 +                      const SerializedLoadContext& aSerialized,
    1.82 +                      const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
    1.83 +  virtual bool DeallocPHttpChannelParent(PHttpChannelParent*) MOZ_OVERRIDE;
    1.84 +  virtual bool DeallocPCookieServiceParent(PCookieServiceParent*) MOZ_OVERRIDE;
    1.85 +  virtual PWyciwygChannelParent* AllocPWyciwygChannelParent() MOZ_OVERRIDE;
    1.86 +  virtual bool DeallocPWyciwygChannelParent(PWyciwygChannelParent*) MOZ_OVERRIDE;
    1.87 +  virtual PFTPChannelParent*
    1.88 +    AllocPFTPChannelParent(PBrowserParent* aBrowser,
    1.89 +                           const SerializedLoadContext& aSerialized,
    1.90 +                           const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
    1.91 +  virtual bool
    1.92 +    RecvPFTPChannelConstructor(
    1.93 +                      PFTPChannelParent* aActor,
    1.94 +                      PBrowserParent* aBrowser,
    1.95 +                      const SerializedLoadContext& aSerialized,
    1.96 +                      const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
    1.97 +  virtual bool DeallocPFTPChannelParent(PFTPChannelParent*) MOZ_OVERRIDE;
    1.98 +  virtual PWebSocketParent*
    1.99 +    AllocPWebSocketParent(PBrowserParent* browser,
   1.100 +                          const SerializedLoadContext& aSerialized) MOZ_OVERRIDE;
   1.101 +  virtual bool DeallocPWebSocketParent(PWebSocketParent*) MOZ_OVERRIDE;
   1.102 +  virtual PTCPSocketParent* AllocPTCPSocketParent() MOZ_OVERRIDE;
   1.103 +
   1.104 +  virtual PRemoteOpenFileParent* AllocPRemoteOpenFileParent(const URIParams& aFileURI,
   1.105 +                                                            const OptionalURIParams& aAppURI)
   1.106 +                                                            MOZ_OVERRIDE;
   1.107 +  virtual bool RecvPRemoteOpenFileConstructor(PRemoteOpenFileParent* aActor,
   1.108 +                                              const URIParams& aFileURI,
   1.109 +                                              const OptionalURIParams& aAppURI)
   1.110 +                                              MOZ_OVERRIDE;
   1.111 +  virtual bool DeallocPRemoteOpenFileParent(PRemoteOpenFileParent* aActor)
   1.112 +                                            MOZ_OVERRIDE;
   1.113 +
   1.114 +  virtual bool DeallocPTCPSocketParent(PTCPSocketParent*) MOZ_OVERRIDE;
   1.115 +  virtual PTCPServerSocketParent*
   1.116 +    AllocPTCPServerSocketParent(const uint16_t& aLocalPort,
   1.117 +                                const uint16_t& aBacklog,
   1.118 +                                const nsString& aBinaryType) MOZ_OVERRIDE;
   1.119 +  virtual bool RecvPTCPServerSocketConstructor(PTCPServerSocketParent*,
   1.120 +                                               const uint16_t& aLocalPort,
   1.121 +                                               const uint16_t& aBacklog,
   1.122 +                                               const nsString& aBinaryType) MOZ_OVERRIDE;
   1.123 +  virtual bool DeallocPTCPServerSocketParent(PTCPServerSocketParent*) MOZ_OVERRIDE;
   1.124 +  virtual PUDPSocketParent* AllocPUDPSocketParent(const nsCString& aHost,
   1.125 +                                                  const uint16_t& aPort,
   1.126 +                                                  const nsCString& aFilter) MOZ_OVERRIDE;
   1.127 +  virtual bool RecvPUDPSocketConstructor(PUDPSocketParent*,
   1.128 +                                         const nsCString& aHost,
   1.129 +                                         const uint16_t& aPort,
   1.130 +                                         const nsCString& aFilter) MOZ_OVERRIDE;
   1.131 +  virtual bool DeallocPUDPSocketParent(PUDPSocketParent*) MOZ_OVERRIDE;
   1.132 +  virtual PDNSRequestParent* AllocPDNSRequestParent(const nsCString& aHost,
   1.133 +                                                    const uint32_t& aFlags) MOZ_OVERRIDE;
   1.134 +  virtual bool RecvPDNSRequestConstructor(PDNSRequestParent* actor,
   1.135 +                                          const nsCString& hostName,
   1.136 +                                          const uint32_t& flags) MOZ_OVERRIDE;
   1.137 +  virtual bool DeallocPDNSRequestParent(PDNSRequestParent*) MOZ_OVERRIDE;
   1.138 +  virtual bool RecvHTMLDNSPrefetch(const nsString& hostname,
   1.139 +                                   const uint16_t& flags) MOZ_OVERRIDE;
   1.140 +  virtual bool RecvCancelHTMLDNSPrefetch(const nsString& hostname,
   1.141 +                                         const uint16_t& flags,
   1.142 +                                         const nsresult& reason) MOZ_OVERRIDE;
   1.143 +
   1.144 +  virtual mozilla::ipc::IProtocol*
   1.145 +  CloneProtocol(Channel* aChannel,
   1.146 +                mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
   1.147 +  virtual PRtspControllerParent* AllocPRtspControllerParent() MOZ_OVERRIDE;
   1.148 +  virtual bool DeallocPRtspControllerParent(PRtspControllerParent*) MOZ_OVERRIDE;
   1.149 +
   1.150 +  virtual PRtspChannelParent*
   1.151 +    AllocPRtspChannelParent(const RtspChannelConnectArgs& aArgs)
   1.152 +                            MOZ_OVERRIDE;
   1.153 +  virtual bool
   1.154 +    RecvPRtspChannelConstructor(PRtspChannelParent* aActor,
   1.155 +                                const RtspChannelConnectArgs& aArgs)
   1.156 +                                MOZ_OVERRIDE;
   1.157 +  virtual bool DeallocPRtspChannelParent(PRtspChannelParent*) MOZ_OVERRIDE;
   1.158 +
   1.159 +  virtual PChannelDiverterParent*
   1.160 +  AllocPChannelDiverterParent(const ChannelDiverterArgs& channel) MOZ_OVERRIDE;
   1.161 +  virtual bool
   1.162 +  RecvPChannelDiverterConstructor(PChannelDiverterParent* actor,
   1.163 +                                  const ChannelDiverterArgs& channel) MOZ_OVERRIDE;
   1.164 +  virtual bool DeallocPChannelDiverterParent(PChannelDiverterParent* actor)
   1.165 +                                                                MOZ_OVERRIDE;
   1.166 +
   1.167 +private:
   1.168 +  nsCString mCoreAppsBasePath;
   1.169 +  nsCString mWebAppsBasePath;
   1.170 +};
   1.171 +
   1.172 +} // namespace net
   1.173 +} // namespace mozilla
   1.174 +
   1.175 +#endif // mozilla_net_NeckoParent_h

mercurial