Bug 1297963 - Part 4: Remove unused URLValueData comparison functions. r=emilio
MozReview-Commit-ID: K1Fg2XW9sd9
--- 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;