OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PressureSensorReading_h |
| 6 #define PressureSensorReading_h |
| 7 |
| 8 #include <limits> |
| 9 |
| 10 #include "modules/sensor/SensorReading.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class MODULES_EXPORT PressureSensorReading : public SensorReading { |
| 15 DEFINE_WRAPPERTYPEINFO(); |
| 16 public: |
| 17 static PressureSensorReading* create(SensorController* controller) |
| 18 { |
| 19 return new PressureSensorReading(controller); |
| 20 } |
| 21 |
| 22 DECLARE_VIRTUAL_TRACE(); |
| 23 |
| 24 DOMHighResTimeStamp timeStamp() const final; |
| 25 double pressure() const; |
| 26 |
| 27 UpdateStatus updateInternalData() final; |
| 28 |
| 29 private: |
| 30 explicit PressureSensorReading(SensorController* controller); |
| 31 void refreshData() const; |
| 32 struct Data |
| 33 { |
| 34 Data() |
| 35 : timestamp(0) |
| 36 , pressure(std::numeric_limits<double>::infinity()) { } |
| 37 double timestamp; |
| 38 double pressure; |
| 39 double unused[device::sensors::blink::kSensorReadingFieldsCount - 2]; |
| 40 } mutable m_data; |
| 41 }; |
| 42 |
| 43 } // namepsace blink |
| 44 |
| 45 #endif // PressureSensorReading_h |
OLD | NEW |