Hello everyone,

nsIURI has been immutable for a few releases now, meaning once you had one
it was safe to use it on any thread (even change it using nsIURIMutator).
But until recently you couldn't create a new URI off the main thread
(unless you already knew the type of the URI).
A few days ago I closed bug 922464
<https://bugzilla.mozilla.org/show_bug.cgi?id=922464>, which means nsIURI
can now be safely used and created on any thread via NS_NewURI. It also
means nsIProtocolHandler.newURI no longer exists, and if you want to add
any other special scheme to Gecko you should do so in NS_NewURI in
nsNetUtil.cpp

Most of the work happened in bug 1536744
<https://bugzilla.mozilla.org/show_bug.cgi?id=1536744>. This unblocks work
to make make nsIPrincipal thread safe in bug 1443925
<https://bugzilla.mozilla.org/show_bug.cgi?id=1443925>.
I've noticed there are some places that keep URIs around as strings. If
those strings are regularly used to create nsIURIs, I strongly encourage
you to do so from the beginning.

There is still work to be done in order to reduce the number of
implementations we have for nsIURI and resolve our incompatibilities with
the URL spec. Stay tuned.

Let me know if you uncover any issues, or if you have any questions.

Cheers!
-- 
Valentin
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to