New issue
Advanced search Search tips

Issue 692579 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

BackgroundFetch should return fetch completed notifications to the service worker

Project Member Reported by harkness@chromium.org, Feb 15 2017

Issue description

When a service worker starts a BackgroundFetch, they receive a promise which will resolve as soon as the fetch metadata is saved in the BackgroundFetch system. 

In order to find out that a fetch has actually completed, the system will need to send an event to the service worker. It's possible that the service worker will need to be loaded into memory in order to deliver the event.

This event will need to communicate at least the tag for the fetch, the status of the fetch, and how to access the fetch response.
 
Cc: mlamouri@chromium.org

Comment 2 by peter@chromium.org, Mar 29 2017

Owner: peter@chromium.org
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 30 2017

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

commit f1cfaa03b05e225971f220bed2451cb2dc4b497d
Author: peter <peter@chromium.org>
Date: Thu Mar 30 16:04:08 2017

Dispatch a bare Service Worker event for a finished Background Fetch

Following this CL, we'll invoke the `backgroundfetched` Service Worker
event when a Background Fetch has completed. The responses will be
filled with the tiniest bits of information we have right now, so we
can't actually distinguish between success and failure yet, but from
this point on we'll be able to iterate on the missing fields.

BUG= 692579 

Review-Url: https://codereview.chromium.org/2786783002
Cr-Commit-Position: refs/heads/master@{#460780}

[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/BUILD.gn
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_context.cc
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_context.h
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_data_manager.cc
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_data_manager.h
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_job_controller.cc
[delete] https://crrev.com/e376f4717780e3248c359ea4fd5e47976130cc0d/content/browser/background_fetch/background_fetch_job_info.cc
[delete] https://crrev.com/e376f4717780e3248c359ea4fd5e47976130cc0d/content/browser/background_fetch/background_fetch_job_info.h
[delete] https://crrev.com/e376f4717780e3248c359ea4fd5e47976130cc0d/content/browser/background_fetch/background_fetch_job_response_data.cc
[delete] https://crrev.com/e376f4717780e3248c359ea4fd5e47976130cc0d/content/browser/background_fetch/background_fetch_job_response_data.h
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_request_info.cc
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_request_info.h
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_service_impl.h
[add] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/browser/background_fetch/background_fetch_service_unittest.cc
[modify] https://crrev.com/f1cfaa03b05e225971f220bed2451cb2dc4b497d/content/test/BUILD.gn

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 3 2017

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

commit c8d12aafd304aa6a16e73c4bc37ebf270bdee9df
Author: peter <peter@chromium.org>
Date: Mon Apr 03 13:31:35 2017

Add a full end-to-end test for Background Fetch

This adds a full end-to-end test for Background Fetch that starts a
Fetch at the Mojo service implementation, provides fake responses
through the download system and invokes the Service Worker event.

There's a ton of TODOs for change-detector tests as we continue to build
up the rest of the API's functionality.

BUG= 692579 

Review-Url: https://codereview.chromium.org/2786973002
Cr-Commit-Position: refs/heads/master@{#461418}

[modify] https://crrev.com/c8d12aafd304aa6a16e73c4bc37ebf270bdee9df/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.cc
[modify] https://crrev.com/c8d12aafd304aa6a16e73c4bc37ebf270bdee9df/content/browser/background_fetch/background_fetch_embedded_worker_test_helper.h
[modify] https://crrev.com/c8d12aafd304aa6a16e73c4bc37ebf270bdee9df/content/browser/background_fetch/background_fetch_service_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 6 2017

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

commit 47cd96b66744dc81abf3d1dc5561ad2876d5c972
Author: peter <peter@chromium.org>
Date: Thu Apr 06 10:10:29 2017

Populate the response blob for finished Background Fetches

Following this CL we actually populate the response blob for a finished
Background Fetch, which means that the developer can read the response.
In addition, the response time and the response URL chain are also set.

BUG= 692579 

Review-Url: https://codereview.chromium.org/2796953003
Cr-Commit-Position: refs/heads/master@{#462410}

[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_context.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_context.h
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_data_manager.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_job_controller.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_request_info.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_request_info.h
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/browser/background_fetch/background_fetch_service_unittest.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/public/test/fake_download_item.cc
[modify] https://crrev.com/47cd96b66744dc81abf3d1dc5561ad2876d5c972/content/public/test/fake_download_item.h

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 14 2017

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

commit bbecee1672a258c459e05b7a9b88f4ef907497eb
Author: peter <peter@chromium.org>
Date: Fri Apr 14 17:09:55 2017

Consider the Access-Control-Allow-Origin header for Background Fetch

This adds very basic support for CORS to Background Fetch. A full
security review will be requested and done prior to shipping this.

BUG= 692579 

Review-Url: https://codereview.chromium.org/2818703003
Cr-Commit-Position: refs/heads/master@{#464740}

[modify] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/BUILD.gn
[add] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_cross_origin_filter.cc
[add] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_cross_origin_filter.h
[add] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_cross_origin_filter_unittest.cc
[modify] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_data_manager.cc
[modify] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_request_info.cc
[modify] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/browser/background_fetch/background_fetch_request_info.h
[modify] https://crrev.com/bbecee1672a258c459e05b7a9b88f4ef907497eb/content/test/BUILD.gn

Comment 10 by peter@chromium.org, Apr 18 2017

Status: Fixed (was: Started)

Sign in to add a comment