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

Unified Diff: chrome/browser/chromeos/device/input_service_proxy.h

Issue 2937253003: cros: Replace BrowserThread::FILE in InputServiceProxy (Closed)
Patch Set: update dependent code to fix tests Created 3 years, 6 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
Index: chrome/browser/chromeos/device/input_service_proxy.h
diff --git a/chrome/browser/chromeos/device/input_service_proxy.h b/chrome/browser/chromeos/device/input_service_proxy.h
index 3c00da6e381eebf32ed42eabca038795c4c45f47..2bd3705661e1b01bd97ff459bf97c10eb8bec728 100644
--- a/chrome/browser/chromeos/device/input_service_proxy.h
+++ b/chrome/browser/chromeos/device/input_service_proxy.h
@@ -14,7 +14,6 @@
#include "base/observer_list.h"
#include "base/task_runner.h"
#include "base/threading/thread_checker.h"
-#include "content/public/browser/browser_thread.h"
#include "device/hid/input_service_linux.h"
namespace chromeos {
@@ -47,12 +46,15 @@ class InputServiceProxy {
void GetDeviceInfo(const std::string& id,
const GetDeviceInfoCallback& callback);
+ // Returns the TaskRunner for device::InputServiceLinux. Make it static so
+ // that all InputServiceProxy instances and code that needs access to
+ // device::InputServiceLinux uses the same TaskRunner.
+ static scoped_refptr<base::TaskRunner> GetInputServiceTaskRunner();
achuithb 2017/06/19 22:34:42 Should we include base/memory/ref_counted.h or is
xiyuan 2017/06/19 23:00:26 You are right that we should include ref_counted.h
+
// Should be called once before any InputServiceProxy instance is created.
- static void SetThreadIdForTesting(content::BrowserThread::ID thread_id);
+ static void SetUseUIThreadForTesting(bool use_ui_thread);
private:
- static content::BrowserThread::ID thread_identifier_;
-
class ServiceObserver;
void OnDeviceAdded(const device::InputServiceLinux::InputDeviceInfo& info);
@@ -61,9 +63,7 @@ class InputServiceProxy {
base::ObserverList<Observer> observers_;
std::unique_ptr<ServiceObserver> service_observer_;
- base::ThreadChecker thread_checker_;
-
- scoped_refptr<base::TaskRunner> task_runner_;
+ THREAD_CHECKER(thread_checker_);
base::WeakPtrFactory<InputServiceProxy> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698