Necko/nsIURI

< Necko
Revision as of 12:19, 23 March 2018 by Valentin.gosu (talk | contribs) (Created page with "== Description == This interface is used to pass around URI objects. These objects are threadsafe and immutable. If you need to change a nsIURI, you should use the nsIURIMutat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This interface is used to pass around URI objects. These objects are threadsafe and immutable. If you need to change a nsIURI, you should use the nsIURIMutator interface (in JavaScript) or the NS_MutateURI helper class (in C++).

Notes on threadsafety

You can only use NS_NewURI on the main thread (because it uses protocol handler which can be JS implemented). If you know the type the URI should be (nsStandardURL for http/ws, nsSimpleURI for various, nsHostObjectURI for blob, etc), then you can use use NS_MutateURI([instert MUTATOR_CONTRACTID here]) and mutate accordingly.

Implementations