• Toni Barzic's avatar
    Skip update if a component is found during registration · 8504f674
    Toni Barzic authored
    Update CrOSComponentManager to handle the case when an installed
    compatible component is found during component registration started by
    CrOSComponentManager::Load.
    
    Previously, CrOSComponentManager would start OnDemandUpdate whenever no
    compatible component path was registered when Load() was called - this
    did not account for cases where Load was called early on, before
    registration of installed components finished. This means that
    CrOSComponentManager could end up starting foreground on demand update
    even if a compatible version of component was already installed.
    
    This CL moves decision whether an update should be requested later on -
    after the component registration was done. Update will be run if it's
    forced, or if there is no compatible component version after component
    registration finishes (which should check for any installed components).
    
    Note - this also moves ComponentInstaller::Register callback after
    OnComponentReady is called, to ensure that any potential compatible
    component path is registered before CrOSComponentManager::StartInstall
    is called. (This is more in line with order OnComponentReady and the
    callback are invoked during Install request, and no other callers seem
    to depend on this ordering).
    
    BUG=872871
    
    Change-Id: I33ff01b5d127d17cd9016b012fc400562c03d9c1
    Reviewed-on: https://chromium-review.googlesource.com/1170172Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
    Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#582230}
    8504f674
cros_component_installer_chromeos.cc 15 KB