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
#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"

static DomRequestsManager *pcscNaClDRM = NULL;

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

	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;
	}

	SetPcscNaclGlobalInstance(pcsc_nacl);

	return;

}

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


<
<
<
<
<
|

|


<
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
<
|
<
>



|

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 "global.h"

static google_smart_card::TypedMessageRouter tmr;

void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId) {


	new google_smart_card::PcscLiteOverRequesterGlobal(&tmr, instance, core);

















	return;

	/* UNREACH: These are no longer used */

	smartcardManagerAppId = smartcardManagerAppId;

	clientId = clientId;
}

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