Optimization for scheme comparison of URIs. See bug 66577 for details. r=darin, sr=brendan@mozilla.org

git-svn-id: svn://10.0.0.236/trunk@85797 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gagan%netscape.com
2001-01-31 01:33:03 +00:00
parent 960e43639c
commit f3f5b36700
73 changed files with 356 additions and 237 deletions

View File

@@ -554,15 +554,13 @@ nsEditorShell::PrepareDocumentForEditing(nsIDOMWindow* aDOMWindow, nsIURI *aUrl)
// get the URL of the page we are editing
if (aUrl)
{
nsXPIDLCString pageScheme;
aUrl->GetScheme(getter_Copies(pageScheme));
nsCAutoString schemeStr(pageScheme);
// if this is a file URL of a file that exists locally, we'll stash the nsIFile
// in the disk document, so that later saves save back to the same file.
nsCOMPtr<nsIFileURL> pageFileURL(do_QueryInterface(aUrl));
if (schemeStr.EqualsIgnoreCase("file") && pageFileURL)
PRBool isFile=PR_FALSE;
rv = aUrl->SchemeIs(nsIURI::FILE, &isFile);
if (NS_SUCCEEDED(rv) && isFile && pageFileURL)
{
nsCOMPtr<nsIFile> pageFile;
pageFileURL->GetFile(getter_AddRefs(pageFile));