Closed Bug 682360 Opened 13 years ago Closed 12 years ago

Merge nsILocalFile and nsIFile interfaces

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: WeirdAl, Assigned: darktrojan)

References

Details

(Keywords: addon-compat, arch, dev-doc-needed)

Attachments

(1 file)

The nsILocalFile interface is the only one inheriting from nsIFile, and I believe every implementation of nsIFile in the Mozilla code also implements nsILocalFile.  The separation of these two interfaces is probably more painful than it should be.

This should be considered somewhat risky, as anything in the Mozilla code, or in extensions, dealing with file I/O could be affected.  If we do this, we might want to keep the deprecated interface around for a little while so external developers can update their code bases.
Attached patch patchSplinter Review
Assignee: nobody → geoff
Status: NEW → ASSIGNED
Blocks: 739001
Attachment #609045 - Flags: review?(benjamin)
Comment on attachment 609045 [details] [diff] [review]
patch

There is no need to change NS_LOCAL_FILE_CID, please don't. Please add [builtinclass] to nsIFile so that nobody tries to implement it in script. r=me with those changes.
Attachment #609045 - Flags: review?(benjamin) → review+
Would it be practical to add [deprecated] to nsILocalFile, as it is for nsIJSXMLHttpRequest?

http://mxr.mozilla.org/mozilla-central/source/content/base/public/nsIXMLHttpRequest.idl#398
Perhaps later, but there are plenty of uses in the tree which would currently just spam warning noise for something harmless.
Attachment #609045 - Flags: superreview?(gavin.sharp)
Comment on attachment 609045 [details] [diff] [review]
patch

I don't think you need my review for this, Benjamin's is sufficient.
Attachment #609045 - Flags: superreview?(gavin.sharp)
Okay then, landed with those changes
https://hg.mozilla.org/integration/mozilla-inbound/rev/82c7bdff95d4
Flags: in-testsuite-
Flags: in-litmus-
Target Milestone: --- → mozilla14
This change should have very little compat risk for JS addons or recompiled C++ addons, but we should nevertheless note it in the "Firefox 14 for Developers" page and update the interface docs on MDC. Geoff is that something you can do?
Yes, I'll do that when I get time.
https://hg.mozilla.org/mozilla-central/rev/82c7bdff95d4
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 749930
Just saw Geoff's post on dev-platform

> In most cases running 'sed s/nsILocalFile\b/nsIFile/g' on your code will be 
> sufficient, although you might end up with pointless do_QueryInterface calls that
> you should weed out.

If that's the case, can we leave some sort of shim around so that add-on developers don't need to make any changes and binary compatibility is maintained?

We typically find out about the impact of bugs that remove interfaces very late in the cycle, and backing out the change at that point requires a UUID change (which can hurt add-on compatibility even more).
Note that we did not remove the nsILocalFile interface, we merely moved all of its guts into nsIFile. So nsILocalFile *is* the shim, and AFAIK there are no plans to remove it any time soon so that JS extensions will continue to work. C++ extensions may require changes not from this bug but from bug 749930 where we're changing some classes to use nsIFile exclusively. But I don't think that there is any additional shimming that we need to do for extensions.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: