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

Unified Diff: device/usb/usb_service.cc

Issue 2423793002: Remove usage of FOR_EACH_OBSERVER macro in device/ (Closed)
Patch Set: rebase Created 4 years, 2 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.cc ('k') | no next file » | 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 b6e6dca0667c93fef1912fd241d46eae47a62967..1a2cf98c303515444602a615cffe05c55839ce07 100644
--- a/device/usb/usb_service.cc
+++ b/device/usb/usb_service.cc
@@ -53,7 +53,8 @@ std::unique_ptr<UsbService> UsbService::Create(
UsbService::~UsbService() {
for (const auto& map_entry : devices_)
map_entry.second->OnDisconnect();
- FOR_EACH_OBSERVER(Observer, observer_list_, WillDestroyUsbService());
+ for (auto& observer : observer_list_)
+ observer.WillDestroyUsbService();
}
UsbService::UsbService(
@@ -127,15 +128,18 @@ void UsbService::GetTestDevices(
void UsbService::NotifyDeviceAdded(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
- FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceAdded(device));
+ for (auto& observer : observer_list_)
+ observer.OnDeviceAdded(device);
}
void UsbService::NotifyDeviceRemoved(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
- FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemoved(device));
+ for (auto& observer : observer_list_)
+ observer.OnDeviceRemoved(device);
device->NotifyDeviceRemoved();
- FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemovedCleanup(device));
+ for (auto& observer : observer_list_)
+ observer.OnDeviceRemovedCleanup(device);
}
} // namespace device
« no previous file with comments | « device/usb/usb_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698