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