#478: M1416307 M1430557 M1416529 M1324042 M1428947 M1437087 M1440926 M1425520

This commit is contained in:
Cameron Kaiser
2018-03-06 20:08:17 -08:00
parent 636587d3d7
commit 0ba5d5dad1
13 changed files with 115 additions and 52 deletions
+11 -10
View File
@@ -6630,9 +6630,17 @@ nsDocShell::ForceRefreshURI(nsIURI* aURI, int32_t aDelay, bool aMetaRefresh, nsI
*/
loadInfo->SetReferrer(mCurrentURI);
/* Don't ever "guess" on which owner to use to avoid picking
* the current owner.
*/
// Set the triggering pricipal to aPrincipal if available, or current
// document's principal otherwise.
nsCOMPtr<nsIPrincipal> principal = aPrincipal;
if (!principal) {
nsCOMPtr<nsIDocument> doc = GetDocument();
if (MOZ_UNLIKELY(!doc)) {
return NS_ERROR_FAILURE;
}
principal = doc->NodePrincipal();
}
loadInfo->SetOwner(principal); // equivalent for SetTriggeringPrincipal
loadInfo->SetOwnerIsExplicit(true);
/* Check if this META refresh causes a redirection
@@ -6660,13 +6668,6 @@ nsDocShell::ForceRefreshURI(nsIURI* aURI, int32_t aDelay, bool aMetaRefresh, nsI
loadInfo->SetLoadType(nsIDocShellLoadInfo::loadRefresh);
}
// If the principal is null, the refresh will have a triggeringPrincipal
// derived from the referrer URI, or will be set to the system principal
// if there is no refererrer. See LoadURI()
if (aPrincipal) {
loadInfo->SetOwner(aPrincipal); // as called prior to bug 1286472
}
/*
* LoadURI(...) will cancel all refresh timers... This causes the
* Timer and its refreshData instance to be released...
+6 -9
View File
@@ -19,9 +19,8 @@ interface nsIRefreshURI : nsISupports {
*
* @param aUri The uri to refresh.
* @param aPrincipal The triggeringPrincipal for the refresh load
* May be null, in which case a principal will be built based on the
* referrer URI of the previous docshell load, or will use the system
* principal when there is no referrer.
* May be null, in which case the principal of current document will be
* applied.
* @param aMillis The number of milliseconds to wait.
* @param aRepeat Flag to indicate if the uri is to be
* repeatedly refreshed every aMillis milliseconds.
@@ -37,9 +36,8 @@ interface nsIRefreshURI : nsISupports {
*
* @param aURI The URI to refresh.
* @param aPrincipal The triggeringPrincipal for the refresh load
* May be null, in which case a principal will be built based on the
* referrer URI of the previous docshell load, or will use the system
* principal when there is no referrer.
* May be null, in which case the principal of current document will be
* applied.
* @param aMillis The number of milliseconds by which this refresh would
* be delayed if it were not being forced.
* @param aMetaRefresh Flag to indicate if this is a meta refresh.
@@ -70,9 +68,8 @@ interface nsIRefreshURI : nsISupports {
*
* @param aBaseURI base URI to resolve refresh uri with.
* @param aPrincipal The triggeringPrincipal for the refresh load
* May be null, in which case a principal will be built based on the
* referrer URI of the previous docshell load, or will use the system
* principal when there is no referrer.
* May be null, in which case the principal of current document will be
* applied.
* @param aHeader The meta refresh header string.
*/
void setupRefreshURIFromHeader(in nsIURI aBaseURI,