Closed Bug 166792 Opened 22 years ago Closed 22 years ago

move nsIIOService::GetURLSpecFromFile, etc. to nsIFileProtocolHandler

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.2beta

People

(Reporter: darin.moz, Assigned: darin.moz)

References

Details

(Keywords: arch, topembed)

Attachments

(1 file, 1 obsolete file)

move nsIIOService::GetURLSpecFromFile, etc. to nsIFileProtocolHandler.  this
just makes sense.
Status: NEW → ASSIGNED
Keywords: mozilla1.2, topembed
Priority: -- → P3
Target Milestone: --- → mozilla1.2beta
Blocks: 157131
Attached patch v1 patch (obsolete) — Splinter Review
so, i ended up refactoring some necko internals now that nsIOService doesn't
own these methods.  also, i'm eliminating the whole URL parser category thingy
that wasn't used for anything but looking up the correct nsIURLParser to use
for file:// URLs.  well, that can be easily hard coded.  i'm also renaming
nsIOServiceXXX.cpp as nsURLHelperXXX.cpp since the former name doesn't make any
sense now.
Attached patch v1.1 patchSplinter Review
realized that i forgot to remove the cached URL parser list from the IO
service.  not used, not needed :)
Attachment #97921 - Attachment is obsolete: true
Blocks: 166735
darin: can you use nsIFile::GetPath() instead?
+    // construct URL spec from native file path
+    rv = aFile->GetNativePath(ePath);

If not, then you need IsDBCSLeadByte() stuff in SwapSlashColon() as
http://lxr.mozilla.org/seamonkey/source/netwerk/base/src/nsIOServiceWin.cpp#62
roy: the code for nsURLHelperWin.cpp is an almost identical copy of the code
from nsIOServiceWin.cpp, so i don't see why it should be changed.  if there's a
bug in the impl of nsIOServiceWin.cpp, then let's make that another bug report.
Comment on attachment 97922 [details] [diff] [review]
v1.1 patch

r=dougt


(how long until we freeze nsIFileProtocalHandler?)
Attachment #97922 - Flags: review+
let's not talk about freezing nsIFileProtocolHandler ;-)
Keywords: arch, nsbeta1
Severity: normal → major
Priority: P3 → P2
I'm hoping to get to this today..
Comment on attachment 97922 [details] [diff] [review]
v1.1 patch

+LOCAL_INCLUDES =			 \
+	 -I$(topsrcdir)/netwerk/base/src \
+	 $(NULL)
+

my understanding is that we normally use relative directories here, i.e.
-I$(srcdir)/../base/src

so that the module doesn't need to know where it is in the tree.

other than that, this looks fine. 
sr=alecf
Attachment #97922 - Flags: superreview+
thx for the tip alec!
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
fixed-on-trunk
The addBookmark.js change looks like it's only partly complete.
thx dbaron... i corrected that mistake.
oops, you forgot one in MsgComposeCommands.js:

which broke attaching files in the compose window.

it's fixed now:

Index: compose/resources/content/MsgComposeCommands.js
===================================================================
RCS file: /cvsroot/mozilla/mailnews/compose/resources/content/MsgComposeCommands
.js,v
retrieving revision 1.290
diff -r1.290 MsgComposeCommands.js
2229c2229,2230
<     var currentAttachment = ioService.getURLSpecFromFile(currentFile);
---
>     var fileHandler = ioService.getProtocolHandler("file").QueryInterface(Comp
onents.interfaces.nsIFileProtocolHandler);
>     var currentAttachment = fileHandler.getURLSpecFromFile(currentFile);
Darin: anything I can do to verify, besides run a URL functional test?
Keywords: verifyme
benc: should be sufficient to verify this API change using LXR.
checked both files w/ lxr and the function has been moved.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: