RenderCounter shouldn't need a pre-destructor hook.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Nov 2014 20:17:44 +0000 (20:17 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Nov 2014 20:17:44 +0000 (20:17 +0000)
<https://webkit.org/b/138316>

Reviewed by Antti Koivisto.

RenderCounter will automatically register/unregister itself with
the RenderView when constructed/destroyed.

It was using a willBeDestroyed() hook because it used to be that you
couldn't get to the RenderView in the destructor. That's no longer
an issue as Document promises that RenderView is the last render tree
node to go away.

* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::willBeDestroyed): Deleted.
* rendering/RenderCounter.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175485 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderCounter.h

index 91c5262..6bdf596 100644 (file)
@@ -1,3 +1,23 @@
+2014-11-03  Andreas Kling  <akling@apple.com>
+
+        RenderCounter shouldn't need a pre-destructor hook.
+        <https://webkit.org/b/138316>
+
+        Reviewed by Antti Koivisto.
+
+        RenderCounter will automatically register/unregister itself with
+        the RenderView when constructed/destroyed.
+
+        It was using a willBeDestroyed() hook because it used to be that you
+        couldn't get to the RenderView in the destructor. That's no longer
+        an issue as Document promises that RenderView is the last render tree
+        node to go away.
+
+        * rendering/RenderCounter.cpp:
+        (WebCore::RenderCounter::~RenderCounter):
+        (WebCore::RenderCounter::willBeDestroyed): Deleted.
+        * rendering/RenderCounter.h:
+
 2014-11-03  Tim Horton  <timothy_horton@apple.com>
 
         Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
 2014-11-03  Tim Horton  <timothy_horton@apple.com>
 
         Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
index 5d57069..b46cda9 100644 (file)
@@ -350,18 +350,14 @@ RenderCounter::RenderCounter(Document& document, const CounterContent& counter)
 
 RenderCounter::~RenderCounter()
 {
 
 RenderCounter::~RenderCounter()
 {
+    view().removeRenderCounter();
+
     if (m_counterNode) {
         m_counterNode->removeRenderer(this);
         ASSERT(!m_counterNode);
     }
 }
 
     if (m_counterNode) {
         m_counterNode->removeRenderer(this);
         ASSERT(!m_counterNode);
     }
 }
 
-void RenderCounter::willBeDestroyed()
-{
-    view().removeRenderCounter();
-    RenderText::willBeDestroyed();
-}
-
 const char* RenderCounter::renderName() const
 {
     return "RenderCounter";
 const char* RenderCounter::renderName() const
 {
     return "RenderCounter";
index bf3d445..61300fd 100644 (file)
@@ -42,9 +42,6 @@ public:
 
     void updateCounter();
 
 
     void updateCounter();
 
-protected:
-    virtual void willBeDestroyed() override;
-
 private:
     virtual const char* renderName() const override;
     virtual bool isCounter() const override;
 private:
     virtual const char* renderName() const override;
     virtual bool isCounter() const override;