Closed
Bug 609785
Opened 14 years ago
Closed 14 years ago
Startupcache urls should not depend on install-location
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: taras.mozilla, Assigned: taras.mozilla)
References
Details
Attachments
(2 files, 8 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
bug 588335 dealt with namespacing startup cache urls. Unfortunately that isn't enough for omnijaring startup cache in bug 562406.
For that to work one needs to use an install-location-independent location scheme. Currently startup cache urls look like:
jsloader:jar:file:///home/taras/firefox/omni.jar!/components/nsPlacesDBFlush.js
jsloader:resource:///modules/NetworkPrioritizer.jsm
jsloader:file:///home/taras/.mozilla/firefox/xxx.default/extensions/inspector@mozilla.org/components/inspector-cmdline.js
This has two problems:
a) startupcache location is not portable, so this entry can't be moved into omnijar
b) This isn't a very good zipfile location, so this can't be easily repacked into omnijar
In my prototype for bug 562406 I worked around this by hardcoding a couple of url types in order to resolve them into saner startup cache locations.
Unfortunately this approach requires hardcoding every possible url type, which obviously sucks.
Can anyone suggest a more general scheme that detect firefox-internal urls(ie skip addons) and rewrite them into portable ones?
Assignee | ||
Comment 1•14 years ago
|
||
The best option in my mind is to just ship with this hack until someone comes up with a better approach.
Comment 2•14 years ago
|
||
Try this. The omnijar file checking is all wrong but I know the caller doesn't clone it. I'll get that right if this patch works for you.
Attachment #488387 -
Flags: feedback?(tglek)
Assignee | ||
Comment 3•14 years ago
|
||
Comment on attachment 488387 [details] [diff] [review]
Detect omnijar jars in js component loading
Tried it, looks like it will work.
Attachment #488387 -
Flags: feedback?(tglek) → feedback+
Assignee | ||
Comment 4•14 years ago
|
||
Assignee: nobody → tglek
Attachment #488367 -
Attachment is obsolete: true
Attachment #488514 -
Flags: review?(benjamin)
Comment 5•14 years ago
|
||
Attachment #488387 -
Attachment is obsolete: true
Attachment #488520 -
Flags: review?(benjamin)
Assignee | ||
Comment 6•14 years ago
|
||
Use resource://gre instead of resource:///
Attachment #488520 -
Attachment is obsolete: true
Attachment #489635 -
Flags: review?(benjamin)
Attachment #488520 -
Flags: review?(benjamin)
Assignee | ||
Comment 7•14 years ago
|
||
Attachment #488514 -
Attachment is obsolete: true
Attachment #489641 -
Flags: review?(benjamin)
Attachment #488514 -
Flags: review?(benjamin)
Comment 8•14 years ago
|
||
Are these two patches alternates, or mean to go together?
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #8)
> Are these two patches alternates, or mean to go together?
together
Updated•14 years ago
|
Attachment #489635 -
Flags: review?(benjamin) → review+
Comment 10•14 years ago
|
||
Comment on attachment 489641 [details] [diff] [review]
convert uris into zip paths skipping scheme and redundant '/'s
I could probably understand what this patch was doing if I thought hard enough, but that's just an indication that SimplifyURL needs a serious doccomment.
Attachment #489641 -
Flags: review?(benjamin) → review-
Assignee | ||
Comment 11•14 years ago
|
||
Attachment #489641 -
Attachment is obsolete: true
Attachment #495162 -
Flags: review?(benjamin)
Comment 12•14 years ago
|
||
Correct version that checks paths instead of pointers.
Attachment #489635 -
Attachment is obsolete: true
Comment 13•14 years ago
|
||
Hrm, I forget that that check may not be entirely safe if the omnijar path is null..
Comment 14•14 years ago
|
||
(In reply to comment #13)
> Hrm, I forget that that check may not be entirely safe if the omnijar path is
> null..
Nevermind, return value catches this situation.
Comment 15•14 years ago
|
||
Comment on attachment 495162 [details] [diff] [review]
commented uri transformation
Why are we doing this transformation for all URLs, instead of just resource: URLs?
Can we constrain our behavior here to the specific case we're trying to solve, so that we don't accidentally end up mixing file: and resource: and chrome: URIs in unexpected ways?
Also, the string code is very manual. Can we use nsIURL.filePath instead of manually cutting out the scheme, and use nsCString::ReplaceSubstring instead of the manual double-slash code.
Attachment #495162 -
Flags: review?(benjamin) → review-
Assignee | ||
Comment 16•14 years ago
|
||
Adjusted text transformations according to review comment
Attachment #495162 -
Attachment is obsolete: true
Attachment #499896 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #499896 -
Flags: review? → review?(benjamin)
Assignee | ||
Comment 17•14 years ago
|
||
(In reply to comment #15)
> Comment on attachment 495162 [details] [diff] [review]
> commented uri transformation
>
> Why are we doing this transformation for all URLs, instead of just resource:
> URLs?
For consistency. The existing code was already prepending jsloader: to resolve ambiguities, this doesn't go much furthe.
> Can we constrain our behavior here to the specific case we're trying to solve,
> so that we don't accidentally end up mixing file: and resource: and chrome:
> URIs in unexpected ways?
Solved that by leaving the protocol in the resulting path.
>
> Also, the string code is very manual. Can we use nsIURL.filePath instead of
> manually cutting out the scheme, and use nsCString::ReplaceSubstring instead of
> the manual double-slash code.
Using nsIURI.path now, no more // collapsing(appending more carefully instead).
Assignee | ||
Comment 18•14 years ago
|
||
this time with a qref
Attachment #499896 -
Attachment is obsolete: true
Attachment #499898 -
Flags: review?(benjamin)
Attachment #499896 -
Flags: review?(benjamin)
Updated•14 years ago
|
Attachment #499898 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 19•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/b664cd398cbb
http://hg.mozilla.org/mozilla-central/rev/d902db23c04e
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•