mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 16:47:29 +09:00
Bug 1217436 - Make nsIdentifierMapEntry::mIdContentList an AutoTArray to save an allocation
Tag #1375
This commit is contained in:
parent
9e9b145d6d
commit
c21eecd1b3
1 changed files with 12 additions and 4 deletions
|
|
@ -54,13 +54,18 @@ public:
|
|||
nsStringHashKey(aKey), mNameContentList(nullptr)
|
||||
{
|
||||
}
|
||||
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) :
|
||||
nsStringHashKey(&aOther.GetKey())
|
||||
nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther) :
|
||||
nsStringHashKey(&aOther.GetKey()),
|
||||
mIdContentList(mozilla::Move(aOther.mIdContentList)),
|
||||
mNameContentList(aOther.mNameContentList.forget()),
|
||||
mChangeCallbacks(aOther.mChangeCallbacks.forget()),
|
||||
mImageElement(aOther.mImageElement.forget())
|
||||
{
|
||||
NS_ERROR("Should never be called");
|
||||
}
|
||||
~nsIdentifierMapEntry();
|
||||
|
||||
enum { ALLOW_MEMMOVE = false };
|
||||
|
||||
void AddNameElement(nsINode* aDocument, Element* aElement);
|
||||
void RemoveNameElement(Element* aElement);
|
||||
bool IsEmpty();
|
||||
|
|
@ -156,12 +161,15 @@ public:
|
|||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) = delete;
|
||||
nsIdentifierMapEntry& operator=(const nsIdentifierMapEntry& aOther) = delete;
|
||||
|
||||
void FireChangeCallbacks(Element* aOldElement, Element* aNewElement,
|
||||
bool aImageOnly = false);
|
||||
|
||||
// empty if there are no elements with this ID.
|
||||
// The elements are stored as weak pointers.
|
||||
nsTArray<Element*> mIdContentList;
|
||||
AutoTArray<Element*, 1> mIdContentList;
|
||||
RefPtr<nsBaseContentList> mNameContentList;
|
||||
nsAutoPtr<nsTHashtable<ChangeCallbackEntry> > mChangeCallbacks;
|
||||
RefPtr<Element> mImageElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue