[webkit-changes] [WebKit/WebKit] 39186f: Restrict background fetch loads to HTTP family

youennf noreply at github.com
Wed Mar 1 02:34:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 39186fb707af4e7aa28391236ccd2dce29c591ff
      https://github.com/WebKit/WebKit/commit/39186fb707af4e7aa28391236ccd2dce29c591ff
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window.js
    M Source/WebCore/workers/service/background-fetch/BackgroundFetch.cpp
    M Source/WebKit/NetworkProcess/BackgroundFetchLoad.cpp

  Log Message:
  -----------
  Restrict background fetch loads to HTTP family
https://bugs.webkit.org/show_bug.cgi?id=253073
rdar://problem/106026139

Reviewed by Alex Christensen.

Update BackgroundFetch to handle the case of a synchronously failure.
Previously, the responseReady promise would not resolve given the failure will happen before the responseReady callback is registered.
We are now making sure to answer the responseReady callback if the failure happened before the registration.

Add HTTP check in BackgroundFetchLoad to fail lood immediately for non HTTP loads.

We update the WPT test to cover the case where the fetch registration happens but the load fails.
This is inline with other checks like CSP done at individual fetch level.

* LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js:
(testBgFetch):
(backgroundFetchTest):
* LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window.js:
(backgroundFetchTest.async t):
* Source/WebCore/workers/service/background-fetch/BackgroundFetch.cpp:
(WebCore::BackgroundFetch::didFinishRecord):
(WebCore::BackgroundFetch::recordIsCompleted):
(WebCore::BackgroundFetch::Record::didFinish):
(WebCore::BackgroundFetch::Record::retrieveResponse):
* Source/WebCore/workers/service/background-fetch/BackgroundFetch.h:
* Source/WebKit/NetworkProcess/BackgroundFetchLoad.cpp:

Canonical link: https://commits.webkit.org/260994@main




More information about the webkit-changes mailing list