OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const PlatformSensorConfiguration& configuration) = 0; | 62 const PlatformSensorConfiguration& configuration) = 0; |
63 virtual void StopSensor() = 0; | 63 virtual void StopSensor() = 0; |
64 virtual bool CheckSensorConfiguration( | 64 virtual bool CheckSensorConfiguration( |
65 const PlatformSensorConfiguration& configuration) = 0; | 65 const PlatformSensorConfiguration& configuration) = 0; |
66 | 66 |
67 void NotifySensorReadingChanged(); | 67 void NotifySensorReadingChanged(); |
68 void NotifySensorError(); | 68 void NotifySensorError(); |
69 | 69 |
70 mojo::ScopedSharedBufferMapping shared_buffer_mapping_; | 70 mojo::ScopedSharedBufferMapping shared_buffer_mapping_; |
71 | 71 |
| 72 // For testing purposes. |
| 73 const ConfigMap& config_map() const { return config_map_; } |
| 74 |
72 private: | 75 private: |
73 friend class base::RefCountedThreadSafe<PlatformSensor>; | 76 friend class base::RefCountedThreadSafe<PlatformSensor>; |
74 | 77 |
75 mojom::SensorType type_; | 78 mojom::SensorType type_; |
76 base::ObserverList<Client, true> clients_; | 79 base::ObserverList<Client, true> clients_; |
77 ConfigMap config_map_; | 80 ConfigMap config_map_; |
78 PlatformSensorProvider* provider_; | 81 PlatformSensorProvider* provider_; |
79 base::WeakPtrFactory<PlatformSensor> weak_factory_; | 82 base::WeakPtrFactory<PlatformSensor> weak_factory_; |
80 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); | 83 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); |
81 }; | 84 }; |
82 | 85 |
83 } // namespace device | 86 } // namespace device |
84 | 87 |
85 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 88 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
OLD | NEW |