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

Unified Diff: third_party/WebKit/Source/modules/sensor/MagnetometerReading.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/MagnetometerReading.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp b/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp
deleted file mode 100644
index 5270eca003f2a6b16794c2ab377328437dbfc53c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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.
-
-#include "modules/sensor/MagnetometerReading.h"
-
-#include "modules/sensor/MagnetometerReadingInit.h"
-#include "wtf/CurrentTime.h"
-
-namespace blink {
-
-namespace {
-
-device::SensorReading ToReadingData(const MagnetometerReadingInit& init) {
- device::SensorReading result;
- result.timestamp = WTF::monotonicallyIncreasingTime();
- if (init.hasX())
- result.values[0] = init.x();
- if (init.hasY())
- result.values[1] = init.y();
- if (init.hasZ())
- result.values[2] = init.z();
-
- return result;
-}
-
-} // namespace
-
-MagnetometerReading::MagnetometerReading(const MagnetometerReadingInit& init)
- : SensorReading(ToReadingData(init)) {}
-
-MagnetometerReading::MagnetometerReading(const device::SensorReading& data)
- : SensorReading(data) {}
-
-MagnetometerReading::~MagnetometerReading() = default;
-
-double MagnetometerReading::x() const {
- return data().values[0];
-}
-
-double MagnetometerReading::y() const {
- return data().values[1];
-}
-
-double MagnetometerReading::z() const {
- return data().values[2];
-}
-
-bool MagnetometerReading::isReadingUpdated(
- const device::SensorReading& previous) const {
- return previous.values[0] != x() || previous.values[1] != y() ||
- previous.values[2] != z();
-}
-
-DEFINE_TRACE(MagnetometerReading) {
- SensorReading::trace(visitor);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698