Closed Bug 1445892 Opened 7 years ago Closed 7 years ago

Remove nsGkAtoms::Home atom

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

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

References

Details

Attachments

(2 files)

nsGkAtoms::Home and DirectoryAtoms::Home are duplicate static atoms. Of the two, the former seems easier remove, simply by replacing its two uses with appropriate NS_GetStaticAtom() calls. Those calls should be rare, because they only occur when pressing the "Home" key on Windows or Linux. MozReview-Commit-ID: H6PZFNPp6nl
Attachment #8959079 - Flags: review?(nfroyd)
Comment on attachment 8959079 [details] [diff] [review] Remove nsGkAtoms::Home atom Review of attachment 8959079 [details] [diff] [review]: ----------------------------------------------------------------- Why not move this into some common list like nsGkAtoms? I mean, if we're going to have this central list in XPCOM, we might as well use the central list, no?
Attachment #8959079 - Flags: review?(nfroyd)
> Why not move this into some common list like nsGkAtoms? I mean, if we're > going to have this central list in XPCOM, we might as well use the central > list, no? I originally tried that, but there's the weirdness of the directory "Home" atom being defined like this: https://searchfox.org/mozilla-central/rev/877c99c523a054419ec964d4dfb3f0cadac9d497/xpcom/io/nsDirectoryServiceAtomList.h#14 Its name is "sOS_HomeDirectory" and its value is NS_OS_HOME_DIR. All the other directories are defined via constants, I thought it would be weird to have this one directory handled differently. Especially at usage points like this: https://searchfox.org/mozilla-central/rev/877c99c523a054419ec964d4dfb3f0cadac9d497/xpcom/io/nsDirectoryService.cpp#601 It seems odd to have nsGkAtoms::Home in among that code. If you still feel strongly about it, I can do it that way.
froydnj: I put up a patch that goes in the other direction. I like the first patch better, but I'm happy to defer to your preference.
Comment on attachment 8960809 [details] Bug 1445892 - Remove nsDirectoryService::sOS_HomeDirectory atom. https://reviewboard.mozilla.org/r/229540/#review235650 Thanks.
Attachment #8960809 - Flags: review?(nfroyd) → review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: