-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadableStream::pipeTo memory leak #6759
ReadableStream::pipeTo memory leak #6759
Conversation
EWS run on current version of this PR (hash 0c85a4a) |
@@ -84,7 +86,8 @@ class AbortSignal final : public RefCounted<AbortSignal>, public EventTarget, pr | |||
void eventListenersDidChange() final; | |||
|
|||
bool m_aborted { false }; | |||
Vector<Algorithm> m_algorithms; | |||
Vector<std::pair<uint32_t, Algorithm>> m_algorithms; | |||
uint32_t m_algorithmIdentifier { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be an ObjectIdentifier of some sort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, the issue is that the algorithm identifier is stored by built-in JS code which only knows about integers, not ObjectIdentifier.
0c85a4a
to
d00a3da
Compare
https://bugs.webkit.org/show_bug.cgi?id=247618 rdar://problem/102366716 Reviewed by Alex Christensen. Before the patch, a reference to pipeState would be kept in the AbortSignal. We are now removing the algorithm from thr AbortSignal when finalizing pipeTo to break the reference cycle. * Source/WebCore/Modules/streams/ReadableStreamInternals.js: (readableStreamPipeToWritableStream): (pipeToFinalize): * Source/WebCore/bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/dom/AbortSignal.cpp: (WebCore::AbortSignal::signalAbort): (WebCore::AbortSignal::addAbortAlgorithmToSignal): (WebCore::AbortSignal::removeAbortAlgorithmFromSignal): (WebCore::AbortSignal::addAlgorithm): (WebCore::AbortSignal::removeAlgorithm): (WebCore::AbortSignal::whenSignalAborted): Deleted. * Source/WebCore/dom/AbortSignal.h: * Source/WebCore/dom/AbortSignal.idl: Canonical link: https://commits.webkit.org/257109@main
d00a3da
to
cb01f4c
Compare
Committed 257109@main (cb01f4c): https://commits.webkit.org/257109@main Reviewed commits have been landed. Closing PR #6759 and removing active labels. |
cb01f4c
0c85a4a