[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

kinuko at chromium.org kinuko at chromium.org
Wed Dec 22 12:43:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit df557d97191960802ff3a40de3c2c799575676cc
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 27 21:15:35 2010 +0000

    2010-08-27  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Add AsyncFileSystem interface for platform-dependent FileSystem API implementation
            https://bugs.webkit.org/show_bug.cgi?id=44433
    
            No new tests; tests will be added later.
    
            * CMakeLists.txt:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * platform/AsyncFileSystem.cpp: Added.
            * platform/AsyncFileSystem.h: Added.
            * platform/AsyncFileSystemCallbacks.h: Added.
            * storage/DOMFileSystem.cpp:
            (WebCore::DOMFileSystem::DOMFileSystem):
            (WebCore::DOMFileSystem::~DOMFileSystem):
            (WebCore::DOMFileSystem::stop):
            (WebCore::DOMFileSystem::hasPendingActivity):
            (WebCore::DOMFileSystem::contextDestroyed):
            * storage/DOMFileSystem.h:
            (WebCore::DOMFileSystem::create):
            * storage/FileSystemCallbacks.cpp:
            (WebCore::FileSystemCallbacksBase::didFail):
            (WebCore::FileSystemCallbacks::FileSystemCallbacks):
            (WebCore::FileSystemCallbacks::didOpenFileSystem):
            * storage/FileSystemCallbacks.h:
            * storage/LocalFileSystem.cpp: Added.
            * storage/LocalFileSystem.h: Added.
    
            * storage/Flags.h: Nits fix.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66255 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 76b84b4..0c37416 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1211,6 +1211,7 @@ SET(WebCore_SOURCES
     page/animation/KeyframeAnimation.cpp
 
     platform/Arena.cpp
+    platform/AsyncFileSystem.cpp
     platform/BlobItem.cpp
     platform/ContentType.cpp
     platform/ContextMenu.cpp
@@ -1483,6 +1484,7 @@ SET(WebCore_SOURCES
     storage/IDBFactory.cpp
     storage/IDBFactoryBackendInterface.cpp
     storage/IDBFactoryBackendImpl.cpp
+    storage/LocalFileSystem.cpp
     storage/LocalStorageTask.cpp
     storage/LocalStorageThread.cpp
     storage/OriginQuotaManager.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9c0619d..bbd3e68 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,38 @@
+2010-08-27  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add AsyncFileSystem interface for platform-dependent FileSystem API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=44433
+
+        No new tests; tests will be added later.
+
+        * CMakeLists.txt:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/AsyncFileSystem.cpp: Added.
+        * platform/AsyncFileSystem.h: Added.
+        * platform/AsyncFileSystemCallbacks.h: Added.
+        * storage/DOMFileSystem.cpp:
+        (WebCore::DOMFileSystem::DOMFileSystem):
+        (WebCore::DOMFileSystem::~DOMFileSystem):
+        (WebCore::DOMFileSystem::stop):
+        (WebCore::DOMFileSystem::hasPendingActivity):
+        (WebCore::DOMFileSystem::contextDestroyed):
+        * storage/DOMFileSystem.h:
+        (WebCore::DOMFileSystem::create):
+        * storage/FileSystemCallbacks.cpp:
+        (WebCore::FileSystemCallbacksBase::didFail):
+        (WebCore::FileSystemCallbacks::FileSystemCallbacks):
+        (WebCore::FileSystemCallbacks::didOpenFileSystem):
+        * storage/FileSystemCallbacks.h:
+        * storage/LocalFileSystem.cpp: Added.
+        * storage/LocalFileSystem.h: Added.
+
+        * storage/Flags.h: Nits fix.
+
 2010-07-27  Jer Noble  <jer.noble at apple.com>
 
         Reviewed by Eric Carlson.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 4cc59bb..bdf8f50 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3042,6 +3042,9 @@
             'platform/Arena.cpp',
             'platform/Arena.h',
             'platform/AsyncFileStream.h',
+            'platform/AsyncFileSystem.cpp',
+            'platform/AsyncFileSystem.h',
+            'platform/AsyncFileSystemCallbacks.h',
             'platform/AutodrainedPool.h',
             'platform/BlobItem.cpp',
             'platform/BlobItem.h',
@@ -3638,6 +3641,7 @@
             'storage/IDBTransactionCallbacks.h',
             'storage/IDBTransactionCoordinator.cpp',
             'storage/IDBTransactionCoordinator.h',
+            'storage/LocalFileSystem.h',
             'storage/LocalStorageTask.cpp',
             'storage/LocalStorageTask.h',
             'storage/LocalStorageThread.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 447d40f..8a33f56 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -874,6 +874,7 @@ SOURCES += \
     platform/animation/Animation.cpp \
     platform/animation/AnimationList.cpp \
     platform/Arena.cpp \
+    platform/AsyncFileSystem.cpp \
     platform/BlobItem.cpp \
     platform/text/Base64.cpp \
     platform/text/BidiContext.cpp \
@@ -1660,6 +1661,8 @@ HEADERS += \
     platform/animation/AnimationList.h \
     platform/Arena.h \
     platform/AsyncFileStream.h \
+    platform/AsyncFileSystem.h \
+    platform/AsyncFileSystemCallbacks.h \
     platform/BlobItem.h \
     platform/ContentType.h \
     platform/ContextMenu.h \
@@ -2597,6 +2600,7 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
         storage/FileSystemCallback.h \
         storage/FileSystemCallbacks.h \
         storage/Flags.h \
+        storage/LocalFileSystem.h \
         storage/Metadata.h \
         storage/MetadataCallback.h
 
@@ -2608,7 +2612,8 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
         storage/Entry.cpp \
         storage/EntryArray.cpp \
         storage/FileEntry.cpp \
-        storage/FileSystemCallbacks.cpp
+        storage/FileSystemCallbacks.cpp \
+        storage/LocalFileSystem.cpp
 }
 
 contains(DEFINES, ENABLE_ICONDATABASE=1) {
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 72863a7..4605ff1 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -23981,6 +23981,18 @@
 				>
 			</File>
 			<File
+				RelativePath="..\platform\AsyncFileSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\platform\AsyncFileSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\platform\AsyncFileSystemCallbacks.h"
+				>
+			</File>
+			<File
 				RelativePath="..\platform\AutodrainedPool.h"
 				>
 			</File>
@@ -51449,6 +51461,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\storage\LocalFileSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\storage\LocalFileSystem.h"
+				>
+			</File>
+			<File
 				RelativePath="..\storage\LocalStorageTask.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 8c56f1c..5cfaae3 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2399,6 +2399,8 @@
 		895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; };
 		89686C9F122244A00076EAA4 /* DOMFilePath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89686C9D122244A00076EAA4 /* DOMFilePath.cpp */; };
 		89686CA0122244A00076EAA4 /* DOMFilePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 89686C9E122244A00076EAA4 /* DOMFilePath.h */; };
