summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_service.cc
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2015-04-16 12:11:04 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-16 19:12:05 +0000
commitb87cb277526092e101ce29f2ad0393f6247cc39e (patch)
treeffd0c2b8e4bb0519070cf000a872f78d83ae9791 /device/hid/hid_service.cc
parente2ff83b4c95cbd9c0df8fd338c9afa39b861cb14 (diff)
downloadchromium_src-b87cb277526092e101ce29f2ad0393f6247cc39e.zip
chromium_src-b87cb277526092e101ce29f2ad0393f6247cc39e.tar.gz
chromium_src-b87cb277526092e101ce29f2ad0393f6247cc39e.tar.bz2
Move device/usb classes from the FILE thread to UI thread.
Code that interacts with device/usb often lives on the UI thread. As with the recent migration of device/hid (issue 422540) moving ownership of these classes to the UI thread makes calling code substancially simplier. Blocking operations are handled internally by posting tasks to the FILE thread and returning a result to the UI thread asynchronously. This change paves the way for replacing libusb with platform-specific implementations of these classes that may have different thread usage requirements (as is the case in the device/hid code). BUG=427985 Review URL: https://codereview.chromium.org/980023002 Cr-Commit-Position: refs/heads/master@{#325491}
Diffstat (limited to 'device/hid/hid_service.cc')
-rw-r--r--device/hid/hid_service.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc
index 4f20235..fc50a41 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -106,9 +106,11 @@ void HidService::AddDevice(scoped_refptr<HidDeviceInfo> device_info) {
HID_LOG(USER) << "HID device "
<< (enumeration_ready_ ? "added" : "detected")
- << ": vendorId = " << device_info->vendor_id()
- << ", productId = " << device_info->product_id()
- << ", deviceId = '" << device_info->device_id() << "'";
+ << ": vendorId=" << device_info->vendor_id()
+ << ", productId=" << device_info->product_id() << ", name='"
+ << device_info->product_name() << "', serial='"
+ << device_info->serial_number() << "', deviceId='"
+ << device_info->device_id() << "'";
if (enumeration_ready_) {
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceAdded(device_info));
@@ -120,7 +122,7 @@ void HidService::RemoveDevice(const HidDeviceId& device_id) {
DCHECK(thread_checker_.CalledOnValidThread());
DeviceMap::iterator it = devices_.find(device_id);
if (it != devices_.end()) {
- HID_LOG(USER) << "HID device removed: deviceId = '" << device_id << "'";
+ HID_LOG(USER) << "HID device removed: deviceId='" << device_id << "'";
if (enumeration_ready_) {
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemoved(it->second));