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

Side by Side 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 + EventHandler.cpp oilpan compile fix Created 6 years, 7 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); 157 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get());
158 158
159 ASSERT(m_shadowRoots.head()); 159 ASSERT(m_shadowRoots.head());
160 ASSERT(shadowRoot.get() == m_shadowRoots.head()); 160 ASSERT(shadowRoot.get() == m_shadowRoots.head());
161 return *m_shadowRoots.head(); 161 return *m_shadowRoots.head();
162 } 162 }
163 163
164 void ElementShadow::removeDetachedShadowRoots() 164 void ElementShadow::removeDetachedShadowRoots()
165 { 165 {
166 // With Oilpan, the Element shadow roots may have been finalized
167 // during the same sweep. Do not access, but do the minimum
168 // necessary/allowed, just clearing the list of roots.
169 #if !ENABLE(OILPAN)
166 // Dont protect this ref count. 170 // Dont protect this ref count.
167 Element* shadowHost = host(); 171 Element* shadowHost = host();
168 ASSERT(shadowHost); 172 ASSERT(shadowHost);
173 #endif
169 174
170 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) { 175 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) {
176 #if !ENABLE(OILPAN)
171 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get()); 177 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get());
172 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get()); 178 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get());
179 #endif
173 m_shadowRoots.removeHead(); 180 m_shadowRoots.removeHead();
174 oldRoot->setParentOrShadowHostNode(0); 181 oldRoot->setParentOrShadowHostNode(0);
182 #if !ENABLE(OILPAN)
175 oldRoot->setParentTreeScope(shadowHost->document()); 183 oldRoot->setParentTreeScope(shadowHost->document());
184 #endif
haraken 2014/05/04 01:46:24 This change is not related to this CL, and should
sof 2014/05/04 18:59:22 The need to be careful on what happens in the Elem
176 oldRoot->setPrev(0); 185 oldRoot->setPrev(0);
177 oldRoot->setNext(0); 186 oldRoot->setNext(0);
178 } 187 }
179
180 } 188 }
181 189
182 void ElementShadow::attach(const Node::AttachContext& context) 190 void ElementShadow::attach(const Node::AttachContext& context)
183 { 191 {
184 Node::AttachContext childrenContext(context); 192 Node::AttachContext childrenContext(context);
185 childrenContext.resolvedStyle = 0; 193 childrenContext.resolvedStyle = 0;
186 194
187 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) { 195 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) {
188 if (root->needsAttach()) 196 if (root->needsAttach())
189 root->attach(childrenContext); 197 root->attach(childrenContext);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 352
345 void ElementShadow::clearDistribution() 353 void ElementShadow::clearDistribution()
346 { 354 {
347 m_nodeToInsertionPoints.clear(); 355 m_nodeToInsertionPoints.clear();
348 356
349 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) 357 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root())
350 root->setShadowInsertionPointOfYoungerShadowRoot(nullptr); 358 root->setShadowInsertionPointOfYoungerShadowRoot(nullptr);
351 } 359 }
352 360
353 } // namespace 361 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698