Backed out changeset 14d6dd504f86 (bug 1534339) for causing Bug 1595179. CLOSED TREE
authorMihai Alexandru Michis <malexandru@mozilla.com>
Thu, 14 Nov 2019 14:59:16 +0200
changeset 501940 9f6892c03bd8dfcc604461ea90e71430c220fb74
parent 501939 3a3dda1714d5fb4b818e0a78cc8291b6c98f056f
child 501941 40b09567e312348b311865f3d54bfd08d4dbf58b
push id100513
push usermalexandru@mozilla.com
push dateThu, 14 Nov 2019 13:38:49 +0000
treeherderautoland@9f6892c03bd8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1534339, 1595179
milestone72.0a1
backs out14d6dd504f86d34d7f781caf77ac1205b5d9a0ce
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 14d6dd504f86 (bug 1534339) for causing Bug 1595179. CLOSED TREE
caps/OriginAttributes.cpp
caps/tests/gtest/TestOriginAttributes.cpp
--- a/caps/OriginAttributes.cpp
+++ b/caps/OriginAttributes.cpp
@@ -8,19 +8,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/BlobURLProtocolHandler.h"
 #include "mozilla/dom/URLSearchParams.h"
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIURI.h"
 #include "nsURLHelper.h"
 
-static const char kSourceChar = ':';
-static const char kSanitizedChar = '+';
-
 namespace mozilla {
 
 using dom::URLParams;
 
 void OriginAttributes::SetFirstPartyDomain(const bool aIsTopLevelDocument,
                                            nsIURI* aURI, bool aForced) {
   bool isFirstPartyEnabled = IsFirstPartyEnabled();
 
@@ -143,26 +140,27 @@ void OriginAttributes::CreateSuffix(nsAC
   if (mPrivateBrowsingId) {
     value.Truncate();
     value.AppendInt(mPrivateBrowsingId);
     params.Set(NS_LITERAL_STRING("privateBrowsingId"), value);
   }
 
   if (!mFirstPartyDomain.IsEmpty()) {
     nsAutoString sanitizedFirstPartyDomain(mFirstPartyDomain);
-    sanitizedFirstPartyDomain.ReplaceChar(kSourceChar, kSanitizedChar);
+    sanitizedFirstPartyDomain.ReplaceChar(
+        dom::quota::QuotaManager::kReplaceChars, '+');
 
     params.Set(NS_LITERAL_STRING("firstPartyDomain"),
                sanitizedFirstPartyDomain);
   }
 
   if (!mGeckoViewSessionContextId.IsEmpty()) {
     nsAutoString sanitizedGeckoViewUserContextId(mGeckoViewSessionContextId);
     sanitizedGeckoViewUserContextId.ReplaceChar(
-        dom::quota::QuotaManager::kReplaceChars, kSanitizedChar);
+        dom::quota::QuotaManager::kReplaceChars, '+');
 
     params.Set(NS_LITERAL_STRING("geckoViewUserContextId"),
                sanitizedGeckoViewUserContextId);
   }
 
   aStr.Truncate();
 
   params.Serialize(value);
@@ -240,19 +238,17 @@ class MOZ_STACK_CLASS PopulateFromSuffix
       NS_ENSURE_TRUE(val >= 0 && val <= UINT32_MAX, false);
       mOriginAttributes->mPrivateBrowsingId = static_cast<uint32_t>(val);
 
       return true;
     }
 
     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;
     }
 
     if (aName.EqualsLiteral("geckoViewUserContextId")) {
       MOZ_RELEASE_ASSERT(
           mOriginAttributes->mGeckoViewSessionContextId.IsEmpty());
       mOriginAttributes->mGeckoViewSessionContextId.Assign(aValue);
       return true;
--- a/caps/tests/gtest/TestOriginAttributes.cpp
+++ b/caps/tests/gtest/TestOriginAttributes.cpp
@@ -21,18 +21,16 @@ static void TestSuffix(const OriginAttri
 }
 
 static void TestFPD(const nsAString& spec, const nsAString& fpd) {
   OriginAttributes attrs;
   nsCOMPtr<nsIURI> url;
   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)
 {
   OriginAttributes attrs;
   TestSuffix(attrs);
 }