OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 DeviceMotionEvent::~DeviceMotionEvent() | 35 DeviceMotionEvent::~DeviceMotionEvent() |
36 { | 36 { |
37 } | 37 } |
38 | 38 |
39 DeviceMotionEvent::DeviceMotionEvent() | 39 DeviceMotionEvent::DeviceMotionEvent() |
40 : m_deviceMotionData(DeviceMotionData::create()) | 40 : m_deviceMotionData(DeviceMotionData::create()) |
41 { | 41 { |
42 ScriptWrappable::init(this); | |
43 } | 42 } |
44 | 43 |
45 DeviceMotionEvent::DeviceMotionEvent(const AtomicString& eventType, DeviceMotion
Data* deviceMotionData) | 44 DeviceMotionEvent::DeviceMotionEvent(const AtomicString& eventType, DeviceMotion
Data* deviceMotionData) |
46 : Event(eventType, false, false) // Can't bubble, not cancelable | 45 : Event(eventType, false, false) // Can't bubble, not cancelable |
47 , m_deviceMotionData(deviceMotionData) | 46 , m_deviceMotionData(deviceMotionData) |
48 { | 47 { |
49 ScriptWrappable::init(this); | |
50 } | 48 } |
51 | 49 |
52 void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bub
bles, bool cancelable, DeviceMotionData* deviceMotionData) | 50 void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bub
bles, bool cancelable, DeviceMotionData* deviceMotionData) |
53 { | 51 { |
54 if (dispatched()) | 52 if (dispatched()) |
55 return; | 53 return; |
56 | 54 |
57 initEvent(type, bubbles, cancelable); | 55 initEvent(type, bubbles, cancelable); |
58 m_deviceMotionData = deviceMotionData; | 56 m_deviceMotionData = deviceMotionData; |
59 | 57 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void DeviceMotionEvent::trace(Visitor* visitor) | 110 void DeviceMotionEvent::trace(Visitor* visitor) |
113 { | 111 { |
114 visitor->trace(m_deviceMotionData); | 112 visitor->trace(m_deviceMotionData); |
115 visitor->trace(m_acceleration); | 113 visitor->trace(m_acceleration); |
116 visitor->trace(m_accelerationIncludingGravity); | 114 visitor->trace(m_accelerationIncludingGravity); |
117 visitor->trace(m_rotationRate); | 115 visitor->trace(m_rotationRate); |
118 Event::trace(visitor); | 116 Event::trace(visitor); |
119 } | 117 } |
120 | 118 |
121 } // namespace blink | 119 } // namespace blink |
OLD | NEW |