Fix IndexedDB build with JSC
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 05:38:59 +0000 (05:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 05:38:59 +0000 (05:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80207

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-03-12
Reviewed by Adam Barth.

This fixes the build of WebKit when IndexedDB is enabled. Most functions were added
empty implementation, it compiles but IndexedDB is not working.

* DerivedSources.make: Added missing IDL files.
* Modules/indexeddb/IDBDatabaseBackendImpl.h: Fix warnings and build errors.
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp: ditto.
(WebCore::IDBDatabaseCallbacksImpl::unregisterDatabase): ditto.
* Modules/indexeddb/IDBFactoryBackendImpl.cpp: ditto.
(WebCore::IDBFactoryBackendImpl::openBackingStore):
* Modules/indexeddb/IDBIndexBackendImpl.cpp: ditto.
(WebCore::IDBIndexBackendImpl::countInternal):
* Modules/indexeddb/IDBKeyPathBackendImpl.cpp: Fix the method signature and add
an empty implementation.
(WebCore):
(WebCore::IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath):
(WebCore::IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: Fix warnings.
(WebCore::IDBObjectStoreBackendImpl::countInternal):
* Modules/indexeddb/IDBPendingTransactionMonitor.cpp: ditto.
(WebCore::transactions):
* Modules/indexeddb/IDBRequest.cpp: ditto.
(WebCore::IDBRequest::resetReadyState):
* Modules/indexeddb/IDBRequest.h: ditto.
(WebCore::IDBRequest::onSuccessWithPrefetch):
(WebCore):
(WebCore::JSIDBVersionChangeRequest::visitChildren):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue): Fix the creation of IDBKeys.
(WebCore::createOptionsObjectFromValue): Add an empty implementation of
the handling of database options (IDBObjectStoreParameters).
(WebCore):
* bindings/js/IDBBindingUtilities.h:
(WebCore):
* bindings/js/JSIDBAnyCustom.cpp:
(WebCore::toJS): Add the missing IDBAny's types.
* bindings/js/JSIDBKeyCustom.cpp:
(WebCore::toJS): Add the missing IDBKey's types.
* bindings/js/JSIDBVersionChangeRequestCustom.cpp: Added.
IDBVersionChangeRequest has the attribute EventTarget so it requires
the visitChildren() function. An empty implementation was added.
* bindings/js/OptionsObject.h: Add an empty implementation.
(WebCore):
(OptionsObject):
(WebCore::OptionsObject::OptionsObject):
(WebCore::OptionsObject::isObject):
(WebCore::OptionsObject::isUndefinedOrNull):
(WebCore::OptionsObject::get):
(WebCore::OptionsObject::getWithUndefinedOrNullCheck):
* bindings/js/SerializedScriptValue.cpp: Add the missing functions needed by IndexedDB.
(WebCore):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::toWireString):
(WebCore::SerializedScriptValue::createFromWire):
(WebCore::SerializedScriptValue::numberValue):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
(SerializedScriptValue):
* bindings/scripts/CodeGeneratorJS.pm: Modify the code generator to:
-Support the IDBKey type correctly.
-Support the OptionsObject type.
-Generate valid function call for static functions.
(GenerateImplementationFunctionCall):
(JSValueToNative):
(NativeToJSValue):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore):

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

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBKeyPathBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/IDBBindingUtilities.cpp
Source/WebCore/bindings/js/IDBBindingUtilities.h
Source/WebCore/bindings/js/JSIDBAnyCustom.cpp
Source/WebCore/bindings/js/JSIDBKeyCustom.cpp
Source/WebCore/bindings/js/JSIDBVersionChangeRequestCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/OptionsObject.h
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/js/SerializedScriptValue.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp

