Bug 452390 Tracemonkey will crash if the compiler doesn't have FASTCALL r=danderson
[wine-gecko.git] / security / manager / ssl / src / nsSmartCardMonitor.h
blob6ad2f88bf40b3dcbf280c36a785eda46fd387ade
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is Contributed by Red Hat Inc.
16 * The Initial Developer of the Original Code is
17 * Red Hat, Inc.
18 * Portions created by the Initial Developer are Copyright (C) 2005
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
36 #ifndef _NSSMARTCARDMONITOR_
37 #define _NSSMARTCARDMONITOR_
39 #include "prthread.h"
40 #include "secmod.h"
41 #include "plhash.h"
42 #include "pkcs11t.h"
44 class SmartCardThreadEntry;
45 class SmartCardMonitoringThread;
48 // manage a group of SmartCardMonitoringThreads
50 class SmartCardThreadList {
51 public:
52 SmartCardThreadList();
53 ~SmartCardThreadList();
54 void Remove(SECMODModule *module);
55 nsresult Add(SmartCardMonitoringThread *thread);
56 private:
57 SmartCardThreadEntry *head;
61 // monitor a Module for token insertion and removal
63 // NOTE: this provides the application the ability to dynamically add slots
64 // on the fly as necessary.
66 class SmartCardMonitoringThread
68 public:
69 SmartCardMonitoringThread(SECMODModule *module);
70 ~SmartCardMonitoringThread();
72 nsresult Start();
73 void Stop();
75 void Execute();
76 void Interrupt();
78 const SECMODModule *GetModule();
80 private:
82 static void LaunchExecute(void *arg);
83 void SetTokenName(CK_SLOT_ID slotid, const char *tokenName, PRUint32 series);
84 const char *GetTokenName(CK_SLOT_ID slotid);
85 PRUint32 GetTokenSeries(CK_SLOT_ID slotid);
86 nsresult SendEvent(const nsAString &type,const char *tokenName);
89 SECMODModule *mModule;
90 PLHashTable *mHash;
91 PRThread* mThread;
94 #endif