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

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

Issue 2870073002: [Sensors] Decouple sensor readings update from rAF (Closed)
Patch Set: [Sensors] Decouple sensor readings update from rAF Created 3 years, 7 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/Sensor.h
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h
index a6370711f54ff7406a8ea5b40f62c9e8eb5db17b..00e41793cc23ee8c7356d8a23c3dd3ddbc6d320f 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.h
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -79,19 +79,19 @@ class Sensor : public EventTargetWithInlineData,
bool CanReturnReadings() const;
bool IsActivated() const { return state_ == SensorState::kActivated; }
- private:
- void InitSensorProxyIfNeeded();
-
- // ContextLifecycleObserver overrides.
- void ContextDestroyed(ExecutionContext*) override;
-
// SensorProxy::Observer overrides.
void OnSensorInitialized() override;
- void NotifySensorChanged(double timestamp) override;
+ void OnSensorReadingChanged(double timestamp) override;
void OnSensorError(ExceptionCode,
const String& sanitized_message,
const String& unsanitized_message) override;
+ private:
+ void InitSensorProxyIfNeeded();
+
+ // ContextLifecycleObserver overrides.
+ void ContextDestroyed(ExecutionContext*) override;
+
void OnAddConfigurationRequestCompleted(bool);
void StartListening();
@@ -104,7 +104,7 @@ class Sensor : public EventTargetWithInlineData,
const String& sanitized_message = String(),
const String& unsanitized_message = String());
- void NotifySensorReadingChanged();
+ void UpdateReading();
void NotifyOnActivate();
void NotifyError(DOMException* error);
@@ -113,9 +113,10 @@ class Sensor : public EventTargetWithInlineData,
device::mojom::blink::SensorType type_;
SensorState state_;
Member<SensorProxy> sensor_proxy_;
- device::SensorReading stored_data_;
+ device::SensorReading reading_;
SensorConfigurationPtr configuration_;
double last_update_timestamp_;
+ bool pending_reading_update_;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp ('k') | third_party/WebKit/Source/modules/sensor/Sensor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698