Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/PeerConnectionObserverEnumsBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM PeerConnectionObserverEnums.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "PeerConnectionObserverEnumsBinding.h"
4
#include "jsapi.h"
5
#include "mozilla/dom/BindingDeclarations.h"
6
#include "mozilla/dom/NonRefcountedDOMObject.h"
7
8
namespace mozilla {
9
namespace dom {
10
11
namespace binding_detail {}; // Just to make sure it's known as a namespace
12
using namespace mozilla::dom::binding_detail;
13
14
15
namespace PCObserverStateTypeValues {
16
extern const EnumEntry strings[5] = {
17
  {"None", 4},
18
  {"IceConnectionState", 18},
19
  {"IceGatheringState", 17},
20
  {"SignalingState", 14},
21
  { nullptr, 0 }
22
};
23
} // namespace PCObserverStateTypeValues
24
25
bool
26
ToJSValue(JSContext* aCx, PCObserverStateType aArgument, JS::MutableHandle<JS::Value> aValue)
27
0
{
28
0
  MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(PCObserverStateTypeValues::strings));
29
0
  JSString* resultStr =
30
0
    JS_NewStringCopyN(aCx, PCObserverStateTypeValues::strings[uint32_t(aArgument)].value,
31
0
                      PCObserverStateTypeValues::strings[uint32_t(aArgument)].length);
32
0
  if (!resultStr) {
33
0
    return false;
34
0
  }
35
0
  aValue.setString(resultStr);
36
0
  return true;
37
0
}
38
39
40
} // namespace dom
41
} // namespace mozilla