Rename GetIconID to GetIconId
[chromium-blink-merge.git] / chrome / browser / android / java_exception_reporter.cc
blob1d572e56adf5e07b3c6d3921b12068ea42b3bb0d
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, jthrowable e) {
21 // Set the exception_string in BuildInfo so that breakpad can read it.
22 base::android::BuildInfo::GetInstance()->SetJavaExceptionInfo(
23 base::android::GetJavaExceptionInfo(env, e));
24 base::debug::DumpWithoutCrashing();
25 base::android::BuildInfo::GetInstance()->ClearJavaExceptionInfo();
28 bool RegisterJavaExceptionReporterJni(JNIEnv* env) {
29 return RegisterNativesImpl(env);
33 } // namespace android
34 } // namespace chrome