New issue
Advanced search Search tips

Issue 841834 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[Background Fetch] Cancelling fetch causes I/O thread to crash

Project Member Reported by na...@chromium.org, May 10 2018

Issue description

Cancelling a background fetch download from the UI currently causes the I/O thread to crash. I've root caused it and am sending a CL shortly.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e2462237dff97b4a89cb16bb87e5b7c48d07d8f

commit 7e2462237dff97b4a89cb16bb87e5b7c48d07d8f
Author: Mugdha Lakhani <nator@chromium.org>
Date: Wed May 16 08:14:40 2018

[Background Fetch] Fix I/O thread crash caused by cancelling the fetch from
the UI.

This happens because BackgroundFetchScheduler::Controller::Finish() gets called
twice when the user cancels the fetch from the UI, and tries to invoke the
finished_callback_ twice. This causes a crash because finished_callback_
is a OnceCallback.

During its first invokation however, this callback gets invalidated
so that it can't be called again. This change fixes the double call to
Finish() and also gets rid of some code duplication.

Bug:  841834 
Change-Id: If8f3e6a271d9ae584577c9b9a96fd264e7be5ffd
Reviewed-on: https://chromium-review.googlesource.com/1053968
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559012}
[modify] https://crrev.com/7e2462237dff97b4a89cb16bb87e5b7c48d07d8f/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
[modify] https://crrev.com/7e2462237dff97b4a89cb16bb87e5b7c48d07d8f/content/browser/background_fetch/background_fetch_job_controller.cc
[modify] https://crrev.com/7e2462237dff97b4a89cb16bb87e5b7c48d07d8f/content/browser/background_fetch/background_fetch_scheduler.cc

Comment 2 by na...@chromium.org, May 16 2018

Status: Fixed (was: Assigned)

Sign in to add a comment