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


##########
framework/src/org/apache/cordova/PluginManager.java:
##########
@@ -617,4 +618,29 @@ public ArrayList<CordovaPluginPathHandler> 
getPluginPathHandlers() {
         }
         return handlers;
     }
+
+    /**
+     * Called when the WebView's render process has exited.
+     *
+     * See 
https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)
+     *
+     * @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.
+     */
+    public boolean onRenderProcessGone(RenderProcessGoneDetail detail) {
+        boolean result = false;
+        synchronized (this.entryMap) {
+            for (PluginEntry entry : this.entryMap.values()) {
+                CordovaPlugin plugin = pluginMap.get(entry.service);
+                if (plugin != null) {
+                    if (plugin.onRenderProcessGone(app, detail)) {

Review Comment:
   That's a good point @breautek!
   
   I've made the change so that the original webview is passed down instead.
   There may be some plugins that want to listen to every crash (e.g., a crash 
report integration plugin of some sort), but would theoretically allow the core 
plugins to be extended to recreate the webview after a crash.



-- 
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