Bug 1083425 - WebSocket should remove its nsIRequest from the docShell when disconnected, r=smaug

This commit is contained in:
Andrea Marchesini 2014-10-17 08:12:26 +01:00
parent 901b75c127
commit 8084a5f411

View File

@ -193,6 +193,8 @@ public:
WorkerPrivate* mWorkerPrivate;
nsAutoPtr<WorkerFeature> mWorkerFeature;
nsWeakPtr mWeakLoadGroup;
private:
~WebSocketImpl()
{
@ -528,8 +530,7 @@ WebSocketImpl::DisconnectInternal()
{
AssertIsOnMainThread();
nsCOMPtr<nsILoadGroup> loadGroup;
GetLoadGroup(getter_AddRefs(loadGroup));
nsCOMPtr<nsILoadGroup> loadGroup = do_QueryReferent(mWeakLoadGroup);
if (loadGroup) {
loadGroup->RemoveRequest(this, nullptr, NS_OK);
}
@ -1390,6 +1391,8 @@ WebSocketImpl::InitializeConnection()
NS_ENSURE_SUCCESS(rv, rv);
rv = loadGroup->AddRequest(this, nullptr);
NS_ENSURE_SUCCESS(rv, rv);
mWeakLoadGroup = do_GetWeakReference(loadGroup);
}
// manually adding loadinfo to the channel since it