Necko/nsIURI

From New wiki
Jump to navigation Jump to search

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