Title: [170627] trunk/Source/WebKit2
Revision
170627
Author
[email protected]
Date
2014-06-30 18:40:13 -0700 (Mon, 30 Jun 2014)

Log Message

Add WebPageProxy::restoreFromState
https://bugs.webkit.org/show_bug.cgi?id=134480

Reviewed by Tim Horton.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreFromState):
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170626 => 170627)


--- trunk/Source/WebKit2/ChangeLog	2014-07-01 01:29:38 UTC (rev 170626)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-01 01:40:13 UTC (rev 170627)
@@ -1,5 +1,16 @@
 2014-06-30  Anders Carlsson  <[email protected]>
 
+        Add WebPageProxy::restoreFromState
+        https://bugs.webkit.org/show_bug.cgi?id=134480
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::restoreFromState):
+        * UIProcess/WebPageProxy.h:
+
+2014-06-30  Anders Carlsson  <[email protected]>
+
         Add a function to restore a WebBackForwardList object from a BackForwardListState object
         https://bugs.webkit.org/show_bug.cgi?id=134478
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (170626 => 170627)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-07-01 01:29:38 UTC (rev 170626)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-07-01 01:40:13 UTC (rev 170627)
@@ -1846,6 +1846,24 @@
 }
 #endif
 
+void WebPageProxy::restoreFromState(SessionState sessionState)
+{
+    m_backForwardList->restoreFromState(std::move(sessionState.backForwardListState));
+
+    LegacySessionState state(m_backForwardList->entries(), m_backForwardList->currentIndex());
+    process().send(Messages::WebPage::RestoreSession(state), m_pageID);
+
+    // FIXME: Navigating should be separate from state restoration.
+
+    if (sessionState.provisionalURL) {
+        loadRequest(sessionState.provisionalURL);
+        return;
+    }
+
+    if (WebBackForwardListItem* item = m_backForwardList->currentItem())
+        goToBackForwardItem(item);
+}
+
 bool WebPageProxy::supportsTextZoom() const
 {
     // FIXME (118840): This should also return false for standalone media and plug-in documents.

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170626 => 170627)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-07-01 01:29:38 UTC (rev 170626)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-07-01 01:40:13 UTC (rev 170627)
@@ -553,6 +553,7 @@
     typedef bool (*WebPageProxySessionStateFilterCallback)(WKPageRef, WKStringRef type, WKTypeRef object, void* context);
     PassRefPtr<API::Data> sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const;
     void restoreFromSessionStateData(API::Data*);
+    void restoreFromState(SessionState);
 
     bool supportsTextZoom() const;
     double textZoomFactor() const { return m_textZoomFactor; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to