Some Spelling Mistakes Result in Compile Errors with ENABLE(FILE_SYSTEM) in LocalFile...
authorkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 05:35:07 +0000 (05:35 +0000)
committerkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 05:35:07 +0000 (05:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86103

Reviewed by Rob Buis.

Added build fixes and some (limited) common implementation for non-chromium ports.

No new tests as this should have no functionality changes.

* Modules/filesystem/DOMFileSystemBase.cpp:
(WebCore::DOMFileSystemBase::isValidType): Added common implementation for non-chromium ports.
(WebCore::DOMFileSystemBase::crackFileSystemURL): Ditto.
(WebCore::DOMFileSystemBase::supportsToURL): Ditto.
(WebCore::DOMFileSystemBase::createFileSystemURL): Ditto.
* Modules/filesystem/LocalFileSystem.cpp:
(WebCore::LocalFileSystem::readFileSystem): Fixed.
(WebCore::LocalFileSystem::requestFileSystem): Fixed.
* platform/blackberry/AsyncFileSystemBlackBerry.cpp:
(WebCore::AsyncFileSystem::openFileSystem): Fixed.
* platform/gtk/AsyncFileSystemGtk.cpp:
(WebCore::AsyncFileSystem::openFileSystem): Fixed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117544 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
Source/WebCore/Modules/filesystem/LocalFileSystem.cpp
Source/WebCore/platform/blackberry/AsyncFileSystemBlackBerry.cpp
Source/WebCore/platform/gtk/AsyncFileSystemGtk.cpp

index ec8b6da..30718eb 100644 (file)
@@ -1,3 +1,27 @@
+2012-05-15  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Some Spelling Mistakes Result in Compile Errors with ENABLE(FILE_SYSTEM) in LocalFileSystem.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=86103
+
+        Reviewed by Rob Buis.
+
+        Added build fixes and some (limited) common implementation for non-chromium ports.
+
+        No new tests as this should have no functionality changes.
+
+        * Modules/filesystem/DOMFileSystemBase.cpp:
+        (WebCore::DOMFileSystemBase::isValidType): Added common implementation for non-chromium ports.
+        (WebCore::DOMFileSystemBase::crackFileSystemURL): Ditto.
+        (WebCore::DOMFileSystemBase::supportsToURL): Ditto.
+        (WebCore::DOMFileSystemBase::createFileSystemURL): Ditto.
+        * Modules/filesystem/LocalFileSystem.cpp:
+        (WebCore::LocalFileSystem::readFileSystem): Fixed.
+        (WebCore::LocalFileSystem::requestFileSystem): Fixed.
+        * platform/blackberry/AsyncFileSystemBlackBerry.cpp:
+        (WebCore::AsyncFileSystem::openFileSystem): Fixed.
+        * platform/gtk/AsyncFileSystemGtk.cpp:
+        (WebCore::AsyncFileSystem::openFileSystem): Fixed.
+
 2012-05-17  Wei James  <james.wei@intel.com>
 
         AudioBufferSourceNode and MediaElementAudioSourceNode should support multi-channel > stereo
index 62fcea0..33cc130 100644 (file)
@@ -68,6 +68,50 @@ DOMFileSystemBase::~DOMFileSystemBase()
 {
 }
 
+#if !PLATFORM(CHROMIUM)
+// static
+bool DOMFileSystemBase::isValidType(FileSystemType type)
+{
+    return type == FileSystemTypeTemporary || type == FileSystemTypePersistent;
+}
+
+// static
+bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath)
+{
+    if (!url.protocolIs("filesystem"))
+        return false;
+
+    if (!url.innerURL())
+        return false;
+
+    String typeString = url.innerURL()->path().substring(1);
+    if (typeString == temporaryPathPrefix)
+        type = FileSystemTypeTemporary;
+    else if (typeString == persistentPathPrefix)
+        type = FileSystemTypePersistent;
+    else
+        return false;
+
+    filePath = decodeURLEscapeSequences(url.path());
+    return true;
+}
+
+bool DOMFileSystemBase::supportsToURL() const
+{
+    ASSERT(isValidType(m_type));
+    return true;
+}
+
+KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const
+{
+    ASSERT(DOMFilePath::isAbsolute(fullPath));
+    KURL url = m_filesystemRootURL;
+    // Remove the extra leading slash.
+    url.setPath(url.path() + encodeWithURLEscapeSequences(fullPath.substring(1)));
+    return url;
+}
+#endif
+
 SecurityOrigin* DOMFileSystemBase::securityOrigin() const
 {
     return m_context->securityOrigin();
index 0eaafae..6643521 100644 (file)
@@ -82,13 +82,13 @@ static void openFileSystem(ScriptExecutionContext*, const String& basePath, cons
     AsyncFileSystem::openFileSystem(basePath, identifier, create, callbacks);
 }
 
-void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, DOMFileSystemBase::Type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousMode)
+void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, FileSystemType, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType)
 {
     // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
     context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), false, callbacks));
 }
 
-void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, DOMFileSystemBase::Type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType)
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSystemType, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType)
 {
     // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
     context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), true, callbacks));
index 71601ec..862c783 100644 (file)
@@ -40,7 +40,7 @@ PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create()
     return adoptPtr(new AsyncFileSystemBlackBerry());
 }
 
-void AsyncFileSystem::openFileSystem(const KURL& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
 {
     UNUSED_PARAM(basePath);
     UNUSED_PARAM(storageIdentifier);
index aa60ba4..f2cfa87 100644 (file)
@@ -40,7 +40,7 @@ PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create()
     return adoptPtr(new AsyncFileSystemGtk());
 }
 
-void AsyncFileSystem::openFileSystem(const KURL& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
 {
     notImplemented();
     callbacks->didFail(NOT_SUPPORTED_ERR);