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

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

    36     36    * Stored PIN for a given certificate
    37     37    */
    38     38   var cackeyCertificateToPINMap = {};
    39     39   
    40     40   /*
    41     41    * Callbacks to perform after PCSC comes online
    42     42    */
    43         -cackeyCallbackAfterInit = []
           43  +cackeyCallbackAfterInit = [];
    44     44   
    45     45   /*
    46     46    * Compute a text-based handle for a certificate to be hashed by
    47     47    */
    48     48   function cackeyCertificateToPINID(certificate) {
    49     49   	var id;
    50     50   	var certificateArray;
................................................................................
   462    462   function cackeyRestart() {
   463    463   	cackeyUninit();
   464    464   	cackeyInit();
   465    465   
   466    466   	return;
   467    467   }
   468    468   
          469  +function cackeyInitGlobalState() {
          470  +	cackeyOutstandingCallbacks = {};
          471  +};
          472  +
   469    473   /*
   470    474    * Handle a CACKey crash (probably due to loss of connectivity to the PCSC daemon)
   471    475    */
   472    476   function cackeyCrash() {
          477  +	/*
          478  +	 * De-initialize CACKey
          479  +	 */
          480  +	cackeyUninit();
          481  +
          482  +	/*
          483  +	 * Reinitialize global state
          484  +	 */
          485  +	cackeyInitGlobalState();
          486  +
   473    487   	/*
   474    488   	 * Schedule the restart to occur in 30 seconds in case we really are
   475    489   	 * not working.
   476    490   	 */
   477         -	setTimeout(cackeyRestart, 30000);
          491  +	setTimeout(cackeyInit, 30000);
   478    492   
   479    493   	return;
   480    494   }
   481    495   
   482    496   function cackeyInitPCSCCompleted() {
   483    497   	var idx;
   484    498   
................................................................................
   679    693   		oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]);
   680    694   
   681    695   		cackeyInitPCSCCompleted();
   682    696   
   683    697   		return;
   684    698   	};
   685    699   
          700  +	/*
          701  +	 * Initialize global state
          702  +	 */
          703  +	cackeyInitGlobalState();
          704  +
   686    705   	return;
   687    706   }
   688    707   
   689    708   /* Initialize CACKey */
   690    709   cackeyAppInit();
   691    710   cackeyInit();