Bug 1839170 - Refactor Snap pulling, Add Firefox Snap Core22 and GNOME 42 SDK symbols...
[gecko.git] / ipc / glue / BackgroundStarterParent.h
blob4312b9ab2ac303662233c4abcbf2594e0d557158
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_ipc_BackgroundStarterParent_h
8 #define mozilla_ipc_BackgroundStarterParent_h
10 #include "mozilla/ipc/PBackgroundStarterParent.h"
11 #include "mozilla/dom/ContentParent.h"
12 #include "nsISupportsImpl.h"
14 namespace mozilla::ipc {
16 class BackgroundStarterParent final : public PBackgroundStarterParent {
17 public:
18 NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_DELETE_ON_MAIN_THREAD(
19 BackgroundStarterParent, override)
21 // Implemented in BackgroundImpl.cpp
22 BackgroundStarterParent(mozilla::dom::ThreadsafeContentParentHandle* aContent,
23 bool aCrossProcess);
25 void SetLiveActorArray(nsTArray<IToplevelProtocol*>* aLiveActorArray);
27 private:
28 friend class PBackgroundStarterParent;
29 ~BackgroundStarterParent() = default;
31 // Implemented in BackgroundImpl.cpp
32 void ActorDestroy(ActorDestroyReason aReason) override;
34 // Implemented in BackgroundImpl.cpp
35 IPCResult RecvInitBackground(Endpoint<PBackgroundParent>&& aEndpoint);
37 const bool mCrossProcess;
39 const RefPtr<mozilla::dom::ThreadsafeContentParentHandle> mContent;
41 // Set when the actor is opened successfully and used to handle shutdown
42 // hangs. Only touched on the background thread.
43 nsTArray<IToplevelProtocol*>* mLiveActorArray = nullptr;
46 } // namespace mozilla::ipc
48 #endif // mozilla_ipc_BackgroundStarterParent_h