Changeset 66570 in webkit
- Timestamp:
- Aug 31, 2010 8:27:01 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r66569 r66570 1 2010-08-31 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by Jian Li. 4 5 Add LocalFileSystem.requestFileSystem interface to DOMWindow 6 https://bugs.webkit.org/show_bug.cgi?id=44734 7 8 No new tests; tests will be added later. 9 10 * bindings/generic/RuntimeEnabledFeatures.cpp: 11 * bindings/generic/RuntimeEnabledFeatures.h: 12 (WebCore::RuntimeEnabledFeatures::fileSystemEnabled): 13 (WebCore::RuntimeEnabledFeatures::setFileSystemEnabled): 14 (WebCore::RuntimeEnabledFeatures::requestFileSystemEnabled): 15 * page/DOMWindow.cpp: 16 (WebCore::DOMWindow::requestFileSystem): 17 * page/DOMWindow.h: 18 (WebCore::DOMWindow::): 19 * page/DOMWindow.idl: 20 * page/Settings.cpp: 21 (WebCore::Settings::setFileSystemRootPath): 22 * page/Settings.h: 23 (WebCore::Settings::fileSystemRootPath): 24 1 25 2010-08-31 Kwang Yul Seo <skyul@company100.net> 2 26 -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
r66243 r66570 54 54 #if ENABLE(XHR_RESPONSE_BLOB) 55 55 bool RuntimeEnabledFeatures::isXHRResponseBlobEnabled = false; 56 #endif 57 58 #if ENABLE(FILE_SYSTEM) 59 bool RuntimeEnabledFeatures::isFileSystemEnabled = false; 56 60 #endif 57 61 -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.h
r66243 r66570 136 136 #endif 137 137 138 #if ENABLE(FILE_SYSTEM) 139 static bool fileSystemEnabled() { return isFileSystemEnabled; } 140 static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; } 141 static bool requestFileSystemEnabled() { return isFileSystemEnabled; } 142 #endif 143 138 144 private: 139 145 // Never instantiate. … … 155 161 static bool isXHRResponseBlobEnabled; 156 162 #endif 163 164 #if ENABLE(FILE_SYSTEM) 165 static bool isFileSystemEnabled; 166 #endif 157 167 }; 158 168 -
trunk/WebCore/page/DOMWindow.cpp
r66462 r66570 89 89 #include <wtf/text/CString.h> 90 90 91 #if ENABLE(FILE_SYSTEM) 92 #include "AsyncFileSystem.h" 93 #include "DOMFileSystem.h" 94 #include "ErrorCallback.h" 95 #include "FileError.h" 96 #include "FileSystemCallback.h" 97 #include "LocalFileSystem.h" 98 #endif 99 91 100 using std::min; 92 101 using std::max; … … 722 731 #endif 723 732 733 #if ENABLE(FILE_SYSTEM) 734 void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) 735 { 736 Document* document = this->document(); 737 if (!document) 738 return; 739 740 if (!m_localFileSystem) { 741 // FIXME: See if access is allowed. 742 743 Page* page = document->page(); 744 if (!page) { 745 DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_STATE_ERR)); 746 return; 747 } 748 749 // FIXME: Get the quota settings as well. 750 String path = page->settings()->fileSystemRootPath(); 751 m_localFileSystem = LocalFileSystem::create(path); 752 } 753 754 m_localFileSystem->requestFileSystem(document, static_cast<AsyncFileSystem::Type>(type), size, successCallback, errorCallback); 755 } 756 757 COMPILE_ASSERT(int(DOMWindow::TEMPORARY) == int(AsyncFileSystem::Temporary), enum_mismatch); 758 COMPILE_ASSERT(int(DOMWindow::PERSISTENT) == int(AsyncFileSystem::Persistent), enum_mismatch); 759 760 #endif 761 724 762 void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) 725 763 { -
trunk/WebCore/page/DOMWindow.h
r66464 r66570 50 50 class Document; 51 51 class Element; 52 class ErrorCallback; 52 53 class Event; 53 54 class EventListener; 55 class FileSystemCallback; 54 56 class FloatRect; 55 57 class Frame; … … 58 60 class IDBKeyRange; 59 61 class InspectorTimelineAgent; 62 class LocalFileSystem; 60 63 class Location; 61 64 class StyleMedia; … … 237 240 IDBFactory* indexedDB() const; 238 241 IDBKeyRange* iDBKeyRange() const; 242 #endif 243 244 #if ENABLE(FILE_SYSTEM) 245 // They are placed here and in all capital letters to enforce compile-time enum checking. 246 enum FileSystemType { 247 TEMPORARY, 248 PERSISTENT, 249 }; 250 void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>); 239 251 #endif 240 252 … … 436 448 mutable RefPtr<IDBKeyRange> m_idbKeyRange; 437 449 #endif 450 #if ENABLE(FILE_SYSTEM) 451 RefPtr<LocalFileSystem> m_localFileSystem; 452 #endif 438 453 439 454 EventTargetData m_eventTargetData; -
trunk/WebCore/page/DOMWindow.idl
r66467 r66570 176 176 readonly attribute [EnabledAtRuntime] IDBFactory indexedDB; 177 177 readonly attribute [EnabledAtRuntime] IDBKeyRange IDBKeyRange; 178 #endif 179 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM 180 const unsigned short TEMPORARY = 0; 181 const unsigned short PERSISTENT = 1; 182 [EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback); 178 183 #endif 179 184 -
trunk/WebCore/page/Settings.cpp
r66251 r66570 484 484 } 485 485 486 void Settings::setFileSystemRootPath(const String& path) 487 { 488 m_fileSystemRootPath = path; 489 } 490 486 491 void Settings::setApplicationChromeMode(bool mode) 487 492 { -
trunk/WebCore/page/Settings.h
r66251 r66570 240 240 void setLocalStorageDatabasePath(const String&); 241 241 const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; } 242 242 243 void setFileSystemRootPath(const String&); 244 const String& fileSystemRootPath() const { return m_fileSystemRootPath; } 245 243 246 void setApplicationChromeMode(bool); 244 247 bool inApplicationChromeMode() const { return m_inApplicationChromeMode; } … … 329 332 private: 330 333 Page* m_page; 331 334 332 335 String m_defaultTextEncodingName; 333 336 String m_ftpDirectoryTemplatePath; 334 337 String m_localStorageDatabasePath; 338 String m_fileSystemRootPath; 335 339 KURL m_userStyleSheetLocation; 336 340 AtomicString m_standardFontFamily; … … 413 417 bool m_memoryInfoEnabled: 1; 414 418 bool m_interactiveFormValidation: 1; 415 419 416 420 #if USE(SAFARI_THEME) 417 421 static bool gShouldPaintNativeControls; -
trunk/WebCore/storage/FileSystemCallbacks.cpp
r66255 r66570 35 35 36 36 #include "AsyncFileSystem.h" 37 #include "DOMFilePath.h" 37 38 #include "DOMFileSystem.h" 38 39 #include "DirectoryEntry.h" … … 133 134 void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirectory) 134 135 { 136 if (!m_entries) 137 m_entries = EntryArray::create(); 135 138 if (isDirectory) 136 m_entries->append(DirectoryEntry::create(m_fileSystem, m_basePath + "/" + name));139 m_entries->append(DirectoryEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name))); 137 140 else 138 m_entries->append(FileEntry::create(m_fileSystem, m_basePath + "/" + name));141 m_entries->append(FileEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name))); 139 142 } 140 143 141 144 void EntriesCallbacks::didReadDirectoryEntries(bool hasMore) 142 145 { 146 ASSERT(m_entries); 143 147 if (m_successCallback) { 144 148 m_successCallback->handleEvent(m_entries.get()); -
trunk/WebKit/chromium/ChangeLog
r66473 r66570 1 2010-08-31 Kinuko Yasuda <kinuko@chromium.org> 2 3 Reviewed by Jian Li. 4 5 Add LocalFileSystem.requestFileSystem interface to DOMWindow 6 https://bugs.webkit.org/show_bug.cgi?id=44734 7 8 * public/WebRuntimeFeatures.h: 9 * src/WebRuntimeFeatures.cpp: 10 (WebKit::WebRuntimeFeatures::enableFileSystem): 11 (WebKit::WebRuntimeFeatures::isFileSystemEnabled): 12 1 13 2010-08-24 Jeremy Orlow <jorlow@chromium.org> 2 14 -
trunk/WebKit/chromium/public/WebRuntimeFeatures.h
r66243 r66570 90 90 WEBKIT_API static bool isXHRResponseBlobEnabled(); 91 91 92 WEBKIT_API static void enableFileSystem(bool); 93 WEBKIT_API static bool isFileSystemEnabled(); 94 92 95 private: 93 96 WebRuntimeFeatures(); -
trunk/WebKit/chromium/src/WebRuntimeFeatures.cpp
r66243 r66570 273 273 } 274 274 275 void WebRuntimeFeatures::enableFileSystem(bool enable) 276 { 277 #if ENABLE(FILE_SYSTEM) 278 RuntimeEnabledFeatures::setFileSystemEnabled(enable); 279 #endif 280 } 281 282 bool WebRuntimeFeatures::isFileSystemEnabled() 283 { 284 #if ENABLE(FILE_SYSTEM) 285 return RuntimeEnabledFeatures::fileSystemEnabled(); 286 #else 287 return false; 288 #endif 289 } 290 275 291 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.