RESOLVED FIXED Bug 37840
Add FileError for File API
https://bugs.webkit.org/show_bug.cgi?id=37840
Summary Add FileError for File API
Jian Li
Reported 2010-04-19 19:30:21 PDT
Need to implement FileError as defined in File API (http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-fileerror). This is needed by both FileReader and FileWriter.
Attachments
Proposed Patch (20.68 KB, patch)
2010-04-19 19:32 PDT, Jian Li
jianli: commit-queue-
Proposed Patch (28.13 KB, patch)
2010-04-20 15:16 PDT, Jian Li
jianli: commit-queue-
Proposed Patch (17.92 KB, patch)
2010-04-22 11:37 PDT, Jian Li
dimich: review+
jianli: commit-queue-
Jian Li
Comment 1 2010-04-19 19:32:41 PDT
Created attachment 53766 [details] Proposed Patch
Jian Li
Comment 2 2010-04-20 15:16:41 PDT
Created attachment 53892 [details] Proposed Patch Added FileErrorConstructor to DOMWindow.
Dmitry Titov
Comment 3 2010-04-21 16:09:55 PDT
Is it possible to split the patch into modifying the code generators and adding a FileError object? I'd look at FileError, but there are others with much better understanding of generators...
Jian Li
Comment 4 2010-04-22 11:37:46 PDT
Created attachment 54080 [details] Proposed Patch Moved code generator changes to a separate patch.
Dmitry Titov
Comment 5 2010-04-22 11:57:02 PDT
Comment on attachment 54080 [details] Proposed Patch r=me with 2 nits: diff --git a/WebCore/dom/ExceptionCode.h b/WebCore/dom/ExceptionCode.h + + // Introduced in File API: It'd be nice to have a link to a spec here as well. +#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER) + NOT_READABLE_ERR = 24, + ENCODING_ERR = 26, +#endif diff --git a/WebCore/html/FileError.h b/WebCore/html/FileError.h +private: + FileError() : m_code(0) { } Initializer should be on a separate line.
Jian Li
Comment 6 2010-04-23 15:26:17 PDT
Kinuko Yasuda
Comment 7 2010-04-27 11:10:38 PDT
Hi, thanks for adding it. +class FileError : public RefCounted<FileError> { +public: + static PassRefPtr<FileError> create(ExceptionCode code) { return adoptRef(new FileError(code)); } +private: + FileError() : m_code(0) { } Don't we need a constructor that takes an ExceptionCode?
Jian Li
Comment 8 2010-04-27 13:49:56 PDT
> Don't we need a constructor that takes an ExceptionCode? Yes, I noticed this when I turn on the feature during building FileReader. The fix is included in the patch for bug 38157. Thanks.
Note You need to log in before you can comment on or make changes to this bug.