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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return nullptr; | 74 return nullptr; |
75 | 75 |
76 if (!m_rotationRate) | 76 if (!m_rotationRate) |
77 m_rotationRate = | 77 m_rotationRate = |
78 DeviceRotationRate::create(m_deviceMotionData->getRotationRate()); | 78 DeviceRotationRate::create(m_deviceMotionData->getRotationRate()); |
79 | 79 |
80 return m_rotationRate.get(); | 80 return m_rotationRate.get(); |
81 } | 81 } |
82 | 82 |
83 double DeviceMotionEvent::interval(bool& isNull) const { | 83 double DeviceMotionEvent::interval(bool& isNull) const { |
84 if (m_deviceMotionData->canProvideInterval()) | 84 isNull = false; |
85 return m_deviceMotionData->interval(); | 85 return m_deviceMotionData->interval(); |
86 | |
87 isNull = true; | |
88 return 0; | |
89 } | 86 } |
90 | 87 |
91 const AtomicString& DeviceMotionEvent::interfaceName() const { | 88 const AtomicString& DeviceMotionEvent::interfaceName() const { |
92 return EventNames::DeviceMotionEvent; | 89 return EventNames::DeviceMotionEvent; |
93 } | 90 } |
94 | 91 |
95 DEFINE_TRACE(DeviceMotionEvent) { | 92 DEFINE_TRACE(DeviceMotionEvent) { |
96 visitor->trace(m_deviceMotionData); | 93 visitor->trace(m_deviceMotionData); |
97 visitor->trace(m_acceleration); | 94 visitor->trace(m_acceleration); |
98 visitor->trace(m_accelerationIncludingGravity); | 95 visitor->trace(m_accelerationIncludingGravity); |
99 visitor->trace(m_rotationRate); | 96 visitor->trace(m_rotationRate); |
100 Event::trace(visitor); | 97 Event::trace(visitor); |
101 } | 98 } |
102 | 99 |
103 } // namespace blink | 100 } // namespace blink |
OLD | NEW |