• Adam Rice's avatar
    Update buffered amount when async callbacks are called · 6f7b2afb
    Adam Rice authored
    If an asynchronous callback is called, it means we must have returned to
    the start of the event loop. Ensure that any consumed bufferedAmount is
    reflected in that case. Do not reflect bufferedAmount if the EventQueue
    is paused, as that means that we may be in a nested event loop.
    
    Add a unit test for this case. Also add a unit test for normal
    bufferedAmount behaviour, as there wasn't one.
    
    Add a web platform test for what happens if a sync XHR is performed
    between calling send() and looking at bufferedAmount.
    
    BUG=856651
    
    Change-Id: Iafa2d619a1eb5284b64500ac03d336fb6380193b
    Reviewed-on: https://chromium-review.googlesource.com/1151086
    Commit-Queue: Adam Rice <ricea@chromium.org>
    Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#580078}
    6f7b2afb
dom_websocket.cc 29.8 KB