Check-in [789f3b2324]
Overview
Comment:ChromeOS: Improved cleanup after crash
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 789f3b2324c924bac9754e7498f4f6287b754ab9
User & Date: rkeene on 2016-02-28 21:22:59
Other Links: manifest | tags
Context
2016-02-28
22:12
ChromeOS: Delayed PCSC initialization even further until we receieved positive confirmation that initialization completed check-in: bdb2e8cfb1 user: rkeene tags: trunk
21:22
ChromeOS: Improved cleanup after crash check-in: 789f3b2324 user: rkeene tags: trunk
21:18
ChromeOS: Made JavaScript talking to PCSC more robust check-in: 455296a053 user: rkeene tags: trunk
Changes

Modified build/chrome/cackey.js from [84d3b8d4ee] to [76d1838f47].

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50







-
+







 * Stored PIN for a given certificate
 */
var cackeyCertificateToPINMap = {};

/*
 * Callbacks to perform after PCSC comes online
 */
cackeyCallbackAfterInit = []
cackeyCallbackAfterInit = [];

/*
 * Compute a text-based handle for a certificate to be hashed by
 */
function cackeyCertificateToPINID(certificate) {
	var id;
	var certificateArray;
462
463
464
465
466
467
468




469
470
471
472










473
474
475
476
477

478
479
480
481
482
483
484
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490

491
492
493
494
495
496
497
498







+
+
+
+




+
+
+
+
+
+
+
+
+
+




-
+







function cackeyRestart() {
	cackeyUninit();
	cackeyInit();

	return;
}

function cackeyInitGlobalState() {
	cackeyOutstandingCallbacks = {};
};

/*
 * Handle a CACKey crash (probably due to loss of connectivity to the PCSC daemon)
 */
function cackeyCrash() {
	/*
	 * De-initialize CACKey
	 */
	cackeyUninit();

	/*
	 * Reinitialize global state
	 */
	cackeyInitGlobalState();

	/*
	 * Schedule the restart to occur in 30 seconds in case we really are
	 * not working.
	 */
	setTimeout(cackeyRestart, 30000);
	setTimeout(cackeyInit, 30000);

	return;
}

function cackeyInitPCSCCompleted() {
	var idx;

679
680
681
682
683
684
685





686
687
688
689
690
691
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710







+
+
+
+
+






		oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]);

		cackeyInitPCSCCompleted();

		return;
	};

	/*
	 * Initialize global state
	 */
	cackeyInitGlobalState();

	return;
}

/* Initialize CACKey */
cackeyAppInit();
cackeyInit();