Closed Bug 1359359 Opened 4 years ago Closed 4 years ago

FileReaderSync should be able to read from a nsIAsyncInputStream


(Core :: DOM: Core & HTML, enhancement)

Not set



Tracking Status
firefox55 --- fixed


(Reporter: baku, Assigned: baku)




(3 files)

Currently FileReaderSync wants a sync nsIInputStream.
It's not able to deal with the new IPCBlobInputStream.
Right now this is executed on the current thread. This is not compatible with the use of IPCBlobInputStream in sync event loop in workers.
Assignee: nobody → amarchesini
Attachment #8861351 - Flags: review?(bugs)
Attached patch part 2 - testsSplinter Review
Attachment #8861353 - Flags: review?(bugs)
Blocks: 1353629
Attachment #8861351 - Flags: review?(bugs) → review+
Attachment #8861352 - Flags: review?(bugs) → review+
Comment on attachment 8861353 [details] [diff] [review]
part 2 - tests

>+let workerUrl = URL.createObjectURL(new Blob(["(", workerScript.toSource(), ")()"]));
>+let worker = new Worker(workerUrl);
>+worker.onmessage = event => {
>+  ok(, "The file has been read");
I would prefer if this tested that the expected data was actually read.

Could you for example read the data asynchronously in the main thread and then compare that the _exactly_ same
data is read synchronously in worker as is asynchronously in main thread. 

With that, r+
Attachment #8861353 - Flags: review?(bugs) → review+
And please ensure that there are also tests for memory blob reading with workers!
That too is required for the r+.
Pushed by
IPCBlobInputStream should execute StreamReady() in the target thread of AsyncWait, r=smaug
FileReaderSync should support nsIAsyncInputStream, r=smaug
Tests for FileReaderSync and IPCBlobInputStream, r=smaug
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.