RESOLVED FIXED Bug 96197
[EFL][WK2] Provide implementation for PageClientImpl::processDidCrash()
https://bugs.webkit.org/show_bug.cgi?id=96197
Summary [EFL][WK2] Provide implementation for PageClientImpl::processDidCrash()
Jinwoo Song
Reported 2012-09-09 00:21:26 PDT
WebKit2 EFL does not have a implementation for PageClientImpl::processDidCrash(). So when WebProcess is crashed, UI process does nothing and left alone as it is.
Attachments
patch (4.23 KB, patch)
2012-09-10 03:56 PDT, Jinwoo Song
no flags
patch (4.24 KB, patch)
2012-09-10 16:31 PDT, Jinwoo Song
gyuyoung.kim: review-
patch. (4.60 KB, patch)
2012-09-11 01:36 PDT, Jinwoo Song
no flags
patch (4.64 KB, patch)
2012-09-11 03:06 PDT, Jinwoo Song
no flags
patch (5.01 KB, patch)
2012-09-12 21:31 PDT, Jinwoo Song
no flags
patch. (5.02 KB, patch)
2012-09-12 21:56 PDT, Jinwoo Song
no flags
patch applied Christophe's comments. (5.00 KB, patch)
2012-09-13 00:24 PDT, Jinwoo Song
no flags
patch (5.00 KB, patch)
2012-09-13 00:29 PDT, Jinwoo Song
no flags
patch (4.90 KB, patch)
2012-09-13 03:01 PDT, Jinwoo Song
gyuyoung.kim: commit-queue-
patch to fix build error. (5.10 KB, patch)
2012-09-13 17:22 PDT, Jinwoo Song
gyuyoung.kim: review+
patch for landing. (5.11 KB, patch)
2012-09-13 18:19 PDT, Jinwoo Song
gyuyoung.kim: review+
patch for landing. (5.12 KB, patch)
2012-09-15 00:27 PDT, Jinwoo Song
no flags
patch for landing. (5.12 KB, patch)
2012-09-15 05:02 PDT, Jinwoo Song
no flags
Jinwoo Song
Comment 1 2012-09-10 03:56:34 PDT
Chris Dumez
Comment 2 2012-09-10 04:56:25 PDT
Comment on attachment 163083 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163083&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1590 > + * Web process was crashed. "has" crashed > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1592 > + * Emits signal: "process,crashed" with pointer to handle crash. with pointer to "crash handling boolean" ? > Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 > + * - "process,crashed", bool*: reports that web process is crashed. "has" crashed.
Jinwoo Song
Comment 3 2012-09-10 16:31:02 PDT
Jinwoo Song
Comment 4 2012-09-10 16:31:23 PDT
(In reply to comment #2) > (From update of attachment 163083 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163083&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1590 > > + * Web process was crashed. > > "has" crashed fixed. > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1592 > > + * Emits signal: "process,crashed" with pointer to handle crash. > > with pointer to "crash handling boolean" ? fixed. > > > Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 > > + * - "process,crashed", bool*: reports that web process is crashed. > > "has" crashed. fixed.
Chris Dumez
Comment 5 2012-09-10 22:09:51 PDT
Comment on attachment 163243 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163243&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1605 > + exit(0); Frankly, I'm a bit scared by this. Why would we exit the app? It seems no other port is doing this. I think we should simply display an error page. To my knowledge, the fact that the WebProcess crashed is not a dead end. If you open a new URL, a new WebProcess would be created.
Gyuyoung Kim
Comment 6 2012-09-10 22:21:22 PDT
Comment on attachment 163243 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163243&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1599 > + fprintf(stderr, "WARNING: The web process experienced a crash on '%s'.\n", priv->pageProxy->urlAtProcessExit().utf8().data()); IMO, EINA_LOG_DOM_WARN is better than fprintf for ewk layer. > Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 > + * - "process,crashed", bool*: reports that web process has crashed. Eina_Bool is correct.
Kenneth Rohde Christiansen
Comment 7 2012-09-11 00:17:14 PDT
Comment on attachment 163243 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163243&action=review > Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp:110 > void PageClientImpl::processDidCrash() > { > - notImplemented(); > + ewk_view_process_crashed(m_viewWidget); > } This seems very simplistic. For Qt we handle lots of things relating to our view, history etc. I am not entirely sure where that is done, but I think it would make sense to have a look and analyse it. As the class name shows this is information meant for the view (ie. client of the page)
Jinwoo Song
Comment 8 2012-09-11 01:24:06 PDT
Comment on attachment 163243 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163243&action=review >> Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp:110 >> } > > This seems very simplistic. For Qt we handle lots of things relating to our view, history etc. I am not entirely sure where that is done, but I think it would make sense to have a look and analyse it. > > As the class name shows this is information meant for the view (ie. client of the page) Yes, I also think it's very simple. I look into the Qt and found that Qt handles warning message, resetGestureRecognizers, and load progress. (void QQuickWebViewPrivate::processDidCrash()). But I could not find other place where other things are handled. As you know, GTK has no implementation for processDidCrash() and default behavior is done in WebPageProxy::processDidCrash(). >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1599 >> + fprintf(stderr, "WARNING: The web process experienced a crash on '%s'.\n", priv->pageProxy->urlAtProcessExit().utf8().data()); > > IMO, EINA_LOG_DOM_WARN is better than fprintf for ewk layer. Okay, I'll use EINA_LOG_DOM_WARN. >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1605 >> + exit(0); > > Frankly, I'm a bit scared by this. Why would we exit the app? It seems no other port is doing this. > I think we should simply display an error page. > > To my knowledge, the fact that the WebProcess crashed is not a dead end. If you open a new URL, a new WebProcess would be created. I agree with you and I'll change to only display the error message. >> Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 >> + * - "process,crashed", bool*: reports that web process has crashed. > > Eina_Bool is correct. I'll fix it.
Jinwoo Song
Comment 9 2012-09-11 01:36:02 PDT
Gyuyoung Kim
Comment 10 2012-09-11 01:52:00 PDT
Why not request review again ?
Jinwoo Song
Comment 11 2012-09-11 01:54:31 PDT
(In reply to comment #10) > Why not request review again ? Okay, I set the flag.
Gyuyoung Kim
Comment 12 2012-09-11 02:30:54 PDT
Comment on attachment 163300 [details] patch. View in context: https://bugs.webkit.org/attachment.cgi?id=163300&action=review Looks good to me except for my comment. > Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 > + * - "process,crashed", Eina_Bool*: reports that web process has crashed. If new signal depends on a parameter which gets a result from callback function, we added comment for parameter as below, http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_view.h#L71
Jinwoo Song
Comment 13 2012-09-11 03:06:48 PDT
Jinwoo Song
Comment 14 2012-09-11 03:08:18 PDT
(In reply to comment #12) > (From update of attachment 163300 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163300&action=review > > Looks good to me except for my comment. > > > Source/WebKit2/UIProcess/API/efl/ewk_view.h:59 > > + * - "process,crashed", Eina_Bool*: reports that web process has crashed. > > If new signal depends on a parameter which gets a result from callback function, we added comment for parameter as below, > > http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_view.h#L71 Done. :)
Gyuyoung Kim
Comment 15 2012-09-11 03:24:18 PDT
(In reply to comment #8) > Yes, I also think it's very simple. I look into the Qt and found that Qt handles warning message, resetGestureRecognizers, and load progress. (void QQuickWebViewPrivate::processDidCrash()). But I could not find other place where other things are handled. > As you know, GTK has no implementation for processDidCrash() and default behavior is done in WebPageProxy::processDidCrash(). One more thing. I'm not sure if we can reset gesture recognizer like qt port. But, it looks we need to check whether page loading is ongoing or not. IMO, we're able to do similar stuff as qt port for finishing page loading using below functions. - ewk_view_load_progress_get - ewk_view_load_progress_changed
Jinwoo Song
Comment 16 2012-09-11 03:32:42 PDT
(In reply to comment #15) > (In reply to comment #8) > > > Yes, I also think it's very simple. I look into the Qt and found that Qt handles warning message, resetGestureRecognizers, and load progress. (void QQuickWebViewPrivate::processDidCrash()). But I could not find other place where other things are handled. > > As you know, GTK has no implementation for processDidCrash() and default behavior is done in WebPageProxy::processDidCrash(). > > One more thing. I'm not sure if we can reset gesture recognizer like qt port. But, it looks we need to check whether page loading is ongoing or not. IMO, we're able to do similar stuff as qt port for finishing page loading using below functions. > > - ewk_view_load_progress_get > - ewk_view_load_progress_changed Okay, I'll do this and upload a patch again. Thanks for advice. :-)
Jinwoo Song
Comment 17 2012-09-12 21:31:18 PDT
Gyuyoung Kim
Comment 18 2012-09-12 21:41:08 PDT
Comment on attachment 163769 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163769&action=review > Source/WebKit2/UIProcess/API/efl/ewk_private.h:34 > +extern int _ewk_log_dom; Nit : A new line is needed. > Source/WebKit2/UIProcess/API/efl/ewk_view_private.h:104 > +void ewk_view_process_crashed(Evas_Object* ewkView); ditto.
Jinwoo Song
Comment 19 2012-09-12 21:56:56 PDT
Jinwoo Song
Comment 20 2012-09-12 21:57:27 PDT
(In reply to comment #18) > (From update of attachment 163769 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163769&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_private.h:34 > > +extern int _ewk_log_dom; > > Nit : A new line is needed. Done. > > > Source/WebKit2/UIProcess/API/efl/ewk_view_private.h:104 > > +void ewk_view_process_crashed(Evas_Object* ewkView); > > ditto. Done.
Simon Hausmann
Comment 21 2012-09-12 22:05:29 PDT
Comment on attachment 163771 [details] patch. View in context: https://bugs.webkit.org/attachment.cgi?id=163771&action=review > Source/WebKit2/UIProcess/API/efl/ewk_private.h:34 > +extern int _ewk_log_dom; Just a thought, wouldn't it be simpler to do the import in ewk_view.cpp instead of here? :)
Chris Dumez
Comment 22 2012-09-12 22:45:10 PDT
Comment on attachment 163771 [details] patch. View in context: https://bugs.webkit.org/attachment.cgi?id=163771&action=review > Source/WebKit2/ChangeLog:13 > + with a url at process exit. And after checking if loading was onging, if so, set "ongoing" > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1644 > + We could even show an HTML error page here, like Qt port is doing. (e.g. using ewk_view_html_string_load()) > Source/WebKit2/UIProcess/API/efl/ewk_view_private.h:104 > +void ewk_view_process_crashed(Evas_Object* ewkView); wouldn't it be clearer if we used ewk_view_webprocess_crashed()?
Jinwoo Song
Comment 23 2012-09-12 22:53:51 PDT
(In reply to comment #21) > (From update of attachment 163771 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163771&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_private.h:34 > > +extern int _ewk_log_dom; > > Just a thought, wouldn't it be simpler to do the import in ewk_view.cpp instead of here? :) Actually, I referenced WebKit1 EFL in ewk_private.h.(Source/WebKit/efl/ewk/ewk_private.h) Also, I'm considering to add Eina Log macros in the ewk_private.h in WebKit2 so as to use the macros in other use cases. That's the reason I put it there. :)
Jinwoo Song
Comment 24 2012-09-13 00:22:33 PDT
(In reply to comment #22) > (From update of attachment 163771 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163771&action=review > > > Source/WebKit2/ChangeLog:13 > > + with a url at process exit. And after checking if loading was onging, if so, set > > "ongoing" Fixed. > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1644 > > + > > We could even show an HTML error page here, like Qt port is doing. (e.g. using ewk_view_html_string_load()) I applied your suggestion. > > > Source/WebKit2/UIProcess/API/efl/ewk_view_private.h:104 > > +void ewk_view_process_crashed(Evas_Object* ewkView); > > wouldn't it be clearer if we used ewk_view_webprocess_crashed()? Yes, I agree with you. I changed the name of the function and callback.
Jinwoo Song
Comment 25 2012-09-13 00:24:52 PDT
Created attachment 163798 [details] patch applied Christophe's comments.
Gyuyoung Kim
Comment 26 2012-09-13 00:26:50 PDT
Comment on attachment 163798 [details] patch applied Christophe's comments. View in context: https://bugs.webkit.org/attachment.cgi?id=163798&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1655 > + Unneeded line.
Jinwoo Song
Comment 27 2012-09-13 00:29:30 PDT
Jinwoo Song
Comment 28 2012-09-13 00:29:59 PDT
(In reply to comment #26) > (From update of attachment 163798 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163798&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1655 > > + > > Unneeded line. Fixed.
Chris Dumez
Comment 29 2012-09-13 00:30:38 PDT
Comment on attachment 163802 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163802&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1648 > + ewk_view_html_string_load(ewkView, errorHTML.utf8().data(), 0, 0); The last argument is the unreachable URL. You should probably pass url.utf8().data().
Gyuyoung Kim
Comment 30 2012-09-13 00:36:02 PDT
Comment on attachment 163802 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163802&action=review >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1648 >> + ewk_view_html_string_load(ewkView, errorHTML.utf8().data(), 0, 0); > > The last argument is the unreachable URL. You should probably pass url.utf8().data(). How about pass "file:///" ?
Chris Dumez
Comment 31 2012-09-13 00:59:56 PDT
Comment on attachment 163802 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163802&action=review >>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1648 >>> + ewk_view_html_string_load(ewkView, errorHTML.utf8().data(), 0, 0); >> >> The last argument is the unreachable URL. You should probably pass url.utf8().data(). > > How about pass "file:///" ? I don't understand your comment. How is "file:///" the unreachable url? The unreachable url is priv->pageProxy->urlAtProcessExit().
Kenneth Rohde Christiansen
Comment 32 2012-09-13 01:04:41 PDT
Comment on attachment 163802 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163802&action=review >>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1648 >>> + ewk_view_html_string_load(ewkView, errorHTML.utf8().data(), 0, 0); >> >> The last argument is the unreachable URL. You should probably pass url.utf8().data(). > > How about pass "file:///" ? Now can you make sure the process is alive here? Also webkit fills in <html> and <body> for you > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1653 > + // Check if loading was ongoing, when process crashed. > + double loadProgress = ewk_view_load_progress_get(ewkView); > + if (loadProgress >= 0 && loadProgress < 1) > + ewk_view_load_progress_changed(ewkView, 1); This seems like something that should be handled even if the handled is true, I would probably move it to ::processDidCrash()
Jinwoo Song
Comment 33 2012-09-13 03:01:19 PDT
Created attachment 163825 [details] patch Applied the comments by Kenneth and Christophe.
Gyuyoung Kim
Comment 34 2012-09-13 03:21:13 PDT
Gyuyoung Kim
Comment 35 2012-09-13 03:28:51 PDT
Comment on attachment 163825 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=163825&action=review > don't understand your comment. How is "file:///" the unreachable url? The unreachable url is priv->pageProxy->urlAtProcessExit(). There was misunderstanding. The unreachable url is right. Thanks. > Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp:110 > + double loadProgress = ewk_view_load_progress_get(m_viewWidget); Need to include ewk_view.h > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1646 > + // Display a process crash page process -> webprocess ?
Kenneth Rohde Christiansen
Comment 36 2012-09-13 04:22:17 PDT
> process -> webprocess ? -> web process
Jinwoo Song
Comment 37 2012-09-13 17:22:45 PDT
Created attachment 164008 [details] patch to fix build error.
Jinwoo Song
Comment 38 2012-09-13 17:24:58 PDT
(In reply to comment #35) > (From update of attachment 163825 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163825&action=review > > > don't understand your comment. How is "file:///" the unreachable url? The unreachable url is priv->pageProxy->urlAtProcessExit(). > > There was misunderstanding. The unreachable url is right. Thanks. > > > Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp:110 > > + double loadProgress = ewk_view_load_progress_get(m_viewWidget); > > Need to include ewk_view.h Added missing header. silly mistake :( > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1646 > > + // Display a process crash page > > process -> webprocess ?
Jinwoo Song
Comment 39 2012-09-13 17:25:15 PDT
(In reply to comment #36) > > process -> webprocess ? > > -> web process Fixed.
Gyuyoung Kim
Comment 40 2012-09-13 18:11:55 PDT
Comment on attachment 164008 [details] patch to fix build error. View in context: https://bugs.webkit.org/attachment.cgi?id=164008&action=review > Source/WebKit2/ChangeLog:14 > + with a url at process exit and load a error page. process -> web process ?
Jinwoo Song
Comment 41 2012-09-13 18:19:59 PDT
Created attachment 164021 [details] patch for landing.
Jinwoo Song
Comment 42 2012-09-13 18:20:11 PDT
(In reply to comment #40) > (From update of attachment 164008 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=164008&action=review > > > Source/WebKit2/ChangeLog:14 > > + with a url at process exit and load a error page. > > process -> web process ? Fixed.
Gyuyoung Kim
Comment 43 2012-09-14 23:59:18 PDT
Comment on attachment 164021 [details] patch for landing. View in context: https://bugs.webkit.org/attachment.cgi?id=164021&action=review > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1646 > + // Display a process crash page process -> web process.
Jinwoo Song
Comment 44 2012-09-15 00:27:05 PDT
Created attachment 164276 [details] patch for landing.
Jinwoo Song
Comment 45 2012-09-15 00:27:51 PDT
(In reply to comment #43) > (From update of attachment 164021 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=164021&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1646 > > + // Display a process crash page > > process -> web process. modified the comment to // Display an error page
Gyuyoung Kim
Comment 46 2012-09-15 01:39:21 PDT
Comment on attachment 164276 [details] patch for landing. View in context: https://bugs.webkit.org/attachment.cgi?id=164276&action=review I already set r+. So, if you add my name to reviewer field in ChangeLog, you don't need to request r+ again. Just request cq? again. > Source/WebKit2/ChangeLog:13 > + If the application does not handle the crash event, show a Eina Log warning message s/a Eina/an Eina/s > Source/WebKit2/ChangeLog:14 > + with a url at web process exit and load a error page. s/a error/an error/s
Jinwoo Song
Comment 47 2012-09-15 04:57:08 PDT
(In reply to comment #46) > (From update of attachment 164276 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=164276&action=review > > I already set r+. So, if you add my name to reviewer field in ChangeLog, you don't need to request r+ again. Just request cq? again. Okay, I see. Thanks for the tip. :) > > > Source/WebKit2/ChangeLog:13 > > + If the application does not handle the crash event, show a Eina Log warning message > > s/a Eina/an Eina/s I'll fix it. > > > Source/WebKit2/ChangeLog:14 > > + with a url at web process exit and load a error page. > > s/a error/an error/s I'll fix it.
Jinwoo Song
Comment 48 2012-09-15 05:02:53 PDT
Created attachment 164284 [details] patch for landing.
WebKit Review Bot
Comment 49 2012-09-15 08:14:43 PDT
Comment on attachment 164284 [details] patch for landing. Clearing flags on attachment: 164284 Committed r128690: <http://trac.webkit.org/changeset/128690>
WebKit Review Bot
Comment 50 2012-09-15 08:14:49 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.