Bug 1425296 - Don't let RequestContext's load state be reset to 'before-DOMContentLoaded' by any sub-requested document within the load group to prevent long delays of tailed (tracking) requests. r=bz

This commit is contained in:
Honza Bambas 2017-12-18 20:08:58 -05:00
parent 1153291ad5
commit 9264c9f395

View File

@ -2417,15 +2417,17 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
// XXXbz what does "just fine" mean exactly? And given that there
// is no nsDocShell::SetDocument, what is this talking about?
// Inform the associated request context about this load start so
// any of its internal load progress flags gets reset.
nsCOMPtr<nsIRequestContextService> rcsvc =
do_GetService("@mozilla.org/network/request-context-service;1");
if (rcsvc) {
nsCOMPtr<nsIRequestContext> rc;
rcsvc->GetRequestContextFromLoadGroup(aLoadGroup, getter_AddRefs(rc));
if (rc) {
rc->BeginLoad();
if (IsContentDocument()) {
// Inform the associated request context about this load start so
// any of its internal load progress flags gets reset.
nsCOMPtr<nsIRequestContextService> rcsvc =
do_GetService("@mozilla.org/network/request-context-service;1");
if (rcsvc) {
nsCOMPtr<nsIRequestContext> rc;
rcsvc->GetRequestContextFromLoadGroup(aLoadGroup, getter_AddRefs(rc));
if (rc) {
rc->BeginLoad();
}
}
}
}