second attempt at landing fix for bug 157131 "nsIIOService mods in preparation for freezing" r=dougt sr=alecf

git-svn-id: svn://10.0.0.236/trunk@127379 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%netscape.com
2002-08-15 18:38:46 +00:00
parent 043f466d14
commit f4ac8b67b2
43 changed files with 470 additions and 486 deletions

View File

@@ -25,6 +25,7 @@
#include "nsIServiceManager.h"
#include "nsIZipReader.h"
#include "nsReadableUtils.h"
#include "nsURLHelper.h"
////////////////////////////////////////////////////////////////////////////////
@@ -91,11 +92,11 @@ NS_IMETHODIMP
nsJARURI::SetSpec(const nsACString &aSpec)
{
nsresult rv;
nsCOMPtr<nsIIOService> serv(do_GetIOService(&rv));
nsCOMPtr<nsIIOService> ioServ(do_GetIOService(&rv));
if (NS_FAILED(rv)) return rv;
nsCAutoString scheme;
rv = serv->ExtractScheme(aSpec, scheme);
rv = ::ExtractURLScheme(aSpec, nsnull, nsnull, &scheme);
if (NS_FAILED(rv)) return rv;
if (strcmp("jar", scheme.get()) != 0)
@@ -119,16 +120,16 @@ nsJARURI::SetSpec(const nsACString &aSpec)
begin.advance(4);
rv = serv->NewURI(Substring(begin, delim_begin), mCharsetHint.get(), nsnull, getter_AddRefs(mJARFile));
rv = ioServ->NewURI(Substring(begin, delim_begin), mCharsetHint.get(), nsnull, getter_AddRefs(mJARFile));
if (NS_FAILED(rv)) return rv;
// skip over any extra '/' chars
while (*delim_end == '/')
++delim_end;
rv = serv->ResolveRelativePath(Substring(delim_end, end),
NS_LITERAL_CSTRING(""),
mJAREntry);
rv = ::ResolveRelativePath(Substring(delim_end, end),
NS_LITERAL_CSTRING(""),
mJAREntry);
return rv;
}
@@ -327,11 +328,8 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result)
{
nsresult rv;
nsCOMPtr<nsIIOService> serv(do_GetIOService(&rv));
if (NS_FAILED(rv)) return rv;
nsCAutoString scheme;
rv = serv->ExtractScheme(relativePath, scheme);
rv = ::ExtractURLScheme(relativePath, nsnull, nsnull, &scheme);
if (NS_SUCCEEDED(rv)) {
// then aSpec is absolute
result = relativePath;
@@ -346,8 +344,8 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result)
path = "";
nsCAutoString resolvedEntry;
rv = serv->ResolveRelativePath(relativePath, path,
resolvedEntry);
rv = ::ResolveRelativePath(relativePath, path,
resolvedEntry);
if (NS_FAILED(rv)) return rv;
return FormatSpec(resolvedEntry, result);
@@ -385,13 +383,11 @@ nsJARURI::GetJAREntry(nsACString &entryPath)
NS_IMETHODIMP
nsJARURI::SetJAREntry(const nsACString &entryPath)
{
nsresult rv;
nsCOMPtr<nsIIOService> serv(do_GetIOService(&rv));
if (NS_FAILED(rv)) return rv;
mJAREntry.Truncate();
return serv->ResolveRelativePath(entryPath, NS_LITERAL_CSTRING(""), mJAREntry);
return ::ResolveRelativePath(entryPath,
NS_LITERAL_CSTRING(""),
mJAREntry);
}
////////////////////////////////////////////////////////////////////////////////