| 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 #include "device/generic_sensor/platform_sensor_provider_linux.h" | 5 #include "services/device/generic_sensor/platform_sensor_provider_linux.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "device/generic_sensor/linux/sensor_data_linux.h" | 11 #include "services/device/generic_sensor/linux/sensor_data_linux.h" |
| 12 #include "device/generic_sensor/platform_sensor_linux.h" | 12 #include "services/device/generic_sensor/platform_sensor_linux.h" |
| 13 #include "device/generic_sensor/platform_sensor_reader_linux.h" | 13 #include "services/device/generic_sensor/platform_sensor_reader_linux.h" |
| 14 | 14 |
| 15 namespace device { | 15 namespace device { |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 PlatformSensorProviderLinux* PlatformSensorProviderLinux::GetInstance() { | 18 PlatformSensorProviderLinux* PlatformSensorProviderLinux::GetInstance() { |
| 19 return base::Singleton< | 19 return base::Singleton< |
| 20 PlatformSensorProviderLinux, | 20 PlatformSensorProviderLinux, |
| 21 base::LeakySingletonTraits<PlatformSensorProviderLinux>>::get(); | 21 base::LeakySingletonTraits<PlatformSensorProviderLinux>>::get(); |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 mojom::SensorType type, | 205 mojom::SensorType type, |
| 206 const std::string& device_node) { | 206 const std::string& device_node) { |
| 207 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); | 207 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
| 208 auto it = sensor_devices_by_type_.find(type); | 208 auto it = sensor_devices_by_type_.find(type); |
| 209 if (it != sensor_devices_by_type_.end() && | 209 if (it != sensor_devices_by_type_.end() && |
| 210 it->second->device_node == device_node) | 210 it->second->device_node == device_node) |
| 211 sensor_devices_by_type_.erase(it); | 211 sensor_devices_by_type_.erase(it); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace device | 214 } // namespace device |
| OLD | NEW |