[webkit-changes] [WebKit/WebKit] f63e77: FetchBodyOwner should not be GCed if its FormDataC...
youennf
noreply at github.com
Tue Sep 10 11:13:05 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f63e77117fcade21cea2c82946e35ebd79446974
https://github.com/WebKit/WebKit/commit/f63e77117fcade21cea2c82946e35ebd79446974
Author: Youenn Fablet <youenn at apple.com>
Date: 2024-09-10 (Tue, 10 Sep 2024)
Changed paths:
A LayoutTests/fast/files/blob-formdata-gc-expected.txt
A LayoutTests/fast/files/blob-formdata-gc.html
M Source/WebCore/Modules/fetch/FetchBody.h
M Source/WebCore/Modules/fetch/FetchBodyConsumer.h
M Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
M Source/WebCore/Modules/fetch/FetchBodyOwner.h
M Source/WebCore/Modules/fetch/FormDataConsumer.cpp
M Source/WebCore/Modules/fetch/FormDataConsumer.h
Log Message:
-----------
FetchBodyOwner should not be GCed if its FormDataConsumer is reading a blob or a file
https://bugs.webkit.org/show_bug.cgi?id=279441
rdar://135355235
Reviewed by Chris Dumez.
FetchResponse or FetchRequest should take a pending activity to not be GCed when doing asynchronous tasks.
We did not do that when reading blob or file items of a FormData.
To fix this, we expose hasPendingActivity in FormDataConsumer to know whether it is doing an asynchronous task.
We use this getter in FetchBodyOwner::virtualHasPendingActivity to prevent GC.
* LayoutTests/fast/files/blob-formdata-gc-expected.txt: Added.
* LayoutTests/fast/files/blob-formdata-gc.html: Added.
* Source/WebCore/Modules/fetch/FetchBody.h:
(WebCore::FetchBody::hasConsumerPendingActivity const):
* Source/WebCore/Modules/fetch/FetchBodyConsumer.h:
(WebCore::FetchBodyConsumer::hasPendingActivity const):
* Source/WebCore/Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::virtualHasPendingActivity const):
* Source/WebCore/Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::isActive const): Deleted.
* Source/WebCore/Modules/fetch/FormDataConsumer.cpp:
(WebCore::FormDataConsumer::consumeFile):
* Source/WebCore/Modules/fetch/FormDataConsumer.h:
(WebCore::FormDataConsumer::hasPendingActivity const):
Canonical link: https://commits.webkit.org/283430@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