Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM PermissionStatus.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_PermissionStatusBinding_h
4 : #define mozilla_dom_PermissionStatusBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jspubtd.h"
8 : #include "mozilla/ErrorResult.h"
9 : #include "mozilla/dom/BindingDeclarations.h"
10 : #include "mozilla/dom/Nullable.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : struct NativePropertyHooks;
16 : class PermissionStatus;
17 : struct PermissionStatusAtoms;
18 : class ProtoAndIfaceCache;
19 :
20 : } // namespace dom
21 : } // namespace mozilla
22 :
23 : namespace mozilla {
24 : namespace dom {
25 :
26 : enum class PermissionState : uint8_t {
27 : Granted,
28 : Denied,
29 : Prompt,
30 : EndGuard_
31 : };
32 :
33 : namespace PermissionStateValues {
34 : extern const EnumEntry strings[4];
35 : } // namespace PermissionStateValues
36 :
37 : bool
38 : ToJSValue(JSContext* aCx, PermissionState aArgument, JS::MutableHandle<JS::Value> aValue);
39 :
40 :
41 : namespace PermissionStatusBinding {
42 :
43 : typedef mozilla::dom::PermissionStatus NativeType;
44 :
45 : JSObject*
46 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
47 :
48 : const JSClass*
49 : GetJSClass();
50 :
51 : bool
52 : Wrap(JSContext* aCx, mozilla::dom::PermissionStatus* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
53 :
54 : template <class T>
55 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
56 : {
57 0 : JS::Rooted<JSObject*> reflector(aCx);
58 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
59 : }
60 :
61 : // We declare this as an array so that retrieving a pointer to this
62 : // binding's property hooks only requires compile/link-time resolvable
63 : // address arithmetic. Declaring it as a pointer instead would require
64 : // doing a run-time load to fetch a pointer to this binding's property
65 : // hooks. And then structures which embedded a pointer to this structure
66 : // would require a run-time load for proper initialization, which would
67 : // then induce static constructors. Lots of static constructors.
68 : extern const NativePropertyHooks sNativePropertyHooks[];
69 :
70 : void
71 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
72 :
73 : JS::Handle<JSObject*>
74 : GetProtoObjectHandle(JSContext* aCx);
75 :
76 : JS::Handle<JSObject*>
77 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
78 :
79 : JSObject*
80 : GetConstructorObject(JSContext* aCx);
81 :
82 : } // namespace PermissionStatusBinding
83 :
84 :
85 :
86 : } // namespace dom
87 : } // namespace mozilla
88 :
89 : #endif // mozilla_dom_PermissionStatusBinding_h
|