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

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: 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
Index: device/usb/usb_service.cc
diff --git a/device/usb/usb_service.cc b/device/usb/usb_service.cc
index 3faa3e56413a24335ca1fde440b41ae4657f410b..5bb7f20f2e7c2d151cfaa7c4b5804e08d4fbc946 100644
--- a/device/usb/usb_service.cc
+++ b/device/usb/usb_service.cc
@@ -6,6 +6,7 @@
#include "base/message_loop/message_loop.h"
#include "device/usb/usb_device.h"
+#include "device/usb/usb_log.h"
#include "device/usb/usb_service_impl.h"
namespace device {
@@ -83,11 +84,19 @@ void UsbService::RemoveObserver(Observer* observer) {
void UsbService::NotifyDeviceAdded(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
+
+ USB_LOG(EVENT) << "USB device added: vendorId = " << device->vendor_id()
+ << ", productId = " << device->product_id()
+ << ", uniqueId = " << device->unique_id();
stevenjb 2015/02/20 00:01:27 These might be a good candidate for 'USER' since i
Reilly Grant (use Gerrit) 2015/02/20 00:10:22 Fair enough. There will be a small burst of events
+
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceAdded(device));
}
void UsbService::NotifyDeviceRemoved(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
+
+ USB_LOG(EVENT) << "USB device removed: uniqueId = " << device->unique_id();
+
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemoved(device));
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemovedCleanup(device));
}
« device/usb/usb_log.h ('K') | « device/usb/usb_log.h ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698