remove leftover in LoginManagerParent.jsm, and cherry-picked mozilla upstream changes:

bug1350564, bug1404787, bug1411957, bug1047098, bug1404105, bug1415133, bug1355576, bug1382366, bug1414425, bug1409951, bug1415441, bug1418922, bug1382358, bug1414945, bug1423159, bug1411745, bug1411708, bug1412420
This commit is contained in:
2018-06-21 23:37:55 +08:00
parent 3721b6288f
commit c440929970
45 changed files with 363 additions and 182 deletions
+19 -8
View File
@@ -6675,8 +6675,10 @@ nsDocShell::ScrollByPages(int32_t aNumPages)
//*****************************************************************************
NS_IMETHODIMP
nsDocShell::RefreshURI(nsIURI* aURI, int32_t aDelay, bool aRepeat,
bool aMetaRefresh)
nsDocShell::RefreshURI(nsIURI* aURI,
int32_t aDelay, bool aRepeat,
bool aMetaRefresh,
nsIPrincipal* aPrincipal)
{
NS_ENSURE_ARG(aURI);
@@ -6710,6 +6712,7 @@ nsDocShell::RefreshURI(nsIURI* aURI, int32_t aDelay, bool aRepeat,
nsCOMPtr<nsISupports> dataRef = refreshTimer; // Get the ref count to 1
refreshTimer->mDocShell = this;
refreshTimer->mPrincipal = aPrincipal;
refreshTimer->mURI = aURI;
refreshTimer->mDelay = aDelay;
refreshTimer->mRepeat = aRepeat;
@@ -6739,7 +6742,8 @@ nsresult
nsDocShell::ForceRefreshURIFromTimer(nsIURI* aURI,
int32_t aDelay,
bool aMetaRefresh,
nsITimer* aTimer)
nsITimer* aTimer,
nsIPrincipal* aPrincipal)
{
NS_PRECONDITION(aTimer, "Must have a timer here");
@@ -6757,11 +6761,11 @@ nsDocShell::ForceRefreshURIFromTimer(nsIURI* aURI,
}
}
return ForceRefreshURI(aURI, aDelay, aMetaRefresh);
return ForceRefreshURI(aURI, aDelay, aMetaRefresh, aPrincipal);
}
NS_IMETHODIMP
nsDocShell::ForceRefreshURI(nsIURI* aURI, int32_t aDelay, bool aMetaRefresh)
nsDocShell::ForceRefreshURI(nsIURI* aURI, int32_t aDelay, bool aMetaRefresh, nsIPrincipal* aPrincipal)
{
NS_ENSURE_ARG(aURI);
@@ -6809,11 +6813,18 @@ nsDocShell::ForceRefreshURI(nsIURI* aURI, int32_t aDelay, bool aMetaRefresh)
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->SetTriggeringPrincipal(aPrincipal);
}
/*
* LoadURI(...) will cancel all refresh timers... This causes the
* Timer and its refreshData instance to be released...
*/
LoadURI(aURI, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE, true);
LoadURI(aURI, loadInfo, nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL, true);
return NS_OK;
}
@@ -7049,7 +7060,7 @@ nsDocShell::SetupRefreshURIFromHeader(nsIURI* aBaseURI,
return NS_ERROR_FAILURE;
}
rv = RefreshURI(uri, seconds * 1000, false, true);
rv = RefreshURI(uri, seconds * 1000, false, true, aPrincipal);
}
}
}
@@ -13547,7 +13558,7 @@ nsRefreshTimer::Notify(nsITimer* aTimer)
// Get the delay count to determine load type
uint32_t delay = 0;
aTimer->GetDelay(&delay);
mDocShell->ForceRefreshURIFromTimer(mURI, delay, mMetaRefresh, aTimer);
mDocShell->ForceRefreshURIFromTimer(mURI, delay, mMetaRefresh, aTimer, mPrincipal);
}
return NS_OK;
}