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

Unified Diff: device/hid/hid_service.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/base/device_monitor_linux.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service.h
diff --git a/device/hid/hid_service.h b/device/hid/hid_service.h
index bcff953411cd831ca66f00a594b0dc88458165c4..c46ce131391187586eb507e9c4438b0893fd37be 100644
--- a/device/hid/hid_service.h
+++ b/device/hid/hid_service.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/bind_helpers.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
@@ -52,6 +53,11 @@ class HidService {
virtual ~HidService();
+ // Shuts down the HidService. Must be called before destroying the HidService
+ // when tasks can still be posted to the |file_task_runner| provided to
+ // Create().
+ virtual void Shutdown();
+
// Enumerates available devices. The provided callback will always be posted
// to the calling thread's task runner.
virtual void GetDevices(const GetDevicesCallback& callback);
@@ -86,10 +92,14 @@ class HidService {
private:
DeviceMap devices_;
- bool enumeration_ready_;
+ bool enumeration_ready_ = false;
std::vector<GetDevicesCallback> pending_enumerations_;
base::ObserverList<Observer, true> observer_list_;
+#if DCHECK_IS_ON()
+ bool did_shutdown_ = false;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(HidService);
};
« no previous file with comments | « device/base/device_monitor_linux.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698