Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -21,25 +21,34 @@ CFLAGS := -I${NACL_SDK_ROOT}/include CXXFLAGS := $(CFLAGS) CPPFLAGS := $(CFLAGS) export CFLAGS CXXFLAGS CPPFLAGS -all: libpcsc.a +all: libpcsc.a libpcsc.h libpcsc.js -libpcsc.a: pcsc/Makefile pcsc/pcsc-nacl.h pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost +libpcsc.a: pcsc/Makefile pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost $(MAKE) -C pcsc BOOST_DIR='$(shell pwd)/boost' cp pcsc/libpcsc.a libpcsc.a.new mv libpcsc.a.new libpcsc.a +libpcsc.h: pcsc/libpcsc.h + cp pcsc/libpcsc.h libpcsc.h.new + mv libpcsc.h.new libpcsc.h + +libpcsc.js: pcsc/libpcsc.js + cp pcsc/libpcsc.js libpcsc.js.new + mv libpcsc.js.new libpcsc.js + boost: build-boost rm -rf boost ./build-boost clean: $(MAKE) -C pcsc clean - rm -f libpcsc.a - rm -f libpcsc.a.new + rm -f libpcsc.a libpcsc.a.new + rm -f libpcsc.h libpcsc.h.new + rm -f libpcsc.js libpcsc.js.new rm -rf workdir-* rm -rf boost.new distclean: clean rm -rf boost ADDED archive/google-chrome-smart-card-apps-20160317-nobinaries.zip Index: archive/google-chrome-smart-card-apps-20160317-nobinaries.zip ================================================================== --- /dev/null +++ archive/google-chrome-smart-card-apps-20160317-nobinaries.zip cannot compute difference between binary files Index: pcsc/Makefile ================================================================== --- pcsc/Makefile +++ pcsc/Makefile @@ -1,12 +1,11 @@ BOOST_DIR := /usr/include/boost CFLAGS += -Wall -std=gnu11 -g3 -ggdb3 CXXFLAGS += -Wall -std=gnu++11 -g3 -ggdb3 CPPFLAGS += -Isrc/include/PCSC -isystem $(BOOST_DIR)/include -Isrc -isystem $(NACL_SDK_ROOT)/include -OBJS += -# pcsc_nacl_init.o +OBJS += pcsc_nacl_init.o all: libpcsc.a include Makefile.deps ADDED pcsc/libpcsc.h Index: pcsc/libpcsc.h ================================================================== --- /dev/null +++ pcsc/libpcsc.h @@ -0,0 +1,11 @@ +#ifndef PCSC_NACL_H +#define PCSC_NACL_H 1 +#ifdef __cplusplus +#include +#include + +void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId); +bool pcscNaClHandleMessage(const pp::Var &message); + +#endif +#endif DELETED pcsc/pcsc-nacl.h Index: pcsc/pcsc-nacl.h ================================================================== --- pcsc/pcsc-nacl.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef PCSC_NACL_H -#define PCSC_NACL_H 1 -#ifdef __cplusplus -#include -#include - -void pcscNaClInit(pp::Instance *instance, pp::Core *core, const char *smartcardManagerAppId, const char *clientId); -bool pcscNaClHandleMessage(const pp::Var &message); - -#endif -#endif Index: pcsc/pcsc_nacl_init.cc ================================================================== --- pcsc/pcsc_nacl_init.cc +++ pcsc/pcsc_nacl_init.cc @@ -1,43 +1,19 @@ #include #include - -#include - -#include "pcsc_nacl_global.h" -#include "dom_requests_manager.h" -#include "pcsc_nacl.h" - -static DomRequestsManager *pcscNaClDRM = NULL; +#include "global.h" + +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; - - 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; + 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(pcscNaClDRM->HandleMessage(message)); + return(tmr.OnMessageReceived(message)); }