Reviewers: Torne, sgurun
CL:
https://codereview.chromium.org/2662143002/Description:
Kill the app when render process is killed
For backward compatible, kill the app when render process was killed
and the event wasn't handled by app.
BUG=686199
Affected files (+13, -3 lines):
M android_webview/browser/aw_browser_terminator.cc
Index: android_webview/browser/aw_browser_terminator.cc
diff --git a/android_webview/browser/aw_browser_terminator.cc b/android_webview/browser/aw_browser_terminator.cc
index 34052e0a0994061b923adf220440b694cdf84f89..77185d0982a7734f7875caa6d933002dabda8093 100644
--- a/android_webview/browser/aw_browser_terminator.cc
+++ b/android_webview/browser/aw_browser_terminator.cc
@@ -67,9 +67,19 @@ void OnRenderProcessGoneDetail(int child_process_id, bool crashed) {
GetAwRenderProcessGoneDelegatesForRenderProcess(child_process_id, &delegates);
for (auto delegate : delegates) {
if (!delegate->OnRenderProcessGoneDetail(child_process_id, crashed)) {
- // Keeps this log unchanged, CTS test uses it to detect crash.
- LOG(FATAL) << "Render process's abnormal termination wasn't handled by"
- << " all associated webviews, triggering application crash";
+ if (crashed) {
+ // Keeps this log unchanged, CTS test uses it to detect crash.
+ LOG(FATAL) << "Render process's crash wasn't handled by all associated"
+ << " webviews, triggering application crash";
+ } else {
+ // The render process was most likely killed for OOM or switching
+ // WebView provider, to make WebView backward compatible, kills the
+ // browser process instead of triggering crash.
+ LOG(ERROR) << "The event of render process has been killed wasn't"
+ << " handled by all associated webviews, killing the"
+ << " process.";
+ kill(getpid(), SIGKILL);
+ }
}
}
}