Update mini_chromium & use its new support for wide streaming in file_path

Fixes a pending issue when we eventually move to C++20.

Original author: Dean Sturtevant

Change-Id: I7bb0648c73df6b6a28a3a4debdb4524d3cd27b38
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4979733
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Eric Astor <epastor@google.com>
This commit is contained in:
Eric Astor 2023-10-26 17:51:24 +00:00 committed by Crashpad LUCI CQ
parent e17518a9e8
commit 59fc31ce00
4 changed files with 20 additions and 25 deletions

2
DEPS
View File

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

View File

@ -546,8 +546,7 @@ void Metadata::Write() {
for (const auto& report : reports_) {
const base::FilePath& path = report.file_path;
if (path.DirName() != report_dir_) {
LOG(ERROR) << path.value().c_str() << " expected to start with "
<< base::WideToUTF8(report_dir_.value());
LOG(ERROR) << path << " expected to start with " << report_dir_;
return;
}
records.push_back(MetadataFileReportRecord(report, &string_table));
@ -591,12 +590,11 @@ OperationStatus Metadata::VerifyReport(const ReportDisk& report_disk,
bool EnsureDirectory(const base::FilePath& path) {
DWORD fileattr = GetFileAttributes(path.value().c_str());
if (fileattr == INVALID_FILE_ATTRIBUTES) {
PLOG(ERROR) << "GetFileAttributes " << base::WideToUTF8(path.value());
PLOG(ERROR) << "GetFileAttributes " << path;
return false;
}
if ((fileattr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
LOG(ERROR) << "GetFileAttributes " << base::WideToUTF8(path.value())
<< ": not a directory";
LOG(ERROR) << "GetFileAttributes " << path << ": not a directory";
return false;
}
return true;
@ -878,7 +876,7 @@ OperationStatus CrashReportDatabaseWin::DeleteReport(const UUID& uuid) {
return os;
if (!DeleteFile(report_path.value().c_str())) {
PLOG(ERROR) << "DeleteFile " << base::WideToUTF8(report_path.value());
PLOG(ERROR) << "DeleteFile " << report_path;
return kFileSystemError;
}
@ -1022,8 +1020,7 @@ void CrashReportDatabaseWin::CleanOrphanedAttachments() {
if (IsDirectory(path, false)) {
UUID uuid;
if (!uuid.InitializeFromString(filename.value())) {
LOG(ERROR) << "unexpected attachment dir name "
<< filename.value().c_str();
LOG(ERROR) << "unexpected attachment dir name " << filename;
continue;
}

View File

@ -115,7 +115,7 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
for (const auto& attachment : (*attachments_)) {
FileReader file_reader;
if (!file_reader.Open(attachment)) {
LOG(ERROR) << "attachment " << attachment.value().c_str()
LOG(ERROR) << "attachment " << attachment
<< " couldn't be opened, skipping";
continue;
}
@ -124,7 +124,7 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
FileWriter* file_writer =
new_report->AddAttachment(base::WideToUTF8(filename.value()));
if (file_writer == nullptr) {
LOG(ERROR) << "attachment " << filename.value().c_str()
LOG(ERROR) << "attachment " << filename
<< " couldn't be created, skipping";
continue;
}

View File

@ -18,7 +18,6 @@
#include <windows.h>
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "util/file/directory_reader.h"
#include "util/misc/time.h"
@ -35,7 +34,7 @@ bool IsSymbolicLink(const base::FilePath& path) {
nullptr,
0));
if (!handle.is_valid()) {
PLOG(ERROR) << "FindFirstFileEx " << base::WideToUTF8(path.value());
PLOG(ERROR) << "FindFirstFileEx " << path;
return false;
}
@ -45,7 +44,7 @@ bool IsSymbolicLink(const base::FilePath& path) {
bool LoggingRemoveDirectoryImpl(const base::FilePath& path) {
if (!RemoveDirectory(path.value().c_str())) {
PLOG(ERROR) << "RemoveDirectory " << base::WideToUTF8(path.value());
PLOG(ERROR) << "RemoveDirectory " << path;
return false;
}
return true;
@ -69,13 +68,13 @@ bool FileModificationTime(const base::FilePath& path, timespec* mtime) {
flags,
nullptr));
if (!handle.is_valid()) {
PLOG(ERROR) << "CreateFile " << base::WideToUTF8(path.value());
PLOG(ERROR) << "CreateFile " << path;
return false;
}
FILETIME file_mtime;
if (!GetFileTime(handle.get(), nullptr, nullptr, &file_mtime)) {
PLOG(ERROR) << "GetFileTime " << base::WideToUTF8(path.value());
PLOG(ERROR) << "GetFileTime " << path;
return false;
}
*mtime = FiletimeToTimespecEpoch(file_mtime);
@ -90,12 +89,12 @@ bool LoggingCreateDirectory(const base::FilePath& path,
}
if (may_reuse && GetLastError() == ERROR_ALREADY_EXISTS) {
if (!IsDirectory(path, true)) {
LOG(ERROR) << base::WideToUTF8(path.value()) << " not a directory";
LOG(ERROR) << path << " not a directory";
return false;
}
return true;
}
PLOG(ERROR) << "CreateDirectory " << base::WideToUTF8(path.value());
PLOG(ERROR) << "CreateDirectory " << path;
return false;
}
@ -104,8 +103,7 @@ bool MoveFileOrDirectory(const base::FilePath& source,
if (!MoveFileEx(source.value().c_str(),
dest.value().c_str(),
IsDirectory(source, false) ? 0 : MOVEFILE_REPLACE_EXISTING)) {
PLOG(ERROR) << "MoveFileEx" << base::WideToUTF8(source.value()) << ", "
<< base::WideToUTF8(dest.value());
PLOG(ERROR) << "MoveFileEx" << source << ", " << dest;
return false;
}
return true;
@ -114,7 +112,7 @@ bool MoveFileOrDirectory(const base::FilePath& source,
bool IsRegularFile(const base::FilePath& path) {
DWORD fileattr = GetFileAttributes(path.value().c_str());
if (fileattr == INVALID_FILE_ATTRIBUTES) {
PLOG(ERROR) << "GetFileAttributes " << base::WideToUTF8(path.value());
PLOG(ERROR) << "GetFileAttributes " << path;
return false;
}
if ((fileattr & FILE_ATTRIBUTE_DIRECTORY) != 0 ||
@ -127,7 +125,7 @@ bool IsRegularFile(const base::FilePath& path) {
bool IsDirectory(const base::FilePath& path, bool allow_symlinks) {
DWORD fileattr = GetFileAttributes(path.value().c_str());
if (fileattr == INVALID_FILE_ATTRIBUTES) {
PLOG(ERROR) << "GetFileAttributes " << base::WideToUTF8(path.value());
PLOG(ERROR) << "GetFileAttributes " << path;
return false;
}
if (!allow_symlinks && (fileattr & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
@ -146,7 +144,7 @@ bool LoggingRemoveFile(const base::FilePath& path) {
}
if (!DeleteFile(path.value().c_str())) {
PLOG(ERROR) << "DeleteFile " << base::WideToUTF8(path.value());
PLOG(ERROR) << "DeleteFile " << path;
return false;
}
return true;
@ -154,7 +152,7 @@ bool LoggingRemoveFile(const base::FilePath& path) {
bool LoggingRemoveDirectory(const base::FilePath& path) {
if (IsSymbolicLink(path)) {
LOG(ERROR) << "Not a directory " << base::WideToUTF8(path.value());
LOG(ERROR) << "Not a directory " << path;
return false;
}
return LoggingRemoveDirectoryImpl(path);
@ -169,7 +167,7 @@ uint64_t GetFileSize(const base::FilePath& filepath) {
if (ret_value == 0) {
return statbuf.st_size;
}
PLOG(ERROR) << "stat " << filepath.value().c_str();
PLOG(ERROR) << "stat " << filepath;
return 0;
}