- Revision
- 115369
- Author
- [email protected]
- Date
- 2012-04-26 14:35:34 -0700 (Thu, 26 Apr 2012)
Log Message
[WK2] AlternativeTextClient leaks when the page is destroyed
https://bugs.webkit.org/show_bug.cgi?id=84307
<rdar://problem/11328431>
Reviewed by Enrica Casucci.
Source/WebCore:
* page/AlternativeTextClient.h: Add pageDestroyed() call, as in EditorClient.
(AlternativeTextClient):
* page/Page.cpp:
(WebCore::Page::~Page): When the page is destroyed, notify the client if it exists.
Source/WebKit/mac:
* WebCoreSupport/WebAlternativeTextClient.h: Implement pageDestroyed(), as in EditorClient.
(WebAlternativeTextClient):
* WebCoreSupport/WebAlternativeTextClient.mm:
(WebAlternativeTextClient::pageDestroyed): Deletes itself.
Source/WebKit2:
* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Implement pageDestroyed(), as in EditorClient.
(WebAlternativeTextClient):
* WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
(WebKit::WebAlternativeTextClient::pageDestroyed): Deletes itself.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (115368 => 115369)
--- trunk/Source/WebCore/ChangeLog 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebCore/ChangeLog 2012-04-26 21:35:34 UTC (rev 115369)
@@ -1,3 +1,16 @@
+2012-04-26 Jon Lee <[email protected]>
+
+ [WK2] AlternativeTextClient leaks when the page is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=84307
+ <rdar://problem/11328431>
+
+ Reviewed by Enrica Casucci.
+
+ * page/AlternativeTextClient.h: Add pageDestroyed() call, as in EditorClient.
+ (AlternativeTextClient):
+ * page/Page.cpp:
+ (WebCore::Page::~Page): When the page is destroyed, notify the client if it exists.
+
2012-04-26 Kentaro Hara <[email protected]>
[V8] Pass Isolate to wrap() (Part1)
Modified: trunk/Source/WebCore/page/AlternativeTextClient.h (115368 => 115369)
--- trunk/Source/WebCore/page/AlternativeTextClient.h 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebCore/page/AlternativeTextClient.h 2012-04-26 21:35:34 UTC (rev 115369)
@@ -53,6 +53,8 @@
class AlternativeTextClient {
public:
virtual ~AlternativeTextClient() { }
+ virtual void pageDestroyed() = 0;
+
virtual void showCorrectionAlternative(AlternativeTextType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, const Vector<String>& alternativeReplacementStrings) = 0;
virtual void dismissAlternative(ReasonForDismissingAlternativeText) = 0;
virtual String dismissAlternativeSoon(ReasonForDismissingAlternativeText) = 0;
Modified: trunk/Source/WebCore/page/Page.cpp (115368 => 115369)
--- trunk/Source/WebCore/page/Page.cpp 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebCore/page/Page.cpp 2012-04-26 21:35:34 UTC (rev 115369)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All Rights Reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* This library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include "config.h"
#include "Page.h"
+#include "AlternativeTextClient.h"
#include "BackForwardController.h"
#include "BackForwardList.h"
#include "Base64.h"
@@ -188,6 +189,8 @@
}
m_editorClient->pageDestroyed();
+ if (m_alternativeTextClient)
+ m_alternativeTextClient->pageDestroyed();
#if ENABLE(INSPECTOR)
m_inspectorController->inspectedPageDestroyed();
Modified: trunk/Source/WebKit/mac/ChangeLog (115368 => 115369)
--- trunk/Source/WebKit/mac/ChangeLog 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-04-26 21:35:34 UTC (rev 115369)
@@ -1,3 +1,16 @@
+2012-04-26 Jon Lee <[email protected]>
+
+ [WK2] AlternativeTextClient leaks when the page is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=84307
+ <rdar://problem/11328431>
+
+ Reviewed by Enrica Casucci.
+
+ * WebCoreSupport/WebAlternativeTextClient.h: Implement pageDestroyed(), as in EditorClient.
+ (WebAlternativeTextClient):
+ * WebCoreSupport/WebAlternativeTextClient.mm:
+ (WebAlternativeTextClient::pageDestroyed): Deletes itself.
+
2012-04-26 Jer Noble <[email protected]>
Full Screen mode does not preserve CALayer ordering after exiting.
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h (115368 => 115369)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h 2012-04-26 21:35:34 UTC (rev 115369)
@@ -36,6 +36,7 @@
public:
WebAlternativeTextClient(WebView *);
virtual ~WebAlternativeTextClient();
+ virtual void pageDestroyed() OVERRIDE;
virtual void showCorrectionAlternative(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) OVERRIDE;
virtual void dismissAlternative(WebCore::ReasonForDismissingAlternativeText) OVERRIDE;
virtual String dismissAlternativeSoon(WebCore::ReasonForDismissingAlternativeText) OVERRIDE;
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm (115368 => 115369)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm 2012-04-26 21:35:34 UTC (rev 115369)
@@ -39,6 +39,11 @@
#endif
}
+void WebAlternativeTextClient::pageDestroyed()
+{
+ delete this;
+}
+
void WebAlternativeTextClient::showCorrectionAlternative(AlternativeTextType type, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
{
#if USE(AUTOCORRECTION_PANEL)
Modified: trunk/Source/WebKit2/ChangeLog (115368 => 115369)
--- trunk/Source/WebKit2/ChangeLog 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit2/ChangeLog 2012-04-26 21:35:34 UTC (rev 115369)
@@ -1,3 +1,16 @@
+2012-04-26 Jon Lee <[email protected]>
+
+ [WK2] AlternativeTextClient leaks when the page is destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=84307
+ <rdar://problem/11328431>
+
+ Reviewed by Enrica Casucci.
+
+ * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Implement pageDestroyed(), as in EditorClient.
+ (WebAlternativeTextClient):
+ * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
+ (WebKit::WebAlternativeTextClient::pageDestroyed): Deletes itself.
+
2012-04-26 Jer Noble <[email protected]>
Full Screen mode does not preserve CALayer ordering after exiting.
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h (115368 => 115369)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h 2012-04-26 21:35:34 UTC (rev 115369)
@@ -37,6 +37,7 @@
public:
WebAlternativeTextClient(WebPage *);
virtual ~WebAlternativeTextClient();
+ virtual void pageDestroyed() OVERRIDE;
virtual void showCorrectionAlternative(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) OVERRIDE;
virtual void dismissAlternative(WebCore::ReasonForDismissingAlternativeText) OVERRIDE;
virtual String dismissAlternativeSoon(WebCore::ReasonForDismissingAlternativeText) OVERRIDE;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp (115368 => 115369)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp 2012-04-26 21:29:05 UTC (rev 115368)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp 2012-04-26 21:35:34 UTC (rev 115369)
@@ -46,6 +46,11 @@
#endif
}
+void WebAlternativeTextClient::pageDestroyed()
+{
+ delete this;
+}
+
void WebAlternativeTextClient::showCorrectionAlternative(AlternativeTextType type, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
{
#if USE(AUTOCORRECTION_PANEL)