WorkerContext shouldn't know about IndexedDB
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Mar 2012 12:45:46 +0000 (12:45 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Mar 2012 12:45:46 +0000 (12:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80094

Reviewed by Kentaro Hara.

There are still a couple IndexedDB stragglers we should clean up in
WebCore proper.  This patch moves some IndexedDB logic from
WorkerContext into the indexeddb module.

In the process of writing this patch, I noticed that some IndexedDB
files were missing from various build systems, so I added them.  I
suspect that means IndexedDB is only enabled by default on Chromium.

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Modules/indexeddb/WorkerContextIndexedDatabase.cpp: Added.
(WebCore):
(WebCore::WorkerContextIndexedDatabase::WorkerContextIndexedDatabase):
(WebCore::WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase):
(WebCore::WorkerContextIndexedDatabase::from):
(WebCore::WorkerContextIndexedDatabase::webkitIndexedDB):
* Modules/indexeddb/WorkerContextIndexedDatabase.h: Added.
(WebCore):
(WorkerContextIndexedDatabase):
* Modules/indexeddb/WorkerContextIndexedDatabase.idl: Added.
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* workers/WorkerContext.cpp:
(WebCore):
* workers/WorkerContext.h:
(WebCore):
(WorkerContext):
* workers/WorkerContext.idl:

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

15 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl [new file with mode: 0644]
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/workers/WorkerContext.cpp
Source/WebCore/workers/WorkerContext.h
Source/WebCore/workers/WorkerContext.idl

index 31999b8..555930a 100644 (file)
@@ -415,6 +415,7 @@ SET(WebCore_SOURCES
     Modules/geolocation/GeolocationController.cpp
     Modules/geolocation/NavigatorGeolocation.cpp
 
+    Modules/indexeddb/DOMWindowIndexedDatabase.cpp
     Modules/indexeddb/IDBAny.cpp
     Modules/indexeddb/IDBDatabase.cpp
     Modules/indexeddb/IDBDatabaseBackendImpl.cpp
@@ -432,6 +433,8 @@ SET(WebCore_SOURCES
     Modules/indexeddb/IDBFactory.cpp
     Modules/indexeddb/IDBFactoryBackendInterface.cpp
     Modules/indexeddb/IDBFactoryBackendImpl.cpp
+    Modules/indexeddb/PageGroupIndexedDatabase.cpp
+    Modules/indexeddb/WorkerContextIndexedDatabase.cpp
 
     accessibility/AXObjectCache.cpp
     accessibility/AccessibilityARIAGrid.cpp
@@ -1539,6 +1542,7 @@ ENDIF ()
 
 IF (ENABLE_INDEXED_DATABASE)
     LIST(APPEND WebCore_IDL_FILES
+        Modules/indexeddb/DOMWindowIndexedDatabase.idl
         Modules/indexeddb/IDBAny.idl
         Modules/indexeddb/IDBCursor.idl
         Modules/indexeddb/IDBDatabaseError.idl
@@ -1551,6 +1555,7 @@ IF (ENABLE_INDEXED_DATABASE)
         Modules/indexeddb/IDBObjectStore.idl
         Modules/indexeddb/IDBRequest.idl
         Modules/indexeddb/IDBTransaction.idl
+        Modules/indexeddb/WorkerContextIndexedDatabase.idl
     )
 ENDIF ()
 
index 1b86f5d..58a4425 100644 (file)
@@ -1,3 +1,43 @@
+2012-03-02  Adam Barth  <abarth@webkit.org>
+
+        WorkerContext shouldn't know about IndexedDB
+        https://bugs.webkit.org/show_bug.cgi?id=80094
+
+        Reviewed by Kentaro Hara.
+
+        There are still a couple IndexedDB stragglers we should clean up in
+        WebCore proper.  This patch moves some IndexedDB logic from
+        WorkerContext into the indexeddb module.
+
+        In the process of writing this patch, I noticed that some IndexedDB
+        files were missing from various build systems, so I added them.  I
+        suspect that means IndexedDB is only enabled by default on Chromium.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * DerivedSources.pri:
+        * GNUmakefile.list.am:
+        * Modules/indexeddb/WorkerContextIndexedDatabase.cpp: Added.
+        (WebCore):
+        (WebCore::WorkerContextIndexedDatabase::WorkerContextIndexedDatabase):
+        (WebCore::WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase):
+        (WebCore::WorkerContextIndexedDatabase::from):
+        (WebCore::WorkerContextIndexedDatabase::webkitIndexedDB):
+        * Modules/indexeddb/WorkerContextIndexedDatabase.h: Added.
+        (WebCore):
+        (WorkerContextIndexedDatabase):
+        * Modules/indexeddb/WorkerContextIndexedDatabase.idl: Added.
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * workers/WorkerContext.cpp:
+        (WebCore):
+        * workers/WorkerContext.h:
+        (WebCore):
+        (WorkerContext):
+        * workers/WorkerContext.idl:
+
 2012-03-02  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Compile WebCore without QtWidgets
index 913c810..156967b 100644 (file)
@@ -62,6 +62,7 @@ BINDING_IDLS = \
     $(WebCore)/Modules/geolocation/PositionCallback.idl \
     $(WebCore)/Modules/geolocation/PositionError.idl \
     $(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
+    $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
     $(WebCore)/Modules/indexeddb/IDBAny.idl \
     $(WebCore)/Modules/indexeddb/IDBCursor.idl \
     $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
@@ -74,6 +75,7 @@ BINDING_IDLS = \
     $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
     $(WebCore)/Modules/indexeddb/IDBRequest.idl \
     $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
+    $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
     $(WebCore)/Modules/websockets/CloseEvent.idl \
     $(WebCore)/Modules/websockets/DOMWindowWebSocket.idl \
     $(WebCore)/Modules/websockets/WebSocket.idl \
index 66b3a34..f41e8e3 100644 (file)
@@ -92,6 +92,7 @@ IDL_BINDINGS += \
     $$PWD/Modules/geolocation/PositionCallback.idl \
     $$PWD/Modules/geolocation/PositionError.idl \
     $$PWD/Modules/geolocation/PositionErrorCallback.idl \
+    $$PWD/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
     $$PWD/Modules/indexeddb/IDBAny.idl \
     $$PWD/Modules/indexeddb/IDBCursor.idl \
     $$PWD/Modules/indexeddb/IDBDatabaseError.idl \
@@ -104,6 +105,7 @@ IDL_BINDINGS += \
     $$PWD/Modules/indexeddb/IDBObjectStore.idl \
     $$PWD/Modules/indexeddb/IDBRequest.idl \
     $$PWD/Modules/indexeddb/IDBTransaction.idl \
+    $$PWD/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
     $$PWD/Modules/websockets/CloseEvent.idl \
     $$PWD/Modules/websockets/DOMWindowWebSocket.idl \
     $$PWD/Modules/websockets/WebSocket.idl \
index 720ebb6..280bdcb 100644 (file)
@@ -970,6 +970,8 @@ webcore_sources += \
        Source/WebCore/Modules/geolocation/PositionError.h \
        Source/WebCore/Modules/geolocation/PositionErrorCallback.h \
        Source/WebCore/Modules/geolocation/PositionOptions.h \
+       Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp \
+       Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h \
        Source/WebCore/Modules/indexeddb/IDBAny.cpp \
        Source/WebCore/Modules/indexeddb/IDBAny.h \
        Source/WebCore/Modules/indexeddb/IDBBackingStore.h \
@@ -1026,6 +1028,10 @@ webcore_sources += \
        Source/WebCore/Modules/indexeddb/IDBTransaction.h \
        Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h \
        Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.h \
+       Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp \
+       Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h \
+       Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp \
+       Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h \
        Source/WebCore/Modules/mediastream/LocalMediaStream.cpp \
        Source/WebCore/Modules/mediastream/LocalMediaStream.h \
        Source/WebCore/Modules/mediastream/MediaStream.cpp \
@@ -4790,6 +4796,7 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSIDBTransaction.h
 
 dom_binding_idls += \
+       $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
        $(WebCore)/Modules/indexeddb/IDBAny.idl \
        $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
        $(WebCore)/Modules/indexeddb/IDBDatabaseError.idl \
@@ -4799,7 +4806,8 @@ dom_binding_idls += \
        $(WebCore)/Modules/indexeddb/IDBKeyRange.idl \
        $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
        $(WebCore)/Modules/indexeddb/IDBRequest.idl \
-       $(WebCore)/Modules/indexeddb/IDBTransaction.idl
+       $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
+       $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl
 endif # END ENABLE_INDEXED_DATABASE
 
 # ----
diff --git a/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp b/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp
new file mode 100644 (file)
index 0000000..b3d2099
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009, 2011 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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"
+
+#if ENABLE(WORKERS) && ENABLE(INDEXED_DATABASE)
+
+#include "WorkerContextIndexedDatabase.h"
+
+#include "IDBFactory.h"
+#include "IDBFactoryBackendInterface.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
+
+namespace WebCore {
+
+WorkerContextIndexedDatabase::WorkerContextIndexedDatabase(ScriptExecutionContext* context)
+    : m_context(context)
+{
+}
+
+WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase()
+{
+}
+
+WorkerContextIndexedDatabase* WorkerContextIndexedDatabase::from(ScriptExecutionContext* context)
+{
+    AtomicString name = "WorkderContextIndexedDatabase";
+    WorkerContextIndexedDatabase* supplement = static_cast<WorkerContextIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, name));
+    if (!supplement) {
+        supplement = new WorkerContextIndexedDatabase(context);
+        provideTo(context, name, adoptPtr(supplement));
+    }
+    return supplement;
+}
+
+IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB(ScriptExecutionContext* context)
+{
+    return from(context)->webkitIndexedDB();
+}
+
+IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB()
+{
+    if (!m_context->securityOrigin()->canAccessDatabase())
+        return 0;
+    if (!m_factoryBackend)
+        m_factoryBackend = IDBFactoryBackendInterface::create();
+    if (!m_idbFactory)
+        m_idbFactory = IDBFactory::create(m_factoryBackend.get());
+    return m_idbFactory.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS) && ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h b/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h
new file mode 100644 (file)
index 0000000..836caa8
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008, 2009 Apple 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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 WorkerContextIndexedDatabase_h
+#define WorkerContextIndexedDatabase_h
+
+#if ENABLE(WORKERS) && ENABLE(INDEXED_DATABASE)
+
+#include "Supplementable.h"
+
+namespace WebCore {
+
+class IDBFactory;
+class IDBFactoryBackendInterface;
+class ScriptExecutionContext;
+
+class WorkerContextIndexedDatabase : public Supplement<ScriptExecutionContext> {
+public:
+    virtual ~WorkerContextIndexedDatabase();
+    static WorkerContextIndexedDatabase* from(ScriptExecutionContext*);
+
+    static IDBFactory* webkitIndexedDB(ScriptExecutionContext*);
+
+private:
+    explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
+
+    IDBFactory* webkitIndexedDB();
+
+    ScriptExecutionContext* m_context;
+    RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
+    RefPtr<IDBFactory> m_idbFactory;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS) && ENABLE(INDEXED_DATABASE)
+
+#endif // WorkerContextIndexedDatabase_h
diff --git a/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl b/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl
new file mode 100644 (file)
index 0000000..f9795a8
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Apple 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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. 
+ *
+ */
+
+module threads {
+
+    interface [
+        Conditional=INDEXED_DATABASE,
+        Supplemental=WorkerContext
+    ] WorkerContextIndexedDatabase {
+        readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
+
+        attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
+        attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
+        attribute [V8EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError;
+        attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
+        attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
+        attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
+        attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
+        attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
+        attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
+        attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
+    };
+
+}
index 7620ad3..14acc42 100644 (file)
@@ -3014,6 +3014,7 @@ contains(DEFINES, ENABLE_INDEXED_DATABASE=1) {
     }
 
     SOURCES += \
+        Modules/indexeddb/DOMWindowIndexedDatabase.cpp \
         Modules/indexeddb/IDBAny.cpp \
         Modules/indexeddb/IDBCursor.cpp \
         Modules/indexeddb/IDBCursorBackendImpl.cpp \
@@ -3031,7 +3032,9 @@ contains(DEFINES, ENABLE_INDEXED_DATABASE=1) {
         Modules/indexeddb/IDBObjectStore.cpp \
         Modules/indexeddb/IDBObjectStoreBackendImpl.cpp \
         Modules/indexeddb/IDBRequest.cpp \
-        Modules/indexeddb/IDBTransaction.cpp
+        Modules/indexeddb/IDBTransaction.cpp \
+        Modules/indexeddb/PageGroupIndexedDatabase.cpp \
+        Modules/indexeddb/WorkerContextIndexedDatabase.cpp
 }
 
 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1) {
index ad314da..747c19a 100644 (file)
             'Modules/indexeddb/IDBTransaction.idl',
             'Modules/indexeddb/IDBVersionChangeEvent.idl',
             'Modules/indexeddb/IDBVersionChangeRequest.idl',
+            'Modules/indexeddb/WorkerContextIndexedDatabase.idl',
             'Modules/intents/DOMWindowIntents.idl',
             'Modules/intents/Intent.idl',
             'Modules/intents/IntentResultCallback.idl',
             'Modules/indexeddb/IDBVersionChangeRequest.h',
             'Modules/indexeddb/PageGroupIndexedDatabase.cpp',
             'Modules/indexeddb/PageGroupIndexedDatabase.h',
+            'Modules/indexeddb/WorkerContextIndexedDatabase.cpp',
+            'Modules/indexeddb/WorkerContextIndexedDatabase.h',
             'Modules/intents/Intent.cpp',
             'Modules/intents/Intent.h',
             'Modules/intents/IntentRequest.cpp',
index 5e29e46..2ecce22 100755 (executable)
                                Name="indexeddb"
                                >
                                <File
+                                       RelativePath="..\Modules\indexeddb\DOMWindowIndexedDatabase.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\Modules\indexeddb\DOMWindowIndexedDatabase.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\Modules\indexeddb\IDBAny.cpp"
                                        >
                                </File>
                                        RelativePath="..\Modules\indexeddb\IDBTransaction.h"
                                        >
                                </File>
+                               <File
+                                       RelativePath="..\Modules\indexeddb\PageGroupIndexedDatabase.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\Modules\indexeddb\PageGroupIndexedDatabase.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\Modules\indexeddb\WorkerContextIndexedDatabase.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\Modules\indexeddb\WorkerContextIndexedDatabase.h"
+                                       >
+                               </File>
                        </Filter>
                        <Filter
                                Name="websockets"
index 16b6d80..5c75890 100644 (file)
                9712A60215004EDA0048AF10 /* IDBVersionChangeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5A915004EDA0048AF10 /* IDBVersionChangeRequest.h */; };
                9712A60415004EDA0048AF10 /* PageGroupIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */; };
                9712A60515004EDA0048AF10 /* PageGroupIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */; };
+               9712A611150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */; };
+               9712A612150090CE0048AF10 /* WorkerContextIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */; };
                97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */; };
                97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */; };
                97205AB51239291000B17380 /* ImageDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AB11239291000B17380 /* ImageDocument.cpp */; };
                9712A5AA15004EDA0048AF10 /* IDBVersionChangeRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = IDBVersionChangeRequest.idl; path = Modules/indexeddb/IDBVersionChangeRequest.idl; sourceTree = "<group>"; };
                9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PageGroupIndexedDatabase.cpp; path = Modules/indexeddb/PageGroupIndexedDatabase.cpp; sourceTree = "<group>"; };
                9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PageGroupIndexedDatabase.h; path = Modules/indexeddb/PageGroupIndexedDatabase.h; sourceTree = "<group>"; };
+               9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerContextIndexedDatabase.cpp; path = Modules/indexeddb/WorkerContextIndexedDatabase.cpp; sourceTree = "<group>"; };
+               9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerContextIndexedDatabase.h; path = Modules/indexeddb/WorkerContextIndexedDatabase.h; sourceTree = "<group>"; };
+               9712A610150090CE0048AF10 /* WorkerContextIndexedDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextIndexedDatabase.idl; path = Modules/indexeddb/WorkerContextIndexedDatabase.idl; sourceTree = "<group>"; };
                97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FTPDirectoryDocument.cpp; sourceTree = "<group>"; };
                97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTPDirectoryDocument.h; sourceTree = "<group>"; };
                97205AB11239291000B17380 /* ImageDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDocument.cpp; sourceTree = "<group>"; };
                                9712A5AA15004EDA0048AF10 /* IDBVersionChangeRequest.idl */,
                                9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */,
                                9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */,
