Changeset 69485 in webkit
- Timestamp:
- Oct 11, 2010 4:21:28 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69484 r69485 1 2010-10-11 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by David Levin. 4 5 Support DirectoryEntry.removeRecursively for FileSystem API 6 https://bugs.webkit.org/show_bug.cgi?id=47400 7 8 * fast/filesystem/resources/async-operations.js: 9 * fast/filesystem/resources/fs-test-util.js: 10 (removeAllInDirectory): renamed from removeRecursively and changed 11 the implemntation to use DirectoryEntry.removeRecursively. 12 * fast/filesystem/resources/fs-worker-common.js: 13 (removeAllInDirectorySync): ditto. 14 * fast/filesystem/resources/op-remove.js: Added removeRecursively test. 15 * fast/filesystem/resources/op-tests-helper.js: 16 (runOperationTest.OperationTestHelper.this.removeRecursively): Added. 17 * fast/filesystem/resources/sync-operations.js: 18 * fast/filesystem/script-tests/file-from-file-entry.js: 19 * fast/filesystem/script-tests/read-directory.js: 20 1 21 2010-10-11 Alexander Pavlov <apavlov@chromium.org> 2 22 -
trunk/LayoutTests/fast/filesystem/op-remove-expected.txt
r69339 r69485 2 2 PASS Succeeded: "/a".remove() 3 3 PASS Succeeded: "/b".remove() 4 PASS this.expectedErrorCode + "" is "13" 4 5 PASS Verified entry does NOT exist: /a 5 6 PASS Verified entry does NOT exist: /b … … 9 10 PASS Verified entry: ENTRY {path:/a/b name:b type:DIRECTORY} 10 11 PASS Verified entry: ENTRY {path:/a/c name:c type:FILE} 12 * Running: RemoveRecursiveWithoutChildren 13 PASS Succeeded: "/a".removeRecursively() 14 PASS Verified entry does NOT exist: /a 15 * Running: RemoveRecursiveWithChildren 16 PASS Succeeded: "/a".removeRecursively() 17 PASS this.expectedErrorCode + "" is "13" 18 PASS Verified entry does NOT exist: /a 11 19 Finished running tests. 12 20 PASS successfullyParsed is true -
trunk/LayoutTests/fast/filesystem/resources/async-operations.js
r69249 r69485 19 19 function errorCallback(error) { 20 20 debug("Got error: " + error.code); 21 remove Recursively(fileSystem.root);21 removeAllInDirectory(fileSystem.root); 22 22 finishJSTest(); 23 23 } … … 35 35 shouldBe('"' + paths.join(',') + '"', '"/a,/b,/c,/d2,/e,/f"'); 36 36 shouldBe("dirsCount", "3"); 37 remove Recursively(fileSystem.root);37 removeAllInDirectory(fileSystem.root); 38 38 finishJSTest(); 39 39 } … … 98 98 debug("Got FileSystem:" + fs.name); 99 99 fileSystem = fs; 100 remove Recursively(fileSystem.root, function(){ helper.done(); }, errorCallback);100 removeAllInDirectory(fileSystem.root, function(){ helper.done(); }, errorCallback); 101 101 }, errorCallback]); }); 102 102 debug("requested FileSystem."); -
trunk/LayoutTests/fast/filesystem/resources/fs-test-util.js
r69249 r69485 47 47 }; 48 48 49 // FIXME: replace this code with the equivalent File API method once it fully supports removeRecursively. 50 function removeRecursively(directory, successCallback, errorCallback) { 51 var RemoveRecursiveHelper = function(successCallback, errorCallback) { 52 this.removeDirMap = {}; 49 // Remove everything in the given directory. 50 function removeAllInDirectory(directory, successCallback, errorCallback) { 51 var RemoveAllInDirectoryHelper = function(successCallback, errorCallback) { 52 this.entriesCount = 0; 53 this.reader = null; 53 54 this.successCallback = successCallback; 54 55 this.errorCallback = errorCallback; 55 56 56 this. removeRecursively = function(directory)57 this.entryRemovedCallback = bindCallback(this, function(entry) 57 58 { 58 this.removeRecursivelyInternal(directory); 59 }; 59 if (--this.entriesCount == 0 && this.successCallback) 60 this.successCallback(); 61 }); 60 62 61 this.hasMoreEntries = function(hash) 62 { 63 for (k in hash) 64 return true; 65 return false; 66 }; 67 68 this.removeDirectory = function(directory, parentDirectory) 69 { 70 if (directory.fullPath != '/') { 71 // Ok to remove the parent directory. 72 directory.remove(bindCallback(this, this.entryRemovedCallback, parentDirectory, directory), bindCallback(this, this.ErrorCallback)); 73 } else 74 delete this.removeDirMap[directory.fullPath]; 75 if (!this.hasMoreEntries(this.removeDirMap) && this.successCallback) 76 this.successCallback(); 77 }; 78 79 this.entryRemovedCallback = function(directory, entry) 80 { 81 if (entry.isDirectory) 82 delete this.removeDirMap[entry.fullPath]; 83 84 if (directory) { 85 var dirInfo = this.removeDirMap[directory.fullPath]; 86 if (--dirInfo.entries == 0 && dirInfo.hasMore == false) 87 this.removeDirectory(directory, dirInfo.parentDirectory); 88 } 89 }; 90 91 this.removeRecursivelyCallback = function(entries, directory) 63 this.entriesCallback = bindCallback(this, function(entries) 92 64 { 93 65 for (var i = 0; i < entries.length; ++i) { 94 this. removeDirMap[directory.fullPath].entries++;66 this.entriesCount++; 95 67 if (entries[i].isDirectory) 96 this.removeRecursivelyInternal(entries[i], directory);68 entries[i].removeRecursively(this.entryRemovedCallback, this.errorCallback); 97 69 else { 98 var entry = entries[i]; 99 entry.remove(bindCallback(this, this.entryRemovedCallback, directory, entry), bindCallback(this, this.errorCallback)); 70 entries[i].remove(this.entryRemovedCallback, this.errorCallback); 100 71 } 101 72 } 102 if (entries.length) { 103 this.removeDirMap[directory.fullPath].reader.readEntries(bindCallback(this, this.removeRecursivelyCallback, directory), bindCallback(this, this.errorCallback)); 104 } else { 105 var dirInfo = this.removeDirMap[directory.fullPath]; 106 dirInfo.hasMore = false; 107 if (dirInfo.entries == 0) 108 this.removeDirectory(directory, dirInfo.parentDirectory); 109 } 110 }; 73 if (entries.length) 74 this.reader.readEntries(this.entriesCallback, this.errorCallback); 75 else if (this.entriesCount == 0 && this.successCallback) 76 this.successCallback(); 77 }); 111 78 112 this.remove RecursivelyInternal = function(directory, parentDirectory)79 this.removeAllInDirectory = function(directory) 113 80 { 114 directoryReader = directory.createReader(); 115 this.removeDirMap[directory.fullPath] = { 116 hasMore: true, 117 parentDirectory: parentDirectory, 118 entries: 0, 119 reader: directoryReader, 120 }; 121 directoryReader.readEntries(bindCallback(this, this.removeRecursivelyCallback, directory), bindCallback(this, this.errorCallback)); 81 this.reader = directory.createReader(); 82 this.reader.readEntries(this.entriesCallback, this.errorCallback); 122 83 }; 123 84 }; 124 85 125 var helper = new Remove RecursiveHelper(successCallback, errorCallback);126 helper.remove Recursively(directory);86 var helper = new RemoveAllInDirectoryHelper(successCallback, errorCallback); 87 helper.removeAllInDirectory(directory); 127 88 } -
trunk/LayoutTests/fast/filesystem/resources/fs-worker-common.js
r69249 r69485 28 28 function shouldBeTrue(_a) { shouldBe(_a, "true"); } 29 29 30 function remove RecursivelySync(directory) {30 function removeAllInDirectorySync(directory) { 31 31 if (!directory) 32 32 return; … … 36 36 for (var i = 0; i < entries.length; ++i) { 37 37 if (entries[i].isDirectory) 38 removeRecursivelySync(entries[i]);38 entries[i].removeRecursively(); 39 39 else 40 40 entries[i].remove(); 41 41 } 42 42 } while (entries.length); 43 if (directory.fullPath != '/')44 directory.remove();45 43 } 46 44 -
trunk/LayoutTests/fast/filesystem/resources/op-remove.js
r69339 r69485 8 8 tests: [ 9 9 function(helper) { helper.remove('/a'); }, 10 function(helper) { helper.remove('/b'); } 10 function(helper) { helper.remove('/b'); }, 11 function(helper) { helper.remove('/', FileError.INVALID_MODIFICATION_ERR); } 11 12 ], 12 13 postcondition: [ … … 31 32 ], 32 33 }, 34 { 35 name: 'RemoveRecursiveWithoutChildren', 36 precondition: [ 37 {fullPath:'/a', isDirectory:true}, 38 ], 39 tests: [ 40 function(helper) { helper.removeRecursively('/a'); } 41 ], 42 postcondition: [ 43 {fullPath:'/a', nonexistent:true}, 44 ], 45 }, 46 { 47 name: 'RemoveRecursiveWithChildren', 48 precondition: [ 49 {fullPath:'/a', isDirectory:true}, 50 {fullPath:'/a/b', isDirectory:true}, 51 {fullPath:'/a/c',} 52 ], 53 tests: [ 54 function(helper) { helper.removeRecursively('/a'); }, 55 function(helper) { helper.removeRecursively('/', FileError.INVALID_MODIFICATION_ERR); } 56 ], 57 postcondition: [ 58 {fullPath:'/a', nonexistent:true}, 59 ], 60 }, 33 61 ]; 34 62 -
trunk/LayoutTests/fast/filesystem/resources/op-tests-helper.js
r69339 r69485 264 264 }; 265 265 266 this.removeRecursively = function(entry, expectedErrorCode) 267 { 268 this.expectedErrorCode = expectedErrorCode; 269 this.stage = '"' + entry + '".removeRecursively()'; 270 this.environment[entry].removeRecursively(bindCallback(this, this.testSuccessCallback), bindCallback(this, this.testErrorCallback)); 271 }; 272 266 273 this.readDirectory = function(entry, expectedErrorCode) 267 274 { … … 292 299 this.expectedErrorCode = ''; 293 300 this.stage = 'resetting filesystem'; 294 remove Recursively(this.fileSystem.root, bindCallback(this, this.setUp), bindCallback(this, this.testErrorCallback));301 removeAllInDirectory(this.fileSystem.root, bindCallback(this, this.setUp), bindCallback(this, this.testErrorCallback)); 295 302 }; 296 303 -
trunk/LayoutTests/fast/filesystem/resources/sync-operations.js
r69249 r69485 7 7 8 8 var fileSystem = requestFileSystemSync(this.TEMPORARY, 100); 9 remove RecursivelySync(fileSystem.root);9 removeAllInDirectorySync(fileSystem.root); 10 10 11 11 // Stage 1 (prepare) … … 39 39 shouldBe('"' + paths.join(',') + '"', '"/a,/b,/c,/d2,/e,/f"'); 40 40 shouldBe("dirsCount", "3"); 41 remove RecursivelySync(fileSystem.root);41 removeAllInDirectorySync(fileSystem.root); 42 42 finishJSTest(); 43 43 -
trunk/LayoutTests/fast/filesystem/script-tests/file-from-file-entry.js
r69165 r69485 30 30 function fileSystemCallback(fs) { 31 31 fileSystem = fs; 32 remove Recursively(fileSystem.root, createTestFile, errorCallback);32 removeAllInDirectory(fileSystem.root, createTestFile, errorCallback); 33 33 } 34 34 -
trunk/LayoutTests/fast/filesystem/script-tests/read-directory.js
r68735 r69485 20 20 function endTest() 21 21 { 22 remove Recursively(fileSystem.root);22 removeAllInDirectory(fileSystem.root); 23 23 finishJSTest(); 24 24 } … … 86 86 fileSystem = fs; 87 87 debug("Successfully obtained Persistent FileSystem:" + fileSystem.name); 88 remove Recursively(fileSystem.root, prepareForTest, errorCallback);88 removeAllInDirectory(fileSystem.root, prepareForTest, errorCallback); 89 89 } 90 90 -
trunk/LayoutTests/platform/chromium-linux/fast/filesystem/async-operations-expected.txt
r69337 r69485 14 14 15 15 TEST COMPLETE 16 -
trunk/WebCore/ChangeLog
r69482 r69485 1 2010-10-11 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by David Levin. 4 5 Support DirectoryEntry.removeRecursively for FileSystem API 6 https://bugs.webkit.org/show_bug.cgi?id=47400 7 8 Also disallows remove/removeRecursively on the root directory. 9 10 Test: fast/filesystem/op-remove.html 11 12 * fileapi/DOMFileSystemBase.cpp: 13 (WebCore::DOMFileSystemBase::removeRecursively): Added. 14 * fileapi/DOMFileSystemBase.h: 15 * fileapi/DirectoryEntry.cpp: 16 (WebCore::DirectoryEntry::removeRecursively): Added. 17 * fileapi/DirectoryEntry.h: 18 * fileapi/DirectoryEntry.idl: 19 * fileapi/DirectoryEntrySync.cpp: 20 (WebCore::DirectoryEntrySync::removeRecursively): Added. 21 * fileapi/DirectoryEntrySync.h: 22 * fileapi/DirectoryEntrySync.idl: 23 * platform/AsyncFileSystem.h: 24 1 25 2010-10-11 Dirk Schulze <krit@webkit.org> 2 26 -
trunk/WebCore/fileapi/DOMFileSystemBase.cpp
r69382 r69485 133 133 { 134 134 ASSERT(entry); 135 // We don't allow calling remove() on the root directory. 136 if (entry->fullPath() == String(DOMFilePath::root)) 137 return false; 135 138 String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath()); 136 139 m_asyncFileSystem->remove(platformPath, VoidCallbacks::create(successCallback, errorCallback)); 140 return true; 141 } 142 143 bool DOMFileSystemBase::removeRecursively(const EntryBase* entry, PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 144 { 145 ASSERT(entry && entry->isDirectory()); 146 // We don't allow calling remove() on the root directory. 147 if (entry->fullPath() == String(DOMFilePath::root)) 148 return false; 149 String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath()); 150 m_asyncFileSystem->removeRecursively(platformPath, VoidCallbacks::create(successCallback, errorCallback)); 137 151 return true; 138 152 } -
trunk/WebCore/fileapi/DOMFileSystemBase.h
r69249 r69485 69 69 bool copy(const EntryBase* source, EntryBase* parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); 70 70 bool remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>); 71 bool removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>); 71 72 bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); 72 73 bool getFile(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); -
trunk/WebCore/fileapi/DirectoryEntry.cpp
r69249 r69485 38 38 #include "ErrorCallback.h" 39 39 #include "FileError.h" 40 #include "VoidCallback.h" 40 41 41 42 namespace WebCore { … … 65 66 } 66 67 68 void DirectoryEntry::removeRecursively(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const 69 { 70 RefPtr<ErrorCallback> errorCallback(errorCallbackRef); 71 if (!m_fileSystem->removeRecursively(this, successCallback, errorCallback)) 72 filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR)); 73 } 74 67 75 } 68 76 -
trunk/WebCore/fileapi/DirectoryEntry.h
r69249 r69485 46 46 class EntryCallback; 47 47 class ErrorCallback; 48 class VoidCallback; 48 49 49 50 class DirectoryEntry : public Entry { … … 58 59 void getFile(const String& path, PassRefPtr<Flags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0); 59 60 void getDirectory(const String& path, PassRefPtr<Flags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0); 61 void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const; 60 62 61 63 private: -
trunk/WebCore/fileapi/DirectoryEntry.idl
r67917 r69485 39 39 [Custom] void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback); 40 40 [Custom] void getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback); 41 void removeRecursively(in [Optional, Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback); 41 42 }; 42 43 } -
trunk/WebCore/fileapi/DirectoryEntrySync.cpp
r69249 r69485 73 73 } 74 74 75 void DirectoryEntrySync::removeRecursively(ExceptionCode& ec) 76 { 77 ec = 0; 78 VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem()); 79 if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.errorCallback())) { 80 ec = INVALID_MODIFICATION_ERR; 81 return; 82 } 83 helper.getResult(ec); 84 } 85 75 86 } 76 87 -
trunk/WebCore/fileapi/DirectoryEntrySync.h
r69178 r69485 56 56 PassRefPtr<FileEntrySync> getFile(const String& path, PassRefPtr<Flags>, ExceptionCode&); 57 57 PassRefPtr<DirectoryEntrySync> getDirectory(const String& path, PassRefPtr<Flags>, ExceptionCode&); 58 void removeRecursively(ExceptionCode&); 58 59 59 60 private: -
trunk/WebCore/fileapi/DirectoryEntrySync.idl
r69178 r69485 39 39 [Custom] FileEntrySync getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in Flags flags) raises (FileException); 40 40 [Custom] DirectoryEntrySync getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in Flags flags) raises (FileException); 41 void removeRecursively() raises (FileException); 41 42 }; 42 43 } -
trunk/WebCore/fileapi/Entry.h
r69249 r69485 52 52 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); } 53 53 54 v irtual void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);55 v irtual void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;56 v irtual void copyTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;57 v irtual void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;58 v irtual void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;54 void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); 55 void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; 56 void copyTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; 57 void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; 58 void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; 59 59 60 virtualString toURI(const String& mimeType = String());60 String toURI(const String& mimeType = String()); 61 61 62 62 protected: -
trunk/WebCore/fileapi/EntrySync.cpp
r69249 r69485 88 88 ec = 0; 89 89 VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem()); 90 if (!m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback())) 90 if (!m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback())) { 91 91 ec = INVALID_MODIFICATION_ERR; 92 return; 93 } 92 94 helper.getResult(ec); 93 95 } -
trunk/WebCore/fileapi/EntrySync.h
r69249 r69485 52 52 DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem); } 53 53 54 virtualPassRefPtr<Metadata> getMetadata(ExceptionCode&);55 virtualPassRefPtr<EntrySync> moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const;56 virtualPassRefPtr<EntrySync> copyTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const;57 v irtual void remove(ExceptionCode&) const;58 virtualPassRefPtr<EntrySync> getParent() const;54 PassRefPtr<Metadata> getMetadata(ExceptionCode&); 55 PassRefPtr<EntrySync> moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const; 56 PassRefPtr<EntrySync> copyTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const; 57 void remove(ExceptionCode&) const; 58 PassRefPtr<EntrySync> getParent() const; 59 59 60 60 protected: -
trunk/WebCore/platform/AsyncFileSystem.h
r69249 r69485 81 81 82 82 // Deletes a file or directory at a given path. 83 // It is an error to try to remove a directory that is not empty. 83 84 // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. 84 85 // AsyncFileSystemCallbacks::didFail() is called otherwise. 85 86 virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; 87 88 // Recursively deletes a directory at a given path. 89 // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. 90 // AsyncFileSystemCallbacks::didFail() is called otherwise. 91 virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; 86 92 87 93 // Retrieves the metadata information of the file or directory at a given path. -
trunk/WebKit/chromium/ChangeLog
r69459 r69485 1 2010-10-11 Kinuko Yasuda <kinuko@google.com> 2 3 Reviewed by David Levin. 4 5 Support DirectoryEntry.removeRecursively for FileSystem API 6 https://bugs.webkit.org/show_bug.cgi?id=47400 7 8 * src/AsyncFileSystemChromium.cpp: 9 (WebCore::AsyncFileSystemChromium::removeRecursively): Added. 10 * src/AsyncFileSystemChromium.h: 11 * src/WorkerAsyncFileSystemChromium.cpp: 12 (WebCore::WorkerAsyncFileSystemChromium::removeRecursively): Added. 13 * src/WorkerAsyncFileSystemChromium.h: 14 * src/WorkerFileSystemCallbacksBridge.cpp: 15 (WebKit::WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread): Added. 16 (WebKit::WorkerFileSystemCallbacksBridge::removeRecursivelyOnMainThread): Added. 17 * src/WorkerFileSystemCallbacksBridge.h: 18 1 19 2010-10-09 Varun Jain <varunjain@chromium.org> 2 20 -
trunk/WebKit/chromium/src/AsyncFileSystemChromium.cpp
r68669 r69485 75 75 { 76 76 m_webFileSystem->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); 77 } 78 79 void AsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 80 { 81 m_webFileSystem->removeRecursively(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); 77 82 } 78 83 -
trunk/WebKit/chromium/src/AsyncFileSystemChromium.h
r68669 r69485 57 57 virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); 58 58 virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 59 virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 59 60 virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 60 61 virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); -
trunk/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp
r69249 r69485 100 100 } 101 101 102 void WorkerAsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 103 { 104 createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); 105 } 106 102 107 void WorkerAsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) 103 108 { -
trunk/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h
r69249 r69485 66 66 virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); 67 67 virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 68 virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 68 69 virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); 69 70 virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); -
trunk/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
r68669 r69485 172 172 } 173 173 174 void WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode) 175 { 176 ASSERT(fileSystem); 177 dispatchTaskToMainThread(createCallbackTask(&removeRecursivelyOnMainThread, fileSystem, path, this, mode)); 178 } 179 174 180 void WorkerFileSystemCallbacksBridge::postReadMetadataToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode) 175 181 { … … 229 235 { 230 236 fileSystem->remove(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); 237 } 238 239 void WorkerFileSystemCallbacksBridge::removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode) 240 { 241 fileSystem->removeRecursively(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); 231 242 } 232 243 -
trunk/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
r68669 r69485 89 89 void postCopyToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode); 90 90 void postRemoveToMainThread(WebFileSystem*, const String& path, const String& mode); 91 void postRemoveRecursivelyToMainThread(WebFileSystem*, const String& path, const String& mode); 91 92 void postReadMetadataToMainThread(WebFileSystem*, const String& path, const String& mode); 92 93 void postCreateFileToMainThread(WebFileSystem*, const String& path, bool exclusive, const String& mode); … … 111 112 static void copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode); 112 113 static void removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode); 114 static void removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode); 113 115 static void readMetadataOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode); 114 116 static void createFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, bool exclusive, WorkerFileSystemCallbacksBridge*, const String& mode);
Note: See TracChangeset
for help on using the changeset viewer.