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

Unified Diff: third_party/WebKit/Source/modules/sensor/PressureSensorReading.h

Issue 2051083002: WIP : Generic Sensor API implementation Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698