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

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

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase 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/ProcessingInstruction.cpp ('k') | Source/core/dom/RangeBoundaryPoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 06b017b28ef5b945e0c6802df5d6c88213d72fe5..4dd65c2a27be40295815e54b7a2700eaa0be0ed0 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -677,11 +677,11 @@ PassRefPtr<DocumentFragment> Range::processContents(ActionType action, Exception
if (collapsed(exceptionState))
return fragment.release();
if (exceptionState.hadException())
- return 0;
+ return nullptr;
RefPtr<Node> commonRoot = commonAncestorContainer(exceptionState);
if (exceptionState.hadException())
- return 0;
+ return nullptr;
ASSERT(commonRoot);
if (m_start.container() == m_end.container()) {
@@ -719,13 +719,13 @@ PassRefPtr<DocumentFragment> Range::processContents(ActionType action, Exception
RefPtr<Node> leftContents;
if (originalStart.container() != commonRoot && commonRoot->contains(originalStart.container())) {
- leftContents = processContentsBetweenOffsets(action, 0, originalStart.container(), originalStart.offset(), lengthOfContentsInNode(originalStart.container()), exceptionState);
+ leftContents = processContentsBetweenOffsets(action, nullptr, originalStart.container(), originalStart.offset(), lengthOfContentsInNode(originalStart.container()), exceptionState);
leftContents = processAncestorsAndTheirSiblings(action, originalStart.container(), ProcessContentsForward, leftContents, commonRoot.get(), exceptionState);
}
RefPtr<Node> rightContents;
if (m_end.container() != commonRoot && commonRoot->contains(originalEnd.container())) {
- rightContents = processContentsBetweenOffsets(action, 0, originalEnd.container(), 0, originalEnd.offset(), exceptionState);
+ rightContents = processContentsBetweenOffsets(action, nullptr, originalEnd.container(), 0, originalEnd.offset(), exceptionState);
rightContents = processAncestorsAndTheirSiblings(action, originalEnd.container(), ProcessContentsBackward, rightContents, commonRoot.get(), exceptionState);
}
@@ -747,7 +747,7 @@ PassRefPtr<DocumentFragment> Range::processContents(ActionType action, Exception
setStart(partialEnd->parentNode(), partialEnd->nodeIndex(), exceptionState);
}
if (exceptionState.hadException())
- return 0;
+ return nullptr;
m_end = m_start;
}
@@ -927,7 +927,7 @@ PassRefPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionSta
{
checkDeleteExtract(exceptionState);
if (exceptionState.hadException())
- return 0;
+ return nullptr;
return processContents(EXTRACT_CONTENTS, exceptionState);
}
@@ -936,7 +936,7 @@ PassRefPtr<DocumentFragment> Range::cloneContents(ExceptionState& exceptionState
{
if (!m_start.container()) {
exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
- return 0;
+ return nullptr;
}
return processContents(CLONE_CONTENTS, exceptionState);
@@ -1098,18 +1098,18 @@ PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& marku
{
if (!m_start.container()) {
exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
- return 0;
+ return nullptr;
}
Node* element = m_start.container()->isElementNode() ? m_start.container() : m_start.container()->parentNode();
if (!element || !element->isHTMLElement()) {
exceptionState.throwDOMException(NotSupportedError, "The range's container must be an HTML element.");
- return 0;
+ return nullptr;
}
RefPtr<DocumentFragment> fragment = WebCore::createContextualFragment(markup, toHTMLElement(element), AllowScriptingContentAndDoNotMarkAlreadyStarted, exceptionState);
if (!fragment)
- return 0;
+ return nullptr;
return fragment.release();
}
@@ -1221,7 +1221,7 @@ PassRefPtr<Range> Range::cloneRange(ExceptionState& exceptionState) const
{
if (!m_start.container()) {
exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
- return 0;
+ return nullptr;
}
return Range::create(*m_ownerDocument.get(), m_start.container(), m_start.offset(), m_end.container(), m_end.offset());
« no previous file with comments | « Source/core/dom/ProcessingInstruction.cpp ('k') | Source/core/dom/RangeBoundaryPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698