Title: [216847] trunk/Source/WebKit2
Revision
216847
Author
akl...@apple.com
Date
2017-05-14 12:27:45 -0700 (Sun, 14 May 2017)

Log Message

Always reset the assisted node when the main frame commits a new load.
https://bugs.webkit.org/show_bug.cgi?id=172088

Reviewed by Antti Koivisto.

WebPage::m_assistedNode could extend the lifetime of the document it pointed into
if the main frame was navigated while the assisted node was in one of its subframes.
The life-supported document wouldn't be reachable from _javascript_ but nevertheless
would consume memory and other resources.

This patch fixes the issue by always clearing WebPage::m_assistedNode when the main
frame commits a new load.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::resetAssistedNodeForFrame):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (216846 => 216847)


--- trunk/Source/WebKit2/ChangeLog	2017-05-14 17:43:39 UTC (rev 216846)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-14 19:27:45 UTC (rev 216847)
@@ -1,3 +1,21 @@
+2017-05-14  Andreas Kling  <akl...@apple.com>
+
+        Always reset the assisted node when the main frame commits a new load.
+        https://bugs.webkit.org/show_bug.cgi?id=172088
+
+        Reviewed by Antti Koivisto.
+
+        WebPage::m_assistedNode could extend the lifetime of the document it pointed into
+        if the main frame was navigated while the assisted node was in one of its subframes.
+        The life-supported document wouldn't be reachable from _javascript_ but nevertheless
+        would consume memory and other resources.
+
+        This patch fixes the issue by always clearing WebPage::m_assistedNode when the main
+        frame commits a new load.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::resetAssistedNodeForFrame):
+
 2017-05-14  Csaba Osztrogonác  <o...@webkit.org>
 
         Unreviewed Mac cmake buildfix after r216690, just for fun.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (216846 => 216847)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-14 17:43:39 UTC (rev 216846)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-14 19:27:45 UTC (rev 216847)
@@ -5100,7 +5100,7 @@
 {
     if (!m_assistedNode)
         return;
-    if (m_assistedNode->document().frame() == frame->coreFrame()) {
+    if (frame->isMainFrame() || m_assistedNode->document().frame() == frame->coreFrame()) {
 #if PLATFORM(IOS)
         send(Messages::WebPageProxy::StopAssistingNode());
 #elif PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to