Fix for jar packaging. r=dprice

This commit is contained in:
hyatt%netscape.com 2000-08-23 07:31:58 +00:00
parent 4069c7f384
commit e1913cd0c9
2 changed files with 24 additions and 8 deletions

View File

@ -37,6 +37,7 @@
#include "nsIIOService.h"
#include "nsILoadGroup.h"
#include "nsIResChannel.h"
#include "nsIJARChannel.h"
#include "nsIScriptSecurityManager.h"
#include "nsIStreamListener.h"
#include "nsIServiceManager.h"
@ -699,10 +700,17 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
if (NS_FAILED(rv)) return rv;
// XXX Will be removed someday when we handle remote chrome.
nsCOMPtr<nsIResChannel> res(do_QueryInterface(result));
nsCOMPtr<nsIFileChannel> file(do_QueryInterface(result));
if (!res && !file) {
NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n");
nsCOMPtr<nsIJARChannel> jar;
nsCOMPtr<nsIResChannel> res;
nsCOMPtr<nsIFileChannel> file;
res = do_QueryInterface(result);
if (!res) {
file = do_QueryInterface(result);
if (!file)
jar = do_QueryInterface(result);
}
if (!res && !file && !jar) {
NS_WARNING("Remote chrome not allowed! Only file:, resource:, and jar: are valid.\n");
result = nsnull;
return NS_ERROR_FAILURE;
}

View File

@ -37,6 +37,7 @@
#include "nsIIOService.h"
#include "nsILoadGroup.h"
#include "nsIResChannel.h"
#include "nsIJARChannel.h"
#include "nsIScriptSecurityManager.h"
#include "nsIStreamListener.h"
#include "nsIServiceManager.h"
@ -699,10 +700,17 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
if (NS_FAILED(rv)) return rv;
// XXX Will be removed someday when we handle remote chrome.
nsCOMPtr<nsIResChannel> res(do_QueryInterface(result));
nsCOMPtr<nsIFileChannel> file(do_QueryInterface(result));
if (!res && !file) {
NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n");
nsCOMPtr<nsIJARChannel> jar;
nsCOMPtr<nsIResChannel> res;
nsCOMPtr<nsIFileChannel> file;
res = do_QueryInterface(result);
if (!res) {
file = do_QueryInterface(result);
if (!file)
jar = do_QueryInterface(result);
}
if (!res && !file && !jar) {
NS_WARNING("Remote chrome not allowed! Only file:, resource:, and jar: are valid.\n");
result = nsnull;
return NS_ERROR_FAILURE;
}