Commit 5b8c3d2a authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Chromium LUCI CQ

[base] Fix SysInfoWin for base::string16 switch

This change prepapres sys_info_win for the string of base::string16 to
std::u16string.

Bug: 911896
Change-Id: I53c2cb2127aa576d8c4f83382893c5ffdd095070
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642267
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845619}
parent 1cda6e78
......@@ -169,7 +169,7 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version,
// static
SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
constexpr base::char16 kSystemBiosInformationRegKey[] =
constexpr wchar_t kSystemBiosInformationRegKey[] =
L"HARDWARE\\DESCRIPTION\\System\\BIOS";
HardwareInfo info;
......@@ -177,15 +177,15 @@ SysInfo::HardwareInfo SysInfo::GetHardwareInfoSync() {
if (system_information_key.Open(HKEY_LOCAL_MACHINE,
kSystemBiosInformationRegKey,
KEY_READ) == ERROR_SUCCESS) {
base::string16 value16;
if (system_information_key.ReadValue(L"SystemManufacturer", &value16) ==
std::wstring value;
if (system_information_key.ReadValue(L"SystemManufacturer", &value) ==
ERROR_SUCCESS) {
info.manufacturer = base::SysWideToUTF8(value16);
info.manufacturer = base::SysWideToUTF8(value);
}
if (system_information_key.ReadValue(L"SystemProductName", &value16) ==
if (system_information_key.ReadValue(L"SystemProductName", &value) ==
ERROR_SUCCESS) {
info.model = base::SysWideToUTF8(value16);
info.model = base::SysWideToUTF8(value);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment