• Solly Ross's avatar
    Use Typed Arrays for the Websock receive queue · 38781d93
    Solly Ross authored
    **This commit removes Base64 (and Flash) support**
    
    This commit converts websock.js to used Typed Arrays for the
    receive queue (and tweaks rfb.js to ensure that it continues
    to function, since only Firefox implements
    `%TypedArray%.prototype.slice`).  Base64 support was removed
    to simplify code paths, and pave the way for using Typed Arrays
    for the send queue as well.
    
    This provides two advantages: first, we allocate a buffer ahead
    of time, meaning the browser doesn't have to do any work dynamically
    increasing the receive queue size.  Secondly, we are now able to pass
    around Typed Array Views (e.g. `Uint8Array`), which are lightweight, and
    don't involve copying.
    
    The downside is that we initially allocate more memory -- we currently
    start out with 4 MiB, and then automatically double when it looks like
    the amount unused is getting to small.
    
    The commit also explicitly adds a check to the compacting logic that
    avoids calling the copy functions if `_rQlen === _rQi`.
    38781d93
Name
Last commit
Last update
..
arrays.html Loading commit data...
arrays.js Loading commit data...
assertions.js Loading commit data...
base64.html Loading commit data...
base64.js Loading commit data...
browser.js Loading commit data...
canvas.html Loading commit data...
cursor.html Loading commit data...
face.png Loading commit data...
face.png.js Loading commit data...
fake.websocket.js Loading commit data...
input.html Loading commit data...
keyboard-tests.html Loading commit data...
run_from_console.casper.js Loading commit data...
run_from_console.js Loading commit data...
run_from_console.zombie.js Loading commit data...
stats.js Loading commit data...
test.base64.js Loading commit data...
test.display.js Loading commit data...
test.helper.js Loading commit data...
test.keyboard.js Loading commit data...
test.rfb.js Loading commit data...
test.util.js Loading commit data...
test.websock.js Loading commit data...
viewport.css Loading commit data...
viewport.html Loading commit data...
vnc_perf.html Loading commit data...
vnc_playback.html Loading commit data...