[Bug 17262] send function should have async interface

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17262

--- Comment #8 from Takashi Toyoshima <toyoshim@chromium.org> 2012-06-01 07:53:26 UTC ---
(In reply to comment #6)
> > Also, this choice makes bufferedAmount meaningless because limitation by
> > internal buffer never depends buffer size.
> 
> I'm not sure what you mean.  After calling send(File), bufferedAmount is
> increased by the file's length, which is always known in advance without any
> disk I/O.  (Some browsers don't implement this correctly yet, but that's a
> bug.)  As the file is streamed from disk over the network, bufferedAmount is
> decreased.  The buffer size is usually not actually that big, but it seems like
> reasonable behavior.

I think bufferedAmount is used as a hint to control sending speed at JavaScript
application level.
Some application will use this hint like,
"OK, now bufferedAmount is less than 512kB. This browser is capable to queue
1MB data safely. Now I can send 256kB text safely."
So, what's happen when bufferedAmount count actual file size and also a browser
accepts many Blob objects as references.
"Wow, now bufferedAmount is over 1GB. When can I send the next text safely?"
This is the point I said that bufferedAmount is meaningless now.

> Actually, File is read-only, too.  More accurately, it's immutable (again with
> the exception of neutering).
> 
> If the underlying File changes (whether by another application or FileWriter),
> reads to earlier File instances will fail, not return the changed data.  A File
> represents a snapshot of a file on disk at the time the File was created, and
> if that data is no longer available because the file was modified, the read
> fails.

Thank you for clarification.

So, the last point looks important.
If the Blob is stored in WebSocket sending queue, internal reading and sending
operation will fail by file modifications. If we want to avoid this unexpected
read failures, we should wait for the completion before update the file. Thus,
we need completion callback or completion event handler.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 1 June 2012 07:53:34 UTC