Restore some frame recursion protection that got lost. Bug 303163, r+sr=jst

This commit is contained in:
bzbarsky@mit.edu
2005-08-22 15:44:49 +00:00
parent 6953ee9cdd
commit be3d62c207
4 changed files with 30 additions and 2 deletions

View File

@@ -220,6 +220,13 @@ nsFrameLoader::Destroy()
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::GetDepthTooGreat(PRBool* aDepthTooGreat)
{
*aDepthTooGreat = mDepthTooGreat;
return NS_OK;
}
nsresult
nsFrameLoader::EnsureDocShell()
{
@@ -396,6 +403,8 @@ nsFrameLoader::GetURL(nsString& aURI)
nsresult
nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
{
mDepthTooGreat = PR_FALSE;
NS_PRECONDITION(mDocShell, "Must have docshell here");
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(mDocShell);
@@ -418,6 +427,7 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
++depth;
if (depth >= MAX_DEPTH_CONTENT_FRAMES) {
mDepthTooGreat = PR_TRUE;
NS_WARNING("Too many nested content frames so giving up");
return NS_ERROR_UNEXPECTED; // Too deep, give up! (silently?)