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
break;
}
hostContext.contextFlags = DefaultBehavior;
hostContext.scope = 0;
hostContext.scope = nullptr;
if (selector.pseudoType() == CSSSelector::PseudoHost)
break;
......
......@@ -55,12 +55,14 @@ public:
};
struct SelectorCheckingContext {
STACK_ALLOCATED();
public:
// Initial selector constructor
SelectorCheckingContext(const CSSSelector& selector, Element* element, VisitedMatchType visitedMatchType)
: selector(&selector)
, element(element)
, previousElement(0)
, scope(0)
, previousElement(nullptr)
, scope(nullptr)
, visitedMatchType(visitedMatchType)
, pseudoId(NOPSEUDO)
, elementStyle(0)
......@@ -71,12 +73,13 @@ public:
, hasSelectionPseudo(false)
, isUARule(false)
, contextFlags(DefaultBehavior)
{ }
{
}
const CSSSelector* selector;
Element* element;
Element* previousElement;
const ContainerNode* scope;
RawPtrWillBeMember<Element> element;
RawPtrWillBeMember<Element> previousElement;
RawPtrWillBeMember<const ContainerNode> scope;
VisitedMatchType visitedMatchType;
PseudoId pseudoId;
RenderStyle* elementStyle;
......
......@@ -54,7 +54,7 @@ private:
void collectFeaturesFromRuleSubSet(CSSStyleSheetRuleSubSet*, RuleFeatureSet&);
DocumentOrderedList m_scopingNodes;
typedef WillBeHeapHashMap<const ContainerNode*, OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> > TreeBoundaryCrossingRuleSetMap;
typedef WillBeHeapHashMap<RawPtrWillBeMember<const ContainerNode>, OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> > TreeBoundaryCrossingRuleSetMap;
TreeBoundaryCrossingRuleSetMap m_treeBoundaryCrossingRuleSetMap;
};
......
......@@ -55,9 +55,9 @@ static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
static bool isScrollableNode(const Node*);
FocusCandidate::FocusCandidate(Node* node, FocusType type)
: visibleNode(0)
, focusableNode(0)
, enclosingScrollableBox(0)
: visibleNode(nullptr)
, focusableNode(nullptr)
, enclosingScrollableBox(nullptr)
, distance(maxDistance())
, alignment(None)
, isOffscreen(true)
......
......@@ -98,10 +98,12 @@ enum RectsAlignment {
};
struct FocusCandidate {
STACK_ALLOCATED();
public:
FocusCandidate()
: visibleNode(0)
, focusableNode(0)
, enclosingScrollableBox(0)
: visibleNode(nullptr)
, focusableNode(nullptr)
, enclosingScrollableBox(nullptr)
, distance(maxDistance())
, alignment(None)
, isOffscreen(true)
......@@ -119,9 +121,9 @@ struct FocusCandidate {
// 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.
// In all other cases, visibleNode and focusableNode are one and the same.
Node* visibleNode;
Node* focusableNode;
Node* enclosingScrollableBox;
RawPtrWillBeMember<Node> visibleNode;
RawPtrWillBeMember<Node> focusableNode;
RawPtrWillBeMember<Node> enclosingScrollableBox;
long long distance;
RectsAlignment alignment;
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