OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BASE_ANDROID_BUILD_INFO_H_ | |
6 #define BASE_ANDROID_BUILD_INFO_H_ | |
7 | |
8 #include <jni.h> | |
9 #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.
| |
10 | |
11 namespace base { | |
12 namespace android { | |
13 | |
14 | |
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.
| |
15 // BuildInfo is a singleton class that stores android build and device | |
16 // information. | |
17 class BuildInfo { | |
18 public: | |
19 | |
20 // 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.
| |
21 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
| |
22 | |
23 ~BuildInfo() {}; | |
Mark Mentovai
2012/04/05 14:28:03
The semicolon; is unnecessary.
carlosvaldivia
2012/04/05 18:35:56
Done.
| |
24 | |
25 // 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.
| |
26 // values available even if the process is in a crash state. Sadly | |
27 // std::string.c_str() doesn't guarantee that memory won't be allocated when | |
28 // it is called. | |
29 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.
| |
30 const char* model; | |
31 const char* brand; | |
32 const char* android_build_id; | |
33 const char* android_build_fp; | |
34 const char* package_version_code; | |
35 const char* package_version_name; | |
36 | |
37 private: | |
38 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
| |
39 | |
40 BuildInfo( | |
41 const char* device, | |
42 const char* model, | |
43 const char* brand, | |
44 const char* android_build_id, | |
45 const char* android_build_fp, | |
46 const char* package_version_code, | |
47 const char* package_version_name); | |
48 | |
Mark Mentovai
2012/04/05 14:28:03
DISALLOW_COPY_AND_ASSIGN?
carlosvaldivia
2012/04/05 18:35:56
Done.
| |
49 }; | |
50 | |
51 bool RegisterBuildInfo(JNIEnv* env); | |
52 | |
53 } // namespace android | |
54 } // namespace base | |
55 | |
56 | |
57 #endif // BASE_ANDROID_BUILD_INFO_H_ | |
OLD | NEW |