Changeset 181815 in webkit
- Timestamp:
- Mar 20, 2015 3:45:14 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r181812 r181815 1 2015-03-20 Chris Dumez <cdumez@apple.com> 2 3 [WK2] Allow stale content when restoring the browser's session state 4 https://bugs.webkit.org/show_bug.cgi?id=142916 5 <rdar://problem/20243493> 6 7 Reviewed by Darin Adler. 8 9 Allow stale content when restoring the browser's session state 10 (restoring all tabs from previous session), e.g. 11 - Via History > Reopen All windows from previous session on Safari 12 - Happens on startup for MobileSafari 13 14 I have verified that using "Open in tabs" on a bookmarks folder 15 still does fresh loads (rdar://problem/8131355) as it is not using 16 the restoreFromSessionState() code path. 17 18 * UIProcess/WebPageProxy.cpp: 19 (WebKit::WebPageProxy::reattachToWebProcessForReload): 20 (WebKit::WebPageProxy::reattachToWebProcessWithItem): 21 (WebKit::WebPageProxy::goForward): 22 (WebKit::WebPageProxy::goBack): 23 (WebKit::WebPageProxy::goToBackForwardItem): 24 (WebKit::WebPageProxy::restoreFromSessionState): 25 * UIProcess/WebPageProxy.h: 26 * WebProcess/WebPage/WebPage.cpp: 27 (WebKit::WebPage::goToBackForwardItem): 28 * WebProcess/WebPage/WebPage.h: 29 * WebProcess/WebPage/WebPage.messages.in: 30 1 31 2015-03-20 Beth Dakin <bdakin@apple.com> 2 32 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r181791 r181815 657 657 658 658 // We allow stale content when reloading a WebProcess that's been killed or crashed. 659 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID() , true /* allowStale */), m_pageID);659 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID()), m_pageID); 660 660 m_process->responsivenessTimer()->start(); 661 661 … … 663 663 } 664 664 665 RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item , AllowStaleContent allowStaleContent)665 RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item) 666 666 { 667 667 if (m_isClosed) … … 679 679 auto navigation = m_navigationState->createBackForwardNavigation(); 680 680 681 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID() , allowStaleContent == AllowStaleContent::Yes), m_pageID);681 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item->itemID()), m_pageID); 682 682 m_process->responsivenessTimer()->start(); 683 683 … … 1027 1027 1028 1028 if (!isValid()) 1029 return reattachToWebProcessWithItem(forwardItem , AllowStaleContent::Yes);1029 return reattachToWebProcessWithItem(forwardItem); 1030 1030 1031 1031 RefPtr<API::Navigation> navigation; … … 1050 1050 1051 1051 if (!isValid()) 1052 return reattachToWebProcessWithItem(backItem , AllowStaleContent::Yes);1052 return reattachToWebProcessWithItem(backItem); 1053 1053 1054 1054 RefPtr<API::Navigation> navigation; … … 1062 1062 } 1063 1063 1064 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item , AllowStaleContent allowStaleContent)1065 { 1066 if (!isValid()) 1067 return reattachToWebProcessWithItem(item , allowStaleContent);1064 RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item) 1065 { 1066 if (!isValid()) 1067 return reattachToWebProcessWithItem(item); 1068 1068 1069 1069 auto transaction = m_pageLoadState.transaction(); … … 1075 1075 navigation = m_navigationState->createBackForwardNavigation(); 1076 1076 1077 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item->itemID() , allowStaleContent == AllowStaleContent::Yes), m_pageID);1077 m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item->itemID()), m_pageID); 1078 1078 m_process->responsivenessTimer()->start(); 1079 1079 … … 2096 2096 if (hasBackForwardList) { 2097 2097 // FIXME: Do we have to null check the back forward list item here? 2098 if (WebBackForwardListItem* item = m_backForwardList->currentItem()) { 2099 // We forbid stale content when restoring the session state and do a fresh load (rdar://problem/8131355). 2100 return goToBackForwardItem(item, AllowStaleContent::No); 2101 } 2098 if (WebBackForwardListItem* item = m_backForwardList->currentItem()) 2099 return goToBackForwardItem(item); 2102 2100 } 2103 2101 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r181782 r181815 359 359 RefPtr<API::Navigation> goBack(); 360 360 361 enum class AllowStaleContent { No, Yes }; 362 RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*, AllowStaleContent = AllowStaleContent::Yes); 361 RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*); 363 362 void tryRestoreScrollPosition(); 364 363 void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removed); … … 1164 1163 void reattachToWebProcess(); 1165 1164 RefPtr<API::Navigation> reattachToWebProcessForReload(); 1166 RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem* , AllowStaleContent);1165 RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*); 1167 1166 1168 1167 void requestNotificationPermission(uint64_t notificationID, const String& originString); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r181782 r181815 1162 1162 } 1163 1163 1164 void WebPage::goToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID , bool allowStaleContent)1164 void WebPage::goToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID) 1165 1165 { 1166 1166 SendStopResponsivenessTimer stopper(this); … … 1175 1175 m_pendingNavigationID = navigationID; 1176 1176 1177 m_page->goToItem(*item, allowStaleContent ? FrameLoadType::IndexedBackForward : FrameLoadType::Standard);1177 m_page->goToItem(*item, FrameLoadType::IndexedBackForward); 1178 1178 } 1179 1179 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r181782 r181815 927 927 void goForward(uint64_t navigationID, uint64_t); 928 928 void goBack(uint64_t navigationID, uint64_t); 929 void goToBackForwardItem(uint64_t navigationID, uint64_t , bool allowStaleContent);929 void goToBackForwardItem(uint64_t navigationID, uint64_t); 930 930 void tryRestoreScrollPosition(); 931 931 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r181782 r181815 120 120 GoBack(uint64_t navigationID, uint64_t backForwardItemID) 121 121 GoForward(uint64_t navigationID, uint64_t backForwardItemID) 122 GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID , bool allowStaleContent)122 GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID) 123 123 TryRestoreScrollPosition() 124 124
Note: See TracChangeset
for help on using the changeset viewer.