Closed Bug 1356412 Opened 7 years ago Closed 6 years ago

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

Categories

(Core :: XPConnect, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: kmag, Assigned: kmag)

Details

Attachments

(2 files)

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.
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
This was only ever useful before we had compartment-based security isolation.
Now it is just a pervasive nuisance.
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.
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
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: