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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp

Issue 2553343002: Avoid WTF::Vector::at() and operator[] in core/dom. (Closed)
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp
index d834fe81dbd587e5d1cf73251593287a4d189205..74a249625d7de5a7d3ce282f9e55ab88958510fe 100644
--- a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp
@@ -107,18 +107,18 @@ void ScriptedAnimationController::dispatchEvents(
remaining.swap(m_eventQueue);
}
- for (size_t i = 0; i < events.size(); ++i) {
- EventTarget* eventTarget = events[i]->target();
+ for (const auto& event : events) {
+ EventTarget* eventTarget = event->target();
// FIXME: we should figure out how to make dispatchEvent properly virtual to
// avoid special casting window.
// FIXME: We should not fire events for nodes that are no longer in the
// tree.
InspectorInstrumentation::AsyncTask asyncTask(
- eventTarget->getExecutionContext(), events[i]);
+ eventTarget->getExecutionContext(), event);
if (LocalDOMWindow* window = eventTarget->toLocalDOMWindow())
- window->dispatchEvent(events[i], nullptr);
+ window->dispatchEvent(event, nullptr);
else
- eventTarget->dispatchEvent(events[i]);
+ eventTarget->dispatchEvent(event);
}
}
@@ -189,8 +189,8 @@ void ScriptedAnimationController::enqueuePerFrameEvent(Event* event) {
void ScriptedAnimationController::enqueueMediaQueryChangeListeners(
HeapVector<Member<MediaQueryListListener>>& listeners) {
- for (size_t i = 0; i < listeners.size(); ++i) {
- m_mediaQueryListListeners.add(listeners[i]);
+ for (const auto& listener : listeners) {
+ m_mediaQueryListListeners.add(listener);
}
scheduleAnimationIfNeeded();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698