Closed Bug 1620273 Opened 1 year ago Closed 1 year ago

Add SafeRefPtr as a safer variant of a RefPtr

Categories

(Core :: Storage: IndexedDB, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(1 file)

Add a safe variant of a RefPtr, which prohibits some unsafe or
unperformant misuses, in particular:

  • It is not implicitly convertible from a raw pointer. Unsafe acquisitions
    from a raw pointer must be made using the verbose
    AcquireStrongRefFromRawPtr.
  • It does not implicitly decay to a raw pointer. get() must be called
    explicitly.
  • It is not copyable, but must be explicitly copied using clone().
  • Temporaries cannot be dereferenced using operator* or operator->.
Attachment #9131144 - Attachment description: Bug 1620273 - Add SafeRefPtr. r=#dom-workers-and-storage,asuth → Bug 1620273 - Add SafeRefPtr. r=#dom-workers-and-storage
Priority: -- → P2
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d69cf5fcb571
Add SafeRefPtr. r=asuth,dom-workers-and-storage-reviewers
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2bcd8d19b32c
Add SafeRefPtr. r=asuth,dom-workers-and-storage-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Blocks: 1698871
You need to log in before you can comment on or make changes to this bug.