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

Unified Diff: Source/core/page/DOMSelection.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/page/DOMSelection.cpp
diff --git a/Source/core/page/DOMSelection.cpp b/Source/core/page/DOMSelection.cpp
index 168e903ac45d74eb8aa1f16d32b64e19a2305eaf..3b735783bd123f59c226d463c4d90302577334af 100644
--- a/Source/core/page/DOMSelection.cpp
+++ b/Source/core/page/DOMSelection.cpp
@@ -349,7 +349,7 @@ void DOMSelection::extend(Node* node, int offset, ExceptionState& exceptionState
m_frame->selection().setExtent(VisiblePosition(createLegacyEditingPosition(node, offset), DOWNSTREAM));
}
-PassRefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Range> DOMSelection::getRangeAt(int index, ExceptionState& exceptionState)
{
if (!m_frame)
return nullptr;
@@ -402,7 +402,7 @@ void DOMSelection::addRange(Range* newRange)
return;
}
- RefPtr<Range> originalRange = selection.firstRange();
+ RefPtrWillBeRawPtr<Range> originalRange = selection.firstRange();
if (originalRange->startContainer()->document() != newRange->startContainer()->document()) {
addConsoleError("The given range does not belong to the current selection's document.");
@@ -426,7 +426,7 @@ void DOMSelection::addRange(Range* newRange)
Range* start = originalRange->compareBoundaryPoints(Range::START_TO_START, newRange, ASSERT_NO_EXCEPTION) < 0 ? originalRange.get() : newRange;
Range* end = originalRange->compareBoundaryPoints(Range::END_TO_END, newRange, ASSERT_NO_EXCEPTION) < 0 ? newRange : originalRange.get();
- RefPtr<Range> merged = Range::create(originalRange->startContainer()->document(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset());
+ RefPtrWillBeRawPtr<Range> merged = Range::create(originalRange->startContainer()->document(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset());
EAffinity affinity = selection.selection().affinity();
selection.setSelectedRange(merged.get(), affinity);
}
@@ -444,7 +444,7 @@ void DOMSelection::deleteFromDocument()
if (isCollapsed())
selection.modify(FrameSelection::AlterationExtend, DirectionBackward, CharacterGranularity);
- RefPtr<Range> selectedRange = selection.selection().toNormalizedRange();
+ RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalizedRange();
if (!selectedRange)
return;
@@ -464,7 +464,7 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const
return false;
unsigned nodeIndex = n->nodeIndex();
- RefPtr<Range> selectedRange = selection.selection().toNormalizedRange();
+ RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalizedRange();
ContainerNode* parentNode = n->parentNode();
if (!parentNode)

Powered by Google App Engine
This is Rietveld 408576698