/src/mozilla-central/dom/system/nsOSPermissionRequestBase.h
Line | Count | Source (jump to first uncovered line) |
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 |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef nsOSPermissionRequestBase_h__ |
8 | | #define nsOSPermissionRequestBase_h__ |
9 | | |
10 | | #include "nsIOSPermissionRequest.h" |
11 | | #include "nsWeakReference.h" |
12 | | |
13 | | #define NS_OSPERMISSIONREQUEST_CID \ |
14 | | { 0x95790842, 0x75a0, 0x430d, \ |
15 | | { 0x98, 0xbf, 0xf5, 0xce, 0x37, 0x88, 0xea, 0x6d } } |
16 | | #define NS_OSPERMISSIONREQUEST_CONTRACTID \ |
17 | | "@mozilla.org/ospermissionrequest;1" |
18 | | |
19 | | namespace mozilla { |
20 | | namespace dom { |
21 | | class Promise; |
22 | | } // namespace dom |
23 | | } // namespace mozilla |
24 | | |
25 | | using mozilla::dom::Promise; |
26 | | |
27 | | /* |
28 | | * The base implementation of nsIOSPermissionRequest to be subclassed on |
29 | | * platforms that require permission requests for access to resources such |
30 | | * as media captures devices. This implementation always returns results |
31 | | * indicating access is permitted. |
32 | | */ |
33 | | class nsOSPermissionRequestBase |
34 | | : public nsIOSPermissionRequest, |
35 | | public nsSupportsWeakReference |
36 | | { |
37 | | public: |
38 | | NS_DECL_ISUPPORTS |
39 | | NS_DECL_NSIOSPERMISSIONREQUEST |
40 | | |
41 | | nsOSPermissionRequestBase() {}; |
42 | | |
43 | | protected: |
44 | | nsresult GetPromise(JSContext* aCx, RefPtr<Promise>& aPromiseOut); |
45 | 0 | virtual ~nsOSPermissionRequestBase() = default; |
46 | | }; |
47 | | |
48 | | #endif |