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

Unified Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 265793017: Oilpan: move node/element rare data objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + assert for Nodes having no renderer on destruction. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/shadow/ElementShadow.cpp
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index ba11a7035476768c2f723cc0defafba3f50454b5..1cd754dc722e1fcb12caf329e571b608a06da2a7 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -163,20 +163,28 @@ ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow
void ElementShadow::removeDetachedShadowRoots()
{
+ // With Oilpan, the Element shadow roots may have been finalized
+ // during the same sweep. Do not access, but do the minimum
+ // necessary/allowed, just clearing the list of roots.
+#if !ENABLE(OILPAN)
// Dont protect this ref count.
Element* shadowHost = host();
ASSERT(shadowHost);
+#endif
while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) {
+#if !ENABLE(OILPAN)
InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get());
shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get());
+#endif
m_shadowRoots.removeHead();
oldRoot->setParentOrShadowHostNode(0);
+#if !ENABLE(OILPAN)
oldRoot->setParentTreeScope(shadowHost->document());
+#endif
oldRoot->setPrev(0);
oldRoot->setNext(0);
}
-
}
void ElementShadow::attach(const Node::AttachContext& context)

Powered by Google App Engine
This is Rietveld 408576698