+                               9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */,
+                               9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */,
+                               9712A610150090CE0048AF10 /* WorkerContextIndexedDatabase.idl */,
                        );
                        name = indexeddb;
                        sourceTree = "<group>";
                                2E4346460F546A8200B0F1BA /* Worker.h in Headers */,
                                F3820897147D35F90010BC06 /* WorkerConsoleAgent.h in Headers */,
                                2E4346490F546A8200B0F1BA /* WorkerContext.h in Headers */,
+                               9712A612150090CE0048AF10 /* WorkerContextIndexedDatabase.h in Headers */,
                                2E43464B0F546A8200B0F1BA /* WorkerContextProxy.h in Headers */,
                                F34742E11343631F00531BC2 /* WorkerDebuggerAgent.h in Headers */,
                                A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */,
                                2E4346450F546A8200B0F1BA /* Worker.cpp in Sources */,
                                F3820896147D35F90010BC06 /* WorkerConsoleAgent.cpp in Sources */,
                                2E4346480F546A8200B0F1BA /* WorkerContext.cpp in Sources */,
+                               9712A611150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp in Sources */,
                                F34742E01343631F00531BC2 /* WorkerDebuggerAgent.cpp in Sources */,
                                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */,
                                F36E07A41358A8BE00AACBC9 /* WorkerInspectorController.cpp in Sources */,
