commit be57d48739e20a866d522a37ec6499919bda675f parent d762927acf9fb9349b0b86041746049abd11d925 Author: Josh Aas <jaas@kflag.net> Date: Tue, 28 Oct 2025 20:14:20 +0000 Bug 1996951 - use common implementation of nsIFile::InitWithFile on macOS. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D270392 Diffstat:
| M | xpcom/io/nsLocalFileCommon.cpp | | | 2 | +- |
| M | xpcom/io/nsLocalFileUnix.cpp | | | 14 | -------------- |
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/xpcom/io/nsLocalFileCommon.cpp b/xpcom/io/nsLocalFileCommon.cpp @@ -171,7 +171,7 @@ nsresult NS_NewLocalFileWithPersistentDescriptor( return NS_OK; } -#if !defined(MOZ_WIDGET_COCOA) && !defined(XP_WIN) +#if !defined(XP_WIN) NS_IMETHODIMP nsLocalFile::InitWithFile(nsIFile* aFile) { if (NS_WARN_IF(!aFile)) { diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp @@ -2906,20 +2906,6 @@ nsLocalFile::GetBundleDisplayName(nsAString& aOutBundleName) { return NS_OK; } -NS_IMETHODIMP nsLocalFile::InitWithFile(nsIFile* aFile) { - if (NS_WARN_IF(!aFile)) { - return NS_ERROR_INVALID_ARG; - } - - nsAutoCString nativePath; - nsresult rv = aFile->GetNativePath(nativePath); - if (NS_FAILED(rv)) { - return rv; - } - - return InitWithNativePath(nativePath); -} - nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, nsILocalFileMac** aResult) { RefPtr<nsLocalFile> file = new nsLocalFile();