NS_NewURI(getter_AddRefs(uri), absURL.GetUnicode(), nsnull);
NS_NewURI(getter_AddRefs(uri), absURL, nsnull);
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);  nsAutoString url;  GetURL(parentContent, url);  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.GetUnicode(), nsnull);  // Check for security  NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,                  NS_SCRIPTSECURITYMANAGER_PROGID, &rv);  NS_ENSURE_SUCCESS(rv, rv);  // Get base URL  nsCOMPtr<nsIURI> baseURI;  rv = aPresContext->GetBaseURL(getter_AddRefs(baseURI));  // Get origin URL (from script, or default to base)  nsCOMPtr<nsIURI> referrer;  nsCOMPtr<nsIPrincipal> principal;  rv = secMan->GetSubjectPrincipal(getter_AddRefs(principal));  NS_ENSURE_SUCCESS(rv, rv);  if (principal) {    nsCOMPtr<nsICodebasePrincipal> codebase = do_QueryInterface(principal);    if (codebase) {      rv = codebase->GetURI(getter_AddRefs(referrer));      NS_ENSURE_SUCCESS(rv, rv);    }  }  if (!referrer) {    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  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);  loadInfo->SetReferrer(referrer);  rv = docShell->LoadURI(uri, loadInfo);  NS_ASSERTION(NS_SUCCEEDED(rv), "failed to load URL");  return rv;}