mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
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:
parent
85fe7a1825
commit
855a42ad4a
@ -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");
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user