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

Unified Diff: Source/core/inspector/TraceEventDispatcher.cpp

Issue 800113002: Use C++11 range-based for loop in Source/core/inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase again and again! Created 6 years 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 | « Source/core/inspector/PromiseTracker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/TraceEventDispatcher.cpp
diff --git a/Source/core/inspector/TraceEventDispatcher.cpp b/Source/core/inspector/TraceEventDispatcher.cpp
index dba8f0a1d8ab1b547b6d7f29c8a5acee2cfe5a7a..918fb52d59fa3cd6ec29ecb3d20e87d479609fb8 100644
--- a/Source/core/inspector/TraceEventDispatcher.cpp
+++ b/Source/core/inspector/TraceEventDispatcher.cpp
@@ -123,8 +123,8 @@ void TraceEventDispatcher::removeAllListeners(void* eventTarget, InspectorClient
MutexLocker locker(m_mutex);
ListenersMap remainingListeners;
- for (ListenersMap::iterator it = m_listeners->begin(); it != m_listeners->end(); ++it) {
- WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> >& listeners = *it->value.get();
+ for (auto& listener : *m_listeners) {
+ WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> >& listeners = *listener.value.get();
for (size_t j = 0; j < listeners.size();) {
if (listeners[j]->target() == eventTarget)
listeners.remove(j);
@@ -132,7 +132,7 @@ void TraceEventDispatcher::removeAllListeners(void* eventTarget, InspectorClient
++j;
}
if (!listeners.isEmpty())
- remainingListeners.add(it->key, it->value.release());
+ remainingListeners.add(listener.key, listener.value.release());
}
m_listeners->swap(remainingListeners);
}
« no previous file with comments | « Source/core/inspector/PromiseTracker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698