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

Side by Side Diff: device/usb/usb_service_win.h

Issue 2702623002: Add support for reading USB descriptors to the new Windows backend. (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/usb/usb_service.h" 5 #include "device/usb/usb_service.h"
6 6
7 #include <list> 7 #include <list>
8 #include <unordered_map> 8 #include <unordered_map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 25 matching lines...) Expand all
36 const std::string& device_path) override; 36 const std::string& device_path) override;
37 void OnDeviceRemoved(const GUID& class_guid, 37 void OnDeviceRemoved(const GUID& class_guid,
38 const std::string& device_path) override; 38 const std::string& device_path) override;
39 39
40 // Methods called by BlockingThreadHelper 40 // Methods called by BlockingThreadHelper
41 void HelperStarted(); 41 void HelperStarted();
42 void CreateDeviceObject(const std::string& device_path, 42 void CreateDeviceObject(const std::string& device_path,
43 const std::string& hub_path, 43 const std::string& hub_path,
44 int port_number); 44 int port_number);
45 45
46 void OnReadDescriptors(scoped_refptr<UsbDeviceWin> device, bool success);
46 void DeviceReady(scoped_refptr<UsbDeviceWin> device, bool success); 47 void DeviceReady(scoped_refptr<UsbDeviceWin> device, bool success);
47 48
48 bool enumeration_ready() { 49 bool enumeration_ready() {
49 return helper_started_ && first_enumeration_countdown_ == 0; 50 return helper_started_ && first_enumeration_countdown_ == 0;
50 } 51 }
51 52
52 // Enumeration callbacks are queued until an enumeration completes. 53 // Enumeration callbacks are queued until an enumeration completes.
53 bool helper_started_ = false; 54 bool helper_started_ = false;
54 uint32_t first_enumeration_countdown_ = 0; 55 uint32_t first_enumeration_countdown_ = 0;
55 std::list<GetDevicesCallback> enumeration_callbacks_; 56 std::list<GetDevicesCallback> enumeration_callbacks_;
56 57
57 BlockingThreadHelper* helper_; 58 BlockingThreadHelper* helper_;
58 std::unordered_map<std::string, scoped_refptr<UsbDeviceWin>> devices_by_path_; 59 std::unordered_map<std::string, scoped_refptr<UsbDeviceWin>> devices_by_path_;
59 60
60 ScopedObserver<DeviceMonitorWin, DeviceMonitorWin::Observer> device_observer_; 61 ScopedObserver<DeviceMonitorWin, DeviceMonitorWin::Observer> device_observer_;
61 62
62 base::WeakPtrFactory<UsbServiceWin> weak_factory_; 63 base::WeakPtrFactory<UsbServiceWin> weak_factory_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(UsbServiceWin); 65 DISALLOW_COPY_AND_ASSIGN(UsbServiceWin);
65 }; 66 };
66 67
67 } // namespace device 68 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698