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

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

Issue 2471003002: [sensors] Accelerometer sensor bindings implementation (Closed)
Patch Set: Rebased after splitting the refactor for the tests. Created 4 years, 1 month 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/AccelerometerReading.h
diff --git a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h b/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h
new file mode 100644
index 0000000000000000000000000000000000000000..260a7ccba4e2ae4c063f356ee3afea55bde4a529
--- /dev/null
+++ b/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h
@@ -0,0 +1,42 @@
+// 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 AccelerometerReading_h
+#define AccelerometerReading_h
+
+#include "modules/sensor/AccelerometerReadingInit.h"
+#include "modules/sensor/SensorReading.h"
+
+namespace blink {
+
+class AccelerometerReading final : public SensorReading {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ static AccelerometerReading* create(const AccelerometerReadingInit& init) {
+ return new AccelerometerReading(init);
+ }
+
+ static AccelerometerReading* create(const device::SensorReading& data) {
+ return new AccelerometerReading(data);
+ }
+
+ ~AccelerometerReading() override;
+
+ double x() const;
+ double y() const;
+ double z() const;
+
+ bool isReadingUpdated(const device::SensorReading&) const override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ explicit AccelerometerReading(const AccelerometerReadingInit&);
+ explicit AccelerometerReading(const device::SensorReading&);
+};
+
+} // namepsace blink
+
+#endif // AccelerometerReading_h

Powered by Google App Engine
This is Rietveld 408576698