diff --git a/chrome/src/nsChromeProtocolHandler.cpp b/chrome/src/nsChromeProtocolHandler.cpp index 6714260dba7e..59952ebd82f0 100644 --- a/chrome/src/nsChromeProtocolHandler.cpp +++ b/chrome/src/nsChromeProtocolHandler.cpp @@ -37,6 +37,7 @@ #include "nsIEventQueueService.h" #include "nsIIOService.h" #include "nsILoadGroup.h" +#include "nsIResChannel.h" #include "nsIScriptSecurityManager.h" #include "nsIStreamListener.h" #include "nsIServiceManager.h" @@ -694,6 +695,15 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result)); if (NS_FAILED(rv)) return rv; + // XXX Will be removed someday when we handle remote chrome. + nsCOMPtr res(do_QueryInterface(result)); + nsCOMPtr file(do_QueryInterface(result)); + if (!res && !file) { + NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n"); + result = nsnull; + return NS_ERROR_FAILURE; + } + // Make sure that the channel remembers where it was // originally loaded from. rv = result->SetOriginalURI(aURI); diff --git a/rdf/chrome/src/nsChromeProtocolHandler.cpp b/rdf/chrome/src/nsChromeProtocolHandler.cpp index 6714260dba7e..59952ebd82f0 100644 --- a/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -37,6 +37,7 @@ #include "nsIEventQueueService.h" #include "nsIIOService.h" #include "nsILoadGroup.h" +#include "nsIResChannel.h" #include "nsIScriptSecurityManager.h" #include "nsIStreamListener.h" #include "nsIServiceManager.h" @@ -694,6 +695,15 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result)); if (NS_FAILED(rv)) return rv; + // XXX Will be removed someday when we handle remote chrome. + nsCOMPtr res(do_QueryInterface(result)); + nsCOMPtr file(do_QueryInterface(result)); + if (!res && !file) { + NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n"); + result = nsnull; + return NS_ERROR_FAILURE; + } + // Make sure that the channel remembers where it was // originally loaded from. rv = result->SetOriginalURI(aURI);