RESOLVED FIXED 228924
Add Cross-Origin-Opener-Policy support for Blob URLs
https://bugs.webkit.org/show_bug.cgi?id=228924
Summary Add Cross-Origin-Opener-Policy support for Blob URLs
Chris Dumez
Reported 2021-08-09 14:02:26 PDT
Add Cross-Origin-Opener-Policy support for Blob URLs.
Attachments
Patch (42.45 KB, patch)
2021-08-10 10:32 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (45.90 KB, patch)
2021-08-10 13:37 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-08-10 10:32:32 PDT
Chris Dumez
Comment 2 2021-08-10 13:37:55 PDT
Alex Christensen
Comment 3 2021-08-10 15:57:01 PDT
Comment on attachment 435284 [details] Patch Why is it ok to have { } in registerBlobURLOptionallyFileBacked and Blob's DeserializationContructor?
Chris Dumez
Comment 4 2021-08-10 16:12:41 PDT
Comment on attachment 435284 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=435284&action=review > Source/WebCore/fileapi/Blob.cpp:140 > + ThreadableBlobRegistry::registerBlobURL(nullptr, { }, m_internalURL, srcURL); Passing an empty coop is intentional here. Notice that we are also passing nullptr as the securityOrigin (first parameter). This is because this constructor is merely used when deserializing a Blob passed via SerializedScriptValue. Both srcURL and and m_internalURL are internal blob URLs here (no origin). COOP gets assigned when creating a *public* blob URL from a Blob (By calling URL.createObjectURL()). Blobs themselves don't have a COOP value but there is a COOP value associated with each public Blob URL for the blob in question. > Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:848 > + session->blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath), contentType, { }); BlobRegistryImpl::registerBlobURL() calls BlobRegistryImpl::registerBlobURLOptionallyFileBacked() internally so I had to add a COOP parameter to BlobRegistryImpl::registerBlobURLOptionallyFileBacked(). However, ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked() is only called from the Blob deserialization constructor (discussed above) and only deals with internal blob URLs (not public ones with security origins). Also note that ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked() does not take a SecurityOrigin in parameter.
Chris Dumez
Comment 5 2021-08-10 19:58:10 PDT
Comment on attachment 435284 [details] Patch Clearing flags on attachment: 435284 Committed r280881 (240418@main): <https://commits.webkit.org/240418@main>
Chris Dumez
Comment 6 2021-08-10 19:58:14 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2021-08-10 19:59:28 PDT
Note You need to log in before you can comment on or make changes to this bug.