diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index cf9101eae32..573e9433987 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -666,11 +666,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt GetChannel()->CloseClientFileDescriptor(); #ifdef MOZ_WIDGET_COCOA - if (!process) { - SetErrorState(); - return false; - } - // Wait for the child process to send us its 'task_t' data. const int kTimeoutMs = 10000; @@ -680,20 +675,17 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt if (err != KERN_SUCCESS) { std::string errString = StringPrintf("0x%x %s", err, mach_error_string(err)); LOG(ERROR) << "parent WaitForMessage() failed: " << errString; - SetErrorState(); return false; } task_t child_task = child_message.GetTranslatedPort(0); if (child_task == MACH_PORT_NULL) { LOG(ERROR) << "parent GetTranslatedPort(0) failed."; - SetErrorState(); return false; } if (child_message.GetTranslatedPort(1) == MACH_PORT_NULL) { LOG(ERROR) << "parent GetTranslatedPort(1) failed."; - SetErrorState(); return false; } MachPortSender parent_sender(child_message.GetTranslatedPort(1)); @@ -701,7 +693,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt MachSendMessage parent_message(/* id= */0); if (!parent_message.AddDescriptor(bootstrap_port)) { LOG(ERROR) << "parent AddDescriptor(" << bootstrap_port << ") failed."; - SetErrorState(); return false; } @@ -709,7 +700,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt if (err != KERN_SUCCESS) { std::string errString = StringPrintf("0x%x %s", err, mach_error_string(err)); LOG(ERROR) << "parent SendMessage() failed: " << errString; - SetErrorState(); return false; } #endif @@ -770,13 +760,14 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector& aExt #else # error Sorry -#endif // OS_POSIX +#endif if (!process) { - SetErrorState(); + MonitorAutoLock lock(mMonitor); + mProcessState = PROCESS_ERROR; + lock.Notify(); return false; } - // NB: on OS X, we block much longer than we need to in order to // reach this call, waiting for the child process's task_t. The // best way to fix that is to refactor this file, hard. diff --git a/ipc/glue/GeckoChildProcessHost.h b/ipc/glue/GeckoChildProcessHost.h index f0489584271..ef843b2f491 100644 --- a/ipc/glue/GeckoChildProcessHost.h +++ b/ipc/glue/GeckoChildProcessHost.h @@ -177,12 +177,6 @@ private: bool RunPerformAsyncLaunch(StringVector aExtraOpts=StringVector(), base::ProcessArchitecture aArch=base::GetCurrentProcessArchitecture()); - inline void SetErrorState() { - MonitorAutoLock lock(mMonitor); - mProcessState = PROCESS_ERROR; - lock.Notify(); - } - // In between launching the subprocess and handing off its IPC // channel, there's a small window of time in which *we* might still // be the channel listener, and receive messages. That's bad