Bug 176674 - DOMFormData should be available in workers
Summary: DOMFormData should be available in workers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-10 14:01 PDT by Sam Weinig
Modified: 2019-11-11 17:36 PST (History)
15 users (show)

See Also:


Attachments
WIP (37.39 KB, patch)
2019-11-11 09:20 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (38.50 KB, patch)
2019-11-11 09:29 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (182.26 KB, patch)
2019-11-11 10:24 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (184.44 KB, patch)
2019-11-11 12:59 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-09-10 14:01:54 PDT
DOMFormData is not currently available in workers due FormData (which DOMFormDatas are passed to for conversion to an HTTP body) currently depending on the Document/Page to do file replacement.
Comment 1 Sam Weinig 2017-09-10 17:39:21 PDT
As noted, the crux of the issue is that FormData class uses the Page to allow a hosting app to generate a file replacement for things like bundles. This was added in https://trac.webkit.org/changeset/32666/webkit (~9 years ago).

My guess is that we can remove the delegation, and use the now available platform standard ways to detect bundles and generate the replacement.
Comment 2 Sam Weinig 2017-09-10 17:44:56 PDT
Indeed, it looks like we have most of the infrastructure in place to do this for Blobs already (File::shouldReplaceFile, File::computeNameAndContentTypeForReplacedFile, BlobDataFileReference::generateReplacementFile).
Comment 3 Alexey Proskuryakov 2017-09-11 12:20:40 PDT
There is some performance improvement to make potentially - I think that there are situations where we compress the same bundle twice, using the delegate first, and then in the Networking process using WebKit functionality again.
Comment 4 youenn fablet 2019-11-11 09:10:32 PST
(In reply to Sam Weinig from comment #2)
> Indeed, it looks like we have most of the infrastructure in place to do this
> for Blobs already (File::shouldReplaceFile,
> File::computeNameAndContentTypeForReplacedFile,
> BlobDataFileReference::generateReplacementFile).

This has been removed now so we should be able to expose DOMFormData to workers
Comment 5 youenn fablet 2019-11-11 09:20:42 PST
Created attachment 383274 [details]
WIP
Comment 6 youenn fablet 2019-11-11 09:24:39 PST
We probably need to handle the call of MIMETypeRegistry::getMIMETypeForExtension
Comment 7 youenn fablet 2019-11-11 09:29:58 PST
Created attachment 383275 [details]
Patch
Comment 8 youenn fablet 2019-11-11 10:24:05 PST
Created attachment 383282 [details]
Patch
Comment 9 youenn fablet 2019-11-11 12:59:54 PST
Created attachment 383289 [details]
Patch
Comment 10 WebKit Commit Bot 2019-11-11 17:34:32 PST
The commit-queue encountered the following flaky tests while processing attachment 383289 [details]:

inspector/model/remote-object-weak-collection.html bug 202932 (authors: drousso@apple.com and joepeck@webkit.org)
The commit-queue is continuing to process your patch.
Comment 11 WebKit Commit Bot 2019-11-11 17:35:29 PST
Comment on attachment 383289 [details]
Patch

Clearing flags on attachment: 383289

Committed r252349: <https://trac.webkit.org/changeset/252349>
Comment 12 WebKit Commit Bot 2019-11-11 17:35:31 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2019-11-11 17:36:18 PST
<rdar://problem/57100456>