Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 5cefea8

Browse files
committed
Bug 749930 - Replace uses of nsILocalFile with nsIFile (compiled code only); r=bsmedberg
1 parent fe6fbbf commit 5cefea8

290 files changed

Lines changed: 1141 additions & 1331 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

b2g/app/nsBrowserApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <stdarg.h>
1919

2020
#include "nsCOMPtr.h"
21-
#include "nsILocalFile.h"
21+
#include "nsIFile.h"
2222
#include "nsStringGlue.h"
2323

2424
#ifdef XP_WIN
@@ -102,7 +102,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
102102

103103
static int do_main(int argc, char* argv[])
104104
{
105-
nsCOMPtr<nsILocalFile> appini;
105+
nsCOMPtr<nsIFile> appini;
106106
nsresult rv;
107107

108108
// Allow firefox.exe to launch XULRunner apps via -app <application.ini>

browser/app/nsBrowserApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <stdarg.h>
2323

2424
#include "nsCOMPtr.h"
25-
#include "nsILocalFile.h"
25+
#include "nsIFile.h"
2626
#include "nsStringGlue.h"
2727

2828
#ifdef XP_WIN
@@ -106,7 +106,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
106106

107107
static int do_main(int argc, char* argv[])
108108
{
109-
nsCOMPtr<nsILocalFile> appini;
109+
nsCOMPtr<nsIFile> appini;
110110
nsresult rv;
111111

112112
// Allow firefox.exe to launch XULRunner apps via -app <application.ini>

browser/components/dirprovider/DirectoryProvider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
5454
nsCString path;
5555
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
5656
if (NS_SUCCEEDED(rv)) {
57-
NS_NewNativeLocalFile(path, true, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
57+
NS_NewNativeLocalFile(path, true, getter_AddRefs(file));
5858
}
5959
}
6060
}

browser/components/shell/public/nsIShellService.idl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "nsISupports.idl"
77

88
interface nsIDOMElement;
9-
interface nsILocalFile;
9+
interface nsIFile;
1010

1111
[scriptable, uuid(bb477da4-dddf-4106-a562-f06c85c7f9a8)]
1212
interface nsIShellService : nsISupports
@@ -99,10 +99,10 @@ interface nsIShellService : nsISupports
9999
* @param uri
100100
* The uri to be loaded by the application
101101
*/
102-
void openApplicationWithURI(in nsILocalFile aApplication, in ACString aURI);
102+
void openApplicationWithURI(in nsIFile aApplication, in ACString aURI);
103103

104104
/**
105105
* The default system handler for web feeds
106106
*/
107-
readonly attribute nsILocalFile defaultFeedReader;
107+
readonly attribute nsIFile defaultFeedReader;
108108
};

browser/components/shell/src/nsGNOMEShellService.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "nsGNOMEShellService.h"
1010
#include "nsShellService.h"
1111
#include "nsIServiceManager.h"
12-
#include "nsILocalFile.h"
12+
#include "nsIFile.h"
1313
#include "nsIProperties.h"
1414
#include "nsDirectoryServiceDefs.h"
1515
#include "nsIPrefService.h"
@@ -107,8 +107,8 @@ nsGNOMEShellService::Init()
107107
(do_GetService("@mozilla.org/file/directory_service;1"));
108108
NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);
109109

110-
nsCOMPtr<nsILocalFile> appPath;
111-
rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile),
110+
nsCOMPtr<nsIFile> appPath;
111+
rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
112112
getter_AddRefs(appPath));
113113
NS_ENSURE_SUCCESS(rv, rv);
114114

@@ -641,7 +641,7 @@ nsGNOMEShellService::OpenApplication(PRInt32 aApplication)
641641
}
642642

643643
NS_IMETHODIMP
644-
nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
644+
nsGNOMEShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI)
645645
{
646646
nsresult rv;
647647
nsCOMPtr<nsIProcess> process =
@@ -659,7 +659,7 @@ nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const ns
659659
}
660660

661661
NS_IMETHODIMP
662-
nsGNOMEShellService::GetDefaultFeedReader(nsILocalFile** _retval)
662+
nsGNOMEShellService::GetDefaultFeedReader(nsIFile** _retval)
663663
{
664664
return NS_ERROR_NOT_IMPLEMENTED;
665665
}

browser/components/shell/src/nsMacShellService.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement,
167167
NS_ENSURE_SUCCESS(rv, rv);
168168

169169
// Get the current user's "Pictures" folder (That's ~/Pictures):
170-
fileLocator->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsILocalFile),
170+
fileLocator->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsIFile),
171171
getter_AddRefs(mBackgroundFile));
172172
if (!mBackgroundFile)
173173
return NS_ERROR_OUT_OF_MEMORY;
@@ -329,7 +329,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
329329
break;
330330
case nsIMacShellService::APPLICATION_NETWORK:
331331
{
332-
nsCOMPtr<nsILocalFile> lf;
332+
nsCOMPtr<nsIFile> lf;
333333
rv = NS_NewNativeLocalFile(NETWORK_PREFPANE, true, getter_AddRefs(lf));
334334
NS_ENSURE_SUCCESS(rv, rv);
335335
bool exists;
@@ -341,7 +341,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
341341
break;
342342
case nsIMacShellService::APPLICATION_DESKTOP:
343343
{
344-
nsCOMPtr<nsILocalFile> lf;
344+
nsCOMPtr<nsIFile> lf;
345345
rv = NS_NewNativeLocalFile(DESKTOP_PREFPANE, true, getter_AddRefs(lf));
346346
NS_ENSURE_SUCCESS(rv, rv);
347347
bool exists;
@@ -382,7 +382,7 @@ nsMacShellService::SetDesktopBackgroundColor(PRUint32 aColor)
382382
}
383383

384384
NS_IMETHODIMP
385-
nsMacShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
385+
nsMacShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI)
386386
{
387387
nsCOMPtr<nsILocalFileMac> lfm(do_QueryInterface(aApplication));
388388
CFURLRef appURL;
@@ -419,7 +419,7 @@ nsMacShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsAC
419419
}
420420

