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

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

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
Index: third_party/WebKit/Source/modules/sensor/SensorProxy.h
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
index 65baab79d07007162208214bb48d54b5a0d7c56b..b91113556c63e4c24153279b06549670bbcdd551 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorProxy.h
+++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
@@ -36,13 +36,20 @@ class SensorProxy final : public GarbageCollectedFinalized<SensorProxy>,
// Has valid 'Sensor' binding, {add, remove}Configuration()
// methods can be called.
virtual void onSensorInitialized() {}
- // Platfrom sensort reading has changed.
+ // Platfrom sensor reading has changed.
+ virtual void onSensorReadingChanged() {}
+ // Observer should send 'onchange' event if needed.
+ // The 'notifySensorChanged' calls are in sync with rAF.
+ // Currently, we decide whether to send 'onchange' event based on the
+ // time elapsed from the previous notification.
+ // TODO: Reconsider this after https://github.com/w3c/sensors/issues/152
+ // is resolved.
// |timestamp| Reference timestamp in seconds of the moment when
// sensor reading was updated from the buffer.
// Note: |timestamp| values are only used to calculate elapsed time
// between shared buffer readings. These values *do not* correspond
// to sensor reading timestamps which are obtained on platform side.
- virtual void onSensorReadingChanged(double timestamp) {}
+ virtual void notifySensorChanged(double timestamp) {}
// An error has occurred.
virtual void onSensorError(ExceptionCode,
const String& sanitizedMessage,
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.cpp ('k') | third_party/WebKit/Source/modules/sensor/SensorProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698