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

Unified Diff: base/android/java/src/org/chromium/base/JavaExceptionReporter.java

Issue 2687193003: android: Report child exception by crashing (Closed)
Patch Set: Created 3 years, 10 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 | base/android/java_exception_reporter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/JavaExceptionReporter.java
diff --git a/base/android/java/src/org/chromium/base/JavaExceptionReporter.java b/base/android/java/src/org/chromium/base/JavaExceptionReporter.java
index ada0bae0cb206bcf16d0c3126efc7387bd52da5d..f192f78c10472d0055128700883aa9b019ff7837 100644
--- a/base/android/java/src/org/chromium/base/JavaExceptionReporter.java
+++ b/base/android/java/src/org/chromium/base/JavaExceptionReporter.java
@@ -20,18 +20,21 @@ import org.chromium.base.annotations.MainDex;
@JNINamespace("base::android")
@MainDex
public class JavaExceptionReporter implements Thread.UncaughtExceptionHandler {
- private Thread.UncaughtExceptionHandler mParent;
+ private final Thread.UncaughtExceptionHandler mParent;
+ private final boolean mCrashAfterReport;
private boolean mHandlingException;
- private JavaExceptionReporter(Thread.UncaughtExceptionHandler parent) {
+ private JavaExceptionReporter(
+ Thread.UncaughtExceptionHandler parent, boolean crashAfterReport) {
mParent = parent;
+ mCrashAfterReport = crashAfterReport;
}
@Override
public void uncaughtException(Thread t, Throwable e) {
if (!mHandlingException) {
mHandlingException = true;
- nativeReportJavaException(e);
+ nativeReportJavaException(mCrashAfterReport, e);
}
if (mParent != null) {
mParent.uncaughtException(t, e);
@@ -52,11 +55,11 @@ public class JavaExceptionReporter implements Thread.UncaughtExceptionHandler {
}
@CalledByNative
- private static void installHandler() {
- Thread.setDefaultUncaughtExceptionHandler(
- new JavaExceptionReporter(Thread.getDefaultUncaughtExceptionHandler()));
+ private static void installHandler(boolean crashAfterReport) {
+ Thread.setDefaultUncaughtExceptionHandler(new JavaExceptionReporter(
+ Thread.getDefaultUncaughtExceptionHandler(), crashAfterReport));
}
- private static native void nativeReportJavaException(Throwable e);
+ private static native void nativeReportJavaException(boolean crashAfterReport, Throwable e);
private static native void nativeReportJavaStackTrace(String stackTrace);
}
« no previous file with comments | « no previous file | base/android/java_exception_reporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698