Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
This patch adds an ID to ensure that we avoid canceling content JS if the next page already started loading by the time we're ready to try canceling the JS. Differential Revision: https://phabricator.services.mozilla.com/D25164
This commit is contained in:
@@ -667,6 +667,16 @@ nsDocShell::GetInterface(const nsIID& aIID, void** aSink) {
|
||||
return *aSink ? NS_OK : NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetCancelContentJSEpoch(int32_t aEpoch) {
|
||||
// Note: this gets called fairly early (before a pageload actually starts).
|
||||
// We could probably defer this even longer.
|
||||
nsCOMPtr<nsIBrowserChild> browserChild = GetBrowserChild();
|
||||
static_cast<BrowserChild*>(browserChild.get())
|
||||
->SetCancelContentJSEpoch(aEpoch);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::LoadURI(nsDocShellLoadState* aLoadState) {
|
||||
MOZ_ASSERT(aLoadState, "Must have a valid load state!");
|
||||
|
||||
Reference in New Issue
Block a user