"background-fetch" permission was added to the Permissions API with this commit: https://github.com/w3c/permissions/pull/183/commits/096436eb59caaa5b244b0514d84f287392cb069b Chrome however uses Automatic Downloads for this permission. This CL ties the Automatic downloads content setting to the background-fetch permission type.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3bcbe725fe3f361e8698dd631d6b19ad55e7d853 commit 3bcbe725fe3f361e8698dd631d6b19ad55e7d853 Author: Mugdha Lakhani <nator@chromium.org> Date: Wed Sep 26 18:35:40 2018 [Background Fetch] Part 1: Take Background Sync content setting out of the decision on whether we can start Background Fetch. For details, see this doc: https://docs.google.com/document/d/1rPYSlbzScw_6PLUJ3m96ZLIkxXVAWyBSL75-VDJEMso/edit?usp=sharing Bug: 886896 Change-Id: Ie6ba2ad6b906ab136eb65b846e67d34bad41e7e6 Reviewed-on: https://chromium-review.googlesource.com/1245799 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Rayan Kanso <rayankans@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#594403} [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/chrome/browser/background_fetch/background_fetch_browsertest.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/chrome/browser/background_fetch/background_fetch_delegate_impl.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/chrome/browser/background_fetch/background_fetch_delegate_impl.h [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_context.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_context.h [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_delegate_proxy.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_metrics.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/background_fetch_metrics.h [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/browser/background_fetch/mock_background_fetch_delegate.cc [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/public/browser/background_fetch_delegate.h [modify] https://crrev.com/3bcbe725fe3f361e8698dd631d6b19ad55e7d853/content/shell/browser/layout_test/layout_test_background_fetch_delegate.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ff13dd1b8fa2b5a2f762aade960c354971665287 commit ff13dd1b8fa2b5a2f762aade960c354971665287 Author: Mugdha Lakhani <nator@chromium.org> Date: Thu Oct 04 18:18:48 2018 [Background Fetch] Start downloads in a paused state when there isn't an explicit ALLOW permission. Bug: 886896 Change-Id: I25250b65b9ea2a7fb5b3c0d43a4ebafe566b4ce1 Reviewed-on: https://chromium-review.googlesource.com/c/1255162 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Reviewed-by: Rayan Kanso <rayankans@chromium.org> Cr-Commit-Position: refs/heads/master@{#596762} [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/chrome/browser/background_fetch/background_fetch_browsertest.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/chrome/browser/background_fetch/background_fetch_delegate_impl.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/chrome/test/data/background_fetch/background_fetch.js [add] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/chrome/test/data/background_fetch/background_fetch_iframe_nowait.html [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/chrome/test/data/background_fetch/sw.js [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_context.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_context.h [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_data_manager.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_data_manager.h [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_data_manager_observer.h [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_data_manager_unittest.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_job_controller.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_job_controller.h [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_job_controller_unittest.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/background_fetch_service_unittest.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/storage/create_metadata_task.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/browser/background_fetch/storage/create_metadata_task.h [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/public/browser/background_fetch_description.cc [modify] https://crrev.com/ff13dd1b8fa2b5a2f762aade960c354971665287/content/public/browser/background_fetch_description.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7895d362d64fd899710b5e315ab7e372a0819d8e commit 7895d362d64fd899710b5e315ab7e372a0819d8e Author: Mugdha Lakhani <nator@chromium.org> Date: Fri Oct 05 18:35:38 2018 [Background Fetch] Surface background-fetch permission. "background-fetch" permission was added to the Permissions API with this commit: https://github.com/w3c/permissions/pull/183/commits/096436eb59caaa5b244b0514d84f287392cb069b Chrome uses Automatic Downloads for this permission, so as not to add yet another user facing permission to the UI. This CL: 1. Adds a background_fetch content setting, because that's needed by PermissionContext and allows us to decouple from Automatic Downloads content setting. 2. Adds a BackgroundFetch PermissionContext mapped to this content setting. 3. Makes this PermissionContext decide whether background fetch() is permitted, which we do by: a. Querying DownloadRequestLimiter when there' a top level frame. b. Querying the Automatic Downloads content setting in other cases. For context and details, please see this document: https://docs.google.com/document/d/1rPYSlbzScw_6PLUJ3m96ZLIkxXVAWyBSL75-VDJEMso/edit?usp=sharing Bug: 886896 Change-Id: Id0fcc64d4242290f3782c61ef11babe5717b409f Reviewed-on: https://chromium-review.googlesource.com/c/1233714 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Rayan Kanso <rayankans@chromium.org> Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org> Reviewed-by: Raymes Khoury <raymes@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Cr-Commit-Position: refs/heads/master@{#597209} [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/android_webview/browser/aw_permission_manager.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/BUILD.gn [add] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/background_fetch/background_fetch_permission_context.cc [add] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/background_fetch/background_fetch_permission_context.h [add] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/background_fetch/background_fetch_permission_context_unittest.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/permissions/permission_manager.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/permissions/permission_util.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/browser/ui/webui/site_settings_helper.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/test/BUILD.gn [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/test/base/testing_browser_process.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/chrome/test/base/testing_browser_process.h [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/components/content_settings/core/common/content_settings.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/components/content_settings/core/common/content_settings_types.h [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/content/browser/permissions/permission_service_impl.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/content/public/browser/permission_type.h [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/content/shell/browser/layout_test/layout_test_message_filter.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/content/shell/browser/shell_permission_manager.cc [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/WebKit/LayoutTests/external/wpt/permissions/interfaces.any.js [add] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/WebKit/LayoutTests/external/wpt/permissions/test-background-fetch-permission.html [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/WebKit/LayoutTests/http/tests/resources/permissions-helper.js [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/blink/public/platform/modules/permissions/permission.mojom [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/blink/renderer/modules/permissions/permission_descriptor.idl [modify] https://crrev.com/7895d362d64fd899710b5e315ab7e372a0819d8e/third_party/blink/renderer/modules/permissions/permissions.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dff0251ff2a96d27159e850f2ff94c4d658d345c commit dff0251ff2a96d27159e850f2ff94c4d658d345c Author: Mugdha Lakhani <nator@chromium.org> Date: Sat Oct 06 05:55:52 2018 [Background Fetch] Pause fetches after the first OnDownloadUpdated() Until we figure out a way to start downloads in a paused state. Bug: 886896 Change-Id: I7357d8baa97f50828f4070e60e60df6d886b2338 Reviewed-on: https://chromium-review.googlesource.com/c/1264517 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Rayan Kanso <rayankans@chromium.org> Cr-Commit-Position: refs/heads/master@{#597414} [modify] https://crrev.com/dff0251ff2a96d27159e850f2ff94c4d658d345c/chrome/browser/background_fetch/background_fetch_browsertest.cc [modify] https://crrev.com/dff0251ff2a96d27159e850f2ff94c4d658d345c/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1f633e352e9d4cb2895bd70eaebe5d61153aec2a commit 1f633e352e9d4cb2895bd70eaebe5d61153aec2a Author: Mugdha Lakhani <nator@chromium.org> Date: Fri Oct 12 17:33:09 2018 [Background Fetch] Finish integration of backgroundFetch permission with devtools. This was suggested a previous review: https://chromium-review.googlesource.com/c/chromium/src/+/1233714/18/content/browser/devtools/protocol/browser_handler.cc#140 Bug: 886896 Change-Id: I41e850811da4c8d11f091b2fb0b49320af6cd0e4 Reviewed-on: https://chromium-review.googlesource.com/c/1278926 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Commit-Queue: Mugdha Lakhani <nator@chromium.org> Cr-Commit-Position: refs/heads/master@{#599271} [modify] https://crrev.com/1f633e352e9d4cb2895bd70eaebe5d61153aec2a/content/browser/devtools/protocol/browser_handler.cc [modify] https://crrev.com/1f633e352e9d4cb2895bd70eaebe5d61153aec2a/third_party/blink/renderer/core/inspector/browser_protocol.pdl
Comment 1 by bugdroid1@chromium.org
, Sep 26