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/. */ 6 7 #ifndef mozilla_ipc_BackgroundStarterChild_h 8 #define mozilla_ipc_BackgroundStarterChild_h 9 10 #include "mozilla/ipc/PBackgroundStarterChild.h" 11 #include "mozilla/dom/ContentChild.h" 12 13 namespace mozilla::ipc { 14 15 class BackgroundStarterChild final : public PBackgroundStarterChild { 16 public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BackgroundStarterChild,override)17 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BackgroundStarterChild, override) 18 19 BackgroundStarterChild(base::ProcessId aOtherPid, 20 nsISerialEventTarget* aTaskQueue) 21 : mOtherPid(aOtherPid), mTaskQueue(aTaskQueue) {} 22 23 // Unlike the methods on `IToplevelProtocol`, may be accessed on any thread 24 // and will not be modified after construction. 25 const base::ProcessId mOtherPid; 26 const nsCOMPtr<nsISerialEventTarget> mTaskQueue; 27 28 private: 29 friend class PBackgroundStarterChild; 30 ~BackgroundStarterChild() = default; 31 }; 32 33 } // namespace mozilla::ipc 34 35 #endif // mozilla_ipc_BackgroundStarterChild_h 36