index c52e694..2d0916b 100644 (file)
@@ -1,3 +1,79 @@
+2012-03-12  Benjamin Poulain  <bpoulain@apple.com>
+
+        Fix IndexedDB build with JSC
+        https://bugs.webkit.org/show_bug.cgi?id=80207
+
+        Reviewed by Adam Barth.
+
+        This fixes the build of WebKit when IndexedDB is enabled. Most functions were added
+        empty implementation, it compiles but IndexedDB is not working.
+
+        * DerivedSources.make: Added missing IDL files.
+        * Modules/indexeddb/IDBDatabaseBackendImpl.h: Fix warnings and build errors.
+        (IDBDatabaseBackendImpl):
+        * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp: ditto.
+        (WebCore::IDBDatabaseCallbacksImpl::unregisterDatabase): ditto.
+        * Modules/indexeddb/IDBFactoryBackendImpl.cpp: ditto.
+        (WebCore::IDBFactoryBackendImpl::openBackingStore):
+        * Modules/indexeddb/IDBIndexBackendImpl.cpp: ditto.
+        (WebCore::IDBIndexBackendImpl::countInternal):
+        * Modules/indexeddb/IDBKeyPathBackendImpl.cpp: Fix the method signature and add
+        an empty implementation.
+        (WebCore):
+        (WebCore::IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath):
+        (WebCore::IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue):
+        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: Fix warnings.
+        (WebCore::IDBObjectStoreBackendImpl::countInternal):
+        * Modules/indexeddb/IDBPendingTransactionMonitor.cpp: ditto.
+        (WebCore::transactions):
+        * Modules/indexeddb/IDBRequest.cpp: ditto.
+        (WebCore::IDBRequest::resetReadyState):
+        * Modules/indexeddb/IDBRequest.h: ditto.
+        (WebCore::IDBRequest::onSuccessWithPrefetch):
+        (WebCore):
+        (WebCore::JSIDBVersionChangeRequest::visitChildren):
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::createIDBKeyFromValue): Fix the creation of IDBKeys.
+        (WebCore::createOptionsObjectFromValue): Add an empty implementation of
+        the handling of database options (IDBObjectStoreParameters).
+        (WebCore):
+        * bindings/js/IDBBindingUtilities.h:
+        (WebCore):
+        * bindings/js/JSIDBAnyCustom.cpp:
+        (WebCore::toJS): Add the missing IDBAny's types.
+        * bindings/js/JSIDBKeyCustom.cpp:
+        (WebCore::toJS): Add the missing IDBKey's types.
+        * bindings/js/JSIDBVersionChangeRequestCustom.cpp: Added.
+        IDBVersionChangeRequest has the attribute EventTarget so it requires
+        the visitChildren() function. An empty implementation was added.
+        * bindings/js/OptionsObject.h: Add an empty implementation.
+        (WebCore):
+        (OptionsObject):
+        (WebCore::OptionsObject::OptionsObject):
+        (WebCore::OptionsObject::isObject):
+        (WebCore::OptionsObject::isUndefinedOrNull):
+        (WebCore::OptionsObject::get):
+        (WebCore::OptionsObject::getWithUndefinedOrNullCheck):
+        * bindings/js/SerializedScriptValue.cpp: Add the missing functions needed by IndexedDB.
+        (WebCore):
+        (WebCore::SerializedScriptValue::create):
+        (WebCore::SerializedScriptValue::toWireString):
+        (WebCore::SerializedScriptValue::createFromWire):
+        (WebCore::SerializedScriptValue::numberValue):
+        (WebCore::SerializedScriptValue::deserialize):
+        * bindings/js/SerializedScriptValue.h:
+        (SerializedScriptValue):
+        * bindings/scripts/CodeGeneratorJS.pm: Modify the code generator to:
+        -Support the IDBKey type correctly.
+        -Support the OptionsObject type.
+        -Generate valid function call for static functions.
+        (GenerateImplementationFunctionCall):
+        (JSValueToNative):
+        (NativeToJSValue):
+        * inspector/InspectorIndexedDBAgent.cpp:
+        (WebCore):
+
 2012-03-12  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r110529.
index 2460683..96be3e8 100644 (file)
@@ -76,6 +76,8 @@ BINDING_IDLS = \
     $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
     $(WebCore)/Modules/indexeddb/IDBRequest.idl \
     $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
+    $(WebCore)/Modules/indexeddb/IDBVersionChangeEvent.idl \
+    $(WebCore)/Modules/indexeddb/IDBVersionChangeRequest.idl \
     $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
     $(WebCore)/Modules/webdatabase/DOMWindowSQLDatabase.idl \
     $(WebCore)/Modules/webdatabase/Database.idl \
index 7a5ce1d..1086eb1 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "IDBCallbacks.h"
 #include "IDBDatabase.h"
+#include <stdint.h>
 #include <wtf/Deque.h>
 #include <wtf/HashMap.h>
 #include <wtf/ListHashSet.h>
