Bug 198561

Summary: REGRESSION(r243094): [GTK][WPE] Stale content after restoring the web view session
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, cdumez, ews-watchlist, gustavo, mcatanzaro
Priority: P2 Keywords: Gtk, Regression
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=195758
https://bugs.webkit.org/show_bug.cgi?id=153230
Bug Depends on: 207908    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch cdumez: review+

Description Carlos Garcia Campos 2019-06-05 05:08:21 PDT
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.
Comment 1 Carlos Garcia Campos 2019-06-05 05:10:11 PDT
Created attachment 371389 [details]
Patch
Comment 2 EWS Watchlist 2019-06-05 05:11:00 PDT
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 3 Chris Dumez 2019-06-05 08:46:35 PDT
Comment on attachment 371389 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371389&action=review

> 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.
Comment 4 Carlos Garcia Campos 2019-06-05 22:43:28 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 371389 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=371389&action=review
> 
> > 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.
Comment 5 Carlos Garcia Campos 2019-06-05 23:05:38 PDT
Created attachment 371476 [details]
Patch
Comment 6 Carlos Garcia Campos 2019-06-06 22:46:09 PDT
Committed r246188: <https://trac.webkit.org/changeset/246188>