MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / fetchCacheData

Function fetchCacheData

src/Fetch.js:439–448  ·  view source on GitHub ↗
(/** @type {IDBDatabase} */ db, fetch, data, onsuccess, onerror)

Source from the content-addressed store, hash-verified

437}
438
439function fetchCacheData(/** @type {IDBDatabase} */ db, fetch, data, onsuccess, onerror) {
440 if (!db) {
441#if FETCH_DEBUG
442 dbg('fetch: IndexedDB not available!');
443#endif
444 onerror(fetch, 0, 'IndexedDB not available!');
445 return;
446 }
447
448 var fetch_attr = fetch + {{{ C_STRUCTS.emscripten_fetch_t.__attributes }}};
449 var destinationPath = {{{ makeGetValue('fetch_attr', C_STRUCTS.emscripten_fetch_attr_t.destinationPath, '*') }}};
450 destinationPath ||= {{{ makeGetValue('fetch', C_STRUCTS.emscripten_fetch_t.url, '*') }}};
451 var destinationPathStr = UTF8ToString(destinationPath);

Callers 2

Fetch.jsFile · 0.85

Calls 2

dbgFunction · 0.50
onerrorFunction · 0.50

Tested by

no test coverage detected