@@ -92,7 +93,7 @@ private:
     static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version);
 
     RefPtr<IDBBackingStore> m_backingStore;
-    int64 m_id;
+    int64_t m_id;
     String m_name;
     String m_version;
 
index 39c4409..19412fc 100644 (file)
@@ -54,7 +54,7 @@ void IDBDatabaseCallbacksImpl::onVersionChange(const String& version)
 
 void IDBDatabaseCallbacksImpl::unregisterDatabase(IDBDatabase* database)
 {
-    ASSERT(database == m_database);
+    ASSERT_UNUSED(database, database == m_database);
     m_database = 0;
 }
 
index dd242ea..f5b9c87 100644 (file)
@@ -30,6 +30,7 @@
 #include "IDBFactoryBackendImpl.h"
 
 #include "DOMStringList.h"
+#include "IDBBackingStore.h"
 #include "IDBDatabaseBackendImpl.h"
 #include "IDBDatabaseException.h"
 #include "IDBLevelDBBackingStore.h"
@@ -144,6 +145,7 @@ PassRefPtr<IDBBackingStore> IDBFactoryBackendImpl::openBackingStore(PassRefPtr<S
 #if USE(LEVELDB)
         backingStore = IDBLevelDBBackingStore::open(securityOrigin.get(), dataDirectory, fileIdentifier, this);
 #else
+        UNUSED_PARAM(dataDirectory);
         ASSERT_NOT_REACHED();
 #endif
     }
index cec43b9..43ae9c2 100644 (file)
@@ -126,7 +126,7 @@ void IDBIndexBackendImpl::openKeyCursor(PassRefPtr<IDBKeyRange> prpKeyRange, uns
         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
 }
 
-void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
+void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface>)
 {
     IDB_TRACE("IDBIndexBackendImpl::countInternal");
     uint32_t count = 0;
index 4f0fcee..94c7f27 100644 (file)
 #include "config.h"
 #include "IDBKeyPathBackendImpl.h"
 
+#include "IDBKey.h"
+#include "SerializedScriptValue.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)
 
-void IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue>&, 0> values, const String& keyPath, Vector<RefPtr<IDBKey>, 0>& keys)
+namespace WebCore {
+
+void IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue>, 0>&, const String&, Vector<RefPtr<IDBKey>, 0>&)
 {
     // FIXME: Implement this method once JSC supports WireFormat for SerializedScriptValue.
 }
 
-PassRefPtr<SerializedScriptValue> IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue(PassRefPtr<IDBKey> key, PassRefPtr<SerializedScriptValue> value, const String& keyPath)
+PassRefPtr<SerializedScriptValue> IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue(PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>, const String&)
 {
     // FIXME: Implement this method once JSC supports WireFormat for SerializedScriptValue.
-    return 0;
+    return PassRefPtr<SerializedScriptValue>();
+}
+
 }
 
 #endif // ENABLE(INDEXED_DATABASE)
index 548f1a2..2e2f0fa 100644 (file)
@@ -596,7 +596,7 @@ void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<
         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
 }
 
-void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
+void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface>)
 {
     IDB_TRACE("IDBObjectStoreBackendImpl::countInternal");
     uint32_t count = 0;
index f2de3e7..2c5ac5a 100644 (file)
@@ -34,7 +34,7 @@ using WTF::ThreadSpecific;
 
 namespace WebCore {
 
-ThreadSpecific<Vector<IDBTransactionBackendInterface*> >& transactions()
+static ThreadSpecific<Vector<IDBTransactionBackendInterface*> >& transactions()
 {
     // FIXME: Move the Vector to ScriptExecutionContext to avoid dealing with
     // thread-local storage.
index 90c188c..5f2185a 100644 (file)
@@ -129,7 +129,7 @@ bool IDBRequest::resetReadyState(IDBTransaction* transaction)
 {
     ASSERT(!m_requestFinished);
     ASSERT(scriptExecutionContext());
-    ASSERT(transaction == m_transaction);
+    ASSERT_UNUSED(transaction, transaction == m_transaction);
     if (m_readyState != DONE)
         return false;
 
index a6b573d..1a69fa7 100644 (file)
@@ -85,7 +85,7 @@ public:
     virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>);
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
     virtual void onSuccessWithContinuation();
-    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values) { ASSERT_NOT_REACHED(); } // Not implemented. Callback should not reach the renderer side.
+    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { ASSERT_NOT_REACHED(); } // Not implemented. Callback should not reach the renderer side.
     virtual void onBlocked();
 
     // ActiveDOMObject
index 2e9059e..7977853 100644 (file)
                24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (); }; };
                2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */; };
                2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               26247DAE150EF0C40027B53A /* JSIDBVersionChangeRequestCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26247DAD150EF0C40027B53A /* JSIDBVersionChangeRequestCustom.cpp */; };
                265541391489811C000DFC5D /* KeyEventCodesIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 265541371489811C000DFC5D /* KeyEventCodesIOS.h */; };
                2655413A1489811C000DFC5D /* KeyEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 265541381489811C000DFC5D /* KeyEventIOS.mm */; };
                265541521489B233000DFC5D /* CursorIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2655414B1489AA2B000DFC5D /* CursorIOS.cpp */; };
