Skip to content

Commit

Permalink
Merge r175485 - RenderCounter shouldn't need a pre-destructor hook.
Browse files Browse the repository at this point in the history
<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:

Canonical link: https://commits.webkit.org/154760.184@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@175943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling authored and carlosgcampos committed Nov 11, 2014
1 parent a776c42 commit 682d73c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
20 changes: 20 additions & 0 deletions Source/WebCore/ChangeLog
@@ -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 Alexey Proskuryakov <ap@apple.com>

REGRESSION: Using a media element changes window.name
Expand Down
8 changes: 2 additions & 6 deletions Source/WebCore/rendering/RenderCounter.cpp
Expand Up @@ -350,18 +350,14 @@ RenderCounter::RenderCounter(Document& document, const CounterContent& counter)

RenderCounter::~RenderCounter()
{
view().removeRenderCounter();

if (m_counterNode) {
m_counterNode->removeRenderer(this);
ASSERT(!m_counterNode);
}
}

void RenderCounter::willBeDestroyed()
{
view().removeRenderCounter();
RenderText::willBeDestroyed();
}

const char* RenderCounter::renderName() const
{
return "RenderCounter";
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/rendering/RenderCounter.h
Expand Up @@ -42,9 +42,6 @@ class RenderCounter final : public RenderText {

void updateCounter();

protected:
virtual void willBeDestroyed();

private:
virtual const char* renderName() const;
virtual bool isCounter() const;
Expand Down

0 comments on commit 682d73c

Please sign in to comment.