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

Side by Side Diff: content/browser/device_sensors/inertial_sensor_consts.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, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_ 5 #ifndef CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_
6 #define CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_ 6 #define CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_
7 7
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
10
8 namespace content { 11 namespace content {
9 12
10 // Constants related to the Device {Motion|Orientation|Light} APIs. 13 // Constants related to the Device {Motion|Orientation|Light} APIs.
11 14
12 enum ConsumerType { 15 enum ConsumerType {
13 CONSUMER_TYPE_MOTION = 1 << 0, 16 CONSUMER_TYPE_MOTION = 1 << 0,
14 CONSUMER_TYPE_ORIENTATION = 1 << 1, 17 CONSUMER_TYPE_ORIENTATION = 1 << 1,
15 CONSUMER_TYPE_LIGHT = 1 << 2, 18 CONSUMER_TYPE_LIGHT = 1 << 2,
16 }; 19 };
17 20
18 // Specifies the minimal interval between subsequent sensor data updates. 21 // Specifies the sampling rate for sensor data updates.
19 // Note that when changing this value it is desirable to have an adequate 22 // Note that when changing this value it is desirable to have an adequate
20 // matching value |DeviceSensorEventPump::kDefaultPumpDelayMillis| in 23 // matching value |DeviceSensorEventPump::kDefaultPumpFrequencyHz| in
21 // content/renderer/device_sensors/device_sensor_event_pump.cc. 24 // content/renderer/device_orientation/device_sensor_event_pump.cc.
22 const int kInertialSensorIntervalMillis = 50; 25 const int64 kInertialSensorSamplingRateHz = 60;
23 // Corresponding |kDefaultLightPumpDelayMillis| is in 26 const int64 kInertialSensorIntervalMicroseconds =
27 base::Time::kMicrosecondsPerSecond / kInertialSensorSamplingRateHz;
timvolodine 2014/09/26 13:09:16 nit: maybe insert whiteline here, otherwise looks
jdarpinian 2014/09/26 23:40:48 Done.
28 // Corresponding |kDefaultLightPumpFrequencyHz| is in
24 // content/renderer/device_sensors/device_light_event_pump.cc. 29 // content/renderer/device_sensors/device_light_event_pump.cc.
25 const int kLightSensorIntervalMillis = 200; 30 const int64 kLightSensorSamplingRateHz = 5;
31 const int64 kLightSensorIntervalMicroseconds =
32 base::Time::kMicrosecondsPerSecond / kLightSensorSamplingRateHz;
26 33
27 } // namespace content 34 } // namespace content
28 35
29 #endif // CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_ 36 #endif // CONTENT_BROWSER_DEVICE_SENSORS_INERTIAL_SENSOR_CONSTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698