2001-08-15 01:53:53 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-31 09:33:35 +00: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/. */
|
2001-08-15 01:53:53 +00:00
|
|
|
|
|
|
|
#ifndef _NSKEYGENTHREAD_H_
|
|
|
|
#define _NSKEYGENTHREAD_H_
|
|
|
|
|
|
|
|
#include "keyhi.h"
|
|
|
|
#include "nspr.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 04:29:02 +00:00
|
|
|
#include "mozilla/Mutex.h"
|
2001-08-15 01:53:53 +00:00
|
|
|
#include "nsIKeygenThread.h"
|
2004-11-24 20:17:25 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2011-11-03 04:14:33 +00:00
|
|
|
class nsIRunnable;
|
2001-08-15 01:53:53 +00:00
|
|
|
|
|
|
|
class nsKeygenThread : public nsIKeygenThread
|
|
|
|
{
|
|
|
|
private:
|
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 04:29:02 +00:00
|
|
|
mozilla::Mutex mutex;
|
2001-08-15 01:53:53 +00:00
|
|
|
|
2011-11-03 04:14:33 +00:00
|
|
|
nsCOMPtr<nsIRunnable> mNotifyObserver;
|
2001-08-15 01:53:53 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool iAmRunning;
|
|
|
|
bool keygenReady;
|
|
|
|
bool statusDialogClosed;
|
|
|
|
bool alreadyReceivedParams;
|
2001-10-23 06:11:57 +00:00
|
|
|
|
|
|
|
SECKEYPrivateKey *privateKey;
|
|
|
|
SECKEYPublicKey *publicKey;
|
|
|
|
PK11SlotInfo *slot;
|
2012-03-21 22:22:15 +00:00
|
|
|
PK11AttrFlags flags;
|
|
|
|
PK11SlotInfo *altSlot;
|
|
|
|
PK11AttrFlags altFlags;
|
|
|
|
PK11SlotInfo *usedSlot;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t keyGenMechanism;
|
2001-10-23 06:11:57 +00:00
|
|
|
void *params;
|
|
|
|
void *wincx;
|
|
|
|
|
2001-08-15 01:53:53 +00:00
|
|
|
PRThread *threadHandle;
|
2014-06-23 22:40:03 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsKeygenThread();
|
|
|
|
|
2001-08-15 01:53:53 +00:00
|
|
|
public:
|
|
|
|
nsKeygenThread();
|
|
|
|
|
|
|
|
NS_DECL_NSIKEYGENTHREAD
|
2013-07-19 02:24:14 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2001-08-15 01:53:53 +00:00
|
|
|
|
2001-10-23 06:11:57 +00:00
|
|
|
void SetParams(
|
|
|
|
PK11SlotInfo *a_slot,
|
2012-03-21 22:22:15 +00:00
|
|
|
PK11AttrFlags a_flags,
|
|
|
|
PK11SlotInfo *a_alternative_slot,
|
|
|
|
PK11AttrFlags a_alternative_flags,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t a_keyGenMechanism,
|
2001-10-23 06:11:57 +00:00
|
|
|
void *a_params,
|
|
|
|
void *a_wincx );
|
|
|
|
|
2012-03-21 22:22:15 +00:00
|
|
|
nsresult ConsumeResult(
|
|
|
|
PK11SlotInfo **a_used_slot,
|
2001-10-23 06:11:57 +00:00
|
|
|
SECKEYPrivateKey **a_privateKey,
|
|
|
|
SECKEYPublicKey **a_publicKey);
|
2001-08-15 01:53:53 +00:00
|
|
|
|
|
|
|
void Join(void);
|
2001-08-21 14:22:11 +00:00
|
|
|
|
|
|
|
void Run(void);
|
2001-08-15 01:53:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_NSKEYGENTHREAD_H_
|