+               269239951505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */; };
+               269239961505E1AA009E57FC /* JSIDBVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */; };
+               269239971505E1AA009E57FC /* JSIDBVersionChangeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269239931505E1AA009E57FC /* JSIDBVersionChangeRequest.cpp */; };
+               269239981505E1AA009E57FC /* JSIDBVersionChangeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 269239941505E1AA009E57FC /* JSIDBVersionChangeRequest.h */; };
                26A5034E14F0983600AA730D /* KURLWTFURLImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A5034D14F0983600AA730D /* KURLWTFURLImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                26A5035A14F0A2BC00AA730D /* KURLWTFURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A5035914F0A2BC00AA730D /* KURLWTFURL.cpp */; };
                26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */; };
                24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
                2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
                2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserGestureIndicator.h; sourceTree = "<group>"; };
+               26247DAD150EF0C40027B53A /* JSIDBVersionChangeRequestCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBVersionChangeRequestCustom.cpp; sourceTree = "<group>"; };
                265541371489811C000DFC5D /* KeyEventCodesIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCodesIOS.h; path = ios/KeyEventCodesIOS.h; sourceTree = "<group>"; };
                265541381489811C000DFC5D /* KeyEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventIOS.mm; path = ios/KeyEventIOS.mm; sourceTree = "<group>"; };
                2655414B1489AA2B000DFC5D /* CursorIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CursorIOS.cpp; path = ios/CursorIOS.cpp; sourceTree = "<group>"; };
+               269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBVersionChangeEvent.cpp; sourceTree = "<group>"; };
+               269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBVersionChangeEvent.h; sourceTree = "<group>"; };
+               269239931505E1AA009E57FC /* JSIDBVersionChangeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBVersionChangeRequest.cpp; sourceTree = "<group>"; };
+               269239941505E1AA009E57FC /* JSIDBVersionChangeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBVersionChangeRequest.h; sourceTree = "<group>"; };
                26A5034D14F0983600AA730D /* KURLWTFURLImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KURLWTFURLImpl.h; sourceTree = "<group>"; };
                26A5035914F0A2BC00AA730D /* KURLWTFURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KURLWTFURL.cpp; sourceTree = "<group>"; };
                26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemIOS.h; path = ios/FileSystemIOS.h; sourceTree = "<group>"; };
                                C585A67911D4FB07004C3E4B /* JSIDBRequest.h */,
                                B656626F120B1227006EA85C /* JSIDBTransaction.cpp */,
                                B656626E120B1227006EA85C /* JSIDBTransaction.h */,
+                               269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */,
+                               269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */,
+                               269239931505E1AA009E57FC /* JSIDBVersionChangeRequest.cpp */,
+                               269239941505E1AA009E57FC /* JSIDBVersionChangeRequest.h */,
                                514C76350CE9225E007EF3CD /* JSSQLError.cpp */,
                                BC8243250D0CE8A200460C8F /* JSSQLError.h */,
                                B525A96411CA2340003A23A8 /* JSSQLException.cpp */,
                                E1AD139D1295D96100ACA989 /* JSHTMLStyleElementCustom.cpp */,
                                C585A65C11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp */,
                                C585A65D11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp */,
+                               26247DAD150EF0C40027B53A /* JSIDBVersionChangeRequestCustom.cpp */,
                                A7D0318D0E93540300E24ACD /* JSImageDataCustom.cpp */,
                                7A0E76D410BF050700A0276E /* JSInjectedScriptHostCustom.cpp */,
                                F316396D1329487600A649CB /* JSInjectedScriptManager.cpp */,
                                C585A68F11D4FB08004C3E4B /* JSIDBObjectStore.h in Headers */,
                                C585A69111D4FB08004C3E4B /* JSIDBRequest.h in Headers */,
                                B6566270120B1227006EA85C /* JSIDBTransaction.h in Headers */,
+                               269239961505E1AA009E57FC /* JSIDBVersionChangeEvent.h in Headers */,
+                               269239981505E1AA009E57FC /* JSIDBVersionChangeRequest.h in Headers */,
                                BC6C49F40D7DBA0500FFA558 /* JSImageConstructor.h in Headers */,
                                A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
                                7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
                                C585A68E11D4FB08004C3E4B /* JSIDBObjectStore.cpp in Sources */,
                                C585A69011D4FB08004C3E4B /* JSIDBRequest.cpp in Sources */,
                                B6566271120B1227006EA85C /* JSIDBTransaction.cpp in Sources */,
+                               269239951505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp in Sources */,
+                               269239971505E1AA009E57FC /* JSIDBVersionChangeRequest.cpp in Sources */,
+                               26247DAE150EF0C40027B53A /* JSIDBVersionChangeRequestCustom.cpp in Sources */,
                                BC6C49F30D7DBA0500FFA558 /* JSImageConstructor.cpp in Sources */,
                                A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
                                A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
index 67623f8..8d3dad5 100644 (file)
@@ -28,6 +28,7 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBBindingUtilities.h"
+#include "NotImplemented.h"
 
 #include "IDBKey.h"
 
