Bug 50846

Summary: Some FileWriter progress events should be queued
Product: WebKit Reporter: Eric U. <ericu>
Component: DOMAssignee: Eric U. <ericu>
Status: RESOLVED FIXED    
Severity: Normal CC: kinuko
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 44358    
Attachments:
Description Flags
Patch eric: review+, eric: commit-queue-

Description Eric U. 2010-12-10 14:42:15 PST
http://www.w3.org/2008/webapps/track/issues/173.

When a FileWriter successfully completes a write, currently it:
* dispatches a write event
* sets readyState to DONE
* dispatches a writeend event

If you want to start a new write, you can't do it in onwrite, since readyState is still WRITING. Those events should be queued for asynchronous delivery, so that readyState is DONE by the time they get handled. If you set up a new write in onwrite, you'll still run the risk of getting confused by the subsequent writeend from the previous write, but that's detectable.

I'll have to look and see what other events should be marked as queued.
Comment 1 Eric U. 2011-04-06 13:13:55 PDT
Created attachment 88499 [details]
Patch
Comment 2 David Levin 2011-04-25 10:58:22 PDT
Comment on attachment 88499 [details]
Patch

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

Not an extensive review as I'm in the middle of something but this should be addressed.

> Source/WebCore/fileapi/FileWriter.h:110
> +        FileWriterCompletionEventTask(PassRefPtr<FileWriter> fileWriter, FileError::ErrorCode code)

Quick comment. This constructor should be private. This should only expose a static create method which returns a PassOwnPtr.
Comment 3 Eric Seidel (no email) 2011-04-26 16:00:06 PDT
Comment on attachment 88499 [details]
Patch

This seems fine.
Comment 4 Eric Seidel (no email) 2011-04-26 16:00:29 PDT
Comment on attachment 88499 [details]
Patch

Should be fixed per levin's comemnt though.
Comment 5 Eric U. 2011-04-26 16:02:47 PDT
(In reply to comment #4)
> (From update of attachment 88499 [details])
> Should be fixed per levin's comemnt though.

Thanks--I'll fix it before I land it.
Comment 6 Eric U. 2011-05-02 17:10:58 PDT
Committed r85556: <http://trac.webkit.org/changeset/85556>