RESOLVED FIXED 47535
DOMFileSystem's reference should be kept while there're any active Entries/callbacks
https://bugs.webkit.org/show_bug.cgi?id=47535
Summary DOMFileSystem's reference should be kept while there're any active Entries/ca...
Kinuko Yasuda
Reported Tuesday, October 12, 2010 5:42:52 AM UTC
DOMFileSystem's reference should be kept while there're any pending Entries/callbacks. Right now the reference needs to be kept in the script -- otherwise it crashes.
Attachments
Patch (24.93 KB, patch)
2010-10-21 10:32 PDT, Kinuko Yasuda
no flags
Patch (26.72 KB, patch)
2010-10-21 17:14 PDT, Kinuko Yasuda
no flags
Patch (26.71 KB, patch)
2010-10-26 16:51 PDT, Kinuko Yasuda
dumi: review+
dumi: commit-queue-
Kinuko Yasuda
Comment 1 Tuesday, October 12, 2010 5:46:31 AM UTC
Or Entries and callbacks should hold a reference to the DOMFileSystem in a proper way.
Michael Nordman
Comment 2 Wednesday, October 13, 2010 11:22:47 PM UTC
FYI: There is an easy workaround to the crashes, hold a script reference to the resulting fileSystem object returned as a result of the requestFileSystem() call.
Kinuko Yasuda
Comment 3 Thursday, October 21, 2010 6:32:00 PM UTC
Eric U.
Comment 4 Friday, October 22, 2010 12:26:24 AM UTC
Comment on attachment 71455 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71455&action=review > WebCore/fileapi/FileSystemCallbacks.cpp:141 > +PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath) What about EntryCallbacks?
Kinuko Yasuda
Comment 5 Friday, October 22, 2010 1:14:35 AM UTC
Kinuko Yasuda
Comment 6 Friday, October 22, 2010 1:16:16 AM UTC
(In reply to comment #4) > (From update of attachment 71455 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71455&action=review > > > WebCore/fileapi/FileSystemCallbacks.cpp:141 > > +PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath) > > What about EntryCallbacks? Forgotten... fixed.
Eric U.
Comment 7 Friday, October 22, 2010 1:37:19 AM UTC
Comment on attachment 71512 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71512&action=review LGTM > LayoutTests/fast/filesystem/script-tests/filesystem-reference.js:8 > + testFailed("Error occured: " + error.code); typo: occurred
Kinuko Yasuda
Comment 8 Wednesday, October 27, 2010 12:51:35 AM UTC
Created attachment 71966 [details] Patch Fixed the typo.
Kinuko Yasuda
Comment 9 Wednesday, October 27, 2010 12:55:18 AM UTC
Adding 'real' reviewers... could someone take a look at it?
Dumitru Daniliuc
Comment 10 Wednesday, October 27, 2010 11:49:23 PM UTC
Comment on attachment 71966 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71966&action=review r=me, but please address my comments before submitting. > LayoutTests/fast/filesystem/script-tests/filesystem-reference.js:44 > +function runTest1(root) nit/optional: i'd make runTest2() come after runTest1(), and runTest3() come after runTest2(). this way, it's easier (i think) to read the test from top to bottom. > WebCore/fileapi/DOMFileSystemBase.cpp:38 > +#include "DirectoryReaderBase.h" why do we need this #include? Changing DirectoryReaderBase* to PassRefPtr<DirectoryReaderBase> shouldn't require any additional #includes (and the list of #includes in DOMFileSystemBase.h didn't change either). > WebCore/fileapi/DirectoryEntry.cpp:51 > + return DirectoryReader::create(filesystem(), m_fullPath); i think we should be consistent in how we use the fields declared in base classes (EntryBase): either keep them protected, and use m_fileSystem.get() and m_fullPath here, or we should make them private and add public/protected getters and use filesystem() and fullPath() here. > WebCore/fileapi/DirectoryEntrySync.cpp:51 > + return DirectoryReaderSync::create(filesystem(), m_fullPath); same comment: let's make this consistent; either use the members directly, or provide getters for all of them. > WebCore/fileapi/EntrySync.cpp:50 > + return adoptRef(new FileEntrySync(entry->filesystem(), entry->m_fullPath)); ditto. > WebCore/fileapi/EntrySync.cpp:102 > + return DirectoryEntrySync::create(filesystem(), parentPath); ditto.
Kinuko Yasuda
Comment 11 Thursday, October 28, 2010 4:18:31 AM UTC
Note You need to log in before you can comment on or make changes to this bug.