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

Unified Diff: device/hid/input_service_linux.h

Issue 2482463002: Remove DeviceMonitorLinux::WillDestroyCurrentMessageLoop(). (Closed)
Patch Set: CR achuithb #24 Created 4 years, 1 month 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_linux.cc ('k') | device/hid/input_service_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/input_service_linux.h
diff --git a/device/hid/input_service_linux.h b/device/hid/input_service_linux.h
index 1eaa30131185303105a38372ee19274059d09f88..484e8115909de9934767d27c22d4d1744ec18f68 100644
--- a/device/hid/input_service_linux.h
+++ b/device/hid/input_service_linux.h
@@ -56,9 +56,19 @@ class InputServiceLinux {
InputServiceLinux();
virtual ~InputServiceLinux();
+ // Returns the InputServiceLinux instance for the current process. Creates one
+ // if none has been set.
static InputServiceLinux* GetInstance();
+
+ // Returns true if an InputServiceLinux instance has been set for the current
+ // process. An instance is set on the first call to GetInstance() or
+ // SetForTesting().
static bool HasInstance();
- static void SetForTesting(InputServiceLinux* service);
+
+ // Sets the InputServiceLinux instance for the current process. Cannot be
+ // called if GetInstance() or SetForTesting() has already been called in the
+ // current process. |service| will never be deleted.
+ static void SetForTesting(std::unique_ptr<InputServiceLinux> service);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -81,8 +91,6 @@ class InputServiceLinux {
base::ObserverList<Observer> observers_;
private:
- friend std::default_delete<InputServiceLinux>;
-
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(InputServiceLinux);
« no previous file with comments | « device/hid/hid_service_linux.cc ('k') | device/hid/input_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698