From d0e4d419a0008a92c9201d3c0b6f799e6f28a338 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 7 Jun 2011 16:48:20 +0000 Subject: [PATCH] 2011-06-07 Nico Weber Reviewed by Dimitri Glazkov. [chromium] -Wdelete-non-virtual-dtor pass for DumpRenderTree https://bugs.webkit.org/show_bug.cgi?id=62210 The change to TestEventPrinter fixes a latent bug, because objects are deleted through the TestEventPrinter type, but none of the subclasses have destructors or non-POD members. The changes to NotificationPresenter and WebViewHost do _not_ to fix a real bug, they just make clang's -Wdelete-non-virtual-dtor happy. As discussed at http://codereview.chromium.org/7094005/, we prefer making leaf class destructors virtual over making the leaf classes final. * DumpRenderTree/chromium/NotificationPresenter.cpp: (NotificationPresenter::~NotificationPresenter): * DumpRenderTree/chromium/NotificationPresenter.h: * DumpRenderTree/chromium/TestEventPrinter.cpp: (TestEventPrinter::~TestEventPrinter): * DumpRenderTree/chromium/TestEventPrinter.h: * DumpRenderTree/chromium/WebViewHost.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88246 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 24 +++++++++++++++++++ .../chromium/NotificationPresenter.cpp | 4 ++++ .../chromium/NotificationPresenter.h | 1 + .../chromium/TestEventPrinter.cpp | 4 ++++ .../chromium/TestEventPrinter.h | 1 + Tools/DumpRenderTree/chromium/WebViewHost.h | 2 +- 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index a20f0ef8129..3e0b07f805f 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,27 @@ +2011-06-07 Nico Weber + + Reviewed by Dimitri Glazkov. + + [chromium] -Wdelete-non-virtual-dtor pass for DumpRenderTree + https://bugs.webkit.org/show_bug.cgi?id=62210 + + The change to TestEventPrinter fixes a latent bug, because + objects are deleted through the TestEventPrinter type, but none + of the subclasses have destructors or non-POD members. + + The changes to NotificationPresenter and WebViewHost do _not_ to fix a + real bug, they just make clang's -Wdelete-non-virtual-dtor happy. As + discussed at http://codereview.chromium.org/7094005/, we prefer making + leaf class destructors virtual over making the leaf classes final. + + * DumpRenderTree/chromium/NotificationPresenter.cpp: + (NotificationPresenter::~NotificationPresenter): + * DumpRenderTree/chromium/NotificationPresenter.h: + * DumpRenderTree/chromium/TestEventPrinter.cpp: + (TestEventPrinter::~TestEventPrinter): + * DumpRenderTree/chromium/TestEventPrinter.h: + * DumpRenderTree/chromium/WebViewHost.h: + 2011-06-06 Ryosuke Niwa Reviewed by Dirk Pranke. diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp index 63a70e4d38d..4b59a34d854 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp @@ -58,6 +58,10 @@ static void deferredDisplayDispatch(void* context) delete notification; } +NotificationPresenter::~NotificationPresenter() +{ +} + void NotificationPresenter::grantPermission(const WebString& origin) { // Make sure it's in the form of an origin. diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h index d476509fd32..f17473592c0 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h @@ -44,6 +44,7 @@ class TestShell; class NotificationPresenter : public WebKit::WebNotificationPresenter { public: explicit NotificationPresenter(TestShell* shell) : m_shell(shell) { } + virtual ~NotificationPresenter(); // Called by the LayoutTestController to simulate a user granting permission. void grantPermission(const WebKit::WebString& origin); diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp index 15de5e62685..ae0dc826d93 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -59,6 +59,10 @@ public: void handleTestFooter(bool dumpedAnything) const; }; +TestEventPrinter::~TestEventPrinter() +{ +} + PassOwnPtr TestEventPrinter::createDRTPrinter() { return adoptPtr(new DRTPrinter); diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.h b/Tools/DumpRenderTree/chromium/TestEventPrinter.h index 40aeabba41c..9cd18a81c0e 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.h +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.h @@ -38,6 +38,7 @@ public: static PassOwnPtr createDRTPrinter(); static PassOwnPtr createTestShellPrinter(); + virtual ~TestEventPrinter(); virtual void handleTestHeader(const char* url) const = 0; virtual void handleTimedOut() const = 0; virtual void handleTextHeader() const = 0; diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 92e7d8616c0..5cbf1160444 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -67,7 +67,7 @@ struct WebWindowFeatures; class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost { public: WebViewHost(TestShell*); - ~WebViewHost(); + virtual ~WebViewHost(); void setWebWidget(WebKit::WebWidget*); WebKit::WebView* webView() const; WebKit::WebWidget* webWidget() const; -- GitLab