Bug 68439 - [Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
Summary: [Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zeno Albisser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 08:00 PDT by Zeno Albisser
Modified: 2011-10-03 07:03 PDT (History)
4 users (show)

See Also:


Attachments
patch for feedback. (2.93 KB, patch)
2011-09-20 08:09 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for feedback. (2.17 KB, patch)
2011-09-22 08:22 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for review. (2.34 KB, patch)
2011-09-26 08:53 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for review - fixed coding style issues (2.34 KB, patch)
2011-09-26 09:01 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for review. - use qApp->quit() instead of exit() (2.64 KB, patch)
2011-10-03 04:32 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for review. - use QCoreApplication::quit() instead of qApp->quit() (2.65 KB, patch)
2011-10-03 05:56 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zeno Albisser 2011-09-20 08:00:07 PDT
[Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
Comment 1 Zeno Albisser 2011-09-20 08:09:22 PDT
Created attachment 108003 [details]
patch for feedback.
Comment 2 Zeno Albisser 2011-09-22 08:22:21 PDT
Created attachment 108336 [details]
patch for feedback.
Comment 3 Adam Roben (:aroben) 2011-09-22 08:28:07 PDT
This should already be happening via WebProcess::didClose. Is that not being called for you?
Comment 4 Adam Roben (:aroben) 2011-09-22 08:29:49 PDT
WebProcess::didClose will only be called if the main thread isn't hung. Even if the main thread *is* hung, ChildProcess::didCloseOnConnectionWorkQueue should be called. That function sets things up so that the web process will exit in 10 seconds if the main thread still hasn't responded.
Comment 5 Zeno Albisser 2011-09-26 07:24:31 PDT
It seems there are several issues with the current implementation.
The didClose / didCloseOnConnectionWorkQueue is not working with the Qt port because the unix sockets IPC mechanism does not provide us any meaningful notification when the ui process died.
Even when the UIProcess is exited "properly" by the user, this approach does not work due to Leaking a WebContext and therefor not closing the IPC socket properly either.


The scheduleWorkOnTermination function does not work either, because we use a SIGNAL/SLOT connection to bind to the QProcess own finished() signal. Which of course never triggers because it would only trigger when the process itself exited already.

I will try to come up with a sensible solution at least for the latter problem.
Comment 6 Zeno Albisser 2011-09-26 07:54:15 PDT
actually i misunderstood the purpose of the scheduleWorkOnTermination function... so at least that one is working properly. :-)  ... but it does not serve the purpose i was assuming.
Comment 7 Zeno Albisser 2011-09-26 08:53:40 PDT
Created attachment 108672 [details]
patch for review.
Comment 8 WebKit Review Bot 2011-09-26 08:55:34 PDT
Attachment 108672 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1

Source/WebKit2/WebProcess/qt/WebProcessQt.cpp:70:  Missing space after ,  [whitespace/comma] [3]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Zeno Albisser 2011-09-26 09:01:04 PDT
Created attachment 108673 [details]
patch for review - fixed coding style issues

i think this is the best thing we can do for now.
But unless we want to fix circular dependencies of WebContext, WebProcessProxy and WebPageProxy and change the IPC mechanism of the Qt port, this is probably the way to go.
Comment 10 Zeno Albisser 2011-09-27 04:40:10 PDT
i will change it from using exit() to qApp->quit() and try that again. ...
Comment 11 Alexis Menard (darktears) 2011-09-27 04:51:21 PDT
Comment on attachment 108673 [details]
patch for review - fixed coding style issues

Not sure if we will support Leopard but Grand Central Dispatch was added in Snow Leopard.
Comment 12 Andreas Kling 2011-09-27 04:54:21 PDT
(In reply to comment #11)
> (From update of attachment 108673 [details])
> Not sure if we will support Leopard but Grand Central Dispatch was added in Snow Leopard.

We should support whatever Qt 5 will support. I don't think there's a problem adding SL-only things to trunk right now, we can figure this out later if someone decides that Qt 5.0 needs to support Leopard.
Comment 13 Zeno Albisser 2011-09-27 04:55:30 PDT
(In reply to comment #11)
> (From update of attachment 108673 [details])
> Not sure if we will support Leopard but Grand Central Dispatch was added in Snow Leopard.

I am aware of that, but i consider it a minor issue in this ecosystem.
Do we have any guidelines on that?
Or do we know of potential WK2 users using Pre Snow Leopard?
Comment 14 Zeno Albisser 2011-10-03 04:32:07 PDT
Created attachment 109468 [details]
patch for review. - use qApp->quit() instead of exit()
Comment 15 Alexis Menard (darktears) 2011-10-03 05:00:55 PDT
Comment on attachment 109468 [details]
patch for review. - use qApp->quit() instead of exit()

I think its good as we use the same approach than the Mac port. Jut a nitpick QApplication::quit() it is way nicer to read and understand than this magic hacked qApp pointer :D.
Comment 16 Zeno Albisser 2011-10-03 05:56:54 PDT
Created attachment 109476 [details]
patch for review. - use QCoreApplication::quit() instead of qApp->quit()
Comment 17 Andreas Kling 2011-10-03 06:00:20 PDT
Comment on attachment 109476 [details]
patch for review. - use QCoreApplication::quit() instead of qApp->quit()

LGTM.
Comment 18 WebKit Review Bot 2011-10-03 07:03:22 PDT
Comment on attachment 109476 [details]
patch for review. - use QCoreApplication::quit() instead of qApp->quit()

Clearing flags on attachment: 109476

Committed r96494: <http://trac.webkit.org/changeset/96494>
Comment 19 WebKit Review Bot 2011-10-03 07:03:27 PDT
All reviewed patches have been landed.  Closing bug.