[WK2] WebDiagnosticLoggingClient is leaking
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 08:12:30 +0000 (08:12 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 08:12:30 +0000 (08:12 +0000)
commitc598f186798835a54c62ed01257f5e48716cd9d3
treec0ed4262ecbd9bf9d7d5c6cacbe8292b2232b6fe
parenta9c5a66741a276e1cfdd5e78ba8a3b64a1fcd208
[WK2] WebDiagnosticLoggingClient is leaking
https://bugs.webkit.org/show_bug.cgi?id=144089
<rdar://problem/19706214>

Reviewed by Darin Adler.

WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
constructor but there is no code destroying it.

This patch adds a new xxxDestroyed() virtual function to
DiagnosticLoggingClient and that is overriden in
WebDiagnosticLoggingClient to call "delete this". This is the same
pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
WebProgressTrackerClient).

Source/WebCore:

* loader/EmptyClients.h:
* page/DiagnosticLoggingClient.h:
* page/MainFrame.cpp:
(WebCore::MainFrame::~MainFrame):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/DiagnosticLoggingClient.h
Source/WebCore/page/MainFrame.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h