doc->GetBaseURL(*getter_AddRefs(base_uri));
doc->GetBaseURL(getter_AddRefs(base_uri));
nsFrameLoader::LoadFrame(){  NS_ENSURE_TRUE(mOwnerContent, NS_ERROR_NOT_INITIALIZED);  nsresult rv = EnsureDocShell();  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIDocument> doc;  mOwnerContent->GetDocument(*getter_AddRefs(doc));  if (!doc) {    return NS_OK;  }  nsAutoString src;  GetURL(src);  src.Trim(" \t\n\r");  if (src.IsEmpty()) {    src.Assign(NS_LITERAL_STRING("about:blank"));  }  // Make an absolute URI  nsCOMPtr<nsIURI> base_uri;  doc->GetBaseURL(*getter_AddRefs(base_uri));  nsAutoString doc_charset;  doc->GetDocumentCharacterSet(doc_charset);  nsCOMPtr<nsIURI> uri;  rv = NS_NewURI(getter_AddRefs(uri), src,                 doc_charset.IsEmpty() ? nsnull :                 NS_ConvertUCS2toUTF8(doc_charset).get(), base_uri);  NS_ENSURE_SUCCESS(rv, rv);  // Check for security  nsCOMPtr<nsIScriptSecurityManager> secMan =    do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIDocShellLoadInfo> loadInfo;  mDocShell->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    loadInfo->SetOwner(principal);  }  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 = base_uri;  }  loadInfo->SetReferrer(referrer);  // Check if we are allowed to load absURL  rv = secMan->CheckLoadURI(referrer, uri,                            nsIScriptSecurityManager::STANDARD);  if (NS_FAILED(rv)) {    return rv; // We're not  }  // Kick off the load...  rv = mDocShell->LoadURI(uri, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE,                          PR_FALSE);  NS_ASSERTION(NS_SUCCEEDED(rv), "failed to load URL");  return rv;}