MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

src/service/cid-impl.js:138–172  ·  view source on GitHub ↗

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

(ampdoc)

Source from the content-addressed store, hash-verified

136class Cid {
137 /** @param {!./ampdoc-impl.AmpDoc} ampdoc */
138 constructor(ampdoc) {
139 /** @const */
140 this.ampdoc = ampdoc;
141
142 /**
143 * Cached base cid once read from storage to avoid repeated
144 * reads.
145 * @private {?Promise<string>}
146 * @restricted
147 */
148 this.baseCid_ = null;
149
150 /**
151 * Cache to store external cids. Scope is used as the key and cookie value
152 * is the value.
153 * @private {!{[key: string]: !Promise<string>}}
154 * @restricted
155 */
156 this.externalCidCache_ = Object.create(null);
157
158 /**
159 * @private @const {!CacheCidApi}
160 */
161 this.cacheCidApi_ = new CacheCidApi(ampdoc);
162
163 /**
164 * @private {!ViewerCidApi}
165 */
166 this.viewerCidApi_ = new ViewerCidApi(ampdoc);
167
168 this.cidApi_ = new GoogleCidApi(ampdoc);
169
170 /** @private {?{[key: string]: string}} */
171 this.apiKeyMap_ = null;
172 }
173
174 /** @override */
175 get(getCidStruct, consent, opt_persistenceConsent) {

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected