Changeset 83972 in webkit
- Timestamp:
- Apr 15, 2011 7:35:32 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83969 r83972 1 2011-04-15 Zelidrag Hornung <zelidrag@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Added enums for external file system type. 6 https://bugs.webkit.org/show_bug.cgi?id=58456 7 8 * fileapi/DOMFileSystemBase.cpp: 9 (WebCore::DOMFileSystemBase::crackFileSystemURL): 10 * fileapi/DOMFileSystemBase.h: 11 * fileapi/EntryBase.cpp: 12 (WebCore::EntryBase::toURL): 13 * page/DOMWindow.cpp: 14 (WebCore::DOMWindow::requestFileSystem): 15 * page/DOMWindow.h: 16 * platform/AsyncFileSystem.h: 17 * workers/WorkerContext.cpp: 18 (WebCore::WorkerContext::requestFileSystem): 19 (WebCore::WorkerContext::requestFileSystemSync): 20 * workers/WorkerContext.h: 21 1 22 2011-04-15 Pavel Feldman <pfeldman@google.com> 2 23 -
trunk/Source/WebCore/fileapi/DOMFileSystemBase.cpp
r79917 r83972 55 55 const char DOMFileSystemBase::kTemporaryPathPrefix[] = "temporary"; 56 56 const size_t DOMFileSystemBase::kTemporaryPathPrefixLength = sizeof(DOMFileSystemBase::kTemporaryPathPrefix) - 1; 57 const char DOMFileSystemBase::kExternalPathPrefix[] = "external"; 58 const size_t DOMFileSystemBase::kExternalPathPrefixLength = sizeof(DOMFileSystemBase::kExternalPathPrefix) - 1; 57 59 58 60 bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& type, String& filePath) … … 73 75 type = AsyncFileSystem::Persistent; 74 76 path = path.substring(kPersistentPathPrefixLength); 77 } else if (path.startsWith(kExternalPathPrefix)) { 78 type = AsyncFileSystem::External; 79 path = path.substring(kExternalPathPrefixLength); 75 80 } else 76 81 return false; -
trunk/Source/WebCore/fileapi/DOMFileSystemBase.h
r79917 r83972 67 67 static const char kTemporaryPathPrefix[]; 68 68 static const size_t kTemporaryPathPrefixLength; 69 static const char kExternalPathPrefix[]; 70 static const size_t kExternalPathPrefixLength; 69 71 static bool crackFileSystemURL(const KURL&, AsyncFileSystem::Type&, String& filePath); 70 72 -
trunk/Source/WebCore/fileapi/EntryBase.cpp
r81438 r83972 65 65 result.append(originString); 66 66 result.append("/"); 67 result.append(m_fileSystem->asyncFileSystem()->type() == AsyncFileSystem::Temporary ? DOMFileSystemBase::kTemporaryPathPrefix : DOMFileSystemBase::kPersistentPathPrefix); 67 switch (m_fileSystem->asyncFileSystem()->type()) { 68 case AsyncFileSystem::Temporary: 69 result.append(DOMFileSystemBase::kTemporaryPathPrefix); 70 break; 71 case AsyncFileSystem::Persistent: 72 result.append(DOMFileSystemBase::kPersistentPathPrefix); 73 break; 74 case AsyncFileSystem::External: 75 result.append(DOMFileSystemBase::kExternalPathPrefix); 76 break; 77 } 68 78 result.append(m_fullPath); 69 79 return result.toString(); -
trunk/Source/WebCore/page/DOMWindow.cpp
r83375 r83972 756 756 757 757 AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type); 758 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent ) {758 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) { 759 759 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR)); 760 760 return; … … 789 789 COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch); 790 790 COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch); 791 COMPILE_ASSERT(static_cast<int>(DOMWindow::EXTERNAL) == static_cast<int>(AsyncFileSystem::External), enum_mismatch); 791 792 792 793 #endif -
trunk/Source/WebCore/page/DOMWindow.h
r82925 r83972 387 387 TEMPORARY, 388 388 PERSISTENT, 389 EXTERNAL, 389 390 }; 390 391 void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>); -
trunk/Source/WebCore/platform/AsyncFileSystem.h
r78362 r83972 54 54 Temporary, 55 55 Persistent, 56 External, 56 57 }; 57 58 -
trunk/Source/WebCore/workers/WorkerContext.cpp
r83900 r83972 355 355 356 356 AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type); 357 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent ) {357 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) { 358 358 DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR)); 359 359 return; … … 372 372 373 373 AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type); 374 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent ) {374 if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) { 375 375 ec = FileException::INVALID_MODIFICATION_ERR; 376 376 return 0; … … 431 431 COMPILE_ASSERT(static_cast<int>(WorkerContext::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch); 432 432 COMPILE_ASSERT(static_cast<int>(WorkerContext::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch); 433 COMPILE_ASSERT(static_cast<int>(WorkerContext::EXTERNAL) == static_cast<int>(AsyncFileSystem::External), enum_mismatch); 433 434 #endif 434 435 -
trunk/Source/WebCore/workers/WorkerContext.h
r83900 r83972 131 131 TEMPORARY, 132 132 PERSISTENT, 133 EXTERNAL, 133 134 }; 134 135 void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback>); -
trunk/Source/WebKit/chromium/ChangeLog
r83958 r83972 1 2011-04-15 Zelidrag Hornung <zelidrag@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Added enums for external file system type and exposed factory function 6 for creating File- and DirectoryEntry objects from Chromium side. 7 https://bugs.webkit.org/show_bug.cgi?id=58456 8 9 * public/WebFileSystem.h: 10 * public/WebFrame.h: 11 * src/AssertMatchingEnums.cpp: 12 * src/WebFrameImpl.cpp: 13 (WebKit::WebFrameImpl::createFileSystem): 14 (WebKit::WebFrameImpl::createFileEntry): 15 * src/WebFrameImpl.h: 16 1 17 2011-04-15 Vsevolod Vlasov <vsevik@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/public/WebFileSystem.h
r68741 r83972 41 41 class WebFileWriterClient; 42 42 43 // FIXME(zelidrag): Remove this define once Chromium side catches up. 44 #define WEB_FILE_SYSTEM_TYPE_EXTERNAL 45 43 46 class WebFileSystem { 44 47 public: … … 46 49 TypeTemporary, 47 50 TypePersistent, 51 TypeExternal, 48 52 }; 49 53 -
trunk/Source/WebKit/chromium/public/WebFrame.h
r83366 r83972 33 33 34 34 #include "WebCanvas.h" 35 #include "WebFileSystem.h" 35 36 #include "WebNode.h" 36 37 #include "WebURL.h" … … 73 74 struct WebSize; 74 75 struct WebURLLoaderOptions; 76 75 77 template <typename T> class WebVector; 76 78 … … 264 266 265 267 // Creates an instance of file system object. 266 virtual v8::Handle<v8::Value> createFileSystem( int type,268 virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, 267 269 const WebString& name, 268 270 const WebString& path) = 0; 271 // Creates an instance of file or directory entry object. 272 virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, 273 const WebString& fileSystemName, 274 const WebString& fileSystemPath, 275 const WebString& filePath, 276 bool isDirectory) = 0; 269 277 #endif 270 278 -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r83258 r83972 393 393 COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); 394 394 COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); 395 COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External); 395 396 COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown); 396 397 COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile); -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r83941 r83972 165 165 #include "AsyncFileSystem.h" 166 166 #include "AsyncFileSystemChromium.h" 167 #include "DirectoryEntry.h" 167 168 #include "DOMFileSystem.h" 169 #include "FileEntry.h" 170 #include "V8DirectoryEntry.h" 168 171 #include "V8DOMFileSystem.h" 172 #include "V8FileEntry.h" 173 #include "WebFileSystem.h" 169 174 #endif 170 175 … … 852 857 } 853 858 854 v8::Handle<v8::Value> WebFrameImpl::createFileSystem( inttype,859 v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type, 855 860 const WebString& name, 856 861 const WebString& path) 857 862 { 858 863 return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), path))); 864 } 865 866 v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, 867 const WebString& fileSystemName, 868 const WebString& fileSystemPath, 869 const WebString& filePath, 870 bool isDirectory) 871 { 872 RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), fileSystemPath)); 873 if (isDirectory) 874 return toV8(DirectoryEntry::create(fileSystem, filePath)); 875 return toV8(FileEntry::create(fileSystem, filePath)); 859 876 } 860 877 #endif -
trunk/Source/WebKit/chromium/src/WebFrameImpl.h
r83320 r83972 110 110 const WebScriptSource&); 111 111 virtual v8::Local<v8::Context> mainWorldScriptContext() const; 112 virtual v8::Handle<v8::Value> createFileSystem( int type,112 virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, 113 113 const WebString& name, 114 114 const WebString& path); 115 virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, 116 const WebString& fileSystemName, 117 const WebString& fileSystemPath, 118 const WebString& filePath, 119 bool isDirectory); 115 120 #endif 116 121 virtual bool insertStyleText(const WebString& css, const WebString& id);
Note: See TracChangeset
for help on using the changeset viewer.