Changeset 108556 in webkit
- Timestamp:
- Feb 22, 2012 3:07:26 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r108476 r108556 1602 1602 fileapi/DOMFileSystemBase.cpp 1603 1603 fileapi/DOMFileSystemSync.cpp 1604 fileapi/DOMWindowFileSystem.cpp 1604 1605 fileapi/Entry.cpp 1605 1606 fileapi/EntryArray.cpp … … 1623 1624 fileapi/DOMFileSystem.idl 1624 1625 fileapi/DOMFileSystemSync.idl 1626 fileapi/DOMWindowFileSystem.idl 1625 1627 fileapi/EntriesCallback.idl 1626 1628 fileapi/Entry.idl -
trunk/Source/WebCore/ChangeLog
r108555 r108556 1 2012-02-22 Adam Barth <abarth@webkit.org> 2 3 Move FILE_SYSTEM code out of DOMWindow and into the fileapi folder 4 https://bugs.webkit.org/show_bug.cgi?id=79259 5 6 Reviewed by Eric Seidel. 7 8 This patch is part of our ongoing effort to remove ifdefs from code 9 classes. The FILE_SYSTEM code in DOMWindow doesn't really have any 10 necessary connection to DOMWindow. DOMWindow is just the context 11 object that the API hangs off of. 12 13 This patch moves the FILE_SYSTEM code into the fileapi folder using 14 [Supplemental]. 15 16 * CMakeLists.txt: 17 * DerivedSources.make: 18 * DerivedSources.pri: 19 * GNUmakefile.list.am: 20 * Target.pri: 21 * WebCore.gypi: 22 * fileapi/DOMWindowFileSystem.cpp: Added. 23 (WebCore): 24 (WebCore::DOMWindowFileSystem::DOMWindowFileSystem): 25 (WebCore::DOMWindowFileSystem::~DOMWindowFileSystem): 26 (WebCore::DOMWindowFileSystem::webkitRequestFileSystem): 27 (WebCore::DOMWindowFileSystem::webkitResolveLocalFileSystemURL): 28 * fileapi/DOMWindowFileSystem.h: Added. 29 (WebCore): 30 (DOMWindowFileSystem): 31 * fileapi/DOMWindowFileSystem.idl: Added. 32 * page/DOMWindow.cpp: 33 (WebCore): 34 * page/DOMWindow.h: 35 (WebCore): 36 (DOMWindow): 37 * page/DOMWindow.idl: 38 1 39 2012-02-22 Luke Macpherson <macpherson@chromium.org> 2 40 -
trunk/Source/WebCore/DerivedSources.make
r108464 r108556 159 159 $(WebCore)/fileapi/DOMFileSystem.idl \ 160 160 $(WebCore)/fileapi/DOMFileSystemSync.idl \ 161 $(WebCore)/fileapi/DOMWindowFileSystem.idl \ 161 162 $(WebCore)/fileapi/DirectoryEntry.idl \ 162 163 $(WebCore)/fileapi/DirectoryEntrySync.idl \ -
trunk/Source/WebCore/DerivedSources.pri
r108464 r108556 190 190 $$PWD/fileapi/DOMFileSystem.idl \ 191 191 $$PWD/fileapi/DOMFileSystemSync.idl \ 192 $$PWD/fileapi/DOMWindowFileSystem.idl \ 192 193 $$PWD/fileapi/EntriesCallback.idl \ 193 194 $$PWD/fileapi/Entry.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r108476 r108556 1874 1874 Source/WebCore/fileapi/DOMFileSystemSync.cpp \ 1875 1875 Source/WebCore/fileapi/DOMFileSystemSync.h \ 1876 Source/WebCore/fileapi/DOMWindowFileSystem.cpp \ 1877 Source/WebCore/fileapi/DOMWindowFileSystem.h \ 1876 1878 Source/WebCore/fileapi/EntriesCallback.h \ 1877 1879 Source/WebCore/fileapi/Entry.cpp \ … … 4834 4836 $(WebCore)/fileapi/DOMFileSystem.idl \ 4835 4837 $(WebCore)/fileapi/DOMFileSystemSync.idl \ 4838 $(WebCore)/fileapi/DOMWindowFileSystem.idl \ 4836 4839 $(WebCore)/fileapi/DirectoryEntry.idl \ 4837 4840 $(WebCore)/fileapi/DirectoryEntrySync.idl \ -
trunk/Source/WebCore/Target.pri
r108498 r108556 657 657 fileapi/DOMFileSystemBase.cpp \ 658 658 fileapi/DOMFileSystemSync.cpp \ 659 fileapi/DOMWindowFileSystem.cpp \ 659 660 fileapi/DirectoryEntry.cpp \ 660 661 fileapi/DirectoryEntrySync.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r108532 r108556 833 833 'fileapi/DOMFileSystem.idl', 834 834 'fileapi/DOMFileSystemSync.idl', 835 'fileapi/DOMWindowFileSystem.idl', 835 836 'fileapi/EntriesCallback.idl', 836 837 'fileapi/Entry.idl', … … 2233 2234 'fileapi/DOMFileSystemSync.cpp', 2234 2235 'fileapi/DOMFileSystemSync.h', 2236 'fileapi/DOMWindowFileSystem.cpp', 2237 'fileapi/DOMWindowFileSystem.h', 2235 2238 'fileapi/DirectoryEntry.cpp', 2236 2239 'fileapi/DirectoryEntry.h', -
trunk/Source/WebCore/page/DOMWindow.cpp
r108428 r108556 103 103 #include <wtf/text/WTFString.h> 104 104 105 #if ENABLE(FILE_SYSTEM)106 #include "AsyncFileSystem.h"107 #include "DOMFileSystem.h"108 #include "EntryCallback.h"109 #include "ErrorCallback.h"110 #include "FileError.h"111 #include "FileSystemCallback.h"112 #include "FileSystemCallbacks.h"113 #include "LocalFileSystem.h"114 #endif115 116 105 #if ENABLE(REQUEST_ANIMATION_FRAME) 117 106 #include "RequestAnimationFrameCallback.h" … … 754 743 #endif 755 744 756 #if ENABLE(FILE_SYSTEM)757 void DOMWindow::webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)758 {759 if (!isCurrentlyDisplayedInFrame())760 return;761 762 Document* document = this->document();763 if (!document)764 return;765 766 if (!AsyncFileSystem::isAvailable() || !document->securityOrigin()->canAccessFileSystem()) {767 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR));768 return;769 }770 771 AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);772 if (!AsyncFileSystem::isValidType(fileSystemType)) {773 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));774 return;775 }776 777 LocalFileSystem::localFileSystem().requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document), false);778 }779 780 void DOMWindow::webkitResolveLocalFileSystemURL(const String& url, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)781 {782 if (!isCurrentlyDisplayedInFrame())783 return;784 785 Document* document = this->document();786 if (!document)787 return;788 789 SecurityOrigin* securityOrigin = document->securityOrigin();790 KURL completedURL = document->completeURL(url);791 if (!AsyncFileSystem::isAvailable() || !securityOrigin->canAccessFileSystem() || !securityOrigin->canRequest(completedURL)) {792 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR));793 return;794 }795 796 AsyncFileSystem::Type type;797 String filePath;798 if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {799 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::ENCODING_ERR));800 return;801 }802 803 LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, filePath));804 }805 806 COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);807 COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);808 809 #endif810 811 745 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) 812 746 { -
trunk/Source/WebCore/page/DOMWindow.h
r108428 r108556 47 47 class Document; 48 48 class Element; 49 class EntryCallback;50 class ErrorCallback;51 49 class EventListener; 52 class FileSystemCallback;53 50 class FloatRect; 54 51 class Frame; … … 359 356 // They are placed here and in all capital letters so they can be checked against the constants in the 360 357 // IDL at compile time. 358 // FIXME: Move these constants to DOMWindowFileSystem. 361 359 enum FileSystemType { 362 360 TEMPORARY, 363 361 PERSISTENT, 364 362 }; 365 void webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);366 void webkitResolveLocalFileSystemURL(const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);367 363 #endif 368 364 -
trunk/Source/WebCore/page/DOMWindow.idl
r108301 r108556 173 173 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS 174 174 readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications; 175 #endif176 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM177 const unsigned short TEMPORARY = 0;178 const unsigned short PERSISTENT = 1;179 [V8EnabledAtRuntime=FileSystem] void webkitRequestFileSystem(in unsigned short type, in long long size, in [Callback] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);180 [V8EnabledAtRuntime=FileSystem] void webkitResolveLocalFileSystemURL(in DOMString url, in [Callback, Optional] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);181 175 #endif 182 176
Note: See TracChangeset
for help on using the changeset viewer.