Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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
18 {
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_THREADSAFE_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);
52 };
54 #endif // NSPROTECTEDAUTHTHREAD_H_