Title: [158343] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (158342 => 158343)


--- trunk/Source/WebCore/ChangeLog	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/ChangeLog	2013-10-31 04:15:24 UTC (rev 158343)
@@ -1,3 +1,13 @@
+2013-10-30  Andreas Kling  <akl...@apple.com>
+
+        Replace InlineBox::destroy() with regular virtual destruction.
+        <https://webkit.org/b/123550>
+
+        Move logic out of destroy() and its overloads into good ol' virtual
+        destructors instead.
+
+        Reviewed by Anders Carlsson.
+
 2013-10-30  Thiago de Barros Lacerda  <thiago.lace...@openbossa.org>
 
         Simplifying MediaStream and MediStreamDescriptor creation

Modified: trunk/Source/WebCore/rendering/InlineBox.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/InlineBox.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/InlineBox.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -66,11 +66,6 @@
         parent()->removeChild(this);
 }
 
-void InlineBox::destroy()
-{
-    delete this;
-}
-
 #ifndef NDEBUG
 const char* InlineBox::boxName() const
 {
@@ -170,7 +165,7 @@
         else if (renderer().isLineBreak())
             toRenderLineBreak(renderer()).setInlineBoxWrapper(0);
     }
-    destroy();
+    delete this;
 }
 
 void InlineBox::extractLine()

Modified: trunk/Source/WebCore/rendering/InlineBox.h (158342 => 158343)


--- trunk/Source/WebCore/rendering/InlineBox.h	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/InlineBox.h	2013-10-31 04:15:24 UTC (rev 158343)
@@ -63,8 +63,6 @@
 
     virtual ~InlineBox();
 
-    virtual void destroy();
-
     virtual void deleteLine();
     virtual void extractLine();
     virtual void attachLine();

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -221,7 +221,7 @@
 #endif
 
     removeLineBoxFromRenderObject();
-    destroy();
+    delete this;
 }
 
 void InlineFlowBox::removeLineBoxFromRenderObject()

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -67,11 +67,10 @@
 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap;
 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
 
-void InlineTextBox::destroy()
+InlineTextBox::~InlineTextBox()
 {
     if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
         gTextBoxesWithOverflow->remove(this);
-    InlineBox::destroy();
 }
 
 void InlineTextBox::markDirty(bool dirty)
@@ -245,7 +244,7 @@
 void InlineTextBox::deleteLine()
 {
     renderer().removeTextBox(*this);
-    destroy();
+    delete this;
 }
 
 void InlineTextBox::extractLine()

Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (158342 => 158343)


--- trunk/Source/WebCore/rendering/InlineTextBox.h	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h	2013-10-31 04:15:24 UTC (rev 158343)
@@ -54,11 +54,11 @@
         setBehavesLikeText(true);
     }
 
+    virtual ~InlineTextBox();
+
     RenderText& renderer() const { return toRenderText(InlineBox::renderer()); }
     const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
 
-    virtual void destroy() OVERRIDE FINAL;
-
     InlineTextBox* prevTextBox() const { return m_prevTextBox; }
     InlineTextBox* nextTextBox() const { return m_nextTextBox; }
     void setNextTextBox(InlineTextBox* n) { m_nextTextBox = n; }

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -113,8 +113,7 @@
     // Mark as being destroyed to avoid trouble with merges in removeChild().
     m_beingDestroyed = true;
 
