Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef NSPROTECTEDAUTHTHREAD_H_ |
michael@0 | 6 | #define NSPROTECTEDAUTHTHREAD_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <nsCOMPtr.h> |
michael@0 | 9 | #include "keyhi.h" |
michael@0 | 10 | #include "nspr.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/Mutex.h" |
michael@0 | 13 | #include "nsIProtectedAuthThread.h" |
michael@0 | 14 | |
michael@0 | 15 | class nsIRunnable; |
michael@0 | 16 | |
michael@0 | 17 | class nsProtectedAuthThread : public nsIProtectedAuthThread |
michael@0 | 18 | { |
michael@0 | 19 | private: |
michael@0 | 20 | mozilla::Mutex mMutex; |
michael@0 | 21 | |
michael@0 | 22 | nsCOMPtr<nsIRunnable> mNotifyObserver; |
michael@0 | 23 | |
michael@0 | 24 | bool mIAmRunning; |
michael@0 | 25 | bool mLoginReady; |
michael@0 | 26 | |
michael@0 | 27 | PRThread *mThreadHandle; |
michael@0 | 28 | |
michael@0 | 29 | // Slot to do authentication on |
michael@0 | 30 | PK11SlotInfo* mSlot; |
michael@0 | 31 | |
michael@0 | 32 | // Result of the authentication |
michael@0 | 33 | SECStatus mLoginResult; |
michael@0 | 34 | |
michael@0 | 35 | public: |
michael@0 | 36 | |
michael@0 | 37 | nsProtectedAuthThread(); |
michael@0 | 38 | virtual ~nsProtectedAuthThread(); |
michael@0 | 39 | |
michael@0 | 40 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 41 | NS_DECL_NSIPROTECTEDAUTHTHREAD |
michael@0 | 42 | |
michael@0 | 43 | // Sets parameters for the thread |
michael@0 | 44 | void SetParams(PK11SlotInfo *slot); |
michael@0 | 45 | |
michael@0 | 46 | // Gets result of the protected authentication operation |
michael@0 | 47 | SECStatus GetResult(); |
michael@0 | 48 | |
michael@0 | 49 | void Join(void); |
michael@0 | 50 | |
michael@0 | 51 | void Run(void); |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #endif // NSPROTECTEDAUTHTHREAD_H_ |