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/. */
7 #ifndef mozilla_dom_MIDIPortChild_h
8 #define mozilla_dom_MIDIPortChild_h
10 #include "mozilla/dom/MIDIPortInterface.h"
11 #include "mozilla/dom/PMIDIPortChild.h"
13 namespace mozilla::dom
{
19 * Child actor for a MIDIPort object. Each MIDIPort DOM object in JS has a its
20 * own child actor. The lifetime of the actor object is dependent on the
21 * lifetime of the JS object.
24 class MIDIPortChild final
: public PMIDIPortChild
, public MIDIPortInterface
{
26 NS_INLINE_DECL_REFCOUNTING(MIDIPortChild
, override
);
27 mozilla::ipc::IPCResult
RecvReceive(nsTArray
<MIDIMessage
>&& aMsgs
);
29 virtual void ActorDestroy(ActorDestroyReason aWhy
) override
;
31 mozilla::ipc::IPCResult
RecvUpdateStatus(const uint32_t& aDeviceState
,
32 const uint32_t& aConnectionState
);
34 MIDIPortChild(const MIDIPortInfo
& aPortInfo
, bool aSysexEnabled
,
36 nsresult
GenerateStableId(const nsACString
& aOrigin
);
37 const nsString
& StableId() { return mStableId
; };
39 void DetachOwner() { mDOMPort
= nullptr; }
42 ~MIDIPortChild() = default;
43 // Pointer to the DOM object this actor represents. The actor cannot outlive
48 } // namespace mozilla::dom