-    if (lineGridBox())
-        lineGridBox()->destroy();
+    delete lineGridBox();
 
     if (renderNamedFlowFragment())
         setRenderNamedFlowFragment(0);

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.h	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h	2013-10-31 04:15:24 UTC (rev 158343)
@@ -242,8 +242,7 @@
     {
         if (!m_rareData)
             m_rareData = adoptPtr(new RenderBlockFlowRareData(*this));
-        if (m_rareData->m_lineGridBox)
-            m_rareData->m_lineGridBox->destroy();
+        delete m_rareData->m_lineGridBox;
         m_rareData->m_lineGridBox = box;
     }
     void layoutLineGridBox();

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -1949,8 +1949,8 @@
 {
     if (m_inlineBoxWrapper) {
         if (fullLayout) {
-            m_inlineBoxWrapper->destroy();
-            m_inlineBoxWrapper = 0;
+            delete m_inlineBoxWrapper;
+            m_inlineBoxWrapper = nullptr;
         } else
             m_inlineBoxWrapper->dirtyLineBoxes();
     }
@@ -1981,7 +1981,7 @@
 
         // Nuke the box.
         box->removeFromParent();
-        box->destroy();
+        delete box;
     } else if (isReplaced()) {
         setLocation(roundedLayoutPoint(box->topLeft()));
         // m_inlineBoxWrapper should already be 0. Deleting it is a safeguard against security issues.
@@ -1997,8 +1997,8 @@
     if (m_inlineBoxWrapper) {
         if (!documentBeingDestroyed())
             m_inlineBoxWrapper->removeFromParent();
-        m_inlineBoxWrapper->destroy();
-        m_inlineBoxWrapper = 0;
+        delete m_inlineBoxWrapper;
+        m_inlineBoxWrapper = nullptr;
     }
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -135,7 +135,7 @@
         InlineFlowBox* next;
         for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
             next = curr->nextLineBox();
-            curr->destroy();
+            delete curr;
         }
         m_firstLineBox = 0;
         m_lastLineBox = 0;

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -43,8 +43,7 @@
 
 RenderLineBreak::~RenderLineBreak()
 {
-    if (m_inlineBoxWrapper)
-        m_inlineBoxWrapper->destroy();
+    delete m_inlineBoxWrapper;
 }
 
 LayoutUnit RenderLineBreak::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
@@ -91,7 +90,7 @@
         return;
     if (!documentBeingDestroyed())
         m_inlineBoxWrapper->removeFromParent();
-    m_inlineBoxWrapper->destroy();
+    delete m_inlineBoxWrapper;
     m_inlineBoxWrapper = nullptr;
 }
 
@@ -100,7 +99,7 @@
     if (!m_inlineBoxWrapper)
         return;
     if (fullLayout) {
-        m_inlineBoxWrapper->destroy();
+        delete m_inlineBoxWrapper;
         m_inlineBoxWrapper = nullptr;
         return;
     }

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -1038,7 +1038,7 @@
         // We want the box to be destroyed.
         textBox->removeFromParent();
         m_lineBoxes.remove(*textBox);
-        textBox->destroy();
+        delete textBox;
         return;
     }
 

Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -123,7 +123,7 @@
     InlineTextBox* next;
     for (auto current = m_first; current; current = next) {
         next = current->nextTextBox();
-        current->destroy();
+        delete current;
     }
     m_first = nullptr;
     m_last = nullptr;

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (158342 => 158343)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2013-10-31 04:15:24 UTC (rev 158343)
@@ -65,10 +65,9 @@
 }
 
 
-void RootInlineBox::destroy()
+RootInlineBox::~RootInlineBox()
 {
     detachEllipsisBox();
-    InlineFlowBox::destroy();
 }
 
 void RootInlineBox::detachEllipsisBox()
@@ -76,7 +75,7 @@
     if (hasEllipsisBox()) {
         EllipsisBox* box = gEllipsisBoxMap->take(this);
         box->setParent(0);
-        box->destroy();
+        delete box;
         setHasEllipsisBox(false);
     }
 }

Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (158342 => 158343)


--- trunk/Source/WebCore/rendering/RootInlineBox.h	2013-10-31 04:11:02 UTC (rev 158342)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h	2013-10-31 04:15:24 UTC (rev 158343)
@@ -38,9 +38,8 @@
 class RootInlineBox : public InlineFlowBox {
 public:
     explicit RootInlineBox(RenderBlockFlow&);
+    virtual ~RootInlineBox();
 
-    virtual void destroy() OVERRIDE FINAL;
-
     virtual bool isRootInlineBox() const OVERRIDE FINAL { return true; }
     RenderBlockFlow& blockFlow() const;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to