Coverage Report

Created: 2018-09-25 14:53

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