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

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

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + add WillBeGarbageCollected FIXME. Created 6 years, 7 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.h ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('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 fbf64abae9b70ba8f470716712883a26842337cb..c0271b807b7cfba6b696789b1ed73c8b1f61b57a 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -565,11 +565,11 @@ static inline unsigned lengthOfContentsInNode(Node* node)
return 0;
}
-PassRefPtr<DocumentFragment> Range::processContents(ActionType action, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<DocumentFragment> Range::processContents(ActionType action, ExceptionState& exceptionState)
{
typedef Vector<RefPtr<Node> > NodeVector;
- RefPtr<DocumentFragment> fragment;
+ RefPtrWillBeRawPtr<DocumentFragment> fragment = nullptr;
if (action == EXTRACT_CONTENTS || action == CLONE_CONTENTS)
fragment = DocumentFragment::create(*m_ownerDocument.get());
@@ -676,7 +676,7 @@ static inline void deleteCharacterData(PassRefPtrWillBeRawPtr<CharacterData> dat
data->deleteData(0, startOffset, exceptionState);
}
-PassRefPtr<Node> Range::processContentsBetweenOffsets(ActionType action, PassRefPtr<DocumentFragment> fragment,
+PassRefPtr<Node> Range::processContentsBetweenOffsets(ActionType action, PassRefPtrWillBeRawPtr<DocumentFragment> fragment,
Node* container, unsigned startOffset, unsigned endOffset, ExceptionState& exceptionState)
{
ASSERT(container);
@@ -821,7 +821,7 @@ PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node
return clonedContainer.release();
}
-PassRefPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionState)
{
checkDeleteExtract(exceptionState);
if (exceptionState.hadException())
@@ -830,7 +830,7 @@ PassRefPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionSta
return processContents(EXTRACT_CONTENTS, exceptionState);
}
-PassRefPtr<DocumentFragment> Range::cloneContents(ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<DocumentFragment> Range::cloneContents(ExceptionState& exceptionState)
{
return processContents(CLONE_CONTENTS, exceptionState);
}
@@ -974,7 +974,7 @@ String Range::text() const
return plainText(this);
}
-PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& markup, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<DocumentFragment> Range::createContextualFragment(const String& markup, ExceptionState& exceptionState)
{
Node* element = m_start.container()->isElementNode() ? m_start.container() : m_start.container()->parentNode();
if (!element || !element->isHTMLElement()) {
@@ -982,7 +982,7 @@ PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& marku
return nullptr;
}
- RefPtr<DocumentFragment> fragment = WebCore::createContextualFragment(markup, toHTMLElement(element), AllowScriptingContentAndDoNotMarkAlreadyStarted, exceptionState);
+ RefPtrWillBeRawPtr<DocumentFragment> fragment = WebCore::createContextualFragment(markup, toHTMLElement(element), AllowScriptingContentAndDoNotMarkAlreadyStarted, exceptionState);
if (!fragment)
return nullptr;
@@ -1266,7 +1266,7 @@ void Range::surroundContents(PassRefPtr<Node> passNewParent, ExceptionState& exc
if (exceptionState.hadException())
return;
}
- RefPtr<DocumentFragment> fragment = extractContents(exceptionState);
+ RefPtrWillBeRawPtr<DocumentFragment> fragment = extractContents(exceptionState);
if (exceptionState.hadException())
return;
insertNode(newParent, exceptionState);
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698