From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- dom/quota/StorageOriginAttributes.cpp | 39 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'dom/quota/StorageOriginAttributes.cpp') diff --git a/dom/quota/StorageOriginAttributes.cpp b/dom/quota/StorageOriginAttributes.cpp index bcdf47bce8..b5fd68407a 100644 --- a/dom/quota/StorageOriginAttributes.cpp +++ b/dom/quota/StorageOriginAttributes.cpp @@ -17,18 +17,17 @@ void StorageOriginAttributes::CreateSuffix(nsACString& aStr) const { nsCString str1; URLParams params; - nsAutoString value; + nsAutoCString value; if (mInIsolatedMozBrowser) { - params.Set(u"inBrowser"_ns, u"1"_ns); + params.Set("inBrowser"_ns, "1"_ns); } str1.Truncate(); - params.Serialize(value, true); if (!value.IsEmpty()) { str1.AppendLiteral("^"); - str1.Append(NS_ConvertUTF16toUTF8(value)); + str1.Append(value); } // Make sure that the string don't contain characters that would get replaced @@ -67,22 +66,22 @@ bool StorageOriginAttributes::PopulateFromSuffix(const nsACString& aStr) { return false; } - bool ok = - URLParams::Parse(Substring(aStr, 1, aStr.Length() - 1), true, - [this](const nsAString& aName, const nsAString& aValue) { - if (aName.EqualsLiteral("inBrowser")) { - if (!aValue.EqualsLiteral("1")) { - return false; - } - - mInIsolatedMozBrowser = true; - return true; - } - - // Let OriginAttributes::PopulateFromSuffix parse other - // origin attributes. - return true; - }); + bool ok = URLParams::Parse( + Substring(aStr, 1, aStr.Length() - 1), true, + [this](const nsACString& aName, const nsACString& aValue) { + if (aName.EqualsLiteral("inBrowser")) { + if (!aValue.EqualsLiteral("1")) { + return false; + } + + mInIsolatedMozBrowser = true; + return true; + } + + // Let OriginAttributes::PopulateFromSuffix parse other + // origin attributes. + return true; + }); if (!ok) { return false; } -- cgit v1.2.3