@@ -183,14 +183,11 @@ void GeckoChildProcessHost::Destroy() {
183183}
184184
185185// static
186- auto GeckoChildProcessHost::GetPathToBinary (FilePath& exePath,
187- GeckoProcessType processType)
188- -> BinaryPathType {
189- if (sRunSelfAsContentProc && (processType == GeckoProcessType_Content ||
190- processType == GeckoProcessType_GPU ||
191- processType == GeckoProcessType_VR ||
192- processType == GeckoProcessType_RDD ||
193- processType == GeckoProcessType_Socket)) {
186+ BinPathType GeckoChildProcessHost::GetPathToBinary (FilePath& exePath,
187+ GeckoProcessType processType) {
188+ BinPathType pathType = XRE_GetChildProcBinPathType (processType);
189+
190+ if (pathType == BinPathType::Self) {
194191#if defined(OS_WIN)
195192 wchar_t exePathBuf[MAXPATHLEN ];
196193 if (!::GetModuleFileNameW (nullptr , exePathBuf, MAXPATHLEN )) {
@@ -213,7 +210,7 @@ auto GeckoChildProcessHost::GetPathToBinary(FilePath& exePath,
213210#else
214211# error Sorry; target OS not supported yet.
215212#endif
216- return BinaryPathType::Self ;
213+ return pathType ;
217214 }
218215
219216 if (ShouldHaveDirectoryService ()) {
@@ -252,7 +249,7 @@ auto GeckoChildProcessHost::GetPathToBinary(FilePath& exePath,
252249
253250 exePath = exePath.AppendASCII (MOZ_CHILD_PROCESS_NAME );
254251
255- return BinaryPathType::PluginContainer ;
252+ return pathType ;
256253}
257254
258255#ifdef MOZ_WIDGET_COCOA
@@ -855,7 +852,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunch(
855852# endif // defined(OS_POSIX)
856853
857854 FilePath exePath;
858- BinaryPathType pathType = GetPathToBinary (exePath, mProcessType );
855+ BinPathType pathType = GetPathToBinary (exePath, mProcessType );
859856
860857 // remap the IPC socket fd to a well-known int, as the OS does for
861858 // STDOUT_FILENO, for example
@@ -871,7 +868,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunch(
871868
872869 childArgv.push_back (exePath.value ());
873870
874- if (pathType == BinaryPathType ::Self) {
871+ if (pathType == BinPathType ::Self) {
875872 childArgv.push_back (" -contentproc" );
876873 }
877874
@@ -1040,7 +1037,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunch(
10401037#elif defined(OS_WIN) // defined(OS_POSIX)
10411038
10421039 FilePath exePath;
1043- BinaryPathType pathType = GetPathToBinary (exePath, mProcessType );
1040+ BinPathType pathType = GetPathToBinary (exePath, mProcessType );
10441041
10451042# if defined(MOZ_SANDBOX) || defined(_ARM64_)
10461043 const bool isGMP = mProcessType == GeckoProcessType_GMPlugin;
@@ -1061,7 +1058,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunch(
10611058
10621059 CommandLine cmdLine (exePath.ToWStringHack ());
10631060
1064- if (pathType == BinaryPathType ::Self) {
1061+ if (pathType == BinPathType ::Self) {
10651062 cmdLine.AppendLooseValue (UTF8ToWide (" -contentproc" ));
10661063 }
10671064
@@ -1353,8 +1350,6 @@ void GeckoChildProcessHost::GetQueuedMessages(std::queue<IPC::Message>& queue) {
13531350 // We expect the next listener to take over processing of our queue.
13541351}
13551352
1356- bool GeckoChildProcessHost::sRunSelfAsContentProc (false );
1357-
13581353#ifdef MOZ_WIDGET_ANDROID
13591354void GeckoChildProcessHost::LaunchAndroidService (
13601355 const char * type, const std::vector<std::string>& argv,
0 commit comments