index 1c043b9..80b5da6 100644 (file)
@@ -69,7 +69,6 @@
 #endif
 
 #include "ExceptionCode.h"
-#include "IDBFactory.h"
 
 namespace WebCore {
 
@@ -407,19 +406,6 @@ void WorkerContext::notifyObserversOfStop()
     }
 }
 
-#if ENABLE(INDEXED_DATABASE)
-IDBFactory* WorkerContext::webkitIndexedDB() const
-{
-    if (!securityOrigin()->canAccessDatabase())
-        return 0;
-    if (!m_idbFactoryBackendInterface)
-        m_idbFactoryBackendInterface = IDBFactoryBackendInterface::create();
-    if (!m_idbFactory)
-        m_idbFactory = IDBFactory::create(m_idbFactoryBackendInterface.get());
-    return m_idbFactory.get();
-}
-#endif
-
 WorkerEventQueue* WorkerContext::eventQueue() const
 {
     return m_eventQueue.get();
index 6b26c35..c1d99ee 100644 (file)
@@ -51,7 +51,6 @@ namespace WebCore {
     class Database;
     class DatabaseCallback;
     class DatabaseSync;
-    class IDBFactory;
     class NotificationCenter;
     class ScheduledAction;
     class WorkerInspectorController;
@@ -154,9 +153,6 @@ namespace WebCore {
         void registerObserver(Observer*);
         void unregisterObserver(Observer*);
         void notifyObserversOfStop();
-#if ENABLE(INDEXED_DATABASE)
-        IDBFactory* webkitIndexedDB() const;
-#endif
 
     protected:
         WorkerContext(const KURL&, const String&, WorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
@@ -204,12 +200,6 @@ namespace WebCore {
         HashSet<Observer*> m_workerObservers;
 
         OwnPtr<WorkerEventQueue> m_eventQueue;
-
-#if ENABLE(INDEXED_DATABASE)
-        mutable RefPtr<IDBFactory> m_idbFactory;
-        mutable RefPtr<IDBFactoryBackendInterface> m_idbFactoryBackendInterface;
-#endif
-
     };
 
 } // namespace WebCore
index 7314e53..1f7c075 100644 (file)
@@ -115,20 +115,6 @@ module threads {
         attribute Float32ArrayConstructor Float32Array; // Usable with new operator
         attribute Float64ArrayConstructor Float64Array; // Usable with new operator
         attribute DataViewConstructor DataView; // Usable with new operator
-#if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
-        readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
-
-        attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
-        attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
-        attribute [V8EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError;
-        attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
-        attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
-        attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
-        attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
-        attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
-        attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
-        attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
-#endif
     };
 
 }