Closed Bug 1172761 Opened 6 years ago Closed 6 years ago

Remove two uses of PL_DHashTableEnumerate() from XPCOM

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(2 files, 2 obsolete files)

Because PLDHashTable::Iterator is much nicer than PL_DHashTableEnumerate().
BTW, is the raw |nsPropertyElement*| kosher or should it be
|nsRefPtr<nsPropertyElement>|?
Attachment #8617064 - Flags: review?(nfroyd)
Attachment #8617062 - Attachment is obsolete: true
Attachment #8617062 - Flags: review?(nfroyd)
Attachment #8617064 - Attachment is obsolete: true
Attachment #8617064 - Flags: review?(nfroyd)
Attachment #8617154 - Flags: review?(nfroyd) → review+
Comment on attachment 8617157 [details] [diff] [review]
(part 2) - Remove PL_DHashTableEnumerator use from nsPersistentProperties

Review of attachment 8617157 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/ds/nsPersistentProperties.cpp
@@ +577,5 @@
> +    auto entry = static_cast<PropertyTableEntry*>(iter.NextEntry());
> +
> +    nsPropertyElement* element =
> +      new nsPropertyElement(nsDependentCString(entry->mKey),
> +                            nsDependentString(entry->mValue));

Making this nsRefPtr<nsPropertyElement> would be good so that in the unlikely event that AppendObject fails, the nsPropertyElement doesn't leak.
Attachment #8617157 - Flags: review?(nfroyd) → review+
You need to log in before you can comment on or make changes to this bug.