Commit 31378e15 authored by tkent@chromium.org's avatar tkent@chromium.org

Oilpan: Remove RefPtrs to Node and its subclasses in core/inspector/ with Oilpan transition types.

InspectorDOMAgent::m_documentNodeToIdMap needs to be switched from a part object
to OwnPtr/Persistent because we have some addres comparisons of
NodeToIdMap(HeapHashMap) and we have no ways to get a HeapHashMap pointer from a
PersistentHeapHashMap.

BUG=357163

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175662 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6c58a4b5
...@@ -75,15 +75,15 @@ public: ...@@ -75,15 +75,15 @@ public:
} }
private: private:
RefPtr<Node> m_parentNode; RefPtrWillBePersistent<Node> m_parentNode;
RefPtr<Node> m_node; RefPtrWillBePersistent<Node> m_node;
RefPtr<Node> m_anchorNode; RefPtrWillBePersistent<Node> m_anchorNode;
}; };
class DOMEditor::InsertBeforeAction FINAL : public InspectorHistory::Action { class DOMEditor::InsertBeforeAction FINAL : public InspectorHistory::Action {
WTF_MAKE_NONCOPYABLE(InsertBeforeAction); WTF_MAKE_NONCOPYABLE(InsertBeforeAction);
public: public:
InsertBeforeAction(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode) InsertBeforeAction(Node* parentNode, PassRefPtrWillBeRawPtr<Node> node, Node* anchorNode)
: InspectorHistory::Action("InsertBefore") : InspectorHistory::Action("InsertBefore")
, m_parentNode(parentNode) , m_parentNode(parentNode)
, m_node(node) , m_node(node)
...@@ -121,9 +121,9 @@ public: ...@@ -121,9 +121,9 @@ public:
} }
private: private:
RefPtr<Node> m_parentNode; RefPtrWillBePersistent<Node> m_parentNode;
RefPtr<Node> m_node; RefPtrWillBePersistent<Node> m_node;
RefPtr<Node> m_anchorNode; RefPtrWillBePersistent<Node> m_anchorNode;
RefPtr<RemoveChildAction> m_removeChildAction; RefPtr<RemoveChildAction> m_removeChildAction;
}; };
...@@ -156,7 +156,7 @@ public: ...@@ -156,7 +156,7 @@ public:
} }
private: private:
RefPtr<Element> m_element; RefPtrWillBePersistent<Element> m_element;
AtomicString m_name; AtomicString m_name;
AtomicString m_value; AtomicString m_value;
}; };
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
} }
private: private:
RefPtr<Element> m_element; RefPtrWillBePersistent<Element> m_element;
AtomicString m_name; AtomicString m_name;
AtomicString m_value; AtomicString m_value;
bool m_hadAttribute; bool m_hadAttribute;
...@@ -244,8 +244,8 @@ public: ...@@ -244,8 +244,8 @@ public:
} }
private: private:
RefPtr<Node> m_node; RefPtrWillBePersistent<Node> m_node;
RefPtr<Node> m_nextSibling; RefPtrWillBePersistent<Node> m_nextSibling;
String m_html; String m_html;
String m_oldHTML; String m_oldHTML;
Node* m_newNode; Node* m_newNode;
...@@ -290,7 +290,7 @@ private: ...@@ -290,7 +290,7 @@ private:
class DOMEditor::ReplaceChildNodeAction FINAL : public InspectorHistory::Action { class DOMEditor::ReplaceChildNodeAction FINAL : public InspectorHistory::Action {
WTF_MAKE_NONCOPYABLE(ReplaceChildNodeAction); WTF_MAKE_NONCOPYABLE(ReplaceChildNodeAction);
public: public:
ReplaceChildNodeAction(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode) ReplaceChildNodeAction(Node* parentNode, PassRefPtrWillBeRawPtr<Node> newNode, Node* oldNode)
: InspectorHistory::Action("ReplaceChildNode") : InspectorHistory::Action("ReplaceChildNode")
, m_parentNode(parentNode) , m_parentNode(parentNode)
, m_newNode(newNode) , m_newNode(newNode)
...@@ -320,9 +320,9 @@ public: ...@@ -320,9 +320,9 @@ public:
} }
private: private:
RefPtr<Node> m_parentNode; RefPtrWillBePersistent<Node> m_parentNode;
RefPtr<Node> m_newNode; RefPtrWillBePersistent<Node> m_newNode;
RefPtr<Node> m_oldNode; RefPtrWillBePersistent<Node> m_oldNode;
}; };
class DOMEditor::SetNodeValueAction FINAL : public InspectorHistory::Action { class DOMEditor::SetNodeValueAction FINAL : public InspectorHistory::Action {
...@@ -354,7 +354,7 @@ public: ...@@ -354,7 +354,7 @@ public:
} }
private: private:
RefPtr<Node> m_node; RefPtrWillBePersistent<Node> m_node;
String m_value; String m_value;
String m_oldValue; String m_oldValue;
}; };
...@@ -363,7 +363,7 @@ DOMEditor::DOMEditor(InspectorHistory* history) : m_history(history) { } ...@@ -363,7 +363,7 @@ DOMEditor::DOMEditor(InspectorHistory* history) : m_history(history) { }
DOMEditor::~DOMEditor() { } DOMEditor::~DOMEditor() { }
bool DOMEditor::insertBefore(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode, ExceptionState& exceptionState) bool DOMEditor::insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node> node, Node* anchorNode, ExceptionState& exceptionState)
{ {
return m_history->perform(adoptRef(new InsertBeforeAction(parentNode, node, anchorNode)), exceptionState); return m_history->perform(adoptRef(new InsertBeforeAction(parentNode, node, anchorNode)), exceptionState);
} }
...@@ -397,7 +397,7 @@ bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ExceptionSt ...@@ -397,7 +397,7 @@ bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ExceptionSt
return m_history->perform(adoptRef(new ReplaceWholeTextAction(textNode, text)), exceptionState); return m_history->perform(adoptRef(new ReplaceWholeTextAction(textNode, text)), exceptionState);
} }
bool DOMEditor::replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionState& exceptionState) bool DOMEditor::replaceChild(Node* parentNode, PassRefPtrWillBeRawPtr<Node> newNode, Node* oldNode, ExceptionState& exceptionState)
{ {
return m_history->perform(adoptRef(new ReplaceChildNodeAction(parentNode, newNode, oldNode)), exceptionState); return m_history->perform(adoptRef(new ReplaceChildNodeAction(parentNode, newNode, oldNode)), exceptionState);
} }
...@@ -413,7 +413,7 @@ static void populateErrorString(ExceptionState& exceptionState, ErrorString* err ...@@ -413,7 +413,7 @@ static void populateErrorString(ExceptionState& exceptionState, ErrorString* err
*errorString = DOMException::getErrorName(exceptionState.code()); *errorString = DOMException::getErrorName(exceptionState.code());
} }
bool DOMEditor::insertBefore(Node* parentNode, PassRefPtr<Node> node, Node* anchorNode, ErrorString* errorString) bool DOMEditor::insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node> node, Node* anchorNode, ErrorString* errorString)
{ {
TrackExceptionState exceptionState; TrackExceptionState exceptionState;
bool result = insertBefore(parentNode, node, anchorNode, exceptionState); bool result = insertBefore(parentNode, node, anchorNode, exceptionState);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#ifndef DOMEditor_h #ifndef DOMEditor_h
#define DOMEditor_h #define DOMEditor_h
#include "platform/heap/Handle.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace WebCore { namespace WebCore {
...@@ -49,16 +50,16 @@ public: ...@@ -49,16 +50,16 @@ public:
explicit DOMEditor(InspectorHistory*); explicit DOMEditor(InspectorHistory*);
~DOMEditor(); ~DOMEditor();
bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ExceptionState&); bool insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node>, Node* anchorNode, ExceptionState&);
bool removeChild(Node* parentNode, Node*, ExceptionState&); bool removeChild(Node* parentNode, Node*, ExceptionState&);
bool setAttribute(Element*, const String& name, const String& value, ExceptionState&); bool setAttribute(Element*, const String& name, const String& value, ExceptionState&);
bool removeAttribute(Element*, const String& name, ExceptionState&); bool removeAttribute(Element*, const String& name, ExceptionState&);
bool setOuterHTML(Node*, const String& html, Node** newNode, ExceptionState&); bool setOuterHTML(Node*, const String& html, Node** newNode, ExceptionState&);
bool replaceWholeText(Text*, const String& text, ExceptionState&); bool replaceWholeText(Text*, const String& text, ExceptionState&);
bool replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionState&); bool replaceChild(Node* parentNode, PassRefPtrWillBeRawPtr<Node> newNode, Node* oldNode, ExceptionState&);
bool setNodeValue(Node* parentNode, const String& value, ExceptionState&); bool setNodeValue(Node* parentNode, const String& value, ExceptionState&);
bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ErrorString*); bool insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node>, Node* anchorNode, ErrorString*);
bool removeChild(Node* parentNode, Node*, ErrorString*); bool removeChild(Node* parentNode, Node*, ErrorString*);
bool setAttribute(Element*, const String& name, const String& value, ErrorString*); bool setAttribute(Element*, const String& name, const String& value, ErrorString*);
bool removeAttribute(Element*, const String& name, ErrorString*); bool removeAttribute(Element*, const String& name, ErrorString*);
......
...@@ -207,7 +207,7 @@ private: ...@@ -207,7 +207,7 @@ private:
HashSet<Document*> m_invalidatedDocuments; HashSet<Document*> m_invalidatedDocuments;
NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet; NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet;
HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > m_documentToViaInspectorStyleSheet; // "via inspector" stylesheets WillBePersistentHeapHashMap<RefPtrWillBeMember<Document>, RefPtr<InspectorStyleSheet> > m_documentToViaInspectorStyleSheet; // "via inspector" stylesheets
NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
RefPtrWillBePersistent<CSSStyleSheet> m_inspectorUserAgentStyleSheet; RefPtrWillBePersistent<CSSStyleSheet> m_inspectorUserAgentStyleSheet;
......
...@@ -176,7 +176,7 @@ public: ...@@ -176,7 +176,7 @@ public:
void willModifyDOMAttr(Element*, const AtomicString& oldValue, const AtomicString& newValue); void willModifyDOMAttr(Element*, const AtomicString& oldValue, const AtomicString& newValue);
void didModifyDOMAttr(Element*, const AtomicString& name, const AtomicString& value); void didModifyDOMAttr(Element*, const AtomicString& name, const AtomicString& value);
void didRemoveDOMAttr(Element*, const AtomicString& name); void didRemoveDOMAttr(Element*, const AtomicString& name);
void styleAttributeInvalidated(const Vector<Element*>& elements); void styleAttributeInvalidated(const WillBeHeapVector<RawPtrWillBeMember<Element> >& elements);
void characterDataModified(CharacterData*); void characterDataModified(CharacterData*);
void didInvalidateStyleAttr(Node*); void didInvalidateStyleAttr(Node*);
void didPushShadowRoot(Element* host, ShadowRoot*); void didPushShadowRoot(Element* host, ShadowRoot*);
...@@ -221,7 +221,7 @@ private: ...@@ -221,7 +221,7 @@ private:
PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, JSONObject* highlightInspectorObject); PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, JSONObject* highlightInspectorObject);
// Node-related methods. // Node-related methods.
typedef HashMap<RefPtr<Node>, int> NodeToIdMap; typedef WillBeHeapHashMap<RefPtrWillBeMember<Node>, int> NodeToIdMap;
int bind(Node*, NodeToIdMap*); int bind(Node*, NodeToIdMap*);
void unbind(Node*, NodeToIdMap*); void unbind(Node*, NodeToIdMap*);
...@@ -258,16 +258,16 @@ private: ...@@ -258,16 +258,16 @@ private:
InspectorOverlay* m_overlay; InspectorOverlay* m_overlay;
InspectorFrontend::DOM* m_frontend; InspectorFrontend::DOM* m_frontend;
DOMListener* m_domListener; DOMListener* m_domListener;
NodeToIdMap m_documentNodeToIdMap; OwnPtrWillBePersistent<NodeToIdMap> m_documentNodeToIdMap;
// Owns node mappings for dangling nodes. // Owns node mappings for dangling nodes.
Vector<OwnPtr<NodeToIdMap> > m_danglingNodeToIdMaps; WillBePersistentHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps;
HashMap<int, Node*> m_idToNode; WillBePersistentHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode;
HashMap<int, NodeToIdMap*> m_idToNodesMap; WillBePersistentHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap;
HashSet<int> m_childrenRequested; HashSet<int> m_childrenRequested;
HashMap<int, int> m_cachedChildCount; HashMap<int, int> m_cachedChildCount;
int m_lastNodeId; int m_lastNodeId;
RefPtr<Document> m_document; RefPtrWillBePersistent<Document> m_document;
typedef HashMap<String, Vector<RefPtr<Node> > > SearchResults; typedef WillBePersistentHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMember<Node> > > SearchResults;
SearchResults m_searchResults; SearchResults m_searchResults;
OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
SearchMode m_searchingForNode; SearchMode m_searchingForNode;
......
...@@ -167,8 +167,8 @@ private: ...@@ -167,8 +167,8 @@ private:
InspectorClient* m_client; InspectorClient* m_client;
String m_pausedInDebuggerMessage; String m_pausedInDebuggerMessage;
bool m_inspectModeEnabled; bool m_inspectModeEnabled;
RefPtr<Node> m_highlightNode; RefPtrWillBePersistent<Node> m_highlightNode;
RefPtr<Node> m_eventTargetNode; RefPtrWillBePersistent<Node> m_eventTargetNode;
HighlightConfig m_nodeHighlightConfig; HighlightConfig m_nodeHighlightConfig;
OwnPtr<FloatQuad> m_highlightQuad; OwnPtr<FloatQuad> m_highlightQuad;
OwnPtrWillBePersistent<Page> m_overlayPage; OwnPtrWillBePersistent<Page> m_overlayPage;
......
...@@ -1547,12 +1547,12 @@ bool InspectorStyleSheet::inlineStyleSheetText(String* result) const ...@@ -1547,12 +1547,12 @@ bool InspectorStyleSheet::inlineStyleSheetText(String* result) const
return true; return true;
} }
PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle::create(const String& id, PassRefPtr<Element> element, Listener* listener) PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle::create(const String& id, PassRefPtrWillBeRawPtr<Element> element, Listener* listener)
{ {
return adoptRef(new InspectorStyleSheetForInlineStyle(id, element, listener)); return adoptRef(new InspectorStyleSheetForInlineStyle(id, element, listener));
} }
InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(const String& id, PassRefPtr<Element> element, Listener* listener) InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(const String& id, PassRefPtrWillBeRawPtr<Element> element, Listener* listener)
: InspectorStyleSheetBase(id, listener) : InspectorStyleSheetBase(id, listener)
, m_element(element) , m_element(element)
, m_ruleSourceData(nullptr) , m_ruleSourceData(nullptr)
......
...@@ -261,7 +261,7 @@ private: ...@@ -261,7 +261,7 @@ private:
class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase { class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase {
public: public:
static PassRefPtr<InspectorStyleSheetForInlineStyle> create(const String& id, PassRefPtr<Element>, Listener*); static PassRefPtr<InspectorStyleSheetForInlineStyle> create(const String& id, PassRefPtrWillBeRawPtr<Element>, Listener*);
void didModifyElementAttribute(); void didModifyElementAttribute();
virtual Document* ownerDocument() const OVERRIDE; virtual Document* ownerDocument() const OVERRIDE;
...@@ -281,12 +281,12 @@ protected: ...@@ -281,12 +281,12 @@ protected:
virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned ruleIndex) const OVERRIDE { ASSERT_UNUSED(ruleIndex, !ruleIndex); return m_ruleSourceData; } virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned ruleIndex) const OVERRIDE { ASSERT_UNUSED(ruleIndex, !ruleIndex); return m_ruleSourceData; }
private: private:
InspectorStyleSheetForInlineStyle(const String& id, PassRefPtr<Element>, Listener*); InspectorStyleSheetForInlineStyle(const String& id, PassRefPtrWillBeRawPtr<Element>, Listener*);
CSSStyleDeclaration* inlineStyle() const; CSSStyleDeclaration* inlineStyle() const;
const String& elementStyleText() const; const String& elementStyleText() const;
PassRefPtrWillBeRawPtr<CSSRuleSourceData> getStyleAttributeData() const; PassRefPtrWillBeRawPtr<CSSRuleSourceData> getStyleAttributeData() const;
RefPtr<Element> m_element; RefPtrWillBePersistent<Element> m_element;
RefPtrWillBePersistent<CSSRuleSourceData> m_ruleSourceData; RefPtrWillBePersistent<CSSRuleSourceData> m_ruleSourceData;
RefPtr<InspectorStyle> m_inspectorStyle; RefPtr<InspectorStyle> m_inspectorStyle;
......
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