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

Method constructor

src/service/storage-impl.js:33–51  ·  view source on GitHub ↗

* @param {!./ampdoc-impl.AmpDoc} ampdoc * @param {!../service/viewer-interface.ViewerInterface} viewer * @param {!StorageBindingDef} binding

(ampdoc, viewer, binding)

Source from the content-addressed store, hash-verified

31 * @param {!StorageBindingDef} binding
32 */
33 constructor(ampdoc, viewer, binding) {
34 /** @const {!./ampdoc-impl.AmpDoc} */
35 this.ampdoc = ampdoc;
36
37 /** @private @const {!../service/viewer-interface.ViewerInterface} */
38 this.viewer_ = viewer;
39
40 /** @private @const {!StorageBindingDef} */
41 this.binding_ = binding;
42
43 /** @private @const {boolean} */
44 this.isViewerStorage_ = binding instanceof ViewerStorageBinding;
45
46 /** @const @private {string} */
47 this.origin_ = getSourceOrigin(this.ampdoc.win.location);
48
49 /** @private {?Promise<!Store>} */
50 this.storePromise_ = null;
51 }
52
53 /**
54 * @return {!Storage}

Callers

nothing calls this directly

Calls 1

getSourceOriginFunction · 0.90

Tested by

no test coverage detected