bootup.js
/**
     * Begins downloading the file in the path, if there is a free slot. If there isn't, then
     * the file is added to the queue to be processed later.
     * @private
     * @param path the file path to download.
     */
Begins downloading the file in the path, if there is a free slot. If there isn't, then
the file is added to the queue to be processed later.
@private
@param path the file path to download.
Begins downloading the file in the path if there is a free slot . If there isn ' t then the file is added to the queue to be processed later . @private @param path the file path to download .
function downloadFile(path) {
        if (threads >= maxThreads) {
            addToNextQueue(path);
            return;
        }
        if (hasFailed) {
            return;
        }
        var precache = fromCache(path);
        if (precache) {
            initiateFileFromCache(precache);
            return;
        }
        threads++;
        var request = getRequest();
        request.onreadystatechange = function () {
            if (hasFailed) {
                return;
            }
            if (request.readyState == 4 && request.status == 200) {
                processResponse(path, request);
            }else if (request.readyState == 4 && request.status > 400 && request.status < 600) {
                processFailure(request, path);
            }
        };
        request.open("GET", path, true);
        request.send(null);
    }
function downloadFile ( path ) { if ( threads >= maxThreads ) { addToNextQueue ( path ) ; return ; } if ( hasFailed ) { return ; } var precache = fromCache ( path ) ; if ( precache ) { initiateFileFromCache ( precache ) ; return ; } threads ++ ; var request = getRequest ( ) ; request . onreadystatechange = function ( ) { if ( hasFailed ) { return ; } if ( request . readyState == 4 && request . status == 200 ) { processResponse ( path , request ) ; } else if ( request . readyState == 4 && request . status > 400 && request . status < 600 ) { processFailure ( request , path ) ; } } ; request . open ( "GET" , path , true ) ; request . send ( null ) ; }
Begins downloading the file in the path, if there is a free slot.
Begins downloading the file in the path if there is a free slot .
// wait until there is room left in the queue
 // if we have failed, don't bother
 // get the file from the cache, and return if already present
 // handle state loading
 // if we have failed, don't bother
