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

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

Issue 330383004: Oilpan: Introduce TempRangeScope to avoid needless Range attaches on Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments. Created 6 years, 6 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 | « no previous file | Source/core/dom/Range.h » ('j') | Source/core/dom/Range.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 98f5e3733f544847224d93f872bcc783599a4557..542d376d2dc473167b0cffcdc62db1f8ab5c43b5 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3763,6 +3763,7 @@ void Document::moveNodeIteratorsToNewDocument(Node& node, Document& newDocument)
void Document::updateRangesAfterChildrenChanged(ContainerNode* container)
{
+ ASSERT(!TemporaryRangeScope::active());
if (!m_ranges.isEmpty()) {
AttachedRangeSet::const_iterator end = m_ranges.end();
for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
@@ -3772,6 +3773,7 @@ void Document::updateRangesAfterChildrenChanged(ContainerNode* container)
void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node)
{
+ ASSERT(!TemporaryRangeScope::active());
ASSERT(node.document() != this);
if (m_ranges.isEmpty())
return;
@@ -3783,6 +3785,7 @@ void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node)
void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
{
+ ASSERT(!TemporaryRangeScope::active());
NoEventDispatchAssertion assertNoEventDispatch;
if (!m_ranges.isEmpty()) {
AttachedRangeSet::const_iterator end = m_ranges.end();
@@ -3807,6 +3810,7 @@ void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
void Document::nodeWillBeRemoved(Node& n)
{
+ ASSERT(!TemporaryRangeScope::active());
WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
for (WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it)
(*it)->nodeWillBeRemoved(n);
@@ -3826,6 +3830,7 @@ void Document::nodeWillBeRemoved(Node& n)
void Document::didInsertText(Node* text, unsigned offset, unsigned length)
{
+ ASSERT(!TemporaryRangeScope::active());
if (!m_ranges.isEmpty()) {
AttachedRangeSet::const_iterator end = m_ranges.end();
for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
@@ -3838,6 +3843,7 @@ void Document::didInsertText(Node* text, unsigned offset, unsigned length)
void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
{
+ ASSERT(!TemporaryRangeScope::active());
if (!m_ranges.isEmpty()) {
AttachedRangeSet::const_iterator end = m_ranges.end();
for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
@@ -3851,6 +3857,7 @@ void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
void Document::didMergeTextNodes(Text& oldNode, unsigned offset)
{
+ ASSERT(!TemporaryRangeScope::active());
if (!m_ranges.isEmpty()) {
NodeWithIndex oldNodeWithIndex(oldNode);
AttachedRangeSet::const_iterator end = m_ranges.end();
@@ -3866,6 +3873,7 @@ void Document::didMergeTextNodes(Text& oldNode, unsigned offset)
void Document::didSplitTextNode(Text& oldNode)
{
+ ASSERT(!TemporaryRangeScope::active());
if (!m_ranges.isEmpty()) {
AttachedRangeSet::const_iterator end = m_ranges.end();
for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
« no previous file with comments | « no previous file | Source/core/dom/Range.h » ('j') | Source/core/dom/Range.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698