Bug 215663 - Blob is missing text() & arrayBuffer() operations
Summary: Blob is missing text() & arrayBuffer() operations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://w3c.github.io/FileAPI/#blob-s...
Keywords: InRadar, WebExposed
: 213168 (view as bug list)
Depends on: 215832
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-19 14:31 PDT by Chris Dumez
Modified: 2020-09-03 11:11 PDT (History)
12 users (show)

See Also:


Attachments
Patch (30.62 KB, patch)
2020-08-19 14:37 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (33.57 KB, patch)
2020-08-19 15:15 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (33.48 KB, patch)
2020-08-19 16:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-08-19 14:31:49 PDT
Blob is missing text() & arrayBuffer() operations:
- https://w3c.github.io/FileAPI/#blob-section
Comment 1 Chris Dumez 2020-08-19 14:37:20 PDT
Created attachment 406873 [details]
Patch
Comment 2 Chris Dumez 2020-08-19 15:15:04 PDT
Created attachment 406877 [details]
Patch
Comment 3 Geoffrey Garen 2020-08-19 15:36:36 PDT
Comment on attachment 406877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406877&action=review

r=me

> Source/WebCore/fileapi/NetworkSendQueue.cpp:74
> +    blobLoaderPtr->start(blob, m_document.get(), FileReaderLoader::ReadAsArrayBuffer);

Could use m_queue.last() here instead of blobLoaderPtr. Not sure if that's obviously better; but taking a raw pointer to a UniqueRef smells bad.

> Source/WebCore/page/ShareDataReader.cpp:58
> +        blobLoaderPtr->start(*blob, document, FileReaderLoader::ReadAsArrayBuffer);

Here too.
Comment 4 Chris Dumez 2020-08-19 16:07:41 PDT
For the record, this was reported via Twitter here:
https://twitter.com/baldand/status/1295769537367990273
Comment 5 Chris Dumez 2020-08-19 16:09:49 PDT
Comment on attachment 406877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406877&action=review

>> Source/WebCore/fileapi/NetworkSendQueue.cpp:74
>> +    blobLoaderPtr->start(blob, m_document.get(), FileReaderLoader::ReadAsArrayBuffer);
> 
> Could use m_queue.last() here instead of blobLoaderPtr. Not sure if that's obviously better; but taking a raw pointer to a UniqueRef smells bad.

Sadly, the queue contains a Variant type so it is not convenient to do what you suggest. I will apply your suggestion to ShareDataReader.cpp though.
Comment 6 Chris Dumez 2020-08-19 16:11:51 PDT
Created attachment 406884 [details]
Patch
Comment 7 EWS 2020-08-19 16:56:08 PDT
Committed r265908: <https://trac.webkit.org/changeset/265908>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406884 [details].
Comment 8 Radar WebKit Bug Importer 2020-08-19 16:57:17 PDT
<rdar://problem/67436725>
Comment 9 Tetsuharu Ohzeki [UTC+9] 2020-09-03 11:11:05 PDT
*** Bug 213168 has been marked as a duplicate of this bug. ***