Changeset 170679 in webkit
- Timestamp:
- Jul 1, 2014, 5:08:13 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/C/WKPage.cpp (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (2 diffs)
-
UIProcess/mac/LegacySessionStateCoding.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r170676 r170679 1 2014-07-01 Anders Carlsson <andersca@apple.com> 2 3 WKPageRestoreFromSessionState should use the new session state restore code path 4 https://bugs.webkit.org/show_bug.cgi?id=134526 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/C/WKPage.cpp: 9 (WKPageRestoreFromSessionState): 10 Use the new code path. 11 12 * UIProcess/WebPageProxy.cpp: 13 (WebKit::WebPageProxy::restoreFromState): 14 Only restore the back-forward state if we have a back-forward list. 15 16 * UIProcess/mac/LegacySessionStateCoding.cpp: 17 (WebKit::encodeSessionHistory): 18 Save the original URL string as well. 19 20 (WebKit::decodeV1SessionHistory): 21 If we don't have a current index, set it to Nullopt instead of 0. 22 1 23 2014-07-01 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 24 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r170671 r170679 370 370 void WKPageRestoreFromSessionState(WKPageRef pageRef, WKDataRef sessionStateData) 371 371 { 372 toImpl(pageRef)->restoreFromSessionStateData(toImpl(sessionStateData)); 372 SessionState sessionState; 373 if (!decodeLegacySessionState(*toImpl(sessionStateData), sessionState)) 374 return; 375 376 toImpl(pageRef)->restoreFromState(std::move(sessionState)); 373 377 } 374 378 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r170664 r170679 1866 1866 uint64_t WebPageProxy::restoreFromState(SessionState sessionState) 1867 1867 { 1868 m_backForwardList->restoreFromState(std::move(sessionState.backForwardListState)); 1869 1870 LegacySessionState state(m_backForwardList->entries(), m_backForwardList->currentIndex()); 1871 process().send(Messages::WebPage::RestoreSession(state), m_pageID); 1868 bool hasBackForwardList = !!sessionState.backForwardListState.currentIndex; 1869 1870 if (hasBackForwardList) { 1871 m_backForwardList->restoreFromState(std::move(sessionState.backForwardListState)); 1872 for (const auto& entry : m_backForwardList->entries()) 1873 process().registerNewWebBackForwardListItem(entry.get()); 1874 1875 LegacySessionState state(m_backForwardList->entries(), m_backForwardList->currentIndex()); 1876 process().send(Messages::WebPage::RestoreSession(state), m_pageID); 1877 } 1872 1878 1873 1879 // FIXME: Navigating should be separate from state restoration. … … 1876 1882 return loadRequest(sessionState.provisionalURL); 1877 1883 1878 if (WebBackForwardListItem* item = m_backForwardList->currentItem()) 1879 return goToBackForwardItem(item); 1884 if (hasBackForwardList) { 1885 // FIXME: Do we have to null check the back forward list item here? 1886 if (WebBackForwardListItem* item = m_backForwardList->currentItem()) 1887 return goToBackForwardItem(item); 1888 } 1880 1889 1881 1890 return 0; -
trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp
r170671 r170679 438 438 auto data = encodeSessionHistoryEntryData(item.pageState.mainFrameState); 439 439 440 auto entryDictionary = createDictionary({ { sessionHistoryEntryURLKey, url.get() }, { sessionHistoryEntryTitleKey, title.get() }, { sessionHistoryEntry DataKey, data.get() }, { sessionHistoryEntrySnapshotUUIDKey, item.snapshotUUID.createCFString().get() }});440 auto entryDictionary = createDictionary({ { sessionHistoryEntryURLKey, url.get() }, { sessionHistoryEntryTitleKey, title.get() }, { sessionHistoryEntryOriginalURLKey, originalURL.get() }, { sessionHistoryEntryDataKey, data.get() }, { sessionHistoryEntrySnapshotUUIDKey, item.snapshotUUID.createCFString().get() }}); 441 441 442 442 CFArrayAppendValue(entries.get(), entryDictionary.get()); … … 1023 1023 if (!currentIndexNumber) { 1024 1024 // No current index means the dictionary represents an empty session. 1025 backForwardListState.currentIndex = 0;1025 backForwardListState.currentIndex = Nullopt; 1026 1026 backForwardListState.items = { }; 1027 1027 return true;
Note:
See TracChangeset
for help on using the changeset viewer.