OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/java_exception_reporter.h" | 5 #include "base/android/java_exception_reporter.h" |
6 | 6 |
7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/debug/dump_without_crashing.h" | 10 #include "base/debug/dump_without_crashing.h" |
11 #include "jni/JavaExceptionReporter_jni.h" | 11 #include "jni/JavaExceptionReporter_jni.h" |
12 | 12 |
13 using base::android::JavaParamRef; | 13 using base::android::JavaParamRef; |
14 | 14 |
15 namespace chrome { | 15 namespace base { |
16 namespace android { | 16 namespace android { |
17 | 17 |
18 void InitJavaExceptionReporter() { | 18 void InitJavaExceptionReporter() { |
19 JNIEnv* env = base::android::AttachCurrentThread(); | 19 JNIEnv* env = base::android::AttachCurrentThread(); |
20 Java_JavaExceptionReporter_installHandler(env); | 20 Java_JavaExceptionReporter_installHandler(env); |
21 } | 21 } |
22 | 22 |
23 void ReportJavaException(JNIEnv* env, | 23 void ReportJavaException(JNIEnv* env, |
24 const JavaParamRef<jclass>& jcaller, | 24 const JavaParamRef<jclass>& jcaller, |
25 const JavaParamRef<jthrowable>& e) { | 25 const JavaParamRef<jthrowable>& e) { |
(...skipping 10 matching lines...) Expand all Loading... |
36 base::android::BuildInfo::GetInstance()->SetJavaExceptionInfo( | 36 base::android::BuildInfo::GetInstance()->SetJavaExceptionInfo( |
37 ConvertJavaStringToUTF8(stackTrace)); | 37 ConvertJavaStringToUTF8(stackTrace)); |
38 base::debug::DumpWithoutCrashing(); | 38 base::debug::DumpWithoutCrashing(); |
39 base::android::BuildInfo::GetInstance()->ClearJavaExceptionInfo(); | 39 base::android::BuildInfo::GetInstance()->ClearJavaExceptionInfo(); |
40 } | 40 } |
41 | 41 |
42 bool RegisterJavaExceptionReporterJni(JNIEnv* env) { | 42 bool RegisterJavaExceptionReporterJni(JNIEnv* env) { |
43 return RegisterNativesImpl(env); | 43 return RegisterNativesImpl(env); |
44 } | 44 } |
45 | 45 |
46 | |
47 } // namespace android | 46 } // namespace android |
48 } // namespace chrome | 47 } // namespace base |
49 | |
50 | |
OLD | NEW |