Skip to content
  • Dan Elphick's avatar
    Allow cancellation of Background fetches · 771998f4
    Dan Elphick authored
    Extend all BackgroundFetchDelegate::Client methods to take job_unique_id
    as well as download_guid in order to identify to quickly identify the
    job that the download belongs to. Further, BackgroundFetchDelegateProxy
    now does a two stage lookup to find a download using the job id and then
    the download id.
    
    Add OnJobCancelled to BackgroundFetchDelegate::Client, which is called
    in response to tapping Cancel in the Background Fetch download
    notification. This method cancels the entire job rather than just an
    individual download request within it. Ultimately this calls
    AbortFromUser on the JobController which then signals back to
    Javascript.
    
    BackgroundFetchDelegateImpl now updates the notification after Abort()
    to mark it cancelled. It is also now more resilient to calls from the
    DownloadService about GUIDs that it doesn't know about. In all cases it
    just drops them on the floor since it no longer has any state for them.
    This mostly happens because BackgroundFetch is not yet persisting state
    between browser restarts and so this will be not be a problem in the
    future.
    
    Bug: 758562
    Change-Id: I8c7c70da6bf91d9b0580ec2bf8614ccc4e208da3
    Reviewed-on: https://chromium-review.googlesource.com/731084
    
    
    Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Commit-Queue: Peter Beverloo <peter@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#512300}
    771998f4