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

Reply via email to