NaCl libpcsc

Diff
Login

Diff

Differences From Artifact [683a161fcd]:

To Artifact [f3e792cf0d]:


1
2
3
4
5
6
7
8

9
10

11
12
13
14
15

16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35



36
37

38

39
40
41
42

43
1
2






3
4

5
6
7



8



9

















10
11
12


13

14
15
16
17

18
19


-
-
-
-
-
-
+

-
+


-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
-
+



-
+

#include <ppapi/cpp/core.h>
#include <ppapi/cpp/instance.h>

#include <unistd.h>

#include "pcsc_nacl_global.h"
#include "dom_requests_manager.h"
#include "pcsc_nacl.h"
#include "global.h"

static DomRequestsManager *pcscNaClDRM = NULL;
static google_smart_card::TypedMessageRouter tmr;

void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId) {
	DomRequestsManager::PpDelegateImpl *drmDelegateImpl;
	PcscNacl *pcsc_nacl;

	new google_smart_card::PcscLiteOverRequesterGlobal(&tmr, instance, core);
	if (smartcardManagerAppId == NULL) {
		smartcardManagerAppId = "khpfeaanjngmcnplbdlpegiifgpfgdco";
	}


	if (clientId == NULL) {
		clientId = "UNKNOWN";
	}

	if (pcscNaClDRM == NULL) {
		drmDelegateImpl = new DomRequestsManager::PpDelegateImpl(instance, core);
	
		pcscNaClDRM = new DomRequestsManager("pcsc-nacl", drmDelegateImpl);
	}

	pcsc_nacl = new PcscNacl(pcscNaClDRM, smartcardManagerAppId, clientId);

	if (!pcsc_nacl->Initialize()) {
		return;
	}

	return;

	/* UNREACH: These are no longer used */
	SetPcscNaclGlobalInstance(pcsc_nacl);

	smartcardManagerAppId = smartcardManagerAppId;
	return;
	clientId = clientId;
}

bool pcscNaClHandleMessage(const pp::Var &message) {
	return(pcscNaClDRM->HandleMessage(message));
	return(tmr.OnMessageReceived(message));
}