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

Unified Diff: content/renderer/device_sensors/device_light_event_pump.cc

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: sync 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_light_event_pump.cc
diff --git a/content/renderer/device_sensors/device_light_event_pump.cc b/content/renderer/device_sensors/device_light_event_pump.cc
index f2fa5cb6ea0f6a608514dfc26eed3f87bdc25c45..53567441df879f54439b7b8d5527e6b12f2df0f8 100644
--- a/content/renderer/device_sensors/device_light_event_pump.cc
+++ b/content/renderer/device_sensors/device_light_event_pump.cc
@@ -4,13 +4,16 @@
#include "content/renderer/device_sensors/device_light_event_pump.h"
+#include "base/time/time.h"
#include "content/common/device_sensors/device_light_messages.h"
#include "content/public/renderer/render_thread.h"
#include "third_party/WebKit/public/platform/WebDeviceLightListener.h"
namespace {
-// Default delay between subsequent firing of DeviceLight events.
-const int kDefaultLightPumpDelayMillis = 200;
+// Default rate for firing of DeviceLight events.
+const int kDefaultLightPumpFrequencyHz = 5;
+const int kDefaultLightPumpDelayMicroseconds =
+ base::Time::kMicrosecondsPerSecond / kDefaultLightPumpFrequencyHz;
} // namespace
namespace content {
@@ -18,7 +21,7 @@ namespace content {
DeviceLightEventPump::DeviceLightEventPump(RenderThread* thread)
: DeviceSensorEventPump<blink::WebDeviceLightListener>(thread),
last_seen_data_(-1) {
- pump_delay_millis_ = kDefaultLightPumpDelayMillis;
+ pump_delay_microseconds_ = kDefaultLightPumpDelayMicroseconds;
}
DeviceLightEventPump::~DeviceLightEventPump() {

Powered by Google App Engine
This is Rietveld 408576698