[webkit-qt] WK2/QML handling of unresponsive/crashed web process

Alexis Menard alexis at webkit.org
Tue Jan 29 04:15:20 PST 2013


On Tue, Jan 29, 2013 at 9:02 AM, Jocelyn Turcotte
<jocelyn.turcotte at digia.com> wrote:
> On Mon, Jan 28, 2013 at 04:42:56PM +0100, Milian Wolff wrote:
>> Hey guys,
>>
>> have you any plans on handling the WKPageLoaderClient's
>> processDidBecomeResponsive or processDidCrash callbacks?
>>
>> I could imagine writing the code required to push these signals all the way up
>> to QML similar to the other webview.experimental.* callbacks such as
>> runJavaScriptAlert in QtWebPageUIClient.
> I don't see a good use case that would needs this to be exposed in the API. User code shouldn't have to worry about this and this should all be handled by WebKit2.
>
>> The question is - how could I design the handler in a way that it would be
>> accepted upstream? Especially I wonder whether it would be OK to push the PID
>> or similar of the webprocess when it hangs, such that I could kill it from a
>> C++ object exposed to QML.
> Applications shouldn't worry about this.

Apps maybe not, a Browser yes.

Here is a given scenario : Large text field where I write my blog
post, lot of text, no auto saving of draft (very common), and then the
WebProcess becomes unresponsive. What WebKit2 will do? reloading the
page automatically? Sounds goods but you loose all what you typed in
the text field...Today Safari ask you if you want to reload the page
because the WebProcess can't respond, so you have the choice to
cancel. Actually the popup even tell you that you can loose some data
if you reload.

In the other hand the "i could kill it" from the Apps is not a good
argument to expose this mechanism. I believe it is handled gracefully
today.

>
>> Also, I'm not sure how to handle the case when the webprocess crashed.
>> Restarting it shounds simple enough, but will it actually be simple to do?
>> Especially updating any potential references to the web process might be error
>> prone - or is it only stored centrally?
> This should already be the case, reloading the page or opening a new one should restart the web process.
>
>> Generally, there is always only web process per webview - right? Or is there
>> even just one per QML/WK2 app - i.e. do multiple webviews share the same
>> webprocess?
> There is currently one per UIProcess by default (I think), the ProcessModel argument passed to the WebContext constructor can allow you to have more than one, but I'm not sure how well this works at the moment. I didn't investigate.

It does not work. Many places in the code still assume there is one
WebProcess but that may change soon :).

>
> There is probably a reason why you ask, are you running into issues around this?

Good question.

>
> br,
> Jocelyn
> _______________________________________________
> webkit-qt mailing list
> webkit-qt at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-qt



-- 
Software Engineer @
Intel Open Source Technology Center


More information about the webkit-qt mailing list