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

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: Use PassRefPtr 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..2f7235b0c56ae4cafb0bdb99776c437c720e2514 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 = PassRefPtr<Node>(container);
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 = PassRefPtr<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