| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ConsumerType consumer_type, base::ProcessHandle handle); | 41 ConsumerType consumer_type, base::ProcessHandle handle); |
| 42 | 42 |
| 43 // Stop/join with the background polling thread in |provider_|. | 43 // Stop/join with the background polling thread in |provider_|. |
| 44 void Shutdown(); | 44 void Shutdown(); |
| 45 | 45 |
| 46 // Injects a custom data fetcher for testing purposes. This class takes | 46 // Injects a custom data fetcher for testing purposes. This class takes |
| 47 // ownership of the injected object. | 47 // ownership of the injected object. |
| 48 void SetDataFetcherForTesting(DataFetcherSharedMemory* test_data_fetcher); | 48 void SetDataFetcherForTesting(DataFetcherSharedMemory* test_data_fetcher); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend struct DefaultSingletonTraits<DeviceInertialSensorService>; | 51 friend struct base::DefaultSingletonTraits<DeviceInertialSensorService>; |
| 52 | 52 |
| 53 DeviceInertialSensorService(); | 53 DeviceInertialSensorService(); |
| 54 virtual ~DeviceInertialSensorService(); | 54 virtual ~DeviceInertialSensorService(); |
| 55 | 55 |
| 56 bool ChangeNumberConsumers(ConsumerType consumer_type, | 56 bool ChangeNumberConsumers(ConsumerType consumer_type, |
| 57 int delta); | 57 int delta); |
| 58 int GetNumberConsumers(ConsumerType consumer_type) const; | 58 int GetNumberConsumers(ConsumerType consumer_type) const; |
| 59 | 59 |
| 60 int num_light_readers_; | 60 int num_light_readers_; |
| 61 int num_motion_readers_; | 61 int num_motion_readers_; |
| 62 int num_orientation_readers_; | 62 int num_orientation_readers_; |
| 63 bool is_shutdown_; | 63 bool is_shutdown_; |
| 64 scoped_ptr<DataFetcherSharedMemory> data_fetcher_; | 64 scoped_ptr<DataFetcherSharedMemory> data_fetcher_; |
| 65 base::ThreadChecker thread_checker_; | 65 base::ThreadChecker thread_checker_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(DeviceInertialSensorService); | 67 DISALLOW_COPY_AND_ASSIGN(DeviceInertialSensorService); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace content | 70 } // namespace content |
| 71 | 71 |
| 72 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ | 72 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_INERTIAL_SENSOR_SERVICE_H_ |
| OLD | NEW |