Changeset 175485 in webkit


Ignore:
Timestamp:
Nov 3, 2014 12:17:44 PM (9 years ago)
Author:
akling@apple.com
Message:

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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175484 r175485  
     12014-11-03  Andreas Kling  <akling@apple.com>
     2
     3        RenderCounter shouldn't need a pre-destructor hook.
     4        <https://webkit.org/b/138316>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        RenderCounter will automatically register/unregister itself with
     9        the RenderView when constructed/destroyed.
     10
     11        It was using a willBeDestroyed() hook because it used to be that you
     12        couldn't get to the RenderView in the destructor. That's no longer
     13        an issue as Document promises that RenderView is the last render tree
     14        node to go away.
     15
     16        * rendering/RenderCounter.cpp:
     17        (WebCore::RenderCounter::~RenderCounter):
     18        (WebCore::RenderCounter::willBeDestroyed): Deleted.
     19        * rendering/RenderCounter.h:
     20
    1212014-11-03  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderCounter.cpp

    r174759 r175485  
    351351RenderCounter::~RenderCounter()
    352352{
     353    view().removeRenderCounter();
     354
    353355    if (m_counterNode) {
    354356        m_counterNode->removeRenderer(this);
    355357        ASSERT(!m_counterNode);
    356358    }
    357 }
    358 
    359 void RenderCounter::willBeDestroyed()
    360 {
    361     view().removeRenderCounter();
    362     RenderText::willBeDestroyed();
    363359}
    364360
  • trunk/Source/WebCore/rendering/RenderCounter.h

    r175084 r175485  
    4343    void updateCounter();
    4444
    45 protected:
    46     virtual void willBeDestroyed() override;
    47 
    4845private:
    4946    virtual const char* renderName() const override;
Note: See TracChangeset for help on using the changeset viewer.