From a95162b2c377273d726c8150d08a1c83ba105200 Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Tue, 14 Nov 2017 22:16:18 -0800 Subject: [PATCH] Bug 1201590 - WebMIDI IPDL files; r=baku MozReview-Commit-ID: 1b4FSasfZJ4 --HG-- extra : rebase_source : 5a400499ef8100d1454b7dbf3ebc63780dac453a --- dom/midi/MIDITypes.ipdlh | 31 +++++++++++++++++++++++++++++++ dom/midi/PMIDIManager.ipdl | 25 +++++++++++++++++++++++++ dom/midi/PMIDIPort.ipdl | 31 +++++++++++++++++++++++++++++++ dom/midi/moz.build | 11 +++++++++++ ipc/glue/PBackground.ipdl | 8 ++++++++ 5 files changed, 106 insertions(+) create mode 100644 dom/midi/MIDITypes.ipdlh create mode 100644 dom/midi/PMIDIManager.ipdl create mode 100644 dom/midi/PMIDIPort.ipdl create mode 100644 dom/midi/moz.build diff --git a/dom/midi/MIDITypes.ipdlh b/dom/midi/MIDITypes.ipdlh new file mode 100644 index 000000000000..004480e42bbe --- /dev/null +++ b/dom/midi/MIDITypes.ipdlh @@ -0,0 +1,31 @@ +/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */ +/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +using mozilla::TimeStamp from "mozilla/TimeStamp.h"; + +namespace mozilla { +namespace dom { + +struct MIDIPortInfo { + nsString id; + nsString name; + nsString manufacturer; + nsString version; + //Actually a MIDIPortType enum + uint32_t type; +}; + +struct MIDIMessage { + uint8_t[] data; + TimeStamp timestamp; +}; + +struct MIDIPortList { + MIDIPortInfo[] ports; +}; + +} // namespace dom +} // namespace mozilla diff --git a/dom/midi/PMIDIManager.ipdl b/dom/midi/PMIDIManager.ipdl new file mode 100644 index 000000000000..eb5f363fd444 --- /dev/null +++ b/dom/midi/PMIDIManager.ipdl @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +include protocol PBackground; +include MIDITypes; + +namespace mozilla { +namespace dom { + +async protocol PMIDIManager +{ + manager PBackground; +parent: + async Shutdown(); +child: + /* + * Send an updated list of MIDI ports to the child + */ + async MIDIPortListUpdate(MIDIPortList aPortList); + async __delete__(); +}; + +} // namespace ipc +} // namespace mozilla diff --git a/dom/midi/PMIDIPort.ipdl b/dom/midi/PMIDIPort.ipdl new file mode 100644 index 000000000000..ebdb9c644d5c --- /dev/null +++ b/dom/midi/PMIDIPort.ipdl @@ -0,0 +1,31 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +include protocol PBackground; +include MIDITypes; + +namespace mozilla { +namespace dom { + +async protocol PMIDIPort +{ + manager PBackground; +parent: + async Shutdown(); + async Send(MIDIMessage[] msg); + async Open(); + async Close(); + async Clear(); +child: + async Receive(MIDIMessage[] msg); + // Actually takes a MIDIDeviceConnectionState and MIDIPortConnectionState + // respectively. + async UpdateStatus(uint32_t deviceState, uint32_t connectionState); + async __delete__(); +}; + +} +} diff --git a/dom/midi/moz.build b/dom/midi/moz.build new file mode 100644 index 000000000000..123ebd47f5d8 --- /dev/null +++ b/dom/midi/moz.build @@ -0,0 +1,11 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +IPDL_SOURCES += [ + 'MIDITypes.ipdlh', + 'PMIDIManager.ipdl', + 'PMIDIPort.ipdl', +] diff --git a/ipc/glue/PBackground.ipdl b/ipc/glue/PBackground.ipdl index 0e29c883cb4d..f3f1164bdc90 100644 --- a/ipc/glue/PBackground.ipdl +++ b/ipc/glue/PBackground.ipdl @@ -22,6 +22,8 @@ include protocol PPendingIPCBlob; include protocol PTemporaryIPCBlob; include protocol PMessagePort; include protocol PCameras; +include protocol PMIDIManager; +include protocol PMIDIPort; include protocol PQuota; include protocol PChildToParentStream; include protocol PParentToChildStream; @@ -36,6 +38,7 @@ include PBackgroundSharedTypes; include PBackgroundIDBSharedTypes; include PFileSystemParams; include ProtocolTypes; +include MIDITypes; include "mozilla/dom/cache/IPCUtils.h"; @@ -73,6 +76,8 @@ sync protocol PBackground manages PTemporaryIPCBlob; manages PMessagePort; manages PCameras; + manages PMIDIManager; + manages PMIDIPort; manages PQuota; manages PChildToParentStream; manages PParentToChildStream; @@ -140,6 +145,9 @@ parent: async PClientManager(); + async PMIDIManager(); + async PMIDIPort(MIDIPortInfo portInfo, bool sysexEnabled); + child: async PCache(); async PCacheStreamControl();