зеркало из https://github.com/mozilla/gecko-dev.git
Changed GetOwner() to read owner from underlying nsJAR rather than saving it locally. SetOwner() now does nothing. bug=7270 r=norris
This commit is contained in:
Родитель
8df8c26172
Коммит
e526225795
|
@ -473,7 +473,6 @@ nsJARChannel::GetContentType(char* *aContentType)
|
|||
char* fileName = new char[PL_strlen(mJAREntry)+1];
|
||||
PL_strcpy(fileName, mJAREntry);
|
||||
|
||||
//char* fileName = <get the relative part of the jar URL's file name>;
|
||||
if (fileName != nsnull) {
|
||||
PRInt32 len = nsCRT::strlen(fileName);
|
||||
const char* ext = nsnull;
|
||||
|
@ -554,27 +553,22 @@ nsJARChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::GetOwner(nsISupports* *aOwner)
|
||||
{
|
||||
if (!mOwner)
|
||||
{
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsresult rv = mJAR->GetPrincipal(mJAREntry, getter_AddRefs(principal));
|
||||
if (NS_SUCCEEDED(rv) && principal)
|
||||
mOwner = do_QueryInterface(principal);
|
||||
rv = principal->QueryInterface(NS_GET_IID(nsISupports), (void **)aOwner);
|
||||
else
|
||||
mOwner = null_nsCOMPtr();
|
||||
}
|
||||
*aOwner = nsnull;
|
||||
|
||||
*aOwner = mOwner.get();
|
||||
NS_IF_ADDREF(*aOwner);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::SetOwner(nsISupports* aOwner)
|
||||
{
|
||||
mOwner = aOwner;
|
||||
return NS_OK;
|
||||
//XXX: is this OK?
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -652,7 +646,7 @@ nsJARChannel::Open(char* *contentType, PRInt32 *contentLength)
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// If this fails, GetOwner will fail, but otherwise we can continue.
|
||||
rv = mJAR->ParseManifest();
|
||||
mJAR->ParseManifest();
|
||||
|
||||
nsCOMPtr<nsIZipEntry> entry;
|
||||
rv = mJAR->GetEntry(mJAREntry, getter_AddRefs(entry));
|
||||
|
|
|
@ -91,7 +91,6 @@ protected:
|
|||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
nsLoadFlags mLoadAttributes;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
|
||||
PRUint32 mStartPosition;
|
||||
PRInt32 mReadCount;
|
||||
|
|
|
@ -473,7 +473,6 @@ nsJARChannel::GetContentType(char* *aContentType)
|
|||
char* fileName = new char[PL_strlen(mJAREntry)+1];
|
||||
PL_strcpy(fileName, mJAREntry);
|
||||
|
||||
//char* fileName = <get the relative part of the jar URL's file name>;
|
||||
if (fileName != nsnull) {
|
||||
PRInt32 len = nsCRT::strlen(fileName);
|
||||
const char* ext = nsnull;
|
||||
|
@ -554,27 +553,22 @@ nsJARChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::GetOwner(nsISupports* *aOwner)
|
||||
{
|
||||
if (!mOwner)
|
||||
{
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsresult rv = mJAR->GetPrincipal(mJAREntry, getter_AddRefs(principal));
|
||||
if (NS_SUCCEEDED(rv) && principal)
|
||||
mOwner = do_QueryInterface(principal);
|
||||
rv = principal->QueryInterface(NS_GET_IID(nsISupports), (void **)aOwner);
|
||||
else
|
||||
mOwner = null_nsCOMPtr();
|
||||
}
|
||||
*aOwner = nsnull;
|
||||
|
||||
*aOwner = mOwner.get();
|
||||
NS_IF_ADDREF(*aOwner);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::SetOwner(nsISupports* aOwner)
|
||||
{
|
||||
mOwner = aOwner;
|
||||
return NS_OK;
|
||||
//XXX: is this OK?
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -652,7 +646,7 @@ nsJARChannel::Open(char* *contentType, PRInt32 *contentLength)
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// If this fails, GetOwner will fail, but otherwise we can continue.
|
||||
rv = mJAR->ParseManifest();
|
||||
mJAR->ParseManifest();
|
||||
|
||||
nsCOMPtr<nsIZipEntry> entry;
|
||||
rv = mJAR->GetEntry(mJAREntry, getter_AddRefs(entry));
|
||||
|
|
|
@ -91,7 +91,6 @@ protected:
|
|||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
nsLoadFlags mLoadAttributes;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
|
||||
PRUint32 mStartPosition;
|
||||
PRInt32 mReadCount;
|
||||
|
|
Загрузка…
Ссылка в новой задаче