Index: third_party/WebKit/Source/modules/sensor/PressureSensorReading.h |
diff --git a/third_party/WebKit/Source/modules/sensor/PressureSensorReading.h b/third_party/WebKit/Source/modules/sensor/PressureSensorReading.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b01320ec5a9672bb262c4456661f5db9a27a5551 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/sensor/PressureSensorReading.h |
@@ -0,0 +1,45 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef PressureSensorReading_h |
+#define PressureSensorReading_h |
+ |
+#include <limits> |
+ |
+#include "modules/sensor/SensorReading.h" |
+ |
+namespace blink { |
+ |
+class MODULES_EXPORT PressureSensorReading : public SensorReading { |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ static PressureSensorReading* create(SensorController* controller) |
+ { |
+ return new PressureSensorReading(controller); |
+ } |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+ DOMHighResTimeStamp timeStamp() const final; |
+ double pressure() const; |
+ |
+ UpdateStatus updateInternalData() final; |
+ |
+private: |
+ explicit PressureSensorReading(SensorController* controller); |
+ void refreshData() const; |
+ struct Data |
+ { |
+ Data() |
+ : timestamp(0) |
+ , pressure(std::numeric_limits<double>::infinity()) { } |
+ double timestamp; |
+ double pressure; |
+ double unused[device::sensors::blink::kSensorReadingFieldsCount - 2]; |
+ } mutable m_data; |
+}; |
+ |
+} // namepsace blink |
+ |
+#endif // PressureSensorReading_h |