Chromium Code Reviews| Index: Source/core/dom/shadow/ShadowRoot.cpp |
| diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp |
| index 1f5b2d83fda38f696c833624c2f05aea28b763b2..9a63cfa9eaa7fd987a4ff37ce9889c17db265959 100644 |
| --- a/Source/core/dom/shadow/ShadowRoot.cpp |
| +++ b/Source/core/dom/shadow/ShadowRoot.cpp |
| @@ -263,7 +263,7 @@ HTMLShadowElement* ShadowRoot::shadowInsertionPointOfYoungerShadowRoot() const |
| return m_shadowRootRareData ? m_shadowRootRareData->shadowInsertionPointOfYoungerShadowRoot() : 0; |
| } |
| -void ShadowRoot::setShadowInsertionPointOfYoungerShadowRoot(PassRefPtr<HTMLShadowElement> shadowInsertionPoint) |
| +void ShadowRoot::setShadowInsertionPointOfYoungerShadowRoot(PassRefPtrWillBeRawPtr<HTMLShadowElement> shadowInsertionPoint) |
| { |
| if (!m_shadowRootRareData && !shadowInsertionPoint) |
| return; |
| @@ -306,19 +306,28 @@ void ShadowRoot::invalidateDescendantInsertionPoints() |
| m_shadowRootRareData->clearDescendantInsertionPoints(); |
| } |
| -const Vector<RefPtr<InsertionPoint> >& ShadowRoot::descendantInsertionPoints() |
| +const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >& ShadowRoot::descendantInsertionPoints() |
| { |
| +#if ENABLE(OILPAN) |
| + DEFINE_STATIC_LOCAL(Persistent<const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> > >, emptyList, (new WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >())); |
| +#else |
| DEFINE_STATIC_LOCAL(const Vector<RefPtr<InsertionPoint> >, emptyList, ()); |
|
haraken
2014/05/12 12:21:38
I'd prefer:
DEFINE_STATIC_LOCAL(WillBePersistentH
sof
2014/05/12 12:37:49
Oh, nice - that will work here. Switched.
|
| +#endif |
| if (m_shadowRootRareData && m_descendantInsertionPointsIsValid) |
| return m_shadowRootRareData->descendantInsertionPoints(); |
| m_descendantInsertionPointsIsValid = true; |
| - if (!containsInsertionPoints()) |
| + if (!containsInsertionPoints()) { |
| +#if ENABLE(OILPAN) |
| + return *emptyList; |
| +#else |
| return emptyList; |
| +#endif |
| + } |
| - Vector<RefPtr<InsertionPoint> > insertionPoints; |
| + WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> > insertionPoints; |
| for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::next(*element, this)) { |
| if (element->isInsertionPoint()) |
| insertionPoints.append(toInsertionPoint(element)); |