Bug 1271198 - Convert Websockets to use AsyncOpen2(). r=jduell
This commit is contained in:
@@ -1402,7 +1402,14 @@ WebSocketChannel::BeginOpenInternal()
|
||||
}
|
||||
#endif
|
||||
|
||||
rv = localChannel->AsyncOpen(this, mHttpChannel);
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = localChannel->GetLoadInfo();
|
||||
if (loadInfo && loadInfo->GetSecurityMode()) {
|
||||
rv = localChannel->AsyncOpen2(this);
|
||||
}
|
||||
else {
|
||||
rv = localChannel->AsyncOpen(this, nullptr);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG(("WebSocketChannel::BeginOpenInternal: cannot async open\n"));
|
||||
AbortSession(NS_ERROR_CONNECTION_REFUSED);
|
||||
@@ -3713,7 +3720,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest,
|
||||
nsISupports *aContext)
|
||||
{
|
||||
LOG(("WebSocketChannel::OnStartRequest(): %p [%p %p] recvdhttpupgrade=%d\n",
|
||||
this, aRequest, aContext, mRecvdHttpUpgradeTransport));
|
||||
this, aRequest, mHttpChannel.get(), mRecvdHttpUpgradeTransport));
|
||||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
MOZ_ASSERT(!mGotUpgradeOK, "OTA duplicated");
|
||||
|
||||
@@ -3874,7 +3881,7 @@ WebSocketChannel::OnStopRequest(nsIRequest *aRequest,
|
||||
nsresult aStatusCode)
|
||||
{
|
||||
LOG(("WebSocketChannel::OnStopRequest() %p [%p %p %x]\n",
|
||||
this, aRequest, aContext, aStatusCode));
|
||||
this, aRequest, mHttpChannel.get(), aStatusCode));
|
||||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
|
||||
ReportConnectionTelemetry();
|
||||
@@ -4037,7 +4044,7 @@ WebSocketChannel::OnDataAvailable(nsIRequest *aRequest,
|
||||
uint32_t aCount)
|
||||
{
|
||||
LOG(("WebSocketChannel::OnDataAvailable() %p [%p %p %p %llu %u]\n",
|
||||
this, aRequest, aContext, aInputStream, aOffset, aCount));
|
||||
this, aRequest, mHttpChannel.get(), aInputStream, aOffset, aCount));
|
||||
|
||||
// This is the HTTP OnDataAvailable Method, which means this is http data in
|
||||
// response to the upgrade request and there should be no http response body
|
||||
|
||||
Reference in New Issue
Block a user