зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1441932 P4 Treat same-value assignments to the LoadInfo reserved and initial ClientInfo values as no-op changes. r=mayhemer
This commit is contained in:
Родитель
85490e45e8
Коммит
ac7ea6f3f6
|
@ -60,6 +60,12 @@ ClientInfo::~ClientInfo()
|
|||
{
|
||||
}
|
||||
|
||||
bool
|
||||
ClientInfo::operator==(const ClientInfo& aRight) const
|
||||
{
|
||||
return *mData == *aRight.mData;
|
||||
}
|
||||
|
||||
const nsID&
|
||||
ClientInfo::Id() const
|
||||
{
|
||||
|
|
|
@ -47,6 +47,9 @@ public:
|
|||
|
||||
~ClientInfo();
|
||||
|
||||
bool
|
||||
operator==(const ClientInfo& aRight) const;
|
||||
|
||||
// Get the unique identifier chosen at the time of the global's creation.
|
||||
const nsID&
|
||||
Id() const;
|
||||
|
|
|
@ -1317,6 +1317,11 @@ void
|
|||
LoadInfo::SetReservedClientInfo(const ClientInfo& aClientInfo)
|
||||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(mInitialClientInfo.isNothing());
|
||||
// Treat assignments of the same value as a no-op. The emplace below
|
||||
// will normally assert when overwriting an existing value.
|
||||
if (mReservedClientInfo.isSome() && mReservedClientInfo.ref() == aClientInfo) {
|
||||
return;
|
||||
}
|
||||
mReservedClientInfo.emplace(aClientInfo);
|
||||
}
|
||||
|
||||
|
@ -1331,6 +1336,11 @@ LoadInfo::SetInitialClientInfo(const ClientInfo& aClientInfo)
|
|||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mReservedClientSource);
|
||||
MOZ_DIAGNOSTIC_ASSERT(mReservedClientInfo.isNothing());
|
||||
// Treat assignments of the same value as a no-op. The emplace below
|
||||
// will normally assert when overwriting an existing value.
|
||||
if (mInitialClientInfo.isSome() && mInitialClientInfo.ref() == aClientInfo) {
|
||||
return;
|
||||
}
|
||||
mInitialClientInfo.emplace(aClientInfo);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче