Fix an instance of -Wshadow.

Bug: chromium:794619
Change-Id: I4561b1019d9aeee6c25d1d4083b977d0a05abdfc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3236044
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
This commit is contained in:
Peter Kasting 2021-10-21 06:15:40 -07:00 committed by Crashpad LUCI CQ
parent 31d9206f05
commit 164b41de76

View File

@ -342,23 +342,23 @@ void CrashReportDatabase::UploadReport::InitializeAttachments() {
if (!IsDirectory(attachments_dir, /*allow_symlinks=*/false)) { if (!IsDirectory(attachments_dir, /*allow_symlinks=*/false)) {
return; return;
} }
DirectoryReader reader; DirectoryReader directory_reader;
if (!reader.Open(attachments_dir)) { if (!directory_reader.Open(attachments_dir)) {
return; return;
} }
base::FilePath filename; base::FilePath filename;
DirectoryReader::Result dir_result; DirectoryReader::Result dir_result;
while ((dir_result = reader.NextFile(&filename)) == while ((dir_result = directory_reader.NextFile(&filename)) ==
DirectoryReader::Result::kSuccess) { DirectoryReader::Result::kSuccess) {
const base::FilePath filepath(attachments_dir.Append(filename)); const base::FilePath filepath(attachments_dir.Append(filename));
std::unique_ptr<FileReader> reader(std::make_unique<FileReader>()); std::unique_ptr<FileReader> file_reader(std::make_unique<FileReader>());
if (!reader->Open(filepath)) { if (!file_reader->Open(filepath)) {
LOG(ERROR) << "attachment " << filepath.value() LOG(ERROR) << "attachment " << filepath.value()
<< " couldn't be opened, skipping"; << " couldn't be opened, skipping";
continue; continue;
} }
attachment_readers_.emplace_back(std::move(reader)); attachment_readers_.emplace_back(std::move(file_reader));
attachment_map_[filename.value()] = attachment_readers_.back().get(); attachment_map_[filename.value()] = attachment_readers_.back().get();
} }
} }