Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dfeb33f0ac4c4f96cf0e09aca2ae8ffe0fd0ca1a
      
https://github.com/WebKit/WebKit/commit/dfeb33f0ac4c4f96cf0e09aca2ae8ffe0fd0ca1a
  Author: Youenn Fablet <you...@apple.com>
  Date:   2025-04-24 (Thu, 24 Apr 2025)

  Changed paths:
    A LayoutTests/http/tests/workers/service/resultingClientId-worker.js
    A 
LayoutTests/http/tests/workers/service/resultingClientId.https-expected.txt
    A LayoutTests/http/tests/workers/service/resultingClientId.https.html
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/DocumentLoader.h
    M Source/WebCore/workers/service/server/SWServer.cpp
    M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
    M Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
    M Source/WebKit/WebProcess/Network/WebResourceLoader.h
    M Source/WebKit/WebProcess/Network/WebResourceLoader.messages.in

  Log Message:
  -----------
  Client id mismatch after Cross-Origin-Opener-Policy Header
rdar://problem/149370100
https://bugs.webkit.org/show_bug.cgi?id=291315

Reviewed by Brady Eidson.

Before the patch, in case of process swapping, we would create a new 
DocumentLoader in the final process.
This would mean a new ScriptExecutionContextIdentifier and so a new clientId 
that is not is the same as the inital DocumentLoader
that triggered the request sent to the service worker.

To fix this, when process swap happens in 
NetworkResourceLoader::transferToNewWebProcess, we tell the new DocumentLoader 
that it
should reuse the initial DocumentLoader ScriptExecutionContextIdentifier (with 
the right process identifier).

We update NetworkResourceLoader, WebResourceLoader and DocumentLoader 
accordingly.
We then have to deal in SWServer with ScriptExecutionContextIdentifier that 
have the same UUID but not the same process identifier.

* LayoutTests/http/tests/workers/service/resultingClientId-worker.js: Added.
* LayoutTests/http/tests/workers/service/resultingClientId.https-expected.txt: 
Added.
* LayoutTests/http/tests/workers/service/resultingClientId.https.html: Added.
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setNewResultingClientId):
* Source/WebCore/loader/DocumentLoader.h:
* Source/WebCore/workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::transferToNewWebProcess):
* Source/WebKit/WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::updateResultingClientIdentifier):
* Source/WebKit/WebProcess/Network/WebResourceLoader.h:
* Source/WebKit/WebProcess/Network/WebResourceLoader.messages.in:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to