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

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 642293004: Use C++11 range-based loop in core/frame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 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 | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 7c852b36fb9cea1ed03e8351197e60cb2319737b..e0c5cd5e891abd1f8a71b708095ede191bfa32a4 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -134,9 +134,8 @@ LocalFrame::~LocalFrame()
m_loader.clear();
setDOMWindow(nullptr);
- HashSet<RawPtr<FrameDestructionObserver> >::iterator stop = m_destructionObservers.end();
- for (HashSet<RawPtr<FrameDestructionObserver> >::iterator it = m_destructionObservers.begin(); it != stop; ++it)
- (*it)->frameDestroyed();
+ for (const auto& frameDestructionObserver : m_destructionObservers)
+ frameDestructionObserver->frameDestroyed();
#endif
}
@@ -165,10 +164,10 @@ void LocalFrame::trace(Visitor* visitor)
void LocalFrame::clearWeakMembers(Visitor* visitor)
{
Vector<HTMLPlugInElement*> deadPlugins;
- for (HashSet<HTMLPlugInElement*>::const_iterator it = m_pluginElements.begin(); it != m_pluginElements.end(); ++it) {
- if (!visitor->isAlive(*it)) {
- (*it)->shouldDisposePlugin();
- deadPlugins.append(*it);
+ for (const auto& pluginElement : m_pluginElements) {
+ if (!visitor->isAlive(pluginElement)) {
+ pluginElement->shouldDisposePlugin();
+ deadPlugins.append(pluginElement);
}
}
for (unsigned i = 0; i < deadPlugins.size(); ++i)
@@ -351,9 +350,8 @@ void LocalFrame::willDetachFrameHost()
if (parent && parent->isLocalFrame())
toLocalFrame(parent)->loader().checkLoadComplete();
- WillBeHeapHashSet<RawPtrWillBeWeakMember<FrameDestructionObserver> >::iterator stop = m_destructionObservers.end();
- for (WillBeHeapHashSet<RawPtrWillBeWeakMember<FrameDestructionObserver> >::iterator it = m_destructionObservers.begin(); it != stop; ++it)
- (*it)->willDetachFrameHost();
+ for (const auto& frameDestructionObserver : m_destructionObservers)
+ frameDestructionObserver->willDetachFrameHost();
// FIXME: Page should take care of updating focus/scrolling instead of Frame.
// FIXME: It's unclear as to why this is called more than once, but it is,
@@ -744,8 +742,8 @@ void LocalFrame::disconnectOwnerElement()
#if ENABLE(OILPAN)
// First give the plugin elements holding persisted,
// renderer-less plugins the opportunity to dispose of them.
- for (HashSet<HTMLPlugInElement*>::const_iterator it = m_pluginElements.begin(); it != m_pluginElements.end(); ++it)
- (*it)->disconnectContentFrame();
+ for (const auto& pluginElement : m_pluginElements)
+ pluginElement->disconnectContentFrame();
m_pluginElements.clear();
// Clear the FrameView and FrameLoader right here rather than
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698