MCPcopy Create free account
hub / github.com/GoogleChrome/samples / processData

Function processData

mkbitmap/mkbitmap.js:3302–3318  ·  view source on GitHub ↗
(byteArray)

Source from the content-addressed store, hash-verified

3300 var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent;
3301 var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
3302 function processData(byteArray) {
3303 function finish(byteArray) {
3304 if (preFinish) preFinish();
3305 if (!dontCreateFile) {
3306 FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
3307 }
3308 if (onload) onload();
3309 removeRunDependency(dep);
3310 }
3311 if (Browser.handledByPreloadPlugin(byteArray, fullname, finish, () => {
3312 if (onerror) onerror();
3313 removeRunDependency(dep);
3314 })) {
3315 return;
3316 }
3317 finish(byteArray);
3318 }
3319 addRunDependency(dep);
3320 if (typeof url == 'string') {
3321 asyncLoad(url, (byteArray) => processData(byteArray), onerror);

Callers 1

mkbitmap.jsFile · 0.70

Calls 2

removeRunDependencyFunction · 0.70
finishFunction · 0.70

Tested by

no test coverage detected