Bug 1635304 [wpt PR 23392] - Remove erroneous named properties object test, a=testonly
[gecko.git] / dom / midi / MIDIPermissionRequest.h
blob28181daee152978471bfb63162066c790005fdea
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_MIDIPermissionRequest_h
8 #define mozilla_dom_MIDIPermissionRequest_h
10 #include "mozilla/dom/Promise.h"
12 namespace mozilla {
13 namespace dom {
15 struct MIDIOptions;
17 /**
18 * Handles permission dialog management when requesting MIDI permissions.
20 class MIDIPermissionRequest final : public ContentPermissionRequestBase,
21 public nsIRunnable {
22 public:
23 MIDIPermissionRequest(nsPIDOMWindowInner* aWindow, Promise* aPromise,
24 const MIDIOptions& aOptions);
26 NS_DECL_ISUPPORTS_INHERITED
27 NS_DECL_NSIRUNNABLE
28 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MIDIPermissionRequest,
29 ContentPermissionRequestBase)
30 // nsIContentPermissionRequest
31 NS_IMETHOD Cancel(void) override;
32 NS_IMETHOD Allow(JS::HandleValue choices) override;
33 NS_IMETHOD GetTypes(nsIArray** aTypes) override;
35 private:
36 ~MIDIPermissionRequest() = default;
38 // Promise for returning MIDIAccess on request success
39 RefPtr<Promise> mPromise;
40 // True if sysex permissions should be requested
41 bool mNeedsSysex;
44 } // namespace dom
45 } // namespace mozilla
47 #endif // mozilla_dom_MIDIPermissionRequest_h