summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_connection_unittest.cc
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2014-10-08 21:53:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-09 04:53:47 +0000
commite8fa00efd0965a7eb5816a1ef05c41e017029880 (patch)
tree3b949bfd6d09e24d3ad157850b351f13002a62b5 /device/hid/hid_connection_unittest.cc
parentefe9bba6f2d35045b588cdf05d211d246dffa46d (diff)
downloadchromium_src-e8fa00efd0965a7eb5816a1ef05c41e017029880.zip
chromium_src-e8fa00efd0965a7eb5816a1ef05c41e017029880.tar.gz
chromium_src-e8fa00efd0965a7eb5816a1ef05c41e017029880.tar.bz2
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}
Diffstat (limited to 'device/hid/hid_connection_unittest.cc')
-rw-r--r--device/hid/hid_connection_unittest.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/device/hid/hid_connection_unittest.cc b/device/hid/hid_connection_unittest.cc
index 28e136c..903cf5a 100644
--- a/device/hid/hid_connection_unittest.cc
+++ b/device/hid/hid_connection_unittest.cc
@@ -73,7 +73,9 @@ class HidConnectionTest : public testing::Test {
if (!UsbTestGadget::IsTestEnabled()) return;
message_loop_.reset(new base::MessageLoopForIO());
- service_ = HidService::GetInstance(message_loop_->message_loop_proxy());
+ service_ = HidService::GetInstance(
+ message_loop_->message_loop_proxy(),
+ message_loop_->message_loop_proxy());
ASSERT_TRUE(service_);
test_gadget_ = UsbTestGadget::Claim();