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

Unified Diff: third_party/WebKit/Source/modules/sensor/Magnetometer.cpp

Issue 2668173003: [Sensors] Remove SensorReading interfaces (Closed)
Patch Set: updated global-interface-listing.html Created 3 years, 11 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/Magnetometer.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp b/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
index 10b228c7eb1c556271c7d3f025054b41f8c67200..78a64c0ec320401a18eac1838c977c225e6ccf8a 100644
--- a/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
@@ -4,8 +4,6 @@
#include "modules/sensor/Magnetometer.h"
-#include "modules/sensor/MagnetometerReading.h"
-
using device::mojom::blink::SensorType;
namespace blink {
@@ -31,13 +29,16 @@ Magnetometer::Magnetometer(ExecutionContext* executionContext,
exceptionState,
SensorType::MAGNETOMETER) {}
-MagnetometerReading* Magnetometer::reading() const {
- return static_cast<MagnetometerReading*>(Sensor::reading());
+double Magnetometer::x(bool& isNull) const {
+ return readingValue(0, isNull);
+}
+
+double Magnetometer::y(bool& isNull) const {
+ return readingValue(1, isNull);
}
-std::unique_ptr<SensorReadingFactory>
-Magnetometer::createSensorReadingFactory() {
- return WTF::makeUnique<SensorReadingFactoryImpl<MagnetometerReading>>();
+double Magnetometer::z(bool& isNull) const {
+ return readingValue(2, isNull);
}
DEFINE_TRACE(Magnetometer) {
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Magnetometer.h ('k') | third_party/WebKit/Source/modules/sensor/Magnetometer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698