breautek commented on code in PR #1574:
URL: https://github.com/apache/cordova-android/pull/1574#discussion_r1173897182


##########
framework/src/org/apache/cordova/CordovaPlugin.java:
##########
@@ -442,4 +444,17 @@ public void onRequestPermissionsResult(int requestCode, 
String[] permissions,
     public CordovaPluginPathHandler getPathHandler() {
         return null;
     }
+
+    /**
+     * Called when the WebView's render process has exited.
+     *
+     * See <a 
href="https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)">WebViewClient#onRenderProcessGone</a>
+     *
+     * @return  true if the host application handled the situation that 
process has exited,
+     *          otherwise, application will crash if render process crashed, 
or be killed
+     *          if render process was killed by the system.

Review Comment:
   Just a nitpick here,
   
   I think we should be explicit that plugins must not attempt to gracefully 
recover from a webview crash on a webview that it does not own/manage. So in 
other words the plugins must not return `true` for a webview that it doesn't 
manage.
   
   Otherwise we open ourselves in the future of plugins conflicting and if they 
do that disregarding the note, then that's on them.
   
   ```suggestion
        * Called when the WebView's render process has exited. Can be used to 
collect information regarding the crash for crashlytics or optionally attempt 
to gracefully handle/recover the crashed webview by recreating it.
        *
        * See <a 
href="https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)">WebViewClient#onRenderProcessGone</a>
        *
        * Note: A plugin must not attempt to recover a webview that it does not 
own/manage.
        *
        * @return  true if the host application handled the situation that 
process has exited,
        *          otherwise, application will crash if render process crashed, 
or be killed
        *          if render process was killed by the system.
   ```



##########
framework/src/org/apache/cordova/CordovaPlugin.java:
##########
@@ -442,4 +444,17 @@ public void onRequestPermissionsResult(int requestCode, 
String[] permissions,
     public CordovaPluginPathHandler getPathHandler() {
         return null;
     }
+
+    /**
+     * Called when the WebView's render process has exited.
+     *
+     * See <a 
href="https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)">WebViewClient#onRenderProcessGone</a>
+     *
+     * @return  true if the host application handled the situation that 
process has exited,
+     *          otherwise, application will crash if render process crashed, 
or be killed
+     *          if render process was killed by the system.

Review Comment:
   Not sure if github UI messed with the formatting, so if the formatting got 
broken, then I apologize.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to