Commit 36895185 authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Replace Node* pointers with Member<Node>s

- Make SelectorCheckerContext STACK_ALLOCATED.
- Make FocusCandidate STACK_ALLOCATED.
- Make TreeBoundaryCrossingRuleSetMap a hash map from Member<Node> to Member<CSSStyleSheetRuleSubSet>. This hash map doesn't need to be weak.

BUG=340522

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179087 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 741f2630
...@@ -934,7 +934,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib ...@@ -934,7 +934,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
break; break;
} }
hostContext.contextFlags = DefaultBehavior; hostContext.contextFlags = DefaultBehavior;
hostContext.scope = 0; hostContext.scope = nullptr;
if (selector.pseudoType() == CSSSelector::PseudoHost) if (selector.pseudoType() == CSSSelector::PseudoHost)
break; break;
......
...@@ -55,12 +55,14 @@ public: ...@@ -55,12 +55,14 @@ public:
}; };
struct SelectorCheckingContext { struct SelectorCheckingContext {
STACK_ALLOCATED();
public:
// Initial selector constructor // Initial selector constructor
SelectorCheckingContext(const CSSSelector& selector, Element* element, VisitedMatchType visitedMatchType) SelectorCheckingContext(const CSSSelector& selector, Element* element, VisitedMatchType visitedMatchType)
: selector(&selector) : selector(&selector)
, element(element) , element(element)
, previousElement(0) , previousElement(nullptr)
, scope(0) , scope(nullptr)
, visitedMatchType(visitedMatchType) , visitedMatchType(visitedMatchType)
, pseudoId(NOPSEUDO) , pseudoId(NOPSEUDO)
, elementStyle(0) , elementStyle(0)
...@@ -71,12 +73,13 @@ public: ...@@ -71,12 +73,13 @@ public:
, hasSelectionPseudo(false) , hasSelectionPseudo(false)
, isUARule(false) , isUARule(false)
, contextFlags(DefaultBehavior) , contextFlags(DefaultBehavior)
{ } {
}
const CSSSelector* selector; const CSSSelector* selector;
Element* element; RawPtrWillBeMember<Element> element;
Element* previousElement; RawPtrWillBeMember<Element> previousElement;
const ContainerNode* scope; RawPtrWillBeMember<const ContainerNode> scope;
VisitedMatchType visitedMatchType; VisitedMatchType visitedMatchType;
PseudoId pseudoId; PseudoId pseudoId;
RenderStyle* elementStyle; RenderStyle* elementStyle;
......
...@@ -54,7 +54,7 @@ private: ...@@ -54,7 +54,7 @@ private:
void collectFeaturesFromRuleSubSet(CSSStyleSheetRuleSubSet*, RuleFeatureSet&); void collectFeaturesFromRuleSubSet(CSSStyleSheetRuleSubSet*, RuleFeatureSet&);
DocumentOrderedList m_scopingNodes; DocumentOrderedList m_scopingNodes;
typedef WillBeHeapHashMap<const ContainerNode*, OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> > TreeBoundaryCrossingRuleSetMap; typedef WillBeHeapHashMap<RawPtrWillBeMember<const ContainerNode>, OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> > TreeBoundaryCrossingRuleSetMap;
TreeBoundaryCrossingRuleSetMap m_treeBoundaryCrossingRuleSetMap; TreeBoundaryCrossingRuleSetMap m_treeBoundaryCrossingRuleSetMap;
}; };
......
...@@ -55,9 +55,9 @@ static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo ...@@ -55,9 +55,9 @@ static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
static bool isScrollableNode(const Node*); static bool isScrollableNode(const Node*);
FocusCandidate::FocusCandidate(Node* node, FocusType type) FocusCandidate::FocusCandidate(Node* node, FocusType type)
: visibleNode(0) : visibleNode(nullptr)
, focusableNode(0) , focusableNode(nullptr)
, enclosingScrollableBox(0) , enclosingScrollableBox(nullptr)
, distance(maxDistance()) , distance(maxDistance())
, alignment(None) , alignment(None)
, isOffscreen(true) , isOffscreen(true)
......
...@@ -98,10 +98,12 @@ enum RectsAlignment { ...@@ -98,10 +98,12 @@ enum RectsAlignment {
}; };
struct FocusCandidate { struct FocusCandidate {
STACK_ALLOCATED();
public:
FocusCandidate() FocusCandidate()
: visibleNode(0) : visibleNode(nullptr)
, focusableNode(0) , focusableNode(nullptr)
, enclosingScrollableBox(0) , enclosingScrollableBox(nullptr)
, distance(maxDistance()) , distance(maxDistance())
, alignment(None) , alignment(None)
, isOffscreen(true) , isOffscreen(true)
...@@ -119,9 +121,9 @@ struct FocusCandidate { ...@@ -119,9 +121,9 @@ struct FocusCandidate {
// We handle differently visibleNode and FocusableNode to properly handle the areas of imagemaps, // We handle differently visibleNode and FocusableNode to properly handle the areas of imagemaps,
// where visibleNode would represent the image element and focusableNode would represent the area element. // where visibleNode would represent the image element and focusableNode would represent the area element.
// In all other cases, visibleNode and focusableNode are one and the same. // In all other cases, visibleNode and focusableNode are one and the same.
Node* visibleNode; RawPtrWillBeMember<Node> visibleNode;
Node* focusableNode; RawPtrWillBeMember<Node> focusableNode;
Node* enclosingScrollableBox; RawPtrWillBeMember<Node> enclosingScrollableBox;
long long distance; long long distance;
RectsAlignment alignment; RectsAlignment alignment;
LayoutRect rect; LayoutRect rect;
......
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