+		898783D312232A13003AABDA /* LocalFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898783D112232A13003AABDA /* LocalFileSystem.cpp */; };
+		898783D412232A13003AABDA /* LocalFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 898783D212232A13003AABDA /* LocalFileSystem.h */; };
 		8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8988E10C11A3508B00DB732E /* BlobItem.cpp */; };
 		8988E10F11A3508B00DB732E /* BlobItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8988E10D11A3508B00DB732E /* BlobItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		899ABC261215E4A300F9F219 /* DirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */; };
@@ -2448,6 +2450,9 @@
 		89C0DD7B121F0C69009E17CA /* FileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 89C0DD79121F0C69009E17CA /* FileSystemCallbacks.h */; };
 		89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; };
 		89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSBlobBuilder.h */; };
+		89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89D08D9C12228451001241DF /* AsyncFileSystem.cpp */; };
+		89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D08D9D12228451001241DF /* AsyncFileSystem.h */; };
+		89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */; };
 		8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		8A413AE01207BBA50082016E /* AsyncScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A413ADE1207BBA50082016E /* AsyncScriptRunner.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		8A413AE11207BBA50082016E /* AsyncScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A413ADF1207BBA50082016E /* AsyncScriptRunner.cpp */; };
@@ -8294,6 +8299,8 @@
 		897A2D8E1200035F0082740C /* JSDOMFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFileSystem.h; sourceTree = "<group>"; };
 		897A2D91120003760082740C /* JSFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFlags.cpp; sourceTree = "<group>"; };
 		897A2D92120003760082740C /* JSFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFlags.h; sourceTree = "<group>"; };
+		898783D112232A13003AABDA /* LocalFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalFileSystem.cpp; sourceTree = "<group>"; };
+		898783D212232A13003AABDA /* LocalFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalFileSystem.h; sourceTree = "<group>"; };
 		8988E10C11A3508B00DB732E /* BlobItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobItem.cpp; sourceTree = "<group>"; };
 		8988E10D11A3508B00DB732E /* BlobItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobItem.h; sourceTree = "<group>"; };
 		899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryEntry.cpp; sourceTree = "<group>"; };
@@ -8329,6 +8336,9 @@
 		89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; };
 		89CD029111C85B870070B791 /* JSBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobBuilder.cpp; sourceTree = "<group>"; };
 		89CD029211C85B870070B791 /* JSBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobBuilder.h; sourceTree = "<group>"; };
+		89D08D9C12228451001241DF /* AsyncFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncFileSystem.cpp; sourceTree = "<group>"; };
+		89D08D9D12228451001241DF /* AsyncFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileSystem.h; sourceTree = "<group>"; };
+		89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileSystemCallbacks.h; sourceTree = "<group>"; };
 		8A12E35C11FA33280025836A /* DocumentLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentLoadTiming.h; sourceTree = "<group>"; };
 		8A413ADE1207BBA50082016E /* AsyncScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncScriptRunner.h; sourceTree = "<group>"; };
 		8A413ADF1207BBA50082016E /* AsyncScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncScriptRunner.cpp; sourceTree = "<group>"; };
@@ -11693,6 +11703,8 @@
 				B6566268120B115A006EA85C /* IDBTransaction.h */,
 				B6566269120B115A006EA85C /* IDBTransaction.idl */,
 				B656626D120B116B006EA85C /* IDBTransactionBackendInterface.h */,
