Changeset 70741 in webkit
- Timestamp:
- Oct 27, 2010 8:18:10 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70740 r70741 1 2010-10-27 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by Dumitru Daniliuc. 4 5 DOMFileSystem's reference should be kept while there're any active Entries/callbacks 6 https://bugs.webkit.org/show_bug.cgi?id=47535 7 8 * fast/filesystem/filesystem-reference-expected.txt: Added. 9 * fast/filesystem/filesystem-reference.html: Added. 10 * fast/filesystem/script-tests/filesystem-reference.js: Added. 11 1 12 2010-10-27 Yuzo Fujishima <yuzo@google.com> 2 13 -
trunk/WebCore/ChangeLog
r70740 r70741 1 2010-10-27 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by Dumitru Daniliuc. 4 5 DOMFileSystem's reference should be kept while there're any active Entries/callbacks 6 https://bugs.webkit.org/show_bug.cgi?id=47535 7 8 Changed to keep DOMFileSystem's reference in each EntryBase, DirectoryReaderBase, EntryCallbacks and EntriesCallbacks. 9 10 Test: fast/filesystem/filesystem-reference.html 11 12 * fileapi/DOMFileSystemBase.cpp: 13 (WebCore::DOMFileSystemBase::readDirectory): Changed to pass/take 14 PassRefPtr but not a raw pointer. 15 * fileapi/DOMFileSystemBase.h: 16 * fileapi/DirectoryEntry.cpp: 17 (WebCore::DirectoryEntry::DirectoryEntry): Ditto. 18 (WebCore::DirectoryEntry::createReader): 19 * fileapi/DirectoryEntry.h: 20 (WebCore::DirectoryEntry::create): Ditto. 21 * fileapi/DirectoryEntrySync.cpp: 22 (WebCore::DirectoryEntrySync::DirectoryEntrySync): Ditto. 23 * fileapi/DirectoryEntrySync.h: 24 (WebCore::DirectoryEntrySync::create): Ditto. 25 * fileapi/DirectoryReader.h: 26 (WebCore::DirectoryReader::filesystem): 27 * fileapi/DirectoryReaderBase.h: 28 (WebCore::DirectoryReaderBase::filesystem): 29 * fileapi/Entry.cpp: 30 (WebCore::Entry::Entry): Ditto. 31 * fileapi/Entry.h: 32 (WebCore::Entry::filesystem): 33 * fileapi/EntryBase.h: 34 (WebCore::EntryBase::filesystem): 35 (WebCore::EntryBase::EntryBase): Ditto. 36 * fileapi/EntrySync.cpp: 37 (WebCore::EntrySync::create): Ditto. 38 (WebCore::EntrySync::getParent): 39 (WebCore::EntrySync::EntrySync): Ditto. 40 * fileapi/EntrySync.h: 41 (WebCore::EntrySync::filesystem): 42 * fileapi/FileEntry.cpp: 43 (WebCore::FileEntry::FileEntry): Ditto. 44 * fileapi/FileEntry.h: 45 (WebCore::FileEntry::create): Ditto. 46 * fileapi/FileEntrySync.cpp: 47 (WebCore::FileEntrySync::FileEntrySync): Ditto. 48 * fileapi/FileEntrySync.h: 49 (WebCore::FileEntrySync::create): Ditto. 50 * fileapi/FileSystemCallbacks.cpp: 51 (WebCore::EntriesCallbacks::create): Ditto. 52 (WebCore::EntriesCallbacks::EntriesCallbacks): Ditto. 53 * fileapi/FileSystemCallbacks.h: 54 1 55 2010-10-27 Yuzo Fujishima <yuzo@google.com> 2 56 -
trunk/WebCore/fileapi/DOMFileSystemBase.cpp
r69485 r70741 36 36 #include "DOMFilePath.h" 37 37 #include "DirectoryEntry.h" 38 #include "DirectoryReaderBase.h" 38 39 #include "EntriesCallback.h" 39 40 #include "EntryArray.h" … … 191 192 } 192 193 193 bool DOMFileSystemBase::readDirectory( DirectoryReaderBase*reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)194 bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 194 195 { 195 196 ASSERT(DOMFilePath::isAbsolute(path)); -
trunk/WebCore/fileapi/DOMFileSystemBase.h
r69485 r70741 73 73 bool getFile(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); 74 74 bool getDirectory(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); 75 bool readDirectory( DirectoryReaderBase*, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);75 bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>); 76 76 77 77 protected: -
trunk/WebCore/fileapi/DirectoryEntry.cpp
r70438 r70741 42 42 namespace WebCore { 43 43 44 DirectoryEntry::DirectoryEntry( DOMFileSystemBase*fileSystem, const String& fullPath)44 DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 45 45 : Entry(fileSystem, fullPath) 46 46 { -
trunk/WebCore/fileapi/DirectoryEntry.h
r69485 r70741 50 50 class DirectoryEntry : public Entry { 51 51 public: 52 static PassRefPtr<DirectoryEntry> create( DOMFileSystemBase*fileSystem, const String& fullPath)52 static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 53 53 { 54 54 return adoptRef(new DirectoryEntry(fileSystem, fullPath)); … … 62 62 63 63 private: 64 DirectoryEntry( DOMFileSystemBase*, const String& fullPath);64 DirectoryEntry(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 65 65 }; 66 66 -
trunk/WebCore/fileapi/DirectoryEntrySync.cpp
r70438 r70741 42 42 namespace WebCore { 43 43 44 DirectoryEntrySync::DirectoryEntrySync( DOMFileSystemBase*fileSystem, const String& fullPath)44 DirectoryEntrySync::DirectoryEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 45 45 : EntrySync(fileSystem, fullPath) 46 46 { -
trunk/WebCore/fileapi/DirectoryEntrySync.h
r69485 r70741 47 47 class DirectoryEntrySync : public EntrySync { 48 48 public: 49 static PassRefPtr<DirectoryEntrySync> create( DOMFileSystemBase*fileSystem, const String& fullPath)49 static PassRefPtr<DirectoryEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 50 50 { 51 51 return adoptRef(new DirectoryEntrySync(fileSystem, fullPath)); … … 60 60 private: 61 61 friend class EntrySync; 62 DirectoryEntrySync( DOMFileSystemBase*, const String& fullPath);62 DirectoryEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 63 63 }; 64 64 -
trunk/WebCore/fileapi/DirectoryReader.cpp
r69178 r70741 41 41 namespace WebCore { 42 42 43 DirectoryReader::DirectoryReader( DOMFileSystemBase*fileSystem, const String& fullPath)43 DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 44 44 : DirectoryReaderBase(fileSystem, fullPath) 45 45 { -
trunk/WebCore/fileapi/DirectoryReader.h
r69178 r70741 48 48 class DirectoryReader : public DirectoryReaderBase { 49 49 public: 50 static PassRefPtr<DirectoryReader> create( DOMFileSystemBase*fileSystem, const String& fullPath)50 static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 51 51 { 52 52 return adoptRef(new DirectoryReader(fileSystem, fullPath)); … … 55 55 void readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback> = 0); 56 56 57 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem ); }57 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); } 58 58 59 59 private: 60 DirectoryReader( DOMFileSystemBase*, const String& fullPath);60 DirectoryReader(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 61 61 }; 62 62 -
trunk/WebCore/fileapi/DirectoryReaderBase.h
r69907 r70741 43 43 class DirectoryReaderBase : public RefCounted<DirectoryReaderBase> { 44 44 public: 45 DOMFileSystemBase* filesystem() const { return m_fileSystem ; }45 DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); } 46 46 void setHasMoreEntries(bool hasMoreEntries) { m_hasMoreEntries = hasMoreEntries; } 47 47 48 48 protected: 49 DirectoryReaderBase( DOMFileSystemBase*fileSystem, const String& fullPath)49 DirectoryReaderBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 50 50 : m_fileSystem(fileSystem) 51 51 , m_fullPath(fullPath) … … 54 54 } 55 55 56 DOMFileSystemBase*m_fileSystem;56 RefPtr<DOMFileSystemBase> m_fileSystem; 57 57 58 58 // This is a virtual path. -
trunk/WebCore/fileapi/DirectoryReaderSync.cpp
r70438 r70741 45 45 namespace WebCore { 46 46 47 DirectoryReaderSync::DirectoryReaderSync( DOMFileSystemBase*fileSystem, const String& fullPath)47 DirectoryReaderSync::DirectoryReaderSync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 48 48 : DirectoryReaderBase(fileSystem, fullPath) 49 49 { -
trunk/WebCore/fileapi/DirectoryReaderSync.h
r69178 r70741 44 44 class DirectoryReaderSync : public DirectoryReaderBase { 45 45 public: 46 static PassRefPtr<DirectoryReaderSync> create( DOMFileSystemBase*fileSystem, const String& fullPath)46 static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 47 47 { 48 48 return adoptRef(new DirectoryReaderSync(fileSystem, fullPath)); … … 52 52 53 53 private: 54 DirectoryReaderSync( DOMFileSystemBase*, const String& fullPath);54 DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 55 55 }; 56 56 -
trunk/WebCore/fileapi/Entry.cpp
r70438 r70741 43 43 namespace WebCore { 44 44 45 Entry::Entry( DOMFileSystemBase*fileSystem, const String& fullPath)45 Entry::Entry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 46 46 : EntryBase(fileSystem, fullPath) 47 47 { -
trunk/WebCore/fileapi/Entry.h
r69485 r70741 50 50 class Entry : public EntryBase { 51 51 public: 52 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem ); }52 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); } 53 53 54 54 void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); … … 61 61 62 62 protected: 63 Entry( DOMFileSystemBase*, const String& fullPath);63 Entry(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 64 64 }; 65 65 -
trunk/WebCore/fileapi/EntryBase.h
r69907 r70741 49 49 virtual ~EntryBase() { } 50 50 51 DOMFileSystemBase* filesystem() const { return m_fileSystem ; }51 DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); } 52 52 53 53 virtual bool isFile() const { return false; } … … 58 58 59 59 protected: 60 EntryBase( DOMFileSystemBase*fileSystem, const String& fullPath)60 EntryBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 61 61 : m_fileSystem(fileSystem) 62 62 , m_fullPath(fullPath) … … 67 67 friend class EntrySync; 68 68 69 DOMFileSystemBase*m_fileSystem;69 RefPtr<DOMFileSystemBase> m_fileSystem; 70 70 71 71 // This is a virtual path. -
trunk/WebCore/fileapi/EntrySync.cpp
r70438 r70741 103 103 } 104 104 105 EntrySync::EntrySync( DOMFileSystemBase*fileSystem, const String& fullPath)105 EntrySync::EntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 106 106 : EntryBase(fileSystem, fullPath) 107 107 { -
trunk/WebCore/fileapi/EntrySync.h
r69485 r70741 50 50 static PassRefPtr<EntrySync> create(EntryBase*); 51 51 52 DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem ); }52 DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem.get()); } 53 53 54 54 PassRefPtr<Metadata> getMetadata(ExceptionCode&); … … 59 59 60 60 protected: 61 EntrySync( DOMFileSystemBase*, const String& fullPath);61 EntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 62 62 }; 63 63 -
trunk/WebCore/fileapi/FileEntry.cpp
r69907 r70741 42 42 namespace WebCore { 43 43 44 FileEntry::FileEntry( DOMFileSystemBase*fileSystem, const String& fullPath)44 FileEntry::FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 45 45 : Entry(fileSystem, fullPath) 46 46 { -
trunk/WebCore/fileapi/FileEntry.h
r69249 r70741 44 44 class FileEntry : public Entry { 45 45 public: 46 static PassRefPtr<FileEntry> create( DOMFileSystemBase*fileSystem, const String& fullPath)46 static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 47 47 { 48 48 return adoptRef(new FileEntry(fileSystem, fullPath)); … … 55 55 56 56 private: 57 FileEntry( DOMFileSystemBase*fileSystem, const String& fullPath);57 FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath); 58 58 }; 59 59 -
trunk/WebCore/fileapi/FileEntrySync.cpp
r69907 r70741 38 38 namespace WebCore { 39 39 40 FileEntrySync::FileEntrySync( DOMFileSystemBase*fileSystem, const String& fullPath)40 FileEntrySync::FileEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 41 41 : EntrySync(fileSystem, fullPath) 42 42 { -
trunk/WebCore/fileapi/FileEntrySync.h
r69907 r70741 45 45 class FileEntrySync : public EntrySync { 46 46 public: 47 static PassRefPtr<FileEntrySync> create( DOMFileSystemBase*fileSystem, const String& fullPath)47 static PassRefPtr<FileEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) 48 48 { 49 49 return adoptRef(new FileEntrySync(fileSystem, fullPath)); … … 56 56 private: 57 57 friend class EntrySync; 58 FileEntrySync( DOMFileSystemBase*, const String& fullPath);58 FileEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); 59 59 }; 60 60 -
trunk/WebCore/fileapi/FileSystemCallbacks.cpp
r70438 r70741 111 111 // EntryCallbacks ------------------------------------------------------------- 112 112 113 PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase*fileSystem, const String& expectedPath, bool isDirectory)113 PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory) 114 114 { 115 115 return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory)); 116 116 } 117 117 118 EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase*fileSystem, const String& expectedPath, bool isDirectory)118 EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory) 119 119 : FileSystemCallbacksBase(errorCallback) 120 120 , m_successCallback(successCallback) … … 138 138 // EntriesCallbacks ----------------------------------------------------------- 139 139 140 PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase*directoryReader, const String& basePath)140 PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath) 141 141 { 142 142 return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath)); 143 143 } 144 144 145 EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase*directoryReader, const String& basePath)145 EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath) 146 146 : FileSystemCallbacksBase(errorCallback) 147 147 , m_successCallback(successCallback) -
trunk/WebCore/fileapi/FileSystemCallbacks.h
r69249 r70741 87 87 class EntryCallbacks : public FileSystemCallbacksBase { 88 88 public: 89 static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);89 static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory); 90 90 virtual void didSucceed(); 91 91 92 92 private: 93 EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);93 EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory); 94 94 RefPtr<EntryCallback> m_successCallback; 95 DOMFileSystemBase*m_fileSystem;95 RefPtr<DOMFileSystemBase> m_fileSystem; 96 96 String m_expectedPath; 97 97 bool m_isDirectory; … … 100 100 class EntriesCallbacks : public FileSystemCallbacksBase { 101 101 public: 102 static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);102 static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath); 103 103 virtual void didReadDirectoryEntry(const String& name, bool isDirectory); 104 104 virtual void didReadDirectoryEntries(bool hasMore); 105 105 106 106 private: 107 EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);107 EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath); 108 108 RefPtr<EntriesCallback> m_successCallback; 109 DirectoryReaderBase*m_directoryReader;109 RefPtr<DirectoryReaderBase> m_directoryReader; 110 110 String m_basePath; 111 111 RefPtr<EntryArray> m_entries;
Note: See TracChangeset
for help on using the changeset viewer.