[webkit-changes] [WebKit/WebKit] 5d14f1: Do not dispatch fetch event if its client is alrea...

youennf noreply at github.com
Wed Jul 10 08:11:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d14f119e11e9b20df828804d9c76cac7517fad8
      https://github.com/WebKit/WebKit/commit/5d14f119e11e9b20df828804d9c76cac7517fad8
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    A LayoutTests/http/wpt/service-workers/navigation-iframe-cancel.https-expected.txt
    A LayoutTests/http/wpt/service-workers/navigation-iframe-cancel.https.html
    M Source/WebCore/workers/service/context/ServiceWorkerFetch.h
    M Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
    M Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
    M Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h

  Log Message:
  -----------
  Do not dispatch fetch event if its client is already cancelled
https://bugs.webkit.org/show_bug.cgi?id=276417
rdar://131072280

Reviewed by Chris Dumez.

We are adding a fetch task and cancelling it when receiving IPC messages.
We are then queuing a task on the event loop to dispatch the fetch event.
If the cancel message happens before the dispatch of the fetch event, we are no longer dispatching the event since it is unnecessary.
To do so, we update the ServiceWorkerFetch::Client class to add a isCancelled getter and use it before dispatching the event.

* LayoutTests/http/wpt/service-workers/navigation-iframe-cancel.https-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/navigation-iframe-cancel.https.html: Added.
* Source/WebCore/workers/service/context/ServiceWorkerFetch.h:
(WebCore::ServiceWorkerFetch::Client::isCancelled const):
(WebCore::ServiceWorkerFetch::Client::cancel):
* Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent):
* Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::doCancel):
(WebKit::WebServiceWorkerFetchTaskClient::cancel): Deleted.
* Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

Canonical link: https://commits.webkit.org/280819@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