diff options
Diffstat (limited to 'core/java/android/webkit/WebViewClient.java')
| -rw-r--r-- | core/java/android/webkit/WebViewClient.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index 76d3fb15d049..8703468a74a7 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -466,4 +466,31 @@ public class WebViewClient { public void onReceivedLoginRequest(WebView view, String realm, String account, String args) { } + + /** + * Notify host application that the given webview's render process has exited. + * + * Multiple WebView instances may be associated with a single render process; + * onRenderProcessGone will be called for each WebView that was affected. + * The application's implementation of this callback should only attempt to + * clean up the specific WebView given as a parameter, and should not assume + * that other WebView instances are affected. + * + * The given WebView can't be used, and should be removed from the view hierarchy, + * all references to it should be cleaned up, e.g any references in the Activity + * or other classes saved using findViewById and similar calls, etc + * + * To cause an render process crash for test purpose, the application can + * call loadUrl("chrome://crash") on the WebView. Note that multiple WebView + * instances may be affected if they share a render process, not just the + * specific WebView which loaded chrome://crash. + * + * @param view The WebView which needs to be cleaned up. + * @param detail the reason why it exited. + * @return true if the host application handled the situation that process has + * exited, otherwise, application will crash. + */ + public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) { + return false; + } } |
