Refactor 'whitelist' -> 'annotations whitelist'

In preparation for an upcoming change that will introduce a second
whitelist (for memory ranges), rename variables/functions to explicitly
reference the annotations whitelist.

Bug: chromium:973167
Change-Id: I1bf232e370990571230a247f9d9022d56ba4fedf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1752361
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Vlad Tsyrklevich 2019-08-13 10:57:12 -07:00 committed by Commit Bot
parent a34bca8611
commit 5a0e18e417
3 changed files with 13 additions and 12 deletions

View File

@ -140,7 +140,7 @@ bool CrashReportExceptionHandler::HandleExceptionWithConnection(
ProcessSnapshot* snapshot = nullptr;
ProcessSnapshotSanitized sanitized;
std::vector<std::string> whitelist;
std::vector<std::string> annotations_whitelist;
if (info.sanitization_information_address) {
SanitizationInformation sanitization_info;
ProcessMemoryRange range;
@ -157,7 +157,7 @@ bool CrashReportExceptionHandler::HandleExceptionWithConnection(
!ReadAnnotationsWhitelist(
range,
sanitization_info.annotations_whitelist_address,
&whitelist)) {
&annotations_whitelist)) {
Metrics::ExceptionCaptureResult(
Metrics::CaptureResult::kSanitizationInitializationFailed);
return false;
@ -165,7 +165,7 @@ bool CrashReportExceptionHandler::HandleExceptionWithConnection(
if (!sanitized.Initialize(&process_snapshot,
sanitization_info.annotations_whitelist_address
? &whitelist
? &annotations_whitelist
: nullptr,
sanitization_info.target_module_address,
sanitization_info.sanitize_stacks)) {

View File

@ -252,12 +252,12 @@ class SanitizeTest : public MultiprocessExec {
ExpectAnnotations(&snapshot, /* sanitized= */ false);
ExpectStackData(&snapshot, addrs, /* sanitized= */ false);
std::vector<std::string> whitelist;
whitelist.push_back(kWhitelistedAnnotationName);
std::vector<std::string> annotations_whitelist;
annotations_whitelist.push_back(kWhitelistedAnnotationName);
ProcessSnapshotSanitized sanitized;
ASSERT_TRUE(sanitized.Initialize(
&snapshot, &whitelist, addrs.module_address, true));
&snapshot, &annotations_whitelist, addrs.module_address, true));
ExpectAnnotations(&sanitized, /* sanitized= */ true);
ExpectStackData(&sanitized, addrs, /* sanitized= */ true);

View File

@ -21,9 +21,9 @@ namespace crashpad {
namespace {
template <typename Pointer>
bool ReadWhitelist(const ProcessMemoryRange& memory,
VMAddress whitelist_address,
std::vector<std::string>* whitelist) {
bool ReadAnnotationsWhitelist(const ProcessMemoryRange& memory,
VMAddress whitelist_address,
std::vector<std::string>* whitelist) {
if (!whitelist_address) {
return true;
}
@ -53,9 +53,10 @@ bool ReadWhitelist(const ProcessMemoryRange& memory,
bool ReadAnnotationsWhitelist(const ProcessMemoryRange& memory,
VMAddress whitelist_address,
std::vector<std::string>* whitelist) {
return memory.Is64Bit()
? ReadWhitelist<uint64_t>(memory, whitelist_address, whitelist)
: ReadWhitelist<uint32_t>(memory, whitelist_address, whitelist);
return memory.Is64Bit() ? ReadAnnotationsWhitelist<uint64_t>(
memory, whitelist_address, whitelist)
: ReadAnnotationsWhitelist<uint32_t>(
memory, whitelist_address, whitelist);
}
} // namespace crashpad