Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: base/android/build_info.cc

Issue 10412045: Add java exception information to BuildInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Jay's comment Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/build_info.h ('k') | base/android/jni_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « base/android/build_info.h ('k') | base/android/jni_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698