Commit 5cd0b59f authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Add comment to JavaExceptionReporter

Clarify the purpose of ensuring that the browser process crashes in java
rather than in native: for webview embedding apps.

Bug: None
Change-Id: I3cd847bc5a32e56ee429cd8d4ce41efa13d32209
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2064782
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742945}
parent 1d50c64e
...@@ -32,6 +32,11 @@ LazyInstance<JavaExceptionFilter>::Leaky g_java_exception_filter; ...@@ -32,6 +32,11 @@ LazyInstance<JavaExceptionFilter>::Leaky g_java_exception_filter;
void InitJavaExceptionReporter() { void InitJavaExceptionReporter() {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
// Since JavaExceptionReporter#installHandler will chain through to the
// default handler, the default handler should cause a crash as if it's a
// normal java exception. Prefer to crash the browser process in java rather
// than native since for webview, the embedding app may have installed its
// own JavaExceptionReporter handler and would expect it to be called.
constexpr bool crash_after_report = false; constexpr bool crash_after_report = false;
SetJavaExceptionFilter( SetJavaExceptionFilter(
base::BindRepeating([](const JavaRef<jthrowable>&) { return true; })); base::BindRepeating([](const JavaRef<jthrowable>&) { return true; }));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment