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

Unified Diff: extensions/shell/browser/shell_device_client.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 | « extensions/shell/browser/shell_device_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/shell_device_client.cc
diff --git a/extensions/shell/browser/shell_device_client.cc b/extensions/shell/browser/shell_device_client.cc
index 81dabf4c72a527d5ca057d0475b07259b5546692..f820ea1aae1383aad46849f2419ae4c3fe4432c7 100644
--- a/extensions/shell/browser/shell_device_client.cc
+++ b/extensions/shell/browser/shell_device_client.cc
@@ -4,7 +4,6 @@
#include "extensions/shell/browser/shell_device_client.h"
-#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
#include "device/hid/hid_service.h"
#include "device/usb/usb_service.h"
@@ -15,7 +14,21 @@ namespace extensions {
ShellDeviceClient::ShellDeviceClient() {}
-ShellDeviceClient::~ShellDeviceClient() {}
+ShellDeviceClient::~ShellDeviceClient() {
+#if DCHECK_IS_ON()
+ DCHECK(did_shutdown_);
+#endif
+}
+
+void ShellDeviceClient::Shutdown() {
+ if (usb_service_)
+ usb_service_->Shutdown();
+ if (hid_service_)
+ hid_service_->Shutdown();
+#if DCHECK_IS_ON()
+ did_shutdown_ = true;
+#endif
+}
device::UsbService* ShellDeviceClient::GetUsbService() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
« no previous file with comments | « extensions/shell/browser/shell_device_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698