Commit 741f2630 authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Remove Element* raw pointers in objects

- Make StyleResolver's StyleSharingList a HeapDeque of Member<Element>s.
- Make CSSFontFaceSrcValue::m_svgFontFaceElement a Member<Element>.
- Add a FIXME to make ScriptLoader::m_element to a Member<Element>.
Given that ResourceClient is going to be moved to the heap soon,
it would be better to just wait for it rather than making it a Persistent<Element>.

BUG=340522

Review URL: https://codereview.chromium.org/423013002

git-svn-id: svn://svn.chromium.org/blink/trunk@179086 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 14e576f9
......@@ -97,6 +97,8 @@ private:
ResourcePtr<FontResource> m_fetched;
#if ENABLE(SVG_FONTS)
// FIXME: Oilpan: Changing this to a member leaks Document.
// Figure out the retaining path. See https://codereview.chromium.org/337703004
SVGFontFaceElement* m_svgFontFaceElement;
#endif
};
......
......@@ -341,7 +341,7 @@ StyleSharingList& StyleResolver::styleSharingList()
unsigned depth = std::max(std::min(m_styleSharingDepth, styleSharingMaxDepth), 1u) - 1u;
if (!m_styleSharingLists[depth])
m_styleSharingLists[depth] = adoptPtr(new StyleSharingList);
m_styleSharingLists[depth] = adoptPtrWillBeNoop(new StyleSharingList);
return *m_styleSharingLists[depth];
}
......@@ -1563,6 +1563,7 @@ void StyleResolver::trace(Visitor* visitor)
visitor->trace(m_uncommonAttributeRuleSet);
visitor->trace(m_watchedSelectorsRules);
visitor->trace(m_treeBoundaryCrossingRules);
visitor->trace(m_styleSharingLists);
visitor->trace(m_pendingStyleSheets);
visitor->trace(m_styleTree);
visitor->trace(m_scopedStyleResolvers);
......
......@@ -85,7 +85,7 @@ enum RuleMatchingBehavior {
const unsigned styleSharingListSize = 15;
const unsigned styleSharingMaxDepth = 32;
typedef WTF::Deque<Element*, styleSharingListSize> StyleSharingList;
typedef WillBeHeapDeque<RawPtrWillBeMember<Element>, styleSharingListSize> StyleSharingList;
struct CSSPropertyValue {
STACK_ALLOCATED();
......@@ -316,7 +316,7 @@ private:
StyleResourceLoader m_styleResourceLoader;
unsigned m_styleSharingDepth;
Vector<OwnPtr<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists;
WillBeHeapVector<OwnPtrWillBeMember<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists;
OwnPtr<StyleResolverStats> m_styleResolverStats;
OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
......
......@@ -85,6 +85,7 @@ private:
// ResourceClient
virtual void notifyFinished(Resource*) OVERRIDE;
// FIXME: Oilpan: This should become a Member once ResourceClient is moved to the heap.
Element* m_element;
ResourcePtr<ScriptResource> m_resource;
WTF::OrdinalNumber m_startLineNumber;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment