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

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

Issue 1335573004: Introduce Range::dispose() for prompt detachment from owner Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 4fa8b8b9c967ac96e518ae08f00915e822a667e9..0dad7073402860febc75e698ceb6fe87a146a749 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -135,6 +135,14 @@ Range::~Range()
}
#endif
+void Range::dispose()
+{
+#if ENABLE(OILPAN)
+ // A prompt detach from the owning Document helps avoid GC overhead.
+ m_ownerDocument->detachRange(this);
+#endif
+}
+
void Range::setDocument(Document& document)
{
ASSERT(m_ownerDocument != document);

Powered by Google App Engine
This is Rietveld 408576698