rv = secMan->CheckLoadURI(referrer, newURI, PR_FALSE);
rv = secMan->CheckLoadURI(referrer, newURI, nsIScriptSecurityManager::STANDARD);
nsHTMLFrameInnerFrame::DoLoadURL(nsIPresContext* aPresContext){  nsresult rv = NS_OK;  NS_ENSURE_TRUE (mSubShell, NS_ERROR_UNEXPECTED);  // Prevent recursion  mCreatingViewer=PR_TRUE;  // Get the URL to load  nsCOMPtr<nsIContent> parentContent;  rv = GetParentContent(*getter_AddRefs(parentContent));  NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && parentContent, rv);  PRBool load = CheckForBrowser(parentContent, mSubShell);  if (load) {    nsAutoString url;    GetURL(parentContent, url);    url.Trim(" \t\n\r");    if (url.IsEmpty())  // Load about:blank into a frame if not URL is specified (bug 35986)      url = NS_ConvertASCIItoUCS2("about:blank");    // Make an absolute URL    nsCOMPtr<nsIURI> baseURL;    nsCOMPtr<nsIHTMLContent> htmlContent = do_QueryInterface(parentContent, &rv);    if (NS_SUCCEEDED(rv) && htmlContent) {      htmlContent->GetBaseURL(*getter_AddRefs(baseURL));    }    else {      nsCOMPtr<nsIDocument> doc;      rv = parentContent->GetDocument(*getter_AddRefs(doc));      if (NS_SUCCEEDED(rv) && doc) {        doc->GetBaseURL(*getter_AddRefs(baseURL));      }    }    nsAutoString absURL;    rv = NS_MakeAbsoluteURI(absURL, url, baseURL);    NS_ENSURE_SUCCESS(rv, rv);    nsCOMPtr<nsIURI> uri;    NS_NewURI(getter_AddRefs(uri), absURL, nsnull);    // Check for security    NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,                    NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);    NS_ENSURE_SUCCESS(rv, rv);    // Get base URL    nsCOMPtr<nsIURI> baseURI;    rv = aPresContext->GetBaseURL(getter_AddRefs(baseURI));    // Get docshell and create load info    nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mSubShell));    NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);    nsCOMPtr<nsIDocShellLoadInfo> loadInfo;    docShell->CreateLoadInfo(getter_AddRefs(loadInfo));    NS_ENSURE_TRUE(loadInfo, NS_ERROR_FAILURE);    // Get referring URL    nsCOMPtr<nsIURI> referrer;    nsCOMPtr<nsIPrincipal> principal;    rv = secMan->GetSubjectPrincipal(getter_AddRefs(principal));    NS_ENSURE_SUCCESS(rv, rv);    // If we were called from script, get the referring URL from the script    if (principal) {      nsCOMPtr<nsICodebasePrincipal> codebase = do_QueryInterface(principal);      if (codebase) {        rv = codebase->GetURI(getter_AddRefs(referrer));        NS_ENSURE_SUCCESS(rv, rv);      }      // Pass the script principal to the docshell      nsCOMPtr<nsISupports> owner = do_QueryInterface(principal);      loadInfo->SetOwner(owner);    }    if (!referrer) { // We're not being called form script, tell the docshell                     // to inherit an owner from the current document.      loadInfo->SetInheritOwner(PR_TRUE);      referrer = baseURI;    }    // Check if we are allowed to load absURL    nsCOMPtr<nsIURI> newURI;    rv = NS_NewURI(getter_AddRefs(newURI), absURL, baseURI);    NS_ENSURE_SUCCESS(rv, rv);    rv = secMan->CheckLoadURI(referrer, newURI, PR_FALSE);    if (NS_FAILED(rv))      return rv; // We're not    rv = docShell->LoadURI(uri, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE);    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to load URL");  }  return rv;}