Bug 1388920 - Call OnChannelConnected handler in parent protocols (r=bkelly)

MozReview-Commit-ID: 8lmpPlmraSw
This commit is contained in:
Bill McCloskey 2017-08-09 15:27:22 -07:00
parent 162e156e36
commit 638d315450

View File

@ -354,20 +354,24 @@ ProcessLink::OnChannelConnected(int32_t peer_pid)
{
MonitorAutoLock lock(*mChan->mMonitor);
// Only update channel state if its still thinks its opening. Do not
// force it into connected if it has errored out, started closing, etc.
if (mChan->mChannelState == ChannelOpening) {
mChan->mChannelState = ChannelConnected;
mChan->mMonitor->Notify();
notifyChannel = true;
// Do not force it into connected if it has errored out, started
// closing, etc. Note that we can be in the Connected state already
// since the parent starts out Connected.
if (mChan->mChannelState == ChannelOpening ||
mChan->mChannelState == ChannelConnected)
{
mChan->mChannelState = ChannelConnected;
mChan->mMonitor->Notify();
notifyChannel = true;
}
}
if (mExistingListener)
if (mExistingListener) {
mExistingListener->OnChannelConnected(peer_pid);
}
if (notifyChannel) {
mChan->OnChannelConnected(peer_pid);
mChan->OnChannelConnected(peer_pid);
}
}