Changeset 69907 in webkit
- Timestamp:
- Oct 15, 2010 7:05:55 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69906 r69907 1 2010-10-15 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by Jian Li. 4 5 Implement FileEntrySync.file() in FileSystem API 6 https://bugs.webkit.org/show_bug.cgi?id=47310 7 8 * fast/filesystem/file-from-file-entry-expected.txt: 9 * fast/filesystem/file-from-file-entry.html: 10 * fast/filesystem/resources/file-from-file-entry-sync.js: Added. 11 * fast/filesystem/resources/file-from-file-entry.js: Added. 12 * fast/filesystem/script-tests/file-from-file-entry.js: Moved to 13 resources to make it available for workers tests too. 14 * fast/filesystem/workers/file-from-file-entry-expected.txt: Added. 15 * fast/filesystem/workers/file-from-file-entry-sync-expected.txt: Added. 16 * fast/filesystem/workers/file-from-file-entry-sync.html: Added. 17 * fast/filesystem/workers/file-from-file-entry.html: Added. 18 1 19 2010-10-15 Oliver Hunt <oliver@apple.com> 2 20 -
trunk/LayoutTests/fast/filesystem/file-from-file-entry-expected.txt
r69165 r69907 1 Obtaining File from FileEntry 1 Obtaining File from FileEntry. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/fast/filesystem/file-from-file-entry.html
r69165 r69907 8 8 <p id="description"></p> 9 9 <div id="console"></div> 10 <script src=" script-tests/file-from-file-entry.js"></script>10 <script src="resources/file-from-file-entry.js"></script> 11 11 <script src="../js/resources/js-test-post.js"></script> 12 12 </body> -
trunk/LayoutTests/fast/filesystem/resources/file-from-file-entry.js
r69905 r69907 1 description("Obtaining File from FileEntry"); 1 if (this.importScripts) { 2 importScripts('fs-worker-common.js'); 3 importScripts('fs-test-util.js'); 4 } 5 6 description("Obtaining File from FileEntry."); 2 7 3 8 var fileSystem = null; … … 33 38 } 34 39 35 if (window.requestFileSystem) { 36 window.jsTestIsAsync = true; 37 requestFileSystem(window.TEMPORARY, 100, fileSystemCallback, errorCallback); 38 } else 39 debug("This test requires FileSystem API support."); 40 41 window.successfullyParsed = true; 40 var jsTestIsAsync = true; 41 requestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); 42 var successfullyParsed = true; -
trunk/WebCore/ChangeLog
r69901 r69907 1 2010-10-15 Kinuko Yasuda <kinuko@google.com> 2 3 Reviewed by Jian Li. 4 5 Implement FileEntrySync.file() in FileSystem API 6 https://bugs.webkit.org/show_bug.cgi?id=47310 7 8 Tests: fast/filesystem/workers/file-from-file-entry-sync.html 9 fast/filesystem/workers/file-from-file-entry.html 10 11 * fileapi/DOMFileSystem.cpp: 12 (WebCore::DOMFileSystem::createFile): Added. 13 * fileapi/DOMFileSystem.h: 14 * fileapi/DOMFileSystemSync.cpp: 15 (WebCore::DOMFileSystemSync::createFile): Added. 16 * fileapi/DOMFileSystemSync.h: 17 * fileapi/DirectoryReaderBase.h: Added 'virtual path' comment. 18 * fileapi/EntryBase.h: Added 'virtual path' comment. 19 * fileapi/FileEntry.cpp: 20 (WebCore::FileEntry::file): Changed to use DOMFileSystem::createFile. 21 * fileapi/FileEntrySync.cpp: 22 (WebCore::FileEntrySync::file): Implemented. 23 * fileapi/FileEntrySync.h: 24 * fileapi/FileEntrySync.idl: Added file(). 25 1 26 2010-10-15 Nico Weber <thakis@chromium.org> 2 27 -
trunk/WebCore/fileapi/DOMFileSystem.cpp
r69249 r69907 38 38 #include "DirectoryEntry.h" 39 39 #include "ErrorCallback.h" 40 #include "File.h" 40 41 #include "FileEntry.h" 41 42 #include "FileSystemCallbacks.h" … … 75 76 } 76 77 77 void DOMFileSystem::createWriter(const FileEntry* file , PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)78 void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 78 79 { 79 ASSERT(file );80 ASSERT(fileEntry); 80 81 81 String platformPath = m_asyncFileSystem->virtualToPlatformPath(file ->fullPath());82 String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath()); 82 83 83 84 RefPtr<FileWriter> fileWriter = FileWriter::create(scriptExecutionContext()); … … 86 87 } 87 88 89 void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback>) 90 { 91 String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath()); 92 scheduleCallback(successCallback, File::create(platformPath)); 93 } 94 88 95 } // namespace 89 96 -
trunk/WebCore/fileapi/DOMFileSystem.h
r69249 r69907 41 41 42 42 class DirectoryEntry; 43 class File; 44 class FileCallback; 43 45 class FileEntry; 44 46 class FileWriterCallback; … … 58 60 virtual void contextDestroyed(); 59 61 60 void createWriter(const FileEntry* file, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>); 62 void createWriter(const FileEntry*, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>); 63 void createFile(const FileEntry*, PassRefPtr<FileCallback>, PassRefPtr<ErrorCallback>); 61 64 62 65 // Schedule a callback. This should not cross threads (should be called on the same context thread). -
trunk/WebCore/fileapi/DOMFileSystemSync.cpp
r69249 r69907 36 36 #include "DOMFilePath.h" 37 37 #include "DirectoryEntrySync.h" 38 #include "File.h" 39 #include "FileEntrySync.h" 38 40 39 41 namespace WebCore { … … 58 60 } 59 61 62 PassRefPtr<File> DOMFileSystemSync::createFile(const FileEntrySync* fileEntry, ExceptionCode& ec) 63 { 64 ec = 0; 65 String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath()); 66 return File::create(platformPath); 67 } 68 60 69 } 61 70 -
trunk/WebCore/fileapi/DOMFileSystemSync.h
r69249 r69907 39 39 40 40 class DirectoryEntrySync; 41 class File; 42 class FileEntrySync; 41 43 42 44 typedef int ExceptionCode; … … 55 57 PassRefPtr<DirectoryEntrySync> root(); 56 58 59 PassRefPtr<File> createFile(const FileEntrySync*, ExceptionCode&); 60 57 61 private: 58 62 DOMFileSystemSync(const String& name, PassOwnPtr<AsyncFileSystem>); -
trunk/WebCore/fileapi/DirectoryReaderBase.h
r69178 r69907 55 55 56 56 DOMFileSystemBase* m_fileSystem; 57 58 // This is a virtual path. 57 59 String m_fullPath; 60 58 61 bool m_hasMoreEntries; 59 62 }; -
trunk/WebCore/fileapi/EntryBase.h
r69249 r69907 68 68 69 69 DOMFileSystemBase* m_fileSystem; 70 71 // This is a virtual path. 70 72 String m_fullPath; 73 71 74 String m_name; 72 75 }; -
trunk/WebCore/fileapi/FileEntry.cpp
r69634 r69907 52 52 } 53 53 54 void FileEntry::file(PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> )54 void FileEntry::file(PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 55 55 { 56 filesystem()-> scheduleCallback(successCallback, File::create(filesystem()->asyncFileSystem()->virtualToPlatformPath(m_fullPath)));56 filesystem()->createFile(this, successCallback, errorCallback); 57 57 } 58 58 -
trunk/WebCore/fileapi/FileEntrySync.cpp
r69178 r69907 34 34 #if ENABLE(FILE_SYSTEM) 35 35 36 #include "File.h" 37 36 38 namespace WebCore { 37 39 … … 41 43 } 42 44 45 PassRefPtr<File> FileEntrySync::file(ExceptionCode& ec) 46 { 47 return filesystem()->createFile(this, ec); 48 } 49 43 50 } 44 51 -
trunk/WebCore/fileapi/FileEntrySync.h
r69178 r69907 41 41 namespace WebCore { 42 42 43 class File; 44 43 45 class FileEntrySync : public EntrySync { 44 46 public: … … 49 51 50 52 virtual bool isFile() const { return true; } 53 54 PassRefPtr<File> file(ExceptionCode&); 51 55 52 56 private: -
trunk/WebCore/fileapi/FileEntrySync.idl
r69178 r69907 36 36 NoStaticTables 37 37 ] FileEntrySync : EntrySync { 38 File file() raises (FileException); 38 39 }; 39 40 }
Note: See TracChangeset
for help on using the changeset viewer.