Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: device/generic_sensor/platform_sensor_provider_linux.cc

Issue 2560263002: [sensors](CrOS/Linux) Rename SensorDeviceManager cc and h files. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/generic_sensor/platform_sensor_provider_linux.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "device/generic_sensor/linux/sensor_data_linux.h" 9 #include "device/generic_sensor/linux/sensor_data_linux.h"
10 #include "device/generic_sensor/platform_sensor_linux.h" 10 #include "device/generic_sensor/platform_sensor_linux.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 return; 195 return;
196 } 196 }
197 sensor_devices_by_type_[type] = std::move(sensor_device); 197 sensor_devices_by_type_[type] = std::move(sensor_device);
198 } 198 }
199 199
200 void PlatformSensorProviderLinux::OnDeviceRemoved( 200 void PlatformSensorProviderLinux::OnDeviceRemoved(
201 mojom::SensorType type, 201 mojom::SensorType type,
202 const std::string& device_node) { 202 const std::string& device_node) {
203 DCHECK(CalledOnValidThread()); 203 DCHECK(CalledOnValidThread());
204 auto it = sensor_devices_by_type_.find(type); 204 auto it = sensor_devices_by_type_.find(type);
205 if (it == sensor_devices_by_type_.end() && 205 if (it != sensor_devices_by_type_.end() &&
206 it->second->device_node == device_node) 206 it->second->device_node == device_node)
207 sensor_devices_by_type_.erase(it); 207 sensor_devices_by_type_.erase(it);
208 } 208 }
209 209
210 } // namespace device 210 } // namespace device
OLDNEW
« no previous file with comments | « device/generic_sensor/platform_sensor_provider_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698