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

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: 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') | chrome/app/breakpad_posix.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..a10f4e02f70b48bc04df3b4d492dbcb6cf282461
--- /dev/null
+++ b/base/android/build_info.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 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>
+
+namespace base {
+namespace android {
+
+
+// BuildInfo is a singleton class that stores android build and device
Yaron 2012/03/26 18:51:15 Seems like you could be using base/memory/singleto
carlosvaldivia 2012/04/03 06:24:47 singleton.h doesn't appear to play well with zero-
Yaron 2012/04/03 23:54:20 I see examples of it already. E.g. CountryDataMap
carlosvaldivia 2012/04/04 20:52:34 I meant non-zero argument constructors like the on
+// information.
+class BuildInfo {
+ public:
+
+ // Static factory method for getting the singleton BuildInfo instance.
+ static const BuildInfo* const GetInstance();
+
+ ~BuildInfo() {};
+
+ // We use const char* instead of std::strings because we need to have these
+ // 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;
+ 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_;
+
+ 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);
+
+};
+
+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') | chrome/app/breakpad_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698