Bug 1621310 - Remove geturi in ContentPrincipal.cpp r=ckerschb
authorSebastian Streich <sstreich@mozilla.com>
Thu, 12 Mar 2020 19:47:56 +0000
changeset 518486 fc2cf95fd031435de3f9edccb6c330b0fe14d812
parent 518485 dbb45e31e5af1ee8df157eee5e6bc3075f90b5d7
child 518487 0666d5b6f6a5a8bfdeacd5cdacbb897e69432ad1
push id37210
push userdvarga@mozilla.com
push dateFri, 13 Mar 2020 04:24:24 +0000
treeherdermozilla-central@7fd4c0e31fde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1621310
milestone76.0a1
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
Bug 1621310 - Remove geturi in ContentPrincipal.cpp r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D66250
caps/ContentPrincipal.cpp
--- a/caps/ContentPrincipal.cpp
+++ b/caps/ContentPrincipal.cpp
@@ -260,22 +260,21 @@ bool ContentPrincipal::SubsumesInternal(
             thisSiteOrigin == otherSiteOrigin,
             "SubsumesConsideringDomain passed with mismatched siteOrigin!");
       }
 #endif
       return isMatch;
     }
   }
 
-  nsCOMPtr<nsIURI> otherURI;
-  rv = aOther->GetURI(getter_AddRefs(otherURI));
+  // Compare uris.
+  bool isSameOrigin = false;
+  rv = aOther->IsSameOrigin(mURI, false, &isSameOrigin);
   NS_ENSURE_SUCCESS(rv, false);
-
-  // Compare uris.
-  return nsScriptSecurityManager::SecurityCompareURIs(mURI, otherURI);
+  return isSameOrigin;
 }
 
 NS_IMETHODIMP
 ContentPrincipal::GetURI(nsIURI** aURI) {
   NS_ADDREF(*aURI = mURI);
   return NS_OK;
 }