Chromium Code Reviews| 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 return m_deviceMotionData->interval(); |
|
timvolodine
2017/03/22 17:05:27
isNull = false; ?
also likely the isNull etc can
Reilly Grant (use Gerrit)
2017/03/22 17:13:33
The generated bindings code initializes isNull to
timvolodine
2017/03/22 18:27:26
In that case perhaps add a this as a comment? Othe
Reilly Grant (use Gerrit)
2017/03/22 18:38:03
It is required by the bindings code because the at
| |
| 85 return m_deviceMotionData->interval(); | |
| 86 | |
| 87 isNull = true; | |
| 88 return 0; | |
| 89 } | 85 } |
| 90 | 86 |
| 91 const AtomicString& DeviceMotionEvent::interfaceName() const { | 87 const AtomicString& DeviceMotionEvent::interfaceName() const { |
| 92 return EventNames::DeviceMotionEvent; | 88 return EventNames::DeviceMotionEvent; |
| 93 } | 89 } |
| 94 | 90 |
| 95 DEFINE_TRACE(DeviceMotionEvent) { | 91 DEFINE_TRACE(DeviceMotionEvent) { |
| 96 visitor->trace(m_deviceMotionData); | 92 visitor->trace(m_deviceMotionData); |
| 97 visitor->trace(m_acceleration); | 93 visitor->trace(m_acceleration); |
| 98 visitor->trace(m_accelerationIncludingGravity); | 94 visitor->trace(m_accelerationIncludingGravity); |
| 99 visitor->trace(m_rotationRate); | 95 visitor->trace(m_rotationRate); |
| 100 Event::trace(visitor); | 96 Event::trace(visitor); |
| 101 } | 97 } |
| 102 | 98 |
| 103 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |