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 #ifndef BASE_ANDROID_BUILD_INFO_H_ | 5 #ifndef BASE_ANDROID_BUILD_INFO_H_ |
6 #define BASE_ANDROID_BUILD_INFO_H_ | 6 #define BASE_ANDROID_BUILD_INFO_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 const char* java_exception_info() const { | 105 const char* java_exception_info() const { |
106 return java_exception_info_; | 106 return java_exception_info_; |
107 } | 107 } |
108 | 108 |
109 void SetJavaExceptionInfo(const std::string& info); | 109 void SetJavaExceptionInfo(const std::string& info); |
110 | 110 |
111 void ClearJavaExceptionInfo(); | 111 void ClearJavaExceptionInfo(); |
112 | 112 |
113 static bool RegisterBindings(JNIEnv* env); | |
114 | |
115 private: | 113 private: |
116 friend struct BuildInfoSingletonTraits; | 114 friend struct BuildInfoSingletonTraits; |
117 | 115 |
118 explicit BuildInfo(JNIEnv* env); | 116 explicit BuildInfo(JNIEnv* env); |
119 | 117 |
120 // Const char* is used instead of std::strings because these values must be | 118 // Const char* is used instead of std::strings because these values must be |
121 // available even if the process is in a crash state. Sadly | 119 // available even if the process is in a crash state. Sadly |
122 // std::string.c_str() doesn't guarantee that memory won't be allocated when | 120 // std::string.c_str() doesn't guarantee that memory won't be allocated when |
123 // it is called. | 121 // it is called. |
124 const char* const device_; | 122 const char* const device_; |
(...skipping 12 matching lines...) Expand all Loading... |
137 // This is set via set_java_exception_info, not at constructor time. | 135 // This is set via set_java_exception_info, not at constructor time. |
138 const char* java_exception_info_; | 136 const char* java_exception_info_; |
139 | 137 |
140 DISALLOW_COPY_AND_ASSIGN(BuildInfo); | 138 DISALLOW_COPY_AND_ASSIGN(BuildInfo); |
141 }; | 139 }; |
142 | 140 |
143 } // namespace android | 141 } // namespace android |
144 } // namespace base | 142 } // namespace base |
145 | 143 |
146 #endif // BASE_ANDROID_BUILD_INFO_H_ | 144 #endif // BASE_ANDROID_BUILD_INFO_H_ |
OLD | NEW |