OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/android/build_info.h" | 5 #include "base/android/build_info.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ConvertJavaStringToUTF8( | 51 ConvertJavaStringToUTF8( |
52 Java_BuildInfo_getPackageVersionName(env, app_context)); | 52 Java_BuildInfo_getPackageVersionName(env, app_context)); |
53 package_version_name_ = strdup(package_version_name_str.c_str()); | 53 package_version_name_ = strdup(package_version_name_str.c_str()); |
54 } | 54 } |
55 | 55 |
56 // static | 56 // static |
57 BuildInfo* BuildInfo::GetInstance() { | 57 BuildInfo* BuildInfo::GetInstance() { |
58 return Singleton<BuildInfo, LeakySingletonTraits<BuildInfo> >::get(); | 58 return Singleton<BuildInfo, LeakySingletonTraits<BuildInfo> >::get(); |
59 } | 59 } |
60 | 60 |
| 61 void BuildInfo::set_java_exception_info(const std::string& info) { |
| 62 DCHECK(!java_exception_info_) << "info should be set only once."; |
| 63 java_exception_info_ = strndup(info.c_str(), 1024); |
| 64 } |
| 65 |
61 bool RegisterBuildInfo(JNIEnv* env) { | 66 bool RegisterBuildInfo(JNIEnv* env) { |
62 return RegisterNativesImpl(env); | 67 return RegisterNativesImpl(env); |
63 } | 68 } |
64 | 69 |
65 } // namespace android | 70 } // namespace android |
66 } // namespace base | 71 } // namespace base |
OLD | NEW |