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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use meaningful names 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 | « no previous file | Source/core/html/HTMLEmbedElement.cpp » ('j') | Source/core/html/HTMLMediaElement.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index f251bd5cf0b7c20519e04e5ed8d89827412f57ce..3eef4cc1a832ef2e52c94050f0fe14a128b7bde2 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -96,9 +96,8 @@ HTMLCanvasElement::~HTMLCanvasElement()
resetDirtyRect();
v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory);
#if !ENABLE(OILPAN)
- HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end();
- for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
- (*it)->canvasDestroyed(this);
+ for (const auto& canvasObserver : m_observers)
Mike West 2014/10/20 18:12:44 When the type is trivial to type, please use the a
+ canvasObserver->canvasDestroyed(this);
// Ensure these go away before the ImageBuffer.
m_contextStateSaver.clear();
m_context.clear();
@@ -251,9 +250,8 @@ void HTMLCanvasElement::willProcessTask()
void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect)
{
- WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m_observers.end();
- for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
- (*it)->canvasChanged(this, rect);
+ for (const auto& canvasObserver : m_observers)
+ canvasObserver->canvasChanged(this, rect);
}
void HTMLCanvasElement::reset()
@@ -311,9 +309,8 @@ void HTMLCanvasElement::reset()
}
}
- WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m_observers.end();
- for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
- (*it)->canvasResized(this);
+ for (const auto& canvasObserver : m_observers)
+ canvasObserver->canvasResized(this);
}
bool HTMLCanvasElement::paintsIntoCanvasBuffer() const
« no previous file with comments | « no previous file | Source/core/html/HTMLEmbedElement.cpp » ('j') | Source/core/html/HTMLMediaElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698