Re: Threadsafe URLs - MozURL
On 10/23/17 10:30 AM, Jeff Muizelaar wrote: For the curious among us, what made nsIURI not thread safe in the first place? There were several aspects to this: 1) Constructing a URI object. This needed a protocol handler, which could be implemented in JS by extensions. With XPCOM extensions gone, we probably still need to audit our protocol handlers to ensure they're threadsafe. 2) Necko caches the protocol handler for a scheme after the first time you get it. This cache is obviously shared mutable global state, and is not threadsafe at the moment. 3) The URI could be implemented in JS by extensions. Again, with that gone we need to audit our built-in URI implementations to ensure they're threadsafe. Some of this work (and fixing the threadsafety issues it uncovered) happened in https://bugzilla.mozilla.org/show_bug.cgi?id=1344751 already. -Boris ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Threadsafe URLs - MozURL
On 23 October 2017 at 16:21, Anne van Kesterenwrote: > On Mon, Oct 23, 2017 at 4:01 PM, Valentin Gosu > wrote: > > A few weeks ago we landed MozURL. This is an immutable threadsafe wrapper > > for rust-url. > > What is the plan for these issues: > > https://github.com/servo/rust-url/issues/163 > https://github.com/servo/rust-url/issues/290 > > I'm rather worried that no serious effort to align with the standard > has taken place for close to two years. Quite a few things changed, > especially in response to feedback from the implementations by Safari, > Node.js, and jsdom. And also in response to work undertaken in > Firefox. > This is indeed a concern, but from what I can tell the only barrier to improving rust-url is finding the people to work on it. I intend to devote some time to this in the next few weeks. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Threadsafe URLs - MozURL
On 23 October 2017 at 16:30, Jeff Muizelaarwrote: > For the curious among us, what made nsIURI not thread safe in the first > place? > One of the factors was that as an IDL nsIURI could also be implemented by JS code in addons, which could only run on the main thread. > -Jeff > > On Mon, Oct 23, 2017 at 10:01 AM, Valentin Gosu > wrote: > > Hi everyone, > > > > Threadsafe URLs have been high on everybody's wishlist for a long while. > > The fact that our nsIURI implementations weren't thread safe meant that > > hacks had to be used to use a URI off the main thread, such as saving it > as > > a string, or bouncing back to the main thread whenever you had to use the > > URI in any way. > > > > A few weeks ago we landed MozURL. This is an immutable threadsafe wrapper > > for rust-url. While it's not yet ready to fully replace our existing URL > > implementations, it's good enough to avoid using the hacks I just > mentioned. > > > > For examples of how to use it go to the header file [1] or the gtests [2] > > > > Work is also under way to provide a threadsafe implementation of nsIURI > > that we eventually hope to replace our other URI parsers, and to improve > > the rust-url parser to be faster than our current nsStandardURL > > implementation [3]. > > > > [1] http://searchfox.org/mozilla-central/source/netwerk/base/MozURL.h > > [2] > > http://searchfox.org/mozilla-central/source/netwerk/test/ > gtest/TestMozURL.cpp > > [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1394906#c2 > > ___ > > dev-platform mailing list > > dev-platform@lists.mozilla.org > > https://lists.mozilla.org/listinfo/dev-platform > ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Threadsafe URLs - MozURL
For the curious among us, what made nsIURI not thread safe in the first place? -Jeff On Mon, Oct 23, 2017 at 10:01 AM, Valentin Gosuwrote: > Hi everyone, > > Threadsafe URLs have been high on everybody's wishlist for a long while. > The fact that our nsIURI implementations weren't thread safe meant that > hacks had to be used to use a URI off the main thread, such as saving it as > a string, or bouncing back to the main thread whenever you had to use the > URI in any way. > > A few weeks ago we landed MozURL. This is an immutable threadsafe wrapper > for rust-url. While it's not yet ready to fully replace our existing URL > implementations, it's good enough to avoid using the hacks I just mentioned. > > For examples of how to use it go to the header file [1] or the gtests [2] > > Work is also under way to provide a threadsafe implementation of nsIURI > that we eventually hope to replace our other URI parsers, and to improve > the rust-url parser to be faster than our current nsStandardURL > implementation [3]. > > [1] http://searchfox.org/mozilla-central/source/netwerk/base/MozURL.h > [2] > http://searchfox.org/mozilla-central/source/netwerk/test/gtest/TestMozURL.cpp > [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1394906#c2 > ___ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Threadsafe URLs - MozURL
On Mon, Oct 23, 2017 at 4:01 PM, Valentin Gosuwrote: > A few weeks ago we landed MozURL. This is an immutable threadsafe wrapper > for rust-url. What is the plan for these issues: https://github.com/servo/rust-url/issues/163 https://github.com/servo/rust-url/issues/290 I'm rather worried that no serious effort to align with the standard has taken place for close to two years. Quite a few things changed, especially in response to feedback from the implementations by Safari, Node.js, and jsdom. And also in response to work undertaken in Firefox. -- https://annevankesteren.nl/ ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Threadsafe URLs - MozURL
Hi everyone, Threadsafe URLs have been high on everybody's wishlist for a long while. The fact that our nsIURI implementations weren't thread safe meant that hacks had to be used to use a URI off the main thread, such as saving it as a string, or bouncing back to the main thread whenever you had to use the URI in any way. A few weeks ago we landed MozURL. This is an immutable threadsafe wrapper for rust-url. While it's not yet ready to fully replace our existing URL implementations, it's good enough to avoid using the hacks I just mentioned. For examples of how to use it go to the header file [1] or the gtests [2] Work is also under way to provide a threadsafe implementation of nsIURI that we eventually hope to replace our other URI parsers, and to improve the rust-url parser to be faster than our current nsStandardURL implementation [3]. [1] http://searchfox.org/mozilla-central/source/netwerk/base/MozURL.h [2] http://searchfox.org/mozilla-central/source/netwerk/test/gtest/TestMozURL.cpp [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1394906#c2 ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform