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

Unified Diff: content/browser/device_sensors/sensor_manager_android.h

Issue 917253002: [Android] Move the android Device Sensors API to the UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify shutdown Created 5 years, 10 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.h
diff --git a/content/browser/device_sensors/sensor_manager_android.h b/content/browser/device_sensors/sensor_manager_android.h
index 714b8ec04165bdad26d3301a5d1137458229c788..535efa1c1c92a6970cebbb26f7877347933bbb17 100644
--- a/content/browser/device_sensors/sensor_manager_android.h
+++ b/content/browser/device_sensors/sensor_manager_android.h
@@ -52,6 +52,8 @@ class CONTENT_EXPORT SensorManagerAndroid {
DeviceOrientationHardwareBuffer* buffer);
void StopFetchingDeviceOrientationData();
+ void Shutdown();
+
protected:
enum EventType {
// These constants should match DEVICE_ORIENTATION, DEVICE_MOTION and
@@ -69,6 +71,16 @@ class CONTENT_EXPORT SensorManagerAndroid {
virtual void Stop(EventType event_type);
virtual int GetNumberActiveDeviceMotionSensors();
+ void StartFetchingLightDataOnUI(DeviceLightHardwareBuffer* buffer);
+ void StopFetchingLightDataOnUI();
+
+ void StartFetchingMotionDataOnUI(DeviceMotionHardwareBuffer* buffer);
+ void StopFetchingMotionDataOnUI();
+
+ void StartFetchingOrientationDataOnUI(
+ DeviceOrientationHardwareBuffer* buffer);
+ void StopFetchingOrientationDataOnUI();
+
private:
friend struct DefaultSingletonTraits<SensorManagerAndroid>;
@@ -104,6 +116,7 @@ class CONTENT_EXPORT SensorManagerAndroid {
base::Lock orientation_buffer_lock_;
bool is_using_backup_sensors_for_orientation_;
+ bool is_shutdown_;
DISALLOW_COPY_AND_ASSIGN(SensorManagerAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698