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"
10 #include "mozilla/net/OfflineObserver.h"
12 #ifndef mozilla_net_NeckoParent_h
13 #define mozilla_net_NeckoParent_h
18 // Used to override channel Private Browsing status if needed.
19 enum PBOverrideStatus
{
20 kPBOverride_Unset
= 0,
22 kPBOverride_NotPrivate
25 // Header file contents
28 , public DisconnectableParent
32 virtual ~NeckoParent();
34 MOZ_WARN_UNUSED_RESULT
36 GetValidatedAppInfo(const SerializedLoadContext
& aSerialized
,
37 PContentParent
* aBrowser
,
39 bool* aInBrowserElement
);
42 * Creates LoadContext for parent-side of an e10s channel.
44 * PContentParent corresponds to the process that is requesting the load.
46 * Returns null if successful, or an error string if failed.
48 MOZ_WARN_UNUSED_RESULT
50 CreateChannelLoadContext(const PBrowserOrId
& aBrowser
,
51 PContentParent
* aContent
,
52 const SerializedLoadContext
& aSerialized
,
53 nsCOMPtr
<nsILoadContext
> &aResult
);
55 virtual void ActorDestroy(ActorDestroyReason aWhy
) MOZ_OVERRIDE
;
56 virtual nsresult
OfflineNotification(nsISupports
*) MOZ_OVERRIDE
;
57 virtual uint32_t GetAppId() MOZ_OVERRIDE
{ return NECKO_UNKNOWN_APP_ID
; }
59 CloneManagees(ProtocolBase
* aSource
,
60 mozilla::ipc::ProtocolCloneContext
* aCtx
) MOZ_OVERRIDE
;
61 virtual PCookieServiceParent
* AllocPCookieServiceParent() MOZ_OVERRIDE
;
63 RecvPCookieServiceConstructor(PCookieServiceParent
* aActor
) MOZ_OVERRIDE
65 return PNeckoParent::RecvPCookieServiceConstructor(aActor
);
69 * This implementation of nsIAuthPrompt2 is used for nested remote iframes that
70 * want an auth prompt. This class lives in the parent process and informs the
71 * NeckoChild that we want an auth prompt, which forwards the request to the
72 * TabParent in the remote iframe that contains the nested iframe
74 class NestedFrameAuthPrompt MOZ_FINAL
: public nsIAuthPrompt2
76 ~NestedFrameAuthPrompt() {}
81 NestedFrameAuthPrompt(PNeckoParent
* aParent
, TabId aNestedFrameId
);
83 NS_IMETHOD
PromptAuth(nsIChannel
*, uint32_t, nsIAuthInformation
*, bool*) MOZ_OVERRIDE
85 return NS_ERROR_NOT_IMPLEMENTED
;
88 NS_IMETHOD
AsyncPromptAuth(nsIChannel
* aChannel
, nsIAuthPromptCallback
* callback
,
89 nsISupports
*, uint32_t,
90 nsIAuthInformation
* aInfo
, nsICancelable
**) MOZ_OVERRIDE
;
93 PNeckoParent
* mNeckoParent
;
98 virtual PHttpChannelParent
*
99 AllocPHttpChannelParent(const PBrowserOrId
&, const SerializedLoadContext
&,
100 const HttpChannelCreationArgs
& aOpenArgs
) MOZ_OVERRIDE
;
102 RecvPHttpChannelConstructor(
103 PHttpChannelParent
* aActor
,
104 const PBrowserOrId
& aBrowser
,
105 const SerializedLoadContext
& aSerialized
,
106 const HttpChannelCreationArgs
& aOpenArgs
) MOZ_OVERRIDE
;
107 virtual bool DeallocPHttpChannelParent(PHttpChannelParent
*) MOZ_OVERRIDE
;
108 virtual bool DeallocPCookieServiceParent(PCookieServiceParent
*) MOZ_OVERRIDE
;
109 virtual PWyciwygChannelParent
* AllocPWyciwygChannelParent() MOZ_OVERRIDE
;
110 virtual bool DeallocPWyciwygChannelParent(PWyciwygChannelParent
*) MOZ_OVERRIDE
;
111 virtual PFTPChannelParent
*
112 AllocPFTPChannelParent(const PBrowserOrId
& aBrowser
,
113 const SerializedLoadContext
& aSerialized
,
114 const FTPChannelCreationArgs
& aOpenArgs
) MOZ_OVERRIDE
;
116 RecvPFTPChannelConstructor(
117 PFTPChannelParent
* aActor
,
118 const PBrowserOrId
& aBrowser
,
119 const SerializedLoadContext
& aSerialized
,
120 const FTPChannelCreationArgs
& aOpenArgs
) MOZ_OVERRIDE
;
121 virtual bool DeallocPFTPChannelParent(PFTPChannelParent
*) MOZ_OVERRIDE
;
122 virtual PWebSocketParent
*
123 AllocPWebSocketParent(const PBrowserOrId
& browser
,
124 const SerializedLoadContext
& aSerialized
) MOZ_OVERRIDE
;
125 virtual bool DeallocPWebSocketParent(PWebSocketParent
*) MOZ_OVERRIDE
;
126 virtual PTCPSocketParent
* AllocPTCPSocketParent(const nsString
& host
,
127 const uint16_t& port
) MOZ_OVERRIDE
;
129 virtual PRemoteOpenFileParent
*
130 AllocPRemoteOpenFileParent(const SerializedLoadContext
& aSerialized
,
131 const URIParams
& aFileURI
,
132 const OptionalURIParams
& aAppURI
) MOZ_OVERRIDE
;
134 RecvPRemoteOpenFileConstructor(PRemoteOpenFileParent
* aActor
,
135 const SerializedLoadContext
& aSerialized
,
136 const URIParams
& aFileURI
,
137 const OptionalURIParams
& aAppURI
)
139 virtual bool DeallocPRemoteOpenFileParent(PRemoteOpenFileParent
* aActor
)
142 virtual bool DeallocPTCPSocketParent(PTCPSocketParent
*) MOZ_OVERRIDE
;
143 virtual PTCPServerSocketParent
*
144 AllocPTCPServerSocketParent(const uint16_t& aLocalPort
,
145 const uint16_t& aBacklog
,
146 const nsString
& aBinaryType
) MOZ_OVERRIDE
;
147 virtual bool RecvPTCPServerSocketConstructor(PTCPServerSocketParent
*,
148 const uint16_t& aLocalPort
,
149 const uint16_t& aBacklog
,
150 const nsString
& aBinaryType
) MOZ_OVERRIDE
;
151 virtual bool DeallocPTCPServerSocketParent(PTCPServerSocketParent
*) MOZ_OVERRIDE
;
152 virtual PUDPSocketParent
* AllocPUDPSocketParent(const nsCString
& aFilter
) MOZ_OVERRIDE
;
153 virtual bool RecvPUDPSocketConstructor(PUDPSocketParent
*, const nsCString
& aFilter
) MOZ_OVERRIDE
;
154 virtual bool DeallocPUDPSocketParent(PUDPSocketParent
*) MOZ_OVERRIDE
;
155 virtual PDNSRequestParent
* AllocPDNSRequestParent(const nsCString
& aHost
,
156 const uint32_t& aFlags
,
157 const nsCString
& aNetworkInterface
) MOZ_OVERRIDE
;
158 virtual bool RecvPDNSRequestConstructor(PDNSRequestParent
* actor
,
159 const nsCString
& hostName
,
160 const uint32_t& flags
,
161 const nsCString
& aNetworkInterface
) MOZ_OVERRIDE
;
162 virtual bool DeallocPDNSRequestParent(PDNSRequestParent
*) MOZ_OVERRIDE
;
163 virtual bool RecvHTMLDNSPrefetch(const nsString
& hostname
,
164 const uint16_t& flags
) MOZ_OVERRIDE
;
165 virtual bool RecvCancelHTMLDNSPrefetch(const nsString
& hostname
,
166 const uint16_t& flags
,
167 const nsresult
& reason
) MOZ_OVERRIDE
;
169 virtual mozilla::ipc::IProtocol
*
170 CloneProtocol(Channel
* aChannel
,
171 mozilla::ipc::ProtocolCloneContext
* aCtx
) MOZ_OVERRIDE
;
172 virtual PRtspControllerParent
* AllocPRtspControllerParent() MOZ_OVERRIDE
;
173 virtual bool DeallocPRtspControllerParent(PRtspControllerParent
*) MOZ_OVERRIDE
;
175 virtual PRtspChannelParent
*
176 AllocPRtspChannelParent(const RtspChannelConnectArgs
& aArgs
)
179 RecvPRtspChannelConstructor(PRtspChannelParent
* aActor
,
180 const RtspChannelConnectArgs
& aArgs
)
182 virtual bool DeallocPRtspChannelParent(PRtspChannelParent
*) MOZ_OVERRIDE
;
184 virtual PChannelDiverterParent
*
185 AllocPChannelDiverterParent(const ChannelDiverterArgs
& channel
) MOZ_OVERRIDE
;
187 RecvPChannelDiverterConstructor(PChannelDiverterParent
* actor
,
188 const ChannelDiverterArgs
& channel
) MOZ_OVERRIDE
;
189 virtual bool DeallocPChannelDiverterParent(PChannelDiverterParent
* actor
)
192 virtual bool RecvOnAuthAvailable(const uint64_t& aCallbackId
,
193 const nsString
& aUser
,
194 const nsString
& aPassword
,
195 const nsString
& aDomain
) MOZ_OVERRIDE
;
196 virtual bool RecvOnAuthCancelled(const uint64_t& aCallbackId
,
197 const bool& aUserCancel
) MOZ_OVERRIDE
;
200 nsCString mCoreAppsBasePath
;
201 nsCString mWebAppsBasePath
;
202 nsRefPtr
<OfflineObserver
> mObserver
;
206 } // namespace mozilla
208 #endif // mozilla_net_NeckoParent_h