Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc |
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc |
index 31d46b0bdc224ed0a08a296527a6634e7c9024e1..7c687e0ee9266b21f16026aca07d2ccb99aff6c6 100644 |
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc |
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc |
@@ -1475,14 +1475,13 @@ void BluetoothLowEnergyEventRouter::DispatchEventToExtensionsWithPermission( |
// only once. |
BluetoothPermissionRequest request(uuid.value()); |
std::set<std::string> handled_extensions; |
- const EventListenerMap::ListenerList listeners = |
- EventRouter::Get(browser_context_)->listeners().GetEventListenersByName( |
- event_name); |
+ const EventListenerMap::ListenerList& listeners = |
+ EventRouter::Get(browser_context_) |
+ ->listeners() |
+ .GetEventListenersByName(event_name); |
- for (EventListenerMap::ListenerList::const_iterator iter = listeners.begin(); |
- iter != listeners.end(); |
- ++iter) { |
- const std::string extension_id = (*iter)->extension_id(); |
+ for (const std::unique_ptr<EventListener>& listener : listeners) { |
+ const std::string& extension_id = listener->extension_id(); |
if (handled_extensions.find(extension_id) != handled_extensions.end()) |
continue; |