Commit 8ac3aff0 authored by Aaron Colwell's avatar Aaron Colwell Committed by Chromium LUCI CQ

Update components/nacl to use more inclusive terms.

Replacing whitelist usage with allowlist terms to bring the code in line
with our inclusive code guidelines.
https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md

No functionality has change. I simply updated comments and a few
variable names.

Bug: 842296
Change-Id: I84c6e5594eb85d5b1d5d0a56b41fa366e669ddac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638547
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: default avatarBrad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845295}
parent bc366664
......@@ -208,7 +208,7 @@ bool PnaclCanOpenFile(const std::string& filename,
pnacl_dir.empty())
return false;
// Prepend the prefix to restrict files to a whitelisted set.
// Prepend the prefix to restrict files to an allowlist set.
base::FilePath full_path = pnacl_dir.AppendASCII(
std::string(kExpectedFilePrefix) + filename);
*file_to_open = full_path;
......
......@@ -147,7 +147,7 @@ void NaClHostMessageFilter::OnLaunchNaCl(
// If we're running llc or ld for the PNaCl translator, we don't need to look
// up permissions, and we don't have the right browser state to look up some
// of the whitelisting parameters anyway.
// of the allowed parameters anyway.
if (launch_params.process_type == kPNaClTranslatorProcessType) {
uint32_t perms = launch_params.permission_bits & ppapi::PERMISSION_DEV;
content::GetIOThreadTaskRunner({})->PostTask(
......
......@@ -912,14 +912,14 @@ bool NaClProcessHost::StartPPAPIProxy(
args.permissions = permissions_;
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
DCHECK(cmdline);
std::string flag_whitelist[] = {
switches::kV,
switches::kVModule,
std::string flag_allowlist[] = {
switches::kV,
switches::kVModule,
};
for (size_t i = 0; i < base::size(flag_whitelist); ++i) {
std::string value = cmdline->GetSwitchValueASCII(flag_whitelist[i]);
for (size_t i = 0; i < base::size(flag_allowlist); ++i) {
std::string value = cmdline->GetSwitchValueASCII(flag_allowlist[i]);
if (!value.empty()) {
args.switch_names.push_back(flag_whitelist[i]);
args.switch_names.push_back(flag_allowlist[i]);
args.switch_values.push_back(value);
}
}
......
......@@ -17,7 +17,7 @@
namespace {
// Test cases in this file just make sure not-whitelisted syscalls
// Test cases in this file just make sure syscalls not in the allow list
// are appropriately disallowed. They should raise SIGSYS regardless
// of arguments. We always pass five zeros not to pass uninitialized
// values to syscalls.
......
......@@ -47,7 +47,7 @@ std::string GetCpuFeatures() {
//
// Care must be taken to avoid instructions which aren't supported by
// the NaCl sandbox. Ideally the translator would do this, but there's
// no point in not doing the whitelist here.
// no point in not doing the allowlist here.
//
// TODO(jfb) Some features are missing, either because the NaCl
// sandbox doesn't support them, because base::CPU doesn't
......
......@@ -612,13 +612,13 @@ std::string PnaclComponentURLToFilename(const std::string& url) {
base::CompareCase::SENSITIVE));
std::string r = url.substr(std::string(kPNaClTranslatorBaseUrl).length());
// Use white-listed-chars.
// Replace characters that are not allowed with '_'.
size_t replace_pos;
static const char kWhiteList[] = "abcdefghijklmnopqrstuvwxyz0123456789_";
replace_pos = r.find_first_not_of(kWhiteList);
static const char kAllowList[] = "abcdefghijklmnopqrstuvwxyz0123456789_";
replace_pos = r.find_first_not_of(kAllowList);
while (replace_pos != std::string::npos) {
r = r.replace(replace_pos, 1, "_");
replace_pos = r.find_first_not_of(kWhiteList);
replace_pos = r.find_first_not_of(kAllowList);
}
return r;
}
......@@ -1113,7 +1113,7 @@ bool ShouldUseSubzero(const PP_PNaClOptions* pnacl_options) {
// Only use Subzero for optlevel=0.
if (pnacl_options->opt_level != 0)
return false;
// Check a whitelist of architectures.
// Check a list of allowed architectures.
const char* arch = GetSandboxArch();
if (strcmp(arch, "x86-32") == 0)
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment