Bug 783551 - Get tooltool running on the b2g on OS X builds. r=respindola
[gecko.git] / security / manager / ssl / src / nsProtectedAuthThread.h
blob4959be8dbab1fef8a1c4e39daf403328142d7fa3
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef NSPROTECTEDAUTHTHREAD_H_
6 #define NSPROTECTEDAUTHTHREAD_H_
8 #include <nsCOMPtr.h>
9 #include "keyhi.h"
10 #include "nspr.h"
12 #include "mozilla/Mutex.h"
13 #include "nsIProtectedAuthThread.h"
15 class nsIRunnable;
17 class nsProtectedAuthThread : public nsIProtectedAuthThread
19 private:
20 mozilla::Mutex mMutex;
22 nsCOMPtr<nsIRunnable> mNotifyObserver;
24 bool mIAmRunning;
25 bool mLoginReady;
27 PRThread *mThreadHandle;
29 // Slot to do authentication on
30 PK11SlotInfo* mSlot;
32 // Result of the authentication
33 SECStatus mLoginResult;
35 public:
37 nsProtectedAuthThread();
38 virtual ~nsProtectedAuthThread();
40 NS_DECL_ISUPPORTS
41 NS_DECL_NSIPROTECTEDAUTHTHREAD
43 // Sets parameters for the thread
44 void SetParams(PK11SlotInfo *slot);
46 // Gets result of the protected authentication operation
47 SECStatus GetResult();
49 void Join(void);
51 void Run(void);
54 #endif // NSPROTECTEDAUTHTHREAD_H_