Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef _NSKEYGENTHREAD_H_
8 #define _NSKEYGENTHREAD_H_
10 #include "keyhi.h"
11 #include "nspr.h"
13 #include "mozilla/Mutex.h"
14 #include "nsIKeygenThread.h"
15 #include "nsCOMPtr.h"
17 class nsIRunnable;
19 class nsKeygenThread : public nsIKeygenThread
20 {
21 private:
22 mozilla::Mutex mutex;
24 nsCOMPtr<nsIRunnable> mNotifyObserver;
26 bool iAmRunning;
27 bool keygenReady;
28 bool statusDialogClosed;
29 bool alreadyReceivedParams;
31 SECKEYPrivateKey *privateKey;
32 SECKEYPublicKey *publicKey;
33 PK11SlotInfo *slot;
34 PK11AttrFlags flags;
35 PK11SlotInfo *altSlot;
36 PK11AttrFlags altFlags;
37 PK11SlotInfo *usedSlot;
38 uint32_t keyGenMechanism;
39 void *params;
40 void *wincx;
42 PRThread *threadHandle;
44 public:
45 nsKeygenThread();
46 virtual ~nsKeygenThread();
48 NS_DECL_NSIKEYGENTHREAD
49 NS_DECL_THREADSAFE_ISUPPORTS
51 void SetParams(
52 PK11SlotInfo *a_slot,
53 PK11AttrFlags a_flags,
54 PK11SlotInfo *a_alternative_slot,
55 PK11AttrFlags a_alternative_flags,
56 uint32_t a_keyGenMechanism,
57 void *a_params,
58 void *a_wincx );
60 nsresult ConsumeResult(
61 PK11SlotInfo **a_used_slot,
62 SECKEYPrivateKey **a_privateKey,
63 SECKEYPublicKey **a_publicKey);
65 void Join(void);
67 void Run(void);
68 };
70 #endif //_NSKEYGENTHREAD_H_