mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Backed out changeset c5e3cdc1f944 (bug 1795568) for causing hybrid bustage on nsAppFileLocationProvider.cpp. CLOSED TREE
This commit is contained in:
parent
d9c2476649
commit
3853193d23
@ -39,8 +39,6 @@ void CopyQuarantineReferrerUrl(const CFStringRef aFilePath,
|
||||
|
||||
CFURLRef GetTemporaryFolderCFURLRef();
|
||||
|
||||
CFURLRef GetProductDirectoryCFURLRef(bool aLocal);
|
||||
|
||||
} // namespace CocoaFileUtils
|
||||
|
||||
#endif
|
||||
|
@ -279,11 +279,4 @@ CFURLRef GetTemporaryFolderCFURLRef() {
|
||||
return tempDir == nil ? NULL : (CFURLRef)[NSURL fileURLWithPath:tempDir isDirectory:YES];
|
||||
}
|
||||
|
||||
CFURLRef GetProductDirectoryCFURLRef(bool aLocal) {
|
||||
NSSearchPathDirectory folderType = aLocal ? NSCachesDirectory : NSLibraryDirectory;
|
||||
NSFileManager* manager = [NSFileManager defaultManager];
|
||||
return static_cast<CFURLRef>([[manager URLsForDirectory:folderType
|
||||
inDomains:NSUserDomainMask] firstObject]);
|
||||
}
|
||||
|
||||
} // namespace CocoaFileUtils
|
||||
|
@ -182,14 +182,19 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
|
||||
nsCOMPtr<nsIFile> localDir;
|
||||
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
FSRef fsRef;
|
||||
OSType folderType =
|
||||
aLocal ? (OSType)kCachedDataFolderType : (OSType)kDomainLibraryFolderType;
|
||||
OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
|
||||
if (err) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_NewLocalFile(u""_ns, true, getter_AddRefs(localDir));
|
||||
if (!localDir) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsILocalFileMac> localDirMac(do_QueryInterface(localDir));
|
||||
|
||||
rv = localDirMac->InitWithCFURL(
|
||||
CocoaFileUtils::GetProductDirectoryCFURLRef(aLocal));
|
||||
rv = localDirMac->InitWithFSRef(&fsRef);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user