Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/DeviceOrientationEvent.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim:set ts=2 sw=2 sts=2 et cindent: */
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
/* THIS FILE IS AUTOGENERATED FROM DeviceOrientationEvent.webidl BY Codegen.py - DO NOT EDIT */
8
9
#include "DeviceOrientationEvent.h"
10
#include "DeviceOrientationEventBinding.h"
11
#include "EventBinding.h"
12
#include "js/GCAPI.h"
13
#include "mozilla/FloatingPoint.h"
14
#include "mozilla/dom/DeviceOrientationEvent.h"
15
#include "mozilla/dom/Nullable.h"
16
#include "mozilla/dom/PrimitiveConversions.h"
17
#include "nsGlobalWindowInner.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
23
DeviceOrientationEvent::DeviceOrientationEvent(mozilla::dom::EventTarget* aOwner)
24
  : Event(aOwner, nullptr, nullptr)
25
0
{
26
0
}
27
28
DeviceOrientationEvent::~DeviceOrientationEvent()
29
0
{
30
0
}
31
32
DeviceOrientationEvent*
33
DeviceOrientationEvent::AsDeviceOrientationEvent()
34
0
{
35
0
  return this;
36
0
}
37
38
JSObject*
39
DeviceOrientationEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
40
0
{
41
0
  return DeviceOrientationEvent_Binding::Wrap(aCx, this, aGivenProto);
42
0
}
43
44
already_AddRefed<DeviceOrientationEvent>
45
DeviceOrientationEvent::Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const DeviceOrientationEventInit& aEventInitDict)
46
0
{
47
0
  RefPtr<DeviceOrientationEvent> e = new DeviceOrientationEvent(aOwner);
48
0
  bool trusted = e->Init(aOwner);
49
0
  e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);
50
0
  e->mAlpha = aEventInitDict.mAlpha;
51
0
  e->mBeta = aEventInitDict.mBeta;
52
0
  e->mGamma = aEventInitDict.mGamma;
53
0
  e->mAbsolute = aEventInitDict.mAbsolute;
54
0
  e->SetTrusted(trusted);
55
0
  e->SetComposed(aEventInitDict.mComposed);
56
0
  return e.forget();
57
0
}
58
59
already_AddRefed<DeviceOrientationEvent>
60
DeviceOrientationEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, const DeviceOrientationEventInit& aEventInitDict, ErrorResult& aRv)
61
0
{
62
0
  nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
63
0
  return Constructor(owner, aType, aEventInitDict);
64
0
}
65
66
Nullable<double>
67
DeviceOrientationEvent::GetAlpha() const
68
0
{
69
0
  return mAlpha;
70
0
}
71
72
Nullable<double>
73
DeviceOrientationEvent::GetBeta() const
74
0
{
75
0
  return mBeta;
76
0
}
77
78
Nullable<double>
79
DeviceOrientationEvent::GetGamma() const
80
0
{
81
0
  return mGamma;
82
0
}
83
84
bool
85
DeviceOrientationEvent::Absolute() const
86
0
{
87
0
  return mAbsolute;
88
0
}
89
90
void
91
DeviceOrientationEvent::InitDeviceOrientationEvent(const nsAString& aType, bool aCanBubble, bool aCancelable, const Nullable<double>& aAlpha, const Nullable<double>& aBeta, const Nullable<double>& aGamma, bool aAbsolute)
92
0
{
93
0
  InitEvent(aType, aCanBubble, aCancelable);
94
0
  mAlpha = aAlpha;
95
0
  mBeta = aBeta;
96
0
  mGamma = aGamma;
97
0
  mAbsolute = aAbsolute;
98
0
99
0
}
100
101
102
} // namespace dom
103
} // namespace mozilla