421421
NS_IMETHODIMP
422-
nsMacShellService::GetDefaultFeedReader(nsILocalFile** _retval)
422+
nsMacShellService::GetDefaultFeedReader(nsIFile** _retval)
423423
{
424424
nsresult rv = NS_ERROR_FAILURE;
425425
*_retval = nsnull;

browser/components/shell/src/nsMacShellService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "nsIMacShellService.h"
1010
#include "nsIWebProgressListener.h"
11-
#include "nsILocalFile.h"
11+
#include "nsIFile.h"
1212
#include "nsCOMPtr.h"
1313

1414
class nsMacShellService : public nsIMacShellService,
@@ -26,7 +26,7 @@ class nsMacShellService : public nsIMacShellService,
2626
protected:
2727

2828
private:
29-
nsCOMPtr<nsILocalFile> mBackgroundFile;
29+
nsCOMPtr<nsIFile> mBackgroundFile;
3030

3131
bool mCheckedThisSession;
3232
};

browser/components/shell/src/nsWindowsShellService.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ GetHelperPath(nsAutoString& aPath)
213213
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
214214
NS_ENSURE_SUCCESS(rv, rv);
215215

216-
nsCOMPtr<nsILocalFile> appHelper;
216+
nsCOMPtr<nsIFile> appHelper;
217217
rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
218-
NS_GET_IID(nsILocalFile),
218+
NS_GET_IID(nsIFile),
219219
getter_AddRefs(appHelper));
220220
NS_ENSURE_SUCCESS(rv, rv);
221221

@@ -1042,7 +1042,7 @@ nsWindowsShellService::LaunchPrefetchClearCommand(nsITimer *aTimer, void*)
10421042
#endif
10431043

10441044
NS_IMETHODIMP
1045-
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
1045+
nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,
10461046
const nsACString& aURI)
10471047
{
10481048
nsresult rv;
@@ -1061,7 +1061,7 @@ nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
10611061
}
10621062

10631063
NS_IMETHODIMP
1064-
nsWindowsShellService::GetDefaultFeedReader(nsILocalFile** _retval)
1064+
nsWindowsShellService::GetDefaultFeedReader(nsIFile** _retval)
10651065
{
10661066
*_retval = nsnull;
10671067

@@ -1090,7 +1090,7 @@ nsWindowsShellService::GetDefaultFeedReader(nsILocalFile** _retval)
10901090
path = Substring(path, 0, path.FindChar(' '));
10911091
}
10921092

1093-
nsCOMPtr<nsILocalFile> defaultReader =
1093+
nsCOMPtr<nsIFile> defaultReader =
10941094
do_CreateInstance("@mozilla.org/file/local;1", &rv);
10951095
NS_ENSURE_SUCCESS(rv, rv);
10961096

chrome/src/nsChromeRegistryChrome.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "nsICommandLine.h"
3434
#include "nsILocaleService.h"
35-
#include "nsILocalFile.h"
35+
#include "nsIFile.h"
3636
#include "nsIObserverService.h"
3737
#include "nsIPrefBranch.h"
3838
#include "nsIPrefService.h"

content/base/src/nsContentAreaDragDrop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ nsContentAreaDragDropDataProvider::SaveURIToFile(nsAString& inSourceURIString,
167167
// that in AddStringsToDataTransfer.
168168
//
169169
// 2. Someone put a kFilePromiseDirectoryMime flavor into the
170-
// transferable with an nsILocalFile for the directory we are to
170+
// transferable with an nsIFile for the directory we are to
171171
// save in. That has to be done by platform-specific code (in
172172
// widget), which gets the destination directory from
173173
// OS-specific drag information.
@@ -218,7 +218,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
218218
dataSize = 0;
219219
aTransferable->GetTransferData(kFilePromiseDirectoryMime,
220220
getter_AddRefs(dirPrimitive), &dataSize);
221-
nsCOMPtr<nsILocalFile> destDirectory = do_QueryInterface(dirPrimitive);
221+
nsCOMPtr<nsIFile> destDirectory = do_QueryInterface(dirPrimitive);
222222
if (!destDirectory)
223223
return NS_ERROR_FAILURE;
224224

@@ -229,7 +229,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
229229
file->Append(targetFilename);
230230

231231
rv = SaveURIToFile(sourceURLString, file);
232-
// send back an nsILocalFile
232+
// send back an nsIFile
233233
if (NS_SUCCEEDED(rv)) {
234234
CallQueryInterface(file, aData);
235235
*aDataLen = sizeof(nsIFile*);

0 commit comments

Comments
 (0)