Commit 301473e2 authored by Tom Sepez's avatar Tom Sepez Committed by Commit Bot

Rename kUtilityProcessSandboxType to kServiceSandboxType

No functional changes, just gets the word "utility process" out from
under the service manager in a few places.

Change-Id: Ia31d8514c9cf2b63382c4fb36feb94571832672b
Reviewed-on: https://chromium-review.googlesource.com/693134
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505722}
parent 2e63fde9
......@@ -23,8 +23,8 @@ void SetCommandLineFlagsForSandboxType(base::CommandLine* command_line,
case SANDBOX_TYPE_UTILITY:
DCHECK(command_line->GetSwitchValueASCII(switches::kProcessType) ==
switches::kUtilityProcess);
DCHECK(!command_line->HasSwitch(switches::kUtilityProcessSandboxType));
command_line->AppendSwitchASCII(switches::kUtilityProcessSandboxType,
DCHECK(!command_line->HasSwitch(switches::kServiceSandboxType));
command_line->AppendSwitchASCII(switches::kServiceSandboxType,
switches::kUtilitySandbox);
break;
case SANDBOX_TYPE_GPU:
......@@ -34,7 +34,7 @@ void SetCommandLineFlagsForSandboxType(base::CommandLine* command_line,
case SANDBOX_TYPE_PPAPI:
if (command_line->GetSwitchValueASCII(switches::kProcessType) ==
switches::kUtilityProcess) {
command_line->AppendSwitchASCII(switches::kUtilityProcessSandboxType,
command_line->AppendSwitchASCII(switches::kServiceSandboxType,
switches::kPpapiSandbox);
} else {
DCHECK(command_line->GetSwitchValueASCII(switches::kProcessType) ==
......@@ -44,15 +44,15 @@ void SetCommandLineFlagsForSandboxType(base::CommandLine* command_line,
case SANDBOX_TYPE_NETWORK:
DCHECK(command_line->GetSwitchValueASCII(switches::kProcessType) ==
switches::kUtilityProcess);
DCHECK(!command_line->HasSwitch(switches::kUtilityProcessSandboxType));
command_line->AppendSwitchASCII(switches::kUtilityProcessSandboxType,
DCHECK(!command_line->HasSwitch(switches::kServiceSandboxType));
command_line->AppendSwitchASCII(switches::kServiceSandboxType,
switches::kNetworkSandbox);
break;
case SANDBOX_TYPE_CDM:
DCHECK(command_line->GetSwitchValueASCII(switches::kProcessType) ==
switches::kUtilityProcess);
DCHECK(!command_line->HasSwitch(switches::kUtilityProcessSandboxType));
command_line->AppendSwitchASCII(switches::kUtilityProcessSandboxType,
DCHECK(!command_line->HasSwitch(switches::kServiceSandboxType));
command_line->AppendSwitchASCII(switches::kServiceSandboxType,
switches::kCdmSandbox);
break;
default:
......@@ -74,7 +74,7 @@ SandboxType SandboxTypeFromCommandLine(const base::CommandLine& command_line) {
if (process_type == switches::kUtilityProcess) {
return UtilitySandboxTypeFromString(
command_line.GetSwitchValueASCII(switches::kUtilityProcessSandboxType));
command_line.GetSwitchValueASCII(switches::kServiceSandboxType));
}
if (process_type == switches::kGpuProcess) {
if (command_line.HasSwitch(switches::kDisableGpuSandbox))
......
......@@ -7,9 +7,9 @@
namespace service_manager {
namespace switches {
// Type of sandbox to apply to the utility process, one of the values
// in the next block.
const char kUtilityProcessSandboxType[] = "utility-sandbox-type";
// Type of sandbox to apply to the process running the service, one of the
// values in the next block.
const char kServiceSandboxType[] = "service-sandbox-type";
// Must be in sync with "sandbox_type" values as used in service manager's
// manifest.json catalog files.
......
......@@ -11,9 +11,9 @@
namespace service_manager {
namespace switches {
// Type of sandbox to apply to the utility process, one of the values
// in the next block.
SERVICE_MANAGER_SANDBOX_EXPORT extern const char kUtilityProcessSandboxType[];
// Type of sandbox to apply to the process running the service, one of the
// values in the next block.
SERVICE_MANAGER_SANDBOX_EXPORT extern const char kServiceSandboxType[];
// Must be in sync with "sandbox_type" values as used in service manager's
// manifest.json catalog files.
......
......@@ -14,8 +14,7 @@ TEST(SandboxTypeTest, Empty) {
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
EXPECT_EQ(SANDBOX_TYPE_NO_SANDBOX, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_NO_SANDBOX, SandboxTypeFromCommandLine(command_line));
EXPECT_FALSE(command_line.HasSwitch(switches::kNoSandbox));
......@@ -30,8 +29,7 @@ TEST(SandboxTypeTest, Renderer) {
switches::kRendererProcess);
EXPECT_EQ(SANDBOX_TYPE_RENDERER, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_RENDERER, SandboxTypeFromCommandLine(command_line));
EXPECT_FALSE(command_line.HasSwitch(switches::kNoSandbox));
......@@ -63,8 +61,7 @@ TEST(SandboxTypeTest, Utility) {
EXPECT_EQ(SANDBOX_TYPE_PPAPI, SandboxTypeFromCommandLine(command_line5));
base::CommandLine command_line6(command_line);
command_line6.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"bogus");
command_line6.AppendSwitchASCII(switches::kServiceSandboxType, "bogus");
EXPECT_EQ(SANDBOX_TYPE_UTILITY, SandboxTypeFromCommandLine(command_line6));
command_line.AppendSwitch(switches::kNoSandbox);
......@@ -77,8 +74,7 @@ TEST(SandboxTypeTest, GPU) {
SetCommandLineFlagsForSandboxType(&command_line, SANDBOX_TYPE_GPU);
EXPECT_EQ(SANDBOX_TYPE_GPU, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_GPU, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitch(switches::kNoSandbox);
......@@ -91,8 +87,7 @@ TEST(SandboxTypeTest, PPAPIBroker) {
switches::kPpapiBrokerProcess);
EXPECT_EQ(SANDBOX_TYPE_NO_SANDBOX, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_NO_SANDBOX, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitch(switches::kNoSandbox);
......@@ -106,8 +101,7 @@ TEST(SandboxTypeTest, PPAPIPlugin) {
SetCommandLineFlagsForSandboxType(&command_line, SANDBOX_TYPE_PPAPI);
EXPECT_EQ(SANDBOX_TYPE_PPAPI, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_PPAPI, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitch(switches::kNoSandbox);
......@@ -119,8 +113,7 @@ TEST(SandboxTypeTest, Nonesuch) {
command_line.AppendSwitchASCII(switches::kProcessType, "nonesuch");
EXPECT_EQ(SANDBOX_TYPE_INVALID, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitchASCII(switches::kUtilityProcessSandboxType,
"network");
command_line.AppendSwitchASCII(switches::kServiceSandboxType, "network");
EXPECT_EQ(SANDBOX_TYPE_INVALID, SandboxTypeFromCommandLine(command_line));
command_line.AppendSwitch(switches::kNoSandbox);
......
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