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

Unified Diff: device/hid/hid_service.cc

Issue 771393002: Migrate HidServiceLinux and HidConnectionLinux to BrowserThread::UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched to an embedded thread checker. Created 6 years 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_service.h ('k') | device/hid/hid_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.cc
diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc
index 071b3968bcd7fdcd21079e58c5226695eb84d72a..78273ae64a2b18f16efb1ab7331b56aa3e7f2132 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -4,9 +4,7 @@
#include "device/hid/hid_service.h"
-#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
@@ -45,11 +43,10 @@ class HidService::Destroyer : public base::MessageLoop::DestructionObserver {
};
HidService* HidService::GetInstance(
- scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) {
if (g_service == NULL) {
#if defined(OS_LINUX) && defined(USE_UDEV)
- g_service = new HidServiceLinux(ui_task_runner);
+ g_service = new HidServiceLinux(file_task_runner);
#elif defined(OS_MACOSX)
g_service = new HidServiceMac(file_task_runner);
#elif defined(OS_WIN)
@@ -87,6 +84,7 @@ void HidService::GetDevices(std::vector<HidDeviceInfo>* devices) {
// Fills in the device info struct of the given device_id.
bool HidService::GetDeviceInfo(const HidDeviceId& device_id,
HidDeviceInfo* info) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
DeviceMap::const_iterator it = devices_.find(device_id);
if (it == devices_.end())
return false;
@@ -95,7 +93,6 @@ bool HidService::GetDeviceInfo(const HidDeviceId& device_id,
}
HidService::HidService() {
- DCHECK(thread_checker_.CalledOnValidThread());
}
void HidService::AddDevice(const HidDeviceInfo& info) {
« no previous file with comments | « device/hid/hid_service.h ('k') | device/hid/hid_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698