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