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); |