Closed
Bug 278262
Opened 20 years ago
Closed 20 years ago
JAR URIs should resolve relative URIs in the base section
Categories
(Core :: Networking: File, defect)
Core
Networking: File
Tracking
()
RESOLVED
FIXED
mozilla1.8beta1
People
(Reporter: benjamin, Assigned: benjamin)
References
()
Details
Attachments
(2 files, 2 obsolete files)
9.64 KB,
patch
|
Biesinger
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
1.53 KB,
patch
|
sayrer
:
review+
|
Details | Diff | Splinter Review |
When dealing with bug 246209 and my semi-annual chrome registry whacking, I found that JAR URIs cannot contain a relative path component in the "first" part of the URI: i.e. jar:../relative/path.jar!/path/inside This isn't that hard to fix, and it makes life a lot less hectic for the chrome registry. Patch forthcoming.
Assignee | ||
Comment 1•20 years ago
|
||
Attachment #171170 -
Flags: superreview?(darin)
Attachment #171170 -
Flags: review?(cbiesinger)
Comment 2•20 years ago
|
||
Comment on attachment 171170 [details] [diff] [review] semi-relative JAR URIs, rev. 1 sharing the string parsing code with nsJARURI::SetSpec instead of duplicating it would be nice...
Assignee | ||
Comment 3•20 years ago
|
||
Comment on attachment 171170 [details] [diff] [review] semi-relative JAR URIs, rev. 1 biesi pointed out that nsJARURI::SetSpec has very similar logic, and to avoid codesize I should try to factor them together. nsJARURI::SetSpecWithBase forthcoming.
Attachment #171170 -
Attachment is obsolete: true
Attachment #171170 -
Flags: superreview?(darin)
Attachment #171170 -
Flags: review?(cbiesinger)
Assignee | ||
Comment 4•20 years ago
|
||
This patch isn't quite as small as I'd like, but it duplicates less code than the last one, and it reduces string<->ns*URI round-trips several times during the parsing of a relative URI reference.
Attachment #171232 -
Flags: review?(cbiesinger)
Comment 5•20 years ago
|
||
sorry for the delay, I didn't have any time for reviewing the patch this weekend, I'll try to get to it tuesday or wednesday
Comment 6•20 years ago
|
||
Comment on attachment 171232 [details] [diff] [review] semi-relative JAR URIs, rev. 2 modules/libjar/nsJARURI.cpp +nsJARURI::SetSpecWithBase - nsCOMPtr<nsIIOService> ioServ(do_GetIOService(&rv)); + nsCOMPtr<nsIIOService> ioServ (do_GetIOService()); hm, why remove the specific error code in favor of a generic one? + aBaseURL->QueryInterface(NS_GET_IID(nsJARURI), getter_AddRefs(otherJAR)); + if (!otherJAR) return NS_NOINTERFACE; NS_ERROR_INVALID_ARG maybe? doesn't matter much. + mJAREntry = do_QueryInterface(entry); + if (!mJAREntry) + return NS_NOINTERFACE; personally I'd only use an assertion here. + while (begin != end && *begin != ':') + ++begin; FindCharInReadable? guess for 4 chars that won't matter :-) + delim_end (end); hm, why do you need this var? nsJARURI::Equals(nsIURI *other, PRBool *result) { + nsresult rv; can you move it back down, to where it is first used?
Attachment #171232 -
Flags: review?(cbiesinger) → review+
Assignee | ||
Comment 7•20 years ago
|
||
Comment on attachment 171232 [details] [diff] [review] semi-relative JAR URIs, rev. 2 I need delim_end because RFindInReadable modifies it's "end" iterator, and I need the real "end" iterator farther down for a dependent substring.
Attachment #171232 -
Flags: superreview?(darin)
Comment 8•20 years ago
|
||
ah, sorry. I was thinking it changed the start iterator.
Comment 9•20 years ago
|
||
Comment on attachment 171232 [details] [diff] [review] semi-relative JAR URIs, rev. 2 >Index: modules/libjar/nsJARURI.cpp >+nsresult >+nsJARURI::SetSpecWithBase(const nsACString &aSpec, nsIURI* aBaseURL) > { > nsresult rv; >+ >+ nsCOMPtr<nsIIOService> ioServ (do_GetIOService()); nit: remove space between "ioServ" and "(" >+ aBaseURL->QueryInterface(NS_GET_IID(nsJARURI), getter_AddRefs(otherJAR)); >+ if (!otherJAR) return NS_NOINTERFACE; nit: use NS_ENSURE_TRUE here? warnings are good :) >+ nsCOMPtr<nsIStandardURL> entry >+ (do_CreateInstance(NS_STANDARDURL_CONTRACTID)); style nit: it all fits on one line, but mainly don't start line with "(" nsCOMPtr<nsIStandardURL> entry(do_CreateInstance(NS_STANDARDURL_CONTRACTID)); >+ if (!scheme.EqualsLiteral("jar")) > return NS_ERROR_MALFORMED_URI; nit: NS_ENSURE_TRUE? or can this even be a NS_ASSERTION?
Attachment #171232 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Updated•20 years ago
|
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta
Updated•17 years ago
|
Attachment #257285 -
Flags: review?(sayrer)
Comment 11•17 years ago
|
||
Unit test v2 * Better than unit test v1.
Attachment #257285 -
Attachment is obsolete: true
Attachment #257292 -
Flags: review?(sayrer)
Updated•17 years ago
|
Attachment #257292 -
Flags: review?(sayrer) → review+
Updated•17 years ago
|
Whiteboard: [checkin needed]
Updated•17 years ago
|
Flags: in-testsuite?
Comment 12•17 years ago
|
||
Checking in test_bug278262.js; /cvsroot/mozilla/modules/libjar/test/unit/test_bug278262.js,v <-- test_bug278262.js initial revision: 1.1 done
Flags: in-testsuite? → in-testsuite+
Whiteboard: [checkin needed]
You need to log in
before you can comment on or make changes to this bug.
Description
•