@@ -36,15 +37,21 @@ namespace WebCore {
 PassRefPtr<IDBKey> createIDBKeyFromValue(JSC::ExecState* exec, JSC::JSValue value)
 {
     if (value.isNull())
-        return IDBKey::create();
+        return IDBKey::createInvalid();
     if (value.isInt32())
-        return IDBKey::create(value.toInt32(exec));
+        return IDBKey::createNumber(value.toNumber(exec));
     if (value.isString())
-        return IDBKey::create(ustringToString(value.toString(exec)->value(exec)));
+        return IDBKey::createString(ustringToString(value.toString(exec)->value(exec)));
     // FIXME: Implement dates.
     return 0;
 }
 
+OptionsObject createOptionsObjectFromValue(JSC::ExecState*, JSC::JSValue)
+{
+    // FIXME: Implement Database Options.
+    return OptionsObject();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
index 7e72152..fa93347 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "OptionsObject.h"
 #include "ScriptValue.h" 
 #include <wtf/Forward.h>
 
@@ -36,6 +37,7 @@ namespace WebCore {
 class IDBKey;
 
 PassRefPtr<IDBKey> createIDBKeyFromValue(JSC::ExecState*, JSC::JSValue);
+OptionsObject createOptionsObjectFromValue(JSC::ExecState*, JSC::JSValue);
 
 }
 
index 506f15f..defa656 100644 (file)
 
 #include "IDBAny.h"
 #include "IDBCursor.h"
+#include "IDBCursorWithValue.h"
 #include "IDBDatabase.h"
 #include "IDBFactory.h"
 #include "IDBIndex.h"
 #include "IDBKey.h"
 #include "IDBObjectStore.h"
+#include "JSDOMStringList.h"
 #include "JSIDBCursor.h"
 #include "JSIDBDatabase.h"
 #include "JSIDBFactory.h"
@@ -61,8 +63,12 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBAny* idbAny)
         return jsUndefined();
     case IDBAny::NullType:
         return jsNull();
+    case IDBAny::DOMStringListType:
+        return toJS(exec, globalObject, idbAny->domStringList());
     case IDBAny::IDBCursorType:
         return toJS(exec, globalObject, idbAny->idbCursor());
+    case IDBAny::IDBCursorWithValueType:
+        return toJS(exec, globalObject, idbAny->idbCursorWithValue());
     case IDBAny::IDBDatabaseType:
         return toJS(exec, globalObject, idbAny->idbDatabase());
     case IDBAny::IDBFactoryType:
index 62fa7cb..b2b78ec 100644 (file)
@@ -37,18 +37,34 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSValue toJS(ExecState* exec, JSDOMGlobalObject*, IDBKey* key)
+JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBKey* key)
 {
     if (!key)
         return jsNull();
 
     switch (key->type()) {
-    case IDBKey::NumberType:
-        return jsNumber(key->number());
+    case IDBKey::ArrayType:
+        {
+            const IDBKey::KeyArray& inArray = key->array();
+            size_t size = inArray.size();
+            JSArray* outArray = constructEmptyArray(exec, globalObject, size);
+            JSGlobalData& globalData = exec->globalData();
+            for (size_t i = 0; i < size; ++i) {
+                IDBKey* arrayKey = inArray.at(i).get();
+                outArray->initializeIndex(globalData, i, toJS(exec, globalObject, arrayKey));
+            }
+            return JSValue(outArray);
+        }
     case IDBKey::StringType:
         return jsString(exec, key->string());
-    // FIXME: Implement dates.
-    // FIXME: Implement arrays.
+    case IDBKey::DateType:
+        return jsDateOrNull(exec, key->date());
+    case IDBKey::NumberType:
+        return jsNumber(key->number());
+    case IDBKey::MinType:
+    case IDBKey::InvalidType:
+        ASSERT_NOT_REACHED();
+        return jsUndefined();
     }
 
     ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/bindings/js/JSIDBVersionChangeRequestCustom.cpp b/Source/WebCore/bindings/js/JSIDBVersionChangeRequestCustom.cpp
new file mode 100644 (file)
index 0000000..f559f41
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012, 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 GOOGLE INC. 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 INC. 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 "JSIDBVersionChangeRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include <wtf/Assertions.h>
+
+namespace WebCore {
+
+void JSIDBVersionChangeRequest::visitChildren(JSCell*, JSC::SlotVisitor&)
+{
+    // FIXME: Implement this.
+}
+
+}
+
+#endif
index 34910c0..4078ae1 100644 (file)
 #ifndef OptionsObject_h
 #define OptionsObject_h
 
+#include "SerializedScriptValue.h"
+#include <wtf/HashSet.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class DOMStringList;
+class DOMWindow;
+class IDBKeyRange;
+class ScriptValue;
+class Storage;
+class TrackBase;
+
 // FIXME: Implement.
+class OptionsObject {
+public:
+    OptionsObject() { }
+
+    bool isObject() const { return false; }
+    bool isUndefinedOrNull() const { return false; }
+
+    bool get(const String&, bool&) const { return false; }
+    bool get(const String&, int32_t&) const { return false; }
+    bool get(const String&, double&) const { return false; }
+    bool get(const String&, String&) const { return false; }
+    bool get(const String&, ScriptValue&) const { return false; }
+    bool get(const String&, unsigned short&) const { return false; }
+    bool get(const String&, unsigned&) const { return false; }
+    bool get(const String&, unsigned long long&) const { return false; }
+    bool get(const String&, RefPtr<DOMWindow>&) const { return false; }
+    bool get(const String&, RefPtr<Storage>&) const { return false; }
+    bool get(const String&, MessagePortArray&) const { return false; }
+#if ENABLE(VIDEO_TRACK)
+    bool get(const String&, RefPtr<TrackBase>&) const { return false; }
+#endif
+    bool get(const String&, HashSet<AtomicString>&) const { return false; }
+
+    bool getWithUndefinedOrNullCheck(const String&, String&) const { return false; }
+};
+
+}
 
 #endif // OptionsObject_h
index 7c586aa..e235945 100644 (file)
@@ -50,6 +50,7 @@
 #include "JSUint32Array.h"
 #include "JSUint8Array.h"
 #include "JSUint8ClampedArray.h"
+#include "NotImplemented.h"
 #include "ScriptValue.h"
 #include "SharedBuffer.h"
 #include <limits>
@@ -1732,6 +1733,37 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(const String& st
     return adoptRef(new SerializedScriptValue(buffer));
 }
 
+#if ENABLE(INDEXED_DATABASE)
+PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSC::ExecState*, JSC::JSValue)
+{
+    notImplemented();
+    return PassRefPtr<SerializedScriptValue>();
+}
+
+String SerializedScriptValue::toWireString() const
+{
+    notImplemented();
+    return String();
+}
+PassRefPtr<SerializedScriptValue> SerializedScriptValue::createFromWire(const String&)
+{
+    notImplemented();
+    return PassRefPtr<SerializedScriptValue>();
+}
+
+PassRefPtr<SerializedScriptValue> SerializedScriptValue::numberValue(double)
+{
+    notImplemented();
+    return PassRefPtr<SerializedScriptValue>();
+}
+
+JSValue SerializedScriptValue::deserialize(JSC::ExecState*, JSC::JSGlobalObject*)
+{
+    notImplemented();
+    return JSValue();
+}
+#endif
+
 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, 
                                                                 MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers,
                                                                 JSValueRef* exception)
