OLD | NEW |
---|---|
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_DEVICE_INERTIAL_SENSOR_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ |
6 #define CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ | 6 #define CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "content/browser/device_sensors/inertial_sensor_consts.h" | 14 #include "content/browser/device_sensors/inertial_sensor_consts.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class DataFetcherSharedMemory; | 19 class DataFetcherSharedMemory; |
20 class RenderProcessHost; | |
21 | 20 |
22 // Owns the DeviceMotionProvider (the background polling thread) and keeps | 21 // Owns the Device(Motion|Orientation)Provider (the background polling thread) |
timvolodine
2014/05/21 17:53:13
could you replace the whole comment with:
"Owns th
riju_
2014/05/22 11:34:31
Done.
| |
23 // track of the number of consumers currently using the data (and pausing | 22 // and keeps track of the number of consumers currently using the data (and |
24 // the provider when not in use). | 23 // pausing the provider when not in use). |
25 class CONTENT_EXPORT DeviceInertialSensorService { | 24 class CONTENT_EXPORT DeviceInertialSensorService { |
26 public: | 25 public: |
27 // Returns the DeviceInertialSensorService singleton. | 26 // Returns the DeviceInertialSensorService singleton. |
28 static DeviceInertialSensorService* GetInstance(); | 27 static DeviceInertialSensorService* GetInstance(); |
29 | 28 |
30 // Increments the number of users of the provider. The Provider is running | 29 // Increments the number of users of the provider. The Provider is running |
31 // when there's > 0 users, and is paused when the count drops to 0. | 30 // when there's > 0 users, and is paused when the count drops to 0. |
32 // Must be called on the I/O thread. | 31 // Must be called on the I/O thread. |
33 void AddConsumer(ConsumerType consumer_type); | 32 void AddConsumer(ConsumerType consumer_type); |
34 | 33 |
(...skipping 28 matching lines...) Expand all Loading... | |
63 bool is_shutdown_; | 62 bool is_shutdown_; |
64 scoped_ptr<DataFetcherSharedMemory> data_fetcher_; | 63 scoped_ptr<DataFetcherSharedMemory> data_fetcher_; |
65 base::ThreadChecker thread_checker_; | 64 base::ThreadChecker thread_checker_; |
66 | 65 |
67 DISALLOW_COPY_AND_ASSIGN(DeviceInertialSensorService); | 66 DISALLOW_COPY_AND_ASSIGN(DeviceInertialSensorService); |
68 }; | 67 }; |
69 | 68 |
70 } // namespace content | 69 } // namespace content |
71 | 70 |
72 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ | 71 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ |
OLD | NEW |