• David Staessens's avatar
    media/gpu/test: Fix potential thread-safety issues in video decoder tests. · 6c512635
    David Staessens authored
    This CL fixes some thread-safety issues in our video decoder tests. These might
    be responsible for some rare crashes we've been seeing when running the tests on
    our test infrastructure, but are not reproducible locally.
    
    Most callbacks will be triggered on the same thread that scheduled these, but
    this is not always the case. However WeakPtrs are not thread-safe, so this CL
    introduces functors that guarantee that WeakPtrs are only dereferenced on the
    thread that created them.
    
    This CL also adds an additional sequence check to make sure events are sent on
    the correct thread, and a comment is added about the use of base::Unretained for
    the video player event callback.
    
    TEST=./video_decode_accelerator_tests on samus
    
    BUG=981718
    
    Change-Id: If04268953f9be5dabc4ec11759fb3223f45055cd
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1843998
    Commit-Queue: David Staessens <dstaessens@chromium.org>
    Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#704467}
    6c512635
video_player.cc 7.37 KB