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/linux/sensor_device_manager.h" | 5 #include "services/device/generic_sensor/linux/sensor_device_manager.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "device/generic_sensor/linux/sensor_data_linux.h" | 10 #include "services/device/generic_sensor/linux/sensor_data_linux.h" |
11 | 11 |
12 namespace device { | 12 namespace device { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 std::string StringOrEmptyIfNull(const char* value) { | 16 std::string StringOrEmptyIfNull(const char* value) { |
17 return value ? value : std::string(); | 17 return value ? value : std::string(); |
18 } | 18 } |
19 | 19 |
20 } // namespace | 20 } // namespace |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 return; | 164 return; |
165 mojom::SensorType type = sensor->second; | 165 mojom::SensorType type = sensor->second; |
166 sensors_by_node_.erase(sensor); | 166 sensors_by_node_.erase(sensor); |
167 | 167 |
168 task_runner_->PostTask( | 168 task_runner_->PostTask( |
169 FROM_HERE, base::Bind(&SensorDeviceManager::Delegate::OnDeviceRemoved, | 169 FROM_HERE, base::Bind(&SensorDeviceManager::Delegate::OnDeviceRemoved, |
170 base::Unretained(delegate_), type, device_node)); | 170 base::Unretained(delegate_), type, device_node)); |
171 } | 171 } |
172 | 172 |
173 } // namespace device | 173 } // namespace device |
OLD | NEW |