2014-05-05 21:30:39 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2011-04-01 03:57:38 +04:00
|
|
|
#include "nsUUIDGenerator.h"
|
Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 23:51:19 +04:00
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(nsUUIDGenerator, nsIUUIDGenerator)
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2020-02-12 14:13:33 +03:00
|
|
|
nsUUIDGenerator::~nsUUIDGenerator() = default;
|
2006-05-15 02:41:47 +04:00
|
|
|
|
2005-11-22 00:01:45 +03:00
|
|
|
NS_IMETHODIMP
|
2014-05-13 21:41:38 +04:00
|
|
|
nsUUIDGenerator::GenerateUUID(nsID** aRet) {
|
2015-04-01 08:29:55 +03:00
|
|
|
nsID* id = static_cast<nsID*>(moz_xmalloc(sizeof(nsID)));
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2014-05-05 21:30:39 +04:00
|
|
|
nsresult rv = GenerateUUIDInPlace(id);
|
|
|
|
if (NS_FAILED(rv)) {
|
2015-04-01 08:29:55 +03:00
|
|
|
free(id);
|
2005-11-22 00:01:45 +03:00
|
|
|
return rv;
|
2014-05-05 21:30:39 +04:00
|
|
|
}
|
|
|
|
|
2014-05-13 21:41:38 +04:00
|
|
|
*aRet = id;
|
2014-05-05 21:30:39 +04:00
|
|
|
return rv;
|
2005-11-22 00:01:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-05-13 21:41:38 +04:00
|
|
|
nsUUIDGenerator::GenerateUUIDInPlace(nsID* aId) {
|
2021-10-14 06:28:49 +03:00
|
|
|
return nsID::GenerateUUIDInPlace(*aId);
|
2005-11-22 00:01:45 +03:00
|
|
|
}
|