Bug 1297963 - Part 4: Remove unused URLValueData comparison functions. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Sat, 03 Sep 2016 00:22:48 +1000
changeset 312444 2fd65026fd36ca156b7179e448bf752fbfd7d5f4
parent 312443 4de2d08774a1ca1fb2b3bd00124acf93a970c3f0
child 312476 57fc4d13d23fb1a473882826ccad08811cd03a4a
child 312482 22e2d63ab8723e932899b1ba1be4403850876133
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1297963
milestone51.0a1
Bug 1297963 - Part 4: Remove unused URLValueData comparison functions. r=emilio MozReview-Commit-ID: 8BDaCXq1O5A
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;