Changing convertChromeURL

git-svn-id: svn://10.0.0.236/trunk@69716 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com 2000-05-15 01:40:52 +00:00
parent c3eb4a5e2a
commit e13add5c1e
6 changed files with 22 additions and 10 deletions

View File

@ -55,7 +55,7 @@ interface nsIChromeRegistry : nsISupports
*
* @param aChromeURL the URL that is to be converted.
*/
void convertChromeURL(in nsIURI aChromeURL);
string convertChromeURL(in nsIURI aChromeURL);
nsISimpleEnumerator getOverlays(in nsIURI aChromeURL);

View File

@ -684,11 +684,16 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
rv = aURI->Clone(getter_AddRefs(chromeURI)); // don't mangle the original
if (NS_FAILED(rv)) return rv;
rv = reg->ConvertChromeURL(chromeURI);
char* spec;
rv = reg->ConvertChromeURL(chromeURI, &spec);
if (NS_FAILED(rv)) return rv;
// now fetch the converted URI
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
nsCOMPtr<nsIProtocolHandler> protocolHandler;
serv->NewURI(spec, nsnull, getter_AddRefs(chromeURI));
nsAllocator::Free(spec);
// now fetch the converted URI
if (NS_FAILED(rv)) return rv;
rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result));

View File

@ -367,7 +367,7 @@ nsChromeRegistry::Canonify(nsIURI* aChromeURI)
}
NS_IMETHODIMP
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, char** aResult)
{
nsresult rv = NS_OK;
NS_ASSERTION(aChromeURL, "null url!");
@ -450,7 +450,8 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
finalURL += "/";
finalURL += remaining;
aChromeURL->SetSpec(finalURL);
*aResult = nsXPIDLCString::Copy(finalURL);
return NS_OK;
}

View File

@ -55,7 +55,7 @@ interface nsIChromeRegistry : nsISupports
*
* @param aChromeURL the URL that is to be converted.
*/
void convertChromeURL(in nsIURI aChromeURL);
string convertChromeURL(in nsIURI aChromeURL);
nsISimpleEnumerator getOverlays(in nsIURI aChromeURL);

View File

@ -684,11 +684,16 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
rv = aURI->Clone(getter_AddRefs(chromeURI)); // don't mangle the original
if (NS_FAILED(rv)) return rv;
rv = reg->ConvertChromeURL(chromeURI);
char* spec;
rv = reg->ConvertChromeURL(chromeURI, &spec);
if (NS_FAILED(rv)) return rv;
// now fetch the converted URI
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
nsCOMPtr<nsIProtocolHandler> protocolHandler;
serv->NewURI(spec, nsnull, getter_AddRefs(chromeURI));
nsAllocator::Free(spec);
// now fetch the converted URI
if (NS_FAILED(rv)) return rv;
rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result));

View File

@ -367,7 +367,7 @@ nsChromeRegistry::Canonify(nsIURI* aChromeURI)
}
NS_IMETHODIMP
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, char** aResult)
{
nsresult rv = NS_OK;
NS_ASSERTION(aChromeURL, "null url!");
@ -450,7 +450,8 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
finalURL += "/";
finalURL += remaining;
aChromeURL->SetSpec(finalURL);
*aResult = nsXPIDLCString::Copy(finalURL);
return NS_OK;
}