fix: disable the V2 sandbox on macOS

The new v2 sandbox uses system sandbox API, there does not seem to have
a way to support it in --enable-mixed-sandbox, we should probably
deprecate the API.

See https://chromium.googlesource.com/chromium/src.git/+/master/sandbox/mac/seatbelt_sandbox_design.md
This commit is contained in:
Cheng Zhao 2018-10-08 15:21:01 +09:00 committed by Jeremy Apthorp
parent 7ba287a05e
commit 878c5b663d

View file

@ -192,6 +192,13 @@ void BrowserMainParts::InitializeFeatureList() {
enable_features += std::string(",") + features::kSharedArrayBuffer.name;
auto disable_features =
cmd_line->GetSwitchValueASCII(switches::kDisableFeatures);
#if defined(OS_MACOSX)
// Disable the V2 sandbox on macOS.
// Chromium is going to use the system sandbox API of macOS for the sandbox
// implmentation, we may have to deprecate --mixed-sandbox for macOS once
// Chromium drops support for the old sandbox implmentation.
disable_features += std::string(",") + features::kMacV2Sandbox.name;
#endif
auto feature_list = std::make_unique<base::FeatureList>();
feature_list->InitializeFromCommandLine(enable_features, disable_features);
base::FeatureList::SetInstance(std::move(feature_list));