| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/update_client/utils.h" | 5 #include "components/update_client/utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 DCHECK(crx_file::id_util::IdIsValid(id)); | 68 DCHECK(crx_file::id_util::IdIsValid(id)); |
| 69 | 69 |
| 70 return id; | 70 return id; |
| 71 } | 71 } |
| 72 | 72 |
| 73 std::string GetOSVersion() { | 73 std::string GetOSVersion() { |
| 74 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 75 int32_t major = 0; | 75 const auto ver = base::win::OSInfo::GetInstance()->version_number(); |
| 76 int32_t minor = 0; | 76 return base::StringPrintf("%d.%d.%d.%d", ver.major, ver.minor, ver.build, |
| 77 int32_t bugfix = 0; | 77 ver.patch); |
| 78 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | |
| 79 return base::StringPrintf("%d.%d.%d", major, minor, bugfix); | |
| 80 #else | 78 #else |
| 81 return base::SysInfo().OperatingSystemVersion(); | 79 return base::SysInfo().OperatingSystemVersion(); |
| 82 #endif | 80 #endif |
| 83 } | 81 } |
| 84 | 82 |
| 85 std::string GetServicePack() { | 83 std::string GetServicePack() { |
| 86 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
| 87 return base::win::OSInfo::GetInstance()->service_pack_str(); | 85 return base::win::OSInfo::GetInstance()->service_pack_str(); |
| 88 #else | 86 #else |
| 89 return std::string(); | 87 return std::string(); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 [](const GURL& url) { return !url.SchemeIsCryptographic(); }), | 333 [](const GURL& url) { return !url.SchemeIsCryptographic(); }), |
| 336 urls->end()); | 334 urls->end()); |
| 337 } | 335 } |
| 338 | 336 |
| 339 CrxInstaller::Result InstallFunctionWrapper(base::Callback<bool()> callback) { | 337 CrxInstaller::Result InstallFunctionWrapper(base::Callback<bool()> callback) { |
| 340 return CrxInstaller::Result(callback.Run() ? InstallError::NONE | 338 return CrxInstaller::Result(callback.Run() ? InstallError::NONE |
| 341 : InstallError::GENERIC_ERROR); | 339 : InstallError::GENERIC_ERROR); |
| 342 } | 340 } |
| 343 | 341 |
| 344 } // namespace update_client | 342 } // namespace update_client |
| OLD | NEW |