smart_card_connector_app/src/background.js
/**
 * Creates a PC/SC-Lite client handler for the specified message channel and the
 * client extension.
 * The clientOrigin argument equal to undefined denotes the case when the sender
 * is our own extension/app.
 * @param {!goog.messaging.AbstractChannel} clientMessageChannel
 * @param {string|undefined} clientOrigin
 */
Creates a PC/SC-Lite client handler for the specified message channel and the
client extension.
The clientOrigin argument equal to undefined denotes the case when the sender
is our own extension/app.
Creates a PC / SC - Lite client handler for the specified message channel and the client extension . The clientOrigin argument equal to undefined denotes the case when the sender is our own extension / app .
function createClientHandler(clientMessageChannel, clientOrigin) {
  GSC.Logging.checkWithLogger(logger, !clientMessageChannel.isDisposed());
  const clientOriginForLog =
      clientOrigin !== undefined ? clientOrigin : 'ourselves';
  if (executableModule.isDisposed() ||
      executableModule.getMessageChannel().isDisposed()) {
    goog.log.warning(
        logger,
        'Could not create PC/SC-Lite client handler for ' + clientOriginForLog +
            ' as the server is disposed. Disposing of the client message ' +
            'channel...');
    clientMessageChannel.dispose();
    return;
  }
  const clientHandler = new GSC.PcscLiteServerClientsManagement.ClientHandler(
      executableModule.getMessageChannel(), pcscLiteReadinessTracker,
      clientMessageChannel, clientOrigin);
  const logMessage = 'Created a new PC/SC-Lite client handler for ' +
      clientOriginForLog + ' (handler id ' + clientHandler.id + ')';
  if (clientOrigin !== undefined)
    goog.log.info(logger, logMessage);
  else
    goog.log.fine(logger, logMessage);
}
function createClientHandler ( clientMessageChannel , clientOrigin ) { GSC . Logging . checkWithLogger ( logger , ! clientMessageChannel . isDisposed ( ) ) ; const clientOriginForLog = clientOrigin !== undefined ? clientOrigin : 'ourselves' ; if ( executableModule . isDisposed ( ) || executableModule . getMessageChannel ( ) . isDisposed ( ) ) { goog . log . warning ( logger , 'Could not create PC/SC-Lite client handler for ' + clientOriginForLog + ' as the server is disposed. Disposing of the client message ' + 'channel...' ) ; clientMessageChannel . dispose ( ) ; return ; } const clientHandler = new GSC . PcscLiteServerClientsManagement . ClientHandler ( executableModule . getMessageChannel ( ) , pcscLiteReadinessTracker , clientMessageChannel , clientOrigin ) ; const logMessage = 'Created a new PC/SC-Lite client handler for ' + clientOriginForLog + ' (handler id ' + clientHandler . id + ')' ; if ( clientOrigin !== undefined ) goog . log . info ( logger , logMessage ) ; else goog . log . fine ( logger , logMessage ) ; }
Creates a PC/SC-Lite client handler for the specified message channel and the
 client extension.
Creates a PC / SC - Lite client handler for the specified message channel and the client extension .
// Note: the reference to the created client handler is not stored anywhere, // because it manages its lifetime itself, based on the lifetimes of the // passed message channels.