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

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

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « base/android/build_info.h ('k') | base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698