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

Unified Diff: Source/core/dom/Range.h

Issue 224113002: Oilpan: move Range object to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use STACK_ALLOCATED() + incorporate ager's overview of macros in this area. Created 6 years, 9 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/dom/Range.h
diff --git a/Source/core/dom/Range.h b/Source/core/dom/Range.h
index 6f50ba56d892695ba5b801fffd5142e75e651917..edbaf83d8517702029f893cbac06df3f07af3442 100644
--- a/Source/core/dom/Range.h
+++ b/Source/core/dom/Range.h
@@ -30,6 +30,7 @@
#include "core/dom/RangeBoundaryPoint.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntRect.h"
+#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
@@ -47,11 +48,11 @@ class Node;
class NodeWithIndex;
class Text;
-class Range : public RefCounted<Range>, public ScriptWrappable {
+class Range FINAL : public RefCountedWillBeGarbageCollectedFinalized<Range>, public ScriptWrappable {
public:
- static PassRefPtr<Range> create(Document&);
- static PassRefPtr<Range> create(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
- static PassRefPtr<Range> create(Document&, const Position&, const Position&);
+ static PassRefPtrWillBeRawPtr<Range> create(Document&);
+ static PassRefPtrWillBeRawPtr<Range> create(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
+ static PassRefPtrWillBeRawPtr<Range> create(Document&, const Position&, const Position&);
~Range();
Document& ownerDocument() const { ASSERT(m_ownerDocument); return *m_ownerDocument.get(); }
@@ -93,7 +94,7 @@ public:
PassRefPtr<DocumentFragment> createContextualFragment(const String& html, ExceptionState&);
void detach(ExceptionState&);
- PassRefPtr<Range> cloneRange(ExceptionState&) const;
+ PassRefPtrWillBeRawPtr<Range> cloneRange(ExceptionState&) const;
void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
@@ -149,6 +150,8 @@ public:
void formatForDebugger(char* buffer, unsigned length) const;
#endif
+ void trace(Visitor*);
+
private:
explicit Range(Document&);
Range(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
@@ -173,7 +176,7 @@ private:
RangeBoundaryPoint m_end;
};
-PassRefPtr<Range> rangeOfContents(Node*);
+PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*);
bool areRangesEqual(const Range*, const Range*);

Powered by Google App Engine
This is Rietveld 408576698