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/. */
|
2007-12-05 07:31:43 +00:00
|
|
|
|
|
|
|
#ifndef NSPROTECTEDAUTHTHREAD_H_
|
|
|
|
#define NSPROTECTEDAUTHTHREAD_H_
|
|
|
|
|
2008-01-15 22:41:52 +00:00
|
|
|
#include <nsCOMPtr.h>
|
2007-12-05 07:31:43 +00:00
|
|
|
#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"
|
2007-12-05 07:31:43 +00:00
|
|
|
#include "nsIProtectedAuthThread.h"
|
|
|
|
|
2011-11-03 04:14:33 +00:00
|
|
|
class nsIRunnable;
|
|
|
|
|
2007-12-05 07:31:43 +00:00
|
|
|
class nsProtectedAuthThread : public nsIProtectedAuthThread
|
|
|
|
{
|
|
|
|
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 mMutex;
|
2007-12-05 07:31:43 +00:00
|
|
|
|
2011-11-03 04:14:33 +00:00
|
|
|
nsCOMPtr<nsIRunnable> mNotifyObserver;
|
2007-12-05 07:31:43 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIAmRunning;
|
|
|
|
bool mLoginReady;
|
2007-12-05 07:31:43 +00:00
|
|
|
|
|
|
|
PRThread *mThreadHandle;
|
|
|
|
|
|
|
|
// Slot to do authentication on
|
|
|
|
PK11SlotInfo* mSlot;
|
|
|
|
|
|
|
|
// Result of the authentication
|
|
|
|
SECStatus mLoginResult;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
nsProtectedAuthThread();
|
|
|
|
|
2013-07-19 02:24:14 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-12-05 07:31:43 +00:00
|
|
|
NS_DECL_NSIPROTECTEDAUTHTHREAD
|
|
|
|
|
|
|
|
// Sets parameters for the thread
|
|
|
|
void SetParams(PK11SlotInfo *slot);
|
|
|
|
|
|
|
|
// Gets result of the protected authentication operation
|
|
|
|
SECStatus GetResult();
|
|
|
|
|
|
|
|
void Join(void);
|
|
|
|
|
|
|
|
void Run(void);
|
2014-06-23 22:40:03 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsProtectedAuthThread();
|
2007-12-05 07:31:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NSPROTECTEDAUTHTHREAD_H_
|