[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jorlow at chromium.org jorlow at chromium.org
Thu Apr 8 02:18:40 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit cb702d2537d79d69992384ff77e729fb451d48b5
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Mar 10 17:06:05 2010 +0000

    2010-03-10  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Add IndexedDatabase class and hook it up.
            https://bugs.webkit.org/show_bug.cgi?id=35927
    
            This change is mostly just adding the plumbing necessary for
            the IndexedDatabaseRequest and IndexedDatabaseSync (not written
            yet).
    
            This code is non-functional, so no tests (yet).
    
            * WebCore.gyp/WebCore.gyp:
            * WebCore.gypi:
            * platform/chromium/ChromiumBridge.h:
            * storage/IndexedDatabase.cpp: Added.
            (WebCore::IndexedDatabase::get):
            * storage/IndexedDatabase.h: Added.
            (WebCore::IndexedDatabase::~IndexedDatabase):
            * storage/IndexedDatabaseImpl.cpp: Added.
            (WebCore::IndexedDatabaseImpl::get):
            (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl):
            (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl):
            (WebCore::IndexedDatabaseImpl::open):
            * storage/IndexedDatabaseImpl.h: Added.
            * storage/chromium/IndexedDatabase.cpp: Added.
            (WebCore::IndexedDatabase::get):
    
            * WebKit.gyp:
            * public/WebIndexedDatabase.h: Added.
            (WebKit::WebIndexedDatabase::~WebIndexedDatabase):
            * public/WebKitClient.h:
            (WebKit::WebKitClient::getIndexedDatabase):
            * src/ChromiumBridge.cpp:
            (WebCore::ChromiumBridge::getIndexedDatabase):
            * src/IndexedDatabaseProxy.cpp: Added.
            (WebCore::IndexedDatabaseProxy::create):
            (WebCore::IndexedDatabaseProxy::IndexedDatabaseProxy):
            (WebCore::IndexedDatabaseProxy::~IndexedDatabaseProxy):
            (WebCore::IndexedDatabaseProxy::open):
            * src/IndexedDatabaseProxy.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c502886..eef9d52 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-03-10  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add IndexedDatabase class and hook it up.
+        https://bugs.webkit.org/show_bug.cgi?id=35927
+
+        This change is mostly just adding the plumbing necessary for
+        the IndexedDatabaseRequest and IndexedDatabaseSync (not written
+        yet).
+
+        This code is non-functional, so no tests (yet).
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/ChromiumBridge.h:
+        * storage/IndexedDatabase.cpp: Added.
+        (WebCore::IndexedDatabase::get):
+        * storage/IndexedDatabase.h: Added.
+        (WebCore::IndexedDatabase::~IndexedDatabase):
+        * storage/IndexedDatabaseImpl.cpp: Added.
+        (WebCore::IndexedDatabaseImpl::get):
+        (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::open):
+        * storage/IndexedDatabaseImpl.h: Added.
+        * storage/chromium/IndexedDatabase.cpp: Added.
+        (WebCore::IndexedDatabase::get):
+
 2010-03-05  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 7b2dff7..a03e1a7 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -762,6 +762,9 @@
         # Don't build StorageEventDispatcher.  We have our own implementation.
         '../storage/StorageEventDispatcher.cpp',
 
+        # Don't build IndexedDatabase.  We have our own implementation.
+        '../storage/IndexedDatabase.cpp',
+
         # Use history/BackForwardListChromium.cpp instead.
         '../history/BackForwardList.cpp',
 
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index bc3f797..a24e62c 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3226,6 +3226,7 @@
             'storage/ChangeVersionWrapper.cpp',
             'storage/ChangeVersionWrapper.h',
             'storage/chromium/DatabaseObserver.h',
+            'storage/chromium/IndexedDatabase.cpp',
             'storage/chromium/DatabaseTrackerChromium.cpp',
             'storage/chromium/QuotaTracker.cpp',
             'storage/chromium/QuotaTracker.h',
@@ -3247,6 +3248,10 @@
             'storage/IDBDatabaseRequest.h',
             'storage/IDBRequest.cpp',
             'storage/IDBRequest.h',
+            'storage/IndexedDatabase.cpp',
+            'storage/IndexedDatabase.h',
+            'storage/IndexedDatabaseImpl.cpp',
+            'storage/IndexedDatabaseImpl.h',
             'storage/IndexedDatabaseRequest.cpp',
             'storage/IndexedDatabaseRequest.h',
             'storage/LocalStorageTask.cpp',
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index f672d11..e582241 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -57,6 +57,7 @@ namespace WebCore {
     class GeolocationServiceChromium;
     class GraphicsContext;
     class Image;
+    class IndexedDatabase;
     class IntRect;
     class KURL;
     class String;
@@ -136,6 +137,9 @@ namespace WebCore {
         static long long databaseGetFileSize(const String& vfsFileName);
 #endif
 
+        // IndexedDB ----------------------------------------------------------
+        static PassRefPtr<IndexedDatabase> indexedDatabase();
+
         // JavaScript ---------------------------------------------------------
         static void notifyJSOutOfMemory(Frame*);
         static bool allowScriptDespiteSettings(const KURL& documentURL);
diff --git a/WebCore/storage/IndexedDatabase.cpp b/WebCore/storage/IndexedDatabase.cpp
new file mode 100644
index 0000000..167494e
--- /dev/null
+++ b/WebCore/storage/IndexedDatabase.cpp
@@ -0,0 +1,49 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabase.h"
+
+#include "IndexedDatabaseImpl.h"
+
+#if PLATFORM(CHROMIUM)
+#error "Chromium should not compile this file and instead define its own version of this factory that navigates the multi-process boundry."
+#endif
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabase::get()
+{
+    return IndexedDatabaseImpl::get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IndexedDatabase.h b/WebCore/storage/IndexedDatabase.h
new file mode 100644
index 0000000..e00f055
--- /dev/null
+++ b/WebCore/storage/IndexedDatabase.h
@@ -0,0 +1,56 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabase_h
+#define IndexedDatabase_h
+
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// This class is shared by IndexedDatabaseRequest (async) and IndexedDatabaseSync (sync).
+// This is implemented by IndexedDatabaseImpl and optionally others (in order to proxy
+// calls across process barriers). All calls to these classes should be non-blocking and
+// trigger work on a background thread if necessary.
+class IndexedDatabase : public ThreadSafeShared<IndexedDatabase> {
+public:
+    static PassRefPtr<IndexedDatabase> get();
+    virtual ~IndexedDatabase() { }
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&) = 0;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabase_h
+
diff --git a/WebCore/storage/IndexedDatabaseImpl.cpp b/WebCore/storage/IndexedDatabaseImpl.cpp
new file mode 100644
index 0000000..cfba05d
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseImpl.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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabaseImpl.h"
+
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IndexedDatabaseImpl* IndexedDatabaseImpl::indexedDatabaseImpl = 0;
+
+PassRefPtr<IndexedDatabaseImpl> IndexedDatabaseImpl::get()
+{
+    if (!indexedDatabaseImpl)
+        indexedDatabaseImpl = new IndexedDatabaseImpl();
+    ASSERT(indexedDatabaseImpl);
+    return indexedDatabaseImpl;
+}
+
+IndexedDatabaseImpl::IndexedDatabaseImpl()
+{
+    // FIXME: Make this thread safe.
+    ASSERT(!indexedDatabaseImpl);
+    indexedDatabaseImpl = this;
+}
+
+IndexedDatabaseImpl::~IndexedDatabaseImpl()
+{
+    // FIXME: Make this thread safe.
+    ASSERT(indexedDatabaseImpl == this);
+    indexedDatabaseImpl = 0;
+}
+
+void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&)
+{
+    // FIXME: Write.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IndexedDatabaseImpl.h b/WebCore/storage/IndexedDatabaseImpl.h
new file mode 100644
index 0000000..37bbc27
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseImpl.h
@@ -0,0 +1,56 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabaseImpl_h
+#define IndexedDatabaseImpl_h
+
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IndexedDatabaseImpl : public IndexedDatabase {
+public:
+    static PassRefPtr<IndexedDatabaseImpl> get();
+    virtual ~IndexedDatabaseImpl();
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&);
+
+private:
+    IndexedDatabaseImpl();
+
+    // We only create one instance of this class at a time.
+    static IndexedDatabaseImpl* indexedDatabaseImpl;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabaseImpl_h
+
diff --git a/WebCore/storage/chromium/IndexedDatabase.cpp b/WebCore/storage/chromium/IndexedDatabase.cpp
new file mode 100644
index 0000000..341a689
--- /dev/null
+++ b/WebCore/storage/chromium/IndexedDatabase.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabase.h"
+
+#include "ChromiumBridge.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabase::get()
+{
+    return ChromiumBridge::indexedDatabase();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index c5acd9a..ee37e7d 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,28 @@
+2010-03-10  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add IndexedDatabase class and hook it up.
+        https://bugs.webkit.org/show_bug.cgi?id=35927
+
+        This change is mostly just adding the plumbing necessary for
+        the IndexedDatabaseRequest and IndexedDatabaseSync (not written
+        yet).
+
+        * WebKit.gyp:
+        * public/WebIndexedDatabase.h: Added.
+        (WebKit::WebIndexedDatabase::~WebIndexedDatabase):
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::getIndexedDatabase):
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::getIndexedDatabase):
+        * src/IndexedDatabaseProxy.cpp: Added.
+        (WebCore::IndexedDatabaseProxy::create):
+        (WebCore::IndexedDatabaseProxy::IndexedDatabaseProxy):
+        (WebCore::IndexedDatabaseProxy::~IndexedDatabaseProxy):
+        (WebCore::IndexedDatabaseProxy::open):
+        * src/IndexedDatabaseProxy.h: Added.
+
 2010-03-10  Andrey Kosyakov  <caseq at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 0bef473..3f3b9fb 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -126,6 +126,7 @@
                 'public/WebHTTPBody.h',
                 'public/WebImage.h',
                 'public/WebImageDecoder.h',
+                'public/WebIndexedDatabase.h',
                 'public/WebInputElement.h',
                 'public/WebInputEvent.h',
                 'public/WebKit.h',
@@ -240,6 +241,8 @@
                 'src/gtk/WebFontInfo.cpp',
                 'src/gtk/WebFontInfo.h',
                 'src/gtk/WebInputEventFactory.cpp',
+                'src/IndexedDatabaseProxy.cpp',
+                'src/IndexedDatabaseProxy.h',
                 'src/InspectorClientImpl.cpp',
                 'src/InspectorClientImpl.h',
                 'src/linux/WebFontRendering.cpp',
diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h
new file mode 100644
index 0000000..21482b5
--- /dev/null
+++ b/WebKit/chromium/public/WebIndexedDatabase.h
@@ -0,0 +1,52 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIndexedDatabase_h
+#define WebIndexedDatabase_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebString;
+
+// The entry point into the IndexedDatabase API.  These classes match their _____Request and
+// _____Sync counterparts in the spec, but operate only in an async manner.
+// http://dev.w3.org/2006/webapi/WebSimpleDB/
+class WebIndexedDatabase {
+public:
+    // FIXME: Implement entry back into WebKit for this API.
+
+    virtual ~WebIndexedDatabase() { }
+
+    // FIXME: This should return an AsyncReturn<> object.
+    virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, int& exceptionCode) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebStorageNamespace_h
diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h
index 042833b..e186329 100644
--- a/WebKit/chromium/public/WebKitClient.h
+++ b/WebKit/chromium/public/WebKitClient.h
@@ -49,6 +49,7 @@ class WebApplicationCacheHost;
 class WebApplicationCacheHostClient;
 class WebClipboard;
 class WebCookieJar;
+class WebIndexedDatabase;
 class WebMessagePortChannel;
 class WebMimeRegistry;
 class WebPluginListBuilder;
@@ -127,7 +128,7 @@ public:
     virtual bool isLinkVisited(unsigned long long linkHash) { return false; }
 
 
-    // Database ------------------------------------------------------------
+    // HTML5 Database ------------------------------------------------------
 
 #ifdef WIN32
     typedef HANDLE FileHandle;
@@ -150,6 +151,11 @@ public:
     virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; }
 
 
+    // Indexed Database ----------------------------------------------------
+
+    virtual WebIndexedDatabase* getIndexedDatabase() { return 0; }
+
+
     // Keygen --------------------------------------------------------------
 
     // Handle the <keygen> tag for generating client certificates
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index 1df7f07..3d51664 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -77,6 +77,7 @@
 #include "FrameView.h"
 #include "GeolocationServiceBridgeChromium.h"
 #include "GraphicsContext.h"
+#include "IndexedDatabaseProxy.h"
 #include "KURL.h"
 #include "NotImplemented.h"
 #include "PlatformContextSkia.h"
@@ -392,6 +393,15 @@ long long ChromiumBridge::databaseGetFileSize(const String& vfsFileName)
 }
 #endif
 
+// Indexed Database -----------------------------------------------------------
+
+PassRefPtr<IndexedDatabase> ChromiumBridge::indexedDatabase()
+{
+    // There's no reason why we need to allocate a new proxy each time, but
+    // there's also no strong reason not to.
+    return IndexedDatabaseProxy::create();
+}
+
 // Keygen ---------------------------------------------------------------------
 
 String ChromiumBridge::signedPublicKeyAndChallengeString(
diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.cpp b/WebKit/chromium/src/IndexedDatabaseProxy.cpp
new file mode 100644
index 0000000..a098641
--- /dev/null
+++ b/WebKit/chromium/src/IndexedDatabaseProxy.cpp
@@ -0,0 +1,61 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabaseProxy.h"
+
+#include "WebIndexedDatabase.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabaseProxy::create()
+{
+    return adoptRef(new IndexedDatabaseProxy());
+}
+
+IndexedDatabaseProxy::IndexedDatabaseProxy()
+    : m_webIndexedDatabase(WebKit::webKitClient()->getIndexedDatabase())
+{
+}
+
+IndexedDatabaseProxy::~IndexedDatabaseProxy()
+{
+}
+
+void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& ec)
+{
+    m_webIndexedDatabase->open(name, description, modifyDatabase, ec);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.h b/WebKit/chromium/src/IndexedDatabaseProxy.h
new file mode 100644
index 0000000..a4bac2c
--- /dev/null
+++ b/WebKit/chromium/src/IndexedDatabaseProxy.h
@@ -0,0 +1,58 @@
+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabaseProxy_h
+#define IndexedDatabaseProxy_h
+
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebKit { class WebIndexedDatabase; }
+
+namespace WebCore {
+
+class IndexedDatabaseProxy : public IndexedDatabase {
+public:
+    static PassRefPtr<IndexedDatabase> create();
+    virtual ~IndexedDatabaseProxy();
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&);
+
+private:
+    IndexedDatabaseProxy();
+
+    // We don't own this pointer.
+    WebKit::WebIndexedDatabase* m_webIndexedDatabase;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabaseProxy_h
+

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list