Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et tw=80 : */ |
michael@0 | 3 | |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #include "mozilla/net/PNeckoParent.h" |
michael@0 | 9 | #include "mozilla/net/NeckoCommon.h" |
michael@0 | 10 | |
michael@0 | 11 | #ifndef mozilla_net_NeckoParent_h |
michael@0 | 12 | #define mozilla_net_NeckoParent_h |
michael@0 | 13 | |
michael@0 | 14 | namespace mozilla { |
michael@0 | 15 | namespace net { |
michael@0 | 16 | |
michael@0 | 17 | // Used to override channel Private Browsing status if needed. |
michael@0 | 18 | enum PBOverrideStatus { |
michael@0 | 19 | kPBOverride_Unset = 0, |
michael@0 | 20 | kPBOverride_Private, |
michael@0 | 21 | kPBOverride_NotPrivate |
michael@0 | 22 | }; |
michael@0 | 23 | |
michael@0 | 24 | // Header file contents |
michael@0 | 25 | class NeckoParent : |
michael@0 | 26 | public PNeckoParent |
michael@0 | 27 | { |
michael@0 | 28 | public: |
michael@0 | 29 | NeckoParent(); |
michael@0 | 30 | virtual ~NeckoParent(); |
michael@0 | 31 | |
michael@0 | 32 | MOZ_WARN_UNUSED_RESULT |
michael@0 | 33 | static const char * |
michael@0 | 34 | GetValidatedAppInfo(const SerializedLoadContext& aSerialized, |
michael@0 | 35 | PBrowserParent* aBrowser, |
michael@0 | 36 | uint32_t* aAppId, |
michael@0 | 37 | bool* aInBrowserElement); |
michael@0 | 38 | |
michael@0 | 39 | MOZ_WARN_UNUSED_RESULT |
michael@0 | 40 | static const char * |
michael@0 | 41 | GetValidatedAppInfo(const SerializedLoadContext& aSerialized, |
michael@0 | 42 | PContentParent* aBrowser, |
michael@0 | 43 | uint32_t* aAppId, |
michael@0 | 44 | bool* aInBrowserElement); |
michael@0 | 45 | |
michael@0 | 46 | /* |
michael@0 | 47 | * Creates LoadContext for parent-side of an e10s channel. |
michael@0 | 48 | * |
michael@0 | 49 | * PContentParent corresponds to the process that is requesting the load. |
michael@0 | 50 | * |
michael@0 | 51 | * Returns null if successful, or an error string if failed. |
michael@0 | 52 | */ |
michael@0 | 53 | MOZ_WARN_UNUSED_RESULT |
michael@0 | 54 | static const char* |
michael@0 | 55 | CreateChannelLoadContext(PBrowserParent* aBrowser, |
michael@0 | 56 | PContentParent* aContent, |
michael@0 | 57 | const SerializedLoadContext& aSerialized, |
michael@0 | 58 | nsCOMPtr<nsILoadContext> &aResult); |
michael@0 | 59 | |
michael@0 | 60 | virtual void |
michael@0 | 61 | CloneManagees(ProtocolBase* aSource, |
michael@0 | 62 | mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE; |
michael@0 | 63 | virtual PCookieServiceParent* AllocPCookieServiceParent() MOZ_OVERRIDE; |
michael@0 | 64 | virtual bool |
michael@0 | 65 | RecvPCookieServiceConstructor(PCookieServiceParent* aActor) MOZ_OVERRIDE |
michael@0 | 66 | { |
michael@0 | 67 | return PNeckoParent::RecvPCookieServiceConstructor(aActor); |
michael@0 | 68 | } |
michael@0 | 69 | |
michael@0 | 70 | protected: |
michael@0 | 71 | virtual PHttpChannelParent* |
michael@0 | 72 | AllocPHttpChannelParent(PBrowserParent*, const SerializedLoadContext&, |
michael@0 | 73 | const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE; |
michael@0 | 74 | virtual bool |
michael@0 | 75 | RecvPHttpChannelConstructor( |
michael@0 | 76 | PHttpChannelParent* aActor, |
michael@0 | 77 | PBrowserParent* aBrowser, |
michael@0 | 78 | const SerializedLoadContext& aSerialized, |
michael@0 | 79 | const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE; |
michael@0 | 80 | virtual bool DeallocPHttpChannelParent(PHttpChannelParent*) MOZ_OVERRIDE; |
michael@0 | 81 | virtual bool DeallocPCookieServiceParent(PCookieServiceParent*) MOZ_OVERRIDE; |
michael@0 | 82 | virtual PWyciwygChannelParent* AllocPWyciwygChannelParent() MOZ_OVERRIDE; |
michael@0 | 83 | virtual bool DeallocPWyciwygChannelParent(PWyciwygChannelParent*) MOZ_OVERRIDE; |
michael@0 | 84 | virtual PFTPChannelParent* |
michael@0 | 85 | AllocPFTPChannelParent(PBrowserParent* aBrowser, |
michael@0 | 86 | const SerializedLoadContext& aSerialized, |
michael@0 | 87 | const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE; |
michael@0 | 88 | virtual bool |
michael@0 | 89 | RecvPFTPChannelConstructor( |
michael@0 | 90 | PFTPChannelParent* aActor, |
michael@0 | 91 | PBrowserParent* aBrowser, |
michael@0 | 92 | const SerializedLoadContext& aSerialized, |
michael@0 | 93 | const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE; |
michael@0 | 94 | virtual bool DeallocPFTPChannelParent(PFTPChannelParent*) MOZ_OVERRIDE; |
michael@0 | 95 | virtual PWebSocketParent* |
michael@0 | 96 | AllocPWebSocketParent(PBrowserParent* browser, |
michael@0 | 97 | const SerializedLoadContext& aSerialized) MOZ_OVERRIDE; |
michael@0 | 98 | virtual bool DeallocPWebSocketParent(PWebSocketParent*) MOZ_OVERRIDE; |
michael@0 | 99 | virtual PTCPSocketParent* AllocPTCPSocketParent() MOZ_OVERRIDE; |
michael@0 | 100 | |
michael@0 | 101 | virtual PRemoteOpenFileParent* AllocPRemoteOpenFileParent(const URIParams& aFileURI, |
michael@0 | 102 | const OptionalURIParams& aAppURI) |
michael@0 | 103 | MOZ_OVERRIDE; |
michael@0 | 104 | virtual bool RecvPRemoteOpenFileConstructor(PRemoteOpenFileParent* aActor, |
michael@0 | 105 | const URIParams& aFileURI, |
michael@0 | 106 | const OptionalURIParams& aAppURI) |
michael@0 | 107 | MOZ_OVERRIDE; |
michael@0 | 108 | virtual bool DeallocPRemoteOpenFileParent(PRemoteOpenFileParent* aActor) |
michael@0 | 109 | MOZ_OVERRIDE; |
michael@0 | 110 | |
michael@0 | 111 | virtual bool DeallocPTCPSocketParent(PTCPSocketParent*) MOZ_OVERRIDE; |
michael@0 | 112 | virtual PTCPServerSocketParent* |
michael@0 | 113 | AllocPTCPServerSocketParent(const uint16_t& aLocalPort, |
michael@0 | 114 | const uint16_t& aBacklog, |
michael@0 | 115 | const nsString& aBinaryType) MOZ_OVERRIDE; |
michael@0 | 116 | virtual bool RecvPTCPServerSocketConstructor(PTCPServerSocketParent*, |
michael@0 | 117 | const uint16_t& aLocalPort, |
michael@0 | 118 | const uint16_t& aBacklog, |
michael@0 | 119 | const nsString& aBinaryType) MOZ_OVERRIDE; |
michael@0 | 120 | virtual bool DeallocPTCPServerSocketParent(PTCPServerSocketParent*) MOZ_OVERRIDE; |
michael@0 | 121 | virtual PUDPSocketParent* AllocPUDPSocketParent(const nsCString& aHost, |
michael@0 | 122 | const uint16_t& aPort, |
michael@0 | 123 | const nsCString& aFilter) MOZ_OVERRIDE; |
michael@0 | 124 | virtual bool RecvPUDPSocketConstructor(PUDPSocketParent*, |
michael@0 | 125 | const nsCString& aHost, |
michael@0 | 126 | const uint16_t& aPort, |
michael@0 | 127 | const nsCString& aFilter) MOZ_OVERRIDE; |
michael@0 | 128 | virtual bool DeallocPUDPSocketParent(PUDPSocketParent*) MOZ_OVERRIDE; |
michael@0 | 129 | virtual PDNSRequestParent* AllocPDNSRequestParent(const nsCString& aHost, |
michael@0 | 130 | const uint32_t& aFlags) MOZ_OVERRIDE; |
michael@0 | 131 | virtual bool RecvPDNSRequestConstructor(PDNSRequestParent* actor, |
michael@0 | 132 | const nsCString& hostName, |
michael@0 | 133 | const uint32_t& flags) MOZ_OVERRIDE; |
michael@0 | 134 | virtual bool DeallocPDNSRequestParent(PDNSRequestParent*) MOZ_OVERRIDE; |
michael@0 | 135 | virtual bool RecvHTMLDNSPrefetch(const nsString& hostname, |
michael@0 | 136 | const uint16_t& flags) MOZ_OVERRIDE; |
michael@0 | 137 | virtual bool RecvCancelHTMLDNSPrefetch(const nsString& hostname, |
michael@0 | 138 | const uint16_t& flags, |
michael@0 | 139 | const nsresult& reason) MOZ_OVERRIDE; |
michael@0 | 140 | |
michael@0 | 141 | virtual mozilla::ipc::IProtocol* |
michael@0 | 142 | CloneProtocol(Channel* aChannel, |
michael@0 | 143 | mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE; |
michael@0 | 144 | virtual PRtspControllerParent* AllocPRtspControllerParent() MOZ_OVERRIDE; |
michael@0 | 145 | virtual bool DeallocPRtspControllerParent(PRtspControllerParent*) MOZ_OVERRIDE; |
michael@0 | 146 | |
michael@0 | 147 | virtual PRtspChannelParent* |
michael@0 | 148 | AllocPRtspChannelParent(const RtspChannelConnectArgs& aArgs) |
michael@0 | 149 | MOZ_OVERRIDE; |
michael@0 | 150 | virtual bool |
michael@0 | 151 | RecvPRtspChannelConstructor(PRtspChannelParent* aActor, |
michael@0 | 152 | const RtspChannelConnectArgs& aArgs) |
michael@0 | 153 | MOZ_OVERRIDE; |
michael@0 | 154 | virtual bool DeallocPRtspChannelParent(PRtspChannelParent*) MOZ_OVERRIDE; |
michael@0 | 155 | |
michael@0 | 156 | virtual PChannelDiverterParent* |
michael@0 | 157 | AllocPChannelDiverterParent(const ChannelDiverterArgs& channel) MOZ_OVERRIDE; |
michael@0 | 158 | virtual bool |
michael@0 | 159 | RecvPChannelDiverterConstructor(PChannelDiverterParent* actor, |
michael@0 | 160 | const ChannelDiverterArgs& channel) MOZ_OVERRIDE; |
michael@0 | 161 | virtual bool DeallocPChannelDiverterParent(PChannelDiverterParent* actor) |
michael@0 | 162 | MOZ_OVERRIDE; |
michael@0 | 163 | |
michael@0 | 164 | private: |
michael@0 | 165 | nsCString mCoreAppsBasePath; |
michael@0 | 166 | nsCString mWebAppsBasePath; |
michael@0 | 167 | }; |
michael@0 | 168 | |
michael@0 | 169 | } // namespace net |
michael@0 | 170 | } // namespace mozilla |
michael@0 | 171 | |
michael@0 | 172 | #endif // mozilla_net_NeckoParent_h |