Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / android / java_exception_reporter.cc
blobe5a15a8610e7d86e544a8ee7320951d32073cdce
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/android/java_exception_reporter.h"
7 #include "base/android/build_info.h"
8 #include "base/android/jni_android.h"
9 #include "base/debug/dump_without_crashing.h"
10 #include "jni/JavaExceptionReporter_jni.h"
12 namespace chrome {
13 namespace android {
15 void InitJavaExceptionReporter() {
16 JNIEnv* env = base::android::AttachCurrentThread();
17 Java_JavaExceptionReporter_installHandler(env);
20 void ReportJavaException(JNIEnv* env, jclass jcaller, jobject e) {
21 jthrowable java_throwable = static_cast<jthrowable>(e);
22 // Set the exception_string in BuildInfo so that breakpad can read it.
23 base::android::BuildInfo::GetInstance()->SetJavaExceptionInfo(
24 base::android::GetJavaExceptionInfo(env, java_throwable));
25 base::debug::DumpWithoutCrashing();
26 base::android::BuildInfo::GetInstance()->ClearJavaExceptionInfo();
29 bool RegisterJavaExceptionReporterJni(JNIEnv* env) {
30 return RegisterNativesImpl(env);
34 } // namespace android
35 } // namespace chrome