• Peter Beverloo's avatar
    Move Background Fetch registration creation to the Data Manager observer · 87886930
    Peter Beverloo authored
    When a Background Fetch registration is created, a BGFetchJobContoller
    is created immediately after committing it to storage even if the job
    can't be started just yet -- this should be the scheduler's decision.
    
    This CL is the first step in removing the assumption that each existing
    Background Fetch registration is represented by a BGFetchJobController.
    Acknowledging creation of the registration is separated from indicating
    that a new registration is available, by adding an OnRegistrationCreated
    method to the BackgroundFetchDataManagerObserver.
    
    As part of this refactoring, in an effort to avoid passing around unique
    pointers to BackgroundFetchRegistration objects, these are now passed by
    const& where the receiver makes a copy when necessary. This enabled
    reducing knowledge of the protobufs throughout our system, which is a
    nice clean-up on its own.
    
    TBR=avi for BUILD.gn
    
    Bug: 850512
    Change-Id: I8d3c42a11ab89f7b7c3573a6f9a21e096493b838
    Reviewed-on: https://chromium-review.googlesource.com/1149871
    Commit-Queue: Peter Beverloo <peter@chromium.org>
    Reviewed-by: default avatarMugdha Lakhani <nator@chromium.org>
    Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#577903}
    87886930
background_fetch_context.h 12.7 KB