diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2019-07-07 20:02:35 +0300 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2019-07-07 20:02:35 +0300 |
commit | e0598b0ae2c748f1b38759d66e7a759aec04a6b9 (patch) | |
tree | b261d3ebf81531e7f4b18a4ea560f014756d6720 | |
parent | 0845614a5eb3f5fafda7f7b82f041d1a8a0ba955 (diff) | |
download | UXP-e0598b0ae2c748f1b38759d66e7a759aec04a6b9.tar UXP-e0598b0ae2c748f1b38759d66e7a759aec04a6b9.tar.gz UXP-e0598b0ae2c748f1b38759d66e7a759aec04a6b9.tar.lz UXP-e0598b0ae2c748f1b38759d66e7a759aec04a6b9.tar.xz UXP-e0598b0ae2c748f1b38759d66e7a759aec04a6b9.zip |
Avoid multiple hashtable lookups in DisplayItemData destructor
UXP has:
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas >Contains(this));
sAliveDisplayItemDatas->RemoveEntry(this);
and this gets hit during frame destruction.
Combine these checks.
-rw-r--r-- | layout/base/FrameLayerBuilder.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index e87d9dc09..934d108e0 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -272,8 +272,13 @@ FrameLayerBuilder::DisplayItemData::~DisplayItemData() array->RemoveElement(this); } - MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas->Contains(this)); - sAliveDisplayItemDatas->RemoveEntry(this); + MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas); + nsPtrHashKey<mozilla::FrameLayerBuilder::DisplayItemData>* entry + = sAliveDisplayItemDatas->GetEntry(this); + MOZ_RELEASE_ASSERT(entry); + + sAliveDisplayItemDatas->RemoveEntry(entry); + if (sAliveDisplayItemDatas->Count() == 0) { delete sAliveDisplayItemDatas; sAliveDisplayItemDatas = nullptr; |