| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 initEvent(type, bubbles, cancelable); | 55 initEvent(type, bubbles, cancelable); |
| 56 m_deviceMotionData = deviceMotionData; | 56 m_deviceMotionData = deviceMotionData; |
| 57 | 57 |
| 58 m_acceleration.clear(); | 58 m_acceleration.clear(); |
| 59 m_accelerationIncludingGravity.clear(); | 59 m_accelerationIncludingGravity.clear(); |
| 60 m_rotationRate.clear(); | 60 m_rotationRate.clear(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 DeviceMotionData* DeviceMotionEvent::deviceMotionData() const | |
| 64 { | |
| 65 return m_deviceMotionData.get(); | |
| 66 } | |
| 67 | |
| 68 DeviceAcceleration* DeviceMotionEvent::acceleration() | 63 DeviceAcceleration* DeviceMotionEvent::acceleration() |
| 69 { | 64 { |
| 70 if (!m_deviceMotionData->acceleration()) | 65 if (!m_deviceMotionData->acceleration()) |
| 71 return nullptr; | 66 return nullptr; |
| 72 | 67 |
| 73 if (!m_acceleration) | 68 if (!m_acceleration) |
| 74 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->accelera
tion()); | 69 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->accelera
tion()); |
| 75 | 70 |
| 76 return m_acceleration.get(); | 71 return m_acceleration.get(); |
| 77 } | 72 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 DEFINE_TRACE(DeviceMotionEvent) | 110 DEFINE_TRACE(DeviceMotionEvent) |
| 116 { | 111 { |
| 117 visitor->trace(m_deviceMotionData); | 112 visitor->trace(m_deviceMotionData); |
| 118 visitor->trace(m_acceleration); | 113 visitor->trace(m_acceleration); |
| 119 visitor->trace(m_accelerationIncludingGravity); | 114 visitor->trace(m_accelerationIncludingGravity); |
| 120 visitor->trace(m_rotationRate); | 115 visitor->trace(m_rotationRate); |
| 121 Event::trace(visitor); | 116 Event::trace(visitor); |
| 122 } | 117 } |
| 123 | 118 |
| 124 } // namespace blink | 119 } // namespace blink |
| OLD | NEW |