Closed Bug 156733 Opened 23 years ago Closed 22 years ago

nsDirectoryService needs to rid its reliance on nsSpecialSystemDirectory

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ccarlen, Assigned: ccarlen)

Details

Attachments

(1 file)

nsSpecialSystemDirectory is based on nsFileSpec, which in itself is evil, but is especially a problem for XP_MACOSX builds. In that world, the XP_UNIX version of nsFileSpec is used because it uses '/' delimited POSIX paths which we want. But, the nature of the nsFileSpec is very different between XP_MAC and XP_UNIX. nsSpecialSystemDirectory, under XP_MACOSX, is caught in an odd place in between. What I want to do is eliminate the use of nsSpecialSystemDirectory and then this can be cleaned up properly.
Fixing summary.
Status: NEW → ASSIGNED
Summary: nsDirectoryService needs to rid of reliance on nsSpecialSystemDirectory → nsDirectoryService needs to rid its reliance on nsSpecialSystemDirectory
Attached patch phase #1 patchSplinter Review
This should be done first. It removes all consumers of nsSpecialSystemDirectory (outside xpcom) from the tree and no longer exports the file.
Comment on attachment 97338 [details] [diff] [review] phase #1 patch r=sdagley w/a few comments: 1) Nice to see how many times nsSpecialSystemDirectory.h was gratuitously included :-) 2) whitespace seems off on several files 3) In DataStruct::GetFileSpec() there's a comment that implies aFileName may be NULL but the new code is testing aFileName.IsEmpty() which isn't the same and may not be safe.
Attachment #97338 - Flags: review+
> In DataStruct::GetFileSpec() there's a comment that implies aFileName may be NULL but the new code is testing aFileName.IsEmpty that's because the old "aFileName" was a const char*. Now it's a const nsACString&. The comment could be changed to say "empty" instead of "NULL."
cc'ing Alec for sr=. BTW, phase #1 is to get rid of all consumers of this object and limit its use to the internals of directory service. Once that is done, the next phase is refactoring the code so that it's not nsFileSpec-based but is nsILocalFile-based (either as a class with a GetFile() method or an nsIDirectoryServiceProvider impl which is created and registered by directory service when it is created).
Comment on attachment 97338 [details] [diff] [review] phase #1 patch sr=alecf wow, mail uses way too many temp files!
Attachment #97338 - Flags: superreview+
Minimo landing did this.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: