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

Unified Diff: base/android/build_info.h

Issue 9838033: Upstream native crash handling changes for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: breakpad gyp changes Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/android/build_info.cc » ('j') | base/android/build_info.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/build_info.h
diff --git a/base/android/build_info.h b/base/android/build_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1e7dae1596bbd9e0d97b27d278c8fbff258ffde
--- /dev/null
+++ b/base/android/build_info.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_BUILD_INFO_H_
+#define BASE_ANDROID_BUILD_INFO_H_
+
+#include <jni.h>
+#include <string>
Mark Mentovai 2012/04/05 14:28:03 Separate C system headers from C++ system headers
carlosvaldivia 2012/04/05 18:35:56 Done.
+
+namespace base {
+namespace android {
+
+
Mark Mentovai 2012/04/05 14:28:03 Get rid of this extra blank line and the one at li
carlosvaldivia 2012/04/05 18:35:56 Done.
+// BuildInfo is a singleton class that stores android build and device
+// information.
+class BuildInfo {
+ public:
+
+ // Static factory method for getting the singleton BuildInfo instance.
Mark Mentovai 2012/04/05 14:28:03 Observe the proper ordering within a class, per ht
carlosvaldivia 2012/04/05 18:35:56 Done.
+ static const BuildInfo* const GetInstance();
Mark Mentovai 2012/04/05 14:28:03 Say somewhere that this leaks all of its data and
Mark Mentovai 2012/04/05 14:28:03 Consider using a Singleton (base/memory/singleton.
carlosvaldivia 2012/04/05 18:35:56 Done.
carlosvaldivia 2012/04/05 18:35:56 I'll get to that along with the linux/posix_breakp
+
+ ~BuildInfo() {};
Mark Mentovai 2012/04/05 14:28:03 The semicolon; is unnecessary.
carlosvaldivia 2012/04/05 18:35:56 Done.
+
+ // We use const char* instead of std::strings because we need to have these
Mark Mentovai 2012/04/05 14:28:03 Don”t write “we” in comments.
carlosvaldivia 2012/04/05 18:35:56 Done.
+ // values available even if the process is in a crash state. Sadly
+ // std::string.c_str() doesn't guarantee that memory won't be allocated when
+ // it is called.
+ const char* device;
Mark Mentovai 2012/04/05 14:28:03 Data members should always be private. http://goog
carlosvaldivia 2012/04/05 18:35:56 Done.
+ const char* model;
+ const char* brand;
+ const char* android_build_id;
+ const char* android_build_fp;
+ const char* package_version_code;
+ const char* package_version_name;
+
+ private:
+ static BuildInfo* instance_;
Mark Mentovai 2012/04/05 14:28:03 private + static + used directly only in one file?
carlosvaldivia 2012/04/05 18:35:56 It is a jni wrapper. There is java code that uses
+
+ BuildInfo(
+ const char* device,
+ const char* model,
+ const char* brand,
+ const char* android_build_id,
+ const char* android_build_fp,
+ const char* package_version_code,
+ const char* package_version_name);
+
Mark Mentovai 2012/04/05 14:28:03 DISALLOW_COPY_AND_ASSIGN?
carlosvaldivia 2012/04/05 18:35:56 Done.
+};
+
+bool RegisterBuildInfo(JNIEnv* env);
+
+} // namespace android
+} // namespace base
+
+
+#endif // BASE_ANDROID_BUILD_INFO_H_
« no previous file with comments | « no previous file | base/android/build_info.cc » ('j') | base/android/build_info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698