Title: [210711] branches/safari-603-branch/Source/WebKit2

Diff

Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (210710 => 210711)


--- branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-01-13 06:10:31 UTC (rev 210710)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-01-13 06:10:34 UTC (rev 210711)
@@ -1,5 +1,31 @@
 2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r210666. rdar://problem/28904157
+
+    2017-01-12  Andreas Kling  <akl...@apple.com>
+
+            WebBackForwardListProxy should remove restored session history items from PageCache on close.
+            <https://webkit.org/b/166972>
+            <rdar://problem/28904157>
+
+            Reviewed by Brady Eidson.
+
+            Register history item ID's from the UIProcess with the associated-items map
+            so that we can remove any PageCache entries associated with them immediately
+            when closing a WebPage.
+
+            Otherwise they might not get removed until the next PageCache pruning happens.
+            This patch is a speculative fix for what looks like it might be weirdness
+            related to a PageCache entry outliving its originating Page.
+
+            * WebProcess/WebPage/WebBackForwardListProxy.cpp:
+            (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
+            * WebProcess/WebPage/WebBackForwardListProxy.h:
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::restoreSessionInternal):
+
+2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r210619. rdar://problem/27745004
 
     2017-01-11  Brent Fulgham  <bfulg...@apple.com>

Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp (210710 => 210711)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp	2017-01-13 06:10:31 UTC (rev 210710)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp	2017-01-13 06:10:34 UTC (rev 210711)
@@ -100,6 +100,8 @@
     ASSERT(!historyItemToIDMap().contains(item.ptr()));
     ASSERT(!idToHistoryItemMap().contains(itemID));
 
+    m_associatedItemIDs.add(itemID);
+
     historyItemToIDMap().set<ItemAndPageID>(item.ptr(), { .itemID = itemID, .pageID = pageID });
     idToHistoryItemMap().set(itemID, item.ptr());
 }

Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h (210710 => 210711)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h	2017-01-13 06:10:31 UTC (rev 210710)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h	2017-01-13 06:10:34 UTC (rev 210711)
@@ -41,7 +41,7 @@
     static uint64_t idForItem(WebCore::HistoryItem*);
     static void removeItem(uint64_t itemID);
 
-    static void addItemFromUIProcess(uint64_t itemID, Ref<WebCore::HistoryItem>&&, uint64_t pageID);
+    void addItemFromUIProcess(uint64_t itemID, Ref<WebCore::HistoryItem>&&, uint64_t pageID);
     static void setHighestItemIDFromUIProcess(uint64_t itemID);
     
     void clear();

Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (210710 => 210711)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-01-13 06:10:31 UTC (rev 210710)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-01-13 06:10:34 UTC (rev 210711)
@@ -115,6 +115,7 @@
 #include <_javascript_Core/APICast.h>
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/ArchiveResource.h>
+#include <WebCore/BackForwardController.h>
 #include <WebCore/Chrome.h>
 #include <WebCore/CommonVM.h>
 #include <WebCore/ContextMenuController.h>
@@ -2334,7 +2335,7 @@
     for (const auto& itemState : itemStates) {
         auto historyItem = toHistoryItem(itemState.pageState);
         historyItem->setWasRestoredFromSession(restoredByAPIRequest == WasRestoredByAPIRequest::Yes);
-        WebBackForwardListProxy::addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID);
+        static_cast<WebBackForwardListProxy*>(corePage()->backForward().client())->addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID);
     }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to