Bug 662554 - Make websocketestablishedconnection getinterface and close() check mOwner != nsnull r=biesi

--HG--
extra : rebase_source : 2a5e0df5d61f52445b2db8e08431df6987a07e5c
This commit is contained in:
Patrick McManus 2011-06-08 08:27:11 -04:00
parent d0c8d40621
commit b5f0db11a1

View File

@ -314,6 +314,7 @@ nsWebSocketEstablishedConnection::PrintErrorOnConsole(const char *aBundleURI,
PRUint32 aFormatStringsLen)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
NS_ABORT_IF_FALSE(mOwner, "No owner");
nsresult rv;
@ -365,6 +366,8 @@ nsresult
nsWebSocketEstablishedConnection::Close()
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
if (!mOwner)
return NS_OK;
// Disconnect() can release this object, so we keep a
// reference until the end of the method
@ -458,6 +461,8 @@ nsresult
nsWebSocketEstablishedConnection::UpdateMustKeepAlive()
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
NS_ABORT_IF_FALSE(mOwner, "No owner");
mOwner->UpdateMustKeepAlive();
return NS_OK;
}
@ -572,6 +577,9 @@ nsWebSocketEstablishedConnection::GetInterface(const nsIID &aIID,
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
if (!mOwner)
return NS_ERROR_FAILURE;
if (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
aIID.Equals(NS_GET_IID(nsIAuthPrompt2))) {
nsresult rv;