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 #ifndef mozilla_net_NeckoChild_h
9 #define mozilla_net_NeckoChild_h
11 #include "mozilla/net/PNeckoChild.h"
12 #include "mozilla/net/NeckoCommon.h"
17 // Header file contents
18 class NeckoChild
: public PNeckoChild
{
19 friend class PNeckoChild
;
22 NeckoChild() = default;
23 virtual ~NeckoChild();
25 static void InitNeckoChild();
28 PStunAddrsRequestChild
* AllocPStunAddrsRequestChild();
29 bool DeallocPStunAddrsRequestChild(PStunAddrsRequestChild
* aActor
);
31 PWebrtcTCPSocketChild
* AllocPWebrtcTCPSocketChild(const Maybe
<TabId
>& tabId
);
32 bool DeallocPWebrtcTCPSocketChild(PWebrtcTCPSocketChild
* aActor
);
34 PAltDataOutputStreamChild
* AllocPAltDataOutputStreamChild(
35 const nsCString
& type
, const int64_t& predictedSize
,
36 PHttpChannelChild
* channel
);
37 bool DeallocPAltDataOutputStreamChild(PAltDataOutputStreamChild
* aActor
);
39 PCookieServiceChild
* AllocPCookieServiceChild();
40 bool DeallocPCookieServiceChild(PCookieServiceChild
*);
41 PFTPChannelChild
* AllocPFTPChannelChild(
42 PBrowserChild
* aBrowser
, const SerializedLoadContext
& aSerialized
,
43 const FTPChannelCreationArgs
& aOpenArgs
);
44 bool DeallocPFTPChannelChild(PFTPChannelChild
*);
46 PGIOChannelChild
* AllocPGIOChannelChild(
47 PBrowserChild
* aBrowser
, const SerializedLoadContext
& aSerialized
,
48 const GIOChannelCreationArgs
& aOpenArgs
);
49 bool DeallocPGIOChannelChild(PGIOChannelChild
*);
51 PWebSocketChild
* AllocPWebSocketChild(PBrowserChild
*,
52 const SerializedLoadContext
&,
54 bool DeallocPWebSocketChild(PWebSocketChild
*);
55 PTCPSocketChild
* AllocPTCPSocketChild(const nsString
& host
,
56 const uint16_t& port
);
57 bool DeallocPTCPSocketChild(PTCPSocketChild
*);
58 PTCPServerSocketChild
* AllocPTCPServerSocketChild(
59 const uint16_t& aLocalPort
, const uint16_t& aBacklog
,
60 const bool& aUseArrayBuffers
);
61 bool DeallocPTCPServerSocketChild(PTCPServerSocketChild
*);
62 PUDPSocketChild
* AllocPUDPSocketChild(nsIPrincipal
* aPrincipal
,
63 const nsCString
& aFilter
);
64 bool DeallocPUDPSocketChild(PUDPSocketChild
*);
65 PSimpleChannelChild
* AllocPSimpleChannelChild(const uint32_t& channelId
);
66 bool DeallocPSimpleChannelChild(PSimpleChannelChild
* child
);
67 PTransportProviderChild
* AllocPTransportProviderChild();
68 bool DeallocPTransportProviderChild(PTransportProviderChild
* aActor
);
69 mozilla::ipc::IPCResult
RecvAsyncAuthPromptForNestedFrame(
70 const TabId
& aNestedFrameId
, const nsCString
& aUri
,
71 const nsString
& aRealm
, const uint64_t& aCallbackId
);
72 PWebSocketEventListenerChild
* AllocPWebSocketEventListenerChild(
73 const uint64_t& aInnerWindowID
);
74 bool DeallocPWebSocketEventListenerChild(PWebSocketEventListenerChild
*);
76 /* Predictor Messsages */
77 mozilla::ipc::IPCResult
RecvPredOnPredictPrefetch(
78 nsIURI
* aURI
, const uint32_t& aHttpStatus
);
79 mozilla::ipc::IPCResult
RecvPredOnPredictPreconnect(nsIURI
* aURI
);
80 mozilla::ipc::IPCResult
RecvPredOnPredictDNS(nsIURI
* aURI
);
82 mozilla::ipc::IPCResult
RecvSpeculativeConnectRequest();
83 mozilla::ipc::IPCResult
RecvNetworkChangeNotification(nsCString
const& type
);
85 PClassifierDummyChannelChild
* AllocPClassifierDummyChannelChild(
86 nsIURI
* aURI
, nsIURI
* aTopWindowURI
, const nsresult
& aTopWindowURIResult
,
87 const Maybe
<LoadInfoArgs
>& aLoadInfo
);
89 bool DeallocPClassifierDummyChannelChild(
90 PClassifierDummyChannelChild
* aActor
);
94 * Reference to the PNecko Child protocol.
95 * Null if this is not a content process.
97 extern PNeckoChild
* gNeckoChild
;
100 } // namespace mozilla
102 #endif // mozilla_net_NeckoChild_h