OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/sensor/SensorErrorEvent.h" | 5 #include "modules/sensor/SensorErrorEvent.h" |
6 | 6 |
7 #include "bindings/core/v8/V8Binding.h" | 7 #include "bindings/core/v8/V8Binding.h" |
8 #include <v8.h> | 8 #include <v8.h> |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 SensorErrorEvent::~SensorErrorEvent() {} | 12 SensorErrorEvent::~SensorErrorEvent() {} |
13 | 13 |
14 SensorErrorEvent::SensorErrorEvent(const AtomicString& eventType) | 14 SensorErrorEvent::SensorErrorEvent(const AtomicString& eventType, |
15 : Event(eventType, | 15 DOMException* error) |
16 true, | 16 : Event(eventType, false, false) // does not bubble, is not cancelable. |
17 false) // let default be bubbles but is not cancelable. | 17 , |
18 {} | 18 m_error(error) { |
| 19 DCHECK(m_error); |
| 20 } |
19 | 21 |
20 SensorErrorEvent::SensorErrorEvent(const AtomicString& eventType, | 22 SensorErrorEvent::SensorErrorEvent(const AtomicString& eventType, |
21 const SensorErrorEventInit& initializer) | 23 const SensorErrorEventInit& initializer) |
22 : Event(eventType, initializer) { | 24 : Event(eventType, initializer) {} |
23 setCanBubble(true); | |
24 } | |
25 | 25 |
26 const AtomicString& SensorErrorEvent::interfaceName() const { | 26 const AtomicString& SensorErrorEvent::interfaceName() const { |
27 return EventNames::SensorErrorEvent; | 27 return EventNames::SensorErrorEvent; |
28 } | 28 } |
29 | 29 |
30 DEFINE_TRACE(SensorErrorEvent) { | 30 DEFINE_TRACE(SensorErrorEvent) { |
| 31 visitor->trace(m_error); |
31 Event::trace(visitor); | 32 Event::trace(visitor); |
32 } | 33 } |
33 | 34 |
34 } // namespace blink | 35 } // namespace blink |
OLD | NEW |