Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1946)

Unified Diff: android_webview/browser/aw_browser_terminator.cc

Issue 2662143002: Kill the app when render process is killed (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
Torne 2017/01/31 11:56:41 not very clear wording; how about "Render process
michaelbai 2017/01/31 17:46:21 Done.
+ << " handled by all associated webviews, killing the"
+ << " process.";
+ kill(getpid(), SIGKILL);
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698