NS_IMETHODIMP nsWebSocketEstablishedConnection::OnStart(nsISupports *aContext) { NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); if (!mOwner) return NS_OK; if (!mOwner->mRequestedProtocolList.IsEmpty()) mWebSocketChannel->GetProtocol(mOwner->mEstablishedProtocol); mWebSocketChannel->GetExtensions(mOwner->mEstablishedExtensions); mStatus = CONN_CONNECTED_AND_READY; mOwner->SetReadyState(nsIMozWebSocket::OPEN); return NS_OK; }