• Min Qin's avatar
    Fix a reentrance issue when showing file picker dialog · e8fcf79a
    Min Qin authored
    If we have multiple file picker dialogs, we queue the callbacks in a deque
    so that they will be handled sequentially. However, if one of the download
    is removed while enqueued, OnConfirmationCallbackComplete() call to
    ShowFilePicker() will cause an reentrance into OnConfirmationCallbackComplete().
    This CL fixes the issue by posing a task to call ShowFilePicker().
    Unit test is also added.
    
    BUG=904319
    
    Change-Id: I00d324a06977a173671a3405594371ccbdc4a5fc
    Reviewed-on: https://chromium-review.googlesource.com/c/1332776Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
    Commit-Queue: Min Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#608040}
    e8fcf79a
chrome_download_manager_delegate.h 11.7 KB