Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/FetchEventBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM FetchEvent.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_FetchEventBinding_h
4
#define mozilla_dom_FetchEventBinding_h
5
6
#include "EventBinding.h"
7
#include "GeckoProfiler.h"
8
#include "js/RootingAPI.h"
9
#include "jspubtd.h"
10
#include "mozilla/ErrorResult.h"
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/dom/Nullable.h"
13
#include "mozilla/dom/PrototypeList.h"
14
#include "mozilla/dom/Request.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
class FetchEvent;
20
struct FetchEventAtoms;
21
struct FetchEventInitAtoms;
22
struct NativePropertyHooks;
23
class ProtoAndIfaceCache;
24
class Request;
25
26
} // namespace dom
27
} // namespace mozilla
28
29
namespace mozilla {
30
namespace dom {
31
32
struct FetchEventInit : public EventInit
33
{
34
  MOZ_INIT_OUTSIDE_CTOR nsString mClientId;
35
  MOZ_INIT_OUTSIDE_CTOR bool mIsReload;
36
  MOZ_INIT_OUTSIDE_CTOR OwningNonNull<mozilla::dom::Request> mRequest;
37
38
  FetchEventInit();
39
40
  explicit inline FetchEventInit(const FastDictionaryInitializer& )
41
    : EventInit(FastDictionaryInitializer())
42
0
  {
43
0
    // Do nothing here; this is used by our "Fast" subclass
44
0
  }
45
46
  explicit inline FetchEventInit(const FetchEventInit& aOther)
47
0
  {
48
0
    *this = aOther;
49
0
  }
50
51
  bool
52
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
53
54
  bool
55
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
56
57
  void
58
  TraceDictionary(JSTracer* trc);
59
60
  inline void
61
  TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
62
0
  {
63
0
    ImplCycleCollectionTraverse(aCallback, mRequest, "mRequest", aFlags);
64
0
  }
65
66
  inline void
67
  UnlinkForCC()
68
0
  {
69
0
    ImplCycleCollectionUnlink(mRequest);
70
0
  }
71
72
  FetchEventInit&
73
  operator=(const FetchEventInit& aOther);
74
75
private:
76
  static bool
77
  InitIds(JSContext* cx, FetchEventInitAtoms* atomsCache);
78
};
79
80
namespace binding_detail {
81
struct FastFetchEventInit : public FetchEventInit
82
{
83
  inline FastFetchEventInit()
84
    : FetchEventInit(FastDictionaryInitializer())
85
0
  {
86
0
    // Doesn't matter what int we pass to the parent constructor
87
0
  }
88
};
89
} // namespace binding_detail
90
91
92
namespace FetchEvent_Binding {
93
94
  typedef mozilla::dom::FetchEvent NativeType;
95
96
  bool
97
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
98
99
  const JSClass*
100
  GetJSClass();
101
102
  bool
103
  Wrap(JSContext* aCx, mozilla::dom::FetchEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
104
105
  template <class T>
106
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
107
0
  {
108
0
    JS::Rooted<JSObject*> reflector(aCx);
109
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
110
0
  }
111
112
  void
113
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
114
115
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
116
0
  {
117
0
    /* Get the interface prototype object for this class.  This will create the
118
0
       object as needed. */
119
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::FetchEvent,
120
0
                                       &CreateInterfaceObjects,
121
0
                                       /* aDefineOnGlobal = */ true);
122
0
123
0
  }
124
125
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
126
0
  {
127
0
    /* Get the interface object for this class.  This will create the object as
128
0
       needed. */
129
0
130
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::FetchEvent,
131
0
                                       &CreateInterfaceObjects,
132
0
                                       aDefineOnGlobal);
133
0
  }
134
135
  JSObject*
136
  GetConstructorObject(JSContext* aCx);
137
138
} // namespace FetchEvent_Binding
139
140
141
142
} // namespace dom
143
} // namespace mozilla
144
145
#endif // mozilla_dom_FetchEventBinding_h