On 23 October 2017 at 16:30, Jeff Muizelaar <jmuizel...@mozilla.com> wrote:
> 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 <valentin.g...@gmail.com> > 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