+				898783D112232A13003AABDA /* LocalFileSystem.cpp */,
+				898783D212232A13003AABDA /* LocalFileSystem.h */,
 				511F23130DC160DA004F0032 /* LocalStorageTask.cpp */,
 				511F23140DC160DA004F0032 /* LocalStorageTask.h */,
 				511F23150DC160DA004F0032 /* LocalStorageThread.cpp */,
@@ -16615,6 +16627,9 @@
 				BCFB2F74097A2E1A00BA703D /* Arena.cpp */,
 				BCFB2F75097A2E1A00BA703D /* Arena.h */,
 				2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */,
+				89D08D9C12228451001241DF /* AsyncFileSystem.cpp */,
+				89D08D9D12228451001241DF /* AsyncFileSystem.h */,
+				89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */,
 				51E1ECB10C91C55600DC255B /* AutodrainedPool.h */,
 				8988E10C11A3508B00DB732E /* BlobItem.cpp */,
 				8988E10D11A3508B00DB732E /* BlobItem.h */,
@@ -20385,6 +20400,9 @@
 				8947A83C122234F400D95F2D /* Metadata.h in Headers */,
 				8947A83D122234F900D95F2D /* MetadataCallback.h in Headers */,
 				9F3B947E12241758005304E7 /* ScriptHeapSnapshot.h in Headers */,
+				89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
+				89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */,
+				898783D412232A13003AABDA /* LocalFileSystem.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -22843,6 +22861,8 @@
 				89686C9F122244A00076EAA4 /* DOMFilePath.cpp in Sources */,
 				8947A82912222C4700D95F2D /* JSMetadata.cpp in Sources */,
 				8947A82B12222C4700D95F2D /* JSMetadataCallback.cpp in Sources */,
