• Ken Rockot's avatar
    Speculative fix for bad SerialConnection behavior · 9aa77988
    Ken Rockot authored
    If a SerialConnection consumer calls StartPolling() and then eventually
    SetPaused(true), they should reasonably be able to assume that the
    callback given to StartPolling() will no longer fire.
    
    This changes SerialConnection::SetPaused() to ensure that any pending
    timeout task is cancelled when pausing, satisfying the above assumption
    where it was not previously satisfied.
    
    This should fix a memory bug in ViscaWebcam which has been causing
    crashes on Chrome OS.
    
    Fixed: 1028819
    Change-Id: I54c233fbc90fc2996d624548326ccda624fc9383
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1974732Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Commit-Queue: Ken Rockot <rockot@google.com>
    Cr-Commit-Position: refs/heads/master@{#726271}
    9aa77988
serial_connection.cc 22.1 KB