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" |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "jni/build_info_jni.h" | 14 #include "jni/BuildInfo_jni.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // The caller takes ownership of the returned const char*. | 18 // The caller takes ownership of the returned const char*. |
19 const char* StrDupJString(const base::android::JavaRef<jstring>& java_string) { | 19 const char* StrDupJString(const base::android::JavaRef<jstring>& java_string) { |
20 std::string str = ConvertJavaStringToUTF8(java_string); | 20 std::string str = ConvertJavaStringToUTF8(java_string); |
21 return strdup(str.c_str()); | 21 return strdup(str.c_str()); |
22 } | 22 } |
23 | 23 |
24 } // namespace | 24 } // namespace |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 java_exception_info_ = strndup(info.c_str(), 1024); | 64 java_exception_info_ = strndup(info.c_str(), 1024); |
65 } | 65 } |
66 | 66 |
67 // static | 67 // static |
68 bool BuildInfo::RegisterBindings(JNIEnv* env) { | 68 bool BuildInfo::RegisterBindings(JNIEnv* env) { |
69 return RegisterNativesImpl(env); | 69 return RegisterNativesImpl(env); |
70 } | 70 } |
71 | 71 |
72 } // namespace android | 72 } // namespace android |
73 } // namespace base | 73 } // namespace base |
OLD | NEW |