Summary: | Implement the DOM FileWriter class | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric U. <ericu> | ||||||||
Component: | DOM | Assignee: | Eric U. <ericu> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Enhancement | CC: | commit-queue, fishd, jianli, kinuko, levin, michaeln, mike | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 44358 | ||||||||||
Attachments: |
|
Description
Eric U.
2010-08-20 14:45:32 PDT
Created attachment 65000 [details]
Implement html/FileWriter
This implements FileWriter, but delegates the hard work to the forthcoming implementation of AsyncFileWriter, which is abstract.
I'm not a reviewer and I haven't looked into it carefully yet, but here're some first comments. WebCore/html/FileWriter.cpp:45 + , m_length(length) Don't we want to initialize m_readyState as well? WebCore/html/FileWriter.cpp:76 + ec = INVALID_STATE_ERR; I think we need to save the error value to m_error to return the last error for FileWriter.error attribute. WebCore/html/FileWriter.cpp:134 + DCHECK_GT(bytes, 0); I don't think we have DCHECK_XXX stuff in WebKit. (ASSERT(...) is used everywhere in WebKit) WebCore/html/FileWriter.cpp:170 + return; In what case does this happen? WebCore/html/FileWriter.h:69 + FileError* error() const { return m_error; }; m_error.get()? WebCore/html/FileWriter.h:109 + RefPtr<FileError*> m_error; '*' is not necessary. WebCore/html/FileWriter.h:111 + RefPtr<AsyncFileWriter*> m_writer; ditto. WebCore/html/FileWriter.cpp:58 + return m_readyState == WRITING || ActiveDOMObject::hasPendingActivity(); If we want to keep an instance while its hasPendingActivity() returns true, we need to add the class name to WebCore/bindings/scripts/CodeGeneratorV8.pm::IsActiveDomType() for v8. Otherwise it gets GC'ed even it is defined as a subclass of ActiveDOMObject. WebCore/html/FileWriter.cpp:39 + FileWriter::FileWriter(ScriptExecutionContext* context, AsyncFileWriter* writer, const String& path, long long length) Does this assume the creator/caller of FileWriter holds the AsyncFileWriter's reference while the writer is writing? Comment on attachment 65000 [details]
Implement html/FileWriter
This patch needs a lot of work; I'm retracting it and will repost soon.
Created attachment 65644 [details]
Patch
Comment on attachment 65644 [details]
Patch
WebCore/html/FileWriterClient.h:54
+
nit: looks like there are some extra new lines here that should be nuked.
R=me
Created attachment 65771 [details]
Fixed whitespace, pulled extra entry out of vcproj
I removed those two blank lines, and I also removed an entry for FileWriterCallback from the vcproj file--that snuck in from the next changelist. Everything else is the same.
Comment on attachment 65771 [details] Fixed whitespace, pulled extra entry out of vcproj Clearing flags on attachment: 65771 Committed r66303: <http://trac.webkit.org/changeset/66303> All reviewed patches have been landed. Closing bug. |