Return result from HidService::GetDevices asynchronously.
commit5b2961f7d25bb6c0fdb364b12de0e7ebed4706bb
authorreillyg <reillyg@chromium.org>
Tue, 9 Dec 2014 22:03:37 +0000 (9 14:03 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 9 Dec 2014 22:04:29 +0000 (9 22:04 +0000)
tree2abb1e368534f5a9a922ccb6b054936bd956716e
parentec6b033cd9fe790bcebde7b5c1cd3490784b891a
Return result from HidService::GetDevices asynchronously.

On Linux HID enumeration happens asynchronously. This change updates
HidService and HidDeviceManager to track an asynchronous enumeration
and not return any results to API clients until the first enumeration
has been completed.

In preparation for broadcasting device add/remove events to apps this
change also switches HidDeviceManager to maintaining its resource ID
mappings using a HidService::Observer. This also made the switch to an
asynchronous GetApiDevices API easier.

BUG=376719

Review URL: https://codereview.chromium.org/782153003

Cr-Commit-Position: refs/heads/master@{#307564}
13 files changed:
device/device_tests.gyp
device/hid/hid_connection_unittest.cc
device/hid/hid_service.cc
device/hid/hid_service.h
device/hid/hid_service_linux.cc
device/hid/hid_service_mac.cc
device/hid/hid_service_unittest.cc [deleted file]
device/hid/hid_service_win.cc
extensions/browser/api/hid/hid_api.cc
extensions/browser/api/hid/hid_api.h
extensions/browser/api/hid/hid_apitest.cc
extensions/browser/api/hid/hid_device_manager.cc
extensions/browser/api/hid/hid_device_manager.h