Bug 1744397 - Simplify refresh code: clean up meta refresh code in nsDocShell. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D132862
This commit is contained in:
Peter Van der Beken
2021-12-16 22:27:07 +00:00
parent 18e4f88acb
commit b821e8d182
6 changed files with 28 additions and 88 deletions

View File

@@ -288,6 +288,22 @@ class nsDocShell final : public nsDocLoader,
// subframes. It then simulates the completion of the toplevel load.
nsresult RestoreFromHistory();
/**
* Parses the passed in header string and sets up a refreshURI if a "refresh"
* header is found. If docshell is busy loading a page currently, the request
* will be queued and executed when the current page finishes loading.
*
* @param aBaseURI base URI to resolve refresh uri with.
* @param aPrincipal The triggeringPrincipal for the refresh load
* May be null, in which case the principal of current document will be
* applied.
* @param aInnerWindowID The window id to use for error reporting.
* @param aHeader The meta refresh header string.
*/
nsresult SetupRefreshURIFromHeader(nsIURI* aBaseURI, nsIPrincipal* aPrincipal,
uint64_t aInnerWindowID,
const nsACString& aHeader);
// Perform a URI load from a refresh timer. This is just like the
// ForceRefreshURI method on nsIRefreshURI, but makes sure to take
// the timer involved out of mRefreshURIList if it's there.
@@ -951,8 +967,6 @@ class nsDocShell final : public nsDocLoader,
nsresult Dispatch(mozilla::TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable);
void SetupReferrerInfoFromChannel(nsIChannel* aChannel);
void SetReferrerInfo(nsIReferrerInfo* aReferrerInfo);
void ReattachEditorToWindow(nsISHEntry* aSHEntry);
void ClearFrameHistory(nsISHEntry* aEntry);
// Determine if this type of load should update history.