Last Comment Bug 747041 - resource:///modules/ and resource://gre/modules/ should be clearly-differentiated
: resource:///modules/ and resource://gre/modules/ should be clearly-differenti...
Status: RESOLVED FIXED
[qa-]
:
Product: Firefox Graveyard
Classification: Graveyard
Component: Web Apps (show other bugs)
: unspecified
: All All
: -- normal
: Firefox 14
Assigned To: Takanori MATSUURA
: Jason Smith [:jsmith]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-19 09:25 PDT by Takanori MATSUURA
Modified: 2016-02-04 15:00 PST (History)
4 users (show)
jsmith: in‑moztrap-
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Fix the path of importing jsm files in webappsUI.jsm and WebappsInstaller.jsm. (1.95 KB, patch)
2012-04-20 03:48 PDT, Takanori MATSUURA
felipc: review+
Details | Diff | Splinter Review
Fix the path of importing jsm files in browser.js. (1.02 KB, patch)
2012-04-20 03:59 PDT, Takanori MATSUURA
felipc: review+
Details | Diff | Splinter Review

Description Takanori MATSUURA 2012-04-19 09:25:49 PDT
The difference of resource:///modules/ and resource://gre/modules/ is exposed by building Firefox on top of xulrunner. So these two resource URLs are clearly-differentiated.


browser/modules/webappsUI.jsm:
WebappsInstaller.jsm is imported from resource://gre/modules/.
However it locates at resource:///modules/.

browser/modules/WebappsInstaller.jsm:
Three files (Services.jsm, FileUtils.jsm, and NetUtil.jsm) are imported from resource:///modules/.
However they exist at resource://gre/modules/.

browser/components/places/content/places.js:
MigrationUtils.jsm is imported from resource://gre/modules/.
However it locates at resource:///modules/.
Comment 1 Jason Smith [:jsmith] 2012-04-19 09:51:16 PDT
Felipe or Myk - Any ideas?
Comment 2 Myk Melez [:myk] [@mykmelez] 2012-04-19 11:01:42 PDT
If I understand this correctly, Takanori is saying that when you build Firefox on top of XULRunner, with the two inhabiting different directories, then resource:///modules/ and resource://gre/modules/ represent two different locations, and some references to modules in those locations are currently referencing the wrong location.

This hasn't shown up in our test builds and in nightly builds because those put Firefox and the underlying platform (the GRE) into the same directory.  So it doesn't affect our ability to ship Firefox with the runtime.  But we should still make our code work for Takanori's use case and correct our references to these modules.
Comment 3 Marco Bonardo [::mak] 2012-04-19 12:11:21 PDT
(In reply to Takanori MATSUURA from comment #0)
> browser/components/places/content/places.js:
> MigrationUtils.jsm is imported from resource://gre/modules/.
> However it locates at resource:///modules/.

this is tracked in bug 739968, fwiw, I think we can fix it in hours.  Btw, surely the non-difference between the 2 paths in common browser builds is quite error-prone (as you can see we keep using the wrong path).
Comment 4 Takanori MATSUURA 2012-04-19 16:04:40 PDT
(In reply to Myk Melez [:myk] [@mykmelez] from comment #2)
> If I understand this correctly, Takanori is saying that when you build
> Firefox on top of XULRunner, with the two inhabiting different directories,
> then resource:///modules/ and resource://gre/modules/ represent two
> different locations, and some references to modules in those locations are
> currently referencing the wrong location.

You are right.
At least, Fedora and RHEL build Firefox on top of xulrunner.
In this case,
resource://gre/modules/ represents jar:file:///usr/lib64/xulrunner-14/omni.ja!/modules/ and
resource:///modules/ represents jar:file:///usr/lib64/firefox/omni.ja!/modules/
Comment 5 :Felipe Gomes (needinfo me!) 2012-04-19 16:11:26 PDT
If anyone wants to provide a patch to the webapps{ui,installer} I can review it
Comment 6 Takanori MATSUURA 2012-04-20 03:48:09 PDT
Created attachment 616920 [details] [diff] [review]
Fix the path of importing jsm files in webappsUI.jsm and WebappsInstaller.jsm.
Comment 7 Takanori MATSUURA 2012-04-20 03:59:06 PDT
Created attachment 616923 [details] [diff] [review]
Fix the path of importing jsm files in browser.js.

Another wrong path found in browser/base/content/browser.js.
Comment 8 :Felipe Gomes (needinfo me!) 2012-04-22 14:33:13 PDT
Thanks Takanori!

https://hg.mozilla.org/integration/mozilla-inbound/rev/c823e4f03017
Comment 9 Ed Morley [:emorley] 2012-04-22 23:42:39 PDT
https://hg.mozilla.org/mozilla-central/rev/c823e4f03017
Comment 10 Jason Smith [:jsmith] 2012-05-12 08:40:21 PDT
Felipe - Is there anything needed to be verified from an end-user perspective? Doesn't look like it, but I'd like to confirm.
Comment 11 :Felipe Gomes (needinfo me!) 2012-05-12 14:21:08 PDT
Jason: no, nothing necessary

Note You need to log in before you can comment on or make changes to this bug.