Bug 1382964 - Part 2: Assert we're on the main thread in nsCSSValueTokenStream::operator==. r=xidorn
This helps the heap write analysis believe that the nsCSSValue comparison
that nsStyleUIReset::CalcDifference does (for mSpecifiedWindowTransform,
which won't have nsCSSValueTokenStream values in it) is safe.
MozReview-Commit-ID: 4JvPC735D7i
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -1750,16 +1750,19 @@ struct nsCSSValueTokenStream final {
private:
// Private destructor, to discourage deletion outside of Release():
~nsCSSValueTokenStream();
public:
bool operator==(const nsCSSValueTokenStream& aOther) const
{
+ // This is not safe to call OMT, due to the URI/Principal Equals calls.
+ MOZ_ASSERT(NS_IsMainThread());
+
bool eq;
return mPropertyID == aOther.mPropertyID &&
mShorthandPropertyID == aOther.mShorthandPropertyID &&
mTokenStream.Equals(aOther.mTokenStream) &&
mLevel == aOther.mLevel &&
(mBaseURI == aOther.mBaseURI ||
(mBaseURI && aOther.mBaseURI &&
NS_SUCCEEDED(mBaseURI->Equals(aOther.mBaseURI, &eq)) &&