Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.cpp

Issue 2758933002: Fix default initialization for DeviceMotionEvent.interval. (Closed)
Patch Set: Rebased. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698