Bug 1874684 - Part 4: Prefer const references instead of copying Instant values....
[gecko.git] / dom / midi / MIDIManagerParent.cpp
blobef574f5b0499b9a3c8827787ab1212dbcf642463
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 #include "mozilla/dom/MIDIManagerParent.h"
8 #include "mozilla/dom/MIDIPlatformService.h"
10 namespace mozilla::dom {
12 void MIDIManagerParent::ActorDestroy(ActorDestroyReason aWhy) {
13 if (MIDIPlatformService::IsRunning()) {
14 MIDIPlatformService::Get()->RemoveManager(this);
18 mozilla::ipc::IPCResult MIDIManagerParent::RecvRefresh() {
19 MIDIPlatformService::Get()->Refresh();
20 return IPC_OK();
23 mozilla::ipc::IPCResult MIDIManagerParent::RecvShutdown() {
24 // The two-step shutdown process here is the standard way to ensure that the
25 // child receives any messages sent by the server (since either sending or
26 // receiving __delete__ prevents any further messages from being received).
27 // This was necessary before bug 1547085 when discarded messages would
28 // trigger a crash, and is probably unnecessary now, but we leave it in place
29 // just in case.
30 Close();
31 return IPC_OK();
34 } // namespace mozilla::dom