Backed out changeset 14d6dd504f86 (bug 1534339) for causing Bug 1595179. CLOSED TREE

--HG--
extra : rebase_source : 101262411debddee38453d05fdfb7327fe03438e
extra : histedit_source : 1ddb09ebad301dfc19bccf12386e7d0beb43cb1a
This commit is contained in:
Mihai Alexandru Michis 2019-11-14 14:59:16 +02:00
Родитель 64a0fd0a54
Коммит 33799b6110
2 изменённых файлов: 4 добавлений и 10 удалений

Просмотреть файл

@ -13,9 +13,6 @@
#include "nsIURI.h"
#include "nsURLHelper.h"
static const char kSourceChar = ':';
static const char kSanitizedChar = '+';
namespace mozilla {
using dom::URLParams;
@ -148,7 +145,8 @@ void OriginAttributes::CreateSuffix(nsACString& aStr) const {
if (!mFirstPartyDomain.IsEmpty()) {
nsAutoString sanitizedFirstPartyDomain(mFirstPartyDomain);
sanitizedFirstPartyDomain.ReplaceChar(kSourceChar, kSanitizedChar);
sanitizedFirstPartyDomain.ReplaceChar(
dom::quota::QuotaManager::kReplaceChars, '+');
params.Set(NS_LITERAL_STRING("firstPartyDomain"),
sanitizedFirstPartyDomain);
@ -157,7 +155,7 @@ void OriginAttributes::CreateSuffix(nsACString& aStr) const {
if (!mGeckoViewSessionContextId.IsEmpty()) {
nsAutoString sanitizedGeckoViewUserContextId(mGeckoViewSessionContextId);
sanitizedGeckoViewUserContextId.ReplaceChar(
dom::quota::QuotaManager::kReplaceChars, kSanitizedChar);
dom::quota::QuotaManager::kReplaceChars, '+');
params.Set(NS_LITERAL_STRING("geckoViewUserContextId"),
sanitizedGeckoViewUserContextId);
@ -245,9 +243,7 @@ class MOZ_STACK_CLASS PopulateFromSuffixIterator final
if (aName.EqualsLiteral("firstPartyDomain")) {
MOZ_RELEASE_ASSERT(mOriginAttributes->mFirstPartyDomain.IsEmpty());
nsAutoString firstPartyDomain(aValue);
firstPartyDomain.ReplaceChar(kSanitizedChar, kSourceChar);
mOriginAttributes->mFirstPartyDomain.Assign(firstPartyDomain);
mOriginAttributes->mFirstPartyDomain.Assign(aValue);
return true;
}

Просмотреть файл

@ -26,8 +26,6 @@ static void TestFPD(const nsAString& spec, const nsAString& fpd) {
ASSERT_EQ(NS_NewURI(getter_AddRefs(url), spec), NS_OK);
attrs.SetFirstPartyDomain(true, url);
EXPECT_TRUE(attrs.mFirstPartyDomain.Equals(fpd));
TestSuffix(attrs);
}
TEST(OriginAttributes, Suffix_default)