extensions/amp-analytics/0.1/iframe-transport-message-queue.js
/**
   * Enqueues an event to be sent to a cross-domain iframe.
   * @param {!IframeTransportEventDef} event
   * Identifies the event and which Transport instance (essentially which
   * creative) is sending it.
   */
Enqueues an event to be sent to a cross-domain iframe.
@param {!IframeTransportEventDef} event
Identifies the event and which Transport instance (essentially which
creative) is sending it.
Enqueues an event to be sent to a cross - domain iframe . @param { !IframeTransportEventDef } event Identifies the event and which Transport instance ( essentially which creative ) is sending it .
enqueue(event) {
    devAssert(
      event && event.creativeId && event.message,
      'Attempted to enqueue malformed message for: ' + event.creativeId
    );
    this.pendingEvents_.push(event);
    if (this.queueSize() >= MAX_QUEUE_SIZE_) {
      dev().warn(
        TAG_,
        'Exceeded maximum size of queue for: ' + event.creativeId
      );
      this.pendingEvents_.shift();
    }
    this.flushQueue_();
  }
enqueue ( event ) { devAssert ( event && event . creativeId && event . message , 'Attempted to enqueue malformed message for: ' + event . creativeId ) ; this . pendingEvents_ . push ( event ) ; if ( this . queueSize ( ) >= MAX_QUEUE_SIZE_ ) { dev ( ) . warn ( TAG_ , 'Exceeded maximum size of queue for: ' + event . creativeId ) ; this . pendingEvents_ . shift ( ) ; } this . flushQueue_ ( ) ; }
Enqueues an event to be sent to a cross-domain iframe.
Enqueues an event to be sent to a cross - domain iframe .