| 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 14 matching lines...) Expand all Loading... |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
| 27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
| 28 #include "components/crx_file/id_util.h" | 28 #include "components/crx_file/id_util.h" |
| 29 #include "components/update_client/configurator.h" | 29 #include "components/update_client/configurator.h" |
| 30 #include "components/update_client/crx_update_item.h" | 30 #include "components/update_client/crx_update_item.h" |
| 31 #include "components/update_client/update_client.h" | 31 #include "components/update_client/update_client.h" |
| 32 #include "components/update_client/update_client_errors.h" | 32 #include "components/update_client/update_client_errors.h" |
| 33 #include "components/update_client/update_query_params.h" | 33 #include "components/update_client/update_query_params.h" |
| 34 #include "components/update_client/updater_state.h" | 34 #include "components/update_client/updater_state.h" |
| 35 #include "components/update_client/utils_win.h" |
| 35 #include "crypto/secure_hash.h" | 36 #include "crypto/secure_hash.h" |
| 36 #include "crypto/sha2.h" | 37 #include "crypto/sha2.h" |
| 37 #include "net/base/load_flags.h" | 38 #include "net/base/load_flags.h" |
| 38 #include "net/url_request/url_fetcher.h" | 39 #include "net/url_request/url_fetcher.h" |
| 39 #include "net/url_request/url_request_context_getter.h" | 40 #include "net/url_request/url_request_context_getter.h" |
| 40 #include "net/url_request/url_request_status.h" | 41 #include "net/url_request/url_request_status.h" |
| 41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 42 | 43 |
| 43 namespace update_client { | 44 namespace update_client { |
| 44 | 45 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 | 68 |
| 68 DCHECK(crx_file::id_util::IdIsValid(id)); | 69 DCHECK(crx_file::id_util::IdIsValid(id)); |
| 69 | 70 |
| 70 return id; | 71 return id; |
| 71 } | 72 } |
| 72 | 73 |
| 73 std::string GetOSVersion() { | 74 std::string GetOSVersion() { |
| 74 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 75 int32_t major = 0; | 76 return GetWindowsOSVersion(); |
| 76 int32_t minor = 0; | |
| 77 int32_t bugfix = 0; | |
| 78 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | |
| 79 return base::StringPrintf("%d.%d.%d", major, minor, bugfix); | |
| 80 #else | 77 #else |
| 81 return base::SysInfo().OperatingSystemVersion(); | 78 return base::SysInfo().OperatingSystemVersion(); |
| 82 #endif | 79 #endif |
| 83 } | 80 } |
| 84 | 81 |
| 85 std::string GetServicePack() { | 82 std::string GetServicePack() { |
| 86 #if defined(OS_WIN) | 83 #if defined(OS_WIN) |
| 87 return base::win::OSInfo::GetInstance()->service_pack_str(); | 84 return base::win::OSInfo::GetInstance()->service_pack_str(); |
| 88 #else | 85 #else |
| 89 return std::string(); | 86 return std::string(); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 [](const GURL& url) { return !url.SchemeIsCryptographic(); }), | 332 [](const GURL& url) { return !url.SchemeIsCryptographic(); }), |
| 336 urls->end()); | 333 urls->end()); |
| 337 } | 334 } |
| 338 | 335 |
| 339 CrxInstaller::Result InstallFunctionWrapper(base::Callback<bool()> callback) { | 336 CrxInstaller::Result InstallFunctionWrapper(base::Callback<bool()> callback) { |
| 340 return CrxInstaller::Result(callback.Run() ? InstallError::NONE | 337 return CrxInstaller::Result(callback.Run() ? InstallError::NONE |
| 341 : InstallError::GENERIC_ERROR); | 338 : InstallError::GENERIC_ERROR); |
| 342 } | 339 } |
| 343 | 340 |
| 344 } // namespace update_client | 341 } // namespace update_client |
| OLD | NEW |