1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
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 
7 #ifndef mozilla_dom_MIDIManagerParent_h
8 #define mozilla_dom_MIDIManagerParent_h
9 
10 #include "mozilla/dom/PMIDIManagerParent.h"
11 
12 namespace mozilla {
13 namespace dom {
14 
15 /**
16  * Actor implementation for the Parent (PBackground thread) side of MIDIManager
17  * (represented in DOM by MIDIAccess). Manages actor lifetime so that we know
18  * to shut down services when all MIDIManagers are gone.
19  *
20  */
21 class MIDIManagerParent final : public PMIDIManagerParent {
22  public:
23   NS_INLINE_DECL_REFCOUNTING(MIDIManagerParent);
24   MIDIManagerParent() = default;
25   mozilla::ipc::IPCResult RecvShutdown();
26   void Teardown();
27   void ActorDestroy(ActorDestroyReason aWhy) override;
28 
29  private:
30   ~MIDIManagerParent() = default;
31 };
32 
33 }  // namespace dom
34 }  // namespace mozilla
35 
36 #endif  // mozilla_dom_MIDIManagerParent_h
37