From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- netwerk/dns/nsIDNService.h | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'netwerk/dns/nsIDNService.h') diff --git a/netwerk/dns/nsIDNService.h b/netwerk/dns/nsIDNService.h index 1e90191326..6e5900e842 100644 --- a/netwerk/dns/nsIDNService.h +++ b/netwerk/dns/nsIDNService.h @@ -16,6 +16,7 @@ #include "mozilla/UniquePtr.h" #include "nsString.h" +#include "nsStringFwd.h" class nsIPrefBranch; @@ -83,8 +84,8 @@ class nsIDNService final : public nsIIDNService { * display, the output is the same as the input * @see isLabelSafe */ - nsresult decodeACE(const nsACString& in, nsACString& out, - stringPrepFlag flag); + nsresult decodeACE(const nsACString& in, nsACString& out, stringPrepFlag flag, + const nsACString& tld); /** * Convert complete domain names between UTF8 and ACE and vice versa @@ -98,6 +99,8 @@ class nsIDNService final : public nsIIDNService { nsresult ACEtoUTF8(const nsACString& input, nsACString& _retval, stringPrepFlag flag); + nsresult Normalize(const nsACString& input, nsACString& output); + void prefsChanged(const char* pref); static void PrefChanged(const char* aPref, void* aSelf) { @@ -132,7 +135,19 @@ class nsIDNService final : public nsIIDNService { * Both simplified-only and traditional-only Chinese characters * XXX this test was disabled by bug 857481 */ - bool isLabelSafe(const nsAString& label) MOZ_EXCLUDES(mLock); + bool isLabelSafe(const nsAString& label, const nsAString& tld) + MOZ_EXCLUDES(mLock); + + /** + * Restriction-level Detection profiles defined in UTR 39 + * http://www.unicode.org/reports/tr39/#Restriction_Level_Detection, + * and selected by the pref network.IDN.restriction_profile + */ + enum restrictionProfile { + eASCIIOnlyProfile, + eHighlyRestrictiveProfile, + eModeratelyRestrictiveProfile + }; /** * Determine whether a combination of scripts in a single label is @@ -148,9 +163,9 @@ class nsIDNService final : public nsIIDNService { * For the "Moderately restrictive" profile, Latin is also allowed * with other scripts except Cyrillic and Greek */ - bool illegalScriptCombo(mozilla::intl::Script script, - mozilla::net::ScriptCombo& savedScript) - MOZ_REQUIRES_SHARED(mLock); + bool illegalScriptCombo(restrictionProfile profile, + mozilla::intl::Script script, + mozilla::net::ScriptCombo& savedScript); /** * Convert a DNS label from ASCII to Unicode using IDNA2008 @@ -173,16 +188,6 @@ class nsIDNService final : public nsIIDNService { // guarded by mLock nsTArray mIDNBlocklist MOZ_GUARDED_BY(mLock); - /** - * Restriction-level Detection profiles defined in UTR 39 - * http://www.unicode.org/reports/tr39/#Restriction_Level_Detection, - * and selected by the pref network.IDN.restriction_profile - */ - enum restrictionProfile { - eASCIIOnlyProfile, - eHighlyRestrictiveProfile, - eModeratelyRestrictiveProfile - }; // guarded by mLock; restrictionProfile mRestrictionProfile MOZ_GUARDED_BY(mLock){ eASCIIOnlyProfile}; -- cgit v1.2.3