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 a3e5ae012246b2daf623fc3628f6eea8941a36f1..0146b66a674fe0437ba6a112832ba677e6df8130 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(); |
Devlin
2016/08/30 19:21:53
can this be const&?
lazyboy
2016/08/30 20:30:56
Done.
|
if (handled_extensions.find(extension_id) != handled_extensions.end()) |
continue; |