Bug 1401790 - Remove ProcessArchitecture from IPC. r=billm r=jimm
This was used to support cross-architecture NPAPI plugins on OS X, but
we stopped supporting that in 54 (
bug 1339182).
MozReview-Commit-ID: 2BcWYD6mguY
--- a/dom/media/gmp/GMPProcessParent.cpp
+++ b/dom/media/gmp/GMPProcessParent.cpp
@@ -18,17 +18,16 @@
#include <string>
using std::vector;
using std::string;
using mozilla::gmp::GMPProcessParent;
using mozilla::ipc::GeckoChildProcessHost;
-using base::ProcessArchitecture;
namespace mozilla {
namespace gmp {
GMPProcessParent::GMPProcessParent(const std::string& aGMPPath)
: GeckoChildProcessHost(GeckoProcessType_GMPlugin),
mGMPPath(aGMPPath)
{
@@ -73,17 +72,17 @@ GMPProcessParent::Launch(int32_t aTimeou
mAllowedFilesRead.push_back(wGMPPath + L"\\*");
}
args.push_back(WideToUTF8(wGMPPath));
#else
args.push_back(mGMPPath);
#endif
- return SyncLaunch(args, aTimeoutMs, base::GetCurrentProcessArchitecture());
+ return SyncLaunch(args, aTimeoutMs);
}
void
GMPProcessParent::Delete(nsCOMPtr<nsIRunnable> aCallback)
{
mDeletedCallback = aCallback;
XRE_GetIOMessageLoop()->PostTask(NewNonOwningRunnableMethod(
"gmp::GMPProcessParent::DoDelete", this, &GMPProcessParent::DoDelete));
--- a/dom/plugins/base/nsPluginsDirDarwin.cpp
+++ b/dom/plugins/base/nsPluginsDirDarwin.cpp
@@ -60,29 +60,16 @@ static CFBundleRef getPluginBundle(const
bundle = ::CFBundleCreate(nullptr, bundleURL);
::CFRelease(bundleURL);
}
::CFRelease(pathRef);
}
return bundle;
}
-static nsresult toCFURLRef(nsIFile* file, CFURLRef& outURL)
-{
- nsCOMPtr<nsILocalFileMac> lfm = do_QueryInterface(file);
- if (!lfm)
- return NS_ERROR_FAILURE;
- CFURLRef url;
- nsresult rv = lfm->GetCFURL(&url);
- if (NS_SUCCEEDED(rv))
- outURL = url;
-
- return rv;
-}
-
bool nsPluginsDir::IsPluginFile(nsIFile* file)
{
nsCString fileName;
file->GetNativeLeafName(fileName);
/*
* Don't load the VDP fake plugin, to avoid tripping a bad bug in OS X
* 10.5.3 (see bug 436575).
*/
@@ -357,72 +344,25 @@ static char* p2cstrdup(StringPtr pstr)
static char* GetNextPluginStringFromHandle(Handle h, short *index)
{
char *ret = p2cstrdup((unsigned char*)(*h + *index));
*index += (ret ? strlen(ret) : 0) + 1;
return ret;
}
-static bool IsCompatibleArch(nsIFile *file)
-{
- CFURLRef pluginURL = nullptr;
- if (NS_FAILED(toCFURLRef(file, pluginURL)))
- return false;
-
- bool isPluginFile = false;
-
- CFBundleRef pluginBundle = ::CFBundleCreate(kCFAllocatorDefault, pluginURL);
- if (pluginBundle) {
- UInt32 packageType, packageCreator;
- ::CFBundleGetPackageInfo(pluginBundle, &packageType, &packageCreator);
- if (packageType == 'BRPL' || packageType == 'IEPL' || packageType == 'NSPL') {
- // Get path to plugin as a C string.
- char executablePath[PATH_MAX];
- executablePath[0] = '\0';
- if (!::CFURLGetFileSystemRepresentation(pluginURL, true, (UInt8*)&executablePath, PATH_MAX)) {
- executablePath[0] = '\0';
- }
-
- uint32_t pluginLibArchitectures;
- nsresult rv = mozilla::ipc::GeckoChildProcessHost::GetArchitecturesForBinary(executablePath, &pluginLibArchitectures);
- if (NS_FAILED(rv)) {
- return false;
- }
-
- uint32_t supportedArchitectures =
-#ifdef __LP64__
- mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
-#else
- base::GetCurrentProcessArchitecture();
-#endif
-
- // Consider the plugin architecture valid if there is any overlap in the masks.
- isPluginFile = !!(supportedArchitectures & pluginLibArchitectures);
- }
- ::CFRelease(pluginBundle);
- }
-
- ::CFRelease(pluginURL);
- return isPluginFile;
-}
-
/**
* Obtains all of the information currently available for this plugin.
*/
nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary)
{
*outLibrary = nullptr;
nsresult rv = NS_OK;
- if (!IsCompatibleArch(mPlugin)) {
- return NS_ERROR_FAILURE;
- }
-
// clear out the info, except for the first field.
memset(&info, 0, sizeof(info));
// Try to get a bundle reference.
nsAutoCString path;
if (NS_FAILED(rv = mPlugin->GetNativePath(path)))
return rv;
CFBundleRef bundle = getPluginBundle(path.get());
--- a/dom/plugins/ipc/PluginProcessParent.cpp
+++ b/dom/plugins/ipc/PluginProcessParent.cpp
@@ -16,17 +16,16 @@
using std::vector;
using std::string;
using mozilla::ipc::BrowserProcessSubThread;
using mozilla::ipc::GeckoChildProcessHost;
using mozilla::plugins::LaunchCompleteTask;
using mozilla::plugins::PluginProcessParent;
-using base::ProcessArchitecture;
#ifdef XP_WIN
PluginProcessParent::PidSet* PluginProcessParent::sPidSet = nullptr;
#endif
PluginProcessParent::PluginProcessParent(const std::string& aPluginFilePath) :
GeckoChildProcessHost(GeckoProcessType_Plugin)
, mPluginFilePath(aPluginFilePath)
@@ -59,58 +58,22 @@ PluginProcessParent::Launch(mozilla::Uni
mSandboxLevel = aSandboxLevel;
#else
if (aSandboxLevel != 0) {
MOZ_ASSERT(false,
"Can't enable an NPAPI process sandbox for platform/build.");
}
#endif
- ProcessArchitecture currentArchitecture = base::GetCurrentProcessArchitecture();
- uint32_t containerArchitectures = GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
-
- uint32_t pluginLibArchitectures = currentArchitecture;
-#ifdef XP_MACOSX
- nsresult rv = GetArchitecturesForBinary(mPluginFilePath.c_str(), &pluginLibArchitectures);
- if (NS_FAILED(rv)) {
- // If the call failed just assume that we want the current architecture.
- pluginLibArchitectures = currentArchitecture;
- }
-#endif
-
- ProcessArchitecture selectedArchitecture = currentArchitecture;
- if (!(pluginLibArchitectures & containerArchitectures & currentArchitecture)) {
- // Prefererence in order: x86_64, i386, PPC. The only particularly important thing
- // about this order is that we'll prefer 64-bit architectures first.
- if (base::PROCESS_ARCH_X86_64 & pluginLibArchitectures & containerArchitectures) {
- selectedArchitecture = base::PROCESS_ARCH_X86_64;
- }
- else if (base::PROCESS_ARCH_I386 & pluginLibArchitectures & containerArchitectures) {
- selectedArchitecture = base::PROCESS_ARCH_I386;
- }
- else if (base::PROCESS_ARCH_PPC & pluginLibArchitectures & containerArchitectures) {
- selectedArchitecture = base::PROCESS_ARCH_PPC;
- }
- else if (base::PROCESS_ARCH_ARM & pluginLibArchitectures & containerArchitectures) {
- selectedArchitecture = base::PROCESS_ARCH_ARM;
- }
- else if (base::PROCESS_ARCH_MIPS & pluginLibArchitectures & containerArchitectures) {
- selectedArchitecture = base::PROCESS_ARCH_MIPS;
- }
- else {
- return false;
- }
- }
-
mLaunchCompleteTask = mozilla::Move(aLaunchCompleteTask);
vector<string> args;
args.push_back(MungePluginDsoPath(mPluginFilePath));
- bool result = AsyncLaunch(args, selectedArchitecture);
+ bool result = AsyncLaunch(args);
if (!result) {
mLaunchCompleteTask = nullptr;
}
return result;
}
void
PluginProcessParent::Delete()
--- a/ipc/chromium/src/base/process_util.h
+++ b/ipc/chromium/src/base/process_util.h
@@ -46,45 +46,16 @@
#include "mozilla/UniquePtr.h"
#if defined(OS_MACOSX)
struct kinfo_proc;
#endif
namespace base {
-// These can be used in a 32-bit bitmask.
-enum ProcessArchitecture {
- PROCESS_ARCH_I386 = 0x1,
- PROCESS_ARCH_X86_64 = 0x2,
- PROCESS_ARCH_PPC = 0x4,
- PROCESS_ARCH_ARM = 0x8,
- PROCESS_ARCH_MIPS = 0x10,
- PROCESS_ARCH_ARM64 = 0x20
-};
-
-inline ProcessArchitecture GetCurrentProcessArchitecture()
-{
- base::ProcessArchitecture currentArchitecture;
-#if defined(ARCH_CPU_X86)
- currentArchitecture = base::PROCESS_ARCH_I386;
-#elif defined(ARCH_CPU_X86_64)
- currentArchitecture = base::PROCESS_ARCH_X86_64;
-#elif defined(ARCH_CPU_PPC)
- currentArchitecture = base::PROCESS_ARCH_PPC;
-#elif defined(ARCH_CPU_ARMEL)
- currentArchitecture = base::PROCESS_ARCH_ARM;
-#elif defined(ARCH_CPU_MIPS)
- currentArchitecture = base::PROCESS_ARCH_MIPS;
-#elif defined(ARCH_CPU_ARM64)
- currentArchitecture = base::PROCESS_ARCH_ARM64;
-#endif
- return currentArchitecture;
-}
-
// A minimalistic but hopefully cross-platform set of exit codes.
// Do not change the enumeration values or you will break third-party
// installers.
enum {
PROCESS_END_NORMAL_TERMINATON = 0,
PROCESS_END_KILLED_BY_USER = 1,
PROCESS_END_PROCESS_WAS_HUNG = 2
};
@@ -158,18 +129,17 @@ typedef std::vector<std::pair<int, int>
bool LaunchApp(const std::vector<std::string>& argv,
const file_handle_mapping_vector& fds_to_remap,
bool wait, ProcessHandle* process_handle);
typedef std::map<std::string, std::string> environment_map;
bool LaunchApp(const std::vector<std::string>& argv,
const file_handle_mapping_vector& fds_to_remap,
const environment_map& env_vars_to_set,
- bool wait, ProcessHandle* process_handle,
- ProcessArchitecture arch=GetCurrentProcessArchitecture());
+ bool wait, ProcessHandle* process_handle);
// Deleter for the array of strings allocated within BuildEnvironmentArray.
struct FreeEnvVarsArray
{
void operator()(char** array);
};
typedef mozilla::UniquePtr<char*[], FreeEnvVarsArray> EnvironmentArray;
--- a/ipc/chromium/src/base/process_util_bsd.cc
+++ b/ipc/chromium/src/base/process_util_bsd.cc
@@ -29,18 +29,17 @@ bool LaunchApp(const std::vector<std::st
bool wait, ProcessHandle* process_handle) {
return LaunchApp(argv, fds_to_remap, environment_map(),
wait, process_handle);
}
bool LaunchApp(const std::vector<std::string>& argv,
const file_handle_mapping_vector& fds_to_remap,
const environment_map& env_vars_to_set,
- bool wait, ProcessHandle* process_handle,
- ProcessArchitecture arch) {
+ bool wait, ProcessHandle* process_handle) {
bool retval = true;
char* argv_copy[argv.size() + 1];
for (size_t i = 0; i < argv.size(); i++) {
argv_copy[i] = const_cast<char*>(argv[i].c_str());
}
argv_copy[argv.size()] = NULL;
--- a/ipc/chromium/src/base/process_util_linux.cc
+++ b/ipc/chromium/src/base/process_util_linux.cc
@@ -29,18 +29,17 @@ bool LaunchApp(const std::vector<std::st
bool wait, ProcessHandle* process_handle) {
return LaunchApp(argv, fds_to_remap, environment_map(),
wait, process_handle);
}
bool LaunchApp(const std::vector<std::string>& argv,
const file_handle_mapping_vector& fds_to_remap,
const environment_map& env_vars_to_set,
- bool wait, ProcessHandle* process_handle,
- ProcessArchitecture arch) {
+ bool wait, ProcessHandle* process_handle) {
mozilla::UniquePtr<char*[]> argv_cstr(new char*[argv.size() + 1]);
// Illegal to allocate memory after fork and before execvp
InjectiveMultimap fd_shuffle1, fd_shuffle2;
fd_shuffle1.reserve(fds_to_remap.size());
fd_shuffle2.reserve(fds_to_remap.size());
EnvironmentArray envp = BuildEnvironmentArray(env_vars_to_set);
--- a/ipc/chromium/src/base/process_util_mac.mm
+++ b/ipc/chromium/src/base/process_util_mac.mm
@@ -28,18 +28,17 @@ bool LaunchApp(const std::vector<std::st
bool wait, ProcessHandle* process_handle) {
return LaunchApp(argv, fds_to_remap, environment_map(),
wait, process_handle);
}
bool LaunchApp(const std::vector<std::string>& argv,
const file_handle_mapping_vector& fds_to_remap,
const environment_map& env_vars_to_set,
- bool wait, ProcessHandle* process_handle,
- ProcessArchitecture arch) {
+ bool wait, ProcessHandle* process_handle) {
bool retval = true;
char* argv_copy[argv.size() + 1];
for (size_t i = 0; i < argv.size(); i++) {
argv_copy[i] = const_cast<char*>(argv[i].c_str());
}
argv_copy[argv.size()] = NULL;
@@ -67,50 +66,24 @@ bool LaunchApp(const std::vector<std::st
}
} else {
if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) {
return false;
}
}
}
- // Set up the CPU preference array.
- cpu_type_t cpu_types[1];
- switch (arch) {
- case PROCESS_ARCH_I386:
- cpu_types[0] = CPU_TYPE_X86;
- break;
- case PROCESS_ARCH_X86_64:
- cpu_types[0] = CPU_TYPE_X86_64;
- break;
- case PROCESS_ARCH_PPC:
- cpu_types[0] = CPU_TYPE_POWERPC;
- break;
- default:
- cpu_types[0] = CPU_TYPE_ANY;
- break;
- }
-
- // Initialize spawn attributes.
posix_spawnattr_t spawnattr;
if (posix_spawnattr_init(&spawnattr) != 0) {
return false;
}
auto spawnattr_guard = mozilla::MakeScopeExit([&spawnattr] {
posix_spawnattr_destroy(&spawnattr);
});
- // Set spawn attributes.
- size_t attr_count = 1;
- size_t attr_ocount = 0;
- if (posix_spawnattr_setbinpref_np(&spawnattr, attr_count, cpu_types, &attr_ocount) != 0 ||
- attr_ocount != attr_count) {
- return false;
- }
-
// Prevent the child process from inheriting any file descriptors
// that aren't named in `file_actions`. (This is an Apple-specific
// extension to posix_spawn.)
if (posix_spawnattr_setflags(&spawnattr, POSIX_SPAWN_CLOEXEC_DEFAULT) != 0) {
return false;
}
// Exempt std{in,out,err} from being closed by POSIX_SPAWN_CLOEXEC_DEFAULT.
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -204,87 +204,16 @@ public:
{
::CFRelease(mObject);
}
private:
CFTypeRef mObject;
};
#endif
-nsresult GeckoChildProcessHost::GetArchitecturesForBinary(const char *path, uint32_t *result)
-{
- *result = 0;
-
-#ifdef MOZ_WIDGET_COCOA
- CFURLRef url = ::CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
- (const UInt8*)path,
- strlen(path),
- false);
- if (!url) {
- return NS_ERROR_FAILURE;
- }
- AutoCFTypeObject autoPluginContainerURL(url);
-
- CFArrayRef pluginContainerArchs = ::CFBundleCopyExecutableArchitecturesForURL(url);
- if (!pluginContainerArchs) {
- return NS_ERROR_FAILURE;
- }
- AutoCFTypeObject autoPluginContainerArchs(pluginContainerArchs);
-
- CFIndex pluginArchCount = ::CFArrayGetCount(pluginContainerArchs);
- for (CFIndex i = 0; i < pluginArchCount; i++) {
- CFNumberRef currentArch = static_cast<CFNumberRef>(::CFArrayGetValueAtIndex(pluginContainerArchs, i));
- int currentArchInt = 0;
- if (!::CFNumberGetValue(currentArch, kCFNumberIntType, ¤tArchInt)) {
- continue;
- }
- switch (currentArchInt) {
- case kCFBundleExecutableArchitectureI386:
- *result |= base::PROCESS_ARCH_I386;
- break;
- case kCFBundleExecutableArchitectureX86_64:
- *result |= base::PROCESS_ARCH_X86_64;
- break;
- case kCFBundleExecutableArchitecturePPC:
- *result |= base::PROCESS_ARCH_PPC;
- break;
- default:
- break;
- }
- }
-
- return (*result ? NS_OK : NS_ERROR_FAILURE);
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-uint32_t GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType type)
-{
-#ifdef MOZ_WIDGET_COCOA
- if (type == GeckoProcessType_Plugin) {
-
- // Cache this, it shouldn't ever change.
- static uint32_t pluginContainerArchs = 0;
- if (pluginContainerArchs == 0) {
- FilePath exePath;
- GetPathToBinary(exePath, type);
- nsresult rv = GetArchitecturesForBinary(exePath.value().c_str(), &pluginContainerArchs);
- NS_ASSERTION(NS_SUCCEEDED(rv) && pluginContainerArchs != 0, "Getting architecture of plugin container failed!");
- if (NS_FAILED(rv) || pluginContainerArchs == 0) {
- pluginContainerArchs = base::GetCurrentProcessArchitecture();
- }
- }
- return pluginContainerArchs;
- }
-#endif
-
- return base::GetCurrentProcessArchitecture();
-}
-
// We start the unique IDs at 1 so that 0 can be used to mean that
// a component has no unique ID assigned to it.
uint32_t GeckoChildProcessHost::sNextUniqueID = 1;
/* static */
uint32_t
GeckoChildProcessHost::GetUniqueID()
{
@@ -367,49 +296,44 @@ void GeckoChildProcessHost::InitWindowsG
} else {
mGroupId.Assign('-');
}
}
}
#endif
bool
-GeckoChildProcessHost::SyncLaunch(std::vector<std::string> aExtraOpts, int aTimeoutMs, base::ProcessArchitecture arch)
+GeckoChildProcessHost::SyncLaunch(std::vector<std::string> aExtraOpts, int aTimeoutMs)
{
PrepareLaunch();
MessageLoop* ioLoop = XRE_GetIOMessageLoop();
NS_ASSERTION(MessageLoop::current() != ioLoop, "sync launch from the IO thread NYI");
- ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>,
- base::ProcessArchitecture>(
+ ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>>(
"ipc::GeckoChildProcessHost::RunPerformAsyncLaunch",
this,
&GeckoChildProcessHost::RunPerformAsyncLaunch,
- aExtraOpts,
- arch));
+ aExtraOpts));
return WaitUntilConnected(aTimeoutMs);
}
bool
-GeckoChildProcessHost::AsyncLaunch(std::vector<std::string> aExtraOpts,
- base::ProcessArchitecture arch)
+GeckoChildProcessHost::AsyncLaunch(std::vector<std::string> aExtraOpts)
{
PrepareLaunch();
MessageLoop* ioLoop = XRE_GetIOMessageLoop();
- ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>,
- base::ProcessArchitecture>(
+ ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>>(
"ipc::GeckoChildProcessHost::RunPerformAsyncLaunch",
this,
&GeckoChildProcessHost::RunPerformAsyncLaunch,
- aExtraOpts,
- arch));
+ aExtraOpts));
// This may look like the sync launch wait, but we only delay as
// long as it takes to create the channel.
MonitorAutoLock lock(mMonitor);
while (mProcessState < CHANNEL_INITIALIZED) {
lock.Wait();
}
@@ -455,23 +379,21 @@ GeckoChildProcessHost::WaitUntilConnecte
}
bool
GeckoChildProcessHost::LaunchAndWaitForProcessHandle(StringVector aExtraOpts)
{
PrepareLaunch();
MessageLoop* ioLoop = XRE_GetIOMessageLoop();
- ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>,
- base::ProcessArchitecture>(
+ ioLoop->PostTask(NewNonOwningRunnableMethod<std::vector<std::string>>(
"ipc::GeckoChildProcessHost::RunPerformAsyncLaunch",
this,
&GeckoChildProcessHost::RunPerformAsyncLaunch,
- aExtraOpts,
- base::GetCurrentProcessArchitecture()));
+ aExtraOpts));
MonitorAutoLock lock(mMonitor);
while (mProcessState < PROCESS_CREATED) {
lock.Wait();
}
MOZ_ASSERT(mProcessState == PROCESS_ERROR || mChildProcessHandle);
return mProcessState < PROCESS_ERROR;
@@ -553,17 +475,17 @@ GeckoChildProcessHost::SetChildLogName(c
// Passing temporary to PR_SetEnv is ok here if we keep the temporary
// for the time we launch the sub-process. It's copied to the new
// environment.
PR_SetEnv(buffer.BeginReading());
}
bool
-GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts, base::ProcessArchitecture arch)
+GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
{
#ifdef MOZ_GECKO_PROFILER
AutoSetProfilerEnvVarsForChildProcess profilerEnvironment;
#endif
const char* origNSPRLogName = PR_GetEnv("NSPR_LOG_FILE");
const char* origMozLogName = PR_GetEnv("MOZ_LOG_FILE");
const char* origRustLog = PR_GetEnv("RUST_LOG");
@@ -600,39 +522,38 @@ GeckoChildProcessHost::PerformAsyncLaunc
mRestoreOrigRustLog.AssignLiteral("RUST_LOG=");
mRestoreOrigRustLog.Append(origRustLog);
}
rustLog.AssignLiteral("RUST_LOG=");
rustLog.Append(childRustLog);
PR_SetEnv(rustLog.get());
}
- bool retval = PerformAsyncLaunchInternal(aExtraOpts, arch);
+ bool retval = PerformAsyncLaunchInternal(aExtraOpts);
// Revert to original value
if (origNSPRLogName) {
PR_SetEnv(mRestoreOrigNSPRLogName.get());
}
if (origMozLogName) {
PR_SetEnv(mRestoreOrigMozLogName.get());
}
if (origRustLog) {
PR_SetEnv(mRestoreOrigRustLog.get());
}
return retval;
}
bool
-GeckoChildProcessHost::RunPerformAsyncLaunch(std::vector<std::string> aExtraOpts,
- base::ProcessArchitecture aArch)
+GeckoChildProcessHost::RunPerformAsyncLaunch(std::vector<std::string> aExtraOpts)
{
InitializeChannel();
- bool ok = PerformAsyncLaunch(aExtraOpts, aArch);
+ bool ok = PerformAsyncLaunch(aExtraOpts);
if (!ok) {
// WaitUntilConnected might be waiting for us to signal.
// If something failed let's set the error state and notify.
MonitorAutoLock lock(mMonitor);
mProcessState = PROCESS_ERROR;
lock.Notify();
CHROMIUM_LOG(ERROR) << "Failed to launch " <<
XRE_ChildProcessTypeToString(mProcessType) << " subprocess";
@@ -689,17 +610,17 @@ AddAppDirToCommandLine(std::vector<std::
aCmdLine.push_back(path.get());
}
#endif
}
}
}
bool
-GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExtraOpts, base::ProcessArchitecture arch)
+GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExtraOpts)
{
// We rely on the fact that InitializeChannel() has already been processed
// on the IO thread before this point is reached.
if (!GetChannel()) {
return false;
}
base::ProcessHandle process = 0;
@@ -906,17 +827,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
# if defined(MOZ_WIDGET_ANDROID)
LaunchAndroidService(childProcessType, childArgv, mFileMap, &process);
# else // goes with defined(MOZ_WIDGET_ANDROID)
base::LaunchApp(childArgv, mFileMap,
# if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS)
newEnvVars,
# endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS)
- false, &process, arch);
+ false, &process);
# endif // defined(MOZ_WIDGET_ANDROID)
// We're in the parent and the child was launched. Close the child FD in the
// parent as soon as possible, which will allow the parent to detect when the
// child closes its FD (either due to normal exit or due to crash).
GetChannel()->CloseClientFileDescriptor();
# ifdef MOZ_WIDGET_COCOA
--- a/ipc/glue/GeckoChildProcessHost.h
+++ b/ipc/glue/GeckoChildProcessHost.h
@@ -37,27 +37,22 @@ protected:
public:
typedef base::ProcessHandle ProcessHandle;
explicit GeckoChildProcessHost(GeckoProcessType aProcessType,
bool aIsFileContent = false);
~GeckoChildProcessHost();
- static nsresult GetArchitecturesForBinary(const char *path, uint32_t *result);
-
- static uint32_t GetSupportedArchitecturesForProcessType(GeckoProcessType type);
-
static uint32_t GetUniqueID();
// Block until the IPC channel for our subprocess is initialized,
// but no longer. The child process may or may not have been
// created when this method returns.
- bool AsyncLaunch(StringVector aExtraOpts=StringVector(),
- base::ProcessArchitecture arch=base::GetCurrentProcessArchitecture());
+ bool AsyncLaunch(StringVector aExtraOpts=StringVector());
virtual bool WaitUntilConnected(int32_t aTimeoutMs = 0);
// Block until the IPC channel for our subprocess is initialized and
// the OS process is created. The subprocess may or may not have
// connected back to us when this method returns.
//
// NB: on POSIX, this method is relatively cheap, and doesn't
@@ -69,21 +64,19 @@ public:
// we return. But we don't know if dynamic linking succeeded on
// either platform.
bool LaunchAndWaitForProcessHandle(StringVector aExtraOpts=StringVector());
// Block until the child process has been created and it connects to
// the IPC channel, meaning it's fully initialized. (Or until an
// error occurs.)
bool SyncLaunch(StringVector aExtraOpts=StringVector(),
- int32_t timeoutMs=0,
- base::ProcessArchitecture arch=base::GetCurrentProcessArchitecture());
+ int32_t timeoutMs=0);
- virtual bool PerformAsyncLaunch(StringVector aExtraOpts=StringVector(),
- base::ProcessArchitecture aArch=base::GetCurrentProcessArchitecture());
+ virtual bool PerformAsyncLaunch(StringVector aExtraOpts=StringVector());
virtual void OnChannelConnected(int32_t peer_pid);
virtual void OnMessageReceived(IPC::Message&& aMsg);
virtual void OnChannelError();
virtual void GetQueuedMessages(std::queue<IPC::Message>& queue);
virtual void InitializeChannel();
@@ -169,21 +162,19 @@ protected:
#endif
bool OpenPrivilegedHandle(base::ProcessId aPid);
private:
DISALLOW_EVIL_CONSTRUCTORS(GeckoChildProcessHost);
// Does the actual work for AsyncLaunch, on the IO thread.
- bool PerformAsyncLaunchInternal(std::vector<std::string>& aExtraOpts,
- base::ProcessArchitecture arch);
+ bool PerformAsyncLaunchInternal(std::vector<std::string>& aExtraOpts);
- bool RunPerformAsyncLaunch(StringVector aExtraOpts=StringVector(),
- base::ProcessArchitecture aArch=base::GetCurrentProcessArchitecture());
+ bool RunPerformAsyncLaunch(StringVector aExtraOpts=StringVector());
enum class BinaryPathType {
Self,
PluginContainer
};
static BinaryPathType GetPathToBinary(FilePath& exePath, GeckoProcessType processType);