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

Unified Diff: device/hid/hid_service.cc

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.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 1e118ef622a136115a7d046dd81a2484a8bceee9..cee3980b9dc86879258bf017b7a4fb304ec7efc4 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -49,6 +49,13 @@ std::unique_ptr<HidService> HidService::Create(
#endif
}
+void HidService::Shutdown() {
+#if DCHECK_IS_ON()
+ DCHECK(!did_shutdown_);
+ did_shutdown_ = true;
+#endif
+}
+
void HidService::GetDevices(const GetDevicesCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
if (enumeration_ready_) {
@@ -82,11 +89,13 @@ scoped_refptr<HidDeviceInfo> HidService::GetDeviceInfo(
return it->second;
}
-HidService::HidService() : enumeration_ready_(false) {
-}
+HidService::HidService() = default;
HidService::~HidService() {
DCHECK(thread_checker_.CalledOnValidThread());
+#if DCHECK_IS_ON()
+ DCHECK(did_shutdown_);
+#endif
}
void HidService::AddDevice(scoped_refptr<HidDeviceInfo> device_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