"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "netwerk/protocol/websocket/WebSocketChannel.cpp" between
UXP-RELBASE_20210427.tar.gz and UXP-RELBASE_20210608.tar.gz

About: Basilisk is a full-featured, optimized browser derived from the code behind the pre-Servo Firefox browser (29–56 era). UXP = Unified XUL Platform. Source code.

WebSocketChannel.cpp  (UXP-RELBASE_20210427):WebSocketChannel.cpp  (UXP-RELBASE_20210608)
skipping to change at line 1248 skipping to change at line 1248
LOG(("WebSocket: received network CHANGED event")); LOG(("WebSocket: received network CHANGED event"));
if (!mSocketThread) { if (!mSocketThread) {
// there has not been an asyncopen yet on the object and then we need // there has not been an asyncopen yet on the object and then we need
// no ping. // no ping.
LOG(("WebSocket: early object, no ping needed")); LOG(("WebSocket: early object, no ping needed"));
} else { } else {
// Next we check mDataStarted, which we need to do on mTargetThread. // Next we check mDataStarted, which we need to do on mTargetThread.
if (!IsOnTargetThread()) { if (!IsOnTargetThread()) {
mTargetThread->Dispatch( mTargetThread->Dispatch(
NewRunnableMethod(this, &WebSocketChannel::OnNetworkChanged), NewRunnableMethod(this, &WebSocketChannel::OnNetworkChangedTargetThr ead),
NS_DISPATCH_NORMAL); NS_DISPATCH_NORMAL);
} else { } else {
OnNetworkChanged(); OnNetworkChangedTargetThread();
} }
} }
} }
} }
return NS_OK; return NS_OK;
} }
nsresult nsresult
WebSocketChannel::OnNetworkChanged() WebSocketChannel::OnNetworkChangedTargetThread()
{ {
if (IsOnTargetThread()) { LOG(("WebSocketChannel::OnNetworkChangedTargetThread() - on target thread %p",
LOG(("WebSocketChannel::OnNetworkChanged() - on target thread %p", this)); this));
if (!mDataStarted) {
LOG(("WebSocket: data not started yet, no ping needed"));
return NS_OK;
}
return mSocketThread->Dispatch( if (!mDataStarted) {
NewRunnableMethod(this, &WebSocketChannel::OnNetworkChanged), LOG(("WebSocket: data not started yet, no ping needed"));
NS_DISPATCH_NORMAL); return NS_OK;
} }
return mSocketThread->Dispatch(
NewRunnableMethod(this, &WebSocketChannel::OnNetworkChanged),
NS_DISPATCH_NORMAL);
}
nsresult
WebSocketChannel::OnNetworkChanged()
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "not socket thread"); MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "not socket thread");
LOG(("WebSocketChannel::OnNetworkChanged() - on socket thread %p", this)); LOG(("WebSocketChannel::OnNetworkChanged() - on socket thread %p", this));
if (mPingOutstanding) { if (mPingOutstanding) {
// If there's an outstanding ping that's expected to get a pong back // If there's an outstanding ping that's expected to get a pong back
// we let that do its thing. // we let that do its thing.
LOG(("WebSocket: pong already pending")); LOG(("WebSocket: pong already pending"));
return NS_OK; return NS_OK;
} }
 End of changes. 6 change blocks. 
13 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)