OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/sensor/MagnetometerReading.h" | 5 #include "modules/sensor/MagnetometerReading.h" |
6 | 6 |
7 #include "modules/sensor/MagnetometerReadingInit.h" | 7 #include "modules/sensor/MagnetometerReadingInit.h" |
8 #include "wtf/CurrentTime.h" | 8 #include "wtf/CurrentTime.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 30 matching lines...) Expand all Loading... |
41 double MagnetometerReading::y() const { | 41 double MagnetometerReading::y() const { |
42 return data().values[1]; | 42 return data().values[1]; |
43 } | 43 } |
44 | 44 |
45 double MagnetometerReading::z() const { | 45 double MagnetometerReading::z() const { |
46 return data().values[2]; | 46 return data().values[2]; |
47 } | 47 } |
48 | 48 |
49 bool MagnetometerReading::isReadingUpdated( | 49 bool MagnetometerReading::isReadingUpdated( |
50 const device::SensorReading& previous) const { | 50 const device::SensorReading& previous) const { |
51 return previous.values[0] != x() && previous.values[1] != y() && | 51 return previous.values[0] != x() || previous.values[1] != y() || |
52 previous.values[2] != z(); | 52 previous.values[2] != z(); |
53 } | 53 } |
54 | 54 |
55 DEFINE_TRACE(MagnetometerReading) { | 55 DEFINE_TRACE(MagnetometerReading) { |
56 SensorReading::trace(visitor); | 56 SensorReading::trace(visitor); |
57 } | 57 } |
58 | 58 |
59 } // namespace blink | 59 } // namespace blink |
OLD | NEW |