• Rayan Kanso's avatar
    [Background Fetch] Lazily initialize download service used by the delegate. · 7c2fdfb8
    Rayan Kanso authored
    If the storage partitions are not fully initialized, the delegate factory
    will enter an infinite loop when trying to create an instance of
    BackgroundFetchDelegateImpl.
    
    This changes moves the service initialization logic from the constructor
    to a lazy accessor function, which is guaranteed to be called after the IO
    thread is up and running. This means all Storage Partitions will have
    been loaded.
    
    This behavior can be triggered when creating a
    BackgroundFetchDelegateImpl in incognito mode.
    
    Bug: 766082
    Change-Id: I320e146634792e16a61514620639ece38b022349
    Reviewed-on: https://chromium-review.googlesource.com/1167842
    Commit-Queue: Rayan Kanso <rayankans@chromium.org>
    Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#582133}
    7c2fdfb8
background_fetch_delegate_impl.h 6.52 KB