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

Unified Diff: content/browser/device_sensors/sensor_manager_android.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/browser/device_sensors/sensor_manager_android.cc
diff --git a/content/browser/device_sensors/sensor_manager_android.cc b/content/browser/device_sensors/sensor_manager_android.cc
index eaaac2df39512f287f053814838ba0d943fb8a8b..abc37927dabd33130e233fca062e4310a980404c 100644
--- a/content/browser/device_sensors/sensor_manager_android.cc
+++ b/content/browser/device_sensors/sensor_manager_android.cc
@@ -150,14 +150,14 @@ void SensorManagerAndroid::GotLight(JNIEnv*, jobject, double value) {
bool SensorManagerAndroid::Start(EventType event_type) {
DCHECK(!device_sensors_.is_null());
- int rate_in_milliseconds = (event_type == kTypeLight)
- ? kLightSensorIntervalMillis
- : kInertialSensorIntervalMillis;
+ int rate_in_microseconds = (event_type == kTypeLight)
+ ? kLightSensorIntervalMicroseconds
+ : kInertialSensorIntervalMicroseconds;
return Java_DeviceSensors_start(AttachCurrentThread(),
device_sensors_.obj(),
reinterpret_cast<intptr_t>(this),
static_cast<jint>(event_type),
- rate_in_milliseconds);
+ rate_in_microseconds);
}
void SensorManagerAndroid::Stop(EventType event_type) {
@@ -250,7 +250,8 @@ void SensorManagerAndroid::CheckMotionBufferReadyToRead() {
received_motion_data_[RECEIVED_MOTION_DATA_ROTATION_RATE] ==
number_active_device_motion_sensors_) {
device_motion_buffer_->seqlock.WriteBegin();
- device_motion_buffer_->data.interval = kInertialSensorIntervalMillis;
+ device_motion_buffer_->data.interval =
+ kInertialSensorIntervalMicroseconds / 1000.;
device_motion_buffer_->seqlock.WriteEnd();
SetMotionBufferReadyStatus(true);

Powered by Google App Engine
This is Rietveld 408576698