Index: content/browser/device_sensors/device_sensor_service.h |
diff --git a/content/browser/device_sensors/device_sensor_service.h b/content/browser/device_sensors/device_sensor_service.h |
index 00946b484ae160a329029147e4255bf3a4dd2d63..cd4d25e5ce93ecf0274d33ed7ad8e84c96105ee4 100644 |
--- a/content/browser/device_sensors/device_sensor_service.h |
+++ b/content/browser/device_sensors/device_sensor_service.h |
@@ -30,19 +30,26 @@ class CONTENT_EXPORT DeviceSensorService { |
// Increments the number of users of the provider. The Provider is running |
// when there's > 0 users, and is paused when the count drops to 0. |
- // Must be called on the I/O thread. |
+ // Must be called on a thread that can perform I/O. |
void AddConsumer(ConsumerType consumer_type); |
// Removes a consumer. Should be matched with an AddConsumer call. |
- // Must be called on the I/O thread. |
+ // Must be called on a thread that can perform I/O. |
void RemoveConsumer(ConsumerType cosumer_type); |
// Returns the shared memory handle of the device motion data. |
mojo::ScopedSharedBufferHandle GetSharedMemoryHandle( |
ConsumerType consumer_type); |
- // Stop/join with the background polling thread in |provider_|. |
- void Shutdown(); |
+ // Performs initialization operations on the UI thread. |
+ void InitOnUIThread(); |
+ |
+ // Performs initialization operations on the IO thread. |
+ void InitOnIOThread(); |
+ |
+ // Stop/join with the background polling thread in |provider_|. Must be |
+ // called on the UI thread. |
+ void ShutDownOnUIThread(); |
// Injects a custom data fetcher for testing purposes. This class takes |
// ownership of the injected object. |
@@ -63,7 +70,9 @@ class CONTENT_EXPORT DeviceSensorService { |
int num_orientation_absolute_readers_; |
bool is_shutdown_; |
std::unique_ptr<DataFetcherSharedMemory> data_fetcher_; |
- base::ThreadChecker thread_checker_; |
+ |
+ // Associated with the IO thread. |
+ base::ThreadChecker io_thread_checker_; |
DISALLOW_COPY_AND_ASSIGN(DeviceSensorService); |
}; |