Closed Bug 1606187 Opened 5 years ago Closed 5 years ago

Remove usage of nsAutoPtr in nsClassHashtable

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: erahm, Assigned: erahm)

References

Details

Attachments

(3 files)

After bug 1241518, nsClassHashtable will be the last remaining usage of nsAutoPtr in xpcom/. Ideally we'll convert it over to using UniquePtr.

There are a couple of issues beyond just conversion:

  1. nsBaseHashtable expects implicit conversion from UserDataType to DataType which UniquePtr intentionally does not support. For example the Iterator class expects this.
  2. nsBaseHashtable expects implicit assignment from UserDataType to DataType which UniquePtr intentionally does not support. For example nsBaseHashtable::Put currently uses this.
  3. nsBaseHashtable::Remove has an optional out param that hands out a moved DataType, all callers that use that need to be updated to use UniquePtr instead for the out param
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Pushed by erahm@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/910c51f0c374 Part 1: Add a DataType conversion helper to nsBaseHashtable r=froydnj,KrisWright https://hg.mozilla.org/integration/autoland/rev/e5a8dac17bba Part 2a: Switch nsClassHashtable over to UniquePtr r=KrisWright,froydnj https://hg.mozilla.org/integration/autoland/rev/416ad9bef391 Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Blocks: 1610067
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: