Bug 911009 - Add error handling for state of ChannelError when opening a ProcessLink. r=cjones

This commit is contained in:
Shelly Lin 2013-09-06 10:53:15 +08:00
Родитель 441de4144e
Коммит 305dfa6604
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -158,8 +158,9 @@ AsyncChannel::ProcessLink::Open(mozilla::ipc::Transport* aTransport,
NewRunnableMethod(this, &ProcessLink::OnTakeConnectedChannel));
}
// FIXME/cjones: handle errors
while (!mChan->Connected()) {
// Should not wait here if something goes wrong with the channel.
while (!mChan->Connected() &&
mChan->mChannelState != AsyncChannel::ChannelError) {
mChan->mMonitor->Wait();
}
}
@ -856,8 +857,10 @@ AsyncChannel::OnChannelErrorFromLink()
AssertLinkThread();
mMonitor->AssertCurrentThreadOwns();
if (ChannelClosing != mChannelState)
if (ChannelClosing != mChannelState) {
mChannelState = ChannelError;
mMonitor->Notify();
}
PostErrorNotifyTask();
}