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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } else if (node.hasRareData()) { 58 } else if (node.hasRareData()) {
59 NodeRareData* rareData = node.rareData(); 59 NodeRareData* rareData = node.rareData();
60 if (rareData->nodeLists()) 60 if (rareData->nodeLists())
61 rareData->nodeLists()->adoptTreeScope(); 61 rareData->nodeLists()->adoptTreeScope();
62 } 62 }
63 63
64 if (!node.isElementNode()) 64 if (!node.isElementNode())
65 continue; 65 continue;
66 Element& element = toElement(node); 66 Element& element = toElement(node);
67 67
68 if (WillBeHeapVector<RefPtrWillBeMember<Attr>>* attrs = element.attrNode List()) { 68 if (HeapVector<Member<Attr>>* attrs = element.attrNodeList()) {
69 for (const auto& attr : *attrs) 69 for (const auto& attr : *attrs)
70 moveTreeToNewScope(*attr); 70 moveTreeToNewScope(*attr);
71 } 71 }
72 72
73 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot()) { 73 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot()) {
74 shadow->setParentTreeScope(newScope()); 74 shadow->setParentTreeScope(newScope());
75 if (willMoveToNewDocument) 75 if (willMoveToNewDocument)
76 moveTreeToNewDocument(*shadow, oldDocument, newDocument); 76 moveTreeToNewDocument(*shadow, oldDocument, newDocument);
77 } 77 }
78 } 78 }
79 79
80 #if !ENABLE(OILPAN) 80 #if !ENABLE(OILPAN)
81 oldScope().guardDeref(); 81 oldScope().guardDeref();
82 #endif 82 #endif
83 } 83 }
84 84
85 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const 85 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const
86 { 86 {
87 ASSERT(oldDocument != newDocument); 87 ASSERT(oldDocument != newDocument);
88 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { 88 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) {
89 moveNodeToNewDocument(node, oldDocument, newDocument); 89 moveNodeToNewDocument(node, oldDocument, newDocument);
90 90
91 if (!node.isElementNode()) 91 if (!node.isElementNode())
92 continue; 92 continue;
93 Element& element = toElement(node); 93 Element& element = toElement(node);
94 94
95 if (WillBeHeapVector<RefPtrWillBeMember<Attr>>* attrs = element.attrNode List()) { 95 if (HeapVector<Member<Attr>>* attrs = element.attrNodeList()) {
96 for (const auto& attr : *attrs) 96 for (const auto& attr : *attrs)
97 moveTreeToNewDocument(*attr, oldDocument, newDocument); 97 moveTreeToNewDocument(*attr, oldDocument, newDocument);
98 } 98 }
99 99
100 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot()) 100 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot())
101 moveTreeToNewDocument(*shadow, oldDocument, newDocument); 101 moveTreeToNewDocument(*shadow, oldDocument, newDocument);
102 } 102 }
103 } 103 }
104 104
105 #if ENABLE(ASSERT) 105 #if ENABLE(ASSERT)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 #if ENABLE(ASSERT) 143 #if ENABLE(ASSERT)
144 didMoveToNewDocumentWasCalled = false; 144 didMoveToNewDocumentWasCalled = false;
145 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; 145 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument;
146 #endif 146 #endif
147 147
148 node.didMoveToNewDocument(oldDocument); 148 node.didMoveToNewDocument(oldDocument);
149 ASSERT(didMoveToNewDocumentWasCalled); 149 ASSERT(didMoveToNewDocumentWasCalled);
150 } 150 }
151 151
152 } // namespace blink 152 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698