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
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef _mozilla_dom_ClientManagerOpParent_h
7 #define _mozilla_dom_ClientManagerOpParent_h
8 
9 #include "mozilla/dom/PClientManagerOpParent.h"
10 #include "ClientOpPromise.h"
11 
12 namespace mozilla {
13 namespace dom {
14 
15 class ClientManagerService;
16 
17 class ClientManagerOpParent final : public PClientManagerOpParent {
18   RefPtr<ClientManagerService> mService;
19   MozPromiseRequestHolder<ClientOpPromise> mPromiseRequestHolder;
20 
21   template <typename Method, typename... Args>
22   void DoServiceOp(Method aMethod, Args&&... aArgs);
23 
24   // PClientManagerOpParent interface
25   void ActorDestroy(ActorDestroyReason aReason) override;
26 
27  public:
28   explicit ClientManagerOpParent(ClientManagerService* aService);
29   ~ClientManagerOpParent() = default;
30 
31   void Init(const ClientOpConstructorArgs& aArgs);
32 };
33 
34 }  // namespace dom
35 }  // namespace mozilla
36 
37 #endif  // _mozilla_dom_ClientManagerOpParent_h
38