diff --git a/chrome/src/nsChromeProtocolHandler.cpp b/chrome/src/nsChromeProtocolHandler.cpp index c1def664768..fd60d6342f3 100644 --- a/chrome/src/nsChromeProtocolHandler.cpp +++ b/chrome/src/nsChromeProtocolHandler.cpp @@ -521,6 +521,13 @@ nsChromeProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_re return NS_OK; } +NS_IMETHODIMP +nsChromeProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/directory/xpcom/base/src/nsLDAPProtocolHandler.cpp b/directory/xpcom/base/src/nsLDAPProtocolHandler.cpp index 82ae1050827..b0e307f1fae 100644 --- a/directory/xpcom/base/src/nsLDAPProtocolHandler.cpp +++ b/directory/xpcom/base/src/nsLDAPProtocolHandler.cpp @@ -77,6 +77,15 @@ nsLDAPProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +// getter method for uritype attribute +// +NS_IMETHODIMP +nsLDAPProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE; + return NS_OK; +} + // construct an appropriate URI // NS_IMETHODIMP diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 75b6073d199..63de48e505e 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -691,6 +691,13 @@ nsJSProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsJSProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsJSProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/extensions/datetime/nsDateTimeHandler.cpp b/extensions/datetime/nsDateTimeHandler.cpp index ba45078c374..0e609fc3223 100644 --- a/extensions/datetime/nsDateTimeHandler.cpp +++ b/extensions/datetime/nsDateTimeHandler.cpp @@ -72,6 +72,12 @@ nsDateTimeHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsDateTimeHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsDateTimeHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/extensions/finger/nsFingerHandler.cpp b/extensions/finger/nsFingerHandler.cpp index 7a959921e90..5ed8c49d4e4 100644 --- a/extensions/finger/nsFingerHandler.cpp +++ b/extensions/finger/nsFingerHandler.cpp @@ -72,6 +72,12 @@ nsFingerHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsFingerHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsFingerHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/extensions/inspector/base/src/inBitmapProtocolHandler.cpp b/extensions/inspector/base/src/inBitmapProtocolHandler.cpp index 87ed021782d..d58c890f1f4 100644 --- a/extensions/inspector/base/src/inBitmapProtocolHandler.cpp +++ b/extensions/inspector/base/src/inBitmapProtocolHandler.cpp @@ -59,6 +59,11 @@ NS_IMETHODIMP inBitmapProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP inBitmapProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE; + return NS_OK; +} NS_IMETHODIMP inBitmapProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval) { diff --git a/extensions/irc/js/lib/chatzilla-service.js b/extensions/irc/js/lib/chatzilla-service.js index 567b8f6b24f..6d2e9c888ca 100644 --- a/extensions/irc/js/lib/chatzilla-service.js +++ b/extensions/irc/js/lib/chatzilla-service.js @@ -162,6 +162,8 @@ function IRCProtocolHandler() IRCProtocolHandler.prototype.scheme = "irc"; IRCProtocolHandler.prototype.defaultPort = 6667; +IRCProtocolHandler.prototype.URIType = + Components.interfaces.nsIProtocolHandler.URI_NORELATIVE; IRCProtocolHandler.prototype.allowPort = function (aPort, aScheme) diff --git a/extensions/xmlterm/ui/xmlterm-service.js b/extensions/xmlterm/ui/xmlterm-service.js index 377769bc63e..22861364b68 100644 --- a/extensions/xmlterm/ui/xmlterm-service.js +++ b/extensions/xmlterm/ui/xmlterm-service.js @@ -154,6 +154,8 @@ function XMLTermProtocolHandler() XMLTermProtocolHandler.prototype.scheme = "terminal"; XMLTermProtocolHandler.prototype.defaultPort = -1; +XMLTermProtocolHandler.prototype.URIType = + Components.interfaces.nsIProtocolHandler.URI_NORELATIVE; XMLTermProtocolHandler.prototype.newURI = function (aSpec, aBaseURI) diff --git a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp index 95bf28a59a2..de77621a849 100644 --- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp +++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp @@ -94,6 +94,12 @@ NS_IMETHODIMP nsAddbookProtocolHandler::GetDefaultPort(PRInt32 *aDefaultPort) return NS_OK; } +NS_IMETHODIMP nsAddbookProtocolHandler::GetURIType(PRInt16 *aUritype) +{ + *aUritype = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsAddbookProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { // get a new smtp url diff --git a/mailnews/compose/src/nsSmtpService.cpp b/mailnews/compose/src/nsSmtpService.cpp index 6db004e0d73..e87c806a65f 100644 --- a/mailnews/compose/src/nsSmtpService.cpp +++ b/mailnews/compose/src/nsSmtpService.cpp @@ -273,6 +273,12 @@ nsSmtpService::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval) return NS_OK; } +NS_IMETHODIMP nsSmtpService::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE; + return NS_OK; +} + ////////////////////////////////////////////////////////////////////////// // This is just a little stub channel class for mailto urls. Mailto urls // don't really have any data for the stream calls in nsIChannel to make much sense. diff --git a/mailnews/imap/src/nsImapService.cpp b/mailnews/imap/src/nsImapService.cpp index 55d7c365be9..b010ee9d551 100644 --- a/mailnews/imap/src/nsImapService.cpp +++ b/mailnews/imap/src/nsImapService.cpp @@ -2976,6 +2976,12 @@ NS_IMETHODIMP nsImapService::GetDefaultPort(PRInt32 *aDefaultPort) return NS_OK; } +NS_IMETHODIMP nsImapService::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsImapService::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval) { // allow imap to run on any port diff --git a/mailnews/local/src/nsMailboxService.cpp b/mailnews/local/src/nsMailboxService.cpp index f4eb5df13a0..5a1cf41500f 100644 --- a/mailnews/local/src/nsMailboxService.cpp +++ b/mailnews/local/src/nsMailboxService.cpp @@ -43,6 +43,7 @@ #include "nsIDocShellLoadInfo.h" #include "nsIWebNavigation.h" #include "prprf.h" +#include "nsEscape.h" static NS_DEFINE_CID(kIStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID); @@ -349,7 +350,7 @@ nsresult nsMailboxService::PrepareMessageCopyUrl(nsIMsgFolder *folder, nsIUrlLis urlSpec = PR_smprintf("mailbox://%s", (const char *) filePath); nsCOMPtr url = do_QueryInterface(*aMailboxUrl); - url->SetSpec(urlSpec); + url->SetSpec(urlSpec); PR_FREEIF(urlSpec); (*aMailboxUrl)->SetMailboxAction(aMailboxAction); @@ -402,14 +403,16 @@ nsresult nsMailboxService::PrepareMessageUrl(const char * aSrcMsgMailboxURI, nsI { // set up the url spec and initialize the url with it. nsFilePath filePath(folderPath); // convert to file url representation... - + nsXPIDLCString escapedFilePath; + *((char**)getter_Copies(escapedFilePath)) = + nsEscape(filePath, url_Path); if (mPrintingOperation) - urlSpec = PR_smprintf("mailbox://%s?number=%d&header=print", (const char *) filePath, msgKey); + urlSpec = PR_smprintf("mailbox://%s?number=%d&header=print", (const char *) escapedFilePath, msgKey); else if (part) urlSpec = PR_smprintf("mailbox://%s?number=%d&%s", (const char *) - filePath, msgKey, part); + escapedFilePath, msgKey, part); else - urlSpec = PR_smprintf("mailbox://%s?number=%d", (const char *) filePath, msgKey); + urlSpec = PR_smprintf("mailbox://%s?number=%d", (const char *) escapedFilePath, msgKey); nsCOMPtr url = do_QueryInterface(*aMailboxUrl); url->SetSpec(urlSpec); @@ -462,6 +465,12 @@ NS_IMETHODIMP nsMailboxService::AllowPort(PRInt32 port, const char *scheme, PRBo return NS_OK; } +NS_IMETHODIMP nsMailboxService::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsMailboxService::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { nsCOMPtr aMsgUrl; diff --git a/mailnews/local/src/nsPop3Service.cpp b/mailnews/local/src/nsPop3Service.cpp index a37386e3ff8..8e730a398c0 100644 --- a/mailnews/local/src/nsPop3Service.cpp +++ b/mailnews/local/src/nsPop3Service.cpp @@ -326,6 +326,13 @@ NS_IMETHODIMP nsPop3Service::GetDefaultDoBiff(PRBool *aDoBiff) return NS_OK; } +NS_IMETHODIMP nsPop3Service::GetURIType(PRInt16 *result) +{ + NS_ENSURE_ARG_POINTER(result); + *result = URI_NORELATIVE; + return NS_OK; +} + NS_IMETHODIMP nsPop3Service::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { nsresult rv = NS_ERROR_FAILURE; diff --git a/mailnews/news/src/nsNntpService.cpp b/mailnews/news/src/nsNntpService.cpp index 060be714eef..f04c9054794 100644 --- a/mailnews/news/src/nsNntpService.cpp +++ b/mailnews/news/src/nsNntpService.cpp @@ -1245,6 +1245,13 @@ nsNntpService::GetDefaultServerPort(PRBool isSecure, PRInt32 *aDefaultPort) return rv; } +NS_IMETHODIMP nsNntpService::GetURIType(PRInt16 *aUritype) +{ + NS_ENSURE_ARG_POINTER(aUritype); + *aUritype = URI_NORELATIVE; + return NS_OK; +} + NS_IMETHODIMP nsNntpService::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { nsresult rv = NS_OK; diff --git a/modules/libjar/nsJARProtocolHandler.cpp b/modules/libjar/nsJARProtocolHandler.cpp index 946cc086191..6a13c0c4ff2 100644 --- a/modules/libjar/nsJARProtocolHandler.cpp +++ b/modules/libjar/nsJARProtocolHandler.cpp @@ -111,6 +111,16 @@ nsJARProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsJARProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + /* Although jar uris have their own concept of relative urls + it is very different from the standard behaviour, so we + have to say norelative here! */ + return NS_OK; +} + NS_IMETHODIMP nsJARProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp b/modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp index 6983a16cf92..3fe68440952 100644 --- a/modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp +++ b/modules/libpr0n/decoders/icon/nsIconProtocolHandler.cpp @@ -59,7 +59,6 @@ NS_IMETHODIMP nsIconProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } - NS_IMETHODIMP nsIconProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval) { // don't override anything. @@ -67,6 +66,12 @@ NS_IMETHODIMP nsIconProtocolHandler::AllowPort(PRInt32 port, const char *scheme, return NS_OK; } +NS_IMETHODIMP nsIconProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsIconProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { // no concept of a relative icon url diff --git a/netwerk/base/public/nsIIOService.idl b/netwerk/base/public/nsIIOService.idl index 9e887947cbd..9380fbc551f 100644 --- a/netwerk/base/public/nsIIOService.idl +++ b/netwerk/base/public/nsIIOService.idl @@ -39,6 +39,14 @@ interface nsIIOService : nsISupports */ nsIProtocolHandler getProtocolHandler(in string scheme); + /** + * Returns a uritype for a given scheme. + * + * @param scheme URI scheme + * @return returns short for uritype definition + */ + short getURIType(in string scheme); + /** * This method constructs a new URI by first determining the scheme * of the URI spec, and then delegating the construction of the URI diff --git a/netwerk/base/public/nsIProtocolHandler.idl b/netwerk/base/public/nsIProtocolHandler.idl index 9f06dee3c32..c156bd3f76b 100644 --- a/netwerk/base/public/nsIProtocolHandler.idl +++ b/netwerk/base/public/nsIProtocolHandler.idl @@ -30,14 +30,34 @@ interface nsIProtocolHandler : nsISupports { readonly attribute string scheme; - /** - * Default Port will be the port that this protocol normally - * uses. If a port does not make sense for the protocol (eg about://) - * -1 will be returned. - */ + /** + * Default Port will be the port that this protocol normally + * uses. If a port does not make sense for the protocol (eg about://) + * -1 will be returned. + */ readonly attribute long defaultPort; + /** + * constants for the uritype mask + */ + + /* the first is the default mask 0, the following masks are deviations */ + + /* standard full uri, has authority component and + has concept of relative uris (http, ftp, ...) */ + const short URI_STD = 0; + + /* no concept of relative uris, (about, rdf, javascript, finger, ...) */ + const short URI_NORELATIVE = (1<<0); + + /* no authority component (file, ...) */ + const short URI_NOAUTH = (1<<1); + + /* more to come as needed */ + + readonly attribute short URIType; + /** * Makes a URI object that is suitable for loading by this protocol. * In the usual case (when only the accessors provided by nsIURI are diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp index d64be634129..25ccb9bf319 100644 --- a/netwerk/base/src/nsIOService.cpp +++ b/netwerk/base/src/nsIOService.cpp @@ -600,6 +600,19 @@ nsIOService::ExtractUrlPart(const char *urlString, PRInt16 flag, PRUint32 *start return NS_OK; } +NS_IMETHODIMP +nsIOService::GetURIType(const char* scheme, PRInt16 *uritype) +{ + nsCOMPtr handler; + nsresult rv = GetProtocolHandler(scheme, getter_AddRefs(handler)); + if (NS_FAILED(rv)) { + return rv; + } + rv = handler->GetURIType(uritype); + return rv; +} + + nsresult nsIOService::NewURI(const char* aSpec, nsIURI* aBaseURI, nsIURI* *result) { diff --git a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp index 440fbae772d..509c5108ef9 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp @@ -91,6 +91,13 @@ nsAboutProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsAboutProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsAboutProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/netwerk/protocol/data/src/nsDataHandler.cpp b/netwerk/protocol/data/src/nsDataHandler.cpp index e9371a7325c..19deb67a0b9 100644 --- a/netwerk/protocol/data/src/nsDataHandler.cpp +++ b/netwerk/protocol/data/src/nsDataHandler.cpp @@ -73,6 +73,12 @@ nsDataHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsDataHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsDataHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/netwerk/protocol/datetime/src/nsDateTimeHandler.cpp b/netwerk/protocol/datetime/src/nsDateTimeHandler.cpp index ba45078c374..0e609fc3223 100644 --- a/netwerk/protocol/datetime/src/nsDateTimeHandler.cpp +++ b/netwerk/protocol/datetime/src/nsDateTimeHandler.cpp @@ -72,6 +72,12 @@ nsDateTimeHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsDateTimeHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsDateTimeHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/netwerk/protocol/file/src/nsFileProtocolHandler.cpp b/netwerk/protocol/file/src/nsFileProtocolHandler.cpp index 302990818ad..79cd211a5f9 100644 --- a/netwerk/protocol/file/src/nsFileProtocolHandler.cpp +++ b/netwerk/protocol/file/src/nsFileProtocolHandler.cpp @@ -95,6 +95,13 @@ nsFileProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsFileProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsFileProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/netwerk/protocol/finger/src/nsFingerHandler.cpp b/netwerk/protocol/finger/src/nsFingerHandler.cpp index 7a959921e90..5ed8c49d4e4 100644 --- a/netwerk/protocol/finger/src/nsFingerHandler.cpp +++ b/netwerk/protocol/finger/src/nsFingerHandler.cpp @@ -72,6 +72,12 @@ nsFingerHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsFingerHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsFingerHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp index c875a1ab1e3..4a6fe3d9064 100644 --- a/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/src/nsFtpProtocolHandler.cpp @@ -136,6 +136,13 @@ nsFtpProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsFtpProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsFtpProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/netwerk/protocol/gopher/src/nsGopherHandler.cpp b/netwerk/protocol/gopher/src/nsGopherHandler.cpp index 2a286fe22f7..d0be7643745 100644 --- a/netwerk/protocol/gopher/src/nsGopherHandler.cpp +++ b/netwerk/protocol/gopher/src/nsGopherHandler.cpp @@ -89,6 +89,12 @@ nsGopherHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsGopherHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE; + return NS_OK; +} + NS_IMETHODIMP nsGopherHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/netwerk/protocol/http/src/nsHttpHandler.cpp b/netwerk/protocol/http/src/nsHttpHandler.cpp index 144f091db67..acef08bf36f 100644 --- a/netwerk/protocol/http/src/nsHttpHandler.cpp +++ b/netwerk/protocol/http/src/nsHttpHandler.cpp @@ -1536,6 +1536,13 @@ nsHttpHandler::GetDefaultPort(PRInt32 *aDefaultPort) return NS_ERROR_NOT_IMPLEMENTED; } +NS_IMETHODIMP +nsHttpHandler::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsHttpHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **aURI) { diff --git a/netwerk/protocol/jar/src/nsJARProtocolHandler.cpp b/netwerk/protocol/jar/src/nsJARProtocolHandler.cpp index 946cc086191..6a13c0c4ff2 100644 --- a/netwerk/protocol/jar/src/nsJARProtocolHandler.cpp +++ b/netwerk/protocol/jar/src/nsJARProtocolHandler.cpp @@ -111,6 +111,16 @@ nsJARProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsJARProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + /* Although jar uris have their own concept of relative urls + it is very different from the standard behaviour, so we + have to say norelative here! */ + return NS_OK; +} + NS_IMETHODIMP nsJARProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp b/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp index 7148c6e0c50..fa0100232dc 100644 --- a/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp +++ b/netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp @@ -95,6 +95,12 @@ nsKeywordProtocolHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsKeywordProtocolHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + // digests a spec _without_ the preceeding "keyword:" scheme. static char * MangleKeywordIntoHTTPURL(const char *aSpec, const char *aHTTPURL) { diff --git a/netwerk/protocol/res/src/nsResProtocolHandler.cpp b/netwerk/protocol/res/src/nsResProtocolHandler.cpp index c60107a53cd..a3913480829 100644 --- a/netwerk/protocol/res/src/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/src/nsResProtocolHandler.cpp @@ -182,6 +182,13 @@ nsResProtocolHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsResProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsResProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/netwerk/protocol/theme/src/nsThemeHandler.cpp b/netwerk/protocol/theme/src/nsThemeHandler.cpp index 819913158a9..d4c4ee9666c 100644 --- a/netwerk/protocol/theme/src/nsThemeHandler.cpp +++ b/netwerk/protocol/theme/src/nsThemeHandler.cpp @@ -120,6 +120,13 @@ nsThemeHandler::GetDefaultPort(PRInt32 *result) return NS_OK; } +NS_IMETHODIMP +nsThemeHandler::GetURIType(PRInt16 *result) +{ + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsThemeHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/netwerk/protocol/viewsource/src/nsViewSourceHandler.cpp b/netwerk/protocol/viewsource/src/nsViewSourceHandler.cpp index fe581caa33d..52217519043 100644 --- a/netwerk/protocol/viewsource/src/nsViewSourceHandler.cpp +++ b/netwerk/protocol/viewsource/src/nsViewSourceHandler.cpp @@ -73,6 +73,12 @@ nsViewSourceHandler::GetDefaultPort(PRInt32 *result) { return NS_OK; } +NS_IMETHODIMP +nsViewSourceHandler::GetURIType(PRInt16 *result) { + *result = URI_NORELATIVE | URI_NOAUTH; + return NS_OK; +} + NS_IMETHODIMP nsViewSourceHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) { diff --git a/rdf/chrome/src/nsChromeProtocolHandler.cpp b/rdf/chrome/src/nsChromeProtocolHandler.cpp index c1def664768..fd60d6342f3 100644 --- a/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -521,6 +521,13 @@ nsChromeProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_re return NS_OK; } +NS_IMETHODIMP +nsChromeProtocolHandler::GetURIType(PRInt16 *result) +{ + *result = URI_STD; + return NS_OK; +} + NS_IMETHODIMP nsChromeProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **result) diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index 2b8f69f94cb..ebfd6bed2d3 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -302,6 +302,13 @@ PRBool nsExternalProtocolHandler::HaveProtocolHandler(nsIURI * aURI) return haveHandler; } +NS_IMETHODIMP nsExternalProtocolHandler::GetURIType(PRInt16 *aUritype) +{ + // Make it norelative since it is a simple uri + *aUritype = URI_NORELATIVE; + return NS_OK; +} + NS_IMETHODIMP nsExternalProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { nsresult rv = NS_ERROR_UNKNOWN_PROTOCOL;