[webkit-changes] [WebKit/WebKit] 73c255: Check CSP for background fetches

youennf noreply at github.com
Thu Mar 2 01:07:29 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 73c255a539a4afc1ede9e8be072eea9c6ed2c690
      https://github.com/WebKit/WebKit/commit/73c255a539a4afc1ede9e8be072eea9c6ed2c690
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-03-02 (Thu, 02 Mar 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window.js
    M Source/WebCore/workers/service/background-fetch/BackgroundFetch.cpp
    M Source/WebCore/workers/service/background-fetch/BackgroundFetch.h
    M Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.cpp
    M Source/WebCore/workers/service/background-fetch/BackgroundFetchManager.cpp
    M Source/WebCore/workers/service/background-fetch/BackgroundFetchRequest.h
    M Source/WebCore/workers/service/server/SWServer.h
    M Source/WebCore/workers/service/server/SWServerDelegate.h
    M Source/WebKit/NetworkProcess/BackgroundFetchLoad.cpp
    M Source/WebKit/NetworkProcess/BackgroundFetchLoad.h
    M Source/WebKit/NetworkProcess/NetworkSession.cpp
    M Source/WebKit/NetworkProcess/NetworkSession.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  Check CSP for background fetches
https://bugs.webkit.org/show_bug.cgi?id=253068
rdar://problem/106025080

Reviewed by Sihui Liu.

Set the CSP response headers in WebProcess and send them as part of BackgroundFetchRequest to network process.
Pipe it to BackgroundFetchLoad that will send them to NetworkLoadChecker.

Small refactoring to directly pass a BackgroundFetchRequest to BackgroundFetchLoad.

Covered by updated and rebased test.
The WPT test is updated as per specification where the bg fetch promise resolves independently from failures of each indivudal fetch algorithm (where CSP is checked).

* LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window.js:
(backgroundFetchTest.async t):
(backgroundFetchTest): Deleted.
* Source/WebCore/workers/service/background-fetch/BackgroundFetch.cpp:
(WebCore::BackgroundFetch::didFinishRecord):
(WebCore::BackgroundFetch::recordIsCompleted):
(WebCore::BackgroundFetch::Record::complete):
(WebCore::BackgroundFetch::Record::didFinish):
(WebCore::BackgroundFetch::Record::retrieveResponse):
* Source/WebCore/workers/service/background-fetch/BackgroundFetch.h:
* Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.cpp:
(WebCore::BackgroundFetchEngine::startBackgroundFetch):
* Source/WebCore/workers/service/background-fetch/BackgroundFetchManager.cpp:
(WebCore::BackgroundFetchManager::fetch):
* Source/WebCore/workers/service/background-fetch/BackgroundFetchRequest.h:
(WebCore::BackgroundFetchRequest::isolatedCopy const):
(WebCore::BackgroundFetchRequest::isolatedCopy):
* Source/WebCore/workers/service/server/SWServer.h:
(WebCore::SWServer::createBackgroundFetchRecordLoader):
* Source/WebCore/workers/service/server/SWServerDelegate.h:
* Source/WebKit/NetworkProcess/BackgroundFetchLoad.cpp:
(WebKit::BackgroundFetchLoad::BackgroundFetchLoad):
* Source/WebKit/NetworkProcess/BackgroundFetchLoad.h:
* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::createBackgroundFetchRecordLoader):
* Source/WebKit/NetworkProcess/NetworkSession.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

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




More information about the webkit-changes mailing list