MCPcopy
hub / github.com/ampproject/amphtml / constructor

Method constructor

third_party/subscriptions-project/swg.js:7740–7814  ·  view source on GitHub ↗

* @param {!./deps.DepsDef} deps * @param {!./fetcher.Fetcher} fetcher

(deps, fetcher)

Source from the content-addressed store, hash-verified

7738 * @param {!./fetcher.Fetcher} fetcher
7739 */
7740 constructor(deps, fetcher) {
7741 /** @private @const {!./fetcher.Fetcher} */
7742 this.fetcher_ = fetcher;
7743
7744 /** @private @const {!../model/doc.Doc} */
7745 this.doc_ = deps.doc();
7746
7747 /** @private @const {!./deps.DepsDef} */
7748 this.deps_ = deps;
7749
7750 /** @private @const {!../components/activities.ActivityPorts} */
7751 this.activityPorts_ = deps.activities();
7752
7753 /** @private @const {!HTMLIFrameElement} */
7754 this.iframe_ = /** @type {!HTMLIFrameElement} */ (
7755 createElement(this.doc_.getWin().document, 'iframe', {})
7756 );
7757 setImportantStyles$1(this.iframe_, iframeStyles);
7758 this.doc_.getBody().appendChild(this.getElement());
7759
7760 /** @private @type {!boolean} */
7761 this.everFinishedLog_ = false;
7762
7763 /**
7764 * @private @const {!AnalyticsContext}
7765 */
7766 this.context_ = new AnalyticsContext();
7767 this.setStaticContext_();
7768
7769 /** @private {?Promise<!web-activities/activity-ports.ActivityIframePort>} */
7770 this.serviceReady_ = null;
7771
7772 /** @private {?Promise} */
7773 this.lastAction_ = null;
7774
7775 /** @private @const {!ClientEventManager} */
7776 this.eventManager_ = deps.eventManager();
7777 this.eventManager_.registerEventListener(
7778 this.handleClientEvent_.bind(this)
7779 );
7780
7781 // This code creates a 'promise to log' that we can use to ensure all
7782 // logging is finished prior to redirecting the page.
7783 /** @private {!number} */
7784 this.unfinishedLogs_ = 0;
7785
7786 /** @private {?function(boolean)} */
7787 this.loggingResolver_ = null;
7788
7789 /** @private {?Promise} */
7790 this.promiseToLog_ = null;
7791
7792 // If logging doesn't work don't force the user to wait
7793 /** @private {!boolean} */
7794 this.loggingBroken_ = false;
7795
7796 // If logging exceeds the timeouts (see const comments above) don't make
7797 // the user wait too long.

Callers

nothing calls this directly

Calls 12

getElementMethod · 0.95
setStaticContext_Method · 0.95
setImportantStyles$1Function · 0.85
toTimestampFunction · 0.85
docMethod · 0.80
activitiesMethod · 0.80
eventManagerMethod · 0.80
nowMethod · 0.80
createElementFunction · 0.70
getWinMethod · 0.45
getBodyMethod · 0.45
registerEventListenerMethod · 0.45

Tested by

no test coverage detected