mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 957883: Handle channel errors during process launch such that we don't sit on a dead channel for the full time-out (e.g. 45 secs for NPAPI), and allow us to detect when an error happens during child process init. Also, now that it's possible, actually check for an error during NPAPI child process init. r=bsmedberg
This commit is contained in:
parent
96409b9e9d
commit
426e0ce897
@ -119,11 +119,9 @@ PluginProcessChild::Init()
|
||||
return false;
|
||||
}
|
||||
|
||||
mPlugin.Init(pluginFilename, ParentHandle(),
|
||||
IOThreadChild::message_loop(),
|
||||
IOThreadChild::channel());
|
||||
|
||||
return true;
|
||||
return mPlugin.Init(pluginFilename, ParentHandle(),
|
||||
IOThreadChild::message_loop(),
|
||||
IOThreadChild::channel());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -45,7 +45,6 @@ public:
|
||||
|
||||
using mozilla::ipc::GeckoChildProcessHost::GetShutDownEvent;
|
||||
using mozilla::ipc::GeckoChildProcessHost::GetChannel;
|
||||
using mozilla::ipc::GeckoChildProcessHost::GetChildProcessHandle;
|
||||
|
||||
private:
|
||||
std::string mPluginFilePath;
|
||||
|
@ -301,7 +301,12 @@ GeckoChildProcessHost::SyncLaunch(std::vector<std::string> aExtraOpts, int aTime
|
||||
|
||||
// We'll receive several notifications, we need to exit when we
|
||||
// have either successfully launched or have timed out.
|
||||
while (mProcessState < PROCESS_CONNECTED) {
|
||||
while (mProcessState != PROCESS_CONNECTED) {
|
||||
// If there was an error then return it, don't wait out the timeout.
|
||||
if (mProcessState == PROCESS_ERROR) {
|
||||
break;
|
||||
}
|
||||
|
||||
lock.Wait(timeoutTicks);
|
||||
|
||||
if (timeoutTicks != PR_INTERVAL_NO_TIMEOUT) {
|
||||
@ -843,6 +848,15 @@ GeckoChildProcessHost::OnMessageReceived(const IPC::Message& aMsg)
|
||||
void
|
||||
GeckoChildProcessHost::OnChannelError()
|
||||
{
|
||||
// Update the process state to an error state if we have a channel
|
||||
// error before we're connected. This fixes certain failures,
|
||||
// but does not address the full range of possible issues described
|
||||
// in the FIXME comment below.
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
if (mProcessState < PROCESS_CONNECTED) {
|
||||
mProcessState = PROCESS_ERROR;
|
||||
lock.Notify();
|
||||
}
|
||||
// FIXME/bug 773925: save up this error for the next listener.
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user