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

Side by Side Diff: device/hid/hid_service.cc

Issue 399313008: Remove HID devices not found during enumeration on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a protected const accessor instead of making devices_ protected. Created 6 years, 5 months 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/hid/hid_service.h ('k') | device/hid/hid_service_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/hid/hid_service.h" 5 #include "device/hid/hid_service.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 } 84 }
85 85
86 void HidService::RemoveDevice(const HidDeviceId& device_id) { 86 void HidService::RemoveDevice(const HidDeviceId& device_id) {
87 DCHECK(thread_checker_.CalledOnValidThread()); 87 DCHECK(thread_checker_.CalledOnValidThread());
88 DeviceMap::iterator it = devices_.find(device_id); 88 DeviceMap::iterator it = devices_.find(device_id);
89 if (it != devices_.end()) 89 if (it != devices_.end())
90 devices_.erase(it); 90 devices_.erase(it);
91 } 91 }
92 92
93 const HidService::DeviceMap& HidService::GetDevicesNoEnumerate() const {
94 return devices_;
95 }
96
93 HidService* HidService::GetInstance() { 97 HidService* HidService::GetInstance() {
94 if (!g_hid_service_ptr.Get().get()) 98 if (!g_hid_service_ptr.Get().get())
95 g_hid_service_ptr.Get().reset(CreateInstance()); 99 g_hid_service_ptr.Get().reset(CreateInstance());
96 return g_hid_service_ptr.Get().get(); 100 return g_hid_service_ptr.Get().get();
97 } 101 }
98 102
99 } // namespace device 103 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_service.h ('k') | device/hid/hid_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698