• Toni Barzic's avatar
    Call CrOSComponentManager::Load callback on main thread · b8c04f45
    Toni Barzic authored
    Most of the callers to CrOSComponentManager::Load expect the
    callback to be called on the UI thread (the same as the thread from
    which the method was called)- the only exception
    is CrostiniManager, which does not assume the callback is called
    on the UI thread, but still just relays the callback result back to
    UI thread.
    
    Currently, callbacks are run using base::PostTask, which post the
    callback to the task runner. To make the behavior of the method match
    the expectations, use ThreadTaskRunnerHandle::Get to get the current
    task runner, and use it to asynchronously run the callback.
    
    Bug: None
    Change-Id: I9f365a11ba2634154488c580615ceede59e2a9d3
    Reviewed-on: https://chromium-review.googlesource.com/1163071
    Commit-Queue: Toni Barzic <tbarzic@chromium.org>
    Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
    Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#580903}
    b8c04f45
crostini_manager.h 20.1 KB