MCPcopy Index your code
hub / github.com/ampproject/amphtml / saveStore_

Method saveStore_

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

* @param {function(!Store)} mutator * @return {!Promise} * @private

(mutator)

Source from the content-addressed store, hash-verified

138 * @private
139 */
140 saveStore_(mutator) {
141 return this.getStore_()
142 .then((store) => {
143 mutator(store);
144 // Need to encode stored object to avoid plain text,
145 // but doesn't need to be base64encode. Can convert to some other
146 // encoding method for further improvement.
147 const blob = btoa(JSON.stringify(store.obj));
148 return this.binding_.saveBlob(this.origin_, blob);
149 })
150 .then(this.broadcastReset_.bind(this));
151 }
152
153 /** @private */
154 listenToBroadcasts_() {

Callers 2

setNonBooleanMethod · 0.95
removeMethod · 0.95

Calls 4

getStore_Method · 0.95
stringifyMethod · 0.80
thenMethod · 0.45
saveBlobMethod · 0.45

Tested by

no test coverage detected