Replace base::WStringPiece with std::string_view

Bug: chromium:691162
Change-Id: I2d34bcfd3b97d59d1811183d62b893b875b08bb4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5010942
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
This commit is contained in:
Lei Zhang 2023-11-07 12:48:40 -08:00 committed by Crashpad LUCI CQ
parent 573918571f
commit 5613499bbd
5 changed files with 9 additions and 5 deletions

2
DEPS
View File

@ -47,7 +47,7 @@ deps = {
'9719c1e1e676814c456b55f5f070eabad6709d31',
'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' +
'450b101187b5311317dec2981303f60a3a0760fb',
'9e21183c1ea369398d6f6ddd302c8db580bd19c4',
'crashpad/third_party/libfuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
'fda403cf93ecb8792cb1d061564d89a6553ca020',

View File

@ -23,6 +23,7 @@
#include <string.h>
#include <memory>
#include <string_view>
#include "base/atomicops.h"
#include "base/check_op.h"
@ -517,7 +518,7 @@ bool StartHandlerProcess(
// invalid command line where the first argument needed by rundll32 is not in
// the correct format as required in:
// https://support.microsoft.com/en-ca/help/164787/info-windows-rundll-and-rundll32-interface
const base::WStringPiece kRunDll32Exe(L"rundll32.exe");
const std::wstring_view kRunDll32Exe(L"rundll32.exe");
bool is_embedded_in_dll = false;
if (data->handler.value().size() >= kRunDll32Exe.size() &&
_wcsicmp(data->handler.value()

View File

@ -19,6 +19,7 @@
#include <algorithm>
#include <iterator>
#include <string_view>
#include <utility>
#include "base/logging.h"
@ -329,7 +330,7 @@ void ProcessSnapshotWin::InitializeUnloadedModules() {
uet.SizeOfImage,
uet.CheckSum,
uet.TimeDateStamp,
base::WideToUTF8(base::WStringPiece(
base::WideToUTF8(std::wstring_view(
uet.ImageName,
wcsnlen(uet.ImageName, std::size(uet.ImageName))))));
}

View File

@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include <string_view>
#include <type_traits>
#include "base/rand_util.h"
@ -89,7 +90,7 @@ bool UUID::InitializeFromString(const base::StringPiece& string) {
}
#if BUILDFLAG(IS_WIN)
bool UUID::InitializeFromString(const base::WStringPiece& string) {
bool UUID::InitializeFromString(const std::wstring_view& string) {
return InitializeFromString(base::WideToUTF8(string));
}
#endif

View File

@ -18,6 +18,7 @@
#include <stdint.h>
#include <string>
#include <string_view>
#include "base/strings/string_piece.h"
#include "build/build_config.h"
@ -64,7 +65,7 @@ struct UUID {
//! parsed, with the object state untouched.
bool InitializeFromString(const base::StringPiece& string);
#if BUILDFLAG(IS_WIN) || DOXYGEN
bool InitializeFromString(const base::WStringPiece& string);
bool InitializeFromString(const std::wstring_view& string);
#endif // BUILDFLAG(IS_WIN)
//! \brief Initializes the %UUID using a standard system facility to generate