extensions/amp-analytics/0.1/iframe-transport.js
/**
   * Called when a creative no longer needs its cross-domain iframe (for
   * instance, because the creative has been removed from the DOM).
   * Once all creatives using a frame are done with it, the frame can be
   * destroyed.
   * @param {!HTMLDocument} ampDoc The AMP document
   * @param {!string} type The type attribute of the amp-analytics tag
   */
Called when a creative no longer needs its cross-domain iframe (for
instance, because the creative has been removed from the DOM).
Once all creatives using a frame are done with it, the frame can be
destroyed.
@param {!HTMLDocument} ampDoc The AMP document
@param {!string} type The type attribute of the amp-analytics tag
Called when a creative no longer needs its cross - domain iframe ( for instance because the creative has been removed from the DOM ) . Once all creatives using a frame are done with it the frame can be destroyed . @param { !HTMLDocument } ampDoc The AMP document @param { !string } type The type attribute of the amp - analytics tag
static markCrossDomainIframeAsDone(ampDoc, type) {
    const frameData = IframeTransport.getFrameData(type);
    dev().assert(frameData && frameData.frame && frameData.usageCount,
        'Marked the ' + type + ' frame as done, but there is no' +
        ' record of it existing.');
    if (--(frameData.usageCount)) {
      return;
    }
    ampDoc.body.removeChild(frameData.frame);
    delete IframeTransport.crossDomainIframes_[type];
  }
static markCrossDomainIframeAsDone ( ampDoc , type ) { const frameData = IframeTransport . getFrameData ( type ) ; dev ( ) . assert ( frameData && frameData . frame && frameData . usageCount , 'Marked the ' + type + ' frame as done, but there is no' + ' record of it existing.' ) ; if ( -- ( frameData . usageCount ) ) { return ; } ampDoc . body . removeChild ( frameData . frame ) ; delete IframeTransport . crossDomainIframes_ [ type ] ; }
Called when a creative no longer needs its cross-domain iframe (for
 instance, because the creative has been removed from the DOM).
Called when a creative no longer needs its cross - domain iframe ( for instance because the creative has been removed from the DOM ) .
// Some other instance is still using it