nsISupports
Last changed in Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)Implemented by @mozilla.org/uuid-generator;
as a service:
var uuidGenerator = Components.classes["@mozilla.org/uuid-generator;1"] .getService(Components.interfaces.nsIUUIDGenerator);
nsIDPtr generateUUID(); |
void generateUUIDInPlace(in nsNonConstIDPtr id); Native code only! |
Obtains a new UUID using appropriate platform-specific methods to obtain a nsID that can be considered to be globally unique.
nsIDPtr generateUUID();
None.
This method returns a nsIDPtr containing a unique ID.
NS_ERROR_FAILURE
Obtain a new UUID like the generateUUID()
method, but place it in the provided nsID pointer instead of allocating a new nsID.
void generateUUIDInPlace( in nsNonConstIDPtr id );
id
NS_ERROR_FAILURE
var uuidGenerator = Components.classes["@mozilla.org/uuid-generator;1"] .getService(Components.interfaces.nsIUUIDGenerator); var uuid = uuidGenerator.generateUUID(); var uuidString = uuid.toString();