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

Unified Diff: content/renderer/device_sensors/device_sensor_event_pump.h

Issue 604483003: Increase device orientation event frequency to 60 Hz. Change constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: content/renderer/device_sensors/device_sensor_event_pump.h
diff --git a/content/renderer/device_sensors/device_sensor_event_pump.h b/content/renderer/device_sensors/device_sensor_event_pump.h
index f36992871a3313eb8886676585a71af0c15ea77a..475f32641d4a37f31e11779736dc14ab4a58cc9d 100644
--- a/content/renderer/device_sensors/device_sensor_event_pump.h
+++ b/content/renderer/device_sensors/device_sensor_event_pump.h
@@ -16,7 +16,7 @@ class CONTENT_EXPORT DeviceSensorEventPump
: NON_EXPORTED_BASE(public PlatformEventObserver<ListenerType>) {
public:
// Default delay between subsequent firing of events.
- static const int kDefaultPumpDelayMillis = 50;
+ static const int kDefaultPumpDelayMicroseconds = 1000000 / 60;
timvolodine 2014/09/25 21:30:51 same here
jdarpinian 2014/09/25 22:36:19 Done.
// PlatformEventObserver
virtual void Start(blink::WebPlatformEventListener* listener) OVERRIDE {
@@ -49,9 +49,8 @@ class CONTENT_EXPORT DeviceSensorEventPump
protected:
explicit DeviceSensorEventPump(RenderThread* thread)
: PlatformEventObserver<ListenerType>(thread),
- pump_delay_millis_(kDefaultPumpDelayMillis),
- state_(STOPPED) {
- }
+ pump_delay_microseconds_(kDefaultPumpDelayMicroseconds),
+ state_(STOPPED) {}
virtual ~DeviceSensorEventPump() {
}
@@ -77,8 +76,9 @@ class CONTENT_EXPORT DeviceSensorEventPump
if (InitializeReader(handle)) {
timer_.Start(FROM_HERE,
- base::TimeDelta::FromMilliseconds(pump_delay_millis_),
- this, &DeviceSensorEventPump::FireEvent);
+ base::TimeDelta::FromMicroseconds(pump_delay_microseconds_),
+ this,
+ &DeviceSensorEventPump::FireEvent);
state_ = RUNNING;
}
}
@@ -86,7 +86,7 @@ class CONTENT_EXPORT DeviceSensorEventPump
virtual void FireEvent() = 0;
virtual bool InitializeReader(base::SharedMemoryHandle handle) = 0;
- int pump_delay_millis_;
+ int pump_delay_microseconds_;
PumpState state_;
base::RepeatingTimer<DeviceSensorEventPump> timer_;

Powered by Google App Engine
This is Rietveld 408576698