OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sys_info.h" | 5 #include "base/sys_info.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 parsed(false) { | 33 parsed(false) { |
34 } | 34 } |
35 | 35 |
36 int32 major_version; | 36 int32 major_version; |
37 int32 minor_version; | 37 int32 minor_version; |
38 int32 bugfix_version; | 38 int32 bugfix_version; |
39 bool parsed; | 39 bool parsed; |
40 }; | 40 }; |
41 | 41 |
42 static base::LazyInstance<ChromeOSVersionNumbers> | 42 static base::LazyInstance<ChromeOSVersionNumbers> |
43 g_chrome_os_version_numbers(base::LINKER_INITIALIZED); | 43 g_chrome_os_version_numbers = LAZY_INSTANCE_INITIALIZER; |
44 | 44 |
45 // static | 45 // static |
46 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, | 46 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, |
47 int32* minor_version, | 47 int32* minor_version, |
48 int32* bugfix_version) { | 48 int32* bugfix_version) { |
49 if (!g_chrome_os_version_numbers.Get().parsed) { | 49 if (!g_chrome_os_version_numbers.Get().parsed) { |
50 // The other implementations of SysInfo don't block on the disk. | 50 // The other implementations of SysInfo don't block on the disk. |
51 // See http://code.google.com/p/chromium/issues/detail?id=60394 | 51 // See http://code.google.com/p/chromium/issues/detail?id=60394 |
52 // Perhaps the caller ought to cache this? | 52 // Perhaps the caller ought to cache this? |
53 // Temporary allowing while we work the bug out. | 53 // Temporary allowing while we work the bug out. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 minor_version); | 106 minor_version); |
107 } else { // 2 == i | 107 } else { // 2 == i |
108 StringToInt(tokenizer.token_begin(), | 108 StringToInt(tokenizer.token_begin(), |
109 tokenizer.token_end(), | 109 tokenizer.token_end(), |
110 bugfix_version); | 110 bugfix_version); |
111 } | 111 } |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 } // namespace base | 115 } // namespace base |
OLD | NEW |