Bug 1501121 - [Mac] With sandbox early startup enabled, content processes become "Not Responding" in Activity Monitor r=Alex_Gaynor

When early sandbox setartup is enabled, revert to sending SetProcessSandbox() to the child process as before. In the child process RecvSetProcessSandbox() handler, call CGSShutdownServerConnections() and then return early if the sandbox is already enabled.

Differential Revision: https://phabricator.services.mozilla.com/D9827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Haik Aftandilian 2018-10-26 13:03:55 +00:00
Родитель dae9ed3530
Коммит 71ea515d77
2 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -1555,6 +1555,12 @@ StartMacOSContentSandbox()
#endif
}
// If the sandbox is already enabled, there's nothing more to do here.
if (Preferences::GetBool("security.sandbox.content.mac.earlyinit") &&
!recordreplay::IsRecordingOrReplaying()) {
return true;
}
nsAutoCString appPath;
if (!nsMacUtilsImpl::GetAppPath(appPath)) {
MOZ_CRASH("Error resolving child process app path");

Просмотреть файл

@ -2742,15 +2742,6 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority)
// of value to take effect.
shouldSandbox = IsContentSandboxEnabled();
#ifdef XP_MACOSX
// If the sandbox was initialized during content process
// startup, we must not send the SetProcessSandbox message.
// If early startup was pref'd off or the process is a
// middleman process, send SetProcessSandbox now.
shouldSandbox = shouldSandbox &&
(!sEarlySandboxInit || IsRecordingOrReplaying());
#endif
#ifdef XP_LINUX
if (shouldSandbox) {
MOZ_ASSERT(!mSandboxBroker);