OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/api/usb/usb_guid_map.h" | 5 #include "extensions/browser/api/usb/usb_guid_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "device/core/device_client.h" | 11 #include "device/base/device_client.h" |
12 #include "device/usb/usb_device.h" | 12 #include "device/usb/usb_device.h" |
13 #include "device/usb/usb_service.h" | 13 #include "device/usb/usb_service.h" |
14 #include "extensions/common/api/usb.h" | 14 #include "extensions/common/api/usb.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 base::LazyInstance<BrowserContextKeyedAPIFactory<UsbGuidMap>>::Leaky | 20 base::LazyInstance<BrowserContextKeyedAPIFactory<UsbGuidMap>>::Leaky |
21 g_usb_guid_map_factory = LAZY_INSTANCE_INITIALIZER; | 21 g_usb_guid_map_factory = LAZY_INSTANCE_INITIALIZER; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 scoped_refptr<device::UsbDevice> device) { | 77 scoped_refptr<device::UsbDevice> device) { |
78 auto iter = guid_to_id_map_.find(device->guid()); | 78 auto iter = guid_to_id_map_.find(device->guid()); |
79 if (iter != guid_to_id_map_.end()) { | 79 if (iter != guid_to_id_map_.end()) { |
80 int id = iter->second; | 80 int id = iter->second; |
81 guid_to_id_map_.erase(iter); | 81 guid_to_id_map_.erase(iter); |
82 id_to_guid_map_.erase(id); | 82 id_to_guid_map_.erase(id); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 } // namespace extensions | 86 } // namespace extensions |
OLD | NEW |