Bug 1297963 - Part 4: Remove unused URLValueData comparison functions. r=emilio draft
authorCameron McCormack <cam@mcc.id.au>
Fri, 02 Sep 2016 19:56:59 +1000
changeset 409180 83650d20afac4e913993e27ec9db2aaf9480741a
parent 409179 8e2c677cbef35995c869374a0b85f87390fe9b66
child 530286 d8a23794bc0bf4f2809f7727a7e4be84be01d389
push id28409
push usercmccormack@mozilla.com
push dateFri, 02 Sep 2016 10:01:25 +0000
reviewersemilio
bugs1297963
milestone51.0a1
Bug 1297963 - Part 4: Remove unused URLValueData comparison functions. r=emilio MozReview-Commit-ID: K1Fg2XW9sd9
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -2644,46 +2644,16 @@ css::URLValueData::operator==(const URLV
            (NS_SUCCEEDED(self.mBaseURI.get()->Equals(other.mBaseURI.get(), &eq)) &&
             eq)) &&
           (mOriginPrincipal == aOther.mOriginPrincipal ||
            self.mOriginPrincipal.get()->Equals(other.mOriginPrincipal.get())) &&
           mLocalURLFlag == aOther.mLocalURLFlag;
 }
 
 bool
-css::URLValueData::MaybeUnresolvedURIEquals(const URLValueData& aOther) const
-{
-  if (!mURIResolved || !aOther.mURIResolved) {
-    return false;
-  }
-
-  return URIEquals(aOther);
-}
-
-bool
-css::URLValueData::URIEquals(const URLValueData& aOther) const
-{
-  MOZ_ASSERT(mURIResolved && aOther.mURIResolved,
-             "How do you know the URIs aren't null?");
-  bool eq;
-  // Cast away const so we can call nsIPrincipal::Equals.
-  auto& self = *const_cast<URLValueData*>(this);
-  auto& other = const_cast<URLValueData&>(aOther);
-  // Worth comparing GetURI() to aOther.GetURI() and mOriginPrincipal to
-  // aOther.mOriginPrincipal, because in the (probably common) case when this
-  // value was one of the ones that in fact did not change this will be our
-  // fast path to equality
-  return (mURI == aOther.mURI ||
-          (NS_SUCCEEDED(mURI->Equals(aOther.mURI, &eq)) && eq)) &&
-         (mOriginPrincipal == aOther.mOriginPrincipal ||
-          self.mOriginPrincipal.get()->Equals(other.mOriginPrincipal.get())) &&
-         mLocalURLFlag == aOther.mLocalURLFlag;
-}
-
-bool
 css::URLValueData::DefinitelyEqualURIs(const URLValueData& aOther) const
 {
   return mBaseURI == aOther.mBaseURI &&
          (mString == aOther.mString ||
           NS_strcmp(nsCSSValue::GetBufferValue(mString),
                     nsCSSValue::GetBufferValue(aOther.mString)) == 0);
 }
 
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -107,26 +107,16 @@ struct URLValueData
   URLValueData(already_AddRefed<PtrHolder<nsIURI>> aURI,
                nsStringBuffer* aString,
                already_AddRefed<PtrHolder<nsIURI>> aBaseURI,
                already_AddRefed<PtrHolder<nsIURI>> aReferrer,
                already_AddRefed<PtrHolder<nsIPrincipal>> aOriginPrincipal);
 
   bool operator==(const URLValueData& aOther) const;
 
-  // URIEquals only compares URIs and principals (unlike operator==, which
-  // also compares the original strings).  URIEquals also assumes that the
-  // mURI member of both URL objects is non-null.  Do NOT call this method
-  // unless you're sure this is the case.
-  bool URIEquals(const URLValueData& aOther) const;
-
-  // Pretty much like URIEquals, but allows comparing unresolved URIs (returning
-  // false in that case).
-  bool MaybeUnresolvedURIEquals(const URLValueData& aOther) const;
-
   // Returns true iff we know for sure, by comparing the mBaseURI pointer,
   // the specified url() value mString, and the mLocalURLFlag, that these
   // two URLValueData objects represent the same computed url() value.
   //
   // Doesn't look at mReferrer or mOriginPrincipal.
   //
   // Safe to call from any thread.
   bool DefinitelyEqualURIs(const URLValueData& aOther) const;