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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 using ConfigMap = std::map<Client*, std::list<PlatformSensorConfiguration>>; | 58 using ConfigMap = std::map<Client*, std::list<PlatformSensorConfiguration>>; |
59 | 59 |
60 virtual bool UpdateSensorInternal(const ConfigMap& configurations) = 0; | 60 virtual bool UpdateSensorInternal(const ConfigMap& configurations) = 0; |
61 virtual bool CheckSensorConfiguration( | 61 virtual bool CheckSensorConfiguration( |
62 const PlatformSensorConfiguration& configuration) = 0; | 62 const PlatformSensorConfiguration& configuration) = 0; |
63 | 63 |
64 void NotifySensorReadingChanged(); | 64 void NotifySensorReadingChanged(); |
65 void NotifySensorError(); | 65 void NotifySensorError(); |
66 | 66 |
67 mojo::ScopedSharedBufferMapping shared_buffer_mapping_; | 67 mojo::ScopedSharedBufferMapping shared_buffer_mapping_; |
| 68 PlatformSensorProvider* provider_; |
68 | 69 |
69 private: | 70 private: |
70 friend class base::RefCountedThreadSafe<PlatformSensor>; | 71 friend class base::RefCountedThreadSafe<PlatformSensor>; |
71 | 72 |
72 mojom::SensorType type_; | 73 mojom::SensorType type_; |
73 base::ObserverList<Client, true> clients_; | 74 base::ObserverList<Client, true> clients_; |
74 ConfigMap config_map_; | 75 ConfigMap config_map_; |
75 PlatformSensorProvider* provider_; | |
76 base::WeakPtrFactory<PlatformSensor> weak_factory_; | 76 base::WeakPtrFactory<PlatformSensor> weak_factory_; |
77 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); | 77 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace device | 80 } // namespace device |
81 | 81 |
82 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 82 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
OLD | NEW |