Use char16_t instead of wchar_t in SystemSnapshotWin

This CL[1] removed the alias declaration for wchar_t
in case of Windows platform. So we cannot call base::UTF16ToUTF8 function
with wchar_t type.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1776026

BUG=chromium:1184955

Change-Id: I07f0e35176ed72df4053d2f70769166e3eebfc63
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2737079
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Adam Kallai 2021-03-05 02:13:53 +01:00 committed by Commit Bot
parent 186e542db6
commit c7ec0a84cc

View File

@ -205,7 +205,7 @@ std::string SystemSnapshotWin::CPUVendor() const {
crashpad::ScopedRegistryKey scoped_key(key);
DWORD type;
wchar_t vendor_identifier[1024];
char16_t vendor_identifier[1024];
DWORD vendor_identifier_size = sizeof(vendor_identifier);
if (RegQueryValueEx(key,
@ -219,9 +219,9 @@ std::string SystemSnapshotWin::CPUVendor() const {
}
std::string return_value;
DCHECK_EQ(vendor_identifier_size % sizeof(wchar_t), 0u);
DCHECK_EQ(vendor_identifier_size % sizeof(char16_t), 0u);
base::UTF16ToUTF8(vendor_identifier,
vendor_identifier_size / sizeof(wchar_t),
vendor_identifier_size / sizeof(char16_t),
&return_value);
return return_value.c_str();