index 3f8da5e..858e8c9 100644 (file)
@@ -58,7 +58,12 @@ enum SerializationErrorMode { NonThrowing, Throwing };
 class ScriptValue;
 class SharedBuffer;
 
-class SerializedScriptValue : public RefCounted<SerializedScriptValue> {
+class SerializedScriptValue :
+#if ENABLE(INDEXED_DATABASE)
+    public ThreadSafeRefCounted<SerializedScriptValue> {
+#else
+    public RefCounted<SerializedScriptValue> {
+#endif
 public:
     static PassRefPtr<SerializedScriptValue> create(JSC::ExecState*, JSC::JSValue, MessagePortArray*, ArrayBufferArray*,
                                                     SerializationErrorMode = Throwing);
@@ -88,6 +93,14 @@ public:
 
     const Vector<uint8_t>& data() { return m_data; }
 
+#if ENABLE(INDEXED_DATABASE)
+    static PassRefPtr<SerializedScriptValue> create(JSC::ExecState*, JSC::JSValue);
+    static PassRefPtr<SerializedScriptValue> createFromWire(const String& data);
+    String toWireString() const;
+    static PassRefPtr<SerializedScriptValue> numberValue(double value);
+    JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*);
+#endif
+
     ~SerializedScriptValue();
 
 private:
index 99ca0be..0a8ba0a 100644 (file)
@@ -2754,7 +2754,8 @@ sub GenerateImplementationFunctionCall()
 
         push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n");
     } else {
-        push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, $functionString, "castedThis") . ";\n");
+        my $thisObject = $function->isStatic ? 0 : "castedThis";
+        push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, $functionString, $thisObject) . ";\n");
         push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
 
         if ($codeGenerator->ExtendedAttributeContains($function->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
@@ -2787,7 +2788,8 @@ my %nativeType = (
     "DOMObject" => "ScriptValue",
     "NodeFilter" => "RefPtr<NodeFilter>",
     "SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
-    "IDBKey" => "RefPtr<IDBKey>",
+    "IDBKey" => "PassRefPtr<IDBKey>",
+    "OptionsObject" => "OptionsObject",
     "boolean" => "bool",
     "double" => "double",
     "float" => "float",
@@ -2923,6 +2925,12 @@ sub JSValueToNative
         return "createIDBKeyFromValue(exec, $value)";
     }
 
+    if ($type eq "OptionsObject") {
+        AddToImplIncludes("IDBBindingUtilities.h", $conditional);
+        AddToImplIncludes("OptionsObject.h", $conditional);
+        return "createOptionsObjectFromValue(exec, $value)";
+    }
+
     if ($type eq "DOMString[]") {
         AddToImplIncludes("JSDOMStringList.h", $conditional);
         return "toDOMStringList($value)";
@@ -2983,7 +2991,10 @@ sub NativeToJSValue
         return "jsString(exec, $value)";
     }
 
-    my $globalObject = "$thisValue->globalObject()";
+    my $globalObject;
+    if ($thisValue) {
+        $globalObject = "$thisValue->globalObject()";
+    }
 
     if ($type eq "CSSStyleDeclaration") {
         AddToImplIncludes("StylePropertySet.h", $conditional);
@@ -3060,8 +3071,11 @@ sub NativeToJSValue
             $value = "${tearOffType}::create($value)";
         }
     }
-
-    return "toJS(exec, $globalObject, WTF::getPtr($value))";
+    if ($globalObject) {
+        return "toJS(exec, $globalObject, WTF::getPtr($value))";
+    } else {
+        return "toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), WTF::getPtr($value))";
+    }
 }
 
 sub ceilingToPowerOf2
index 1cac012..22240a7 100644 (file)
@@ -108,7 +108,7 @@ public:
     virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) { }
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>) { }
     virtual void onSuccessWithContinuation() { }
-    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values) { }
+    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { }
     virtual void onBlocked() { }
 };