Closed Bug 1435766 Opened 6 years ago Closed 2 years ago

make the directory service use GetSpecialSystemDirectory for mac-specific atoms

Categories

(Core :: XPCOM, enhancement, P3)

All
macOS
enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox60 --- wontfix
firefox101 --- fixed

People

(Reporter: froydnj, Assigned: nika)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

This change helps address #4 and #5 in bug 1435745.
The enum values in SystemDirectories are all explicitly assigned
values.  While explicit is normally better than implicit, having
explicit values for everything requires renumbering if you wanted to
insert values somewhere in the middle of the list: a new OS_* constant,
or a Mac_LocalDesktopDirectory.  You could insert them at the end,
always, but perhaps you'd like to keep related things close together for
aesthetics.  Removing values also requires renumbering things, partially
for aesthetics, but partially to not run out of numbers.

To make life for future hackers easier, let's renumber everything using
explicit values for the start of the "sections", and implicit numbering
for everything else.
Attachment #8956095 - Flags: review?(nika)
This change makes the nsDirectoryService implementation for Mac more
consistent with the Windows and generic Unix implementations.  The
change also opens up the possibility of using GetSpecialSystemDirectory
on Mac for Mac-specific things elsewhere in the codebase and not having
things fall over.  We need to add a bunch of SystemDirectories constants
to accommodate all the atoms required by the directory service.
Attachment #8956096 - Flags: review?(spohl.mozilla.bugs)
Comment on attachment 8956095 [details] [diff] [review]
part 1 - rely on implicit enum numbering for SystemDirectories

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

LGTM :-)
Attachment #8956095 - Flags: review?(nika) → review+
Comment on attachment 8956096 [details] [diff] [review]
part 2 - reimplement nsDirectoryService Mac getters in terms of GetSpecialSystemDirectory

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

r+ with the one issue fixed. Thanks!

::: xpcom/io/nsDirectoryService.cpp
@@ +484,2 @@
>    } else if (inAtom == nsDirectoryService::sLocalInternetPlugInDirectory) {
> +    rv = GetSpecialSystemDirectory(Mac_LocalDocumentsDirectory, getter_AddRefs(localFile));

s/Mac_LocalDocumentsDirectory/Mac_LocalInternetPluginDirectory/
Attachment #8956096 - Flags: review?(spohl.mozilla.bugs) → review+

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:froydnj, could you have a look please?

Flags: needinfo?(nfroyd)

Setting n-i for myself to come back and see if we can land this.

Flags: needinfo?(spohl.mozilla.bugs)

This has changed substantially due to the changes made in bug 1449686. :froydnj, how should we proceed here?

Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(nfroyd)
Flags: needinfo?(nfroyd)
Flags: needinfo?(froydnj+bz)

The bug assignee didn't login in Bugzilla in the last 7 months.
:nika, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: froydnj+bz → nobody
Flags: needinfo?(nika)

I think there's a new patch we could write based on these patches which would help fix the original issues, but the existing patches won't apply anymore as noted due to the changes in 1449686. It looks simple enough to just whip up, so I'll post an updated patch shortly.

Assignee: nobody → nika
Flags: needinfo?(nika)

This makes the getters more consistent with getters on other platforms,
and theoretically provides a faster way of getting these directories
from C++ code in the future.

Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fba6063b1a37
Reimplement nsDirectoryService Mac getters in terms of GetSpecialSystemDirectory, r=xpcom-reviewers,mccr8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: