зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1797020 - Add an API to determine if there are any midi devices. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D160974
This commit is contained in:
Родитель
e9b58109c1
Коммит
e8d791fac7
|
@ -97,6 +97,9 @@ class MIDIPlatformService {
|
|||
// before/at now, and schedules MIDI Port connection closing.
|
||||
void Close(MIDIPortParent* aPort);
|
||||
|
||||
// Returns whether there are currently any MIDI devices.
|
||||
bool HasDevice() { return !mPortInfo.IsEmpty(); }
|
||||
|
||||
protected:
|
||||
MIDIPlatformService();
|
||||
virtual ~MIDIPlatformService();
|
||||
|
|
|
@ -1259,6 +1259,16 @@ bool BackgroundParentImpl::DeallocPMIDIManagerParent(
|
|||
return true;
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult BackgroundParentImpl::RecvHasMIDIDevice(
|
||||
HasMIDIDeviceResolver&& aResolver) {
|
||||
AssertIsInMainOrSocketProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
|
||||
bool hasDevice = MIDIPlatformService::Get()->HasDevice();
|
||||
aResolver(hasDevice);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::dom::PClientManagerParent*
|
||||
BackgroundParentImpl::AllocPClientManagerParent() {
|
||||
return mozilla::dom::AllocClientManagerParent();
|
||||
|
|
|
@ -347,6 +347,9 @@ class BackgroundParentImpl : public PBackgroundParent {
|
|||
|
||||
bool DeallocPMIDIManagerParent(PMIDIManagerParent* aActor) override;
|
||||
|
||||
mozilla::ipc::IPCResult RecvHasMIDIDevice(
|
||||
HasMIDIDeviceResolver&& aResolver) override;
|
||||
|
||||
mozilla::ipc::IPCResult RecvStorageActivity(
|
||||
const PrincipalInfo& aPrincipalInfo) override;
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ parent:
|
|||
|
||||
async PMIDIManager();
|
||||
async PMIDIPort(MIDIPortInfo portInfo, bool sysexEnabled);
|
||||
async HasMIDIDevice() returns (bool hasDevice);
|
||||
|
||||
// This method is used to propagate storage activities from the child actor
|
||||
// to the parent actor. See StorageActivityService.
|
||||
|
|
Загрузка…
Ссылка в новой задаче