This is another regression of delaying the web process launch until the first load. If the session is restored before anything has been loaded, which is the normal way, the RestoreSession message is just ignored and the state is sent to the WebPage on creation via creation parameters. The WebPage considers that restoring a session from creation parameters only happens when re-launching a process after a crash or in case of process swap. In those cases, the history item is not marked as restored from session. We need to ensure the session is restored in the web process from the IPC message handler, by launching the initial process before the session is restored.
Created attachment 371389 [details]
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment on attachment 371389 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=371389&action=review
> + getPage(webView).launchInitialProcessIfNecessary();
Can you please add this call at the beginning of WebPageProxy::restoreFromSessionState() instead? It seems like a useful thing to do for all ports.
(In reply to Chris Dumez from comment #3)
> Comment on attachment 371389 [details]
> View in context:
> > Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:4129
> > + getPage(webView).launchInitialProcessIfNecessary();
> Can you please add this call at the beginning of
> WebPageProxy::restoreFromSessionState() instead? It seems like a useful
> thing to do for all ports.
Sure, I thought you wanted the opposite, because cocoa based ports always want stale contents after session restore.
Created attachment 371476 [details]
Committed r246188: <https://trac.webkit.org/changeset/246188>