| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 build_type_(StrDupJString(Java_BuildInfo_getBuildType(env))), | 61 build_type_(StrDupJString(Java_BuildInfo_getBuildType(env))), |
| 62 sdk_int_(Java_BuildInfo_getSdkInt(env)), | 62 sdk_int_(Java_BuildInfo_getSdkInt(env)), |
| 63 java_exception_info_(NULL) { | 63 java_exception_info_(NULL) { |
| 64 } | 64 } |
| 65 | 65 |
| 66 // static | 66 // static |
| 67 BuildInfo* BuildInfo::GetInstance() { | 67 BuildInfo* BuildInfo::GetInstance() { |
| 68 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); | 68 return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void BuildInfo::set_java_exception_info(const std::string& info) { | 71 void BuildInfo::SetJavaExceptionInfo(const std::string& info) { |
| 72 DCHECK(!java_exception_info_) << "info should be set only once."; | 72 DCHECK(!java_exception_info_) << "info should be set only once."; |
| 73 java_exception_info_ = strndup(info.c_str(), 4096); | 73 java_exception_info_ = strndup(info.c_str(), 4096); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void BuildInfo::ClearJavaExceptionInfo() { |
| 77 delete java_exception_info_; |
| 78 java_exception_info_ = nullptr; |
| 79 } |
| 80 |
| 76 // static | 81 // static |
| 77 bool BuildInfo::RegisterBindings(JNIEnv* env) { | 82 bool BuildInfo::RegisterBindings(JNIEnv* env) { |
| 78 return RegisterNativesImpl(env); | 83 return RegisterNativesImpl(env); |
| 79 } | 84 } |
| 80 | 85 |
| 81 } // namespace android | 86 } // namespace android |
| 82 } // namespace base | 87 } // namespace base |
| OLD | NEW |