[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:44:16 UTC 2010


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

    2010-08-27  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Dumitru Daniliuc.
    
            [chromium] Add chromium-side of AsyncFileSystem implementation
            https://bugs.webkit.org/show_bug.cgi?id=44434
    
            * WebKit.gyp:
            * src/AssertMatchingEnums.cpp: Added assertions.
            * src/AsyncFileSystemChromium.cpp: Added.
            * src/AsyncFileSystemChromium.h: Added.
            * src/LocalFileSystemChromium.cpp: Added.
            * src/WebFileSystemCallbacksImpl.cpp:
            (WebKit::WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl):
            * src/WebFileSystemCallbacksImpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index d264291..a64e1a9 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-27  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Dumitru Daniliuc.
+
+        [chromium] Add chromium-side of AsyncFileSystem implementation
+        https://bugs.webkit.org/show_bug.cgi?id=44434
+
+        * WebKit.gyp:
+        * src/AssertMatchingEnums.cpp: Added assertions.
+        * src/AsyncFileSystemChromium.cpp: Added.
+        * src/AsyncFileSystemChromium.h: Added.
+        * src/LocalFileSystemChromium.cpp: Added.
+        * src/WebFileSystemCallbacksImpl.cpp:
+        (WebKit::WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl):
+        * src/WebFileSystemCallbacksImpl.h:
+
 2010-08-27  Michael Nordman  <michaeln at google.com>
 
         Reviewed by David Levin.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 9443d8e..32b14db 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -292,6 +292,8 @@
                 'src/ApplicationCacheHost.cpp',
                 'src/ApplicationCacheHostInternal.h',
                 'src/AssertMatchingEnums.cpp',
+                'src/AsyncFileSystemChromium.cpp',
+                'src/AsyncFileSystemChromium.h',
                 'src/AutoFillPopupMenuClient.cpp',
                 'src/AutoFillPopupMenuClient.h',
                 'src/BackForwardListClientImpl.cpp',
@@ -363,6 +365,7 @@
                 'src/x11/WebScreenInfoFactory.cpp',
                 'src/mac/WebInputEventFactory.mm',
                 'src/mac/WebScreenInfoFactory.mm',
+                'src/LocalFileSystemChromium.cpp',
                 'src/LocalizedStrings.cpp',
                 'src/MediaPlayerPrivateChromium.cpp',
                 'src/NotificationPresenterImpl.h',
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index a117fc2..ac3aad3 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -35,6 +35,7 @@
 
 #include "AccessibilityObject.h"
 #include "ApplicationCacheHost.h"
+#include "AsyncFileSystem.h"
 #include "EditorInsertAction.h"
 #include "FontDescription.h"
 #include "FontSmoothingMode.h"
@@ -54,6 +55,7 @@
 #include "WebClipboard.h"
 #include "WebCursorInfo.h"
 #include "WebEditingAction.h"
+#include "WebFileSystem.h"
 #include "WebFontDescription.h"
 #include "WebIDBKey.h"
 #include "WebInputElement.h"
@@ -380,3 +382,8 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInT
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType);
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType);
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType);
+
+#if ENABLE(FILE_SYSTEM)
+COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent);
+#endif
diff --git a/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/WebKit/chromium/src/AsyncFileSystemChromium.cpp
new file mode 100644
index 0000000..c783918
--- /dev/null
+++ b/WebKit/chromium/src/AsyncFileSystemChromium.cpp
@@ -0,0 +1,104 @@
+/*
+ * 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 "AsyncFileSystemChromium.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileSystemCallbacks.h"
+#include "FileSystem.h"
+#include "WebFileSystem.h"
+#include "WebFileSystemCallbacksImpl.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+AsyncFileSystemChromium::AsyncFileSystemChromium(const String& rootPath)
+    : AsyncFileSystem(rootPath)
+    , m_webFileSystem(WebKit::webKitClient()->fileSystem())
+{
+    ASSERT(m_webFileSystem);
+}
+
+AsyncFileSystemChromium::~AsyncFileSystemChromium()
+{
+}
+
+void AsyncFileSystemChromium::move(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->move(virtualToPlatformPath(srcPath), virtualToPlatformPath(destPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::copy(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->copy(virtualToPlatformPath(srcPath), virtualToPlatformPath(destPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->remove(virtualToPlatformPath(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->readMetadata(virtualToPlatformPath(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->createFile(virtualToPlatformPath(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->createDirectory(virtualToPlatformPath(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->fileExists(virtualToPlatformPath(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->directoryExists(virtualToPlatformPath(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+void AsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+    m_webFileSystem->readDirectory(virtualToPlatformPath(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/WebKit/chromium/src/AsyncFileSystemChromium.h b/WebKit/chromium/src/AsyncFileSystemChromium.h
new file mode 100644
index 0000000..f46f78c
--- /dev/null
+++ b/WebKit/chromium/src/AsyncFileSystemChromium.h
@@ -0,0 +1,70 @@
+/*
+ * 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  AsyncFileSystemChromium_h
+#define  AsyncFileSystemChromium_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileSystem.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+class WebFileSystem;
+}
+
+namespace WebCore {
+
+class AsyncFileSystemCallbacks;
+
+class AsyncFileSystemChromium : public AsyncFileSystem {
+public:
+    AsyncFileSystemChromium(const String& rootPath);
+    virtual ~AsyncFileSystemChromium();
+
+    virtual void move(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void copy(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+    virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
+
+private:
+    WebKit::WebFileSystem* m_webFileSystem;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif //  AsyncFileSystemChromium_h
diff --git a/WebKit/chromium/src/LocalFileSystemChromium.cpp b/WebKit/chromium/src/LocalFileSystemChromium.cpp
new file mode 100644
index 0000000..45365ef
--- /dev/null
+++ b/WebKit/chromium/src/LocalFileSystemChromium.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 ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileSystem.h"
+#include "ErrorCallback.h"
+#include "FileSystemCallback.h"
+#include "FileSystemCallbacks.h"
+#include "PlatformString.h"
+#include "WebFileSystem.h"
+#include "WebFileSystemCallbacksImpl.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
+
+using namespace WebKit;
+
+namespace WebCore {
+
+PassRefPtr<LocalFileSystem> LocalFileSystem::create(const String& path)
+{
+    return adoptRef(new LocalFileSystem(path));
+}
+
+void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+    ASSERT(context);
+    if (context->isDocument()) {
+        Document* document = static_cast<Document*>(context);
+        WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
+        webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(new FileSystemCallbacks(successCallback, errorCallback, context)));
+    } else {
+        // FIXME: Add implementation for workers.
+    }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
index 3829c4c..a23add7 100644
--- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
+++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
@@ -32,8 +32,9 @@
 
 #if ENABLE(FILE_SYSTEM)
 
+#include "AsyncFileSystemCallbacks.h"
+#include "AsyncFileSystemChromium.h"
 #include "ExceptionCode.h"
-#include "FileSystemCallbacks.h"
 #include "WebFileSystemEntry.h"
 #include "WebFileInfo.h"
 #include "WebString.h"
@@ -43,7 +44,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<FileSystemCallbacksBase> callbacks)
+WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
     : m_callbacks(callbacks)
 {
 }
@@ -78,7 +79,7 @@ void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemE
 
 void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const WebString& path)
 {
-    m_callbacks->didOpenFileSystem(name, path);
+    m_callbacks->didOpenFileSystem(name, new AsyncFileSystemChromium(path));
     delete this;
 }
 
diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
index f3c6bc3..b9c825b 100644
--- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
+++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
@@ -37,7 +37,7 @@
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
-class FileSystemCallbacksBase;
+class AsyncFileSystemCallbacks;
 }
 
 namespace WebKit {
@@ -48,7 +48,7 @@ class WebString;
 
 class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks {
 public:
-    WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::FileSystemCallbacksBase>);
+    WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>);
     virtual ~WebFileSystemCallbacksImpl();
 
     virtual void didSucceed();
@@ -58,7 +58,7 @@ public:
     virtual void didFail(WebFileError error);
 
 private:
-    OwnPtr<WebCore::FileSystemCallbacksBase> m_callbacks;
+    OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list