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

Unified Diff: device/usb/usb_service.cc

Issue 941063003: Log device/usb messages to chrome://device-log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 10 months 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/usb/usb_device_impl.cc ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service.cc
diff --git a/device/usb/usb_service.cc b/device/usb/usb_service.cc
index 3faa3e56413a24335ca1fde440b41ae4657f410b..10338fc7e14e45f832ae342e43c2447d10604828 100644
--- a/device/usb/usb_service.cc
+++ b/device/usb/usb_service.cc
@@ -5,6 +5,7 @@
#include "device/usb/usb_service.h"
#include "base/message_loop/message_loop.h"
+#include "components/device_event_log/device_event_log.h"
#include "device/usb/usb_device.h"
#include "device/usb/usb_service_impl.h"
@@ -83,11 +84,19 @@ void UsbService::RemoveObserver(Observer* observer) {
void UsbService::NotifyDeviceAdded(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
+
+ USB_LOG(USER) << "USB device added: vendorId = " << device->vendor_id()
+ << ", productId = " << device->product_id()
+ << ", uniqueId = " << device->unique_id();
+
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceAdded(device));
}
void UsbService::NotifyDeviceRemoved(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
+
+ USB_LOG(USER) << "USB device removed: uniqueId = " << device->unique_id();
+
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemoved(device));
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemovedCleanup(device));
}
« no previous file with comments | « device/usb/usb_device_impl.cc ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698