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

Side by Side Diff: Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp

Issue 610273005: Use auto and Range-based loop interation in Source/core/dom/custom/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/dom/custom/CustomElementRegistrationContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" 6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
7 7
8 #include "core/dom/Microtask.h" 8 #include "core/dom/Microtask.h"
9 #include "core/dom/custom/CustomElementCallbackQueue.h" 9 #include "core/dom/custom/CustomElementCallbackQueue.h"
10 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" 10 #include "core/dom/custom/CustomElementMicrotaskImportStep.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 m_hasScheduledMicrotask = false; 64 m_hasScheduledMicrotask = false;
65 65
66 // Finishing microtask work deletes all 66 // Finishing microtask work deletes all
67 // CustomElementCallbackQueues. Being in a callback delivery scope 67 // CustomElementCallbackQueues. Being in a callback delivery scope
68 // implies those queues could still be in use. 68 // implies those queues could still be in use.
69 ASSERT_WITH_SECURITY_IMPLICATION(!CustomElementProcessingStack::inCallbackDe liveryScope()); 69 ASSERT_WITH_SECURITY_IMPLICATION(!CustomElementProcessingStack::inCallbackDe liveryScope());
70 70
71 m_phase = Resolving; 71 m_phase = Resolving;
72 72
73 m_phase = DispatchingCallbacks; 73 m_phase = DispatchingCallbacks;
74 for (WillBeHeapVector<RawPtrWillBeMember<CustomElementCallbackQueue> >::iter ator it = m_elements.begin(); it != m_elements.end(); ++it) { 74 for (const auto& element : m_elements) {
75 // Created callback may enqueue an attached callback. 75 // Created callback may enqueue an attached callback.
76 CustomElementProcessingStack::CallbackDeliveryScope scope; 76 CustomElementProcessingStack::CallbackDeliveryScope scope;
77 (*it)->processInElementQueue(kMicrotaskQueueId); 77 element->processInElementQueue(kMicrotaskQueueId);
78 } 78 }
79 79
80 m_elements.clear(); 80 m_elements.clear();
81 CustomElementScheduler::microtaskDispatcherDidFinish(); 81 CustomElementScheduler::microtaskDispatcherDidFinish();
82 m_phase = Quiescent; 82 m_phase = Quiescent;
83 } 83 }
84 84
85 void CustomElementMicrotaskDispatcher::trace(Visitor* visitor) 85 void CustomElementMicrotaskDispatcher::trace(Visitor* visitor)
86 { 86 {
87 #if ENABLE(OILPAN) 87 #if ENABLE(OILPAN)
88 visitor->trace(m_elements); 88 visitor->trace(m_elements);
89 #endif 89 #endif
90 } 90 }
91 91
92 } // namespace blink 92 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/custom/CustomElementRegistrationContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698