* @param {!Window} win
(win)
| 100 | * @param {!Window} win |
| 101 | */ |
| 102 | constructor(win) { |
| 103 | /** @const {!Window} */ |
| 104 | this.win = win; |
| 105 | |
| 106 | /** @const {string} */ |
| 107 | this.eventid_ = base64UrlEncodeFromBytes( |
| 108 | getCryptoRandomBytesArray(win, 16) |
| 109 | ); |
| 110 | |
| 111 | /** @const @private {!Array<TickEventDef>} */ |
| 112 | this.events_ = []; |
| 113 | |
| 114 | /** @const @private {number} */ |
| 115 | this.timeOrigin_ = |
| 116 | win.performance.timeOrigin || win.performance.timing.navigationStart; |
| 117 | |
| 118 | /** @private {?./ampdoc-impl.AmpDoc} */ |
| 119 | this.ampdoc_ = null; |
| 120 | |
| 121 | /** @private {?./viewer-interface.ViewerInterface} */ |
| 122 | this.viewer_ = null; |
| 123 | |
| 124 | /** @private {?./resources-interface.ResourcesInterface} */ |
| 125 | this.resources_ = null; |
| 126 | |
| 127 | /** @private {?./document-info-impl.DocumentInfoDef} */ |
| 128 | this.documentInfo_ = null; |
| 129 | |
| 130 | /** @private {boolean} */ |
| 131 | this.isMessagingReady_ = false; |
| 132 | |
| 133 | /** @private {boolean} */ |
| 134 | this.isPerformanceTrackingOn_ = false; |
| 135 | |
| 136 | /** @private {!{[key: string]: boolean}} */ |
| 137 | this.enabledExperiments_ = map(); |
| 138 | |
| 139 | /** @private {string|undefined} */ |
| 140 | this.ampexp_ = undefined; |
| 141 | |
| 142 | /** @private {Signals} */ |
| 143 | this.metrics_ = new Signals(); |
| 144 | |
| 145 | /** |
| 146 | * How many times a layout shift metric has been ticked. |
| 147 | * |
| 148 | * @private {number} |
| 149 | */ |
| 150 | this.shiftScoresTicked_ = 0; |
| 151 | |
| 152 | /** |
| 153 | * The collection of layout shift events from the Layout Instability API, |
| 154 | * used for normalized windowed sessions according to the latest CWV |
| 155 | * implementation. This uses 5s max window with a 1s session gap as the |
| 156 | * session size. |
| 157 | * See https://github.com/GoogleChrome/web-vitals/blob/main/src/getCLS.ts |
| 158 | * @private {Array<LayoutShift>} |
| 159 | */ |
nothing calls this directly
no test coverage detected