Avoid virtual method calls in the GraphicsLayer destructor
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 21:30:27 +0000 (21:30 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 21:30:27 +0000 (21:30 +0000)
commitf160b406f1b40bde8968f5c91a4aca4e46b6adf1
tree9626c0ab0cc29e015dfc83ad8127a93b0980e0e5
parent2a4229d384838c76c1d950286df040f7b0c66698
Avoid virtual method calls in the GraphicsLayer destructor
https://bugs.webkit.org/show_bug.cgi?id=83067

Reviewed by James Robinson.

Code cleanup to avoid calling virtual methods in the GraphicsLayer
destructor. Factor teardown code into a willBeDestroyed() method
that is called from the most dervied class. willBeDestroyed()
calls have to be chained. Fix the various ports' GraphicsLayer
implementations.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::~GraphicsLayer):
(WebCore):
(WebCore::GraphicsLayer::willBeDestroyed):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayerBlackBerry::~GraphicsLayerBlackBerry):
(WebCore):
(WebCore::GraphicsLayerBlackBerry::willBeDestroyed):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
(GraphicsLayerBlackBerry):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::~GraphicsLayerCA):
(WebCore):
(WebCore::GraphicsLayerCA::willBeDestroyed):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::~GraphicsLayerChromium):
(WebCore):
(WebCore::GraphicsLayerChromium::willBeDestroyed):
* platform/graphics/chromium/GraphicsLayerChromium.h:
(GraphicsLayerChromium):
* platform/graphics/clutter/GraphicsLayerClutter.cpp:
(WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
* platform/graphics/efl/GraphicsLayerEfl.cpp:
(WebCore::GraphicsLayerEfl::~GraphicsLayerEfl):
* platform/graphics/qt/GraphicsLayerQt.cpp:
(WebCore::GraphicsLayerQt::~GraphicsLayerQt):
(WebCore):
(WebCore::GraphicsLayerQt::willBeDestroyed):
* platform/graphics/qt/GraphicsLayerQt.h:
(GraphicsLayerQt):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
Source/WebCore/platform/graphics/efl/GraphicsLayerEfl.cpp
Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
Source/WebCore/platform/graphics/qt/GraphicsLayerQt.h