[webkit-changes] [WebKit/WebKit] bcdf23: Make sure to unregister service worker client ID i...

youennf noreply at github.com
Mon Mar 4 09:55:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bcdf230cf814eac06367a081a2b5bcb5628fbf30
      https://github.com/WebKit/WebKit/commit/bcdf230cf814eac06367a081a2b5bcb5628fbf30
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
    M Source/WebCore/loader/DocumentLoader.cpp

  Log Message:
  -----------
  Make sure to unregister service worker client ID in case DocumentLoader::loadMainResource is called repeatedly
rdar://123839279
https://bugs.webkit.org/show_bug.cgi?id=270353

Reviewed by Chris Dumez.

Let's say that DocumentLoader::loadMainResource is called once.
The load proceeds and DocumentLoader now has a service worker registration data.
This means that DocumentLoader::m_resultingClientId is a registered service worker client identifier.
DocumentLoader::commitData is not yet called as there is not yet any data so the Document is not owning this identifier.

If DocumentLoader::loadMainResource is called again without DocumentLoader::clearMainResource()
being called in between, we would create a new identifier without unregistering the past registered service worker client identifier.

This patch makes sure to unregister the service worker client identifier, if any in DocumentLoader::loadMainResource.

* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list