After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695642 - [WK2] Call to HasModifiedForms method is sync
[WK2] Call to HasModifiedForms method is sync
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 698436 706691 (view as bug list)
Depends on:
Blocks: 678610
 
 
Reported: 2013-03-11 16:38 UTC by Xan Lopez
Modified: 2013-08-28 19:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (12.46 KB, patch)
2013-03-21 13:04 UTC, Carlos Garcia Campos
committed Details | Review
ephy-window: Simplify ephy_window_close() (1.33 KB, patch)
2013-08-28 19:24 UTC, Claudio Saavedra
committed Details | Review

Description Xan Lopez 2013-03-11 16:38:23 UTC
This needs to be async, otherwise the UI process can lock up for a few seconds in the worst case.
Comment 1 Xan Lopez 2013-03-13 18:30:56 UTC
One problem here is that the EphyWebView method this implements is sync, and it is used in EphyWindow in a context that also needs a sync response (a handler for the close request signal). So doing a dbus async call won't work without changing more things.

Could we make the WebProcess emit a signal if a webview is about to be closed with modified forms, and let the UI process handle it if it wants to? Seems like it fits more naturally the way things work in WK2.
Comment 2 Xan Lopez 2013-03-13 18:32:15 UTC
Regardless of that if seems like this should not look up for seconds, and there are warnings printed in the console, so I think we are just doing something wrong. Possibly calling HasModifiedForms when the WebProcess is already dead/dying, since this happens when we close a tab. Doing that better might be enough for 3.8.
Comment 3 Carlos Garcia Campos 2013-03-14 13:50:00 UTC
(In reply to comment #1)
> Could we make the WebProcess emit a signal if a webview is about to be closed
> with modified forms, and let the UI process handle it if it wants to? Seems
> like it fits more naturally the way things work in WK2.

The problem os this approach is how to prevent the page from closing. To implement that in the web process, first we need to close the web view, so that web process receives the close message, but it's too late, it's just a notification. So, this needs to be done before actually closing the web view from the UI process.
Comment 4 Carlos Garcia Campos 2013-03-14 13:50:27 UTC
(In reply to comment #2)
> Regardless of that if seems like this should not look up for seconds, and there
> are warnings printed in the console, so I think we are just doing something
> wrong. Possibly calling HasModifiedForms when the WebProcess is already
> dead/dying, since this happens when we close a tab. Doing that better might be
> enough for 3.8.

Looks like a race condition somewhere.
Comment 5 Carlos Garcia Campos 2013-03-21 13:04:40 UTC
Created attachment 239467 [details] [review]
Patch
Comment 6 Xan Lopez 2013-04-01 14:47:16 UTC
Review of attachment 239467 [details] [review]:

I'm a bit confused, is this patch meant to be for master only? It does not seem like the code in ephy-window.c will compile for WebKit1?

::: src/ephy-window.c
@@ +4544,3 @@
 	{
+		if (!window->priv->force_close &&
+		    gtk_notebook_get_n_pages (window->priv->notebook) > 0)

Seems like this can just be one if block now.
Comment 7 Carlos Garcia Campos 2013-04-16 07:24:44 UTC
(In reply to comment #6)
> Review of attachment 239467 [details] [review]:
> 
> I'm a bit confused, is this patch meant to be for master only? It does not seem
> like the code in ephy-window.c will compile for WebKit1?

Why not? Now ephy_web_view_has_modified_forms() is async even for WebKit1. 

> ::: src/ephy-window.c
> @@ +4544,3 @@
>      {
> +        if (!window->priv->force_close &&
> +            gtk_notebook_get_n_pages (window->priv->notebook) > 0)
> 
> Seems like this can just be one if block now.

Ok.
Comment 8 Garrett Regier 2013-06-21 14:02:06 UTC
*** Bug 698436 has been marked as a duplicate of this bug. ***
Comment 9 Claudio Saavedra 2013-08-27 21:30:16 UTC
Ping?
Comment 10 Claudio Saavedra 2013-08-28 19:18:51 UTC
*** Bug 706691 has been marked as a duplicate of this bug. ***
Comment 11 Claudio Saavedra 2013-08-28 19:24:25 UTC
Created attachment 253438 [details] [review]
ephy-window: Simplify ephy_window_close()

Simply use one if block, also put the boolean variable check first.
Comment 12 Claudio Saavedra 2013-08-28 19:27:52 UTC
Attachment 253438 [details] pushed as 91464ee - ephy-window: Simplify ephy_window_close()