Bug 517584 - Fix orange in test for bug 480619. r=dwitte a=blocking-fennec

This commit is contained in:
Alon Zakai 2010-10-14 17:28:45 -07:00
parent 6d067a9e1a
commit d83eb5d7d0
2 changed files with 16 additions and 1 deletions

View File

@ -330,6 +330,7 @@ nsHttpHandler::Init()
mObserverService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);
mObserverService->AddObserver(this, "net:clear-active-logins", PR_TRUE);
mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, PR_TRUE);
mObserverService->AddObserver(this, "net:prune-dead-connections", PR_TRUE);
}
return NS_OK;
@ -1644,6 +1645,11 @@ nsHttpHandler::Observe(nsISupports *subject,
else if (NS_LITERAL_STRING(NS_PRIVATE_BROWSING_LEAVE).Equals(data))
mInPrivateBrowsingMode = PR_FALSE;
}
else if (strcmp(topic, "net:prune-dead-connections") == 0) {
if (mConnMgr) {
mConnMgr->PruneDeadConnections();
}
}
return NS_OK;
}

View File

@ -361,7 +361,16 @@ LogoutAndTeardown()
SSL_ClearSessionCache();
}
return nssComponent->LogoutAuthenticatedPK11();
rv = nssComponent->LogoutAuthenticatedPK11();
// After we just logged out, we need to prune dead connections to make
// sure that all connections that should be stopped, are stopped. See
// bug 517584.
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os)
os->NotifyObservers(nsnull, "net:prune-dead-connections", nsnull);
return rv;
}
/* void setWindow(in nsISupports w); */