diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /netwerk/base/nsNetUtil.h | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/base/nsNetUtil.h')
-rw-r--r-- | netwerk/base/nsNetUtil.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index c1f30a56ed..8058ae89d9 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -294,10 +294,28 @@ int32_t NS_GetDefaultPort(const char* scheme, nsIIOService* ioService = nullptr); /** - * This function is a helper function to apply the ToAscii conversion - * to a string + * The UTS #46 ToASCII operation as parametrized by the WHATWG URL Standard. + * + * Use this function to prepare a host name for network protocols. + */ +nsresult NS_DomainToASCII(const nsACString& aHost, nsACString& aASCII); + +/** + * The UTS #46 ToUnicode operation as parametrized by the WHATWG URL Standard, + * except potentially misleading labels are treated according to ToASCII + * instead. + * + * Use this function to prepare a host name for display to the user. */ -bool NS_StringToACE(const nsACString& idn, nsACString& result); +nsresult NS_DomainToDisplay(const nsACString& aHost, nsACString& aDisplay); + +/** + * The UTS #46 ToUnicode operation as parametrized by the WHATWG URL Standard. + * + * It's most likely incorrect to call this function, and `NS_DomainToDisplay` + * should typically be called instead. + */ +nsresult NS_DomainToUnicode(const nsACString& aHost, nsACString& aUnicode); /** * This function is a helper function to get a protocol's default port if the @@ -1020,7 +1038,7 @@ bool SchemeIsFTP(nsIURI* aURI); // step 2.1 in https://url.spec.whatwg.org/#scheme-state bool SchemeIsSpecial(const nsACString&); bool IsSchemeChangePermitted(nsIURI*, const nsACString&); -already_AddRefed<nsIURI> TryChangeProtocol(nsIURI*, const nsAString&); +already_AddRefed<nsIURI> TryChangeProtocol(nsIURI*, const nsACString&); struct LinkHeader { nsString mHref; @@ -1099,6 +1117,8 @@ void CheckForBrokenChromeURL(nsILoadInfo* aLoadInfo, nsIURI* aURI); bool IsCoepCredentiallessEnabled(bool aIsOriginTrialCoepCredentiallessEnabled); +void ParseSimpleURISchemes(const nsACString& schemeList); + } // namespace net } // namespace mozilla |