Title: [184095] releases/WebKitGTK/webkit-2.8/Source
Revision
184095
Author
[email protected]
Date
2015-05-11 06:43:33 -0700 (Mon, 11 May 2015)

Log Message

Merge r183179 - [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:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-05-11 13:43:33 UTC (rev 184095)
@@ -1,3 +1,25 @@
+2015-04-23  Chris Dumez  <[email protected]>
+
+        [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).
+
+        * loader/EmptyClients.h:
+        * page/DiagnosticLoggingClient.h:
+        * page/MainFrame.cpp:
+        (WebCore::MainFrame::~MainFrame):
+
 2015-04-22  Antti Koivisto  <[email protected]>
 
         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/EmptyClients.h (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/EmptyClients.h	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/EmptyClients.h	2015-05-11 13:43:33 UTC (rev 184095)
@@ -635,6 +635,8 @@
     virtual void logDiagnosticMessage(const String&, const String&) override { }
     virtual void logDiagnosticMessageWithResult(const String&, const String&, DiagnosticLoggingResultType) override { }
     virtual void logDiagnosticMessageWithValue(const String&, const String&, const String&) override { }
+
+    virtual void mainFrameDestroyed() override { }
 };
 
 void fillWithEmptyClients(PageConfiguration&);

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/page/DiagnosticLoggingClient.h (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/page/DiagnosticLoggingClient.h	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/page/DiagnosticLoggingClient.h	2015-05-11 13:43:33 UTC (rev 184095)
@@ -37,6 +37,8 @@
     virtual void logDiagnosticMessageWithResult(const String& message, const String& description, DiagnosticLoggingResultType) = 0;
     virtual void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value) = 0;
 
+    virtual void mainFrameDestroyed() = 0;
+
 protected:
     virtual ~DiagnosticLoggingClient() { }
 };

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/page/MainFrame.cpp (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/page/MainFrame.cpp	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/page/MainFrame.cpp	2015-05-11 13:43:33 UTC (rev 184095)
@@ -57,6 +57,8 @@
 
 MainFrame::~MainFrame()
 {
+    if (m_diagnosticLoggingClient)
+        m_diagnosticLoggingClient->mainFrameDestroyed();
 }
 
 RefPtr<MainFrame> MainFrame::create(Page& page, PageConfiguration& configuration)

Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog	2015-05-11 13:43:33 UTC (rev 184095)
@@ -1,3 +1,24 @@
+2015-04-23  Chris Dumez  <[email protected]>
+
+        [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).
+
+        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
+        (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
+        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
+
 2015-04-17  Tim Horton  <[email protected]>
 
         Clients sometimes block for 500ms in waitForPossibleGeometryUpdates

Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp	2015-05-11 13:43:33 UTC (rev 184095)
@@ -71,4 +71,9 @@
     m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValue(message, description, value));
 }
 
+void WebDiagnosticLoggingClient::mainFrameDestroyed()
+{
+    delete this;
+}
+
 } // namespace WebKit

Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h (184094 => 184095)


--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h	2015-05-11 13:41:28 UTC (rev 184094)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h	2015-05-11 13:43:33 UTC (rev 184095)
@@ -43,6 +43,8 @@
     virtual void logDiagnosticMessageWithResult(const String& message, const String& description, WebCore::DiagnosticLoggingResultType) override;
     virtual void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value) override;
 
+    virtual void mainFrameDestroyed() override;
+
     WebPage& m_page;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to