Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d3783956a15168b6e70f933a7720792bd2998d77
      
https://github.com/WebKit/WebKit/commit/d3783956a15168b6e70f933a7720792bd2998d77
  Author: Youenn Fablet <[email protected]>
  Date:   2023-06-21 (Wed, 21 Jun 2023)

  Changed paths:
    M Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm

  Log Message:
  -----------
  ServiceWorkerGlobalScope::notifyServiceWorkerPageOfCreationIfNecessary should 
limit itself to normalWorld
https://bugs.webkit.org/show_bug.cgi?id=258339
rdar://105387315

Reviewed by Chris Dumez.

Page::serviceWorkerGlobalObject is only supporting normal worlds and is 
checking this with a RELEASE_ASSERT.
ServiceWorkerGlobalScope::notifyServiceWorkerPageOfCreationIfNecessary calls 
LocalFrameLoaderClient::dispatchServiceWorkerGlobalObjectAvailable on all 
worlds.
This puts the burden on implementors of 
LocalFrameLoaderClient::dispatchServiceWorkerGlobalObjectAvailable to check 
that the world is a normal world.
Instead of hitting the RELEASE_ASSERT, we are limiting 
LocalFrameLoaderClient::dispatchServiceWorkerGlobalObjectAvailable call to 
normal worlds.

Updated test is adding a world in a test that is using service worker.
It hits the RELEASE_ASSERT without the change in 
ServiceWorkerGlobalScope::notifyServiceWorkerPageOfCreationIfNecessary.

* Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::notifyServiceWorkerPageOfCreationIfNecessary):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to