1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_net_SocketProcessBridgeChild_h
7 #define mozilla_net_SocketProcessBridgeChild_h
10 #include "mozilla/net/PSocketProcessBridgeChild.h"
11 #include "nsIObserver.h"
16 // The IPC actor implements PSocketProcessBridgeChild in content process.
17 // This is allocated and kept alive by NeckoChild. When "content-child-shutdown"
18 // topic is observed, this actor will be destroyed.
19 class SocketProcessBridgeChild final
: public PSocketProcessBridgeChild
,
22 NS_DECL_THREADSAFE_ISUPPORTS
25 static already_AddRefed
<SocketProcessBridgeChild
> GetSingleton();
27 MozPromise
<RefPtr
<SocketProcessBridgeChild
>, nsCString
, false>;
28 static RefPtr
<GetPromise
> GetSocketProcessBridge();
30 mozilla::ipc::IPCResult
RecvTest();
31 void ActorDestroy(ActorDestroyReason aWhy
) override
;
32 void DeferredDestroy();
33 bool IsShuttingDown() const { return mShuttingDown
; };
34 ProcessId
SocketProcessPid() const { return mSocketProcessPid
; };
37 DISALLOW_COPY_AND_ASSIGN(SocketProcessBridgeChild
);
38 static bool Create(Endpoint
<PSocketProcessBridgeChild
>&& aEndpoint
);
39 explicit SocketProcessBridgeChild();
40 virtual ~SocketProcessBridgeChild();
42 static StaticRefPtr
<SocketProcessBridgeChild
> sSocketProcessBridgeChild
;
44 ProcessId mSocketProcessPid
;
48 } // namespace mozilla
50 #endif // mozilla_net_SocketProcessBridgeChild_h