Get rid of the " -> " path mangling in the subscript loader

RESOLVED FIXED in Firefox 65

Status

()

enhancement
P2
normal
RESOLVED FIXED
2 years ago
5 months ago

People

(Reporter: kmag, Assigned: kmag)

Tracking

unspecified
mozilla65
Points:
---

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
This hack was added before we had compartment-based security isolation, and no longer serves any purpose. And it makes debugging a major headache. We should git rid of it.
Priority: -- → P2
I don't understand the security aspects of this, but it looks like it makes such code fail for no good reason?
http://searchfox.org/mozilla-central/rev/18c16ebf818abb86805ce08a6e537e4cd826f044/dom/workers/WorkerPrivate.cpp#4933
      JS::AutoFilename fileName;
      if (JS::DescribeScriptedCaller(aCx, &fileName)) {
        ...
          // As expected, fileName is not a path, so proceed with
          // a uri.
          rv = NS_NewURI(getter_AddRefs(loadInfo.mBaseURI),
                         fileName.get());

We expect fileName to be a URI, not multiple URIs separated with "->".

I imagine many calls to DescribeScriptedCaller may fail for the same reasons:
http://searchfox.org/mozilla-central/search?q=DescribeScriptedCaller&path=

It took me a while to figure out such issue in bug 1392602 comment 20.
(Assignee)

Comment 2

2 years ago
This has been a consistent thorn in a lot of sides, so I'll try to get to it this week. The main difficulty will be cleaning up all of the various bits crufty old code we've added over the years to deal with these mangled paths.
Assignee: nobody → kmaglione+bmo
(Assignee)

Comment 3

6 months ago
This was only ever useful before we had compartment-based security isolation.
Now it is just a pervasive nuisance.
(Assignee)

Comment 4

6 months ago
As in part 1, this no longer serves any purpose.

This patch also removes the otherwise unused WrappersEnabled() method, which
was similarly only useful before we had compartment-based security isolation.
Its functionality is now handled by compartment flags.

Comment 7

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9b4bf02afd60
https://hg.mozilla.org/mozilla-central/rev/00f962601b8b
https://hg.mozilla.org/mozilla-central/rev/00a33f24732b
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.