+				89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */,
+				898783D312232A13003AABDA /* LocalFileSystem.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/platform/AsyncFileSystem.cpp b/WebCore/platform/AsyncFileSystem.cpp
new file mode 100644
index 0000000..b4fcd0d
--- /dev/null
+++ b/WebCore/platform/AsyncFileSystem.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AsyncFileSystem.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileSystemCallbacks.h"
+#include "FileSystem.h"
+
+namespace WebCore {
+
+PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(const String&)
+{
+    // FIXME: return default AsyncFileSystem implementation.
+    return 0;
+}
+
+// Default implementation.
+void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    String typeString = (type == Persistent) ? "Persistent" : "Temporary";
+
+    String name = storageIdentifier;
+    name += ":";
+    name += typeString;
+
+    String rootPath = basePath;
+    rootPath.append(PlatformFilePathSeparator);
+    rootPath += storageIdentifier;
+    rootPath.append(PlatformFilePathSeparator);
+    rootPath += typeString;
+    rootPath.append(PlatformFilePathSeparator);
+
+    callbacks->didOpenFileSystem(name, AsyncFileSystem::create(rootPath));
+}
+
+// Default implementation.
+String AsyncFileSystem::virtualToPlatformPath(const String& path) const
+{
+    ASSERT(!m_platformRootPath.isEmpty());
+    String virtualPath = path;
+    return m_platformRootPath + virtualPath.replace('/', PlatformFilePathSeparator);
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/platform/AsyncFileSystem.h b/WebCore/platform/AsyncFileSystem.h
new file mode 100644
index 0000000..82f7163
--- /dev/null
+++ b/WebCore/platform/AsyncFileSystem.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AsyncFileSystem_h
+#define AsyncFileSystem_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "PlatformString.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class AsyncFileSystem;
+class AsyncFileSystemCallbacks;
+
+// This class provides async interface for platform-specific DOMFileSystem implementation. Note that all the methods take canonicalized virtual paths.
+class AsyncFileSystem : public Noncopyable {
+public:
+    virtual ~AsyncFileSystem() { }
+
+    // FileSystem type
+    enum Type {
+        Temporary,
+        Persistent,
+    };
+
+    virtual void stop() { }
+    virtual bool hasPendingActivity() { return false; }
+
+    // Creates and returns a new platform-specific AsyncFileSystem instance if the platform has its own implementation.
+    static PassOwnPtr<AsyncFileSystem> create(const String& rootPath);
+
+    // Opens a new file system.
+    static void openFileSystem(const String& basePath, const String& storageIdentifier, Type, PassOwnPtr<AsyncFileSystemCallbacks>);
+
+    // Moves a file or directory from srcPath to destPath.
+    // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void move(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Copies a file or directory from srcPath to destPath.
+    // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void copy(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Deletes a file or directory at a given path.
+    // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Retrieves the metadata information of the file or directory at a given path.
+    // AsyncFileSystemCallbacks::didReadMetadata() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Creates a file at a given path.  If exclusive flag is true, it fails if the path already exists.
+    // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Creates a directory at a given path.  If exclusive flag is true, it fails if the path already exists.
+    // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Checks if a file exists at a given path.
+    // AsyncFileSystemCallbacks::didSucceed() is called if the file exists.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Checks if a directory exists at a given path.
+    // AsyncFileSystemCallbacks::didSucceed() is called if the directory exists.
+    // AsyncFileSystemCallbacks::didFail() is called otherwise.
+    virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Reads directory entries of a given directory at path.
+    // AsyncFileSystemCallbacks::didReadDirectoryEntry() is called when each directory entry is called. AsyncFileSystemCallbacks::didReadDirectoryEntries() is called after a chunk of directory entries have been read.
+    // AsyncFileSystemCallbacks::didFail() is when there is an error.
+    virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
+
+    // Converts a given absolute virtual path to a platform path that starts with the platform root path of this file system.
+    virtual String virtualToPlatformPath(const String& path) const;
+
+protected:
+    AsyncFileSystem(const String& platformRootPath)
+        : m_platformRootPath(platformRootPath)
+    {
+    }
+
+    String m_platformRootPath;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // AsyncFileSystem_h
diff --git a/WebCore/platform/AsyncFileSystemCallbacks.h b/WebCore/platform/AsyncFileSystemCallbacks.h
new file mode 100644
index 0000000..0547fad
--- /dev/null
+++ b/WebCore/platform/AsyncFileSystemCallbacks.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AsyncFileSystemCallbacks_h
+#define AsyncFileSystemCallbacks_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class AsyncFileSystem;
+
+class AsyncFileSystemCallbacks : public Noncopyable {
+public:
+    // Called when a requested operation is completed successfully.
+    virtual void didSucceed() = 0;
+
+    // Called when a requested file system is opened.
+    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>) = 0;
+
+    // Called when a file metadata is read successfully.
+    virtual void didReadMetadata(double modificationTime) = 0;
+
+    // Called when a directory entry is read.
+    virtual void didReadDirectoryEntry(const String& name, bool isDirectory) = 0;
+
+    // Called after a chunk of directory entries have been read (i.e. indicates it's good time to call back to the application).  If hasMore is true there can be more chunks.
+    virtual void didReadDirectoryEntries(bool hasMore) = 0;
+
+    // Called when there was an error.
+    virtual void didFail(int code) = 0;
+
+    virtual ~AsyncFileSystemCallbacks() { }
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // AsyncFileSystemCallbacks_h
diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h
index ec75a21..e3916cf 100644
--- a/WebCore/platform/FileSystem.h
+++ b/WebCore/platform/FileSystem.h
@@ -138,6 +138,12 @@ enum FileSeekOrigin {
     SeekFromEnd
 };
 
+#if OS(WINDOWS)
+static const char PlatformFilePathSeparator = '\\';
+#else
+static const char PlatformFilePathSeparator = '/';
+#endif
+
 bool fileExists(const String&);
 bool deleteFile(const String&);
 bool deleteEmptyDirectory(const String&);
diff --git a/WebCore/storage/DOMFileSystem.cpp b/WebCore/storage/DOMFileSystem.cpp
index c3dbd34..5d6073a 100644
--- a/WebCore/storage/DOMFileSystem.cpp
+++ b/WebCore/storage/DOMFileSystem.cpp
@@ -33,13 +33,20 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include "AsyncFileSystem.h"
 #include "DirectoryEntry.h"
+#include "ScriptExecutionContext.h"
 
 namespace WebCore {
 
-DOMFileSystem::DOMFileSystem(const String& name, const String& rootPath)
-    : m_rootPath(rootPath)
+DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+    : ActiveDOMObject(context, this)
     , m_name(name)
+    , m_asyncFileSystem(asyncFileSystem)
+{
+}
+
+DOMFileSystem::~DOMFileSystem()
 {
 }
 
@@ -48,6 +55,21 @@ PassRefPtr<DirectoryEntry> DOMFileSystem::root()
     return DirectoryEntry::create(this, "/");
 }
 
+void DOMFileSystem::stop()
+{
+    m_asyncFileSystem->stop();
+}
+
+bool DOMFileSystem::hasPendingActivity() const
+{
+    return m_asyncFileSystem->hasPendingActivity();
+}
+
+void DOMFileSystem::contextDestroyed()
+{
+    m_asyncFileSystem->stop();
+}
+
 } // namespace
 
 #endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/DOMFileSystem.h b/WebCore/storage/DOMFileSystem.h
index b87aaaf..337bea9 100644
--- a/WebCore/storage/DOMFileSystem.h
+++ b/WebCore/storage/DOMFileSystem.h
@@ -33,6 +33,9 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include "ActiveDOMObject.h"
+#include "AsyncFileSystem.h"
+#include "Flags.h"
 #include "PlatformString.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -40,22 +43,30 @@
 namespace WebCore {
 
 class DirectoryEntry;
+class ScriptExecutionContext;
 
-class DOMFileSystem : public RefCounted<DOMFileSystem> {
+class DOMFileSystem : public RefCounted<DOMFileSystem>, public ActiveDOMObject {
 public:
-    static PassRefPtr<DOMFileSystem> create(const String& name, const String& rootPath)
+    static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
     {
-        return adoptRef(new DOMFileSystem(name, rootPath));
+        return adoptRef(new DOMFileSystem(context, name, asyncFileSystem));
     }
 
+    virtual ~DOMFileSystem();
+
     const String& name() const { return m_name; }
     PassRefPtr<DirectoryEntry> root();
 
+    // ActiveDOMObject methods.
+    virtual void stop();
+    virtual bool hasPendingActivity() const;
+    virtual void contextDestroyed();
+
 private:
-    DOMFileSystem(const String& name, const String& rootPath);
+    DOMFileSystem(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
 
-    String m_rootPath;
     String m_name;
+    mutable OwnPtr<AsyncFileSystem> m_asyncFileSystem;
 };
 
 } // namespace
diff --git a/WebCore/storage/FileSystemCallbacks.cpp b/WebCore/storage/FileSystemCallbacks.cpp
index ec352dd..1dd9725 100644
--- a/WebCore/storage/FileSystemCallbacks.cpp
+++ b/WebCore/storage/FileSystemCallbacks.cpp
@@ -33,6 +33,7 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include "AsyncFileSystem.h"
 #include "DOMFileSystem.h"
 #include "DirectoryEntry.h"
 #include "EntriesCallback.h"
@@ -65,7 +66,7 @@ void FileSystemCallbacksBase::didSucceed()
     ASSERT_NOT_REACHED();
 }
 
-void FileSystemCallbacksBase::didOpenFileSystem(const String&, const String&)
+void FileSystemCallbacksBase::didOpenFileSystem(const String&, PassOwnPtr<AsyncFileSystem>)
 {
     // Each subclass must implement an appropriate one.
     ASSERT_NOT_REACHED();
@@ -77,7 +78,7 @@ void FileSystemCallbacksBase::didReadMetadata(double)
     ASSERT_NOT_REACHED();
 }
 
-void FileSystemCallbacksBase::didReadDirectoryChunkDone(bool)
+void FileSystemCallbacksBase::didReadDirectoryEntries(bool)
 {
     // Each subclass must implement an appropriate one.
     ASSERT_NOT_REACHED();
@@ -89,7 +90,7 @@ void FileSystemCallbacksBase::didReadDirectoryEntry(const String&, bool)
     ASSERT_NOT_REACHED();
 }
 
-void FileSystemCallbacksBase::didFail(ExceptionCode code)
+void FileSystemCallbacksBase::didFail(int code)
 {
     if (m_errorCallback) {
         m_errorCallback->handleEvent(FileError::create(code).get());
@@ -137,7 +138,7 @@ void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirector
         m_entries->append(FileEntry::create(m_fileSystem, m_basePath + "/" + name));
 }
 
-void EntriesCallbacks::didReadDirectoryChunkDone(bool hasMore)
+void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
 {
     if (m_successCallback) {
         m_successCallback->handleEvent(m_entries.get());
@@ -152,16 +153,20 @@ void EntriesCallbacks::didReadDirectoryChunkDone(bool hasMore)
 
 // FileSystemCallbacks --------------------------------------------------------
 
-FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context)
     : FileSystemCallbacksBase(errorCallback)
     , m_successCallback(successCallback)
+    , m_scriptExecutionContext(context)
 {
 }
 
-void FileSystemCallbacks::didOpenFileSystem(const String& name, const String& rootPath)
+void FileSystemCallbacks::didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
 {
-    if (m_successCallback)
-        m_successCallback->handleEvent(DOMFileSystem::create(name, rootPath).get());
+    if (m_successCallback) {
+        ASSERT(asyncFileSystem);
+        m_successCallback->handleEvent(DOMFileSystem::create(m_scriptExecutionContext.get(), name, asyncFileSystem.leakPtr()).get());
+        m_scriptExecutionContext.clear();
+    }
     m_successCallback.clear();
 }
 
diff --git a/WebCore/storage/FileSystemCallbacks.h b/WebCore/storage/FileSystemCallbacks.h
index e0e78d3..31a2a0c 100644
--- a/WebCore/storage/FileSystemCallbacks.h
+++ b/WebCore/storage/FileSystemCallbacks.h
@@ -33,6 +33,7 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include "AsyncFileSystemCallbacks.h"
 #include "PlatformString.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
@@ -49,10 +50,7 @@ class MetadataCallback;
 class ScriptExecutionContext;
 class VoidCallback;
 
-typedef int ExceptionCode;
-
-// A base class for FileSystem callbacks that bundles successCallback, errorCallback and some closure data for the callbacks.
-class FileSystemCallbacksBase : public Noncopyable {
+class FileSystemCallbacksBase : public AsyncFileSystemCallbacks {
 public:
     virtual ~FileSystemCallbacksBase();
 
@@ -60,17 +58,17 @@ public:
     virtual void didSucceed();
 
     // For FileSystemCallbacks.
-    virtual void didOpenFileSystem(const String& name, const String& rootPath);
+    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
 
     // For MetadataCallbacks.
     virtual void didReadMetadata(double modificationTime);
 
     // For EntriesCallbacks. didReadDirectoryEntry is called each time the API reads an entry, and didReadDirectoryDone is called when a chunk of entries have been read (i.e. good time to call back to the application).  If hasMore is true there can be more chunks.
     virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
-    virtual void didReadDirectoryChunkDone(bool hasMore);
+    virtual void didReadDirectoryEntries(bool hasMore);
 
     // For ErrorCallback.
-    virtual void didFail(ExceptionCode code);
+    virtual void didFail(int code);
 
 protected:
     FileSystemCallbacksBase(PassRefPtr<ErrorCallback> errorCallback);
@@ -95,7 +93,7 @@ class EntriesCallbacks : public FileSystemCallbacksBase {
 public:
     EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& basePath);
     virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
-    virtual void didReadDirectoryChunkDone(bool hasMore);
+    virtual void didReadDirectoryEntries(bool hasMore);
 
 private:
     RefPtr<EntriesCallback> m_successCallback;
@@ -106,11 +104,12 @@ private:
 
 class FileSystemCallbacks : public FileSystemCallbacksBase {
 public:
-    FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
-    virtual void didOpenFileSystem(const String& name, const String& rootPath);
+    FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
+    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
 
 private:
     RefPtr<FileSystemCallback> m_successCallback;
+    RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
 };
 
 class MetadataCallbacks : public FileSystemCallbacksBase {
diff --git a/WebCore/storage/Flags.h b/WebCore/storage/Flags.h
index ffe3403..30884fc 100644
--- a/WebCore/storage/Flags.h
+++ b/WebCore/storage/Flags.h
@@ -33,6 +33,7 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
diff --git a/WebCore/storage/LocalFileSystem.cpp b/WebCore/storage/LocalFileSystem.cpp
new file mode 100644
index 0000000..282508e
--- /dev/null
+++ b/WebCore/storage/LocalFileSystem.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "LocalFileSystem.h"
+
+#if PLATFORM(CHROMIUM)
+#error "Chromium should not compile this file and instead define its own version of these factories."
+#endif
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DOMWindow.h"
+#include "ErrorCallback.h"
+#include "ExceptionCode.h"
+#include "FileError.h"
+#include "FileSystemCallback.h"
+#include "FileSystemCallbacks.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+PassRefPtr<LocalFileSystem> LocalFileSystem::create(const String& basePath)
+{
+    return adoptRef(new LocalFileSystem(basePath));
+}
+
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+    if (type != AsyncFileSystem::Temporary && type != AsyncFileSystem::Persistent) {
+        errorCallback->handleEvent(FileError::create(INVALID_MODIFICATION_ERR).get());
+        return;
+    }
+
+    AsyncFileSystem::openFileSystem(m_basePath, context->securityOrigin()->databaseIdentifier(), type, new FileSystemCallbacks(successCallback, errorCallback, context));
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/LocalFileSystem.h b/WebCore/storage/LocalFileSystem.h
new file mode 100644
index 0000000..48cfa8f
--- /dev/null
+++ b/WebCore/storage/LocalFileSystem.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LocalFileSystem_h
+#define LocalFileSystem_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileSystem.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class ErrorCallback;
+class FileSystemCallback;
+class ScriptExecutionContext;
+
+class LocalFileSystem : public RefCounted<LocalFileSystem> {
+public:
+    static PassRefPtr<LocalFileSystem> create(const String& basePath);
+    virtual ~LocalFileSystem() { }
+
+    void requestFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
+
+protected:
+    LocalFileSystem(const String& basePath)
+        : m_basePath(basePath)
+    {
+    }
+
+    String m_basePath;
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // LocalFileSystem_h
diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
index d29f86d..3829c4c 100644
--- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
+++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
@@ -71,7 +71,7 @@ void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemE
     ASSERT(m_callbacks);
     for (size_t i = 0; i < entries.size(); ++i)
         m_callbacks->didReadDirectoryEntry(entries[i].name, entries[i].isDirectory);
-    m_callbacks->didReadDirectoryChunkDone(hasMore);
+    m_callbacks->didReadDirectoryEntries(hasMore);
     if (!hasMore)
         delete this;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list