Closed Bug 1332355 Opened 8 years ago Closed 8 years ago

off-main-thread nsIURI

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 922464

People

(Reporter: bkelly, Unassigned)

References

Details

In the past we have required nsIURI to be used on main thread for a couple reasons: 1) URL parsing can be implemented in addon javascript 2) nsIURI are mutable and perhaps a bit of a foot-gun for cross-thread access In my mind (1) is a much bigger hurdle to clear. We are almost there, though. Now that legacy addons have been deprecated and web extensions will be the only public API we may no longer have to support js parsing of URLs. With that in mind we may want to put some effort into designing OMT URL parsing. For option (2), I think code can work around the issue using Clone(). We could also introduce an immutable URI type that has accessors, but no mutators. Or we could just use locking within the URI. It would be really great to fix this because it forces us to main thread for many things: 1) Running `new URL(s)` in a worker freezes the worker thread while we parse on the main thread. 2) All security checks must be performed on the main thread because nsIPrincipal is built on top of nsIURI 3) Network code must go through the main thread to parse URLs 4) Any other code that needs to parse URLs (which is a lot), etc
See Also: → libdweb-protocol
Isn't this a dupe of bug 1228115?
(Also, see bug 922464)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.