nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, nsACString& aResult)
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) #ifdef NECKO
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, nsACString& aResult){  nsresult rv = NS_OK;  NS_ASSERTION(aChromeURL, "null url!");  if (!aChromeURL)      return NS_ERROR_NULL_POINTER;  // No need to canonify as the SplitURL() that we  // do is the equivalent of canonification without modifying  // aChromeURL  // Obtain the package, provider and remaining from the URL  nsCAutoString package, provider, remaining;  rv = SplitURL(aChromeURL, package, provider, remaining);  if (NS_FAILED(rv)) return rv;  // Try for the profile data source first because it  // will load the install data source as well.  if (!mProfileInitialized) {    rv = LoadProfileDataSource();    if (NS_FAILED(rv)) return rv;  }  if (!mInstallInitialized) {    rv = LoadInstallDataSource();    if (NS_FAILED(rv)) return rv;  }  nsCAutoString finalURL;  rv = GetOverrideURL(package, provider, remaining, finalURL);  if (NS_SUCCEEDED(rv))    return NS_OK;    rv = GetBaseURL(package, provider, finalURL);#ifdef DEBUG  if (NS_FAILED(rv)) {    nsCAutoString msg("chrome: failed to get base url");    nsCAutoString url;    rv = aChromeURL->GetSpec(url);    if (NS_SUCCEEDED(rv)) {      msg += " for ";      msg += url.get();    }    msg += " -- using wacky default";    NS_WARNING(msg.get());  }#endif  if (finalURL.IsEmpty()) {    // hard-coded fallback    if (provider.Equals("skin")) {      finalURL = "resource:/chrome/skins/classic/";    }    else if (provider.Equals("locale")) {      finalURL = "resource:/chrome/locales/en-US/";    }    else if (package.Equals("aim")) {      finalURL = "resource:/chrome/packages/aim/";    }    else if (package.Equals("messenger")) {      finalURL = "resource:/chrome/packages/messenger/";    }    else if (package.Equals("global")) {      finalURL = "resource:/chrome/packages/widget-toolkit/";    }    else {      finalURL = "resource:/chrome/packages/core/";    }  }  aResult = finalURL + remaining;  return NS_OK;}