third_party/subscriptions-project/swg.js
/**
   * This function is called by the iframe after it sends the log to the server.
   * @param {../proto/api_messages.Message=} message
   */
This function is called by the iframe after it sends the log to the server.
This function is called by the iframe after it sends the log to the server .
afterLogging_(message) {
    const response =  (message);
    const success = (response && response.getComplete()) || false;
    const error = (response && response.getError()) || 'Unknown logging Error';
    const isTimeout = error === TIMEOUT_ERROR;
    if (!success) {
      log('Error when logging: ' + error);
    }
    this.unfinishedLogs_--;
    if (!isTimeout) {
      this.everFinishedLog_ = true;
    }
    if (this.loggingResolver_ === null) {
      return;
    }
    if (this.unfinishedLogs_ === 0 || this.loggingBroken_ || isTimeout) {
      if (this.timeout_ !== null) {
        clearTimeout(this.timeout_);
        this.timeout_ = null;
      }
      this.loggingResolver_(success);
      this.promiseToLog_ = null;
      this.loggingResolver_ = null;
    }
  }
afterLogging_ ( message ) { const response = ( message ) ; const success = ( response && response . getComplete ( ) ) || false ; const error = ( response && response . getError ( ) ) || 'Unknown logging Error' ; const isTimeout = error === TIMEOUT_ERROR ; if ( ! success ) { log ( 'Error when logging: ' + error ) ; } this . unfinishedLogs_ -- ; if ( ! isTimeout ) { this . everFinishedLog_ = true ; } if ( this . loggingResolver_ === null ) { return ; } if ( this . unfinishedLogs_ === 0 || this . loggingBroken_ || isTimeout ) { if ( this . timeout_ !== null ) { clearTimeout ( this . timeout_ ) ; this . timeout_ = null ; } this . loggingResolver_ ( success ) ; this . promiseToLog_ = null ; this . loggingResolver_ = null ; } }
This function is called by the iframe after it sends the log to the server.
This function is called by the iframe after it sends the log to the server .
/** @type {!FinishedLoggingResponse} */ // Nothing is waiting