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
|
|
|
|
|
|
|
#ifndef _NSUUIDGENERATOR_H_
|
|
|
|
#define _NSUUIDGENERATOR_H_
|
|
|
|
|
2011-12-18 07:47:45 +04:00
|
|
|
#include "mozilla/Attributes.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-04-01 08:29:02 +04:00
|
|
|
#include "mozilla/Mutex.h"
|
2011-12-18 07:47:45 +04:00
|
|
|
|
2005-11-22 00:01:45 +03:00
|
|
|
#include "nsIUUIDGenerator.h"
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsUUIDGenerator final : public nsIUUIDGenerator {
|
2005-11-22 00:01:45 +03:00
|
|
|
public:
|
2014-05-05 21:30:39 +04:00
|
|
|
nsUUIDGenerator();
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2014-05-05 21:30:39 +04:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2014-05-05 21:30:39 +04:00
|
|
|
NS_DECL_NSIUUIDGENERATOR
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2014-05-05 21:30:39 +04:00
|
|
|
nsresult Init();
|
2005-11-22 00:01:45 +03:00
|
|
|
|
2006-05-15 02:41:47 +04:00
|
|
|
private:
|
2014-05-05 21:30:39 +04:00
|
|
|
~nsUUIDGenerator();
|
2006-05-15 02:41:47 +04:00
|
|
|
|
|
|
|
protected:
|
2014-05-05 21:30:39 +04:00
|
|
|
mozilla::Mutex mLock;
|
2014-06-03 02:41:00 +04:00
|
|
|
#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(HAVE_ARC4RANDOM)
|
2014-05-05 21:30:39 +04:00
|
|
|
char mState[128];
|
2014-05-13 21:41:38 +04:00
|
|
|
char* mSavedState;
|
2014-05-05 21:30:39 +04:00
|
|
|
uint8_t mRBytes;
|
2006-05-15 02:41:47 +04:00
|
|
|
#endif
|
2005-11-22 00:01:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_UUID_GENERATOR_CONTRACTID "@mozilla.org/uuid-generator;1"
|
|
|
|
#define NS_UUID_GENERATOR_CID \
|
2018-11-30 13:46:48 +03:00
|
|
|
{ \
|
2005-11-22 00:01:45 +03:00
|
|
|
0x706d36bb, 0xbf79, 0x4293, { \
|
|
|
|
0x81, 0xf2, 0x8f, 0x68, 0x28, 0xc1, 0x8f, 0x9d \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _NSUUIDGENERATOR_H_ */
|