Bug 1914261 - Rename --noinstall to --no-install for raptor. r=perftest-reviewers...
[gecko.git] / dom / permission / Permissions.h
blobf6cfd4ae6568e1ef771a25a20db5c7b7f2cc6f92
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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_Permissions_h_
8 #define mozilla_dom_Permissions_h_
10 #include "nsISupports.h"
11 #include "nsPIDOMWindow.h"
12 #include "nsWrapperCache.h"
14 namespace mozilla {
16 class ErrorResult;
18 namespace dom {
20 class Promise;
21 class PermissionStatus;
22 struct PermissionSetParameters;
24 class Permissions final : public nsISupports, public nsWrapperCache {
25 public:
26 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
27 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Permissions)
29 explicit Permissions(nsPIDOMWindowInner* aWindow);
31 nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
33 JSObject* WrapObject(JSContext* aCx,
34 JS::Handle<JSObject*> aGivenProto) override;
36 already_AddRefed<Promise> Query(JSContext* aCx,
37 JS::Handle<JSObject*> aPermission,
38 ErrorResult& aRv);
40 // The IDL conversion steps of
41 // https://w3c.github.io/permissions/#webdriver-command-set-permission
42 already_AddRefed<PermissionStatus> ParseSetParameters(
43 JSContext* aCx, const PermissionSetParameters& aParameters,
44 ErrorResult& aRv);
46 private:
47 ~Permissions();
49 nsCOMPtr<nsPIDOMWindowInner> mWindow;
52 } // namespace dom
53 } // namespace mozilla
55 #endif // mozilla_dom_permissions_h_