Merge StaticAtom and DynamicAtom

RESOLVED FIXED in Firefox 57

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
There's no reason for them to be separate, and we can use the |kind| field to
distinguish the two kinds when necessary.

This lets us remove the duplication of ScriptableToString(), ToUTF8String(),
and ScriptableEquals().

It also lets us use |Atom*| pointers instead of |nsIAtom*| pointers in various
places within nsAtomTable.cpp, which de-virtualizes various calls and removes
the need for some static_casts.
(Assignee)

Comment 1

a year ago
Created attachment 8900078 [details] [diff] [review]
Merge StaticAtom and DynamicAtom
Attachment #8900078 - Flags: review?(nfroyd)
Comment on attachment 8900078 [details] [diff] [review]
Merge StaticAtom and DynamicAtom

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

Thanks!

::: xpcom/ds/nsAtomTable.cpp
@@ +794,5 @@
>      retVal = he->mAtom;
>    } else {
> +    RefPtr<Atom> atom = Atom::CreateDynamic(aUTF16String, hash);
> +    he->mAtom = atom;
> +    retVal = atom;

Nit: retVal = atom.forget() to avoid unnecessary refcounting.
Attachment #8900078 - Flags: review?(nfroyd) → review+
(Assignee)

Updated

a year ago
Blocks: 1392883
https://hg.mozilla.org/mozilla-central/rev/c9164c497b32
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.