Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / midi / MIDIPortChild.h
blobd67896e73a1ecd26c676a04556ce7074dc2e2f29
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/PMIDIPortChild.h"
11 #include "mozilla/dom/MIDIPortInterface.h"
13 namespace mozilla::dom {
15 class MIDIPort;
16 class MIDIPortInfo;
18 /**
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 {
25 public:
26 NS_INLINE_DECL_REFCOUNTING(MIDIPortChild);
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,
35 MIDIPort* aPort);
36 // virtual void Shutdown() override;
37 void SetActorAlive();
39 void Teardown();
41 private:
42 ~MIDIPortChild() = default;
43 // Pointer to the DOM object this actor represents. The actor cannot outlive
44 // the DOM object.
45 MIDIPort* mDOMPort;
46 bool mActorWasAlive;
48 } // namespace mozilla::dom
50 #endif