RESOLVED FIXED45498
[FileSystem] Do not call EntriesCallback more than once if there're no entries.
https://bugs.webkit.org/show_bug.cgi?id=45498
Summary [FileSystem] Do not call EntriesCallback more than once if there're no entries.
Kinuko Yasuda
Reported 2010-09-09 15:26:14 PDT
DirectoryReader.readDirectory should not call EntriesCallback twice if there're no entries. Currently it wrongly calls the callback twice (one to return entries that is empty and the other one to indicate there's no more entries.) http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-directoryreader-interface
Attachments
Patch (2.15 KB, patch)
2010-09-09 15:35 PDT, Kinuko Yasuda
dumi: review+
Kinuko Yasuda
Comment 1 2010-09-09 15:35:32 PDT
Dumitru Daniliuc
Comment 2 2010-09-09 23:00:35 PDT
Comment on attachment 67103 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=67103&action=prettypatch r=me, but please address the comments before submitting. > WebCore/fileapi/FileSystemCallbacks.cpp:150 > + if (!hasMore && hadEntries) { i don't think you need the hadEntries variable. can you just use: if (!hasMore && !m_entries->isEmpty()) and clear m_entries after the if-block? > WebCore/fileapi/FileSystemCallbacks.cpp:151 > // If there're no more entries, call back once more with an empty array. update the comment please.
Kinuko Yasuda
Comment 3 2010-09-10 11:44:19 PDT
Note You need to log in before you can comment on or make changes to this bug.