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

Unified Diff: Source/core/html/HTMLTextFormControlElement.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/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 0a0c83fd50aa24ac96ba60d9743a11c469c67610..d3720ac48067ebbc69cb5a9d0a45dabac693f9bf 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -42,6 +42,7 @@
#include "core/html/shadow/ShadowElementNames.h"
#include "core/rendering/RenderBlock.h"
#include "core/rendering/RenderTheme.h"
+#include "platform/heap/Handle.h"
#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -311,7 +312,7 @@ VisiblePosition HTMLTextFormControlElement::visiblePositionForIndex(int index) c
{
if (index <= 0)
return VisiblePosition(firstPositionInNode(innerTextElement()), DOWNSTREAM);
- RefPtr<Range> range = Range::create(document());
+ RefPtrWillBeRawPtr<Range> range = Range::create(document());
range->selectNodeContents(innerTextElement(), ASSERT_NO_EXCEPTION);
CharacterIterator it(range.get());
it.advance(index - 1);
@@ -324,7 +325,7 @@ int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& p
if (enclosingTextFormControl(indexPosition) != this)
return 0;
ASSERT(indexPosition.document());
- RefPtr<Range> range = Range::create(*indexPosition.document());
+ RefPtrWillBeRawPtr<Range> range = Range::create(*indexPosition.document());
range->setStart(innerTextElement(), 0, ASSERT_NO_EXCEPTION);
range->setEnd(indexPosition.containerNode(), indexPosition.offsetInContainerNode(), ASSERT_NO_EXCEPTION);
return TextIterator::rangeLength(range.get());
@@ -420,7 +421,7 @@ static inline void setContainerAndOffsetForRange(Node* node, int offset, Node*&
}
}
-PassRefPtr<Range> HTMLTextFormControlElement::selection() const
+PassRefPtrWillBeRawPtr<Range> HTMLTextFormControlElement::selection() const
{
if (!renderer() || !isTextFormControl() || !hasCachedSelection())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698