RESOLVED FIXED68439
[Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
https://bugs.webkit.org/show_bug.cgi?id=68439
Summary [Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
Zeno Albisser
Reported 2011-09-20 08:00:07 PDT
[Qt][WebKit2][Mac] WebProcess should exit automatically when UIProcess dies.
Attachments
patch for feedback. (2.93 KB, patch)
2011-09-20 08:09 PDT, Zeno Albisser
no flags
patch for feedback. (2.17 KB, patch)
2011-09-22 08:22 PDT, Zeno Albisser
no flags
patch for review. (2.34 KB, patch)
2011-09-26 08:53 PDT, Zeno Albisser
no flags
patch for review - fixed coding style issues (2.34 KB, patch)
2011-09-26 09:01 PDT, Zeno Albisser
no flags
patch for review. - use qApp->quit() instead of exit() (2.64 KB, patch)
2011-10-03 04:32 PDT, Zeno Albisser
no flags
patch for review. - use QCoreApplication::quit() instead of qApp->quit() (2.65 KB, patch)
2011-10-03 05:56 PDT, Zeno Albisser
no flags
Zeno Albisser
Comment 1 2011-09-20 08:09:22 PDT
Created attachment 108003 [details] patch for feedback.
Zeno Albisser
Comment 2 2011-09-22 08:22:21 PDT
Created attachment 108336 [details] patch for feedback.
Adam Roben (:aroben)
Comment 3 2011-09-22 08:28:07 PDT
This should already be happening via WebProcess::didClose. Is that not being called for you?
Adam Roben (:aroben)
Comment 4 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.
Zeno Albisser
Comment 5 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.
Zeno Albisser
Comment 6 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.
Zeno Albisser
Comment 7 2011-09-26 08:53:40 PDT
Created attachment 108672 [details] patch for review.
WebKit Review Bot
Comment 8 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.
Zeno Albisser
Comment 9 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.
Zeno Albisser
Comment 10 2011-09-27 04:40:10 PDT
i will change it from using exit() to qApp->quit() and try that again. ...
Alexis Menard (darktears)
Comment 11 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.
Andreas Kling
Comment 12 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.
Zeno Albisser
Comment 13 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?
Zeno Albisser
Comment 14 2011-10-03 04:32:07 PDT
Created attachment 109468 [details] patch for review. - use qApp->quit() instead of exit()
Alexis Menard (darktears)
Comment 15 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.
Zeno Albisser
Comment 16 2011-10-03 05:56:54 PDT
Created attachment 109476 [details] patch for review. - use QCoreApplication::quit() instead of qApp->quit()
Andreas Kling
Comment 17 2011-10-03 06:00:20 PDT
Comment on attachment 109476 [details] patch for review. - use QCoreApplication::quit() instead of qApp->quit() LGTM.
WebKit Review Bot
Comment 18 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>
WebKit Review Bot
Comment 19 2011-10-03 07:03:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.