1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/ssl/src/nsProtectedAuthThread.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef NSPROTECTEDAUTHTHREAD_H_ 1.9 +#define NSPROTECTEDAUTHTHREAD_H_ 1.10 + 1.11 +#include <nsCOMPtr.h> 1.12 +#include "keyhi.h" 1.13 +#include "nspr.h" 1.14 + 1.15 +#include "mozilla/Mutex.h" 1.16 +#include "nsIProtectedAuthThread.h" 1.17 + 1.18 +class nsIRunnable; 1.19 + 1.20 +class nsProtectedAuthThread : public nsIProtectedAuthThread 1.21 +{ 1.22 +private: 1.23 + mozilla::Mutex mMutex; 1.24 + 1.25 + nsCOMPtr<nsIRunnable> mNotifyObserver; 1.26 + 1.27 + bool mIAmRunning; 1.28 + bool mLoginReady; 1.29 + 1.30 + PRThread *mThreadHandle; 1.31 + 1.32 + // Slot to do authentication on 1.33 + PK11SlotInfo* mSlot; 1.34 + 1.35 + // Result of the authentication 1.36 + SECStatus mLoginResult; 1.37 + 1.38 +public: 1.39 + 1.40 + nsProtectedAuthThread(); 1.41 + virtual ~nsProtectedAuthThread(); 1.42 + 1.43 + NS_DECL_THREADSAFE_ISUPPORTS 1.44 + NS_DECL_NSIPROTECTEDAUTHTHREAD 1.45 + 1.46 + // Sets parameters for the thread 1.47 + void SetParams(PK11SlotInfo *slot); 1.48 + 1.49 + // Gets result of the protected authentication operation 1.50 + SECStatus GetResult(); 1.51 + 1.52 + void Join(void); 1.53 + 1.54 + void Run(void); 1.55 +}; 1.56 + 1.57 +#endif // NSPROTECTEDAUTHTHREAD_H_