src/chunk.js
/**
   * Schedule running the next queued task.
   * @private
   */
Schedule running the next queued task.
@private
Schedule running the next queued task . @private
schedule_() {
    const nextTask = this.nextTask_();
    if (!nextTask) {
      return;
    }
    if (nextTask.immediateTriggerCondition_()) {
      this.executeAsap_( null);
      return;
    }
    if (nextTask.useRequestIdleCallback_() && this.win_.requestIdleCallback) {
      onIdle(this.win_,
          15 ,
          2000 ,
          this.boundExecute_);
      return;
    }
    this.win_.postMessage('amp-macro-task', '*');
  }
schedule_ ( ) { const nextTask = this . nextTask_ ( ) ; if ( ! nextTask ) { return ; } if ( nextTask . immediateTriggerCondition_ ( ) ) { this . executeAsap_ ( null ) ; return ; } if ( nextTask . useRequestIdleCallback_ ( ) && this . win_ . requestIdleCallback ) { onIdle ( this . win_ , 15 , 2000 , this . boundExecute_ ) ; return ; } this . win_ . postMessage ( 'amp-macro-task' , '*' ) ; }
Schedule running the next queued task.
Schedule running the next queued task .
/* idleDeadline */ // If requestIdleCallback exists, schedule a task with it, but // do not wait longer than two seconds. // Wait until we have a budget of at least 15ms. // 15ms is a magic number. Budgets are higher when the user // is completely idle (around 40), but that occurs too // rarely to be usable. 15ms budgets can happen during scrolling // but only if the device is doing super, super well, and no // real processing is done between frames. /* minimumTimeRemaining */ /* timeout */ // The message doesn't actually matter. /*OK*/