| OLD | NEW |
| 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/sys_info.h" | 5 #include "base/sys_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 Time lsb_release_time_; | 158 Time lsb_release_time_; |
| 159 SysInfo::LsbReleaseMap lsb_release_map_; | 159 SysInfo::LsbReleaseMap lsb_release_map_; |
| 160 int32_t major_version_; | 160 int32_t major_version_; |
| 161 int32_t minor_version_; | 161 int32_t minor_version_; |
| 162 int32_t bugfix_version_; | 162 int32_t bugfix_version_; |
| 163 bool is_running_on_chromeos_; | 163 bool is_running_on_chromeos_; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 static LazyInstance<ChromeOSVersionInfo> | 166 static LazyInstance<ChromeOSVersionInfo>::Leaky |
| 167 g_chrome_os_version_info = LAZY_INSTANCE_INITIALIZER; | 167 g_chrome_os_version_info = LAZY_INSTANCE_INITIALIZER; |
| 168 | 168 |
| 169 ChromeOSVersionInfo& GetChromeOSVersionInfo() { | 169 ChromeOSVersionInfo& GetChromeOSVersionInfo() { |
| 170 return g_chrome_os_version_info.Get(); | 170 return g_chrome_os_version_info.Get(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace | 173 } // namespace |
| 174 | 174 |
| 175 // static | 175 // static |
| 176 void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, | 176 void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void SysInfo::SetChromeOSVersionInfoForTest(const std::string& lsb_release, | 213 void SysInfo::SetChromeOSVersionInfoForTest(const std::string& lsb_release, |
| 214 const Time& lsb_release_time) { | 214 const Time& lsb_release_time) { |
| 215 std::unique_ptr<Environment> env(Environment::Create()); | 215 std::unique_ptr<Environment> env(Environment::Create()); |
| 216 env->SetVar(kLsbReleaseKey, lsb_release); | 216 env->SetVar(kLsbReleaseKey, lsb_release); |
| 217 env->SetVar(kLsbReleaseTimeKey, | 217 env->SetVar(kLsbReleaseTimeKey, |
| 218 DoubleToString(lsb_release_time.ToDoubleT())); | 218 DoubleToString(lsb_release_time.ToDoubleT())); |
| 219 g_chrome_os_version_info.Get().Parse(); | 219 g_chrome_os_version_info.Get().Parse(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace base | 222 } // namespace base |
| OLD | NEW |