AbortSignal does not always emit the abort signal
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 16:31:21 +0000 (16:31 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 16:31:21 +0000 (16:31 +0000)
commitc4927620f0d5d9886cdf94b9d32b6668c0c1893e
treeb39aad0eaa37e15df3e3c820fb847c140fd54c7c
parentbc05400efbf4f07438f263487aed2576a7f51719
AbortSignal does not always emit the abort signal
https://bugs.webkit.org/show_bug.cgi?id=201871
<rdar://problem/55451712>

Reviewed by Chris Dumez.

Source/WebCore:

Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
This includes a followed signal and an AbortController.
Current WebKit implementation only uses following of one signal at a time.

Test: http/tests/fetch/abort-signal-gc.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAbortControllerCustom.cpp: Added.
(WebCore::JSAbortController::visitAdditionalChildren):
* bindings/js/JSAbortSignalCustom.cpp: Added.
(WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
* dom/AbortController.idl:
* dom/AbortSignal.cpp:
(WebCore::AbortSignal::follow):
* dom/AbortSignal.h:
* dom/AbortSignal.idl:

LayoutTests:

* http/tests/fetch/abort-signal-gc-expected.txt: Added.
* http/tests/fetch/abort-signal-gc.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/fetch/abort-signal-gc-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/fetch/abort-signal-gc.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSAbortControllerCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSAbortSignalCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp
Source/WebCore/dom/AbortController.idl
Source/WebCore/dom/AbortSignal.cpp
Source/WebCore/dom/AbortSignal.h
Source/WebCore/dom/AbortSignal.idl