Commit 4173f201 authored by Greg Kerr's avatar Greg Kerr Committed by Commit Bot

Reland "macOS V2 Sandbox: Remove the feature flags."

This is a reland of 5c4908e8

Original change's description:
> macOS V2 Sandbox: Remove the feature flags.
>
> The V2 sandbox is now default for all but the network and GPU processes
> on macOS. This CL deletes the feature flag. A new experiment will be
> introduced for the GPU process. The default case for the sandbox profile
> switch is removed, because previous CHECK() failures were confusing to
> diagnose. All profiles must now be handled explicitly, so Chrome won't
> build if a new profile type isn't handled.
>
> Bug: 749839
> CQ-Depend: 1268671
> Change-Id: I0860d3a5148b0085be6a99dc01c4971602ee5582
> Reviewed-on: https://chromium-review.googlesource.com/c/1269996
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Mark Pearson <mpearson@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Greg Kerr <kerrnel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#598128}

CQ-DEPEND=CL:1268671

Bug: 749839
Change-Id: I91544907b640c572823f3aae3e29c0cfa003da51
Reviewed-on: https://chromium-review.googlesource.com/c/1274888Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Greg Kerr <kerrnel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598822}
parent db904e67
...@@ -2397,9 +2397,6 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -2397,9 +2397,6 @@ const FeatureEntry kFeatureEntries[] = {
SINGLE_VALUE_TYPE(switches::kTrySupportedChannelLayouts)}, SINGLE_VALUE_TYPE(switches::kTrySupportedChannelLayouts)},
#endif // OS_WIN #endif // OS_WIN
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
{"mac-v2-sandbox", flag_descriptions::kMacV2SandboxName,
flag_descriptions::kMacV2SandboxDescription, kOsMac,
FEATURE_VALUE_TYPE(features::kMacV2Sandbox)},
{"mac-views-task-manager", flag_descriptions::kMacViewsTaskManagerName, {"mac-views-task-manager", flag_descriptions::kMacViewsTaskManagerName,
flag_descriptions::kMacViewsTaskManagerDescription, kOsMac, flag_descriptions::kMacViewsTaskManagerDescription, kOsMac,
FEATURE_VALUE_TYPE(features::kViewsTaskManager)}, FEATURE_VALUE_TYPE(features::kViewsTaskManager)},
......
...@@ -2980,11 +2980,6 @@ const char kMacRTLDescription[] = "Mirrors the UI for RTL language users"; ...@@ -2980,11 +2980,6 @@ const char kMacRTLDescription[] = "Mirrors the UI for RTL language users";
const char kMacTouchBarName[] = "Hardware Touch Bar"; const char kMacTouchBarName[] = "Hardware Touch Bar";
const char kMacTouchBarDescription[] = "Control the use of the Touch Bar."; const char kMacTouchBarDescription[] = "Control the use of the Touch Bar.";
const char kMacV2SandboxName[] = "Mac V2 Sandbox";
const char kMacV2SandboxDescription[] =
"Eliminates the unsandboxed warmup phase and sandboxes processes for their "
"entire life cycle.";
const char kMacViewsNativeAppWindowsName[] = "Toolkit-Views App Windows."; const char kMacViewsNativeAppWindowsName[] = "Toolkit-Views App Windows.";
const char kMacViewsNativeAppWindowsDescription[] = const char kMacViewsNativeAppWindowsDescription[] =
"Controls whether to use Toolkit-Views based Chrome App windows."; "Controls whether to use Toolkit-Views based Chrome App windows.";
......
...@@ -1800,9 +1800,6 @@ extern const char kMacRTLDescription[]; ...@@ -1800,9 +1800,6 @@ extern const char kMacRTLDescription[];
extern const char kMacTouchBarName[]; extern const char kMacTouchBarName[];
extern const char kMacTouchBarDescription[]; extern const char kMacTouchBarDescription[];
extern const char kMacV2SandboxName[];
extern const char kMacV2SandboxDescription[];
extern const char kMacViewsNativeAppWindowsName[]; extern const char kMacViewsNativeAppWindowsName[];
extern const char kMacViewsNativeAppWindowsDescription[]; extern const char kMacViewsNativeAppWindowsDescription[];
......
...@@ -73,34 +73,8 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( ...@@ -73,34 +73,8 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
command_line_->HasSwitch(service_manager::switches::kNoSandbox) || command_line_->HasSwitch(service_manager::switches::kNoSandbox) ||
service_manager::IsUnsandboxedSandboxType(sandbox_type); service_manager::IsUnsandboxedSandboxType(sandbox_type);
// TODO(kerrnel): Delete this switch once the V2 sandbox is always enabled. bool use_v2 =
bool use_v2 = base::FeatureList::IsEnabled(features::kMacV2Sandbox); !no_sandbox && (sandbox_type != service_manager::SANDBOX_TYPE_GPU);
switch (sandbox_type) {
case service_manager::SANDBOX_TYPE_NO_SANDBOX:
break;
case service_manager::SANDBOX_TYPE_CDM:
case service_manager::SANDBOX_TYPE_PPAPI:
case service_manager::SANDBOX_TYPE_RENDERER:
case service_manager::SANDBOX_TYPE_UTILITY:
case service_manager::SANDBOX_TYPE_NACL_LOADER:
case service_manager::SANDBOX_TYPE_PDF_COMPOSITOR:
case service_manager::SANDBOX_TYPE_PROFILING:
// If the feature experiment is enabled and this process type supports
// the v2 sandbox, use it.
use_v2 &= true;
break;
case service_manager::SANDBOX_TYPE_AUDIO:
// The audio service only exists with the v2 sandbox.
use_v2 |= true;
break;
default:
// This is a 'break' because the V2 sandbox is not enabled for all
// processes yet, and so there are sandbox types like NETWORK that
// should not be run under the V2 sandbox.
use_v2 = false;
break;
}
if (use_v2 && !no_sandbox) { if (use_v2 && !no_sandbox) {
// Generate the profile string. // Generate the profile string.
...@@ -133,8 +107,16 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( ...@@ -133,8 +107,16 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
case service_manager::SANDBOX_TYPE_PROFILING: case service_manager::SANDBOX_TYPE_PROFILING:
profile += service_manager::kSeatbeltPolicyString_utility; profile += service_manager::kSeatbeltPolicyString_utility;
break; break;
default: case service_manager::SANDBOX_TYPE_NETWORK:
// Put a separate CHECK() for the network sandbox so that crash reports
// will show which invalid case was hit.
CHECK(false); CHECK(false);
break;
case service_manager::SANDBOX_TYPE_INVALID:
case service_manager::SANDBOX_TYPE_FIRST_TYPE:
case service_manager::SANDBOX_TYPE_AFTER_LAST_TYPE:
CHECK(false);
break;
} }
// Disable os logging to com.apple.diagnosticd which is a performance // Disable os logging to com.apple.diagnosticd which is a performance
......
...@@ -656,11 +656,6 @@ const base::Feature kDeviceMonitorMac{"DeviceMonitorMac", ...@@ -656,11 +656,6 @@ const base::Feature kDeviceMonitorMac{"DeviceMonitorMac",
// Enable IOSurface based screen capturer. // Enable IOSurface based screen capturer.
const base::Feature kIOSurfaceCapturer{"IOSurfaceCapturer", const base::Feature kIOSurfaceCapturer{"IOSurfaceCapturer",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// The V2 sandbox on MacOS removes the unsandboed warmup phase and sandboxes the
// entire life of the process.
const base::Feature kMacV2Sandbox{"MacV2Sandbox",
base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
enum class VideoCaptureServiceConfiguration { enum class VideoCaptureServiceConfiguration {
......
...@@ -159,7 +159,6 @@ CONTENT_EXPORT extern const base::Feature kWebUIPolymer2; ...@@ -159,7 +159,6 @@ CONTENT_EXPORT extern const base::Feature kWebUIPolymer2;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
CONTENT_EXPORT extern const base::Feature kDeviceMonitorMac; CONTENT_EXPORT extern const base::Feature kDeviceMonitorMac;
CONTENT_EXPORT extern const base::Feature kIOSurfaceCapturer; CONTENT_EXPORT extern const base::Feature kIOSurfaceCapturer;
CONTENT_EXPORT extern const base::Feature kMacV2Sandbox;
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
// DON'T ADD RANDOM STUFF HERE. Put it in the main section above in // DON'T ADD RANDOM STUFF HERE. Put it in the main section above in
......
...@@ -2415,21 +2415,6 @@ ...@@ -2415,21 +2415,6 @@
] ]
} }
], ],
"MacV2Sandbox": [
{
"platforms": [
"mac"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"MacV2Sandbox"
]
}
]
}
],
"MediaFoundationH264Encoding": [ "MediaFoundationH264Encoding": [
{ {
"platforms": [ "platforms": [
......
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