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

Unified Diff: device/hid/input_service_linux.cc

Issue 913773002: Created fakes for HID-detection screen testing. Initial browsertest added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TaskRunner used for InputServiceProxy. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/hid/input_service_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/input_service_linux.cc
diff --git a/device/hid/input_service_linux.cc b/device/hid/input_service_linux.cc
index f6fd0dceb7bf8589fbcf8bee5c649a23978d1327..81cac1a33da7364e9a4fbed161eb19b071e03116 100644
--- a/device/hid/input_service_linux.cc
+++ b/device/hid/input_service_linux.cc
@@ -90,6 +90,9 @@ class InputServiceLinuxImpl : public InputServiceLinux,
};
InputServiceLinuxImpl::InputServiceLinuxImpl() {
+ base::ThreadRestrictions::AssertIOAllowed();
+ base::MessageLoop::current()->AddDestructionObserver(this);
+
DeviceMonitorLinux::GetInstance()->AddObserver(this);
DeviceMonitorLinux::GetInstance()->Enumerate(base::Bind(
&InputServiceLinuxImpl::OnDeviceAdded, base::Unretained(this)));
@@ -98,6 +101,7 @@ InputServiceLinuxImpl::InputServiceLinuxImpl() {
InputServiceLinuxImpl::~InputServiceLinuxImpl() {
if (DeviceMonitorLinux::HasInstance())
DeviceMonitorLinux::GetInstance()->RemoveObserver(this);
+ base::MessageLoop::current()->RemoveDestructionObserver(this);
}
void InputServiceLinuxImpl::OnDeviceAdded(udev_device* device) {
@@ -162,13 +166,10 @@ InputServiceLinux::InputDeviceInfo::InputDeviceInfo()
is_touchscreen(false) {}
InputServiceLinux::InputServiceLinux() {
- base::ThreadRestrictions::AssertIOAllowed();
- base::MessageLoop::current()->AddDestructionObserver(this);
}
InputServiceLinux::~InputServiceLinux() {
DCHECK(CalledOnValidThread());
- base::MessageLoop::current()->RemoveDestructionObserver(this);
}
// static
« no previous file with comments | « device/hid/input_service_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698