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

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

Issue 51273002: Have ChildFrameDisconnector / ChildListMutationScope deal with references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/Node.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 35f44dd4812903505005216ef265c9dcb7e39b39..1d7b8b49bd433e04e9d66d4d191c6853f017cea6 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -1028,9 +1028,10 @@ PassRefPtr<DocumentFragment> createContextualFragment(const String& markup, HTML
void replaceChildrenWithFragment(ContainerNode* container, PassRefPtr<DocumentFragment> fragment, ExceptionState& es)
{
+ ASSERT(container);
RefPtr<ContainerNode> containerNode(container);
- ChildListMutationScope mutation(containerNode.get());
+ ChildListMutationScope mutation(*containerNode);
if (!fragment->firstChild()) {
containerNode->removeChildren();
@@ -1053,9 +1054,10 @@ void replaceChildrenWithFragment(ContainerNode* container, PassRefPtr<DocumentFr
void replaceChildrenWithText(ContainerNode* container, const String& text, ExceptionState& es)
{
+ ASSERT(container);
RefPtr<ContainerNode> containerNode(container);
- ChildListMutationScope mutation(containerNode.get());
+ ChildListMutationScope mutation(*containerNode);
if (containerNode->hasOneTextChild()) {
toText(containerNode->firstChild())->setData(text);
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698