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

Unified Diff: device/hid/hid_service_linux.cc

Issue 2014933002: Move DeviceMonitorLinux to //device/core. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment for boolean parameter. Created 4 years, 7 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/hid.gyp ('k') | device/hid/input_service_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service_linux.cc
diff --git a/device/hid/hid_service_linux.cc b/device/hid/hid_service_linux.cc
index 1e22b5200a15c5122ef0459d1fd3bb251645d83f..2d878310a493a586d7d274d4bee24a36ed757d68 100644
--- a/device/hid/hid_service_linux.cc
+++ b/device/hid/hid_service_linux.cc
@@ -25,7 +25,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "components/device_event_log/device_event_log.h"
-#include "device/hid/device_monitor_linux.h"
+#include "device/core/device_monitor_linux.h"
#include "device/hid/hid_connection_linux.h"
#include "device/hid/hid_device_info_linux.h"
#include "device/udev_linux/scoped_udev.h"
@@ -66,9 +66,7 @@ struct HidServiceLinux::ConnectParams {
base::File device_file;
};
-class HidServiceLinux::FileThreadHelper
- : public DeviceMonitorLinux::Observer,
- public base::MessageLoop::DestructionObserver {
+class HidServiceLinux::FileThreadHelper : public DeviceMonitorLinux::Observer {
public:
FileThreadHelper(base::WeakPtr<HidServiceLinux> service,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
@@ -76,15 +74,11 @@ class HidServiceLinux::FileThreadHelper
~FileThreadHelper() override {
DCHECK(thread_checker_.CalledOnValidThread());
- base::MessageLoop::current()->RemoveDestructionObserver(this);
}
static void Start(std::unique_ptr<FileThreadHelper> self) {
base::ThreadRestrictions::AssertIOAllowed();
self->thread_checker_.DetachFromThread();
- // |self| must be added as a destruction observer first so that it will be
- // notified before DeviceMonitorLinux.
- base::MessageLoop::current()->AddDestructionObserver(self.get());
DeviceMonitorLinux* monitor = DeviceMonitorLinux::GetInstance();
self->observer_.Add(monitor);
@@ -193,8 +187,7 @@ class HidServiceLinux::FileThreadHelper
}
}
- // base::MessageLoop::DestructionObserver:
- void WillDestroyCurrentMessageLoop() override {
+ void WillDestroyMonitorMessageLoop() override {
DCHECK(thread_checker_.CalledOnValidThread());
delete this;
}
« no previous file with comments | « device/hid/hid.gyp ('k') | device/hid/input_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698