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

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

Issue 2746573002: [Sensors] Implement bindings for AbsoluteOrientationSensor (Closed)
Patch Set: webexpose Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
index baa7be212caa72df4b93ed3c77bf24acfc2be9a3..ea0a9199393487883fbd7d0a361bf38766c5dfe8 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
+++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
@@ -129,7 +129,11 @@ void SensorProxy::updateSensorReading() {
}
}
- m_reading = readingData;
+ if (m_reading.timestamp != readingData.timestamp) {
+ m_reading = readingData;
+ for (Observer* observer : m_observers)
+ observer->onSensorReadingChanged();
+ }
}
void SensorProxy::notifySensorChanged(double timestamp) {
@@ -137,7 +141,7 @@ void SensorProxy::notifySensorChanged(double timestamp) {
// we must cache m_observers as it can be modified within event handlers.
auto copy = m_observers;
for (Observer* observer : copy)
- observer->onSensorReadingChanged(timestamp);
+ observer->notifySensorChanged(timestamp);
}
void SensorProxy::RaiseError() {
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698