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_SENSOR_PROVIDER_IMPL_H_ | 5 #ifndef SERVICES_DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
6 #define DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ | 6 #define SERVICES_DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "device/generic_sensor/generic_sensor_export.h" | 10 #include "services/device/public/interfaces/sensor_provider.mojom.h" |
11 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom.h" | |
12 | 11 |
13 namespace device { | 12 namespace device { |
14 | 13 |
15 class PlatformSensorProvider; | 14 class PlatformSensorProvider; |
16 class PlatformSensor; | 15 class PlatformSensor; |
17 | 16 |
18 // Implementation of SensorProvider mojo interface. | 17 // Implementation of SensorProvider mojo interface. |
19 // Uses PlatformSensorProvider singleton to create platform specific instances | 18 // Uses PlatformSensorProvider singleton to create platform specific instances |
20 // of PlatformSensor which are used by SensorImpl. | 19 // of PlatformSensor which are used by SensorImpl. |
21 class DEVICE_GENERIC_SENSOR_EXPORT SensorProviderImpl final | 20 class SensorProviderImpl final : public mojom::SensorProvider { |
22 : public mojom::SensorProvider { | |
23 public: | 21 public: |
24 static void Create( | 22 static void Create( |
25 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | 23 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
26 mojom::SensorProviderRequest request); | 24 mojom::SensorProviderRequest request); |
27 | 25 |
28 ~SensorProviderImpl() override; | 26 ~SensorProviderImpl() override; |
29 | 27 |
30 private: | 28 private: |
31 explicit SensorProviderImpl(PlatformSensorProvider* provider); | 29 explicit SensorProviderImpl(PlatformSensorProvider* provider); |
32 | 30 |
(...skipping 10 matching lines...) Expand all Loading... |
43 scoped_refptr<PlatformSensor> sensor); | 41 scoped_refptr<PlatformSensor> sensor); |
44 | 42 |
45 PlatformSensorProvider* provider_; | 43 PlatformSensorProvider* provider_; |
46 base::WeakPtrFactory<SensorProviderImpl> weak_ptr_factory_; | 44 base::WeakPtrFactory<SensorProviderImpl> weak_ptr_factory_; |
47 | 45 |
48 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl); | 46 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl); |
49 }; | 47 }; |
50 | 48 |
51 } // namespace device | 49 } // namespace device |
52 | 50 |
53 #endif // DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ | 51 #endif // SERVICES_DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
OLD | NEW |