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

Side by Side Diff: third_party/WebKit/Source/core/dom/ChildFrameDisconnector.cpp

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase 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 unified diff | Download patch
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 "core/dom/ChildFrameDisconnector.h" 5 #include "core/dom/ChildFrameDisconnector.h"
6 6
7 #include "core/dom/shadow/ElementShadow.h" 7 #include "core/dom/shadow/ElementShadow.h"
8 #include "core/dom/shadow/ShadowRoot.h" 8 #include "core/dom/shadow/ShadowRoot.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 disconnectCollectedFrameOwners(); 33 disconnectCollectedFrameOwners();
34 } 34 }
35 35
36 void ChildFrameDisconnector::collectFrameOwners(Node& root) { 36 void ChildFrameDisconnector::collectFrameOwners(Node& root) {
37 if (!root.connectedSubframeCount()) 37 if (!root.connectedSubframeCount())
38 return; 38 return;
39 39
40 if (root.isHTMLElement() && root.isFrameOwnerElement()) 40 if (root.isHTMLElement() && root.isFrameOwnerElement())
41 m_frameOwners.append(&toHTMLFrameOwnerElement(root)); 41 m_frameOwners.push_back(&toHTMLFrameOwnerElement(root));
42 42
43 for (Node* child = root.firstChild(); child; child = child->nextSibling()) 43 for (Node* child = root.firstChild(); child; child = child->nextSibling())
44 collectFrameOwners(*child); 44 collectFrameOwners(*child);
45 45
46 ElementShadow* shadow = root.isElementNode() ? toElement(root).shadow() : 0; 46 ElementShadow* shadow = root.isElementNode() ? toElement(root).shadow() : 0;
47 if (shadow) 47 if (shadow)
48 collectFrameOwners(*shadow); 48 collectFrameOwners(*shadow);
49 } 49 }
50 50
51 void ChildFrameDisconnector::disconnectCollectedFrameOwners() { 51 void ChildFrameDisconnector::disconnectCollectedFrameOwners() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // If we overcount it's safe, but not optimal because it means we'll traverse 94 // If we overcount it's safe, but not optimal because it means we'll traverse
95 // through the document in ChildFrameDisconnector looking for frames that have 95 // through the document in ChildFrameDisconnector looking for frames that have
96 // already been disconnected. 96 // already been disconnected.
97 DCHECK_EQ(node.connectedSubframeCount(), count); 97 DCHECK_EQ(node.connectedSubframeCount(), count);
98 98
99 return count; 99 return count;
100 } 100 }
101 #endif 101 #endif
102 102
103 } // namespace blink 103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698