Fixed jar url resolve so that chrome protocol works. Fixed jar channel to not remove channel after kicking off load. Bug 18433

This commit is contained in:
warren%netscape.com 2000-06-07 09:07:10 +00:00
parent 85fe7a1825
commit 855a42ad4a
4 changed files with 30 additions and 4 deletions

View File

@ -534,7 +534,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
}
error:
if (mLoadGroup) {
if (NS_FAILED(rv) && mLoadGroup) {
nsresult rv2 = mLoadGroup->RemoveChannel(this, nsnull, rv, nsnull); // XXX fix error message
NS_ASSERTION(NS_SUCCEEDED(rv2), "RemoveChannel failed");
}

View File

@ -1,4 +1,4 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -296,9 +296,22 @@ NS_IMETHODIMP
nsJARURI::Resolve(const char *relativePath, char **result)
{
nsresult rv;
if (!relativePath) return NS_ERROR_NULL_POINTER;
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsXPIDLCString scheme;
rv = serv->ExtractScheme(relativePath, nsnull, nsnull, getter_Copies(scheme));
if (NS_SUCCEEDED(rv)) {
// then aSpec is absolute
*result = nsCRT::strdup(relativePath);
if (*result == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
nsCAutoString path(mJAREntry);
PRInt32 pos = path.RFind("/");
if (pos >= 0)

View File

@ -534,7 +534,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
}
error:
if (mLoadGroup) {
if (NS_FAILED(rv) && mLoadGroup) {
nsresult rv2 = mLoadGroup->RemoveChannel(this, nsnull, rv, nsnull); // XXX fix error message
NS_ASSERTION(NS_SUCCEEDED(rv2), "RemoveChannel failed");
}

View File

@ -1,4 +1,4 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -296,9 +296,22 @@ NS_IMETHODIMP
nsJARURI::Resolve(const char *relativePath, char **result)
{
nsresult rv;
if (!relativePath) return NS_ERROR_NULL_POINTER;
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsXPIDLCString scheme;
rv = serv->ExtractScheme(relativePath, nsnull, nsnull, getter_Copies(scheme));
if (NS_SUCCEEDED(rv)) {
// then aSpec is absolute
*result = nsCRT::strdup(relativePath);
if (*result == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
nsCAutoString path(mJAREntry);
PRInt32 pos = path.RFind("/");
if (pos >= 0)