Title: [119814] trunk/Source/WebCore
Revision
119814
Author
[email protected]
Date
2012-06-08 02:19:39 -0700 (Fri, 08 Jun 2012)

Log Message

REGRESSION r119802: Remove unnecessary ASSERT(!m_deletionHasBegun) from Document.h
https://bugs.webkit.org/show_bug.cgi?id=88528

Reviewed by Ryosuke Niwa.

m_deletionHasBegun should become true just before 'delete this'.

No tests. No change in behavior.

* dom/Document.h:
(WebCore::Document::guardRef):
(WebCore::Document::guardDeref):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (119813 => 119814)


--- trunk/Source/WebCore/ChangeLog	2012-06-08 09:09:23 UTC (rev 119813)
+++ trunk/Source/WebCore/ChangeLog	2012-06-08 09:19:39 UTC (rev 119814)
@@ -1,3 +1,18 @@
+2012-06-08  Kentaro Hara  <[email protected]>
+
+        REGRESSION r119802: Remove unnecessary ASSERT(!m_deletionHasBegun) from Document.h
+        https://bugs.webkit.org/show_bug.cgi?id=88528
+
+        Reviewed by Ryosuke Niwa.
+
+        m_deletionHasBegun should become true just before 'delete this'.
+
+        No tests. No change in behavior.
+
+        * dom/Document.h:
+        (WebCore::Document::guardRef):
+        (WebCore::Document::guardDeref):
+
 2012-06-08  Adam Barth  <[email protected]>
 
         HTTP 204 No Content responses shouldn't trigger MIME type warnings in the web inspector

Modified: trunk/Source/WebCore/dom/Document.cpp (119813 => 119814)


--- trunk/Source/WebCore/dom/Document.cpp	2012-06-08 09:09:23 UTC (rev 119813)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-06-08 09:19:39 UTC (rev 119814)
@@ -641,6 +641,7 @@
 
 void Document::removedLastRef()
 {
+    ASSERT(!m_deletionHasBegun);
     if (m_guardRefCount) {
         // If removing a child removes the last self-only ref, we don't
         // want the scope to be destructed until after
@@ -685,6 +686,9 @@
 
         guardDeref();
     } else {
+#ifndef NDEBUG 
+        m_deletionHasBegun = true; 
+#endif 
         delete this;
     }
 }

Modified: trunk/Source/WebCore/dom/Node.h (119813 => 119814)


--- trunk/Source/WebCore/dom/Node.h	2012-06-08 09:09:23 UTC (rev 119813)
+++ trunk/Source/WebCore/dom/Node.h	2012-06-08 09:19:39 UTC (rev 119814)
@@ -146,7 +146,13 @@
     static StyleChange diff(const RenderStyle*, const RenderStyle*, Document*);
 
     virtual ~Node();
-    virtual void removedLastRef() { delete this; }
+    virtual void removedLastRef()
+    {
+#ifndef NDEBUG
+        m_deletionHasBegun = true;
+#endif
+        delete this;
+    }
 
     // DOM methods & attributes for Node
 

Modified: trunk/Source/WebCore/platform/TreeShared.h (119813 => 119814)


--- trunk/Source/WebCore/platform/TreeShared.h	2012-06-08 09:09:23 UTC (rev 119813)
+++ trunk/Source/WebCore/platform/TreeShared.h	2012-06-08 09:19:39 UTC (rev 119814)
@@ -89,7 +89,6 @@
         if (--m_refCount <= 0 && !m_parent) {
 #ifndef NDEBUG
             m_inRemovedLastRefFunction = true;
-            m_deletionHasBegun = true;
 #endif
             callRemovedLastRef(this);
         }

Modified: trunk/Source/WebCore/svg/SVGElementInstance.h (119813 => 119814)


--- trunk/Source/WebCore/svg/SVGElementInstance.h	2012-06-08 09:09:23 UTC (rev 119813)
+++ trunk/Source/WebCore/svg/SVGElementInstance.h	2012-06-08 09:19:39 UTC (rev 119814)
@@ -47,7 +47,13 @@
     }
 
     virtual ~SVGElementInstance();
-    virtual void removedLastRef() { delete this; };
+    virtual void removedLastRef()
+    {
+#ifndef NDEBUG
+        m_deletionHasBegun = true;
+#endif
+        delete this;
+    };
 
     void setParentOrHostNode(SVGElementInstance* instance) { setParent(instance); }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to