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

Unified Diff: Source/core/editing/PlainTextRange.cpp

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/editing/PlainTextRange.cpp
diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp
index 096fb6d55678e09cd7a6699000c88bd63aedc196..e67ddd7d6a842c9e8b6d7e7e3f046f1e6adcb9b4 100644
--- a/Source/core/editing/PlainTextRange.cpp
+++ b/Source/core/editing/PlainTextRange.cpp
@@ -57,26 +57,26 @@ PlainTextRange::PlainTextRange(int start, int end)
ASSERT(start <= end);
}
-PassRefPtr<Range> PlainTextRange::createRange(const ContainerNode& scope) const
+PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRange(const ContainerNode& scope) const
{
return createRangeFor(scope, ForGeneric);
}
-PassRefPtr<Range> PlainTextRange::createRangeForSelection(const ContainerNode& scope) const
+PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeForSelection(const ContainerNode& scope) const
{
return createRangeFor(scope, ForSelection);
}
-PassRefPtr<Range> PlainTextRange::createRangeFor(const ContainerNode& scope, GetRangeFor getRangeFor) const
+PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode& scope, GetRangeFor getRangeFor) const
{
ASSERT(isNotNull());
- RefPtr<Range> resultRange = scope.document().createRange();
+ RefPtrWillBeRawPtr<Range> resultRange = scope.document().createRange();
size_t docTextPosition = 0;
bool startRangeFound = false;
- RefPtr<Range> textRunRange;
+ RefPtrWillBeRawPtr<Range> textRunRange = nullptr;
TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), getRangeFor == ForSelection ? TextIteratorEmitsCharactersBetweenAllVisiblePositions : TextIteratorDefaultBehavior);
@@ -106,7 +106,7 @@ PassRefPtr<Range> PlainTextRange::createRangeFor(const ContainerNode& scope, Get
scope.document().updateLayoutIgnorePendingStylesheets();
it.advance();
if (!it.atEnd()) {
- RefPtr<Range> range = it.range();
+ RefPtrWillBeRawPtr<Range> range = it.range();
textRunRange->setEnd(range->startContainer(), range->startOffset(), ASSERT_NO_EXCEPTION);
} else {
Position runStart = textRunRange->startPosition();
@@ -171,7 +171,7 @@ PlainTextRange PlainTextRange::create(const Node& scope, const Range& range)
if (range.endContainer() != scope && !range.endContainer()->isDescendantOf(&scope))
return PlainTextRange();
- RefPtr<Range> testRange = Range::create(scope.document(), const_cast<Node*>(&scope), 0, range.startContainer(), range.startOffset());
+ RefPtrWillBeRawPtr<Range> testRange = Range::create(scope.document(), const_cast<Node*>(&scope), 0, range.startContainer(), range.startOffset());
ASSERT(testRange->startContainer() == &scope);
size_t start = TextIterator::rangeLength(testRange.get());

Powered by Google App Engine
This is Rietveld 408576698