|
1 /* -*- Mode: C++; tab-width: 50; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef _NSUUIDGENERATOR_H_ |
|
7 #define _NSUUIDGENERATOR_H_ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "mozilla/Mutex.h" |
|
11 |
|
12 #include "nsIUUIDGenerator.h" |
|
13 |
|
14 class nsUUIDGenerator MOZ_FINAL : public nsIUUIDGenerator { |
|
15 public: |
|
16 nsUUIDGenerator(); |
|
17 |
|
18 NS_DECL_THREADSAFE_ISUPPORTS |
|
19 |
|
20 NS_DECL_NSIUUIDGENERATOR |
|
21 |
|
22 nsresult Init(); |
|
23 |
|
24 private: |
|
25 ~nsUUIDGenerator(); |
|
26 |
|
27 protected: |
|
28 |
|
29 mozilla::Mutex mLock; |
|
30 #if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID) |
|
31 char mState[128]; |
|
32 char *mSavedState; |
|
33 uint8_t mRBytes; |
|
34 #endif |
|
35 }; |
|
36 |
|
37 #define NS_UUID_GENERATOR_CONTRACTID "@mozilla.org/uuid-generator;1" |
|
38 #define NS_UUID_GENERATOR_CID \ |
|
39 { 0x706d36bb, 0xbf79, 0x4293, \ |
|
40 { 0x81, 0xf2, 0x8f, 0x68, 0x28, 0xc1, 0x8f, 0x9d } } |
|
41 |
|
42 #endif /* _NSUUIDGENERATOR_H_ */ |