Bug 1659102 - Remove aLoadType argument from nsDocShell::OnNewURI. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91590
This commit is contained in:
@@ -7847,7 +7847,7 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
|
|||||||
if (failedURI) {
|
if (failedURI) {
|
||||||
errorOnLocationChangeNeeded =
|
errorOnLocationChangeNeeded =
|
||||||
OnNewURI(failedURI, failedChannel, triggeringPrincipal, nullptr,
|
OnNewURI(failedURI, failedChannel, triggeringPrincipal, nullptr,
|
||||||
nullptr, mLoadType, nullptr, false, false, false);
|
nullptr, nullptr, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be sure to have a correct mLSHE, it may have been cleared by
|
// Be sure to have a correct mLSHE, it may have been cleared by
|
||||||
@@ -7875,8 +7875,8 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
|
|||||||
if (finalURI) {
|
if (finalURI) {
|
||||||
// Pass false for aCloneSHChildren, since we're loading a new page here.
|
// Pass false for aCloneSHChildren, since we're loading a new page here.
|
||||||
onLocationChangeNeeded =
|
onLocationChangeNeeded =
|
||||||
OnNewURI(finalURI, aOpenedChannel, nullptr, nullptr, nullptr, mLoadType,
|
OnNewURI(finalURI, aOpenedChannel, nullptr, nullptr, nullptr, nullptr,
|
||||||
nullptr, false, true, false);
|
false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// let's try resetting the load group if we need to...
|
// let's try resetting the load group if we need to...
|
||||||
@@ -8772,7 +8772,7 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
|
|||||||
// doSameDocumentNavigation in this scope.
|
// doSameDocumentNavigation in this scope.
|
||||||
OnNewURI(aLoadState->URI(), nullptr, newURITriggeringPrincipal,
|
OnNewURI(aLoadState->URI(), nullptr, newURITriggeringPrincipal,
|
||||||
newURIPrincipalToInherit, newURIPartitionedPrincipalToInherit,
|
newURIPrincipalToInherit, newURIPartitionedPrincipalToInherit,
|
||||||
mLoadType, newCsp, true, true, true);
|
newCsp, true, true, true);
|
||||||
|
|
||||||
nsCOMPtr<nsIInputStream> postData;
|
nsCOMPtr<nsIInputStream> postData;
|
||||||
uint32_t cacheKey = 0;
|
uint32_t cacheKey = 0;
|
||||||
@@ -10542,7 +10542,7 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
nsIPrincipal* aTriggeringPrincipal,
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
nsIPrincipal* aPrincipalToInherit,
|
nsIPrincipal* aPrincipalToInherit,
|
||||||
nsIPrincipal* aPartitionedPrincipalToInherit,
|
nsIPrincipal* aPartitionedPrincipalToInherit,
|
||||||
uint32_t aLoadType, nsIContentSecurityPolicy* aCsp,
|
nsIContentSecurityPolicy* aCsp,
|
||||||
bool aFireOnLocationChange, bool aAddToGlobalHistory,
|
bool aFireOnLocationChange, bool aAddToGlobalHistory,
|
||||||
bool aCloneSHChildren) {
|
bool aCloneSHChildren) {
|
||||||
MOZ_ASSERT(aURI, "uri is null");
|
MOZ_ASSERT(aURI, "uri is null");
|
||||||
@@ -10562,7 +10562,7 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
|
|
||||||
MOZ_LOG(gDocShellLog, LogLevel::Debug,
|
MOZ_LOG(gDocShellLog, LogLevel::Debug,
|
||||||
("nsDocShell[%p]::OnNewURI(\"%s\", [%s], 0x%x)\n", this,
|
("nsDocShell[%p]::OnNewURI(\"%s\", [%s], 0x%x)\n", this,
|
||||||
aURI->GetSpecOrDefault().get(), chanName.get(), aLoadType));
|
aURI->GetSpecOrDefault().get(), chanName.get(), mLoadType));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -10595,11 +10595,11 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine if this type of load should update history.
|
// Determine if this type of load should update history.
|
||||||
bool updateGHistory = ShouldUpdateGlobalHistory(aLoadType);
|
bool updateGHistory = ShouldUpdateGlobalHistory(mLoadType);
|
||||||
|
|
||||||
// We don't update session history on reload unless we're loading
|
// We don't update session history on reload unless we're loading
|
||||||
// an iframe in shift-reload case.
|
// an iframe in shift-reload case.
|
||||||
bool updateSHistory = mBrowsingContext->ShouldUpdateSessionHistory(aLoadType);
|
bool updateSHistory = mBrowsingContext->ShouldUpdateSessionHistory(mLoadType);
|
||||||
|
|
||||||
// Create SH Entry (mLSHE) only if there is a SessionHistory object in the
|
// Create SH Entry (mLSHE) only if there is a SessionHistory object in the
|
||||||
// root browsing context.
|
// root browsing context.
|
||||||
@@ -10667,7 +10667,7 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
* for the page. Save the new cacheKey in Session History.
|
* for the page. Save the new cacheKey in Session History.
|
||||||
* see bug 90098
|
* see bug 90098
|
||||||
*/
|
*/
|
||||||
if (aChannel && IsForceReloadType(aLoadType)) {
|
if (aChannel && IsForceReloadType(mLoadType)) {
|
||||||
MOZ_ASSERT(!updateSHistory || IsFrame(),
|
MOZ_ASSERT(!updateSHistory || IsFrame(),
|
||||||
"We shouldn't be updating session history for forced"
|
"We shouldn't be updating session history for forced"
|
||||||
" reloads unless we're in a newly created iframe!");
|
" reloads unless we're in a newly created iframe!");
|
||||||
@@ -10693,9 +10693,9 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
|
|
||||||
if (!mozilla::SessionHistoryInParent()) {
|
if (!mozilla::SessionHistoryInParent()) {
|
||||||
// Clear subframe history on refresh.
|
// Clear subframe history on refresh.
|
||||||
// XXX: history.go(0) won't go this path as aLoadType is LOAD_HISTORY in
|
// XXX: history.go(0) won't go this path as mLoadType is LOAD_HISTORY in
|
||||||
// this case. One should re-validate after bug 1331865 fixed.
|
// this case. One should re-validate after bug 1331865 fixed.
|
||||||
if (aLoadType == LOAD_REFRESH) {
|
if (mLoadType == LOAD_REFRESH) {
|
||||||
ClearFrameHistory(mLSHE);
|
ClearFrameHistory(mLSHE);
|
||||||
ClearFrameHistory(mOSHE);
|
ClearFrameHistory(mOSHE);
|
||||||
}
|
}
|
||||||
@@ -10728,7 +10728,7 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
|||||||
nsCOMPtr<nsIURI> previousURI;
|
nsCOMPtr<nsIURI> previousURI;
|
||||||
uint32_t previousFlags = 0;
|
uint32_t previousFlags = 0;
|
||||||
|
|
||||||
if (aLoadType & LOAD_CMD_RELOAD) {
|
if (mLoadType & LOAD_CMD_RELOAD) {
|
||||||
// On a reload request, we don't set redirecting flags.
|
// On a reload request, we don't set redirecting flags.
|
||||||
previousURI = aURI;
|
previousURI = aURI;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -706,6 +706,7 @@ class nsDocShell final : public nsDocLoader,
|
|||||||
nsresult ScrollToAnchor(bool aCurHasRef, bool aNewHasRef,
|
nsresult ScrollToAnchor(bool aCurHasRef, bool aNewHasRef,
|
||||||
nsACString& aNewHash, uint32_t aLoadType);
|
nsACString& aNewHash, uint32_t aLoadType);
|
||||||
|
|
||||||
|
private:
|
||||||
// Returns true if would have called FireOnLocationChange,
|
// Returns true if would have called FireOnLocationChange,
|
||||||
// but did not because aFireOnLocationChange was false on entry.
|
// but did not because aFireOnLocationChange was false on entry.
|
||||||
// In this case it is the caller's responsibility to ensure
|
// In this case it is the caller's responsibility to ensure
|
||||||
@@ -724,10 +725,10 @@ class nsDocShell final : public nsDocLoader,
|
|||||||
nsIPrincipal* aTriggeringPrincipal,
|
nsIPrincipal* aTriggeringPrincipal,
|
||||||
nsIPrincipal* aPrincipalToInherit,
|
nsIPrincipal* aPrincipalToInherit,
|
||||||
nsIPrincipal* aPartitionedPrincipalToInehrit,
|
nsIPrincipal* aPartitionedPrincipalToInehrit,
|
||||||
uint32_t aLoadType, nsIContentSecurityPolicy* aCsp,
|
nsIContentSecurityPolicy* aCsp, bool aFireOnLocationChange,
|
||||||
bool aFireOnLocationChange, bool aAddToGlobalHistory,
|
bool aAddToGlobalHistory, bool aCloneSHChildren);
|
||||||
bool aCloneSHChildren);
|
|
||||||
|
|
||||||
|
public:
|
||||||
// Helper method that is called when a new document (including any
|
// Helper method that is called when a new document (including any
|
||||||
// sub-documents - ie. frames) has been completely loaded.
|
// sub-documents - ie. frames) has been completely loaded.
|
||||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||||
|
|||||||
Reference in New Issue
Block a user