Diff
Modified: trunk/Source/WebKit2/ChangeLog (181814 => 181815)
--- trunk/Source/WebKit2/ChangeLog 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/ChangeLog 2015-03-20 22:45:14 UTC (rev 181815)
@@ -1,3 +1,33 @@
+2015-03-20 Chris Dumez <[email protected]>
+
+ [WK2] Allow stale content when restoring the browser's session state
+ https://bugs.webkit.org/show_bug.cgi?id=142916
+ <rdar://problem/20243493>
+
+ Reviewed by Darin Adler.
+
+ Allow stale content when restoring the browser's session state
+ (restoring all tabs from previous session), e.g.
+ - Via History > Reopen All windows from previous session on Safari
+ - Happens on startup for MobileSafari
+
+ I have verified that using "Open in tabs" on a bookmarks folder
+ still does fresh loads (rdar://problem/8131355) as it is not using
+ the restoreFromSessionState() code path.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcessForReload):
+ (WebKit::WebPageProxy::reattachToWebProcessWithItem):
+ (WebKit::WebPageProxy::goForward):
+ (WebKit::WebPageProxy::goBack):
+ (WebKit::WebPageProxy::goToBackForwardItem):
+ (WebKit::WebPageProxy::restoreFromSessionState):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::goToBackForwardItem):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2015-03-20 Beth Dakin <[email protected]>
[Immediate Actions] Should re-enable immediate actions for iBooks
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (181814 => 181815)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2015-03-20 22:45:14 UTC (rev 181815)
@@ -656,13 +656,13 @@
auto navigation = m_navigationState->createReloadNavigation();
// We allow stale content when reloading a WebProcess that's been killed or crashed.
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), true /* allowStale */), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID()), m_pageID);
m_process->responsivenessTimer()->start();
return WTF::move(navigation);
}
-RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item, AllowStaleContent allowStaleContent)
+RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
{
if (m_isClosed)
return nullptr;
@@ -678,7 +678,7 @@
auto navigation = m_navigationState->createBackForwardNavigation();
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID(), allowStaleContent == AllowStaleContent::Yes), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID()), m_pageID);
m_process->responsivenessTimer()->start();
return WTF::move(navigation);
@@ -1026,7 +1026,7 @@
m_pageLoadState.setPendingAPIRequestURL(transaction, forwardItem->url());
if (!isValid())
- return reattachToWebProcessWithItem(forwardItem, AllowStaleContent::Yes);
+ return reattachToWebProcessWithItem(forwardItem);
RefPtr<API::Navigation> navigation;
if (!m_backForwardList->currentItem()->itemIsInSameDocument(*forwardItem))
@@ -1049,7 +1049,7 @@
m_pageLoadState.setPendingAPIRequestURL(transaction, backItem->url());
if (!isValid())
- return reattachToWebProcessWithItem(backItem, AllowStaleContent::Yes);
+ return reattachToWebProcessWithItem(backItem);
RefPtr<API::Navigation> navigation;
if (!m_backForwardList->currentItem()->itemIsInSameDocument(*backItem))
@@ -1061,10 +1061,10 @@
return navigation;
}
-RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item, AllowStaleContent allowStaleContent)
+RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
{
if (!isValid())
- return reattachToWebProcessWithItem(item, allowStaleContent);
+ return reattachToWebProcessWithItem(item);
auto transaction = m_pageLoadState.transaction();
@@ -1074,7 +1074,7 @@
if (!m_backForwardList->currentItem()->itemIsInSameDocument(*item))
navigation = m_navigationState->createBackForwardNavigation();
- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item->itemID(), allowStaleContent == AllowStaleContent::Yes), m_pageID);
+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item->itemID()), m_pageID);
m_process->responsivenessTimer()->start();
return navigation;
@@ -2095,10 +2095,8 @@
if (hasBackForwardList) {
// FIXME: Do we have to null check the back forward list item here?
- if (WebBackForwardListItem* item = m_backForwardList->currentItem()) {
- // We forbid stale content when restoring the session state and do a fresh load (rdar://problem/8131355).
- return goToBackForwardItem(item, AllowStaleContent::No);
- }
+ if (WebBackForwardListItem* item = m_backForwardList->currentItem())
+ return goToBackForwardItem(item);
}
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (181814 => 181815)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2015-03-20 22:45:14 UTC (rev 181815)
@@ -358,8 +358,7 @@
RefPtr<API::Navigation> goForward();
RefPtr<API::Navigation> goBack();
- enum class AllowStaleContent { No, Yes };
- RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*, AllowStaleContent = AllowStaleContent::Yes);
+ RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*);
void tryRestoreScrollPosition();
void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removed);
void willGoToBackForwardListItem(uint64_t itemID, const UserData&);
@@ -1163,7 +1162,7 @@
void reattachToWebProcess();
RefPtr<API::Navigation> reattachToWebProcessForReload();
- RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*, AllowStaleContent);
+ RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
void requestNotificationPermission(uint64_t notificationID, const String& originString);
void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (181814 => 181815)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-03-20 22:45:14 UTC (rev 181815)
@@ -1161,7 +1161,7 @@
m_page->goToItem(*item, FrameLoadType::Back);
}
-void WebPage::goToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID, bool allowStaleContent)
+void WebPage::goToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID)
{
SendStopResponsivenessTimer stopper(this);
@@ -1174,7 +1174,7 @@
if (!item->isInPageCache())
m_pendingNavigationID = navigationID;
- m_page->goToItem(*item, allowStaleContent ? FrameLoadType::IndexedBackForward : FrameLoadType::Standard);
+ m_page->goToItem(*item, FrameLoadType::IndexedBackForward);
}
void WebPage::tryRestoreScrollPosition()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (181814 => 181815)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-03-20 22:45:14 UTC (rev 181815)
@@ -926,7 +926,7 @@
void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
void goForward(uint64_t navigationID, uint64_t);
void goBack(uint64_t navigationID, uint64_t);
- void goToBackForwardItem(uint64_t navigationID, uint64_t, bool allowStaleContent);
+ void goToBackForwardItem(uint64_t navigationID, uint64_t);
void tryRestoreScrollPosition();
void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
void setWindowResizerSize(const WebCore::IntSize&);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (181814 => 181815)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2015-03-20 21:35:17 UTC (rev 181814)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2015-03-20 22:45:14 UTC (rev 181815)
@@ -119,7 +119,7 @@
GoBack(uint64_t navigationID, uint64_t backForwardItemID)
GoForward(uint64_t navigationID, uint64_t backForwardItemID)
- GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID, bool allowStaleContent)
+ GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID)
TryRestoreScrollPosition()
LoadURLInFrame(String url, uint64_t frameID)