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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 4 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: 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;

Powered by Google App Engine
This is Rietveld 408576698