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

Method removeResource_

src/service/resources-impl.js:475–489  ·  view source on GitHub ↗

* @param {!Resource} resource * @private

(resource)

Source from the content-addressed store, hash-verified

473 * @private
474 */
475 removeResource_(resource) {
476 const index = this.resources_.indexOf(resource);
477 if (index != -1) {
478 this.resources_.splice(index, 1);
479 }
480 if (resource.isBuilt()) {
481 resource.pauseOnRemove();
482 }
483
484 if (resource.getState() === ResourceState_Enum.LAYOUT_SCHEDULED) {
485 resource.layoutCanceled();
486 }
487 this.cleanupTasks_(resource, /* opt_removePending */ true);
488 dev().fine(TAG_, 'resource removed:', resource.debugid);
489 }
490
491 /** @override */
492 upgraded(element) {

Callers 2

buildResourceUnsafe_Method · 0.95
removeMethod · 0.95

Calls 7

cleanupTasks_Method · 0.95
devFunction · 0.90
pauseOnRemoveMethod · 0.80
layoutCanceledMethod · 0.80
fineMethod · 0.80
isBuiltMethod · 0.45
getStateMethod · 0.45

Tested by

no test coverage detected