Bug 1541130: Follow-up: Add missing parts that had been stripped out during rebase; r=froydnj, jld on a CLOSED TREE

--HG--
extra : histedit_source : 2849ecff69e5b362ac2565552e101c542b47f696
This commit is contained in:
Aaron Klotz 2019-04-08 12:55:55 -06:00
Родитель 37d285c812
Коммит dd69e6bdd5
2 изменённых файлов: 26 добавлений и 14 удалений

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

@ -136,10 +136,6 @@ class GeckoChildProcessHost : public ChildProcessHost {
// For bug 943174: Skip the EnsureProcessTerminated call in the destructor.
void SetAlreadyDead();
static void EnableSameExecutableForContentProc() {
sRunSelfAsContentProc = true;
}
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// To allow filling a MacSandboxInfo from the child
// process without an instance of RDDProcessHost.
@ -238,10 +234,8 @@ class GeckoChildProcessHost : public ChildProcessHost {
// PerformAsyncLaunch, and consolidates error handling.
void RunPerformAsyncLaunch(StringVector aExtraOpts);
enum class BinaryPathType { Self, PluginContainer };
static BinaryPathType GetPathToBinary(FilePath& exePath,
GeckoProcessType processType);
static BinPathType GetPathToBinary(FilePath& exePath,
GeckoProcessType processType);
// The buffer is passed to preserve its lifetime until we are done
// with launching the sub-process.
@ -265,8 +259,6 @@ class GeckoChildProcessHost : public ChildProcessHost {
static uint32_t sNextUniqueID;
static bool sRunSelfAsContentProc;
#if defined(MOZ_WIDGET_ANDROID)
void LaunchAndroidService(
const char* type, const std::vector<std::string>& argv,

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

@ -4904,9 +4904,9 @@ bool XRE_IsE10sParentProcess() {
return XRE_IsParentProcess() && BrowserTabsRemoteAutostart();
}
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
bool XRE_Is##xre_name##Process() { \
return XRE_GetProcessType() == GeckoProcessType_##enum_name; \
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name, bin_type) \
bool XRE_Is##xre_name##Process() { \
return XRE_GetProcessType() == GeckoProcessType_##enum_name; \
}
#include "mozilla/GeckoProcessTypes.h"
#undef GECKO_PROCESS_TYPE
@ -5072,9 +5072,29 @@ void OverrideDefaultLocaleIfNeeded() {
}
}
static bool gRunSelfAsContentProc = false;
void XRE_EnableSameExecutableForContentProc() {
if (!PR_GetEnv("MOZ_SEPARATE_CHILD_PROCESS")) {
mozilla::ipc::GeckoChildProcessHost::EnableSameExecutableForContentProc();
gRunSelfAsContentProc = true;
}
}
mozilla::BinPathType XRE_GetChildProcBinPathType(GeckoProcessType aProcessType) {
MOZ_ASSERT(aProcessType != GeckoProcessType_Default);
if (!gRunSelfAsContentProc) {
return BinPathType::PluginContainer;
}
switch (aProcessType) {
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name, bin_type) \
case GeckoProcessType_##enum_name: \
return BinPathType::bin_type;
#include "mozilla/GeckoProcessTypes.h"
#undef GECKO_PROCESS_TYPE
default:
return BinPathType::PluginContainer;
}
}