Use IOService enumeration instead of IOHIDManager in HidServiceMac.
commite8fa00efd0965a7eb5816a1ef05c41e017029880
authorreillyg <reillyg@chromium.org>
Thu, 9 Oct 2014 04:53:10 +0000 (8 21:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Oct 2014 04:53:47 +0000 (9 04:53 +0000)
tree3b949bfd6d09e24d3ad157850b351f13002a62b5
parentefe9bba6f2d35045b588cdf05d211d246dffa46d
Use IOService enumeration instead of IOHIDManager in HidServiceMac.

Using the IOServiceAddMatchingNotification API to monitor devices
connected to the system is preferable to IOHIDManager because it is
lighter weight. IOHIDManager forces its own lifetime expectations on
the IOHIDDevice objects that it creates and opens all devices it sees
for I/O whether or not there is a Chrome app that is using them.

As a necessary step to simplify this transition the device/hid API now
lives on the browser UI thread when running on OS X. This change will
soon be made for Linux and Windows as well. This change should also
reduce the risk of race conditions as observed in bug 418207 which is
why it is being made independently of the other platforms.

BUG=418207,413978
R=rockot@chromium.org,rpaquay@chromium.org
TBR=thestig@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#298793}
18 files changed:
chrome/browser/chrome_device_client.cc
device/hid/hid_connection_mac.cc
device/hid/hid_connection_mac.h
device/hid/hid_connection_unittest.cc
device/hid/hid_device_info.cc
device/hid/hid_device_info.h
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_mac.h
device/hid/hid_service_unittest.cc
device/hid/hid_service_win.cc
extensions/browser/api/async_api_function.cc
extensions/browser/api/hid/hid_api.cc
extensions/browser/api/hid/hid_connection_resource.h
extensions/browser/api/hid/hid_device_manager.cc
extensions/shell/browser/shell_device_client.cc