Closed Bug 609785 Opened 14 years ago Closed 14 years ago

Startupcache urls should not depend on install-location

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: taras.mozilla, Assigned: taras.mozilla)

References

Details

Attachments

(2 files, 8 obsolete files)

Attached patch workaround (obsolete) (deleted) — 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?
The best option in my mind is to just ship with this hack until someone comes up with a better approach.
Attached patch Detect omnijar jars in js component loading (obsolete) (deleted) — Splinter Review
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)
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: nobody → tglek
Attachment #488367 - Attachment is obsolete: true
Attachment #488514 - Flags: review?(benjamin)
Attached patch Use resource URLs for omnijars (obsolete) (deleted) — Splinter Review
Attachment #488387 - Attachment is obsolete: true
Attachment #488520 - Flags: review?(benjamin)
Attached patch Use resource URLs for omnijars (obsolete) (deleted) — Splinter Review
Use resource://gre instead of resource:///
Attachment #488520 - Attachment is obsolete: true
Attachment #489635 - Flags: review?(benjamin)
Attachment #488520 - Flags: review?(benjamin)
Attachment #488514 - Attachment is obsolete: true
Attachment #489641 - Flags: review?(benjamin)
Attachment #488514 - Flags: review?(benjamin)
Are these two patches alternates, or mean to go together?
(In reply to comment #8) > Are these two patches alternates, or mean to go together? together
Attachment #489635 - Flags: review?(benjamin) → review+
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-
Attached patch commented uri transformation (obsolete) (deleted) — Splinter Review
Attachment #489641 - Attachment is obsolete: true
Attachment #495162 - Flags: review?(benjamin)
Correct version that checks paths instead of pointers.
Attachment #489635 - Attachment is obsolete: true
Hrm, I forget that that check may not be entirely safe if the omnijar path is null..
(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 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-
Attached patch uri transformation rev3 (obsolete) (deleted) — Splinter Review
Adjusted text transformations according to review comment
Attachment #495162 - Attachment is obsolete: true
Attachment #499896 - Flags: review?
Attachment #499896 - Flags: review? → review?(benjamin)
(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).
Attached patch uri transformation rev3 (deleted) — Splinter Review
this time with a qref
Attachment #499896 - Attachment is obsolete: true
Attachment #499898 - Flags: review?(benjamin)
Attachment #499896 - Flags: review?(benjamin)
Attachment #499898 - Flags: review?(benjamin) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 633381
Blocks: 633666
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: