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

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

Issue 23467007: Have Range constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.h
diff --git a/Source/core/dom/Range.h b/Source/core/dom/Range.h
index 6b9541b1650eeea55dcb65d9ab79e6767da7402b..736b7a8066c3d9a187cbfb794f4839e22f13f1b8 100644
--- a/Source/core/dom/Range.h
+++ b/Source/core/dom/Range.h
@@ -49,12 +49,12 @@ class Text;
class Range : public RefCounted<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 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&);
~Range();
- Document* ownerDocument() const { return m_ownerDocument.get(); }
+ Document& ownerDocument() const { ASSERT(m_ownerDocument); return *m_ownerDocument.get(); }
Node* startContainer() const { return m_start.container(); }
int startOffset() const { return m_start.offset(); }
Node* endContainer() const { return m_end.container(); }
@@ -150,10 +150,10 @@ public:
#endif
private:
- explicit Range(Document*);
- Range(Document*, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
+ explicit Range(Document&);
+ Range(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
- void setDocument(Document*);
+ void setDocument(Document&);
Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const;
void checkNodeBA(Node*, ExceptionState&, const char* methodName) const;
@@ -168,7 +168,7 @@ private:
enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackward };
static PassRefPtr<Node> processAncestorsAndTheirSiblings(ActionType, Node* container, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* commonRoot, ExceptionState&);
- RefPtr<Document> m_ownerDocument;
+ RefPtr<Document> m_ownerDocument; // Cannot be null.
do-not-use 2013/09/03 15:43:22 BTW, a Reference-flavoured smart pointer class wou
RangeBoundaryPoint m_start;
RangeBoundaryPoint m_end;
};
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698