Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Unified Diff: Source/core/html/parser/HTMLElementStack.h

Issue 298043008: [Oilpan]: Move HTMLStackItem and friends to the oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix non-oilpan build Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/parser/HTMLElementStack.h
diff --git a/Source/core/html/parser/HTMLElementStack.h b/Source/core/html/parser/HTMLElementStack.h
index e63bbbc3e7237859bebba9fd19824f8b5141a113..3dadfc20a642af51c6e7aea6ea8f7bc4936af23a 100644
--- a/Source/core/html/parser/HTMLElementStack.h
+++ b/Source/core/html/parser/HTMLElementStack.h
@@ -44,35 +44,40 @@ class QualifiedName;
// NOTE: The HTML5 spec uses a backwards (grows downward) stack. We're using
// more standard (grows upwards) stack terminology here.
class HTMLElementStack {
- WTF_MAKE_NONCOPYABLE(HTMLElementStack); WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(HTMLElementStack);
+ DISALLOW_ALLOCATION();
public:
HTMLElementStack();
~HTMLElementStack();
- class ElementRecord {
- WTF_MAKE_NONCOPYABLE(ElementRecord); WTF_MAKE_FAST_ALLOCATED;
+ class ElementRecord : public NoBaseWillBeGarbageCollected<ElementRecord> {
Mads Ager (chromium) 2014/05/27 10:32:03 add FINAL since the trace method is not virtual?
wibling-chromium 2014/05/27 10:45:46 Done.
+ WTF_MAKE_NONCOPYABLE(ElementRecord); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
+#if !ENABLE(OILPAN)
~ElementRecord(); // Public for ~PassOwnPtr()
+#endif
haraken 2014/05/27 10:48:22 You can use DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOV
wibling-chromium 2014/05/27 11:16:36 I tried it, but it doesn't work since it is a nest
Element* element() const { return m_item->element(); }
ContainerNode* node() const { return m_item->node(); }
const AtomicString& namespaceURI() const { return m_item->namespaceURI(); }
- PassRefPtr<HTMLStackItem> stackItem() const { return m_item; }
- void replaceElement(PassRefPtr<HTMLStackItem>);
+ PassRefPtrWillBeRawPtr<HTMLStackItem> stackItem() const { return m_item; }
+ void replaceElement(PassRefPtrWillBeRawPtr<HTMLStackItem>);
bool isAbove(ElementRecord*) const;
ElementRecord* next() const { return m_next.get(); }
+
+ void trace(Visitor*);
private:
friend class HTMLElementStack;
- ElementRecord(PassRefPtr<HTMLStackItem>, PassOwnPtr<ElementRecord>);
+ ElementRecord(PassRefPtrWillBeRawPtr<HTMLStackItem>, PassOwnPtrWillBeRawPtr<ElementRecord>);
- PassOwnPtr<ElementRecord> releaseNext() { return m_next.release(); }
- void setNext(PassOwnPtr<ElementRecord> next) { m_next = next; }
+ PassOwnPtrWillBeRawPtr<ElementRecord> releaseNext() { return m_next.release(); }
+ void setNext(PassOwnPtrWillBeRawPtr<ElementRecord> next) { m_next = next; }
- RefPtr<HTMLStackItem> m_item;
- OwnPtr<ElementRecord> m_next;
+ RefPtrWillBeMember<HTMLStackItem> m_item;
+ OwnPtrWillBeMember<ElementRecord> m_next;
};
unsigned stackDepth() const { return m_stackDepth; }
@@ -103,13 +108,13 @@ public:
ElementRecord* furthestBlockForFormattingElement(Element*) const;
ElementRecord* topmost(const AtomicString& tagName) const;
- void insertAbove(PassRefPtr<HTMLStackItem>, ElementRecord*);
+ void insertAbove(PassRefPtrWillBeRawPtr<HTMLStackItem>, ElementRecord*);
- void push(PassRefPtr<HTMLStackItem>);
- void pushRootNode(PassRefPtr<HTMLStackItem>);
- void pushHTMLHtmlElement(PassRefPtr<HTMLStackItem>);
- void pushHTMLHeadElement(PassRefPtr<HTMLStackItem>);
- void pushHTMLBodyElement(PassRefPtr<HTMLStackItem>);
+ void push(PassRefPtrWillBeRawPtr<HTMLStackItem>);
+ void pushRootNode(PassRefPtrWillBeRawPtr<HTMLStackItem>);
+ void pushHTMLHtmlElement(PassRefPtrWillBeRawPtr<HTMLStackItem>);
+ void pushHTMLHeadElement(PassRefPtrWillBeRawPtr<HTMLStackItem>);
+ void pushHTMLBodyElement(PassRefPtrWillBeRawPtr<HTMLStackItem>);
void pop();
void popUntil(const AtomicString& tagName);
@@ -159,17 +164,19 @@ public:
ContainerNode* rootNode() const;
+ void trace(Visitor*);
+
#ifndef NDEBUG
void show();
#endif
private:
- void pushCommon(PassRefPtr<HTMLStackItem>);
- void pushRootNodeCommon(PassRefPtr<HTMLStackItem>);
+ void pushCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>);
+ void pushRootNodeCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>);
void popCommon();
void removeNonTopCommon(Element*);
- OwnPtr<ElementRecord> m_top;
+ OwnPtrWillBeMember<ElementRecord> m_top;
// We remember the root node, <head> and <body> as they are pushed. Their
// ElementRecords keep them alive. The root node is never popped.

Powered by Google App Engine
This is Rietveld 408576698