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

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

Issue 178613003: Make Document::nodeChildrenWillBeRemoved() take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/Range.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/RangeBoundaryPoint.h
diff --git a/Source/core/dom/RangeBoundaryPoint.h b/Source/core/dom/RangeBoundaryPoint.h
index 2652ceae03ceb0949021ad0824d051cb2f12c02d..6ce9ef9f06b12d0c1558ed92c54f24840f7620a1 100644
--- a/Source/core/dom/RangeBoundaryPoint.h
+++ b/Source/core/dom/RangeBoundaryPoint.h
@@ -49,8 +49,8 @@ public:
void setOffset(int offset);
void setToBeforeChild(Node&);
- void setToStartOfNode(PassRefPtr<Node>);
- void setToEndOfNode(PassRefPtr<Node>);
+ void setToStartOfNode(Node&);
+ void setToEndOfNode(Node&);
void childBeforeWillBeRemoved();
void invalidateOffset() const;
@@ -144,18 +144,16 @@ inline void RangeBoundaryPoint::setToBeforeChild(Node& child)
m_offsetInContainer = m_childBeforeBoundary ? invalidOffset : 0;
}
-inline void RangeBoundaryPoint::setToStartOfNode(PassRefPtr<Node> container)
+inline void RangeBoundaryPoint::setToStartOfNode(Node& container)
{
- ASSERT(container);
- m_containerNode = container;
+ m_containerNode = RefPtr<Node>(container);
adamk 2014/02/24 22:15:00 Nit: shouldn't these be PassRefPtr<Node>() to avoi
Inactive 2014/02/24 22:21:08 arg, you're right :) I have just checked the RefPt
Inactive 2014/02/24 22:36:13 Done.
m_offsetInContainer = 0;
m_childBeforeBoundary = nullptr;
}
-inline void RangeBoundaryPoint::setToEndOfNode(PassRefPtr<Node> container)
+inline void RangeBoundaryPoint::setToEndOfNode(Node& container)
{
- ASSERT(container);
- m_containerNode = container;
+ m_containerNode = RefPtr<Node>(container);
if (m_containerNode->offsetInCharacters()) {
m_offsetInContainer = m_containerNode->maxCharacterOffset();
m_childBeforeBoundary = nullptr;
« no previous file with comments | « Source/core/dom/Range.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698