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

Method constructor

src/service/viewer-impl.js:72–267  ·  view source on GitHub ↗

* @param {!./ampdoc-impl.AmpDoc} ampdoc

(ampdoc)

Source from the content-addressed store, hash-verified

70 * @param {!./ampdoc-impl.AmpDoc} ampdoc
71 */
72 constructor(ampdoc) {
73 /** @const {!./ampdoc-impl.AmpDoc} */
74 this.ampdoc = ampdoc;
75
76 /** @const {!Window} */
77 this.win = ampdoc.win;
78
79 /** @private @const {boolean} */
80 this.isIframed_ = isIframed(this.win);
81
82 /** @private {boolean} */
83 this.isRuntimeOn_ = true;
84
85 /** @private {boolean} */
86 this.overtakeHistory_ = false;
87
88 /** @private {!{[key: string]: !Observable<!JsonObject>}} */
89 this.messageObservables_ = map();
90
91 /** @private {!{[key: string]: !./viewer-interface.RequestResponderDef}} */
92 this.messageResponders_ = map();
93
94 /** @private {!Observable<boolean>} */
95 this.runtimeOnObservable_ = new Observable();
96
97 /** @private {!Observable<!JsonObject>} */
98 this.broadcastObservable_ = new Observable();
99
100 /**
101 * @private {?function(string, (?JsonObject|string|undefined), boolean):
102 * (Promise<*>|undefined)}
103 */
104 this.messageDeliverer_ = null;
105
106 /** @private {?string} */
107 this.messagingOrigin_ = null;
108
109 /**
110 * @private {!Array<!{
111 * eventType: string,
112 * data: (?JsonObject|string|undefined),
113 * awaitResponse: boolean,
114 * responsePromise: (Promise<*>|undefined),
115 * responseResolver: function(*)
116 * }>}
117 */
118 this.messageQueue_ = [];
119
120 /**
121 * @private {!Object<string, !Array<!{
122 * data: !JsonObject,
123 * deferred: !Deferred
124 * }>>}
125 */
126 this.receivedMessageQueue_ = map();
127
128 /**
129 * Subset of this.params_ that only contains parameters in the URL hash,

Callers

nothing calls this directly

Calls 15

initMessagingChannel_Method · 0.95
isEmbeddedMethod · 0.95
isTrustedViewerMethod · 0.95
visibleOnUserAction_Method · 0.95
isIframedFunction · 0.90
mapFunction · 0.90
parseQueryStringFunction · 0.90
devFunction · 0.90
isProxyOriginFunction · 0.90
parseUrlDeprecatedFunction · 0.90

Tested by

no test coverage detected