Rename current concrete IDB implementation to "Legacy".
https://bugs.webkit.org/show_bug.cgi?id=149118
Reviewed by Alex Christensen.
Source/WebCore:
No new tests (No change in behavior).
This patch makes IDL bindings abstract.
It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
Finally it moves those files and their support classes to a "legacy" subfolder.
* CMakeLists.txt:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
* Modules/indexeddb/IDBAny.cpp:
* Modules/indexeddb/IDBAny.h:
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBCursorWithValue.h:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.cpp:
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.cpp:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.cpp:
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.cpp:
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
* Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
* Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
* Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
* Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
* Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
* Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
* Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
* Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
* Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
* Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
* Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
* Modules/indexeddb/legacy/LegacyAny.h: Added.
* Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
* Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
* Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
* Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
* Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
* Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
* Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
* Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
* Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
* Modules/indexeddb/legacy/LegacyIndex.h: Added.
* Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
* Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
* Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
* Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
* Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
* Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
* WebCore.xcodeproj/project.pbxproj:
* WebCore.vcxproj/WebCore.vcxproj:
Source/WebKit2:
* CMakeLists.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@189746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 0f31451f..ca33fda 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -10,6 +10,7 @@
"${WEBCORE_DIR}/Modules/gamepad/deprecated"
"${WEBCORE_DIR}/Modules/geolocation"
"${WEBCORE_DIR}/Modules/indexeddb"
+ "${WEBCORE_DIR}/Modules/indexeddb/legacy"
"${WEBCORE_DIR}/Modules/indieui"
"${WEBCORE_DIR}/Modules/mediacontrols/"
"${WEBCORE_DIR}/Modules/mediasession"
@@ -844,12 +845,8 @@
Modules/indexeddb/DOMWindowIndexedDatabase.cpp
Modules/indexeddb/IDBAny.cpp
Modules/indexeddb/IDBCursor.cpp
- Modules/indexeddb/IDBCursorBackend.cpp
- Modules/indexeddb/IDBCursorBackendOperations.cpp
Modules/indexeddb/IDBCursorWithValue.cpp
Modules/indexeddb/IDBDatabase.cpp
- Modules/indexeddb/IDBDatabaseBackend.cpp
- Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
Modules/indexeddb/IDBDatabaseException.cpp
Modules/indexeddb/IDBDatabaseMetadata.cpp
Modules/indexeddb/IDBEventDispatcher.cpp
@@ -862,15 +859,31 @@
Modules/indexeddb/IDBKeyRangeData.cpp
Modules/indexeddb/IDBObjectStore.cpp
Modules/indexeddb/IDBOpenDBRequest.cpp
- Modules/indexeddb/IDBPendingTransactionMonitor.cpp
Modules/indexeddb/IDBRequest.cpp
Modules/indexeddb/IDBTransaction.cpp
- Modules/indexeddb/IDBTransactionBackend.cpp
- Modules/indexeddb/IDBTransactionBackendOperations.cpp
- Modules/indexeddb/IDBTransactionCoordinator.cpp
Modules/indexeddb/IDBVersionChangeEvent.cpp
Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
+ Modules/indexeddb/legacy/IDBCursorBackend.cpp
+ Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
+ Modules/indexeddb/legacy/IDBDatabaseBackend.cpp
+ Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
+ Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
+ Modules/indexeddb/legacy/IDBTransactionBackend.cpp
+ Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp
+ Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp
+ Modules/indexeddb/legacy/LegacyAny.cpp
+ Modules/indexeddb/legacy/LegacyCursor.cpp
+ Modules/indexeddb/legacy/LegacyCursorWithValue.cpp
+ Modules/indexeddb/legacy/LegacyDatabase.cpp
+ Modules/indexeddb/legacy/LegacyFactory.cpp
+ Modules/indexeddb/legacy/LegacyIndex.cpp
+ Modules/indexeddb/legacy/LegacyObjectStore.cpp
+ Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp
+ Modules/indexeddb/legacy/LegacyRequest.cpp
+ Modules/indexeddb/legacy/LegacyTransaction.cpp
+ Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
+
Modules/mediacontrols/MediaControlsHost.cpp
Modules/mediasession/HTMLMediaElementMediaSession.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index f3cfaab..f8243d0 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,95 @@
+2015-09-14 Brady Eidson <beidson@apple.com>
+
+ Rename current concrete IDB implementation to "Legacy".
+ https://bugs.webkit.org/show_bug.cgi?id=149118
+
+ Reviewed by Alex Christensen.
+
+ No new tests (No change in behavior).
+
+ This patch makes IDL bindings abstract.
+ It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
+ Finally it moves those files and their support classes to a "legacy" subfolder.
+
+ * CMakeLists.txt:
+ * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+ * Modules/indexeddb/IDBAny.cpp:
+ * Modules/indexeddb/IDBAny.h:
+ * Modules/indexeddb/IDBCursor.cpp:
+ * Modules/indexeddb/IDBCursor.h:
+ * Modules/indexeddb/IDBCursor.idl:
+ * Modules/indexeddb/IDBCursorWithValue.cpp:
+ * Modules/indexeddb/IDBCursorWithValue.h:
+ * Modules/indexeddb/IDBCursorWithValue.idl:
+ * Modules/indexeddb/IDBDatabase.cpp:
+ * Modules/indexeddb/IDBDatabase.h:
+ * Modules/indexeddb/IDBDatabase.idl:
+ * Modules/indexeddb/IDBFactory.cpp:
+ * Modules/indexeddb/IDBFactory.h:
+ * Modules/indexeddb/IDBFactory.idl:
+ * Modules/indexeddb/IDBIndex.cpp:
+ * Modules/indexeddb/IDBIndex.h:
+ * Modules/indexeddb/IDBIndex.idl:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ * Modules/indexeddb/IDBObjectStore.h:
+ * Modules/indexeddb/IDBObjectStore.idl:
+ * Modules/indexeddb/IDBOpenDBRequest.cpp:
+ * Modules/indexeddb/IDBOpenDBRequest.h:
+ * Modules/indexeddb/IDBOpenDBRequest.idl:
+ * Modules/indexeddb/IDBRequest.cpp:
+ * Modules/indexeddb/IDBRequest.h:
+ * Modules/indexeddb/IDBRequest.idl:
+ * Modules/indexeddb/IDBTransaction.cpp:
+ * Modules/indexeddb/IDBTransaction.h:
+ * Modules/indexeddb/IDBTransaction.idl:
+ * Modules/indexeddb/IDBVersionChangeEvent.cpp:
+ * Modules/indexeddb/IDBVersionChangeEvent.h:
+ * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
+ * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
+ * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
+ * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
+ * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
+ * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
+ * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
+ * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
+ * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
+ * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
+ * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
+ * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
+ * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
+ * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
+ * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
+ * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
+ * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
+ * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
+ * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
+ * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
+ * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
+ * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
+ * Modules/indexeddb/legacy/LegacyAny.h: Added.
+ * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
+ * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
+ * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
+ * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
+ * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
+ * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
+ * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
+ * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
+ * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
+ * Modules/indexeddb/legacy/LegacyIndex.h: Added.
+ * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
+ * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
+ * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
+ * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
+ * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
+ * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
+ * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
+ * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
+ * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
+ * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
+ * WebCore.xcodeproj/project.pbxproj:
+ * WebCore.vcxproj/WebCore.vcxproj:
+
2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
[EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
diff --git a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
index 2a1ae3c..d05d22e 100644
--- a/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
@@ -31,7 +31,7 @@
#include "DOMWindow.h"
#include "DatabaseProvider.h"
#include "Document.h"
-#include "IDBFactory.h"
+#include "LegacyFactory.h"
#include "Page.h"
#include "SecurityOrigin.h"
@@ -112,7 +112,7 @@
return nullptr;
if (!m_idbFactory)
- m_idbFactory = IDBFactory::create(page->databaseProvider().idbFactoryBackend());
+ m_idbFactory = LegacyFactory::create(page->databaseProvider().idbFactoryBackend());
return m_idbFactory.get();
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.cpp b/Source/WebCore/Modules/indexeddb/IDBAny.cpp
index 827a4cd..4b286b6 100644
--- a/Source/WebCore/Modules/indexeddb/IDBAny.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBAny.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,191 +28,12 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBFactory.h"
-#include "IDBIndex.h"
-#include "IDBKeyPath.h"
-#include "IDBObjectStore.h"
-#include "DOMStringList.h"
-
namespace WebCore {
-PassRefPtr<IDBAny> IDBAny::createInvalid()
-{
- return adoptRef(new IDBAny(UndefinedType));
-}
-
-PassRefPtr<IDBAny> IDBAny::createNull()
-{
- return adoptRef(new IDBAny(NullType));
-}
-
-PassRefPtr<IDBAny> IDBAny::createString(const String& value)
-{
- return adoptRef(new IDBAny(value));
-}
-
-IDBAny::IDBAny(Type type)
- : m_type(type)
- , m_integer(0)
-{
- ASSERT(type == UndefinedType || type == NullType);
-}
-
-IDBAny::~IDBAny()
-{
-}
-
-PassRefPtr<DOMStringList> IDBAny::domStringList()
-{
- ASSERT(m_type == DOMStringListType);
- return m_domStringList;
-}
-
-PassRefPtr<IDBCursor> IDBAny::idbCursor()
-{
- ASSERT(m_type == IDBCursorType);
- return m_idbCursor;
-}
-
-PassRefPtr<IDBCursorWithValue> IDBAny::idbCursorWithValue()
-{
- ASSERT(m_type == IDBCursorWithValueType);
- return m_idbCursorWithValue;
-}
-
-PassRefPtr<IDBDatabase> IDBAny::idbDatabase()
-{
- ASSERT(m_type == IDBDatabaseType);
- return m_idbDatabase;
-}
-
-PassRefPtr<IDBFactory> IDBAny::idbFactory()
-{
- ASSERT(m_type == IDBFactoryType);
- return m_idbFactory;
-}
-
-PassRefPtr<IDBIndex> IDBAny::idbIndex()
-{
- ASSERT(m_type == IDBIndexType);
- return m_idbIndex;
-}
-
-PassRefPtr<IDBObjectStore> IDBAny::idbObjectStore()
-{
- ASSERT(m_type == IDBObjectStoreType);
- return m_idbObjectStore;
-}
-
-PassRefPtr<IDBTransaction> IDBAny::idbTransaction()
-{
- ASSERT(m_type == IDBTransactionType);
- return m_idbTransaction;
-}
-
-const Deprecated::ScriptValue& IDBAny::scriptValue()
-{
- ASSERT(m_type == ScriptValueType);
- return m_scriptValue;
-}
-
-const String& IDBAny::string()
-{
- ASSERT(m_type == StringType);
- return m_string;
-}
-
-int64_t IDBAny::integer()
-{
- ASSERT(m_type == IntegerType);
- return m_integer;
-}
-
-IDBAny::IDBAny(PassRefPtr<DOMStringList> value)
- : m_type(DOMStringListType)
- , m_domStringList(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBCursorWithValue> value)
- : m_type(IDBCursorWithValueType)
- , m_idbCursorWithValue(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBCursor> value)
- : m_type(IDBCursorType)
- , m_idbCursor(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBDatabase> value)
- : m_type(IDBDatabaseType)
- , m_idbDatabase(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBFactory> value)
- : m_type(IDBFactoryType)
- , m_idbFactory(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBIndex> value)
- : m_type(IDBIndexType)
- , m_idbIndex(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBTransaction> value)
- : m_type(IDBTransactionType)
- , m_idbTransaction(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(PassRefPtr<IDBObjectStore> value)
- : m_type(IDBObjectStoreType)
- , m_idbObjectStore(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(const Deprecated::ScriptValue& value)
- : m_type(ScriptValueType)
- , m_scriptValue(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(const IDBKeyPath& value)
- : m_type(KeyPathType)
- , m_idbKeyPath(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(const String& value)
- : m_type(StringType)
- , m_string(value)
- , m_integer(0)
-{
-}
-
-IDBAny::IDBAny(int64_t value)
- : m_type(IntegerType)
- , m_integer(value)
+IDBAny::IDBAny()
{
}
} // namespace WebCore
-#endif
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.h b/Source/WebCore/Modules/indexeddb/IDBAny.h
index d728456..a57573c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBAny.h
+++ b/Source/WebCore/Modules/indexeddb/IDBAny.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBAny_h
@@ -50,29 +50,7 @@
class IDBAny : public ScriptWrappable, public RefCounted<IDBAny> {
public:
- static PassRefPtr<IDBAny> createInvalid();
- static PassRefPtr<IDBAny> createNull();
- static PassRefPtr<IDBAny> createString(const String&);
- template<typename T>
- static PassRefPtr<IDBAny> create(T* idbObject)
- {
- return adoptRef(new IDBAny(idbObject));
- }
- template<typename T>
- static PassRefPtr<IDBAny> create(const T& idbObject)
- {
- return adoptRef(new IDBAny(idbObject));
- }
- template<typename T>
- static PassRefPtr<IDBAny> create(PassRefPtr<T> idbObject)
- {
- return adoptRef(new IDBAny(idbObject));
- }
- static PassRefPtr<IDBAny> create(int64_t value)
- {
- return adoptRef(new IDBAny(value));
- }
- ~IDBAny();
+ virtual ~IDBAny() { }
enum Type {
UndefinedType = 0,
@@ -91,51 +69,22 @@
KeyPathType,
};
- Type type() const { return m_type; }
- // Use type() to figure out which one of these you're allowed to call.
- PassRefPtr<DOMStringList> domStringList();
- PassRefPtr<IDBCursor> idbCursor();
- PassRefPtr<IDBCursorWithValue> idbCursorWithValue();
- PassRefPtr<IDBDatabase> idbDatabase();
- PassRefPtr<IDBFactory> idbFactory();
- PassRefPtr<IDBIndex> idbIndex();
- PassRefPtr<IDBObjectStore> idbObjectStore();
- PassRefPtr<IDBTransaction> idbTransaction();
- const Deprecated::ScriptValue& scriptValue();
- int64_t integer();
- const String& string();
- const IDBKeyPath& keyPath() { return m_idbKeyPath; };
+ virtual Type type() const = 0;
+ virtual PassRefPtr<DOMStringList> domStringList() = 0;
+ virtual PassRefPtr<IDBCursor> idbCursor() = 0;
+ virtual PassRefPtr<IDBCursorWithValue> idbCursorWithValue() = 0;
+ virtual PassRefPtr<IDBDatabase> idbDatabase() = 0;
+ virtual PassRefPtr<IDBFactory> idbFactory() = 0;
+ virtual PassRefPtr<IDBIndex> idbIndex() = 0;
+ virtual PassRefPtr<IDBObjectStore> idbObjectStore() = 0;
+ virtual PassRefPtr<IDBTransaction> idbTransaction() = 0;
+ virtual const Deprecated::ScriptValue& scriptValue() = 0;
+ virtual int64_t integer() = 0;
+ virtual const String& string() = 0;
+ virtual const IDBKeyPath& keyPath() = 0;
-private:
- explicit IDBAny(Type);
- explicit IDBAny(PassRefPtr<DOMStringList>);
- explicit IDBAny(PassRefPtr<IDBCursor>);
- explicit IDBAny(PassRefPtr<IDBCursorWithValue>);
- explicit IDBAny(PassRefPtr<IDBDatabase>);
- explicit IDBAny(PassRefPtr<IDBFactory>);
- explicit IDBAny(PassRefPtr<IDBIndex>);
- explicit IDBAny(PassRefPtr<IDBObjectStore>);
- explicit IDBAny(PassRefPtr<IDBTransaction>);
- explicit IDBAny(const IDBKeyPath&);
- explicit IDBAny(const String&);
- explicit IDBAny(const Deprecated::ScriptValue&);
- explicit IDBAny(int64_t);
-
- const Type m_type;
-
- // Only one of the following should ever be in use at any given time.
- const RefPtr<DOMStringList> m_domStringList;
- const RefPtr<IDBCursor> m_idbCursor;
- const RefPtr<IDBCursorWithValue> m_idbCursorWithValue;
- const RefPtr<IDBDatabase> m_idbDatabase;
- const RefPtr<IDBFactory> m_idbFactory;
- const RefPtr<IDBIndex> m_idbIndex;
- const RefPtr<IDBObjectStore> m_idbObjectStore;
- const RefPtr<IDBTransaction> m_idbTransaction;
- const IDBKeyPath m_idbKeyPath;
- const Deprecated::ScriptValue m_scriptValue;
- const String m_string;
- const int64_t m_integer;
+protected:
+ IDBAny();
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index c4011dc..86380e1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,24 +28,12 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBAny.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCallbacks.h"
-#include "IDBCursorBackend.h"
-#include "IDBKey.h"
-#include "IDBObjectStore.h"
-#include "IDBRequest.h"
-#include "IDBTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include <inspector/ScriptCallStack.h>
-#include <limits>
+#include "ExceptionCode.h"
namespace WebCore {
-Ref<IDBCursor> IDBCursor::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
+IDBCursor::IDBCursor()
{
- return adoptRef(*new IDBCursor(backend, direction, request, source, transaction));
}
const AtomicString& IDBCursor::directionNext()
@@ -72,231 +60,6 @@
return prevunique;
}
-
-IDBCursor::IDBCursor(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
- : m_backend(backend)
- , m_request(request)
- , m_direction(direction)
- , m_source(source)
- , m_transaction(transaction)
- , m_transactionNotifier(transaction, this)
- , m_gotValue(false)
-{
- ASSERT(m_backend);
- ASSERT(m_request);
- ASSERT(m_source->type() == IDBAny::IDBObjectStoreType || m_source->type() == IDBAny::IDBIndexType);
- ASSERT(m_transaction);
-}
-
-IDBCursor::~IDBCursor()
-{
-}
-
-const String& IDBCursor::direction() const
-{
- LOG(StorageAPI, "IDBCursor::direction");
- return directionToString(m_direction);
-}
-
-const Deprecated::ScriptValue& IDBCursor::key() const
-{
- LOG(StorageAPI, "IDBCursor::key");
- return m_currentKeyValue;
-}
-
-const Deprecated::ScriptValue& IDBCursor::primaryKey() const
-{
- LOG(StorageAPI, "IDBCursor::primaryKey");
- return m_currentPrimaryKeyValue;
-}
-
-const Deprecated::ScriptValue& IDBCursor::value() const
-{
- LOG(StorageAPI, "IDBCursor::value");
- return m_currentValue;
-}
-
-IDBAny* IDBCursor::source() const
-{
- return m_source.get();
-}
-
-PassRefPtr<IDBRequest> IDBCursor::update(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBCursor::update");
-
- if (!m_gotValue || isKeyCursor()) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::ReadOnlyError;
- return 0;
- }
-
- RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
- const IDBKeyPath& keyPath = objectStore->metadata().keyPath;
- const bool usesInLineKeys = !keyPath.isNull();
- if (usesInLineKeys) {
- RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, keyPath);
- if (!keyPathKey || !keyPathKey->isEqual(m_currentPrimaryKey.get())) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
- }
-
- return objectStore->put(IDBDatabaseBackend::CursorUpdate, IDBAny::create(this), state, value, m_currentPrimaryKey, ec);
-}
-
-void IDBCursor::advance(unsigned long count, ExceptionCode& ec)
-{
- ec = 0;
- LOG(StorageAPI, "IDBCursor::advance");
- if (!m_gotValue) {
- ec = IDBDatabaseException::InvalidStateError;
- return;
- }
-
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return;
- }
-
- if (!count) {
- ec = TypeError;
- return;
- }
-
- m_request->setPendingCursor(this);
- m_gotValue = false;
- m_backend->advance(count, m_request, ec);
- ASSERT(!ec);
-}
-
-void IDBCursor::continueFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
-{
- DOMRequestState requestState(context);
- RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
- continueFunction(key.release(), ec);
-}
-
-void IDBCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec)
-{
- ec = 0;
- LOG(StorageAPI, "IDBCursor::continue");
- if (key && !key->isValid()) {
- ec = IDBDatabaseException::DataError;
- return;
- }
-
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return;
- }
-
- if (!m_gotValue) {
- ec = IDBDatabaseException::InvalidStateError;
- return;
- }
-
- if (key) {
- ASSERT(m_currentKey);
- if (m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::NextNoDuplicate) {
- if (!m_currentKey->isLessThan(key.get())) {
- ec = IDBDatabaseException::DataError;
- return;
- }
- } else {
- if (!key->isLessThan(m_currentKey.get())) {
- ec = IDBDatabaseException::DataError;
- return;
- }
- }
- }
-
- // FIXME: We're not using the context from when continue was called, which means the callback
- // will be on the original context openCursor was called on. Is this right?
- m_request->setPendingCursor(this);
- m_gotValue = false;
- m_backend->continueFunction(key, m_request, ec);
- ASSERT(!ec);
-}
-
-PassRefPtr<IDBRequest> IDBCursor::deleteFunction(ScriptExecutionContext* context, ExceptionCode& ec)
-{
- ec = 0;
- LOG(StorageAPI, "IDBCursor::delete");
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::ReadOnlyError;
- return 0;
- }
-
- if (!m_gotValue || isKeyCursor()) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- m_backend->deleteFunction(request, ec);
- ASSERT(!ec);
- return request.release();
-}
-
-void IDBCursor::postSuccessHandlerCallback()
-{
- m_backend->postSuccessHandlerCallback();
-}
-
-void IDBCursor::close()
-{
- m_transactionNotifier.cursorFinished();
- if (m_request) {
- m_request->finishCursor();
- m_request = nullptr;
- }
-}
-
-void IDBCursor::setValueReady(DOMRequestState* state, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue& value)
-{
- m_currentKey = key;
- m_currentKeyValue = idbKeyToScriptValue(state, m_currentKey);
-
- m_currentPrimaryKey = primaryKey;
- m_currentPrimaryKeyValue = idbKeyToScriptValue(state, m_currentPrimaryKey);
-
- if (!isKeyCursor()) {
- RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
- const IDBObjectStoreMetadata metadata = objectStore->metadata();
- if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
-#ifndef NDEBUG
- RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, metadata.keyPath);
- ASSERT(!expectedKey || expectedKey->isEqual(m_currentPrimaryKey.get()));
-#endif
- bool injected = injectIDBKeyIntoScriptValue(m_request->requestState(), m_currentPrimaryKey, value, metadata.keyPath);
- // FIXME: There is no way to report errors here. Move this into onSuccessWithContinuation so that we can abort the transaction there. See: https://bugs.webkit.org/show_bug.cgi?id=92278
- ASSERT_UNUSED(injected, injected);
- }
- }
- m_currentValue = value;
-
- m_gotValue = true;
-}
-
-PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore()
-{
- if (m_source->type() == IDBAny::IDBObjectStoreType)
- return m_source->idbObjectStore();
- RefPtr<IDBIndex> index = m_source->idbIndex();
- return index->objectStore();
-}
-
IndexedDB::CursorDirection IDBCursor::stringToDirection(const String& directionString, ExceptionCode& ec)
{
if (directionString == IDBCursor::directionNext())
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index 7dddcab..24144db 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBCursor_h
@@ -42,7 +42,6 @@
class DOMRequestState;
class IDBAny;
class IDBCallbacks;
-class IDBCursorBackend;
class IDBRequest;
class ScriptExecutionContext;
@@ -58,50 +57,26 @@
static IndexedDB::CursorDirection stringToDirection(const String& modeString, ExceptionCode&);
static const AtomicString& directionToString(IndexedDB::CursorDirection mode);
- static Ref<IDBCursor> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
- virtual ~IDBCursor();
+ virtual ~IDBCursor() { }
// Implement the IDL
- const String& direction() const;
- const Deprecated::ScriptValue& key() const;
- const Deprecated::ScriptValue& primaryKey() const;
- const Deprecated::ScriptValue& value() const;
- IDBAny* source() const;
+ virtual const String& direction() const = 0;
+ virtual const Deprecated::ScriptValue& key() const = 0;
+ virtual const Deprecated::ScriptValue& primaryKey() const = 0;
+ virtual const Deprecated::ScriptValue& value() const = 0;
+ virtual IDBAny* source() const = 0;
- PassRefPtr<IDBRequest> update(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
- void advance(unsigned long, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> update(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&) = 0;
+ virtual void advance(unsigned long, ExceptionCode&) = 0;
// FIXME: Try to modify the code generator so this overload is unneeded.
- void continueFunction(ScriptExecutionContext*, ExceptionCode& ec) { continueFunction(static_cast<IDBKey*>(nullptr), ec); }
- void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, ExceptionCode&);
-
- void continueFunction(PassRefPtr<IDBKey>, ExceptionCode&);
- void postSuccessHandlerCallback();
- void close();
- void setValueReady(DOMRequestState*, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue&);
- PassRefPtr<IDBKey> idbPrimaryKey() { return m_currentPrimaryKey; }
+ virtual void continueFunction(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, ExceptionCode&) = 0;
protected:
- IDBCursor(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
+ IDBCursor();
+
virtual bool isKeyCursor() const { return true; }
-
-private:
- PassRefPtr<IDBObjectStore> effectiveObjectStore();
-
- RefPtr<IDBCursorBackend> m_backend;
- RefPtr<IDBRequest> m_request;
- const IndexedDB::CursorDirection m_direction;
- RefPtr<IDBAny> m_source;
- RefPtr<IDBTransaction> m_transaction;
- IDBTransaction::OpenCursorNotifier m_transactionNotifier;
- bool m_gotValue;
- // These values are held because m_backend may advance while they
- // are still valid for the current success handlers.
- Deprecated::ScriptValue m_currentKeyValue;
- Deprecated::ScriptValue m_currentPrimaryKeyValue;
- RefPtr<IDBKey> m_currentKey;
- RefPtr<IDBKey> m_currentPrimaryKey;
- Deprecated::ScriptValue m_currentValue;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.idl b/Source/WebCore/Modules/indexeddb/IDBCursor.idl
index a507121..64b291d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.idl
@@ -26,6 +26,7 @@
[
Conditional=INDEXED_DATABASE,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBCursor {
readonly attribute IDBAny source;
readonly attribute DOMString direction;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp
index 90ec57a..5ce4738 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,28 +28,9 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBCursorBackend.h"
-#include "IDBKey.h"
-
namespace WebCore {
-PassRefPtr<IDBCursorWithValue> IDBCursorWithValue::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
-{
- return adoptRef(new IDBCursorWithValue(backend, direction, request, source, transaction));
-}
-
-PassRefPtr<IDBCursorWithValue> IDBCursorWithValue::fromCursor(PassRefPtr<IDBCursor> prpCursor)
-{
- RefPtr<IDBCursorWithValue> cursorWithValue(static_cast<IDBCursorWithValue*>(prpCursor.get()));
- return cursorWithValue.release();
-}
-
-IDBCursorWithValue::IDBCursorWithValue(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
- : IDBCursor(backend, direction, request, source, transaction)
-{
-}
-
-IDBCursorWithValue::~IDBCursorWithValue()
+IDBCursorWithValue::IDBCursorWithValue()
{
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
index 96f96b0..c5319a0 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBCursorWithValue_h
@@ -34,22 +34,16 @@
class IDBCursorWithValue : public IDBCursor {
public:
- static PassRefPtr<IDBCursorWithValue> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
- static PassRefPtr<IDBCursorWithValue> fromCursor(PassRefPtr<IDBCursor>);
- virtual ~IDBCursorWithValue();
-
- // The value attribute defined in the IDL is simply implemented in IDBCursor (but not exposed via
- // its IDL). This is to make the implementation more simple while matching what the spec says.
+ virtual ~IDBCursorWithValue() { }
protected:
- virtual bool isKeyCursor() const override { return false; }
+ IDBCursorWithValue();
-private:
- IDBCursorWithValue(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
+ virtual bool isKeyCursor() const override { return false; }
};
} // namespace WebCore
#endif
-#endif // IDBCursorWithValue_h
+#endif // LegacyCursorWithValue_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl
index 246dc06..3471a24 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl
@@ -26,6 +26,7 @@
[
Conditional=INDEXED_DATABASE,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBCursorWithValue : IDBCursor {
readonly attribute any value;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index 9eef9af..2d6479f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,371 +28,11 @@
#if ENABLE(INDEXED_DATABASE)
-#include "DOMStringList.h"
-#include "EventQueue.h"
-#include "ExceptionCode.h"
-#include "IDBAny.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseError.h"
-#include "IDBDatabaseException.h"
-#include "IDBEventDispatcher.h"
-#include "IDBIndex.h"
-#include "IDBKeyPath.h"
-#include "IDBObjectStore.h"
-#include "IDBTransaction.h"
-#include "IDBVersionChangeEvent.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include <atomic>
-#include <inspector/ScriptCallStack.h>
-#include <limits>
-#include <wtf/Atomics.h>
-
namespace WebCore {
-Ref<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> database, PassRefPtr<IDBDatabaseCallbacks> callbacks)
-{
- Ref<IDBDatabase> idbDatabase(adoptRef(*new IDBDatabase(context, database, callbacks)));
- idbDatabase->suspendIfNeeded();
- return idbDatabase;
-}
-
-IDBDatabase::IDBDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks)
+IDBDatabase::IDBDatabase(ScriptExecutionContext* context)
: ActiveDOMObject(context)
- , m_backend(backend)
- , m_closePending(false)
- , m_isClosed(false)
- , m_contextStopped(false)
- , m_databaseCallbacks(callbacks)
{
- // We pass a reference of this object before it can be adopted.
- relaxAdoptionRequirement();
-}
-
-IDBDatabase::~IDBDatabase()
-{
- // This does what IDBDatabase::close does, but without any ref/deref of the
- // database since it is already in the process of being deleted. The logic here
- // is also simpler since we know there are no transactions (since they ref the
- // database when they are alive).
-
- ASSERT(m_transactions.isEmpty());
-
- if (!m_closePending) {
- m_closePending = true;
- m_backend->close(m_databaseCallbacks);
- }
-
- if (auto* context = scriptExecutionContext()) {
- // Remove any pending versionchange events scheduled to fire on this
- // connection. They would have been scheduled by the backend when another
- // connection called setVersion, but the frontend connection is being
- // closed before they could fire.
- for (auto& event : m_enqueuedEvents)
- context->eventQueue().cancelEvent(*event);
- }
-}
-
-int64_t IDBDatabase::nextTransactionId()
-{
- // Only keep a 32-bit counter to allow ports to use the other 32
- // bits of the id.
- static std::atomic<uint32_t> currentTransactionId;
-
- return ++currentTransactionId;
-}
-
-void IDBDatabase::transactionCreated(IDBTransaction* transaction)
-{
- ASSERT(transaction);
- ASSERT(!m_transactions.contains(transaction->id()));
- m_transactions.add(transaction->id(), transaction);
-
- if (transaction->isVersionChange()) {
- ASSERT(!m_versionChangeTransaction);
- m_versionChangeTransaction = transaction;
- }
-}
-
-void IDBDatabase::transactionFinished(IDBTransaction* transaction)
-{
- ASSERT(transaction);
- ASSERT(m_transactions.contains(transaction->id()));
- ASSERT(m_transactions.get(transaction->id()) == transaction);
- m_transactions.remove(transaction->id());
-
- if (transaction->isVersionChange()) {
- ASSERT(m_versionChangeTransaction == transaction);
- m_versionChangeTransaction = nullptr;
- }
-
- if (m_closePending && m_transactions.isEmpty())
- closeConnection();
-}
-
-void IDBDatabase::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
-{
- ASSERT(m_transactions.contains(transactionId));
- m_transactions.get(transactionId)->onAbort(error);
-}
-
-void IDBDatabase::onComplete(int64_t transactionId)
-{
- ASSERT(m_transactions.contains(transactionId));
- m_transactions.get(transactionId)->onComplete();
-}
-
-PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const
-{
- RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
- for (auto& objectStore : m_metadata.objectStores.values())
- objectStoreNames->append(objectStore.name);
- objectStoreNames->sort();
- return objectStoreNames.release();
-}
-
-uint64_t IDBDatabase::version() const
-{
- // NoIntVersion is a special value for internal use only and shouldn't be exposed to script.
- // DefaultIntVersion should be exposed instead.
- return m_metadata.version != IDBDatabaseMetadata::NoIntVersion ? m_metadata.version : static_cast<uint64_t>(IDBDatabaseMetadata::DefaultIntVersion);
-}
-
-PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, const Dictionary& options, ExceptionCode& ec)
-{
- IDBKeyPath keyPath;
- bool autoIncrement = false;
- if (!options.isUndefinedOrNull()) {
- String keyPathString;
- Vector<String> keyPathArray;
- if (options.get("keyPath", keyPathArray))
- keyPath = IDBKeyPath(keyPathArray);
- else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString))
- keyPath = IDBKeyPath(keyPathString);
-
- options.get("autoIncrement", autoIncrement);
- }
-
- return createObjectStore(name, keyPath, autoIncrement, ec);
-}
-
-PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBDatabase::createObjectStore");
- if (!m_versionChangeTransaction) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_versionChangeTransaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
-
- if (containsObjectStore(name)) {
- ec = IDBDatabaseException::ConstraintError;
- return 0;
- }
-
- if (!keyPath.isNull() && !keyPath.isValid()) {
- ec = IDBDatabaseException::SyntaxError;
- return 0;
- }
-
- if (autoIncrement && ((keyPath.type() == IDBKeyPath::StringType && keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::ArrayType)) {
- ec = IDBDatabaseException::InvalidAccessError;
- return 0;
- }
-
- int64_t objectStoreId = m_metadata.maxObjectStoreId + 1;
- m_backend->createObjectStore(m_versionChangeTransaction->id(), objectStoreId, name, keyPath, autoIncrement);
-
- IDBObjectStoreMetadata metadata(name, objectStoreId, keyPath, autoIncrement, IDBDatabaseBackend::MinimumIndexId);
- RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(metadata, m_versionChangeTransaction.get());
- m_metadata.objectStores.set(metadata.id, metadata);
- ++m_metadata.maxObjectStoreId;
-
- m_versionChangeTransaction->objectStoreCreated(name, objectStore);
- return objectStore.release();
-}
-
-void IDBDatabase::deleteObjectStore(const String& name, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBDatabase::deleteObjectStore");
- if (!m_versionChangeTransaction) {
- ec = IDBDatabaseException::InvalidStateError;
- return;
- }
- if (!m_versionChangeTransaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return;
- }
-
- int64_t objectStoreId = findObjectStoreId(name);
- if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
- ec = IDBDatabaseException::NotFoundError;
- return;
- }
-
- m_backend->deleteObjectStore(m_versionChangeTransaction->id(), objectStoreId);
- m_versionChangeTransaction->objectStoreDeleted(name);
- m_metadata.objectStores.remove(objectStoreId);
-}
-
-PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const Vector<String>& scope, const String& modeString, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBDatabase::transaction");
- if (!scope.size()) {
- ec = IDBDatabaseException::InvalidAccessError;
- return 0;
- }
-
- IndexedDB::TransactionMode mode = IDBTransaction::stringToMode(modeString, ec);
- if (ec)
- return 0;
-
- if (m_versionChangeTransaction || m_closePending) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
-
- Vector<int64_t> objectStoreIds;
- for (auto& name : scope) {
- int64_t objectStoreId = findObjectStoreId(name);
- if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
- ec = IDBDatabaseException::NotFoundError;
- return 0;
- }
- objectStoreIds.append(objectStoreId);
- }
-
- int64_t transactionId = nextTransactionId();
- m_backend->createTransaction(transactionId, m_databaseCallbacks, objectStoreIds, mode);
-
- RefPtr<IDBTransaction> transaction = IDBTransaction::create(context, transactionId, scope, mode, this);
- return transaction.release();
-}
-
-PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, const String& mode, ExceptionCode& ec)
-{
- RefPtr<DOMStringList> storeNames = DOMStringList::create();
- storeNames->append(storeName);
- return transaction(context, storeNames, mode, ec);
-}
-
-void IDBDatabase::forceClose()
-{
- for (auto& transaction : m_transactions.values())
- transaction->abort(IGNORE_EXCEPTION);
- this->close();
-}
-
-void IDBDatabase::close()
-{
- LOG(StorageAPI, "IDBDatabase::close");
- if (m_closePending)
- return;
-
- m_closePending = true;
-
- if (m_transactions.isEmpty())
- closeConnection();
-}
-
-void IDBDatabase::closeConnection()
-{
- ASSERT(m_closePending);
- ASSERT(m_transactions.isEmpty());
-
- // Closing may result in deallocating the last transaction, which could result in deleting
- // this IDBDatabase. We need the deallocation to happen after we are through.
- Ref<IDBDatabase> protect(*this);
-
- m_backend->close(m_databaseCallbacks);
-
- if (m_contextStopped || !scriptExecutionContext())
- return;
-
- EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
- // Remove any pending versionchange events scheduled to fire on this
- // connection. They would have been scheduled by the backend when another
- // connection called setVersion, but the frontend connection is being
- // closed before they could fire.
- for (auto& event : m_enqueuedEvents) {
- bool removed = eventQueue.cancelEvent(*event);
- ASSERT_UNUSED(removed, removed);
- }
-
- m_isClosed = true;
-}
-
-void IDBDatabase::onVersionChange(uint64_t oldVersion, uint64_t newVersion)
-{
- LOG(StorageAPI, "IDBDatabase::onVersionChange");
- if (m_contextStopped || !scriptExecutionContext())
- return;
-
- if (m_closePending)
- return;
-
- ASSERT(newVersion != IDBDatabaseMetadata::NoIntVersion);
- enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().versionchangeEvent));
-}
-
-void IDBDatabase::enqueueEvent(PassRefPtr<Event> event)
-{
- ASSERT(!m_contextStopped);
- ASSERT(!m_isClosed);
- ASSERT(scriptExecutionContext());
- event->setTarget(this);
- scriptExecutionContext()->eventQueue().enqueueEvent(event.get());
- m_enqueuedEvents.append(event);
-}
-
-bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event)
-{
- LOG(StorageAPI, "IDBDatabase::dispatchEvent");
- ASSERT(event->type() == eventNames().versionchangeEvent);
- for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
- if (m_enqueuedEvents[i].get() == event.get())
- m_enqueuedEvents.remove(i);
- }
- return EventTarget::dispatchEvent(event.get());
-}
-
-int64_t IDBDatabase::findObjectStoreId(const String& name) const
-{
- for (auto& objectStore : m_metadata.objectStores) {
- if (objectStore.value.name == name) {
- ASSERT(objectStore.key != IDBObjectStoreMetadata::InvalidId);
- return objectStore.key;
- }
- }
- return IDBObjectStoreMetadata::InvalidId;
-}
-
-bool IDBDatabase::hasPendingActivity() const
-{
- // The script wrapper must not be collected before the object is closed or
- // we can't fire a "versionchange" event to let script manually close the connection.
- return !m_closePending && hasEventListeners() && !m_contextStopped;
-}
-
-void IDBDatabase::stop()
-{
- // Stop fires at a deterministic time, so we need to call close in it.
- close();
-
- m_contextStopped = true;
-}
-
-const char* IDBDatabase::activeDOMObjectName() const
-{
- return "IDBDatabase";
-}
-
-bool IDBDatabase::canSuspendForPageCache() const
-{
- return m_isClosed;
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index 4899763..a5a9613 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBDatabase_h
@@ -31,7 +31,6 @@
#include "Dictionary.h"
#include "Event.h"
#include "EventTarget.h"
-#include "IDBDatabaseCallbacks.h"
#include "IDBDatabaseMetadata.h"
#include "IDBObjectStore.h"
#include "IDBTransaction.h"
@@ -49,90 +48,29 @@
typedef int ExceptionCode;
-class IDBDatabase final : public RefCounted<IDBDatabase>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
+class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
public:
- static Ref<IDBDatabase> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
- ~IDBDatabase();
-
- void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadata; }
- void transactionCreated(IDBTransaction*);
- void transactionFinished(IDBTransaction*);
+ virtual ~IDBDatabase() { }
// Implement the IDL
- const String name() const { return m_metadata.name; }
- uint64_t version() const;
- PassRefPtr<DOMStringList> objectStoreNames() const;
+ virtual const String name() const = 0;
+ virtual uint64_t version() const = 0;
+ virtual PassRefPtr<DOMStringList> objectStoreNames() const = 0;
- PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&);
- PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCode&);
- PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> scope, const String& mode, ExceptionCode& ec) { return transaction(context, *scope, mode, ec); }
- PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCode&);
- PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&);
- void deleteObjectStore(const String& name, ExceptionCode&);
- void close();
+ virtual PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&) = 0;
+ virtual void deleteObjectStore(const String& name, ExceptionCode&) = 0;
+ virtual void close() = 0;
- // IDBDatabaseCallbacks
- virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion);
- virtual void onAbort(int64_t, PassRefPtr<IDBDatabaseError>);
- virtual void onComplete(int64_t);
-
- // EventTarget
- virtual EventTargetInterface eventTargetInterface() const override final { return IDBDatabaseEventTargetInterfaceType; }
- virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
-
- bool isClosePending() const { return m_closePending; }
- void forceClose();
- const IDBDatabaseMetadata metadata() const { return m_metadata; }
- void enqueueEvent(PassRefPtr<Event>);
-
- using EventTarget::dispatchEvent;
- virtual bool dispatchEvent(PassRefPtr<Event>) override;
-
- int64_t findObjectStoreId(const String& name) const;
- bool containsObjectStore(const String& name) const
- {
- return findObjectStoreId(name) != IDBObjectStoreMetadata::InvalidId;
- }
-
- IDBDatabaseBackend* backend() const { return m_backend.get(); }
-
- static int64_t nextTransactionId();
+ virtual const IDBDatabaseMetadata metadata() const = 0;
using RefCounted<IDBDatabase>::ref;
using RefCounted<IDBDatabase>::deref;
- // ActiveDOMObject API.
- bool hasPendingActivity() const override;
-
-private:
- IDBDatabase(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
-
- // ActiveDOMObject API.
- void stop() override;
- const char* activeDOMObjectName() const override;
- bool canSuspendForPageCache() const override;
-
- // EventTarget
- virtual void refEventTarget() override final { ref(); }
- virtual void derefEventTarget() override final { deref(); }
-
- void closeConnection();
-
- IDBDatabaseMetadata m_metadata;
- RefPtr<IDBDatabaseBackend> m_backend;
- RefPtr<IDBTransaction> m_versionChangeTransaction;
- typedef HashMap<int64_t, IDBTransaction*> TransactionMap;
- TransactionMap m_transactions;
-
- bool m_closePending;
- bool m_isClosed;
- bool m_contextStopped;
-
- // Keep track of the versionchange events waiting to be fired on this
- // database so that we can cancel them if the database closes.
- Vector<RefPtr<Event>> m_enqueuedEvents;
-
- RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
+protected:
+ IDBDatabase(ScriptExecutionContext*);
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.idl b/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
index ed98fed..a5def70 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
@@ -31,6 +31,7 @@
JSGenerateToJSObject,
JSGenerateToNativeObject,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBDatabase : EventTarget {
readonly attribute DOMString name;
readonly attribute unsigned long long version;
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
index d507e6b..7a9f995 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
@@ -1,29 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -31,135 +28,10 @@
#if ENABLE(INDEXED_DATABASE)
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "Frame.h"
-#include "IDBBindingUtilities.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseCallbacksImpl.h"
-#include "IDBDatabaseException.h"
-#include "IDBFactoryBackendInterface.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "IDBOpenDBRequest.h"
-#include "Logging.h"
-#include "Page.h"
-#include "PageGroup.h"
-#include "SchemeRegistry.h"
-#include "SecurityOrigin.h"
-#include "WorkerGlobalScope.h"
-#include "WorkerLoaderProxy.h"
-#include "WorkerThread.h"
-
namespace WebCore {
-IDBFactory::IDBFactory(IDBFactoryBackendInterface* factory)
- : m_backend(factory)
+IDBFactory::IDBFactory()
{
- // We pass a reference to this object before it can be adopted.
- relaxAdoptionRequirement();
-}
-
-IDBFactory::~IDBFactory()
-{
-}
-
-static bool isContextValid(ScriptExecutionContext* context)
-{
- ASSERT(is<Document>(*context) || context->isWorkerGlobalScope());
- if (is<Document>(*context)) {
- Document& document = downcast<Document>(*context);
- return document.frame() && document.page() && (!document.page()->usesEphemeralSession() || SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin()->protocol()));
- }
- return true;
-}
-
-PassRefPtr<IDBRequest> IDBFactory::getDatabaseNames(ScriptExecutionContext* context, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBFactory::getDatabaseNames");
- if (!isContextValid(context))
- return 0;
- if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
- ec = SECURITY_ERR;
- return 0;
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0);
- m_backend->getDatabaseNames(request, *(context->securityOrigin()), *(context->topOrigin()), context);
- return request;
-}
-
-PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBFactory::open");
- return openInternal(context, name, 0, IndexedDB::VersionNullness::Null, ec);
-}
-
-PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, const String& name, unsigned long long version, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBFactory::open");
- if (!version) {
- ec = TypeError;
- return 0;
- }
- return openInternal(context, name, version, IndexedDB::VersionNullness::NonNull, ec);
-}
-
-PassRefPtr<IDBOpenDBRequest> IDBFactory::openInternal(ScriptExecutionContext* context, const String& name, uint64_t version, IndexedDB::VersionNullness versionNullness, ExceptionCode& ec)
-{
- ASSERT(version >= 1 || versionNullness == IndexedDB::VersionNullness::Null);
- if (name.isNull()) {
- ec = TypeError;
- return 0;
- }
- if (!isContextValid(context))
- return 0;
- if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
- ec = SECURITY_ERR;
- return 0;
- }
-
- RefPtr<IDBDatabaseCallbacks> databaseCallbacks = IDBDatabaseCallbacksImpl::create();
- int64_t transactionId = IDBDatabase::nextTransactionId();
- RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, databaseCallbacks, transactionId, version, versionNullness);
- m_backend->open(name, version, transactionId, request, databaseCallbacks, *(context->securityOrigin()), *(context->topOrigin()));
- return request;
-}
-
-PassRefPtr<IDBOpenDBRequest> IDBFactory::deleteDatabase(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBFactory::deleteDatabase");
- if (name.isNull()) {
- ec = TypeError;
- return 0;
- }
- if (!isContextValid(context))
- return 0;
- if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
- ec = SECURITY_ERR;
- return 0;
- }
-
- RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, 0, 0, 0, IndexedDB::VersionNullness::Null);
- m_backend->deleteDatabase(name, *context->securityOrigin(), *context->topOrigin(), request, context);
- return request;
-}
-
-short IDBFactory::cmp(ScriptExecutionContext* context, const Deprecated::ScriptValue& firstValue, const Deprecated::ScriptValue& secondValue, ExceptionCode& ec)
-{
- DOMRequestState requestState(context);
- RefPtr<IDBKey> first = scriptValueToIDBKey(&requestState, firstValue);
- RefPtr<IDBKey> second = scriptValueToIDBKey(&requestState, secondValue);
-
- ASSERT(first);
- ASSERT(second);
-
- if (!first->isValid() || !second->isValid()) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
-
- return static_cast<short>(first->compare(second.get()));
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.h b/Source/WebCore/Modules/indexeddb/IDBFactory.h
index 867e31e..446e107 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.h
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.h
@@ -1,30 +1,28 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
+
#ifndef IDBFactory_h
#define IDBFactory_h
@@ -46,38 +44,27 @@
typedef int ExceptionCode;
-class IDBFactory : public ScriptWrappable, public RefCounted<IDBFactory> {
+class IDBFactory : public RefCounted<IDBFactory> {
public:
- static PassRefPtr<IDBFactory> create(IDBFactoryBackendInterface* factory)
- {
- // FIXME: While the feature is under development we'll handle a null factory backend here,
- // returning null, so javascript can't try to use the feature.
- // Once the feature is fully functional we should remove the null factory backend.
- return factory ? adoptRef(new IDBFactory(factory)) : nullptr;
- }
- ~IDBFactory();
+ virtual ~IDBFactory() { }
// FIXME: getDatabaseNames is no longer a web-facing API, and should be removed from IDBFactory.
// The Web Inspector currently uses this to enumerate the list of databases, but is more complicated as a result.
// We should provide a simpler API to the Web Inspector then remove getDatabaseNames.
- PassRefPtr<IDBRequest> getDatabaseNames(ScriptExecutionContext*, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> getDatabaseNames(ScriptExecutionContext*, ExceptionCode&) = 0;
- PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&);
- PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, unsigned long long version, ExceptionCode&);
- PassRefPtr<IDBOpenDBRequest> deleteDatabase(ScriptExecutionContext*, const String& name, ExceptionCode&);
+ virtual PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, unsigned long long version, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBOpenDBRequest> deleteDatabase(ScriptExecutionContext*, const String& name, ExceptionCode&) = 0;
- short cmp(ScriptExecutionContext*, const Deprecated::ScriptValue& first, const Deprecated::ScriptValue& second, ExceptionCode&);
+ virtual short cmp(ScriptExecutionContext*, const Deprecated::ScriptValue& first, const Deprecated::ScriptValue& second, ExceptionCode&) = 0;
-private:
- IDBFactory(IDBFactoryBackendInterface*);
-
- PassRefPtr<IDBOpenDBRequest> openInternal(ScriptExecutionContext*, const String& name, uint64_t version, IndexedDB::VersionNullness, ExceptionCode&);
-
- RefPtr<IDBFactoryBackendInterface> m_backend;
+protected:
+ IDBFactory();
};
} // namespace WebCore
#endif
-#endif // IDBFactory_h
+#endif // LegacyFactory_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.idl b/Source/WebCore/Modules/indexeddb/IDBFactory.idl
index 8527322..c87ce19 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.idl
@@ -25,8 +25,8 @@
[
Conditional=INDEXED_DATABASE,
- ImplementationLacksVTable,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBFactory {
[CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
[CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index e6fdf5c..a2b4e2b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,181 +28,10 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBDatabaseException.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "IDBObjectStore.h"
-#include "IDBRequest.h"
-#include "IDBTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-
namespace WebCore {
-IDBIndex::IDBIndex(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
- : m_metadata(metadata)
- , m_objectStore(objectStore)
- , m_transaction(transaction)
- , m_deleted(false)
+IDBIndex::IDBIndex()
{
- ASSERT(m_objectStore);
- ASSERT(m_transaction);
- ASSERT(m_metadata.id != IDBIndexMetadata::InvalidId);
-}
-
-IDBIndex::~IDBIndex()
-{
-}
-
-PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::openCursor");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
- if (ec)
- return 0;
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
- backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, IDBDatabaseBackend::NormalTask, request);
- return request;
-}
-
-PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::openCursor");
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return openCursor(context, keyRange.release(), direction, ec);
-}
-
-PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::count");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, request);
- return request;
-}
-
-PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::count");
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return count(context, keyRange.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::openKeyCursor");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
- if (ec)
- return 0;
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- request->setCursorDetails(IndexedDB::CursorType::KeyOnly, direction);
- backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, true, IDBDatabaseBackend::NormalTask, request);
- return request;
-}
-
-PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::openKeyCursor");
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return openKeyCursor(context, keyRange.release(), direction, ec);
-}
-
-PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::get");
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return get(context, keyRange.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::get");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (!keyRange) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, false, request);
- return request;
-}
-
-PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::getKey");
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
-
- return getKey(context, keyRange.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBIndex::getKey");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (!keyRange) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, true, request);
- return request;
-}
-
-IDBDatabaseBackend* IDBIndex::backendDB() const
-{
- return m_transaction->backendDB();
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h
index 1a9e476..ab351ee 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBIndex_h
@@ -43,55 +43,43 @@
class IDBObjectStore;
-class IDBIndex : public ScriptWrappable, public RefCounted<IDBIndex> {
+class IDBIndex : public RefCounted<IDBIndex> {
public:
- static Ref<IDBIndex> create(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
- {
- return adoptRef(*new IDBIndex(metadata, objectStore, transaction));
- }
- ~IDBIndex();
+ virtual ~IDBIndex() { }
// Implement the IDL
- const String name() const { return m_metadata.name; }
- PassRefPtr<IDBObjectStore> objectStore() const { return m_objectStore; }
- PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); }
- const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
- bool unique() const { return m_metadata.unique; }
- bool multiEntry() const { return m_metadata.multiEntry; }
- int64_t id() const { return m_metadata.id; }
+ virtual const String name() const = 0;
+ virtual PassRefPtr<IDBObjectStore> objectStore() const = 0;
+ virtual PassRefPtr<IDBAny> keyPathAny() const = 0;
+ virtual const IDBKeyPath keyPath() const = 0;
+ virtual bool unique() const = 0;
+ virtual bool multiEntry() const = 0;
+ virtual int64_t id() const = 0;
- // FIXME: Try to modify the code generator so this is unneeded.
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
- PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) = 0;
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openKeyCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
- PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) = 0;
- void markDeleted() { m_deleted = true; }
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
- IDBDatabaseBackend* backendDB() const;
+ virtual PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
-private:
- IDBIndex(const IDBIndexMetadata&, IDBObjectStore*, IDBTransaction*);
-
- IDBIndexMetadata m_metadata;
- RefPtr<IDBObjectStore> m_objectStore;
- RefPtr<IDBTransaction> m_transaction;
- bool m_deleted;
+protected:
+ IDBIndex();
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.idl b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
index c75be70..95a106d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.idl
@@ -25,8 +25,8 @@
[
Conditional=INDEXED_DATABASE,
- ImplementationLacksVTable,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBIndex {
readonly attribute DOMString name;
readonly attribute IDBObjectStore objectStore;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index a6d2814..4a06415 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,545 +28,10 @@
#if ENABLE(INDEXED_DATABASE)
-#include "DOMStringList.h"
-#include "IDBAny.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseException.h"
-#include "IDBIndex.h"
-#include "IDBKey.h"
-#include "IDBKeyData.h"
-#include "IDBKeyPath.h"
-#include "IDBKeyRange.h"
-#include "IDBTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include "SerializedScriptValue.h"
-#include "SharedBuffer.h"
-
namespace WebCore {
-IDBObjectStore::IDBObjectStore(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
- : m_metadata(metadata)
- , m_transaction(transaction)
- , m_deleted(false)
+IDBObjectStore::IDBObjectStore()
{
- ASSERT(m_transaction);
- // We pass a reference to this object before it can be adopted.
- relaxAdoptionRequirement();
-}
-
-PassRefPtr<DOMStringList> IDBObjectStore::indexNames() const
-{
- LOG(StorageAPI, "IDBObjectStore::indexNames");
- RefPtr<DOMStringList> indexNames = DOMStringList::create();
- for (auto& index : m_metadata.indexes.values())
- indexNames->append(index.name);
- indexNames->sort();
- return indexNames.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::get");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!keyRange) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, false, request);
- return request.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return get(context, keyRange.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::add(JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::add");
- return put(IDBDatabaseBackend::AddOnly, IDBAny::create(this), state, value, key, ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::add(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::add");
- return put(IDBDatabaseBackend::AddOnly, IDBAny::create(this), state, value, static_cast<IDBKey*>(nullptr), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::put(JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::put");
- return put(IDBDatabaseBackend::AddOrUpdate, IDBAny::create(this), state, value, key, ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::put(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::put");
- return put(IDBDatabaseBackend::AddOrUpdate, IDBAny::create(this), state, value, static_cast<IDBKey*>(nullptr), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::put(IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBAny> source, JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
-{
- ScriptExecutionContext* context = scriptExecutionContextFromExecState(state);
- DOMRequestState requestState(context);
- RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
- return put(putMode, source, state, value, key.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::put(IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBAny> source, JSC::ExecState* state, Deprecated::ScriptValue& value, PassRefPtr<IDBKey> prpKey, ExceptionCode& ec)
-{
- RefPtr<IDBKey> key = prpKey;
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return nullptr;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return nullptr;
- }
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::ReadOnlyError;
- return nullptr;
- }
-
- RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(state, value.jsValue(), nullptr, nullptr);
- if (state->hadException())
- return nullptr;
-
- if (serializedValue->hasBlobURLs()) {
- // FIXME: Add Blob/File/FileList support
- ec = IDBDatabaseException::DataCloneError;
- return nullptr;
- }
-
- const IDBKeyPath& keyPath = m_metadata.keyPath;
- const bool usesInLineKeys = !keyPath.isNull();
- const bool hasKeyGenerator = autoIncrement();
-
- ScriptExecutionContext* context = scriptExecutionContextFromExecState(state);
- DOMRequestState requestState(context);
-
- if (putMode != IDBDatabaseBackend::CursorUpdate && usesInLineKeys && key) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
- if (!usesInLineKeys && !hasKeyGenerator && !key) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
- if (usesInLineKeys) {
- RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(requestState.exec(), value, keyPath);
- if (keyPathKey && !keyPathKey->isValid()) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
- if (!hasKeyGenerator && !keyPathKey) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
- if (hasKeyGenerator && !keyPathKey) {
- if (!canInjectIDBKeyIntoScriptValue(&requestState, value, keyPath)) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
- }
- if (keyPathKey)
- key = keyPathKey;
- }
- if (key && !key->isValid()) {
- ec = IDBDatabaseException::DataError;
- return nullptr;
- }
-
- Vector<int64_t> indexIds;
- Vector<IndexKeys> indexKeys;
- for (auto& index : m_metadata.indexes) {
- Vector<IDBKeyData> keyDatas;
- generateIndexKeysForValue(requestState.exec(), index.value, value, keyDatas);
- indexIds.append(index.key);
-
- // FIXME: Much of the Indexed DB code needs to use IDBKeyData directly to avoid wasteful conversions like this.
- Vector<RefPtr<IDBKey>> keys;
- for (auto& keyData : keyDatas) {
- RefPtr<IDBKey> key = keyData.maybeCreateIDBKey();
- if (key)
- keys.append(key.release());
- }
- indexKeys.append(keys);
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, source, m_transaction.get());
- Vector<uint8_t> valueBytes = serializedValue->toWireBytes();
- // This is a hack to account for disagreements about whether SerializedScriptValue should deal in Vector<uint8_t> or Vector<char>.
- // See https://lists.webkit.org/pipermail/webkit-dev/2013-February/023682.html
- Vector<char>* valueBytesSigned = reinterpret_cast<Vector<char>*>(&valueBytes);
- RefPtr<SharedBuffer> valueBuffer = SharedBuffer::adoptVector(*valueBytesSigned);
- backendDB()->put(m_transaction->id(), id(), valueBuffer, key.release(), static_cast<IDBDatabaseBackend::PutMode>(putMode), request, indexIds, indexKeys);
- return request.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::deleteFunction(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::delete");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::ReadOnlyError;
- return 0;
- }
- if (!keyRange) {
- ec = IDBDatabaseException::DataError;
- return 0;
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->deleteRange(m_transaction->id(), id(), keyRange, request);
- return request.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::deleteFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return deleteFunction(context, keyRange.release(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::clear(ScriptExecutionContext* context, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::clear");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (m_transaction->isReadOnly()) {
- ec = IDBDatabaseException::ReadOnlyError;
- return 0;
- }
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->clearObjectStore(m_transaction->id(), id(), request);
- return request.release();
-}
-
-namespace {
-// This class creates the index keys for a given index by extracting
-// them from the SerializedScriptValue, for all the existing values in
-// the objectStore. It only needs to be kept alive by virtue of being
-// a listener on an IDBRequest object, in the same way that JavaScript
-// cursor success handlers are kept alive.
-class IndexPopulator : public EventListener {
-public:
- static Ref<IndexPopulator> create(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
- {
- return adoptRef(*new IndexPopulator(backend, transactionId, objectStoreId, indexMetadata));
- }
-
- virtual bool operator==(const EventListener& other)
- {
- return this == &other;
- }
-
-private:
- IndexPopulator(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
- : EventListener(CPPEventListenerType)
- , m_databaseBackend(backend)
- , m_transactionId(transactionId)
- , m_objectStoreId(objectStoreId)
- , m_indexMetadata(indexMetadata)
- {
- }
-
- virtual void handleEvent(ScriptExecutionContext*, Event* event)
- {
- ASSERT(event->type() == eventNames().successEvent);
- EventTarget* target = event->target();
- IDBRequest* request = static_cast<IDBRequest*>(target);
-
- RefPtr<IDBAny> cursorAny = request->result(ASSERT_NO_EXCEPTION);
- RefPtr<IDBCursorWithValue> cursor;
- if (cursorAny->type() == IDBAny::IDBCursorWithValueType)
- cursor = cursorAny->idbCursorWithValue();
-
- Vector<int64_t, 1> indexIds;
- indexIds.append(m_indexMetadata.id);
- if (cursor) {
- cursor->continueFunction(static_cast<IDBKey*>(nullptr), ASSERT_NO_EXCEPTION);
-
- RefPtr<IDBKey> primaryKey = cursor->idbPrimaryKey();
- Deprecated::ScriptValue value = cursor->value();
-
- Vector<IDBKeyData> indexKeyDatas;
- generateIndexKeysForValue(request->requestState()->exec(), m_indexMetadata, value, indexKeyDatas);
-
- Vector<RefPtr<IDBKey>> indexKeys;
- for (auto& indexKeyData : indexKeyDatas) {
- RefPtr<IDBKey> key = indexKeyData.maybeCreateIDBKey();
- if (key)
- indexKeys.append(key.release());
- }
- Vector<IDBObjectStore::IndexKeys, 1> indexKeysList;
- indexKeysList.append(indexKeys);
-
- m_databaseBackend->setIndexKeys(m_transactionId, m_objectStoreId, primaryKey, indexIds, indexKeysList);
- } else {
- // Now that we are done indexing, tell the backend to go
- // back to processing tasks of type NormalTask.
- m_databaseBackend->setIndexesReady(m_transactionId, m_objectStoreId, indexIds);
- m_databaseBackend = nullptr;
- }
-
- }
-
- RefPtr<IDBDatabaseBackend> m_databaseBackend;
- const int64_t m_transactionId;
- const int64_t m_objectStoreId;
- const IDBIndexMetadata m_indexMetadata;
-};
-}
-
-PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, const Dictionary& options, ExceptionCode& ec)
-{
- bool unique = false;
- options.get("unique", unique);
-
- bool multiEntry = false;
- options.get("multiEntry", multiEntry);
-
- return createIndex(context, name, keyPath, unique, multiEntry, ec);
-}
-
-PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::createIndex");
- if (!m_transaction->isVersionChange() || m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- if (!keyPath.isValid()) {
- ec = IDBDatabaseException::SyntaxError;
- return 0;
- }
- if (name.isNull()) {
- ec = TypeError;
- return 0;
- }
- if (containsIndex(name)) {
- ec = IDBDatabaseException::ConstraintError;
- return 0;
- }
-
- if (keyPath.type() == IDBKeyPath::ArrayType && multiEntry) {
- ec = IDBDatabaseException::InvalidAccessError;
- return 0;
- }
-
- int64_t indexId = m_metadata.maxIndexId + 1;
- backendDB()->createIndex(m_transaction->id(), id(), indexId, name, keyPath, unique, multiEntry);
-
- ++m_metadata.maxIndexId;
-
- IDBIndexMetadata metadata(name, indexId, keyPath, unique, multiEntry);
- RefPtr<IDBIndex> index = IDBIndex::create(metadata, this, m_transaction.get());
- m_indexMap.set(name, index);
- m_metadata.indexes.set(indexId, metadata);
-
- ASSERT(!ec);
- if (ec)
- return 0;
-
- ASSERT_UNUSED(context, context);
- return index.release();
-}
-
-PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::index");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (m_transaction->isFinished()) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
-
- IDBIndexMap::iterator it = m_indexMap.find(name);
- if (it != m_indexMap.end())
- return it->value;
-
- int64_t indexId = findIndexId(name);
- if (indexId == IDBIndexMetadata::InvalidId) {
- ec = IDBDatabaseException::NotFoundError;
- return 0;
- }
-
- const IDBIndexMetadata* indexMetadata(nullptr);
- for (auto& index : m_metadata.indexes.values()) {
- if (index.name == name) {
- indexMetadata = &index;
- break;
- }
- }
- ASSERT(indexMetadata);
- ASSERT(indexMetadata->id != IDBIndexMetadata::InvalidId);
-
- RefPtr<IDBIndex> index = IDBIndex::create(*indexMetadata, this, m_transaction.get());
- m_indexMap.set(name, index);
- return index.release();
-}
-
-void IDBObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::deleteIndex");
- if (!m_transaction->isVersionChange() || m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return;
- }
- int64_t indexId = findIndexId(name);
- if (indexId == IDBIndexMetadata::InvalidId) {
- ec = IDBDatabaseException::NotFoundError;
- return;
- }
-
- backendDB()->deleteIndex(m_transaction->id(), id(), indexId);
-
- m_metadata.indexes.remove(indexId);
- IDBIndexMap::iterator it = m_indexMap.find(name);
- if (it != m_indexMap.end()) {
- it->value->markDeleted();
- m_indexMap.remove(name);
- }
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, ExceptionCode& ec)
-{
- return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
-{
- return openCursor(context, keyRange, IDBCursor::directionNext(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- return openCursor(context, key, IDBCursor::directionNext(), ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& direction, ExceptionCode& ec)
-{
- return openCursor(context, range, direction, IDBDatabaseBackend::NormalTask, ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, IDBDatabaseBackend::TaskType taskType, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::openCursor");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
- if (ec)
- return 0;
-
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
-
- backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, direction, false, static_cast<IDBDatabaseBackend::TaskType>(taskType), request);
- return request.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
-{
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return openCursor(context, keyRange.release(), direction, ec);
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, ExceptionCode& ec)
-{
- LOG(StorageAPI, "IDBObjectStore::count");
- if (m_deleted) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- if (!m_transaction->isActive()) {
- ec = IDBDatabaseException::TransactionInactiveError;
- return 0;
- }
- RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- backendDB()->count(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, request);
- return request.release();
-}
-
-PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
-{
- RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
- if (ec)
- return 0;
- return count(context, keyRange.release(), ec);
-}
-
-void IDBObjectStore::transactionFinished()
-{
- ASSERT(m_transaction->isFinished());
-
- // Break reference cycles.
- m_indexMap.clear();
-}
-
-int64_t IDBObjectStore::findIndexId(const String& name) const
-{
- for (auto& index : m_metadata.indexes) {
- if (index.value.name == name) {
- ASSERT(index.key != IDBIndexMetadata::InvalidId);
- return index.key;
- }
- }
- return IDBIndexMetadata::InvalidId;
-}
-
-IDBDatabaseBackend* IDBObjectStore::backendDB() const
-{
- return m_transaction->backendDB();
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index 5766be0..2866504 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -1,41 +1,34 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBObjectStore_h
#define IDBObjectStore_h
#include "Dictionary.h"
-#include "IDBCursor.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBIndex.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "IDBRequest.h"
-#include "IDBTransaction.h"
+#include "ExceptionCode.h"
#include "ScriptWrappable.h"
-#include "SerializedScriptValue.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -43,85 +36,65 @@
#if ENABLE(INDEXED_DATABASE)
+namespace Deprecated {
+class ScriptValue;
+}
+
+namespace JSC {
+class ExecState;
+}
+
namespace WebCore {
class DOMStringList;
class IDBAny;
+class IDBIndex;
+class IDBKeyPath;
+class IDBKeyRange;
+class IDBRequest;
+class IDBTransaction;
+class ScriptExecutionContext;
-class IDBObjectStore : public ScriptWrappable, public RefCounted<IDBObjectStore> {
+class IDBObjectStore : public RefCounted<IDBObjectStore> {
public:
- static Ref<IDBObjectStore> create(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
- {
- return adoptRef(*new IDBObjectStore(metadata, transaction));
- }
- ~IDBObjectStore() { }
+ virtual ~IDBObjectStore() { }
// Implement the IDBObjectStore IDL
- int64_t id() const { return m_metadata.id; }
- const String name() const { return m_metadata.name; }
- PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); }
- const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
- PassRefPtr<DOMStringList> indexNames() const;
- PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
- bool autoIncrement() const { return m_metadata.autoIncrement; }
+ virtual int64_t id() const = 0;
+ virtual const String name() const = 0;
+ virtual PassRefPtr<IDBAny> keyPathAny() const = 0;
+ virtual const IDBKeyPath keyPath() const = 0;
+ virtual PassRefPtr<DOMStringList> indexNames() const = 0;
+ virtual PassRefPtr<IDBTransaction> transaction() const = 0;
+ virtual bool autoIncrement() const = 0;
- PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
- PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, IDBDatabaseBackend::TaskType, ExceptionCode&);
- PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) = 0;
- PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&) = 0;
- PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
- PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
- PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, const Dictionary&, ExceptionCode&);
- PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionCode&);
+ virtual PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionCode&) = 0;
- PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&);
- void deleteIndex(const String& name, ExceptionCode&);
+ virtual PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&) = 0;
+ virtual void deleteIndex(const String& name, ExceptionCode&) = 0;
- PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
- PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
- PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) = 0;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) = 0;
- PassRefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, PassRefPtr<IDBAny> source, JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
- PassRefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, PassRefPtr<IDBAny> source, JSC::ExecState*, Deprecated::ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&);
- void markDeleted() { m_deleted = true; }
- void transactionFinished();
-
- IDBObjectStoreMetadata metadata() const { return m_metadata; }
- void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = metadata; }
-
- typedef Vector<RefPtr<IDBKey>> IndexKeys;
- typedef HashMap<String, IndexKeys> IndexKeyMap;
-
- IDBDatabaseBackend* backendDB() const;
-
-private:
- IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);
-
- int64_t findIndexId(const String& name) const;
- bool containsIndex(const String& name) const
- {
- return findIndexId(name) != IDBIndexMetadata::InvalidId;
- }
-
- IDBObjectStoreMetadata m_metadata;
- RefPtr<IDBTransaction> m_transaction;
- bool m_deleted;
-
- typedef HashMap<String, RefPtr<IDBIndex>> IDBIndexMap;
- IDBIndexMap m_indexMap;
+protected:
+ IDBObjectStore();
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
index fdfca8a..af020df 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
@@ -25,8 +25,8 @@
[
Conditional=INDEXED_DATABASE,
- ImplementationLacksVTable,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBObjectStore {
[TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
[ImplementedAs=keyPathAny] readonly attribute IDBAny keyPath;
diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
index 71579b0..adf8a68 100644
--- a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,128 +28,13 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBDatabase.h"
-#include "IDBDatabaseCallbacksImpl.h"
-#include "IDBPendingTransactionMonitor.h"
-#include "IDBVersionChangeEvent.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-
namespace WebCore {
-Ref<IDBOpenDBRequest> IDBOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
+IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context)
+ : IDBRequest(context)
{
- Ref<IDBOpenDBRequest> request(adoptRef(*new IDBOpenDBRequest(context, callbacks, transactionId, version, versionNullness)));
- request->suspendIfNeeded();
- return request;
-}
-
-IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
- : IDBRequest(context, IDBAny::createNull(), IDBDatabaseBackend::NormalTask, 0)
- , m_databaseCallbacks(callbacks)
- , m_transactionId(transactionId)
- , m_version(version)
- , m_versionNullness(versionNullness)
-{
- ASSERT(!m_result);
-}
-
-IDBOpenDBRequest::~IDBOpenDBRequest()
-{
-}
-
-EventTargetInterface IDBOpenDBRequest::eventTargetInterface() const
-{
- return IDBOpenDBRequestEventTargetInterfaceType;
-}
-
-void IDBOpenDBRequest::onBlocked(uint64_t oldVersion)
-{
- LOG(StorageAPI, "IDBOpenDBRequest::onBlocked()");
- if (!shouldEnqueueEvent())
- return;
-
- enqueueEvent(IDBVersionChangeEvent::create(oldVersion, m_version, eventNames().blockedEvent));
-}
-
-void IDBOpenDBRequest::onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend> prpDatabaseBackend, const IDBDatabaseMetadata& metadata)
-{
- LOG(StorageAPI, "IDBOpenDBRequest::onUpgradeNeeded()");
- if (m_contextStopped || !scriptExecutionContext()) {
- RefPtr<IDBDatabaseBackend> db = prpDatabaseBackend;
- db->abort(m_transactionId);
- db->close(m_databaseCallbacks);
- return;
- }
- if (!shouldEnqueueEvent())
- return;
-
- ASSERT(m_databaseCallbacks);
-
- RefPtr<IDBDatabaseBackend> databaseBackend = prpDatabaseBackend;
-
- RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(scriptExecutionContext(), databaseBackend, m_databaseCallbacks);
- idbDatabase->setMetadata(metadata);
- m_databaseCallbacks->connect(idbDatabase.get());
- m_databaseCallbacks = nullptr;
-
- IDBDatabaseMetadata oldMetadata(metadata);
- oldMetadata.version = oldVersion;
-
- m_transaction = IDBTransaction::create(scriptExecutionContext(), m_transactionId, idbDatabase.get(), this, oldMetadata);
- m_result = IDBAny::create(idbDatabase.release());
-
- if (m_versionNullness == IndexedDB::VersionNullness::Null)
- m_version = 1;
- enqueueEvent(IDBVersionChangeEvent::create(oldVersion, m_version, eventNames().upgradeneededEvent));
-}
-
-void IDBOpenDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackend> prpBackend, const IDBDatabaseMetadata& metadata)
-{
- LOG(StorageAPI, "IDBOpenDBRequest::onSuccess()");
- if (!shouldEnqueueEvent())
- return;
-
- RefPtr<IDBDatabaseBackend> backend = prpBackend;
- RefPtr<IDBDatabase> idbDatabase;
- if (m_result) {
- idbDatabase = m_result->idbDatabase();
- ASSERT(idbDatabase);
- ASSERT(!m_databaseCallbacks);
- } else {
- ASSERT(m_databaseCallbacks);
- idbDatabase = IDBDatabase::create(scriptExecutionContext(), backend.release(), m_databaseCallbacks);
- m_databaseCallbacks->connect(idbDatabase.get());
- m_databaseCallbacks = nullptr;
- m_result = IDBAny::create(idbDatabase.get());
- }
- idbDatabase->setMetadata(metadata);
- enqueueEvent(Event::create(eventNames().successEvent, false, false));
-}
-
-bool IDBOpenDBRequest::shouldEnqueueEvent() const
-{
- if (m_contextStopped || !scriptExecutionContext())
- return false;
- ASSERT(m_readyState == PENDING || m_readyState == DONE);
- if (m_requestAborted)
- return false;
- return true;
-}
-
-bool IDBOpenDBRequest::dispatchEvent(PassRefPtr<Event> event)
-{
- // If the connection closed between onUpgradeNeeded and the delivery of the "success" event,
- // an "error" event should be fired instead.
- if (event->type() == eventNames().successEvent && m_result->type() == IDBAny::IDBDatabaseType && m_result->idbDatabase()->isClosePending()) {
- m_result = nullptr;
- onError(IDBDatabaseError::create(IDBDatabaseException::AbortError, "The connection was closed."));
- return false;
- }
-
- return IDBRequest::dispatchEvent(event);
}
} // namespace WebCore
-#endif
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
index 91d4b01..a10156b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBOpenDBRequest_h
@@ -33,33 +33,12 @@
namespace WebCore {
-class IDBDatabaseCallbacks;
-
class IDBOpenDBRequest : public IDBRequest {
public:
- static Ref<IDBOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
- virtual ~IDBOpenDBRequest();
-
- using IDBRequest::onSuccess;
-
- virtual void onBlocked(uint64_t existingVersion) override;
- virtual void onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override;
- virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override;
-
- // EventTarget
- virtual EventTargetInterface eventTargetInterface() const override;
- virtual bool dispatchEvent(PassRefPtr<Event>) override;
+ virtual ~IDBOpenDBRequest() { }
protected:
- virtual bool shouldEnqueueEvent() const override;
-
-private:
- IDBOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
-
- RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
- const int64_t m_transactionId;
- uint64_t m_version;
- IndexedDB::VersionNullness m_versionNullness;
+ IDBOpenDBRequest(ScriptExecutionContext*);
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl
index 59a6601..5469789 100644
--- a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl
@@ -29,6 +29,7 @@
JSGenerateToJSObject,
JSGenerateToNativeObject,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBOpenDBRequest : IDBRequest {
attribute EventHandler onblocked;
attribute EventHandler onupgradeneeded;
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index 864de53..c6a8b1e 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -1,29 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -31,547 +28,13 @@
#if ENABLE(INDEXED_DATABASE)
-#include "EventException.h"
-#include "EventListener.h"
-#include "EventNames.h"
-#include "EventQueue.h"
-#include "ExceptionCodePlaceholder.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCursorBackend.h"
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBEventDispatcher.h"
-#include "IDBTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include "SharedBuffer.h"
-
namespace WebCore {
-Ref<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
-{
- Ref<IDBRequest> request(adoptRef(*new IDBRequest(context, source, IDBDatabaseBackend::NormalTask, transaction)));
- request->suspendIfNeeded();
- // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
- if (transaction)
- transaction->registerRequest(request.ptr());
- return request;
-}
-
-Ref<IDBRequest> IDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType taskType, IDBTransaction* transaction)
-{
- Ref<IDBRequest> request(adoptRef(*new IDBRequest(context, source, taskType, transaction)));
- request->suspendIfNeeded();
- // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
- if (transaction)
- transaction->registerRequest(request.ptr());
- return request;
-}
-
-IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType taskType, IDBTransaction* transaction)
+IDBRequest::IDBRequest(ScriptExecutionContext* context)
: ActiveDOMObject(context)
- , m_result(nullptr)
- , m_errorCode(0)
- , m_contextStopped(false)
- , m_transaction(transaction)
- , m_readyState(PENDING)
- , m_requestAborted(false)
- , m_source(source)
- , m_taskType(taskType)
- , m_hasPendingActivity(true)
- , m_cursorType(IndexedDB::CursorType::KeyAndValue)
- , m_cursorDirection(IndexedDB::CursorDirection::Next)
- , m_cursorFinished(false)
- , m_pendingCursor(nullptr)
- , m_didFireUpgradeNeededEvent(false)
- , m_preventPropagation(false)
- , m_requestState(context)
{
}
-IDBRequest::~IDBRequest()
-{
-}
-
-PassRefPtr<IDBAny> IDBRequest::result(ExceptionCode& ec) const
-{
- if (m_readyState != DONE) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- return m_result;
-}
-
-PassRefPtr<DOMError> IDBRequest::error(ExceptionCode& ec) const
-{
- if (m_readyState != DONE) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- return m_error;
-}
-
-unsigned short IDBRequest::errorCode(ExceptionCode& ec) const
-{
- if (m_readyState != DONE) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
- return m_errorCode;
-}
-
-PassRefPtr<IDBAny> IDBRequest::source() const
-{
- return m_source;
-}
-
-PassRefPtr<IDBTransaction> IDBRequest::transaction() const
-{
- return m_transaction;
-}
-
-const String& IDBRequest::readyState() const
-{
- ASSERT(m_readyState == PENDING || m_readyState == DONE);
- DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, pending, ("pending", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, done, ("done", AtomicString::ConstructFromLiteral));
-
- if (m_readyState == PENDING)
- return pending;
-
- return done;
-}
-
-void IDBRequest::markEarlyDeath()
-{
- ASSERT(m_readyState == PENDING);
- m_readyState = EarlyDeath;
- if (m_transaction)
- m_transaction->unregisterRequest(this);
-}
-
-void IDBRequest::abort()
-{
- ASSERT(!m_requestAborted);
- if (m_contextStopped || !scriptExecutionContext())
- return;
- ASSERT(m_readyState == PENDING || m_readyState == DONE);
- if (m_readyState == DONE)
- return;
-
- // Enqueued events may be the only reference to this object.
- RefPtr<IDBRequest> self(this);
-
- EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
- for (auto& event : m_enqueuedEvents) {
- bool removed = eventQueue.cancelEvent(*event);
- ASSERT_UNUSED(removed, removed);
- }
- m_enqueuedEvents.clear();
-
- m_errorCode = 0;
- m_error = nullptr;
- m_errorMessage = String();
- m_result = nullptr;
- onError(IDBDatabaseError::create(IDBDatabaseException::AbortError));
- m_requestAborted = true;
-}
-
-void IDBRequest::setCursorDetails(IndexedDB::CursorType cursorType, IndexedDB::CursorDirection direction)
-{
- ASSERT(m_readyState == PENDING);
- ASSERT(!m_pendingCursor);
- m_cursorType = cursorType;
- m_cursorDirection = direction;
-}
-
-void IDBRequest::setPendingCursor(PassRefPtr<IDBCursor> cursor)
-{
- ASSERT(m_readyState == DONE);
- ASSERT(scriptExecutionContext());
- ASSERT(m_transaction);
- ASSERT(!m_pendingCursor);
- ASSERT(cursor == getResultCursor());
-
- m_pendingCursor = cursor;
- m_result = nullptr;
- m_readyState = PENDING;
- m_errorCode = 0;
- m_error = nullptr;
- m_errorMessage = String();
- m_transaction->registerRequest(this);
-}
-
-RefPtr<IDBCursor> IDBRequest::getResultCursor()
-{
- if (!m_result)
- return nullptr;
- if (m_result->type() == IDBAny::IDBCursorType)
- return m_result->idbCursor();
- if (m_result->type() == IDBAny::IDBCursorWithValueType)
- return m_result->idbCursorWithValue();
- return nullptr;
-}
-
-void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue& value)
-{
- ASSERT(m_readyState == PENDING);
- m_cursorKey = key;
- m_cursorPrimaryKey = primaryKey;
- m_cursorValue = value;
-
- if (m_cursorType == IndexedDB::CursorType::KeyOnly) {
- m_result = IDBAny::create(cursor);
- return;
- }
-
- m_result = IDBAny::create(IDBCursorWithValue::fromCursor(cursor));
-}
-
-void IDBRequest::finishCursor()
-{
- m_cursorFinished = true;
- if (m_readyState != PENDING)
- m_hasPendingActivity = false;
-}
-
-bool IDBRequest::shouldEnqueueEvent() const
-{
- if (m_contextStopped || !scriptExecutionContext())
- return false;
- ASSERT(m_readyState == PENDING || m_readyState == DONE);
- if (m_requestAborted)
- return false;
- ASSERT(m_readyState == PENDING);
- ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
- return true;
-}
-
-void IDBRequest::onError(PassRefPtr<IDBDatabaseError> error)
-{
- LOG(StorageAPI, "IDBRequest::onError() (%s) '%s'", error->name().utf8().data(), error->message().utf8().data());
- if (!shouldEnqueueEvent())
- return;
-
- m_errorCode = error->code();
- m_errorMessage = error->message();
- m_error = DOMError::create(IDBDatabaseException::getErrorName(error->idbCode()));
- m_pendingCursor = nullptr;
- enqueueEvent(Event::create(eventNames().errorEvent, true, true));
-}
-
-static PassRefPtr<Event> createSuccessEvent()
-{
- return Event::create(eventNames().successEvent, false, false);
-}
-
-void IDBRequest::onSuccess(PassRefPtr<DOMStringList> domStringList)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(DOMStringList)");
- if (!shouldEnqueueEvent())
- return;
-
- m_result = IDBAny::create(domStringList);
- enqueueEvent(createSuccessEvent());
-}
-
-void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackend> prpBackend)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(IDBCursor)");
- if (!shouldEnqueueEvent())
- return;
-
- DOMRequestState::Scope scope(m_requestState);
-
- RefPtr<IDBCursorBackend> backend = prpBackend;
- RefPtr<IDBKey> key = backend->key();
- RefPtr<IDBKey> primaryKey = backend->primaryKey();
-
- Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), backend->valueBuffer(), !!key);
-
- ASSERT(!m_pendingCursor);
- RefPtr<IDBCursor> cursor;
- switch (m_cursorType) {
- case IndexedDB::CursorType::KeyOnly:
- cursor = IDBCursor::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
- break;
- case IndexedDB::CursorType::KeyAndValue:
- cursor = IDBCursorWithValue::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
- break;
- default:
- ASSERT_NOT_REACHED();
- }
- setResultCursor(cursor, key.release(), primaryKey.release(), value);
-
- enqueueEvent(createSuccessEvent());
-}
-
-void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(IDBKey)");
- if (!shouldEnqueueEvent())
- return;
-
- if (idbKey && idbKey->isValid()) {
- DOMRequestState::Scope scope(m_requestState);
- m_result = IDBAny::create(idbKeyToScriptValue(requestState(), idbKey));
- } else
- m_result = IDBAny::createInvalid();
- enqueueEvent(createSuccessEvent());
-}
-
-void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(SharedBuffer)");
- if (!shouldEnqueueEvent())
- return;
-
- DOMRequestState::Scope scope(m_requestState);
-
- // FIXME: By not knowing whether or not the key is defined here, we don't know
- // if a null valueBuffer means the value is null or the value is undefined.
- Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
- onSuccessInternal(value);
-}
-
-#ifndef NDEBUG
-static PassRefPtr<IDBObjectStore> effectiveObjectStore(PassRefPtr<IDBAny> source)
-{
- if (source->type() == IDBAny::IDBObjectStoreType)
- return source->idbObjectStore();
- if (source->type() == IDBAny::IDBIndexType)
- return source->idbIndex()->objectStore();
-
- ASSERT_NOT_REACHED();
- return 0;
-}
-#endif
-
-void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)");
- if (!shouldEnqueueEvent())
- return;
-
-#ifndef NDEBUG
- ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath());
-#endif
- DOMRequestState::Scope scope(m_requestState);
-
- // FIXME: By not knowing whether or not the key is defined here, we don't know
- // if a null valueBuffer means the value is null or the value is undefined.
- Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
-
- RefPtr<IDBKey> primaryKey = prpPrimaryKey;
-
- if (!keyPath.isNull()) {
-#ifndef NDEBUG
- RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath);
- ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get()));
-#endif
- bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath);
- ASSERT_UNUSED(injected, injected);
- }
-
- onSuccessInternal(value);
-}
-
-void IDBRequest::onSuccess(int64_t value)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(int64_t)");
- if (!shouldEnqueueEvent())
- return;
- return onSuccessInternal(SerializedScriptValue::numberValue(value));
-}
-
-void IDBRequest::onSuccess()
-{
- LOG(StorageAPI, "IDBRequest::onSuccess()");
- if (!shouldEnqueueEvent())
- return;
- return onSuccessInternal(SerializedScriptValue::undefinedValue());
-}
-
-void IDBRequest::onSuccessInternal(PassRefPtr<SerializedScriptValue> value)
-{
- ASSERT(!m_contextStopped);
- DOMRequestState::Scope scope(m_requestState);
- return onSuccessInternal(deserializeIDBValue(requestState(), value));
-}
-
-void IDBRequest::onSuccessInternal(const Deprecated::ScriptValue& value)
-{
- m_result = IDBAny::create(value);
- if (m_pendingCursor) {
- m_pendingCursor->close();
- m_pendingCursor = nullptr;
- }
- enqueueEvent(createSuccessEvent());
-}
-
-void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> buffer)
-{
- LOG(StorageAPI, "IDBRequest::onSuccess(key, primaryKey, valueBuffer)");
- if (!shouldEnqueueEvent())
- return;
-
- DOMRequestState::Scope scope(m_requestState);
-
- Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), buffer, !!key);
-
- ASSERT(m_pendingCursor);
- setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
- enqueueEvent(createSuccessEvent());
-}
-
-bool IDBRequest::hasPendingActivity() const
-{
- // FIXME: In an ideal world, we should return true as long as anyone has a or can
- // get a handle to us and we have event listeners. This is order to handle
- // user generated events properly.
- return m_hasPendingActivity && !m_contextStopped;
-}
-
-void IDBRequest::stop()
-{
- if (m_contextStopped)
- return;
-
- m_contextStopped = true;
- m_requestState.clear();
- if (m_readyState == PENDING)
- markEarlyDeath();
-}
-
-bool IDBRequest::canSuspendForPageCache() const
-{
- return !m_hasPendingActivity;
-}
-
-const char* IDBRequest::activeDOMObjectName() const
-{
- return "IDBRequest";
-}
-
-EventTargetInterface IDBRequest::eventTargetInterface() const
-{
- return IDBRequestEventTargetInterfaceType;
-}
-
-bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
-{
- LOG(StorageAPI, "IDBRequest::dispatchEvent");
- ASSERT(m_readyState == PENDING);
- ASSERT(!m_contextStopped);
- ASSERT(m_hasPendingActivity);
- ASSERT(m_enqueuedEvents.size());
- ASSERT(scriptExecutionContext());
- ASSERT(event->target() == this);
- ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), DONE, m_readyState);
-
- DOMRequestState::Scope scope(m_requestState);
-
- if (event->type() != eventNames().blockedEvent)
- m_readyState = DONE;
-
- for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
- if (m_enqueuedEvents[i].get() == event.get())
- m_enqueuedEvents.remove(i);
- }
-
- Vector<RefPtr<EventTarget>> targets;
- targets.append(this);
- if (m_transaction && !m_preventPropagation) {
- targets.append(m_transaction);
- // If there ever are events that are associated with a database but
- // that do not have a transaction, then this will not work and we need
- // this object to actually hold a reference to the database (to ensure
- // it stays alive).
- targets.append(m_transaction->db());
- }
-
- // Cursor properties should not updated until the success event is being dispatched.
- RefPtr<IDBCursor> cursorToNotify;
- if (event->type() == eventNames().successEvent) {
- cursorToNotify = getResultCursor();
- if (cursorToNotify) {
- cursorToNotify->setValueReady(requestState(), m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue);
- m_cursorValue.clear();
- }
- }
-
- if (event->type() == eventNames().upgradeneededEvent) {
- ASSERT(!m_didFireUpgradeNeededEvent);
- m_didFireUpgradeNeededEvent = true;
- }
-
- // FIXME: When we allow custom event dispatching, this will probably need to change.
- ASSERT_WITH_MESSAGE(event->type() == eventNames().successEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().blockedEvent || event->type() == eventNames().upgradeneededEvent, "event type was %s", event->type().string().utf8().data());
- const bool setTransactionActive = m_transaction && (event->type() == eventNames().successEvent || event->type() == eventNames().upgradeneededEvent || (event->type() == eventNames().errorEvent && m_errorCode != IDBDatabaseException::AbortError));
-
- if (setTransactionActive)
- m_transaction->setActive(true);
-
- bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets);
-
- if (m_transaction) {
- if (m_readyState == DONE)
- m_transaction->unregisterRequest(this);
-
- // Possibly abort the transaction. This must occur after unregistering (so this request
- // doesn't receive a second error) and before deactivating (which might trigger commit).
- if (event->type() == eventNames().errorEvent && dontPreventDefault && !m_requestAborted) {
- m_transaction->setError(m_error, m_errorMessage);
- m_transaction->abort(IGNORE_EXCEPTION);
- }
-
- // If this was the last request in the transaction's list, it may commit here.
- if (setTransactionActive)
- m_transaction->setActive(false);
- }
-
- if (cursorToNotify)
- cursorToNotify->postSuccessHandlerCallback();
-
- if (m_readyState == DONE && (!cursorToNotify || m_cursorFinished) && event->type() != eventNames().upgradeneededEvent)
- m_hasPendingActivity = false;
-
- return dontPreventDefault;
-}
-
-void IDBRequest::uncaughtExceptionInEventHandler()
-{
- if (m_transaction && !m_requestAborted) {
- m_transaction->setError(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)), "Uncaught exception in event handler.");
- m_transaction->abort(IGNORE_EXCEPTION);
- }
-}
-
-void IDBRequest::transactionDidFinishAndDispatch()
-{
- ASSERT(m_transaction);
- ASSERT(m_transaction->isVersionChange());
- ASSERT(m_readyState == DONE);
- ASSERT(scriptExecutionContext());
- m_transaction = nullptr;
- m_readyState = PENDING;
-}
-
-void IDBRequest::enqueueEvent(PassRefPtr<Event> event)
-{
- ASSERT(m_readyState == PENDING || m_readyState == DONE);
-
- if (m_contextStopped || !scriptExecutionContext())
- return;
-
- ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().string().utf8().data(), m_readyState);
-
- event->setTarget(this);
-
- if (scriptExecutionContext()->eventQueue().enqueueEvent(event.get()))
- m_enqueuedEvents.append(event);
-}
-
} // namespace WebCore
-#endif
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h
index 0ea7e2f..44fb9e2 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h
@@ -1,29 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBRequest_h
@@ -39,10 +36,7 @@
#include "EventListener.h"
#include "EventTarget.h"
#include "IDBAny.h"
-#include "IDBCallbacks.h"
#include "IDBCursor.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseCallbacks.h"
#include "ScriptWrappable.h"
namespace WebCore {
@@ -51,18 +45,15 @@
typedef int ExceptionCode;
-class IDBRequest : public ScriptWrappable, public IDBCallbacks, public EventTargetWithInlineData, public ActiveDOMObject {
+class IDBRequest : public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
public:
- static Ref<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
- static Ref<IDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType, IDBTransaction*);
- virtual ~IDBRequest();
+ virtual ~IDBRequest() { }
- PassRefPtr<IDBAny> result(ExceptionCode&) const;
- unsigned short errorCode(ExceptionCode&) const;
- PassRefPtr<DOMError> error(ExceptionCode&) const;
- PassRefPtr<IDBAny> source() const;
- PassRefPtr<IDBTransaction> transaction() const;
- void preventPropagation() { m_preventPropagation = true; }
+ virtual PassRefPtr<IDBAny> result(ExceptionCode&) const = 0;
+ virtual unsigned short errorCode(ExceptionCode&) const = 0;
+ virtual PassRefPtr<DOMError> error(ExceptionCode&) const = 0;
+ virtual PassRefPtr<IDBAny> source() const = 0;
+ virtual PassRefPtr<IDBTransaction> transaction() const = 0;
// Defined in the IDL
enum ReadyState {
@@ -71,96 +62,14 @@
EarlyDeath = 3
};
- const String& readyState() const;
-
- void markEarlyDeath();
- void setCursorDetails(IndexedDB::CursorType, IndexedDB::CursorDirection);
- void setPendingCursor(PassRefPtr<IDBCursor>);
- void finishCursor();
- void abort();
-
- // IDBCallbacks
- virtual void onError(PassRefPtr<IDBDatabaseError>) override;
- virtual void onSuccess(PassRefPtr<DOMStringList>) override;
- virtual void onSuccess(PassRefPtr<IDBCursorBackend>) override;
- virtual void onSuccess(PassRefPtr<IDBKey>) override;
- virtual void onSuccess(PassRefPtr<SharedBuffer>) override;
- virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&) override;
- virtual void onSuccess(int64_t) override;
- virtual void onSuccess() override;
- virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>) override;
-
- // EventTarget
- virtual EventTargetInterface eventTargetInterface() const override;
- virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
- virtual void uncaughtExceptionInEventHandler() override final;
-
- using EventTarget::dispatchEvent;
- virtual bool dispatchEvent(PassRefPtr<Event>) override;
-
- void transactionDidFinishAndDispatch();
-
- using RefCounted<IDBCallbacks>::ref;
- using RefCounted<IDBCallbacks>::deref;
-
- IDBDatabaseBackend::TaskType taskType() { return m_taskType; }
-
- DOMRequestState* requestState() { return &m_requestState; }
-
- // ActiveDOMObject API.
- bool hasPendingActivity() const override;
+ virtual const String& readyState() const = 0;
protected:
- IDBRequest(ScriptExecutionContext*, PassRefPtr<IDBAny> source, IDBDatabaseBackend::TaskType, IDBTransaction*);
- void enqueueEvent(PassRefPtr<Event>);
- virtual bool shouldEnqueueEvent() const;
- void onSuccessInternal(PassRefPtr<SerializedScriptValue>);
- void onSuccessInternal(const Deprecated::ScriptValue&);
-
- RefPtr<IDBAny> m_result;
- unsigned short m_errorCode;
- String m_errorMessage;
- RefPtr<DOMError> m_error;
- bool m_contextStopped;
- RefPtr<IDBTransaction> m_transaction;
- ReadyState m_readyState;
- bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
-
-private:
- // ActiveDOMObject API.
- void stop() override;
- const char* activeDOMObjectName() const override;
- bool canSuspendForPageCache() const override;
-
- // EventTarget API.
- virtual void refEventTarget() override final { ref(); }
- virtual void derefEventTarget() override final { deref(); }
-
- RefPtr<IDBCursor> getResultCursor();
- void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue&);
-
- RefPtr<IDBAny> m_source;
- const IDBDatabaseBackend::TaskType m_taskType;
-
- bool m_hasPendingActivity;
- Vector<RefPtr<Event>> m_enqueuedEvents;
-
- // Only used if the result type will be a cursor.
- IndexedDB::CursorType m_cursorType;
- IndexedDB::CursorDirection m_cursorDirection;
- bool m_cursorFinished;
- RefPtr<IDBCursor> m_pendingCursor;
- RefPtr<IDBKey> m_cursorKey;
- RefPtr<IDBKey> m_cursorPrimaryKey;
- Deprecated::ScriptValue m_cursorValue;
- bool m_didFireUpgradeNeededEvent;
- bool m_preventPropagation;
-
- DOMRequestState m_requestState;
+ IDBRequest(ScriptExecutionContext*);
};
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBRequest_h
+#endif // LegacyRequest_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.idl b/Source/WebCore/Modules/indexeddb/IDBRequest.idl
index ef6e2b6..3dbdf8d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.idl
@@ -33,7 +33,8 @@
ActiveDOMObject,
EventTarget,
JSGenerateToJSObject,
- JSGenerateToNativeObject
+ JSGenerateToNativeObject,
+ SkipVTableValidation,
] interface IDBRequest : EventTarget {
[GetterRaisesException] readonly attribute IDBAny result;
[GetterRaisesException] readonly attribute DOMError error;
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index 6ec29fa..5170777 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -28,34 +28,13 @@
#if ENABLE(INDEXED_DATABASE)
-#include "EventException.h"
-#include "EventQueue.h"
-#include "ExceptionCodePlaceholder.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseException.h"
-#include "IDBEventDispatcher.h"
-#include "IDBIndex.h"
-#include "IDBObjectStore.h"
-#include "IDBOpenDBRequest.h"
-#include "IDBPendingTransactionMonitor.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
+#include "ExceptionCode.h"
namespace WebCore {
-Ref<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, IDBDatabase* db)
+IDBTransaction::IDBTransaction(ScriptExecutionContext* context)
+ : ActiveDOMObject(context)
{
- IDBOpenDBRequest* openDBRequest = nullptr;
- Ref<IDBTransaction> transaction(adoptRef(*new IDBTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())));
- transaction->suspendIfNeeded();
- return transaction;
-}
-
-Ref<IDBTransaction> IDBTransaction::create(ScriptExecutionContext* context, int64_t id, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
-{
- Ref<IDBTransaction> transaction(adoptRef(*new IDBTransaction(context, id, Vector<String>(), IndexedDB::TransactionMode::VersionChange, db, openDBRequest, previousMetadata)));
- transaction->suspendIfNeeded();
- return transaction;
}
const AtomicString& IDBTransaction::modeReadOnly()
@@ -88,249 +67,6 @@
return readwrite;
}
-
-IDBTransaction::IDBTransaction(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
- : ActiveDOMObject(context)
- , m_id(id)
- , m_database(db)
- , m_objectStoreNames(objectStoreNames)
- , m_openDBRequest(openDBRequest)
- , m_mode(mode)
- , m_state(Active)
- , m_hasPendingActivity(true)
- , m_contextStopped(false)
- , m_previousMetadata(previousMetadata)
-{
- if (mode == IndexedDB::TransactionMode::VersionChange) {
- // Not active until the callback.
- m_state = Inactive;
- }
-
- // We pass a reference of this object before it can be adopted.
- relaxAdoptionRequirement();
- if (m_state == Active)
- IDBPendingTransactionMonitor::addNewTransaction(this);
- m_database->transactionCreated(this);
-}
-
-IDBTransaction::~IDBTransaction()
-{
- ASSERT(m_state == Finished || m_contextStopped);
- ASSERT(m_requestList.isEmpty() || m_contextStopped);
-}
-
-const String& IDBTransaction::mode() const
-{
- return modeToString(m_mode);
-}
-
-void IDBTransaction::setError(PassRefPtr<DOMError> error, const String& errorMessage)
-{
- ASSERT(m_state != Finished);
- ASSERT(error);
-
- // The first error to be set is the true cause of the
- // transaction abort.
- if (!m_error) {
- m_error = error;
- m_errorMessage = errorMessage;
- }
-}
-
-PassRefPtr<IDBObjectStore> IDBTransaction::objectStore(const String& name, ExceptionCode& ec)
-{
- if (m_state == Finished) {
- ec = IDBDatabaseException::InvalidStateError;
- return 0;
- }
-
- IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
- if (it != m_objectStoreMap.end())
- return it->value;
-
- if (!isVersionChange() && !m_objectStoreNames.contains(name)) {
- ec = IDBDatabaseException::NotFoundError;
- return 0;
- }
-
- int64_t objectStoreId = m_database->findObjectStoreId(name);
- if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
- ASSERT(isVersionChange());
- ec = IDBDatabaseException::NotFoundError;
- return 0;
- }
-
- const IDBDatabaseMetadata& metadata = m_database->metadata();
-
- RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(metadata.objectStores.get(objectStoreId), this);
- objectStoreCreated(name, objectStore);
- return objectStore.release();
-}
-
-void IDBTransaction::objectStoreCreated(const String& name, PassRefPtr<IDBObjectStore> prpObjectStore)
-{
- ASSERT(m_state != Finished);
- RefPtr<IDBObjectStore> objectStore = prpObjectStore;
- m_objectStoreMap.set(name, objectStore);
- if (isVersionChange())
- m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
-}
-
-void IDBTransaction::objectStoreDeleted(const String& name)
-{
- ASSERT(m_state != Finished);
- ASSERT(isVersionChange());
- IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
- if (it != m_objectStoreMap.end()) {
- RefPtr<IDBObjectStore> objectStore = it->value;
- m_objectStoreMap.remove(name);
- objectStore->markDeleted();
- m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
- m_deletedObjectStores.add(objectStore);
- }
-}
-
-void IDBTransaction::setActive(bool active)
-{
- LOG(StorageAPI, "IDBTransaction::setActive(%s) for transaction id %lli", active ? "true" : "false", static_cast<long long>(m_id));
- ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to setActive(%s)", active ? "true" : "false");
- if (m_state == Finishing)
- return;
- ASSERT(active != (m_state == Active));
- m_state = active ? Active : Inactive;
-
- if (!active && m_requestList.isEmpty())
- backendDB()->commit(m_id);
-}
-
-void IDBTransaction::abort(ExceptionCode& ec)
-{
- if (m_state == Finishing || m_state == Finished) {
- ec = IDBDatabaseException::InvalidStateError;
- return;
- }
-
- m_state = Finishing;
-
- while (!m_requestList.isEmpty()) {
- RefPtr<IDBRequest> request = *m_requestList.begin();
- m_requestList.remove(request);
- request->abort();
- }
-
- RefPtr<IDBTransaction> selfRef = this;
- backendDB()->abort(m_id);
-}
-
-IDBTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<IDBTransaction> transaction, IDBCursor* cursor)
- : m_transaction(transaction),
- m_cursor(cursor)
-{
- m_transaction->registerOpenCursor(m_cursor);
-}
-
-IDBTransaction::OpenCursorNotifier::~OpenCursorNotifier()
-{
- if (m_cursor)
- m_transaction->unregisterOpenCursor(m_cursor);
-}
-
-void IDBTransaction::OpenCursorNotifier::cursorFinished()
-{
- if (m_cursor) {
- m_transaction->unregisterOpenCursor(m_cursor);
- m_cursor = nullptr;
- m_transaction = nullptr;
- }
-}
-
-void IDBTransaction::registerOpenCursor(IDBCursor* cursor)
-{
- m_openCursors.add(cursor);
-}
-
-void IDBTransaction::unregisterOpenCursor(IDBCursor* cursor)
-{
- m_openCursors.remove(cursor);
-}
-
-void IDBTransaction::closeOpenCursors()
-{
- HashSet<IDBCursor*> cursors;
- cursors.swap(m_openCursors);
- for (auto& cursor : cursors)
- cursor->close();
-}
-
-void IDBTransaction::registerRequest(IDBRequest* request)
-{
- ASSERT(request);
- ASSERT(m_state == Active);
- m_requestList.add(request);
-}
-
-void IDBTransaction::unregisterRequest(IDBRequest* request)
-{
- ASSERT(request);
- // If we aborted the request, it will already have been removed.
- m_requestList.remove(request);
-}
-
-void IDBTransaction::onAbort(PassRefPtr<IDBDatabaseError> prpError)
-{
- LOG(StorageAPI, "IDBTransaction::onAbort");
- RefPtr<IDBDatabaseError> error = prpError;
- ASSERT(m_state != Finished);
-
- if (m_state != Finishing) {
- ASSERT(error.get());
- setError(DOMError::create(error->name()), error->message());
-
- // Abort was not triggered by front-end, so outstanding requests must
- // be aborted now.
- while (!m_requestList.isEmpty()) {
- RefPtr<IDBRequest> request = *m_requestList.begin();
- m_requestList.remove(request);
- request->abort();
- }
- m_state = Finishing;
- }
-
- if (isVersionChange()) {
- for (auto& objectStore : m_objectStoreCleanupMap)
- objectStore.key->setMetadata(objectStore.value);
- m_database->setMetadata(m_previousMetadata);
- m_database->close();
- }
- m_objectStoreCleanupMap.clear();
- closeOpenCursors();
-
- // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
- enqueueEvent(Event::create(eventNames().abortEvent, true, false));
- m_database->transactionFinished(this);
-}
-
-void IDBTransaction::onComplete()
-{
- LOG(StorageAPI, "IDBTransaction::onComplete");
- ASSERT(m_state != Finished);
- m_state = Finishing;
- m_objectStoreCleanupMap.clear();
- closeOpenCursors();
-
- // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
- enqueueEvent(Event::create(eventNames().completeEvent, false, false));
- m_database->transactionFinished(this);
-}
-
-bool IDBTransaction::hasPendingActivity() const
-{
- // FIXME: In an ideal world, we should return true as long as anyone has a or can
- // get a handle to us or any child request object and any of those have
- // event listeners. This is in order to handle user generated events properly.
- return m_hasPendingActivity && !m_contextStopped;
-}
-
IndexedDB::TransactionMode IDBTransaction::stringToMode(const String& modeString, ExceptionCode& ec)
{
if (modeString.isNull()
@@ -360,74 +96,6 @@
return IDBTransaction::modeReadOnly();
}
-bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event)
-{
- LOG(StorageAPI, "IDBTransaction::dispatchEvent");
- ASSERT(m_state != Finished);
- ASSERT(m_hasPendingActivity);
- ASSERT(scriptExecutionContext());
- ASSERT(event->target() == this);
- m_state = Finished;
-
- // Break reference cycles.
- for (auto& objectStore : m_objectStoreMap)
- objectStore.value->transactionFinished();
- m_objectStoreMap.clear();
- for (auto& objectStore : m_deletedObjectStores)
- objectStore->transactionFinished();
- m_deletedObjectStores.clear();
-
- Vector<RefPtr<EventTarget>> targets;
- targets.append(this);
- targets.append(db());
-
- // FIXME: When we allow custom event dispatching, this will probably need to change.
- ASSERT(event->type() == eventNames().completeEvent || event->type() == eventNames().abortEvent);
- bool returnValue = IDBEventDispatcher::dispatch(event.get(), targets);
- // FIXME: Try to construct a test where |this| outlives openDBRequest and we
- // get a crash.
- if (m_openDBRequest) {
- ASSERT(isVersionChange());
- m_openDBRequest->transactionDidFinishAndDispatch();
- }
- m_hasPendingActivity = false;
- return returnValue;
-}
-
-bool IDBTransaction::canSuspendForPageCache() const
-{
- // FIXME: Technically we can suspend before the first request is schedule
- // and after the complete/abort event is enqueued.
- return m_state == Finished;
-}
-
-void IDBTransaction::stop()
-{
- m_contextStopped = true;
-
- abort(IGNORE_EXCEPTION);
-}
-
-const char* IDBTransaction::activeDOMObjectName() const
-{
- return "IDBTransaction";
-}
-
-void IDBTransaction::enqueueEvent(PassRefPtr<Event> event)
-{
- ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().string().utf8().data());
- if (m_contextStopped || !scriptExecutionContext())
- return;
-
- event->setTarget(this);
- scriptExecutionContext()->eventQueue().enqueueEvent(event);
-}
-
-IDBDatabaseBackend* IDBTransaction::backendDB() const
-{
- return db()->backend();
-}
-
-}
+} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 9f34314..0588dd1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBTransaction_h
@@ -29,11 +29,7 @@
#if ENABLE(INDEXED_DATABASE)
#include "ActiveDOMObject.h"
-#include "DOMError.h"
-#include "Event.h"
-#include "EventListener.h"
#include "EventTarget.h"
-#include "IDBDatabaseMetadata.h"
#include "IndexedDB.h"
#include "ScriptWrappable.h"
#include <wtf/HashSet.h>
@@ -41,6 +37,7 @@
namespace WebCore {
+class DOMError;
class IDBCursor;
class IDBDatabase;
class IDBDatabaseBackend;
@@ -49,11 +46,9 @@
class IDBOpenDBRequest;
struct IDBObjectStoreMetadata;
-class IDBTransaction final : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
+class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
public:
- static Ref<IDBTransaction> create(ScriptExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*);
- static Ref<IDBTransaction> create(ScriptExecutionContext*, int64_t, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
- virtual ~IDBTransaction();
+ virtual ~IDBTransaction() { }
static const AtomicString& modeReadOnly();
static const AtomicString& modeReadWrite();
@@ -64,103 +59,18 @@
static IndexedDB::TransactionMode stringToMode(const String&, ExceptionCode&);
static const AtomicString& modeToString(IndexedDB::TransactionMode);
- IDBDatabaseBackend* backendDB() const;
-
- int64_t id() const { return m_id; }
- bool isActive() const { return m_state == Active; }
- bool isFinished() const { return m_state == Finished; }
- bool isReadOnly() const { return m_mode == IndexedDB::TransactionMode::ReadOnly; }
- bool isVersionChange() const { return m_mode == IndexedDB::TransactionMode::VersionChange; }
-
// Implement the IDBTransaction IDL
- const String& mode() const;
- IDBDatabase* db() const { return m_database.get(); }
- PassRefPtr<DOMError> error() const { return m_error; }
- PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&);
- void abort(ExceptionCode&);
-
- class OpenCursorNotifier {
- public:
- OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*);
- ~OpenCursorNotifier();
- void cursorFinished();
- private:
- RefPtr<IDBTransaction> m_transaction;
- IDBCursor* m_cursor;
- };
-
- void registerRequest(IDBRequest*);
- void unregisterRequest(IDBRequest*);
- void objectStoreCreated(const String&, PassRefPtr<IDBObjectStore>);
- void objectStoreDeleted(const String&);
- void setActive(bool);
- void setError(PassRefPtr<DOMError>, const String& errorMessage);
-
- void onAbort(PassRefPtr<IDBDatabaseError>);
- void onComplete();
-
- // EventTarget
- virtual EventTargetInterface eventTargetInterface() const override { return IDBTransactionEventTargetInterfaceType; }
- virtual ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
-
- using EventTarget::dispatchEvent;
- virtual bool dispatchEvent(PassRefPtr<Event>) override;
-
- // ActiveDOMObject
- bool hasPendingActivity() const override;
+ virtual const String& mode() const = 0;
+ virtual IDBDatabase* db() const = 0;
+ virtual PassRefPtr<DOMError> error() const = 0;
+ virtual PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&) = 0;
+ virtual void abort(ExceptionCode&) = 0;
using RefCounted<IDBTransaction>::ref;
using RefCounted<IDBTransaction>::deref;
-private:
- IDBTransaction(ScriptExecutionContext*, int64_t, const Vector<String>&, IndexedDB::TransactionMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&);
-
- void enqueueEvent(PassRefPtr<Event>);
- void closeOpenCursors();
-
- void registerOpenCursor(IDBCursor*);
- void unregisterOpenCursor(IDBCursor*);
-
- // ActiveDOMObject API.
- bool canSuspendForPageCache() const override;
- void stop() override;
- const char* activeDOMObjectName() const override;
-
- // EventTarget API.
- virtual void refEventTarget() override { ref(); }
- virtual void derefEventTarget() override { deref(); }
-
- enum State {
- Inactive, // Created or started, but not in an event callback
- Active, // Created or started, in creation scope or an event callback
- Finishing, // In the process of aborting or completing.
- Finished, // No more events will fire and no new requests may be filed.
- };
-
- int64_t m_id;
- RefPtr<IDBDatabase> m_database;
- const Vector<String> m_objectStoreNames;
- IDBOpenDBRequest* m_openDBRequest;
- const IndexedDB::TransactionMode m_mode;
- State m_state;
- bool m_hasPendingActivity;
- bool m_contextStopped;
- RefPtr<DOMError> m_error;
- String m_errorMessage;
-
- ListHashSet<RefPtr<IDBRequest>> m_requestList;
-
- typedef HashMap<String, RefPtr<IDBObjectStore>> IDBObjectStoreMap;
- IDBObjectStoreMap m_objectStoreMap;
-
- typedef HashSet<RefPtr<IDBObjectStore>> IDBObjectStoreSet;
- IDBObjectStoreSet m_deletedObjectStores;
-
- typedef HashMap<RefPtr<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjectStoreMetadataMap;
- IDBObjectStoreMetadataMap m_objectStoreCleanupMap;
- IDBDatabaseMetadata m_previousMetadata;
-
- HashSet<IDBCursor*> m_openCursors;
+protected:
+ IDBTransaction(ScriptExecutionContext*);
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.idl b/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
index eb62871..cc89c50 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
@@ -31,6 +31,7 @@
JSGenerateToJSObject,
JSGenerateToNativeObject,
EnabledAtRuntime=IndexedDB,
+ SkipVTableValidation,
] interface IDBTransaction : EventTarget {
readonly attribute DOMString mode;
readonly attribute IDBDatabase db;
diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
index d133c6d..4d464cf 100644
--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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"
@@ -30,22 +30,11 @@
namespace WebCore {
-IDBVersionChangeEvent::IDBVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType)
- : Event(eventType, false /*canBubble*/, false /*cancelable*/)
- , m_oldVersion(oldVersion)
- , m_newVersion(newVersion)
+IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& name)
+ : Event(name, false /*canBubble*/, false /*cancelable*/)
{
}
-IDBVersionChangeEvent::~IDBVersionChangeEvent()
-{
-}
-
-EventInterface IDBVersionChangeEvent::eventInterface() const
-{
- return IDBVersionChangeEventInterfaceType;
-}
-
} // namespace WebCore
-#endif
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
index dbad5cd..1299e37 100644
--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
@@ -1,26 +1,26 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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.
*
- * 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 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
*/
#ifndef IDBVersionChangeEvent_h
@@ -29,7 +29,6 @@
#if ENABLE(INDEXED_DATABASE)
#include "Event.h"
-#include "IndexedDB.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
@@ -38,23 +37,13 @@
class IDBVersionChangeEvent : public Event {
public:
- static Ref<IDBVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, const AtomicString& eventType = AtomicString())
- {
- return adoptRef(*new IDBVersionChangeEvent(oldVersion, newVersion, eventType));
- }
+ virtual ~IDBVersionChangeEvent() { }
- virtual ~IDBVersionChangeEvent();
+ virtual uint64_t oldVersion() const = 0;
+ virtual uint64_t newVersion() const = 0;
- virtual unsigned long long oldVersion() { return m_oldVersion; }
- virtual unsigned long long newVersion() { return m_newVersion; }
-
- virtual EventInterface eventInterface() const;
-
-private:
- IDBVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType);
-
- unsigned long long m_oldVersion;
- unsigned long long m_newVersion;
+protected:
+ IDBVersionChangeEvent(const AtomicString&);
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCallbacks.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBCallbacks.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBCallbacks.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.cpp
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.cpp
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
similarity index 99%
rename from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
index cda1697..5f8a5fe 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
@@ -27,10 +27,9 @@
#include "config.h"
#include "IDBCursorBackendOperations.h"
-#include "IDBServerConnection.h"
-
#if ENABLE(INDEXED_DATABASE)
+#include "IDBServerConnection.h"
#include "Logging.h"
namespace WebCore {
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.cpp
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.cpp
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h
similarity index 96%
rename from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h
index 70e91c2..75c0ea5 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h
@@ -35,7 +35,7 @@
namespace WebCore {
-class IDBDatabase;
+class LegacyDatabase;
class IDBDatabaseCallbacks : public RefCounted<IDBDatabaseCallbacks> {
public:
@@ -47,7 +47,7 @@
virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) = 0;
virtual void onComplete(int64_t transactionId) = 0;
- virtual void connect(IDBDatabase*) = 0;
+ virtual void connect(LegacyDatabase*) = 0;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
similarity index 96%
rename from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
index db43856..f63ddeb 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
@@ -28,7 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBDatabase.h"
+#include "LegacyDatabase.h"
namespace WebCore {
@@ -58,7 +58,7 @@
m_database->onVersionChange(oldVersion, newVersion);
}
-void IDBDatabaseCallbacksImpl::connect(IDBDatabase* database)
+void IDBDatabaseCallbacksImpl::connect(LegacyDatabase* database)
{
ASSERT(!m_database);
ASSERT(database);
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h
similarity index 95%
rename from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h
index 56c802b..5d3b0cb 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h
@@ -34,7 +34,7 @@
namespace WebCore {
-class IDBDatabase;
+class LegacyDatabase;
class IDBDatabaseCallbacksImpl final : public IDBDatabaseCallbacks {
public:
@@ -48,13 +48,13 @@
virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) override;
virtual void onComplete(int64_t transactionId) override;
- virtual void connect(IDBDatabase*) override;
+ virtual void connect(LegacyDatabase*) override;
private:
IDBDatabaseCallbacksImpl();
// The initial IDBOpenDBRequest or final IDBDatabase maintains a RefPtr to this
- IDBDatabase* m_database;
+ LegacyDatabase* m_database;
};
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h b/Source/WebCore/Modules/indexeddb/legacy/IDBFactoryBackendInterface.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBFactoryBackendInterface.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingDeleteCall.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBPendingDeleteCall.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingOpenCall.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBPendingOpenCall.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
similarity index 93%
rename from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
index 2f73d3f..e9d6601 100644
--- a/Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
@@ -25,7 +25,8 @@
#include "config.h"
#include "IDBPendingTransactionMonitor.h"
-#include "IDBTransaction.h"
+
+#include "LegacyTransaction.h"
#include <mutex>
#include <wtf/ThreadSpecific.h>
@@ -35,7 +36,7 @@
namespace WebCore {
-typedef Vector<RefPtr<IDBTransaction>> TransactionList;
+typedef Vector<RefPtr<LegacyTransaction>> TransactionList;
static ThreadSpecific<TransactionList>& transactions()
{
@@ -43,14 +44,14 @@
// thread-local storage.
static std::once_flag onceFlag;
static ThreadSpecific<TransactionList>* transactions;
- std::call_once(onceFlag, []{
+ std::call_once(onceFlag, [] {
transactions = new ThreadSpecific<TransactionList>;
});
return *transactions;
}
-void IDBPendingTransactionMonitor::addNewTransaction(PassRefPtr<IDBTransaction> transaction)
+void IDBPendingTransactionMonitor::addNewTransaction(PassRefPtr<LegacyTransaction> transaction)
{
transactions()->append(transaction);
}
diff --git a/Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h
similarity index 95%
rename from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h
index fef55fe..73fe273 100644
--- a/Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h
+++ b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h
@@ -33,7 +33,7 @@
namespace WebCore {
-class IDBTransaction;
+class LegacyTransaction;
// This class keeps track of the transactions created during the current
// Javascript execution context. Transactions have an internal |active| flag
@@ -43,7 +43,7 @@
class IDBPendingTransactionMonitor {
WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor);
public:
- static void addNewTransaction(PassRefPtr<IDBTransaction>);
+ static void addNewTransaction(PassRefPtr<LegacyTransaction>);
static void deactivateNewTransactions();
private:
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.cpp
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.cpp
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.h
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.h
similarity index 100%
rename from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h
rename to Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp
new file mode 100644
index 0000000..22e89af
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp
@@ -0,0 +1,261 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyAny.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DOMStringList.h"
+#include "IDBKeyPath.h"
+#include "LegacyCursorWithValue.h"
+#include "LegacyDatabase.h"
+#include "LegacyFactory.h"
+#include "LegacyIndex.h"
+#include "LegacyObjectStore.h"
+
+namespace WebCore {
+
+PassRefPtr<LegacyAny> LegacyAny::createInvalid()
+{
+ return adoptRef(new LegacyAny(UndefinedType));
+}
+
+PassRefPtr<LegacyAny> LegacyAny::createNull()
+{
+ return adoptRef(new LegacyAny(NullType));
+}
+
+PassRefPtr<LegacyAny> LegacyAny::createString(const String& value)
+{
+ return adoptRef(new LegacyAny(value));
+}
+
+LegacyAny::LegacyAny(Type type)
+ : m_type(type)
+ , m_integer(0)
+{
+ ASSERT(type == UndefinedType || type == NullType);
+}
+
+LegacyAny::~LegacyAny()
+{
+}
+
+PassRefPtr<DOMStringList> LegacyAny::domStringList()
+{
+ ASSERT(m_type == DOMStringListType);
+ return m_domStringList;
+}
+
+PassRefPtr<IDBCursor> LegacyAny::idbCursor()
+{
+ ASSERT(m_type == IDBCursorType);
+ return m_idbCursor;
+}
+
+PassRefPtr<IDBCursorWithValue> LegacyAny::idbCursorWithValue()
+{
+ ASSERT(m_type == IDBCursorWithValueType);
+ return m_idbCursorWithValue;
+}
+
+PassRefPtr<IDBDatabase> LegacyAny::idbDatabase()
+{
+ ASSERT(m_type == IDBDatabaseType);
+ return m_idbDatabase;
+}
+
+PassRefPtr<IDBFactory> LegacyAny::idbFactory()
+{
+ ASSERT(m_type == IDBFactoryType);
+ return m_idbFactory;
+}
+
+PassRefPtr<IDBIndex> LegacyAny::idbIndex()
+{
+ ASSERT(m_type == IDBIndexType);
+ return m_idbIndex;
+}
+
+PassRefPtr<IDBObjectStore> LegacyAny::idbObjectStore()
+{
+ ASSERT(m_type == IDBObjectStoreType);
+ return m_idbObjectStore;
+}
+
+PassRefPtr<IDBTransaction> LegacyAny::idbTransaction()
+{
+ ASSERT(m_type == IDBTransactionType);
+ return m_idbTransaction;
+}
+
+const Deprecated::ScriptValue& LegacyAny::scriptValue()
+{
+ ASSERT(m_type == ScriptValueType);
+ return m_scriptValue;
+}
+
+const String& LegacyAny::string()
+{
+ ASSERT(m_type == StringType);
+ return m_string;
+}
+
+int64_t LegacyAny::integer()
+{
+ ASSERT(m_type == IntegerType);
+ return m_integer;
+}
+
+LegacyAny::LegacyAny(PassRefPtr<DOMStringList> value)
+ : m_type(DOMStringListType)
+ , m_domStringList(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyCursorWithValue> value)
+ : m_type(IDBCursorWithValueType)
+ , m_idbCursorWithValue(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyCursor> value)
+ : m_type(IDBCursorType)
+ , m_idbCursor(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyDatabase> value)
+ : m_type(IDBDatabaseType)
+ , m_idbDatabase(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyFactory> value)
+ : m_type(IDBFactoryType)
+ , m_idbFactory(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyIndex> value)
+ : m_type(IDBIndexType)
+ , m_idbIndex(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyTransaction> value)
+ : m_type(IDBTransactionType)
+ , m_idbTransaction(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(PassRefPtr<LegacyObjectStore> value)
+ : m_type(IDBObjectStoreType)
+ , m_idbObjectStore(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(const Deprecated::ScriptValue& value)
+ : m_type(ScriptValueType)
+ , m_scriptValue(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(const IDBKeyPath& value)
+ : m_type(KeyPathType)
+ , m_idbKeyPath(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(const String& value)
+ : m_type(StringType)
+ , m_string(value)
+ , m_integer(0)
+{
+}
+
+LegacyAny::LegacyAny(int64_t value)
+ : m_type(IntegerType)
+ , m_integer(value)
+{
+}
+
+LegacyCursor* LegacyAny::legacyCursor()
+{
+ ASSERT(m_type == IDBCursorType);
+ return m_idbCursor.get();
+}
+
+LegacyCursorWithValue* LegacyAny::legacyCursorWithValue()
+{
+ ASSERT(m_type == IDBCursorWithValueType);
+ return m_idbCursorWithValue.get();
+}
+
+LegacyDatabase* LegacyAny::legacyDatabase()
+{
+ ASSERT(m_type == IDBDatabaseType);
+ return m_idbDatabase.get();
+}
+
+LegacyFactory* LegacyAny::legacyFactory()
+{
+ ASSERT(m_type == IDBFactoryType);
+ return m_idbFactory.get();
+}
+
+LegacyIndex* LegacyAny::legacyIndex()
+{
+ ASSERT(m_type == IDBIndexType);
+ return m_idbIndex.get();
+}
+
+LegacyObjectStore* LegacyAny::legacyObjectStore()
+{
+ ASSERT(m_type == IDBObjectStoreType);
+ return m_idbObjectStore.get();
+}
+
+LegacyTransaction* LegacyAny::legacyTransaction()
+{
+ ASSERT(m_type == IDBTransactionType);
+ return m_idbTransaction.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h
new file mode 100644
index 0000000..9f6ab05
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ *
+ * 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 LegacyAny_h
+#define LegacyAny_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBAny.h"
+#include "IDBKeyPath.h"
+#include "ScriptWrappable.h"
+#include <bindings/ScriptValue.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DOMStringList;
+class IDBCursor;
+class IDBCursorWithValue;
+class IDBDatabase;
+class IDBFactory;
+class IDBIndex;
+class IDBKeyPath;
+class IDBObjectStore;
+class IDBTransaction;
+
+class LegacyCursor;
+class LegacyCursorWithValue;
+class LegacyDatabase;
+class LegacyFactory;
+class LegacyIndex;
+class LegacyObjectStore;
+class LegacyTransaction;
+
+class LegacyAny : public IDBAny {
+public:
+ static PassRefPtr<LegacyAny> createInvalid();
+ static PassRefPtr<LegacyAny> createNull();
+ static PassRefPtr<LegacyAny> createString(const String&);
+ template<typename T>
+ static PassRefPtr<LegacyAny> create(T* idbObject)
+ {
+ return adoptRef(new LegacyAny(idbObject));
+ }
+ template<typename T>
+ static PassRefPtr<LegacyAny> create(const T& idbObject)
+ {
+ return adoptRef(new LegacyAny(idbObject));
+ }
+ template<typename T>
+ static PassRefPtr<LegacyAny> create(PassRefPtr<T> idbObject)
+ {
+ return adoptRef(new LegacyAny(idbObject));
+ }
+ static PassRefPtr<LegacyAny> create(int64_t value)
+ {
+ return adoptRef(new LegacyAny(value));
+ }
+ ~LegacyAny();
+
+ virtual Type type() const override final { return m_type; }
+ // Use type() to figure out which one of these you're allowed to call.
+ virtual PassRefPtr<DOMStringList> domStringList() override final;
+ virtual PassRefPtr<IDBCursor> idbCursor() override final;
+ virtual PassRefPtr<IDBCursorWithValue> idbCursorWithValue() override final;
+ virtual PassRefPtr<IDBDatabase> idbDatabase() override final;
+ virtual PassRefPtr<IDBFactory> idbFactory() override final;
+ virtual PassRefPtr<IDBIndex> idbIndex() override final;
+ virtual PassRefPtr<IDBObjectStore> idbObjectStore() override final;
+ virtual PassRefPtr<IDBTransaction> idbTransaction() override final;
+ virtual const Deprecated::ScriptValue& scriptValue() override final;
+ virtual int64_t integer() override final;
+ virtual const String& string() override final;
+ virtual const IDBKeyPath& keyPath() override final { return m_idbKeyPath; };
+
+ LegacyCursor* legacyCursor();
+ LegacyCursorWithValue* legacyCursorWithValue();
+ LegacyDatabase* legacyDatabase();
+ LegacyFactory* legacyFactory();
+ LegacyIndex* legacyIndex();
+ LegacyObjectStore* legacyObjectStore();
+ LegacyTransaction* legacyTransaction();
+
+private:
+ explicit LegacyAny(Type);
+ explicit LegacyAny(PassRefPtr<DOMStringList>);
+ explicit LegacyAny(PassRefPtr<LegacyCursor>);
+ explicit LegacyAny(PassRefPtr<LegacyCursorWithValue>);
+ explicit LegacyAny(PassRefPtr<LegacyDatabase>);
+ explicit LegacyAny(PassRefPtr<LegacyFactory>);
+ explicit LegacyAny(PassRefPtr<LegacyIndex>);
+ explicit LegacyAny(PassRefPtr<LegacyObjectStore>);
+ explicit LegacyAny(PassRefPtr<LegacyTransaction>);
+ explicit LegacyAny(const IDBKeyPath&);
+ explicit LegacyAny(const String&);
+ explicit LegacyAny(const Deprecated::ScriptValue&);
+ explicit LegacyAny(int64_t);
+
+ const Type m_type;
+
+ // Only one of the following should ever be in use at any given time.
+ const RefPtr<DOMStringList> m_domStringList;
+ const RefPtr<LegacyCursor> m_idbCursor;
+ const RefPtr<LegacyCursorWithValue> m_idbCursorWithValue;
+ const RefPtr<LegacyDatabase> m_idbDatabase;
+ const RefPtr<LegacyFactory> m_idbFactory;
+ const RefPtr<LegacyIndex> m_idbIndex;
+ const RefPtr<LegacyObjectStore> m_idbObjectStore;
+ const RefPtr<LegacyTransaction> m_idbTransaction;
+ const IDBKeyPath m_idbKeyPath;
+ const Deprecated::ScriptValue m_scriptValue;
+ const String m_string;
+ const int64_t m_integer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // LegacyAny_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp
new file mode 100644
index 0000000..f0e955d
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp
@@ -0,0 +1,277 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyCursor.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBAny.h"
+#include "IDBBindingUtilities.h"
+#include "IDBCallbacks.h"
+#include "IDBCursorBackend.h"
+#include "IDBKey.h"
+#include "IDBObjectStore.h"
+#include "IDBTransaction.h"
+#include "LegacyRequest.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+#include <inspector/ScriptCallStack.h>
+#include <limits>
+
+namespace WebCore {
+
+Ref<LegacyCursor> LegacyCursor::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
+{
+ return adoptRef(*new LegacyCursor(backend, direction, request, source, transaction));
+}
+
+LegacyCursor::LegacyCursor(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
+ : m_backend(backend)
+ , m_request(request)
+ , m_direction(direction)
+ , m_source(source)
+ , m_transaction(transaction)
+ , m_transactionNotifier(transaction, this)
+ , m_gotValue(false)
+{
+ ASSERT(m_backend);
+ ASSERT(m_request);
+ ASSERT(m_source->type() == IDBAny::IDBObjectStoreType || m_source->type() == IDBAny::IDBIndexType);
+ ASSERT(m_transaction);
+}
+
+LegacyCursor::~LegacyCursor()
+{
+}
+
+const String& LegacyCursor::direction() const
+{
+ LOG(StorageAPI, "LegacyCursor::direction");
+ return directionToString(m_direction);
+}
+
+const Deprecated::ScriptValue& LegacyCursor::key() const
+{
+ LOG(StorageAPI, "LegacyCursor::key");
+ return m_currentKeyValue;
+}
+
+const Deprecated::ScriptValue& LegacyCursor::primaryKey() const
+{
+ LOG(StorageAPI, "LegacyCursor::primaryKey");
+ return m_currentPrimaryKeyValue;
+}
+
+const Deprecated::ScriptValue& LegacyCursor::value() const
+{
+ LOG(StorageAPI, "LegacyCursor::value");
+ return m_currentValue;
+}
+
+IDBAny* LegacyCursor::source() const
+{
+ return m_source.get();
+}
+
+PassRefPtr<IDBRequest> LegacyCursor::update(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyCursor::update");
+
+ if (!m_gotValue || isKeyCursor()) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::ReadOnlyError;
+ return 0;
+ }
+
+ RefPtr<LegacyObjectStore> objectStore = effectiveObjectStore();
+ const IDBKeyPath& keyPath = objectStore->metadata().keyPath;
+ const bool usesInLineKeys = !keyPath.isNull();
+ if (usesInLineKeys) {
+ RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, keyPath);
+ if (!keyPathKey || !keyPathKey->isEqual(m_currentPrimaryKey.get())) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+ }
+
+ return objectStore->put(IDBDatabaseBackend::CursorUpdate, LegacyAny::create(this), state, value, m_currentPrimaryKey, ec);
+}
+
+void LegacyCursor::advance(unsigned long count, ExceptionCode& ec)
+{
+ ec = 0;
+ LOG(StorageAPI, "LegacyCursor::advance");
+ if (!m_gotValue) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return;
+ }
+
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return;
+ }
+
+ if (!count) {
+ ec = TypeError;
+ return;
+ }
+
+ m_request->setPendingCursor(this);
+ m_gotValue = false;
+ m_backend->advance(count, m_request, ec);
+ ASSERT(!ec);
+}
+
+void LegacyCursor::continueFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
+{
+ DOMRequestState requestState(context);
+ RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
+ continueFunction(key.release(), ec);
+}
+
+void LegacyCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec)
+{
+ ec = 0;
+ LOG(StorageAPI, "LegacyCursor::continue");
+ if (key && !key->isValid()) {
+ ec = IDBDatabaseException::DataError;
+ return;
+ }
+
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return;
+ }
+
+ if (!m_gotValue) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return;
+ }
+
+ if (key) {
+ ASSERT(m_currentKey);
+ if (m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::NextNoDuplicate) {
+ if (!m_currentKey->isLessThan(key.get())) {
+ ec = IDBDatabaseException::DataError;
+ return;
+ }
+ } else {
+ if (!key->isLessThan(m_currentKey.get())) {
+ ec = IDBDatabaseException::DataError;
+ return;
+ }
+ }
+ }
+
+ // FIXME: We're not using the context from when continue was called, which means the callback
+ // will be on the original context openCursor was called on. Is this right?
+ m_request->setPendingCursor(this);
+ m_gotValue = false;
+ m_backend->continueFunction(key, m_request, ec);
+ ASSERT(!ec);
+}
+
+PassRefPtr<IDBRequest> LegacyCursor::deleteFunction(ScriptExecutionContext* context, ExceptionCode& ec)
+{
+ ec = 0;
+ LOG(StorageAPI, "LegacyCursor::delete");
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::ReadOnlyError;
+ return 0;
+ }
+
+ if (!m_gotValue || isKeyCursor()) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ m_backend->deleteFunction(request, ec);
+ ASSERT(!ec);
+ return request.release();
+}
+
+void LegacyCursor::postSuccessHandlerCallback()
+{
+ m_backend->postSuccessHandlerCallback();
+}
+
+void LegacyCursor::close()
+{
+ m_transactionNotifier.cursorFinished();
+ if (m_request) {
+ m_request->finishCursor();
+ m_request = nullptr;
+ }
+}
+
+void LegacyCursor::setValueReady(DOMRequestState* state, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue& value)
+{
+ m_currentKey = key;
+ m_currentKeyValue = idbKeyToScriptValue(state, m_currentKey);
+
+ m_currentPrimaryKey = primaryKey;
+ m_currentPrimaryKeyValue = idbKeyToScriptValue(state, m_currentPrimaryKey);
+
+ if (!isKeyCursor()) {
+ RefPtr<LegacyObjectStore> objectStore = effectiveObjectStore();
+ const IDBObjectStoreMetadata metadata = objectStore->metadata();
+ if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
+#ifndef NDEBUG
+ RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, metadata.keyPath);
+ ASSERT(!expectedKey || expectedKey->isEqual(m_currentPrimaryKey.get()));
+#endif
+ bool injected = injectIDBKeyIntoScriptValue(m_request->requestState(), m_currentPrimaryKey, value, metadata.keyPath);
+ // FIXME: There is no way to report errors here. Move this into onSuccessWithContinuation so that we can abort the transaction there. See: https://bugs.webkit.org/show_bug.cgi?id=92278
+ ASSERT_UNUSED(injected, injected);
+ }
+ }
+ m_currentValue = value;
+
+ m_gotValue = true;
+}
+
+PassRefPtr<LegacyObjectStore> LegacyCursor::effectiveObjectStore()
+{
+ if (m_source->type() == IDBAny::IDBObjectStoreType)
+ return m_source->legacyObjectStore();
+ RefPtr<LegacyIndex> index = m_source->legacyIndex();
+ return index->legacyObjectStore();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h
new file mode 100644
index 0000000..e1dbb32
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ *
+ * 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 LegacyCursor_h
+#define LegacyCursor_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBCursorWithValue.h"
+#include "IDBKey.h"
+#include "IndexedDB.h"
+#include "LegacyObjectStore.h"
+#include "LegacyTransaction.h"
+#include "ScriptWrappable.h"
+#include <bindings/ScriptValue.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class DOMRequestState;
+class IDBAny;
+class IDBCallbacks;
+class IDBCursorBackend;
+class LegacyRequest;
+class ScriptExecutionContext;
+
+typedef int ExceptionCode;
+
+class LegacyCursor : public IDBCursorWithValue {
+public:
+ static Ref<LegacyCursor> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
+ virtual ~LegacyCursor();
+
+ // Implement the IDL
+ const String& direction() const;
+ const Deprecated::ScriptValue& key() const;
+ const Deprecated::ScriptValue& primaryKey() const;
+ const Deprecated::ScriptValue& value() const;
+ IDBAny* source() const;
+
+ PassRefPtr<IDBRequest> update(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
+ void advance(unsigned long, ExceptionCode&);
+ // FIXME: Try to modify the code generator so this overload is unneeded.
+ void continueFunction(ScriptExecutionContext*, ExceptionCode& ec) { continueFunction(static_cast<IDBKey*>(nullptr), ec); }
+ void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, ExceptionCode&);
+
+ void continueFunction(PassRefPtr<IDBKey>, ExceptionCode&);
+ void postSuccessHandlerCallback();
+ void close();
+ void setValueReady(DOMRequestState*, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue&);
+ PassRefPtr<IDBKey> idbPrimaryKey() { return m_currentPrimaryKey; }
+
+protected:
+ LegacyCursor(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
+ virtual bool isKeyCursor() const { return true; }
+
+private:
+ PassRefPtr<LegacyObjectStore> effectiveObjectStore();
+
+ RefPtr<IDBCursorBackend> m_backend;
+ RefPtr<LegacyRequest> m_request;
+ const IndexedDB::CursorDirection m_direction;
+ RefPtr<LegacyAny> m_source;
+ RefPtr<LegacyTransaction> m_transaction;
+ LegacyTransaction::OpenCursorNotifier m_transactionNotifier;
+ bool m_gotValue;
+ // These values are held because m_backend may advance while they
+ // are still valid for the current success handlers.
+ Deprecated::ScriptValue m_currentKeyValue;
+ Deprecated::ScriptValue m_currentPrimaryKeyValue;
+ RefPtr<IDBKey> m_currentKey;
+ RefPtr<IDBKey> m_currentPrimaryKey;
+ Deprecated::ScriptValue m_currentValue;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // LegacyCursor_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp
new file mode 100644
index 0000000..31cd11d
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 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 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 "LegacyCursorWithValue.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBCursorBackend.h"
+#include "IDBKey.h"
+
+namespace WebCore {
+
+PassRefPtr<LegacyCursorWithValue> LegacyCursorWithValue::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
+{
+ return adoptRef(new LegacyCursorWithValue(backend, direction, request, source, transaction));
+}
+
+PassRefPtr<LegacyCursorWithValue> LegacyCursorWithValue::fromCursor(PassRefPtr<LegacyCursor> prpCursor)
+{
+ RefPtr<LegacyCursorWithValue> cursorWithValue(static_cast<LegacyCursorWithValue*>(prpCursor.get()));
+ return cursorWithValue.release();
+}
+
+LegacyCursorWithValue::LegacyCursorWithValue(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
+ : LegacyCursor(backend, direction, request, source, transaction)
+{
+}
+
+LegacyCursorWithValue::~LegacyCursorWithValue()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h
similarity index 61%
copy from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
copy to Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h
index 70e91c2..487b1f1 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h
@@ -23,35 +23,33 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef IDBDatabaseCallbacks_h
-#define IDBDatabaseCallbacks_h
+#ifndef LegacyCursorWithValue_h
+#define LegacyCursorWithValue_h
#if ENABLE(INDEXED_DATABASE)
-#include "IDBDatabaseError.h"
-#include "IndexedDB.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
+#include "LegacyCursor.h"
namespace WebCore {
-class IDBDatabase;
-
-class IDBDatabaseCallbacks : public RefCounted<IDBDatabaseCallbacks> {
+class LegacyCursorWithValue : public LegacyCursor {
public:
- virtual ~IDBDatabaseCallbacks() { }
+ static PassRefPtr<LegacyCursorWithValue> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
+ static PassRefPtr<LegacyCursorWithValue> fromCursor(PassRefPtr<LegacyCursor>);
+ virtual ~LegacyCursorWithValue();
- virtual void onForcedClose() = 0;
- virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion) = 0;
+ // The value attribute defined in the IDL is simply implemented in LegacyCursor (but not exposed via
+ // its IDL). This is to make the implementation more simple while matching what the spec says.
- virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) = 0;
- virtual void onComplete(int64_t transactionId) = 0;
+protected:
+ virtual bool isKeyCursor() const override { return false; }
- virtual void connect(IDBDatabase*) = 0;
+private:
+ LegacyCursorWithValue(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
};
} // namespace WebCore
#endif
-#endif // IDBDatabaseCallbacks_h
+#endif // LegacyCursorWithValue_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp
new file mode 100644
index 0000000..7e17492
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp
@@ -0,0 +1,403 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DOMStringList.h"
+#include "EventQueue.h"
+#include "ExceptionCode.h"
+#include "IDBAny.h"
+#include "IDBDatabaseBackend.h"
+#include "IDBDatabaseCallbacks.h"
+#include "IDBDatabaseError.h"
+#include "IDBDatabaseException.h"
+#include "IDBEventDispatcher.h"
+#include "IDBIndex.h"
+#include "IDBKeyPath.h"
+#include "IDBObjectStore.h"
+#include "IDBTransaction.h"
+#include "IDBVersionChangeEvent.h"
+#include "LegacyObjectStore.h"
+#include "LegacyVersionChangeEvent.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+#include <atomic>
+#include <inspector/ScriptCallStack.h>
+#include <limits>
+#include <wtf/Atomics.h>
+
+namespace WebCore {
+
+Ref<LegacyDatabase> LegacyDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> database, PassRefPtr<IDBDatabaseCallbacks> callbacks)
+{
+ Ref<LegacyDatabase> legacyDatabase(adoptRef(*new LegacyDatabase(context, database, callbacks)));
+ legacyDatabase->suspendIfNeeded();
+ return legacyDatabase;
+}
+
+LegacyDatabase::LegacyDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks)
+ : IDBDatabase(context)
+ , m_backend(backend)
+ , m_closePending(false)
+ , m_isClosed(false)
+ , m_contextStopped(false)
+ , m_databaseCallbacks(callbacks)
+{
+ // We pass a reference of this object before it can be adopted.
+ relaxAdoptionRequirement();
+}
+
+LegacyDatabase::~LegacyDatabase()
+{
+ // This does what LegacyDatabase::close does, but without any ref/deref of the
+ // database since it is already in the process of being deleted. The logic here
+ // is also simpler since we know there are no transactions (since they ref the
+ // database when they are alive).
+
+ ASSERT(m_transactions.isEmpty());
+
+ if (!m_closePending) {
+ m_closePending = true;
+ m_backend->close(m_databaseCallbacks);
+ }
+
+ if (auto* context = scriptExecutionContext()) {
+ // Remove any pending versionchange events scheduled to fire on this
+ // connection. They would have been scheduled by the backend when another
+ // connection called setVersion, but the frontend connection is being
+ // closed before they could fire.
+ for (auto& event : m_enqueuedEvents)
+ context->eventQueue().cancelEvent(*event);
+ }
+}
+
+int64_t LegacyDatabase::nextTransactionId()
+{
+ // Only keep a 32-bit counter to allow ports to use the other 32
+ // bits of the id.
+ static std::atomic<uint32_t> currentTransactionId;
+
+ return ++currentTransactionId;
+}
+
+void LegacyDatabase::transactionCreated(LegacyTransaction* transaction)
+{
+ ASSERT(transaction);
+ ASSERT(!m_transactions.contains(transaction->id()));
+ m_transactions.add(transaction->id(), transaction);
+
+ if (transaction->isVersionChange()) {
+ ASSERT(!m_versionChangeTransaction);
+ m_versionChangeTransaction = transaction;
+ }
+}
+
+void LegacyDatabase::transactionFinished(LegacyTransaction* transaction)
+{
+ ASSERT(transaction);
+ ASSERT(m_transactions.contains(transaction->id()));
+ ASSERT(m_transactions.get(transaction->id()) == transaction);
+ m_transactions.remove(transaction->id());
+
+ if (transaction->isVersionChange()) {
+ ASSERT(m_versionChangeTransaction == transaction);
+ m_versionChangeTransaction = nullptr;
+ }
+
+ if (m_closePending && m_transactions.isEmpty())
+ closeConnection();
+}
+
+void LegacyDatabase::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
+{
+ ASSERT(m_transactions.contains(transactionId));
+ m_transactions.get(transactionId)->onAbort(error);
+}
+
+void LegacyDatabase::onComplete(int64_t transactionId)
+{
+ ASSERT(m_transactions.contains(transactionId));
+ m_transactions.get(transactionId)->onComplete();
+}
+
+PassRefPtr<DOMStringList> LegacyDatabase::objectStoreNames() const
+{
+ RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
+ for (auto& objectStore : m_metadata.objectStores.values())
+ objectStoreNames->append(objectStore.name);
+ objectStoreNames->sort();
+ return objectStoreNames.release();
+}
+
+uint64_t LegacyDatabase::version() const
+{
+ // NoIntVersion is a special value for internal use only and shouldn't be exposed to script.
+ // DefaultIntVersion should be exposed instead.
+ return m_metadata.version != IDBDatabaseMetadata::NoIntVersion ? m_metadata.version : static_cast<uint64_t>(IDBDatabaseMetadata::DefaultIntVersion);
+}
+
+PassRefPtr<IDBObjectStore> LegacyDatabase::createObjectStore(const String& name, const Dictionary& options, ExceptionCode& ec)
+{
+ IDBKeyPath keyPath;
+ bool autoIncrement = false;
+ if (!options.isUndefinedOrNull()) {
+ String keyPathString;
+ Vector<String> keyPathArray;
+ if (options.get("keyPath", keyPathArray))
+ keyPath = IDBKeyPath(keyPathArray);
+ else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString))
+ keyPath = IDBKeyPath(keyPathString);
+
+ options.get("autoIncrement", autoIncrement);
+ }
+
+ return createObjectStore(name, keyPath, autoIncrement, ec);
+}
+
+PassRefPtr<IDBObjectStore> LegacyDatabase::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyDatabase::createObjectStore");
+ if (!m_versionChangeTransaction) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_versionChangeTransaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+
+ if (containsObjectStore(name)) {
+ ec = IDBDatabaseException::ConstraintError;
+ return 0;
+ }
+
+ if (!keyPath.isNull() && !keyPath.isValid()) {
+ ec = IDBDatabaseException::SyntaxError;
+ return 0;
+ }
+
+ if (autoIncrement && ((keyPath.type() == IDBKeyPath::StringType && keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::ArrayType)) {
+ ec = IDBDatabaseException::InvalidAccessError;
+ return 0;
+ }
+
+ int64_t objectStoreId = m_metadata.maxObjectStoreId + 1;
+ m_backend->createObjectStore(m_versionChangeTransaction->id(), objectStoreId, name, keyPath, autoIncrement);
+
+ IDBObjectStoreMetadata metadata(name, objectStoreId, keyPath, autoIncrement, IDBDatabaseBackend::MinimumIndexId);
+ RefPtr<LegacyObjectStore> objectStore = LegacyObjectStore::create(metadata, m_versionChangeTransaction.get());
+ m_metadata.objectStores.set(metadata.id, metadata);
+ ++m_metadata.maxObjectStoreId;
+
+ m_versionChangeTransaction->objectStoreCreated(name, objectStore);
+ return objectStore.release();
+}
+
+void LegacyDatabase::deleteObjectStore(const String& name, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyDatabase::deleteObjectStore");
+ if (!m_versionChangeTransaction) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return;
+ }
+ if (!m_versionChangeTransaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return;
+ }
+
+ int64_t objectStoreId = findObjectStoreId(name);
+ if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
+ ec = IDBDatabaseException::NotFoundError;
+ return;
+ }
+
+ m_backend->deleteObjectStore(m_versionChangeTransaction->id(), objectStoreId);
+ m_versionChangeTransaction->objectStoreDeleted(name);
+ m_metadata.objectStores.remove(objectStoreId);
+}
+
+PassRefPtr<IDBTransaction> LegacyDatabase::transaction(ScriptExecutionContext* context, const Vector<String>& scope, const String& modeString, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyDatabase::transaction");
+ if (!scope.size()) {
+ ec = IDBDatabaseException::InvalidAccessError;
+ return 0;
+ }
+
+ IndexedDB::TransactionMode mode = IDBTransaction::stringToMode(modeString, ec);
+ if (ec)
+ return 0;
+
+ if (m_versionChangeTransaction || m_closePending) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+
+ Vector<int64_t> objectStoreIds;
+ for (auto& name : scope) {
+ int64_t objectStoreId = findObjectStoreId(name);
+ if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
+ ec = IDBDatabaseException::NotFoundError;
+ return 0;
+ }
+ objectStoreIds.append(objectStoreId);
+ }
+
+ int64_t transactionId = nextTransactionId();
+ m_backend->createTransaction(transactionId, m_databaseCallbacks, objectStoreIds, mode);
+
+ RefPtr<LegacyTransaction> transaction = LegacyTransaction::create(context, transactionId, scope, mode, this);
+ return transaction.release();
+}
+
+PassRefPtr<IDBTransaction> LegacyDatabase::transaction(ScriptExecutionContext* context, const String& storeName, const String& mode, ExceptionCode& ec)
+{
+ RefPtr<DOMStringList> storeNames = DOMStringList::create();
+ storeNames->append(storeName);
+ return transaction(context, storeNames, mode, ec);
+}
+
+void LegacyDatabase::forceClose()
+{
+ for (auto& transaction : m_transactions.values())
+ transaction->abort(IGNORE_EXCEPTION);
+ this->close();
+}
+
+void LegacyDatabase::close()
+{
+ LOG(StorageAPI, "LegacyDatabase::close");
+ if (m_closePending)
+ return;
+
+ m_closePending = true;
+
+ if (m_transactions.isEmpty())
+ closeConnection();
+}
+
+void LegacyDatabase::closeConnection()
+{
+ ASSERT(m_closePending);
+ ASSERT(m_transactions.isEmpty());
+
+ // Closing may result in deallocating the last transaction, which could result in deleting
+ // this LegacyDatabase. We need the deallocation to happen after we are through.
+ Ref<LegacyDatabase> protect(*this);
+
+ m_backend->close(m_databaseCallbacks);
+
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+
+ EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
+ // Remove any pending versionchange events scheduled to fire on this
+ // connection. They would have been scheduled by the backend when another
+ // connection called setVersion, but the frontend connection is being
+ // closed before they could fire.
+ for (auto& event : m_enqueuedEvents) {
+ bool removed = eventQueue.cancelEvent(*event);
+ ASSERT_UNUSED(removed, removed);
+ }
+
+ m_isClosed = true;
+}
+
+void LegacyDatabase::onVersionChange(uint64_t oldVersion, uint64_t newVersion)
+{
+ LOG(StorageAPI, "LegacyDatabase::onVersionChange");
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+
+ if (m_closePending)
+ return;
+
+ ASSERT(newVersion != IDBDatabaseMetadata::NoIntVersion);
+ enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, newVersion, eventNames().versionchangeEvent));
+}
+
+void LegacyDatabase::enqueueEvent(PassRefPtr<Event> event)
+{
+ ASSERT(!m_contextStopped);
+ ASSERT(!m_isClosed);
+ ASSERT(scriptExecutionContext());
+ event->setTarget(this);
+ scriptExecutionContext()->eventQueue().enqueueEvent(event.get());
+ m_enqueuedEvents.append(event);
+}
+
+bool LegacyDatabase::dispatchEvent(PassRefPtr<Event> event)
+{
+ LOG(StorageAPI, "LegacyDatabase::dispatchEvent");
+ ASSERT(event->type() == eventNames().versionchangeEvent);
+ for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
+ if (m_enqueuedEvents[i].get() == event.get())
+ m_enqueuedEvents.remove(i);
+ }
+ return EventTarget::dispatchEvent(event.get());
+}
+
+int64_t LegacyDatabase::findObjectStoreId(const String& name) const
+{
+ for (auto& objectStore : m_metadata.objectStores) {
+ if (objectStore.value.name == name) {
+ ASSERT(objectStore.key != IDBObjectStoreMetadata::InvalidId);
+ return objectStore.key;
+ }
+ }
+ return IDBObjectStoreMetadata::InvalidId;
+}
+
+bool LegacyDatabase::hasPendingActivity() const
+{
+ // The script wrapper must not be collected before the object is closed or
+ // we can't fire a "versionchange" event to let script manually close the connection.
+ return !m_closePending && hasEventListeners() && !m_contextStopped;
+}
+
+void LegacyDatabase::stop()
+{
+ // Stop fires at a deterministic time, so we need to call close in it.
+ close();
+
+ m_contextStopped = true;
+}
+
+const char* LegacyDatabase::activeDOMObjectName() const
+{
+ return "LegacyDatabase";
+}
+
+bool LegacyDatabase::canSuspendForPageCache() const
+{
+ return m_isClosed;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h
new file mode 100644
index 0000000..b06c162
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h
@@ -0,0 +1,142 @@
+/*
+ * 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.
+ *
+ * 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 LegacyDatabase_h
+#define LegacyDatabase_h
+
+#include "ActiveDOMObject.h"
+#include "DOMStringList.h"
+#include "Dictionary.h"
+#include "Event.h"
+#include "EventTarget.h"
+#include "IDBDatabase.h"
+#include "IDBDatabaseCallbacks.h"
+#include "IDBDatabaseMetadata.h"
+#include "IDBObjectStore.h"
+#include "IndexedDB.h"
+#include "LegacyTransaction.h"
+#include "ScriptWrappable.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class LegacyTransaction;
+class ScriptExecutionContext;
+
+typedef int ExceptionCode;
+
+class LegacyDatabase final : public IDBDatabase {
+public:
+ static Ref<LegacyDatabase> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
+ ~LegacyDatabase();
+
+ void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadata; }
+ void transactionCreated(LegacyTransaction*);
+ void transactionFinished(LegacyTransaction*);
+
+ // Implement the IDL
+ virtual const String name() const override final { return m_metadata.name; }
+ virtual uint64_t version() const override final;
+ virtual PassRefPtr<DOMStringList> objectStoreNames() const override final;
+
+ virtual PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&) override final;
+ virtual void deleteObjectStore(const String& name, ExceptionCode&) override final;
+ virtual void close() override final;
+
+ // IDBDatabaseCallbacks
+ virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion);
+ virtual void onAbort(int64_t, PassRefPtr<IDBDatabaseError>);
+ virtual void onComplete(int64_t);
+
+ // EventTarget
+ virtual EventTargetInterface eventTargetInterface() const override final { return IDBDatabaseEventTargetInterfaceType; }
+ virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
+
+ bool isClosePending() const { return m_closePending; }
+ void forceClose();
+ virtual const IDBDatabaseMetadata metadata() const override final { return m_metadata; }
+ void enqueueEvent(PassRefPtr<Event>);
+
+ using EventTarget::dispatchEvent;
+ virtual bool dispatchEvent(PassRefPtr<Event>) override;
+
+ int64_t findObjectStoreId(const String& name) const;
+ bool containsObjectStore(const String& name) const
+ {
+ return findObjectStoreId(name) != IDBObjectStoreMetadata::InvalidId;
+ }
+
+ IDBDatabaseBackend* backend() const { return m_backend.get(); }
+
+ static int64_t nextTransactionId();
+
+ // ActiveDOMObject API.
+ bool hasPendingActivity() const override;
+
+private:
+ LegacyDatabase(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
+
+ PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> scope, const String& mode, ExceptionCode& ec) { return transaction(context, *scope, mode, ec); }
+
+ // ActiveDOMObject API.
+ void stop() override;
+ const char* activeDOMObjectName() const override;
+ bool canSuspendForPageCache() const override;
+
+ // EventTarget
+ virtual void refEventTarget() override final { ref(); }
+ virtual void derefEventTarget() override final { deref(); }
+
+ void closeConnection();
+
+ IDBDatabaseMetadata m_metadata;
+ RefPtr<IDBDatabaseBackend> m_backend;
+ RefPtr<LegacyTransaction> m_versionChangeTransaction;
+ typedef HashMap<int64_t, LegacyTransaction*> TransactionMap;
+ TransactionMap m_transactions;
+
+ bool m_closePending;
+ bool m_isClosed;
+ bool m_contextStopped;
+
+ // Keep track of the versionchange events waiting to be fired on this
+ // database so that we can cancel them if the database closes.
+ Vector<RefPtr<Event>> m_enqueuedEvents;
+
+ RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // LegacyDatabase_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp
new file mode 100644
index 0000000..d089198
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp
@@ -0,0 +1,169 @@
+/*
+ * 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 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 "LegacyFactory.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "IDBBindingUtilities.h"
+#include "IDBDatabaseCallbacksImpl.h"
+#include "IDBDatabaseException.h"
+#include "IDBFactoryBackendInterface.h"
+#include "IDBKey.h"
+#include "IDBKeyRange.h"
+#include "LegacyAny.h"
+#include "LegacyDatabase.h"
+#include "LegacyOpenDBRequest.h"
+#include "Logging.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "SchemeRegistry.h"
+#include "SecurityOrigin.h"
+#include "WorkerGlobalScope.h"
+#include "WorkerLoaderProxy.h"
+#include "WorkerThread.h"
+
+namespace WebCore {
+
+LegacyFactory::LegacyFactory(IDBFactoryBackendInterface* factory)
+ : m_backend(factory)
+{
+ // We pass a reference to this object before it can be adopted.
+ relaxAdoptionRequirement();
+}
+
+LegacyFactory::~LegacyFactory()
+{
+}
+
+static bool isContextValid(ScriptExecutionContext* context)
+{
+ ASSERT(is<Document>(*context) || context->isWorkerGlobalScope());
+ if (is<Document>(*context)) {
+ Document& document = downcast<Document>(*context);
+ return document.frame() && document.page() && (!document.page()->usesEphemeralSession() || SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin()->protocol()));
+ }
+ return true;
+}
+
+PassRefPtr<IDBRequest> LegacyFactory::getDatabaseNames(ScriptExecutionContext* context, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyFactory::getDatabaseNames");
+ if (!isContextValid(context))
+ return 0;
+ if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
+ ec = SECURITY_ERR;
+ return 0;
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), 0);
+ m_backend->getDatabaseNames(request, *(context->securityOrigin()), *(context->topOrigin()), context);
+ return request;
+}
+
+PassRefPtr<IDBOpenDBRequest> LegacyFactory::open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyFactory::open");
+ return openInternal(context, name, 0, IndexedDB::VersionNullness::Null, ec);
+}
+
+PassRefPtr<IDBOpenDBRequest> LegacyFactory::open(ScriptExecutionContext* context, const String& name, unsigned long long version, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyFactory::open");
+ if (!version) {
+ ec = TypeError;
+ return 0;
+ }
+ return openInternal(context, name, version, IndexedDB::VersionNullness::NonNull, ec);
+}
+
+PassRefPtr<IDBOpenDBRequest> LegacyFactory::openInternal(ScriptExecutionContext* context, const String& name, uint64_t version, IndexedDB::VersionNullness versionNullness, ExceptionCode& ec)
+{
+ ASSERT(version >= 1 || versionNullness == IndexedDB::VersionNullness::Null);
+ if (name.isNull()) {
+ ec = TypeError;
+ return 0;
+ }
+ if (!isContextValid(context))
+ return 0;
+ if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
+ ec = SECURITY_ERR;
+ return 0;
+ }
+
+ RefPtr<IDBDatabaseCallbacks> databaseCallbacks = IDBDatabaseCallbacksImpl::create();
+ int64_t transactionId = LegacyDatabase::nextTransactionId();
+ RefPtr<LegacyOpenDBRequest> request = LegacyOpenDBRequest::create(context, databaseCallbacks, transactionId, version, versionNullness);
+ m_backend->open(name, version, transactionId, request, databaseCallbacks, *(context->securityOrigin()), *(context->topOrigin()));
+ return request;
+}
+
+PassRefPtr<IDBOpenDBRequest> LegacyFactory::deleteDatabase(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
+{
+ WTFLogAlways("yah dude");
+ LOG(StorageAPI, "LegacyFactory::deleteDatabase");
+ if (name.isNull()) {
+ ec = TypeError;
+ return 0;
+ }
+ if (!isContextValid(context))
+ return 0;
+ if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
+ ec = SECURITY_ERR;
+ return 0;
+ }
+
+ RefPtr<LegacyOpenDBRequest> request = LegacyOpenDBRequest::create(context, 0, 0, 0, IndexedDB::VersionNullness::Null);
+ m_backend->deleteDatabase(name, *context->securityOrigin(), *context->topOrigin(), request, context);
+ return request;
+}
+
+short LegacyFactory::cmp(ScriptExecutionContext* context, const Deprecated::ScriptValue& firstValue, const Deprecated::ScriptValue& secondValue, ExceptionCode& ec)
+{
+ DOMRequestState requestState(context);
+ RefPtr<IDBKey> first = scriptValueToIDBKey(&requestState, firstValue);
+ RefPtr<IDBKey> second = scriptValueToIDBKey(&requestState, secondValue);
+
+ ASSERT(first);
+ ASSERT(second);
+
+ if (!first->isValid() || !second->isValid()) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+
+ return static_cast<short>(first->compare(second.get()));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h
new file mode 100644
index 0000000..535b174
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h
@@ -0,0 +1,84 @@
+/*
+ * 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 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 LegacyFactory_h
+#define LegacyFactory_h
+
+#include "IDBFactory.h"
+#include "IDBOpenDBRequest.h"
+#include "ScriptWrappable.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBKey;
+class IDBKeyRange;
+class IDBFactoryBackendInterface;
+class ScriptExecutionContext;
+
+typedef int ExceptionCode;
+
+class LegacyFactory : public ScriptWrappable, public IDBFactory {
+public:
+ static PassRefPtr<LegacyFactory> create(IDBFactoryBackendInterface* factory)
+ {
+ // FIXME: While the feature is under development we'll handle a null factory backend here,
+ // returning null, so javascript can't try to use the feature.
+ // Once the feature is fully functional we should remove the null factory backend.
+ return factory ? adoptRef(new LegacyFactory(factory)) : nullptr;
+ }
+ ~LegacyFactory();
+
+ // FIXME: getDatabaseNames is no longer a web-facing API, and should be removed from LegacyFactory.
+ // The Web Inspector currently uses this to enumerate the list of databases, but is more complicated as a result.
+ // We should provide a simpler API to the Web Inspector then remove getDatabaseNames.
+ PassRefPtr<IDBRequest> getDatabaseNames(ScriptExecutionContext*, ExceptionCode&);
+
+ PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&);
+ PassRefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, unsigned long long version, ExceptionCode&);
+ PassRefPtr<IDBOpenDBRequest> deleteDatabase(ScriptExecutionContext*, const String& name, ExceptionCode&);
+
+ short cmp(ScriptExecutionContext*, const Deprecated::ScriptValue& first, const Deprecated::ScriptValue& second, ExceptionCode&);
+
+private:
+ LegacyFactory(IDBFactoryBackendInterface*);
+
+ PassRefPtr<IDBOpenDBRequest> openInternal(ScriptExecutionContext*, const String& name, uint64_t version, IndexedDB::VersionNullness, ExceptionCode&);
+
+ RefPtr<IDBFactoryBackendInterface> m_backend;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // LegacyFactory_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp
new file mode 100644
index 0000000..abbe720
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyIndex.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabaseException.h"
+#include "IDBKey.h"
+#include "IDBKeyRange.h"
+#include "IDBObjectStore.h"
+#include "IDBRequest.h"
+#include "IDBTransaction.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+LegacyIndex::LegacyIndex(const IDBIndexMetadata& metadata, LegacyObjectStore* objectStore, LegacyTransaction* transaction)
+ : m_metadata(metadata)
+ , m_objectStore(objectStore)
+ , m_transaction(transaction)
+ , m_deleted(false)
+{
+ ASSERT(m_objectStore);
+ ASSERT(m_transaction);
+ ASSERT(m_metadata.id != IDBIndexMetadata::InvalidId);
+}
+
+LegacyIndex::~LegacyIndex()
+{
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::openCursor");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
+ return 0;
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
+ backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, IDBDatabaseBackend::NormalTask, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::openCursor");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, keyRange.release(), direction, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::count");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::count");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return count(context, keyRange.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::openKeyCursor");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
+ return 0;
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ request->setCursorDetails(IndexedDB::CursorType::KeyOnly, direction);
+ backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, true, IDBDatabaseBackend::NormalTask, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::openKeyCursor");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return openKeyCursor(context, keyRange.release(), direction, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::get");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return get(context, keyRange.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::get");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (!keyRange) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, false, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::getKey(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::getKey");
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+
+ return getKey(context, keyRange.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyIndex::getKey(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyIndex::getKey");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (!keyRange) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, true, request);
+ return request;
+}
+
+IDBDatabaseBackend* LegacyIndex::backendDB() const
+{
+ return m_transaction->backendDB();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h
new file mode 100644
index 0000000..7345880
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ *
+ * 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 LegacyIndex_h
+#define LegacyIndex_h
+
+#include "IDBCursor.h"
+#include "IDBDatabase.h"
+#include "IDBDatabaseMetadata.h"
+#include "IDBKeyPath.h"
+#include "IDBKeyRange.h"
+#include "IDBRequest.h"
+#include "LegacyAny.h"
+#include "LegacyObjectStore.h"
+#include "LegacyRequest.h"
+#include "LegacyTransaction.h"
+#include "ScriptWrappable.h"
+#include <wtf/Forward.h>
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBObjectStore;
+
+class LegacyIndex : public ScriptWrappable, public IDBIndex {
+public:
+ static Ref<LegacyIndex> create(const IDBIndexMetadata& metadata, LegacyObjectStore* objectStore, LegacyTransaction* transaction)
+ {
+ return adoptRef(*new LegacyIndex(metadata, objectStore, transaction));
+ }
+ ~LegacyIndex();
+
+ // Implement the IDL
+ virtual const String name() const override final { return m_metadata.name; }
+ virtual PassRefPtr<IDBObjectStore> objectStore() const override final { return m_objectStore; }
+ PassRefPtr<LegacyObjectStore> legacyObjectStore() const { return m_objectStore; }
+ virtual PassRefPtr<IDBAny> keyPathAny() const override final { return LegacyAny::create(m_metadata.keyPath); }
+ virtual const IDBKeyPath keyPath() const override final { return m_metadata.keyPath; }
+ virtual bool unique() const override final { return m_metadata.unique; }
+ virtual bool multiEntry() const override final { return m_metadata.multiEntry; }
+ virtual int64_t id() const override final { return m_metadata.id; }
+
+ // FIXME: Try to modify the code generator so this is unneeded.
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) override final { return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) override final { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) override final { return openCursor(context, key, IDBCursor::directionNext(), ec); }
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) override final { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCode& ec) override final { return openKeyCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) override final { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) override final { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
+
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&) override final;
+ virtual PassRefPtr<IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+
+ void markDeleted() { m_deleted = true; }
+
+ IDBDatabaseBackend* backendDB() const;
+
+private:
+ LegacyIndex(const IDBIndexMetadata&, LegacyObjectStore*, LegacyTransaction*);
+
+ IDBIndexMetadata m_metadata;
+ RefPtr<LegacyObjectStore> m_objectStore;
+ RefPtr<LegacyTransaction> m_transaction;
+ bool m_deleted;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // LegacyIndex_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp
new file mode 100644
index 0000000..0b3e61e
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp
@@ -0,0 +1,575 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyObjectStore.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DOMStringList.h"
+#include "IDBAny.h"
+#include "IDBBindingUtilities.h"
+#include "IDBCursorWithValue.h"
+#include "IDBDatabase.h"
+#include "IDBDatabaseException.h"
+#include "IDBKey.h"
+#include "IDBKeyData.h"
+#include "IDBKeyPath.h"
+#include "IDBKeyRange.h"
+#include "IDBTransaction.h"
+#include "LegacyCursorWithValue.h"
+#include "LegacyIndex.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+#include "SerializedScriptValue.h"
+#include "SharedBuffer.h"
+
+namespace WebCore {
+
+LegacyObjectStore::LegacyObjectStore(const IDBObjectStoreMetadata& metadata, LegacyTransaction* transaction)
+ : m_metadata(metadata)
+ , m_transaction(transaction)
+ , m_deleted(false)
+{
+ ASSERT(m_transaction);
+ // We pass a reference to this object before it can be adopted.
+ relaxAdoptionRequirement();
+}
+
+PassRefPtr<DOMStringList> LegacyObjectStore::indexNames() const
+{
+ LOG(StorageAPI, "LegacyObjectStore::indexNames");
+ RefPtr<DOMStringList> indexNames = DOMStringList::create();
+ for (auto& index : m_metadata.indexes.values())
+ indexNames->append(index.name);
+ indexNames->sort();
+ return indexNames.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::get");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!keyRange) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, false, request);
+ return request.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return get(context, keyRange.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::add(JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::add");
+ return put(IDBDatabaseBackend::AddOnly, LegacyAny::create(this), state, value, key, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::add(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::add");
+ return put(IDBDatabaseBackend::AddOnly, LegacyAny::create(this), state, value, static_cast<IDBKey*>(nullptr), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::put(JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::put");
+ return put(IDBDatabaseBackend::AddOrUpdate, LegacyAny::create(this), state, value, key, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::put(JSC::ExecState* state, Deprecated::ScriptValue& value, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::put");
+ return put(IDBDatabaseBackend::AddOrUpdate, LegacyAny::create(this), state, value, static_cast<IDBKey*>(nullptr), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::put(IDBDatabaseBackend::PutMode putMode, PassRefPtr<LegacyAny> source, JSC::ExecState* state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
+{
+ ScriptExecutionContext* context = scriptExecutionContextFromExecState(state);
+ DOMRequestState requestState(context);
+ RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
+ return put(putMode, source, state, value, key.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::put(IDBDatabaseBackend::PutMode putMode, PassRefPtr<LegacyAny> source, JSC::ExecState* state, Deprecated::ScriptValue& value, PassRefPtr<IDBKey> prpKey, ExceptionCode& ec)
+{
+ RefPtr<IDBKey> key = prpKey;
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return nullptr;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return nullptr;
+ }
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::ReadOnlyError;
+ return nullptr;
+ }
+
+ RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(state, value.jsValue(), nullptr, nullptr);
+ if (state->hadException())
+ return nullptr;
+
+ if (serializedValue->hasBlobURLs()) {
+ // FIXME: Add Blob/File/FileList support
+ ec = IDBDatabaseException::DataCloneError;
+ return nullptr;
+ }
+
+ const IDBKeyPath& keyPath = m_metadata.keyPath;
+ const bool usesInLineKeys = !keyPath.isNull();
+ const bool hasKeyGenerator = autoIncrement();
+
+ ScriptExecutionContext* context = scriptExecutionContextFromExecState(state);
+ DOMRequestState requestState(context);
+
+ if (putMode != IDBDatabaseBackend::CursorUpdate && usesInLineKeys && key) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+ if (!usesInLineKeys && !hasKeyGenerator && !key) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+ if (usesInLineKeys) {
+ RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(requestState.exec(), value, keyPath);
+ if (keyPathKey && !keyPathKey->isValid()) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+ if (!hasKeyGenerator && !keyPathKey) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+ if (hasKeyGenerator && !keyPathKey) {
+ if (!canInjectIDBKeyIntoScriptValue(&requestState, value, keyPath)) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+ }
+ if (keyPathKey)
+ key = keyPathKey;
+ }
+ if (key && !key->isValid()) {
+ ec = IDBDatabaseException::DataError;
+ return nullptr;
+ }
+
+ Vector<int64_t> indexIds;
+ Vector<IndexKeys> indexKeys;
+ for (auto& index : m_metadata.indexes) {
+ Vector<IDBKeyData> keyDatas;
+ generateIndexKeysForValue(requestState.exec(), index.value, value, keyDatas);
+ indexIds.append(index.key);
+
+ // FIXME: Much of the Indexed DB code needs to use IDBKeyData directly to avoid wasteful conversions like this.
+ Vector<RefPtr<IDBKey>> keys;
+ for (auto& keyData : keyDatas) {
+ RefPtr<IDBKey> key = keyData.maybeCreateIDBKey();
+ if (key)
+ keys.append(key.release());
+ }
+ indexKeys.append(keys);
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, source, m_transaction.get());
+ Vector<uint8_t> valueBytes = serializedValue->toWireBytes();
+ // This is a hack to account for disagreements about whether SerializedScriptValue should deal in Vector<uint8_t> or Vector<char>.
+ // See https://lists.webkit.org/pipermail/webkit-dev/2013-February/023682.html
+ Vector<char>* valueBytesSigned = reinterpret_cast<Vector<char>*>(&valueBytes);
+ RefPtr<SharedBuffer> valueBuffer = SharedBuffer::adoptVector(*valueBytesSigned);
+ backendDB()->put(m_transaction->id(), id(), valueBuffer, key.release(), static_cast<IDBDatabaseBackend::PutMode>(putMode), request, indexIds, indexKeys);
+ return request.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::deleteFunction(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::delete");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::ReadOnlyError;
+ return 0;
+ }
+ if (!keyRange) {
+ ec = IDBDatabaseException::DataError;
+ return 0;
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->deleteRange(m_transaction->id(), id(), keyRange, request);
+ return request.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::deleteFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return deleteFunction(context, keyRange.release(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::clear(ScriptExecutionContext* context, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::clear");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (m_transaction->isReadOnly()) {
+ ec = IDBDatabaseException::ReadOnlyError;
+ return 0;
+ }
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->clearObjectStore(m_transaction->id(), id(), request);
+ return request.release();
+}
+
+namespace {
+// This class creates the index keys for a given index by extracting
+// them from the SerializedScriptValue, for all the existing values in
+// the objectStore. It only needs to be kept alive by virtue of being
+// a listener on an IDBRequest object, in the same way that JavaScript
+// cursor success handlers are kept alive.
+class IndexPopulator : public EventListener {
+public:
+ static Ref<IndexPopulator> create(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+ {
+ return adoptRef(*new IndexPopulator(backend, transactionId, objectStoreId, indexMetadata));
+ }
+
+ virtual bool operator==(const EventListener& other)
+ {
+ return this == &other;
+ }
+
+private:
+ IndexPopulator(PassRefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
+ : EventListener(CPPEventListenerType)
+ , m_databaseBackend(backend)
+ , m_transactionId(transactionId)
+ , m_objectStoreId(objectStoreId)
+ , m_indexMetadata(indexMetadata)
+ {
+ }
+
+ virtual void handleEvent(ScriptExecutionContext*, Event* event)
+ {
+ ASSERT(event->type() == eventNames().successEvent);
+ EventTarget* target = event->target();
+ LegacyRequest* request = static_cast<LegacyRequest*>(target);
+
+ RefPtr<LegacyAny> cursorAny = request->legacyResult(ASSERT_NO_EXCEPTION);
+ RefPtr<LegacyCursorWithValue> cursor;
+ if (cursorAny->type() == IDBAny::IDBCursorWithValueType)
+ cursor = cursorAny->legacyCursorWithValue();
+
+ Vector<int64_t, 1> indexIds;
+ indexIds.append(m_indexMetadata.id);
+ if (cursor) {
+ cursor->continueFunction(static_cast<IDBKey*>(nullptr), ASSERT_NO_EXCEPTION);
+
+ RefPtr<IDBKey> primaryKey = cursor->idbPrimaryKey();
+ Deprecated::ScriptValue value = cursor->value();
+
+ Vector<IDBKeyData> indexKeyDatas;
+ generateIndexKeysForValue(request->requestState()->exec(), m_indexMetadata, value, indexKeyDatas);
+
+ Vector<RefPtr<IDBKey>> indexKeys;
+ for (auto& indexKeyData : indexKeyDatas) {
+ RefPtr<IDBKey> key = indexKeyData.maybeCreateIDBKey();
+ if (key)
+ indexKeys.append(key.release());
+ }
+ Vector<LegacyObjectStore::IndexKeys, 1> indexKeysList;
+ indexKeysList.append(indexKeys);
+
+ m_databaseBackend->setIndexKeys(m_transactionId, m_objectStoreId, primaryKey, indexIds, indexKeysList);
+ } else {
+ // Now that we are done indexing, tell the backend to go
+ // back to processing tasks of type NormalTask.
+ m_databaseBackend->setIndexesReady(m_transactionId, m_objectStoreId, indexIds);
+ m_databaseBackend = nullptr;
+ }
+
+ }
+
+ RefPtr<IDBDatabaseBackend> m_databaseBackend;
+ const int64_t m_transactionId;
+ const int64_t m_objectStoreId;
+ const IDBIndexMetadata m_indexMetadata;
+};
+}
+
+PassRefPtr<IDBIndex> LegacyObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, const Dictionary& options, ExceptionCode& ec)
+{
+ bool unique = false;
+ options.get("unique", unique);
+
+ bool multiEntry = false;
+ options.get("multiEntry", multiEntry);
+
+ return createIndex(context, name, keyPath, unique, multiEntry, ec);
+}
+
+PassRefPtr<IDBIndex> LegacyObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::createIndex");
+ if (!m_transaction->isVersionChange() || m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ if (!keyPath.isValid()) {
+ ec = IDBDatabaseException::SyntaxError;
+ return 0;
+ }
+ if (name.isNull()) {
+ ec = TypeError;
+ return 0;
+ }
+ if (containsIndex(name)) {
+ ec = IDBDatabaseException::ConstraintError;
+ return 0;
+ }
+
+ if (keyPath.type() == IDBKeyPath::ArrayType && multiEntry) {
+ ec = IDBDatabaseException::InvalidAccessError;
+ return 0;
+ }
+
+ int64_t indexId = m_metadata.maxIndexId + 1;
+ backendDB()->createIndex(m_transaction->id(), id(), indexId, name, keyPath, unique, multiEntry);
+
+ ++m_metadata.maxIndexId;
+
+ IDBIndexMetadata metadata(name, indexId, keyPath, unique, multiEntry);
+ RefPtr<LegacyIndex> index = LegacyIndex::create(metadata, this, m_transaction.get());
+ m_indexMap.set(name, index);
+ m_metadata.indexes.set(indexId, metadata);
+
+ ASSERT(!ec);
+ if (ec)
+ return 0;
+
+ ASSERT_UNUSED(context, context);
+ return index.release();
+}
+
+PassRefPtr<IDBIndex> LegacyObjectStore::index(const String& name, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::index");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (m_transaction->isFinished()) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+
+ IDBIndexMap::iterator it = m_indexMap.find(name);
+ if (it != m_indexMap.end())
+ return it->value;
+
+ int64_t indexId = findIndexId(name);
+ if (indexId == IDBIndexMetadata::InvalidId) {
+ ec = IDBDatabaseException::NotFoundError;
+ return 0;
+ }
+
+ const IDBIndexMetadata* indexMetadata(nullptr);
+ for (auto& index : m_metadata.indexes.values()) {
+ if (index.name == name) {
+ indexMetadata = &index;
+ break;
+ }
+ }
+ ASSERT(indexMetadata);
+ ASSERT(indexMetadata->id != IDBIndexMetadata::InvalidId);
+
+ RefPtr<LegacyIndex> index = LegacyIndex::create(*indexMetadata, this, m_transaction.get());
+ m_indexMap.set(name, index);
+ return index.release();
+}
+
+void LegacyObjectStore::deleteIndex(const String& name, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::deleteIndex");
+ if (!m_transaction->isVersionChange() || m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return;
+ }
+ int64_t indexId = findIndexId(name);
+ if (indexId == IDBIndexMetadata::InvalidId) {
+ ec = IDBDatabaseException::NotFoundError;
+ return;
+ }
+
+ backendDB()->deleteIndex(m_transaction->id(), id(), indexId);
+
+ m_metadata.indexes.remove(indexId);
+ IDBIndexMap::iterator it = m_indexMap.find(name);
+ if (it != m_indexMap.end()) {
+ it->value->markDeleted();
+ m_indexMap.remove(name);
+ }
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, ExceptionCode& ec)
+{
+ return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
+{
+ return openCursor(context, keyRange, IDBCursor::directionNext(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ return openCursor(context, key, IDBCursor::directionNext(), ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& direction, ExceptionCode& ec)
+{
+ return openCursor(context, range, direction, IDBDatabaseBackend::NormalTask, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, IDBDatabaseBackend::TaskType taskType, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::openCursor");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+ if (ec)
+ return 0;
+
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
+
+ backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, direction, false, static_cast<IDBDatabaseBackend::TaskType>(taskType), request);
+ return request.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode& ec)
+{
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return openCursor(context, keyRange.release(), direction, ec);
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, ExceptionCode& ec)
+{
+ LOG(StorageAPI, "LegacyObjectStore::count");
+ if (m_deleted) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ if (!m_transaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return 0;
+ }
+ RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
+ backendDB()->count(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, request);
+ return request.release();
+}
+
+PassRefPtr<IDBRequest> LegacyObjectStore::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec)
+{
+ RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec);
+ if (ec)
+ return 0;
+ return count(context, keyRange.release(), ec);
+}
+
+void LegacyObjectStore::transactionFinished()
+{
+ ASSERT(m_transaction->isFinished());
+
+ // Break reference cycles.
+ m_indexMap.clear();
+}
+
+int64_t LegacyObjectStore::findIndexId(const String& name) const
+{
+ for (auto& index : m_metadata.indexes) {
+ if (index.value.name == name) {
+ ASSERT(index.key != IDBIndexMetadata::InvalidId);
+ return index.key;
+ }
+ }
+ return IDBIndexMetadata::InvalidId;
+}
+
+IDBDatabaseBackend* LegacyObjectStore::backendDB() const
+{
+ return m_transaction->backendDB();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h
new file mode 100644
index 0000000..291aeb5
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ *
+ * 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 LegacyObjectStore_h
+#define LegacyObjectStore_h
+
+#include "Dictionary.h"
+#include "IDBCursor.h"
+#include "IDBDatabaseBackend.h"
+#include "IDBDatabaseMetadata.h"
+#include "IDBIndex.h"
+#include "IDBKey.h"
+#include "IDBKeyRange.h"
+#include "IDBRequest.h"
+#include "LegacyIndex.h"
+#include "LegacyTransaction.h"
+#include "ScriptWrappable.h"
+#include "SerializedScriptValue.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class DOMStringList;
+class IDBAny;
+class LegacyIndex;
+
+class LegacyObjectStore : public ScriptWrappable, public IDBObjectStore {
+public:
+ static Ref<LegacyObjectStore> create(const IDBObjectStoreMetadata& metadata, LegacyTransaction* transaction)
+ {
+ return adoptRef(*new LegacyObjectStore(metadata, transaction));
+ }
+ ~LegacyObjectStore() { }
+
+ // Implement the IDBObjectStore IDL
+ int64_t id() const { return m_metadata.id; }
+ const String name() const { return m_metadata.name; }
+ PassRefPtr<IDBAny> keyPathAny() const { return LegacyAny::create(m_metadata.keyPath); }
+ const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
+ PassRefPtr<DOMStringList> indexNames() const;
+ PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
+ bool autoIncrement() const { return m_metadata.autoIncrement; }
+
+ PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
+ PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, IDBDatabaseBackend::TaskType, ExceptionCode&);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&);
+
+ PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
+ PassRefPtr<IDBRequest> add(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> put(JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, PassRefPtr<LegacyAny>, JSC::ExecState*, Deprecated::ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&);
+ PassRefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, PassRefPtr<LegacyAny> source, JSC::ExecState*, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCode&);
+
+ PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
+ PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&);
+
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, const Dictionary&, ExceptionCode&);
+ PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionCode&);
+
+ PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&);
+ void deleteIndex(const String& name, ExceptionCode&);
+
+ PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
+ PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+
+ void markDeleted() { m_deleted = true; }
+ void transactionFinished();
+
+ IDBObjectStoreMetadata metadata() const { return m_metadata; }
+ void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = metadata; }
+
+ typedef Vector<RefPtr<IDBKey>> IndexKeys;
+ typedef HashMap<String, IndexKeys> IndexKeyMap;
+
+ IDBDatabaseBackend* backendDB() const;
+
+private:
+ LegacyObjectStore(const IDBObjectStoreMetadata&, LegacyTransaction*);
+
+ int64_t findIndexId(const String& name) const;
+ bool containsIndex(const String& name) const
+ {
+ return findIndexId(name) != IDBIndexMetadata::InvalidId;
+ }
+
+ IDBObjectStoreMetadata m_metadata;
+ RefPtr<LegacyTransaction> m_transaction;
+ bool m_deleted;
+
+ typedef HashMap<String, RefPtr<LegacyIndex>> IDBIndexMap;
+ IDBIndexMap m_indexMap;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // LegacyObjectStore_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp
new file mode 100644
index 0000000..6a723e8
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2012 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 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 "LegacyOpenDBRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabaseCallbacksImpl.h"
+#include "IDBPendingTransactionMonitor.h"
+#include "IDBVersionChangeEvent.h"
+#include "LegacyDatabase.h"
+#include "LegacyVersionChangeEvent.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+Ref<LegacyOpenDBRequest> LegacyOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
+{
+ Ref<LegacyOpenDBRequest> request(adoptRef(*new LegacyOpenDBRequest(context, callbacks, transactionId, version, versionNullness)));
+ request->suspendIfNeeded();
+ return request;
+}
+
+LegacyOpenDBRequest::LegacyOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
+ : LegacyRequest(context, LegacyAny::createNull(), IDBDatabaseBackend::NormalTask, 0)
+ , m_databaseCallbacks(callbacks)
+ , m_transactionId(transactionId)
+ , m_version(version)
+ , m_versionNullness(versionNullness)
+{
+ ASSERT(!m_result);
+}
+
+LegacyOpenDBRequest::~LegacyOpenDBRequest()
+{
+}
+
+EventTargetInterface LegacyOpenDBRequest::eventTargetInterface() const
+{
+ return IDBOpenDBRequestEventTargetInterfaceType;
+}
+
+void LegacyOpenDBRequest::onBlocked(uint64_t oldVersion)
+{
+ LOG(StorageAPI, "LegacyOpenDBRequest::onBlocked()");
+ if (!shouldEnqueueEvent())
+ return;
+
+ enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, m_version, eventNames().blockedEvent));
+}
+
+void LegacyOpenDBRequest::onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend> prpDatabaseBackend, const IDBDatabaseMetadata& metadata)
+{
+ LOG(StorageAPI, "LegacyOpenDBRequest::onUpgradeNeeded()");
+ if (m_contextStopped || !scriptExecutionContext()) {
+ RefPtr<IDBDatabaseBackend> db = prpDatabaseBackend;
+ db->abort(m_transactionId);
+ db->close(m_databaseCallbacks);
+ return;
+ }
+ if (!shouldEnqueueEvent())
+ return;
+
+ ASSERT(m_databaseCallbacks);
+
+ RefPtr<IDBDatabaseBackend> databaseBackend = prpDatabaseBackend;
+
+ RefPtr<LegacyDatabase> idbDatabase = LegacyDatabase::create(scriptExecutionContext(), databaseBackend, m_databaseCallbacks);
+ idbDatabase->setMetadata(metadata);
+ m_databaseCallbacks->connect(idbDatabase.get());
+ m_databaseCallbacks = nullptr;
+
+ IDBDatabaseMetadata oldMetadata(metadata);
+ oldMetadata.version = oldVersion;
+
+ m_transaction = LegacyTransaction::create(scriptExecutionContext(), m_transactionId, idbDatabase.get(), this, oldMetadata);
+ m_result = LegacyAny::create(idbDatabase.release());
+
+ if (m_versionNullness == IndexedDB::VersionNullness::Null)
+ m_version = 1;
+ enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, m_version, eventNames().upgradeneededEvent));
+}
+
+void LegacyOpenDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackend> prpBackend, const IDBDatabaseMetadata& metadata)
+{
+ LOG(StorageAPI, "LegacyOpenDBRequest::onSuccess()");
+ if (!shouldEnqueueEvent())
+ return;
+
+ RefPtr<IDBDatabaseBackend> backend = prpBackend;
+ RefPtr<LegacyDatabase> idbDatabase;
+ if (m_result) {
+ idbDatabase = m_result->legacyDatabase();
+ ASSERT(idbDatabase);
+ ASSERT(!m_databaseCallbacks);
+ } else {
+ ASSERT(m_databaseCallbacks);
+ idbDatabase = LegacyDatabase::create(scriptExecutionContext(), backend.release(), m_databaseCallbacks);
+ m_databaseCallbacks->connect(idbDatabase.get());
+ m_databaseCallbacks = nullptr;
+ m_result = LegacyAny::create(idbDatabase.get());
+ }
+ idbDatabase->setMetadata(metadata);
+ enqueueEvent(Event::create(eventNames().successEvent, false, false));
+}
+
+bool LegacyOpenDBRequest::shouldEnqueueEvent() const
+{
+ if (m_contextStopped || !scriptExecutionContext())
+ return false;
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ if (m_requestAborted)
+ return false;
+ return true;
+}
+
+bool LegacyOpenDBRequest::dispatchEvent(PassRefPtr<Event> event)
+{
+ // If the connection closed between onUpgradeNeeded and the delivery of the "success" event,
+ // an "error" event should be fired instead.
+ if (event->type() == eventNames().successEvent && m_result->type() == IDBAny::IDBDatabaseType && m_result->legacyDatabase()->isClosePending()) {
+ m_result = nullptr;
+ onError(IDBDatabaseError::create(IDBDatabaseException::AbortError, "The connection was closed."));
+ return false;
+ }
+
+ return LegacyRequest::dispatchEvent(event);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h
new file mode 100644
index 0000000..5a593b5
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 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 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 LegacyOpenDBRequest_h
+#define LegacyOpenDBRequest_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabaseMetadata.h"
+#include "IDBOpenDBRequest.h"
+#include "IndexedDB.h"
+#include "LegacyRequest.h"
+
+namespace WebCore {
+
+class IDBDatabaseCallbacks;
+
+class LegacyOpenDBRequest : public LegacyRequest {
+public:
+ static Ref<LegacyOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
+ virtual ~LegacyOpenDBRequest();
+
+ virtual void onBlocked(uint64_t existingVersion) override final;
+ virtual void onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override final;
+ virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override final;
+
+ // EventTarget
+ virtual EventTargetInterface eventTargetInterface() const override final;
+ virtual bool dispatchEvent(PassRefPtr<Event>) override final;
+
+protected:
+ virtual bool shouldEnqueueEvent() const override;
+
+private:
+ LegacyOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
+
+ RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
+ const int64_t m_transactionId;
+ uint64_t m_version;
+ IndexedDB::VersionNullness m_versionNullness;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // LegacyOpenDBRequest_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp
new file mode 100644
index 0000000..0d4ee9d
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp
@@ -0,0 +1,586 @@
+/*
+ * 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 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 "LegacyRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "EventException.h"
+#include "EventListener.h"
+#include "EventNames.h"
+#include "EventQueue.h"
+#include "ExceptionCodePlaceholder.h"
+#include "IDBBindingUtilities.h"
+#include "IDBCursorBackend.h"
+#include "IDBCursorWithValue.h"
+#include "IDBDatabase.h"
+#include "IDBEventDispatcher.h"
+#include "IDBIndex.h"
+#include "LegacyCursor.h"
+#include "LegacyCursorWithValue.h"
+#include "LegacyTransaction.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+#include "SharedBuffer.h"
+
+namespace WebCore {
+
+Ref<LegacyRequest> LegacyRequest::create(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, LegacyTransaction* transaction)
+{
+ Ref<LegacyRequest> request(adoptRef(*new LegacyRequest(context, source, IDBDatabaseBackend::NormalTask, transaction)));
+ request->suspendIfNeeded();
+ // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
+ if (transaction)
+ transaction->registerRequest(request.ptr());
+ return request;
+}
+
+Ref<LegacyRequest> LegacyRequest::create(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType taskType, LegacyTransaction* transaction)
+{
+ Ref<LegacyRequest> request(adoptRef(*new LegacyRequest(context, source, taskType, transaction)));
+ request->suspendIfNeeded();
+ // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
+ if (transaction)
+ transaction->registerRequest(request.ptr());
+ return request;
+}
+
+LegacyRequest::LegacyRequest(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType taskType, LegacyTransaction* transaction)
+ : IDBOpenDBRequest(context)
+ , m_result(nullptr)
+ , m_errorCode(0)
+ , m_contextStopped(false)
+ , m_transaction(transaction)
+ , m_readyState(PENDING)
+ , m_requestAborted(false)
+ , m_source(source)
+ , m_taskType(taskType)
+ , m_hasPendingActivity(true)
+ , m_cursorType(IndexedDB::CursorType::KeyAndValue)
+ , m_cursorDirection(IndexedDB::CursorDirection::Next)
+ , m_cursorFinished(false)
+ , m_pendingCursor(nullptr)
+ , m_didFireUpgradeNeededEvent(false)
+ , m_preventPropagation(false)
+ , m_requestState(context)
+{
+}
+
+LegacyRequest::~LegacyRequest()
+{
+}
+
+PassRefPtr<IDBAny> LegacyRequest::result(ExceptionCode& ec) const
+{
+ if (m_readyState != DONE) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ return m_result;
+}
+
+PassRefPtr<DOMError> LegacyRequest::error(ExceptionCode& ec) const
+{
+ if (m_readyState != DONE) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ return m_error;
+}
+
+unsigned short LegacyRequest::errorCode(ExceptionCode& ec) const
+{
+ if (m_readyState != DONE) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+ return m_errorCode;
+}
+
+PassRefPtr<IDBAny> LegacyRequest::source() const
+{
+ return m_source;
+}
+
+PassRefPtr<IDBTransaction> LegacyRequest::transaction() const
+{
+ return m_transaction;
+}
+
+const String& LegacyRequest::readyState() const
+{
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, pending, ("pending", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, done, ("done", AtomicString::ConstructFromLiteral));
+
+ if (m_readyState == PENDING)
+ return pending;
+
+ return done;
+}
+
+void LegacyRequest::markEarlyDeath()
+{
+ ASSERT(m_readyState == PENDING);
+ m_readyState = EarlyDeath;
+ if (m_transaction)
+ m_transaction->unregisterRequest(this);
+}
+
+void LegacyRequest::abort()
+{
+ ASSERT(!m_requestAborted);
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ if (m_readyState == DONE)
+ return;
+
+ // Enqueued events may be the only reference to this object.
+ RefPtr<LegacyRequest> self(this);
+
+ EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
+ for (auto& event : m_enqueuedEvents) {
+ bool removed = eventQueue.cancelEvent(*event);
+ ASSERT_UNUSED(removed, removed);
+ }
+ m_enqueuedEvents.clear();
+
+ m_errorCode = 0;
+ m_error = nullptr;
+ m_errorMessage = String();
+ m_result = nullptr;
+ onError(IDBDatabaseError::create(IDBDatabaseException::AbortError));
+ m_requestAborted = true;
+}
+
+void LegacyRequest::setCursorDetails(IndexedDB::CursorType cursorType, IndexedDB::CursorDirection direction)
+{
+ ASSERT(m_readyState == PENDING);
+ ASSERT(!m_pendingCursor);
+ m_cursorType = cursorType;
+ m_cursorDirection = direction;
+}
+
+void LegacyRequest::setPendingCursor(PassRefPtr<LegacyCursor> cursor)
+{
+ ASSERT(m_readyState == DONE);
+ ASSERT(scriptExecutionContext());
+ ASSERT(m_transaction);
+ ASSERT(!m_pendingCursor);
+ ASSERT(cursor == getResultCursor());
+
+ m_pendingCursor = cursor;
+ m_result = nullptr;
+ m_readyState = PENDING;
+ m_errorCode = 0;
+ m_error = nullptr;
+ m_errorMessage = String();
+ m_transaction->registerRequest(this);
+}
+
+RefPtr<LegacyCursor> LegacyRequest::getResultCursor()
+{
+ if (!m_result)
+ return nullptr;
+ if (m_result->type() == IDBAny::IDBCursorType)
+ return m_result->legacyCursor();
+ if (m_result->type() == IDBAny::IDBCursorWithValueType)
+ return m_result->legacyCursorWithValue();
+ return nullptr;
+}
+
+void LegacyRequest::setResultCursor(PassRefPtr<LegacyCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue& value)
+{
+ ASSERT(m_readyState == PENDING);
+ m_cursorKey = key;
+ m_cursorPrimaryKey = primaryKey;
+ m_cursorValue = value;
+
+ if (m_cursorType == IndexedDB::CursorType::KeyOnly) {
+ m_result = LegacyAny::create(cursor);
+ return;
+ }
+
+ m_result = LegacyAny::create(LegacyCursorWithValue::fromCursor(cursor));
+}
+
+void LegacyRequest::finishCursor()
+{
+ m_cursorFinished = true;
+ if (m_readyState != PENDING)
+ m_hasPendingActivity = false;
+}
+
+bool LegacyRequest::shouldEnqueueEvent() const
+{
+ if (m_contextStopped || !scriptExecutionContext())
+ return false;
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+ if (m_requestAborted)
+ return false;
+ ASSERT(m_readyState == PENDING);
+ ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
+ return true;
+}
+
+void LegacyRequest::onError(PassRefPtr<IDBDatabaseError> error)
+{
+ LOG(StorageAPI, "LegacyRequest::onError() (%s) '%s'", error->name().utf8().data(), error->message().utf8().data());
+ if (!shouldEnqueueEvent())
+ return;
+
+ m_errorCode = error->code();
+ m_errorMessage = error->message();
+ m_error = DOMError::create(IDBDatabaseException::getErrorName(error->idbCode()));
+ m_pendingCursor = nullptr;
+ enqueueEvent(Event::create(eventNames().errorEvent, true, true));
+}
+
+static PassRefPtr<Event> createSuccessEvent()
+{
+ return Event::create(eventNames().successEvent, false, false);
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<DOMStringList> domStringList)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(DOMStringList)");
+ if (!shouldEnqueueEvent())
+ return;
+
+ m_result = LegacyAny::create(domStringList);
+ enqueueEvent(createSuccessEvent());
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<IDBCursorBackend> prpBackend)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(IDBCursor)");
+ if (!shouldEnqueueEvent())
+ return;
+
+ DOMRequestState::Scope scope(m_requestState);
+
+ RefPtr<IDBCursorBackend> backend = prpBackend;
+ RefPtr<IDBKey> key = backend->key();
+ RefPtr<IDBKey> primaryKey = backend->primaryKey();
+
+ Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), backend->valueBuffer(), !!key);
+
+ ASSERT(!m_pendingCursor);
+ RefPtr<LegacyCursor> cursor;
+ switch (m_cursorType) {
+ case IndexedDB::CursorType::KeyOnly:
+ cursor = LegacyCursor::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
+ break;
+ case IndexedDB::CursorType::KeyAndValue:
+ cursor = LegacyCursorWithValue::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ setResultCursor(cursor, key.release(), primaryKey.release(), value);
+
+ enqueueEvent(createSuccessEvent());
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<IDBKey> idbKey)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(IDBKey)");
+ if (!shouldEnqueueEvent())
+ return;
+
+ if (idbKey && idbKey->isValid()) {
+ DOMRequestState::Scope scope(m_requestState);
+ m_result = LegacyAny::create(idbKeyToScriptValue(requestState(), idbKey));
+ } else
+ m_result = LegacyAny::createInvalid();
+ enqueueEvent(createSuccessEvent());
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(SharedBuffer)");
+ if (!shouldEnqueueEvent())
+ return;
+
+ DOMRequestState::Scope scope(m_requestState);
+
+ // FIXME: By not knowing whether or not the key is defined here, we don't know
+ // if a null valueBuffer means the value is null or the value is undefined.
+ Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
+ onSuccessInternal(value);
+}
+
+#ifndef NDEBUG
+static PassRefPtr<IDBObjectStore> effectiveObjectStore(LegacyAny* source)
+{
+ if (source->type() == IDBAny::IDBObjectStoreType)
+ return source->idbObjectStore();
+ if (source->type() == IDBAny::IDBIndexType)
+ return source->idbIndex()->objectStore();
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+#endif
+
+void LegacyRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)");
+ if (!shouldEnqueueEvent())
+ return;
+
+#ifndef NDEBUG
+ ASSERT(keyPath == effectiveObjectStore(m_source.get())->keyPath());
+#endif
+ DOMRequestState::Scope scope(m_requestState);
+
+ // FIXME: By not knowing whether or not the key is defined here, we don't know
+ // if a null valueBuffer means the value is null or the value is undefined.
+ Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
+
+ RefPtr<IDBKey> primaryKey = prpPrimaryKey;
+
+ if (!keyPath.isNull()) {
+#ifndef NDEBUG
+ RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath);
+ ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get()));
+#endif
+ bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath);
+ ASSERT_UNUSED(injected, injected);
+ }
+
+ onSuccessInternal(value);
+}
+
+void LegacyRequest::onSuccess(int64_t value)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(int64_t)");
+ if (!shouldEnqueueEvent())
+ return;
+ return onSuccessInternal(SerializedScriptValue::numberValue(value));
+}
+
+void LegacyRequest::onSuccess()
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess()");
+ if (!shouldEnqueueEvent())
+ return;
+ return onSuccessInternal(SerializedScriptValue::undefinedValue());
+}
+
+void LegacyRequest::onSuccessInternal(PassRefPtr<SerializedScriptValue> value)
+{
+ ASSERT(!m_contextStopped);
+ DOMRequestState::Scope scope(m_requestState);
+ return onSuccessInternal(deserializeIDBValue(requestState(), value));
+}
+
+void LegacyRequest::onSuccessInternal(const Deprecated::ScriptValue& value)
+{
+ m_result = LegacyAny::create(value);
+ if (m_pendingCursor) {
+ m_pendingCursor->close();
+ m_pendingCursor = nullptr;
+ }
+ enqueueEvent(createSuccessEvent());
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> buffer)
+{
+ LOG(StorageAPI, "LegacyRequest::onSuccess(key, primaryKey, valueBuffer)");
+ if (!shouldEnqueueEvent())
+ return;
+
+ DOMRequestState::Scope scope(m_requestState);
+
+ Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), buffer, !!key);
+
+ ASSERT(m_pendingCursor);
+ setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
+ enqueueEvent(createSuccessEvent());
+}
+
+void LegacyRequest::onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&)
+{
+ // Only the LegacyOpenDBRequest version of this should ever be called;
+ ASSERT_NOT_REACHED();
+}
+
+bool LegacyRequest::hasPendingActivity() const
+{
+ // FIXME: In an ideal world, we should return true as long as anyone has a or can
+ // get a handle to us and we have event listeners. This is order to handle
+ // user generated events properly.
+ return m_hasPendingActivity && !m_contextStopped;
+}
+
+void LegacyRequest::stop()
+{
+ if (m_contextStopped)
+ return;
+
+ m_contextStopped = true;
+ m_requestState.clear();
+ if (m_readyState == PENDING)
+ markEarlyDeath();
+}
+
+bool LegacyRequest::canSuspendForPageCache() const
+{
+ return !m_hasPendingActivity;
+}
+
+const char* LegacyRequest::activeDOMObjectName() const
+{
+ return "LegacyRequest";
+}
+
+EventTargetInterface LegacyRequest::eventTargetInterface() const
+{
+ return IDBRequestEventTargetInterfaceType;
+}
+
+bool LegacyRequest::dispatchEvent(PassRefPtr<Event> event)
+{
+ LOG(StorageAPI, "LegacyRequest::dispatchEvent");
+ ASSERT(m_readyState == PENDING);
+ ASSERT(!m_contextStopped);
+ ASSERT(m_hasPendingActivity);
+ ASSERT(m_enqueuedEvents.size());
+ ASSERT(scriptExecutionContext());
+ ASSERT(event->target() == this);
+ ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), DONE, m_readyState);
+
+ DOMRequestState::Scope scope(m_requestState);
+
+ if (event->type() != eventNames().blockedEvent)
+ m_readyState = DONE;
+
+ for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
+ if (m_enqueuedEvents[i].get() == event.get())
+ m_enqueuedEvents.remove(i);
+ }
+
+ Vector<RefPtr<EventTarget>> targets;
+ targets.append(this);
+ if (m_transaction && !m_preventPropagation) {
+ targets.append(m_transaction);
+ // If there ever are events that are associated with a database but
+ // that do not have a transaction, then this will not work and we need
+ // this object to actually hold a reference to the database (to ensure
+ // it stays alive).
+ targets.append(m_transaction->db());
+ }
+
+ // Cursor properties should not updated until the success event is being dispatched.
+ RefPtr<LegacyCursor> cursorToNotify;
+ if (event->type() == eventNames().successEvent) {
+ cursorToNotify = getResultCursor();
+ if (cursorToNotify) {
+ cursorToNotify->setValueReady(requestState(), m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue);
+ m_cursorValue.clear();
+ }
+ }
+
+ if (event->type() == eventNames().upgradeneededEvent) {
+ ASSERT(!m_didFireUpgradeNeededEvent);
+ m_didFireUpgradeNeededEvent = true;
+ }
+
+ // FIXME: When we allow custom event dispatching, this will probably need to change.
+ ASSERT_WITH_MESSAGE(event->type() == eventNames().successEvent || event->type() == eventNames().errorEvent || event->type() == eventNames().blockedEvent || event->type() == eventNames().upgradeneededEvent, "event type was %s", event->type().string().utf8().data());
+ const bool setTransactionActive = m_transaction && (event->type() == eventNames().successEvent || event->type() == eventNames().upgradeneededEvent || (event->type() == eventNames().errorEvent && m_errorCode != IDBDatabaseException::AbortError));
+
+ if (setTransactionActive)
+ m_transaction->setActive(true);
+
+ bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets);
+
+ if (m_transaction) {
+ if (m_readyState == DONE)
+ m_transaction->unregisterRequest(this);
+
+ // Possibly abort the transaction. This must occur after unregistering (so this request
+ // doesn't receive a second error) and before deactivating (which might trigger commit).
+ if (event->type() == eventNames().errorEvent && dontPreventDefault && !m_requestAborted) {
+ m_transaction->setError(m_error, m_errorMessage);
+ m_transaction->abort(IGNORE_EXCEPTION);
+ }
+
+ // If this was the last request in the transaction's list, it may commit here.
+ if (setTransactionActive)
+ m_transaction->setActive(false);
+ }
+
+ if (cursorToNotify)
+ cursorToNotify->postSuccessHandlerCallback();
+
+ if (m_readyState == DONE && (!cursorToNotify || m_cursorFinished) && event->type() != eventNames().upgradeneededEvent)
+ m_hasPendingActivity = false;
+
+ return dontPreventDefault;
+}
+
+void LegacyRequest::uncaughtExceptionInEventHandler()
+{
+ if (m_transaction && !m_requestAborted) {
+ m_transaction->setError(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)), "Uncaught exception in event handler.");
+ m_transaction->abort(IGNORE_EXCEPTION);
+ }
+}
+
+void LegacyRequest::transactionDidFinishAndDispatch()
+{
+ ASSERT(m_transaction);
+ ASSERT(m_transaction->isVersionChange());
+ ASSERT(m_readyState == DONE);
+ ASSERT(scriptExecutionContext());
+ m_transaction = nullptr;
+ m_readyState = PENDING;
+}
+
+void LegacyRequest::enqueueEvent(PassRefPtr<Event> event)
+{
+ ASSERT(m_readyState == PENDING || m_readyState == DONE);
+
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+
+ ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().string().utf8().data(), m_readyState);
+
+ event->setTarget(this);
+
+ if (scriptExecutionContext()->eventQueue().enqueueEvent(event.get()))
+ m_enqueuedEvents.append(event);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h
new file mode 100644
index 0000000..637fd50
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h
@@ -0,0 +1,162 @@
+/*
+ * 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 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 LegacyRequest_h
+#define LegacyRequest_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "ActiveDOMObject.h"
+#include "DOMError.h"
+#include "DOMRequestState.h"
+#include "DOMStringList.h"
+#include "Event.h"
+#include "EventListener.h"
+#include "EventTarget.h"
+#include "IDBCallbacks.h"
+#include "IDBCursor.h"
+#include "IDBDatabaseBackend.h"
+#include "IDBDatabaseCallbacks.h"
+#include "IDBOpenDBRequest.h"
+#include "LegacyAny.h"
+#include "ScriptWrappable.h"
+
+namespace WebCore {
+
+class LegacyTransaction;
+
+typedef int ExceptionCode;
+
+class LegacyRequest : public IDBOpenDBRequest, public IDBCallbacks {
+public:
+ static Ref<LegacyRequest> create(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, LegacyTransaction*);
+ static Ref<LegacyRequest> create(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType, LegacyTransaction*);
+ virtual ~LegacyRequest();
+
+ virtual PassRefPtr<IDBAny> result(ExceptionCode&) const override final;
+ PassRefPtr<LegacyAny> legacyResult(ExceptionCode&);
+ virtual unsigned short errorCode(ExceptionCode&) const override final;
+ virtual PassRefPtr<DOMError> error(ExceptionCode&) const override final;
+ virtual PassRefPtr<IDBAny> source() const override final;
+ virtual PassRefPtr<IDBTransaction> transaction() const override final;
+ virtual const String& readyState() const override final;
+
+ void preventPropagation() { m_preventPropagation = true; }
+
+ void markEarlyDeath();
+ void setCursorDetails(IndexedDB::CursorType, IndexedDB::CursorDirection);
+ void setPendingCursor(PassRefPtr<LegacyCursor>);
+ void finishCursor();
+ void abort();
+
+ // IDBCallbacks
+ virtual void onError(PassRefPtr<IDBDatabaseError>) override final;
+ virtual void onSuccess(PassRefPtr<DOMStringList>) override final;
+ virtual void onSuccess(PassRefPtr<IDBCursorBackend>) override final;
+ virtual void onSuccess(PassRefPtr<IDBKey>) override final;
+ virtual void onSuccess(PassRefPtr<SharedBuffer>) override final;
+ virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&) override final;
+ virtual void onSuccess(int64_t) override final;
+ virtual void onSuccess() override final;
+ virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>) override final;
+ virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override;
+
+ // EventTarget
+ virtual EventTargetInterface eventTargetInterface() const override;
+ virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
+ virtual void uncaughtExceptionInEventHandler() override final;
+
+ using EventTarget::dispatchEvent;
+ virtual bool dispatchEvent(PassRefPtr<Event>) override;
+
+ void transactionDidFinishAndDispatch();
+
+ IDBDatabaseBackend::TaskType taskType() { return m_taskType; }
+
+ DOMRequestState* requestState() { return &m_requestState; }
+
+ // ActiveDOMObject API.
+ bool hasPendingActivity() const override;
+
+ using IDBCallbacks::ref;
+ using IDBCallbacks::deref;
+
+protected:
+ LegacyRequest(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType, LegacyTransaction*);
+ void enqueueEvent(PassRefPtr<Event>);
+ virtual bool shouldEnqueueEvent() const;
+ void onSuccessInternal(PassRefPtr<SerializedScriptValue>);
+ void onSuccessInternal(const Deprecated::ScriptValue&);
+
+ RefPtr<LegacyAny> m_result;
+ unsigned short m_errorCode;
+ String m_errorMessage;
+ RefPtr<DOMError> m_error;
+ bool m_contextStopped;
+ RefPtr<LegacyTransaction> m_transaction;
+ ReadyState m_readyState;
+ bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
+
+private:
+ // ActiveDOMObject API.
+ void stop() override;
+ const char* activeDOMObjectName() const override;
+ bool canSuspendForPageCache() const override;
+
+ // EventTarget API.
+ virtual void refEventTarget() override final { ref(); }
+ virtual void derefEventTarget() override final { deref(); }
+
+ RefPtr<LegacyCursor> getResultCursor();
+ void setResultCursor(PassRefPtr<LegacyCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue&);
+
+ RefPtr<LegacyAny> m_source;
+ const IDBDatabaseBackend::TaskType m_taskType;
+
+ bool m_hasPendingActivity;
+ Vector<RefPtr<Event>> m_enqueuedEvents;
+
+ // Only used if the result type will be a cursor.
+ IndexedDB::CursorType m_cursorType;
+ IndexedDB::CursorDirection m_cursorDirection;
+ bool m_cursorFinished;
+ RefPtr<LegacyCursor> m_pendingCursor;
+ RefPtr<IDBKey> m_cursorKey;
+ RefPtr<IDBKey> m_cursorPrimaryKey;
+ Deprecated::ScriptValue m_cursorValue;
+ bool m_didFireUpgradeNeededEvent;
+ bool m_preventPropagation;
+
+ DOMRequestState m_requestState;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // LegacyRequest_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp
new file mode 100644
index 0000000..4acf6d6
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp
@@ -0,0 +1,380 @@
+/*
+ * 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.
+ *
+ * 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 "LegacyTransaction.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "EventException.h"
+#include "EventQueue.h"
+#include "ExceptionCodePlaceholder.h"
+#include "IDBDatabase.h"
+#include "IDBDatabaseException.h"
+#include "IDBEventDispatcher.h"
+#include "IDBIndex.h"
+#include "IDBObjectStore.h"
+#include "IDBPendingTransactionMonitor.h"
+#include "LegacyCursor.h"
+#include "LegacyObjectStore.h"
+#include "LegacyOpenDBRequest.h"
+#include "Logging.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+Ref<LegacyTransaction> LegacyTransaction::create(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, LegacyDatabase* db)
+{
+ LegacyOpenDBRequest* openDBRequest = nullptr;
+ Ref<LegacyTransaction> transaction(adoptRef(*new LegacyTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())));
+ transaction->suspendIfNeeded();
+ return transaction;
+}
+
+Ref<LegacyTransaction> LegacyTransaction::create(ScriptExecutionContext* context, int64_t id, LegacyDatabase* db, LegacyOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
+{
+ Ref<LegacyTransaction> transaction(adoptRef(*new LegacyTransaction(context, id, Vector<String>(), IndexedDB::TransactionMode::VersionChange, db, openDBRequest, previousMetadata)));
+ transaction->suspendIfNeeded();
+ return transaction;
+}
+
+LegacyTransaction::LegacyTransaction(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, LegacyDatabase* db, LegacyOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
+ : IDBTransaction(context)
+ , m_id(id)
+ , m_database(db)
+ , m_objectStoreNames(objectStoreNames)
+ , m_openDBRequest(openDBRequest)
+ , m_mode(mode)
+ , m_state(Active)
+ , m_hasPendingActivity(true)
+ , m_contextStopped(false)
+ , m_previousMetadata(previousMetadata)
+{
+ if (mode == IndexedDB::TransactionMode::VersionChange) {
+ // Not active until the callback.
+ m_state = Inactive;
+ }
+
+ // We pass a reference of this object before it can be adopted.
+ relaxAdoptionRequirement();
+ if (m_state == Active)
+ IDBPendingTransactionMonitor::addNewTransaction(this);
+ m_database->transactionCreated(this);
+}
+
+LegacyTransaction::~LegacyTransaction()
+{
+ ASSERT(m_state == Finished || m_contextStopped);
+ ASSERT(m_requestList.isEmpty() || m_contextStopped);
+}
+
+const String& LegacyTransaction::mode() const
+{
+ return modeToString(m_mode);
+}
+
+IDBDatabase* LegacyTransaction::db() const
+{
+ return m_database.get();
+}
+
+void LegacyTransaction::setError(PassRefPtr<DOMError> error, const String& errorMessage)
+{
+ ASSERT(m_state != Finished);
+ ASSERT(error);
+
+ // The first error to be set is the true cause of the
+ // transaction abort.
+ if (!m_error) {
+ m_error = error;
+ m_errorMessage = errorMessage;
+ }
+}
+
+PassRefPtr<IDBObjectStore> LegacyTransaction::objectStore(const String& name, ExceptionCode& ec)
+{
+ if (m_state == Finished) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return 0;
+ }
+
+ IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
+ if (it != m_objectStoreMap.end())
+ return it->value;
+
+ if (!isVersionChange() && !m_objectStoreNames.contains(name)) {
+ ec = IDBDatabaseException::NotFoundError;
+ return 0;
+ }
+
+ int64_t objectStoreId = m_database->findObjectStoreId(name);
+ if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
+ ASSERT(isVersionChange());
+ ec = IDBDatabaseException::NotFoundError;
+ return 0;
+ }
+
+ const IDBDatabaseMetadata& metadata = m_database->metadata();
+
+ RefPtr<LegacyObjectStore> objectStore = LegacyObjectStore::create(metadata.objectStores.get(objectStoreId), this);
+ objectStoreCreated(name, objectStore);
+ return objectStore.release();
+}
+
+void LegacyTransaction::objectStoreCreated(const String& name, PassRefPtr<LegacyObjectStore> prpObjectStore)
+{
+ ASSERT(m_state != Finished);
+ RefPtr<LegacyObjectStore> objectStore = prpObjectStore;
+ m_objectStoreMap.set(name, objectStore);
+ if (isVersionChange())
+ m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
+}
+
+void LegacyTransaction::objectStoreDeleted(const String& name)
+{
+ ASSERT(m_state != Finished);
+ ASSERT(isVersionChange());
+ IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
+ if (it != m_objectStoreMap.end()) {
+ RefPtr<LegacyObjectStore> objectStore = it->value;
+ m_objectStoreMap.remove(name);
+ objectStore->markDeleted();
+ m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
+ m_deletedObjectStores.add(objectStore);
+ }
+}
+
+void LegacyTransaction::setActive(bool active)
+{
+ LOG(StorageAPI, "LegacyTransaction::setActive(%s) for transaction id %lli", active ? "true" : "false", static_cast<long long>(m_id));
+ ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to setActive(%s)", active ? "true" : "false");
+ if (m_state == Finishing)
+ return;
+ ASSERT(active != (m_state == Active));
+ m_state = active ? Active : Inactive;
+
+ if (!active && m_requestList.isEmpty())
+ backendDB()->commit(m_id);
+}
+
+void LegacyTransaction::abort(ExceptionCode& ec)
+{
+ if (m_state == Finishing || m_state == Finished) {
+ ec = IDBDatabaseException::InvalidStateError;
+ return;
+ }
+
+ m_state = Finishing;
+
+ while (!m_requestList.isEmpty()) {
+ RefPtr<LegacyRequest> request = *m_requestList.begin();
+ m_requestList.remove(request);
+ request->abort();
+ }
+
+ RefPtr<LegacyTransaction> selfRef = this;
+ backendDB()->abort(m_id);
+}
+
+LegacyTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<LegacyTransaction> transaction, LegacyCursor* cursor)
+ : m_transaction(transaction)
+ , m_cursor(cursor)
+{
+ m_transaction->registerOpenCursor(m_cursor);
+}
+
+LegacyTransaction::OpenCursorNotifier::~OpenCursorNotifier()
+{
+ if (m_cursor)
+ m_transaction->unregisterOpenCursor(m_cursor);
+}
+
+void LegacyTransaction::OpenCursorNotifier::cursorFinished()
+{
+ if (m_cursor) {
+ m_transaction->unregisterOpenCursor(m_cursor);
+ m_cursor = nullptr;
+ m_transaction = nullptr;
+ }
+}
+
+void LegacyTransaction::registerOpenCursor(LegacyCursor* cursor)
+{
+ m_openCursors.add(cursor);
+}
+
+void LegacyTransaction::unregisterOpenCursor(LegacyCursor* cursor)
+{
+ m_openCursors.remove(cursor);
+}
+
+void LegacyTransaction::closeOpenCursors()
+{
+ HashSet<LegacyCursor*> cursors;
+ cursors.swap(m_openCursors);
+ for (auto& cursor : cursors)
+ cursor->close();
+}
+
+void LegacyTransaction::registerRequest(LegacyRequest* request)
+{
+ ASSERT(request);
+ ASSERT(m_state == Active);
+ m_requestList.add(request);
+}
+
+void LegacyTransaction::unregisterRequest(LegacyRequest* request)
+{
+ ASSERT(request);
+ // If we aborted the request, it will already have been removed.
+ m_requestList.remove(request);
+}
+
+void LegacyTransaction::onAbort(PassRefPtr<IDBDatabaseError> prpError)
+{
+ LOG(StorageAPI, "LegacyTransaction::onAbort");
+ RefPtr<IDBDatabaseError> error = prpError;
+ ASSERT(m_state != Finished);
+
+ if (m_state != Finishing) {
+ ASSERT(error.get());
+ setError(DOMError::create(error->name()), error->message());
+
+ // Abort was not triggered by front-end, so outstanding requests must
+ // be aborted now.
+ while (!m_requestList.isEmpty()) {
+ RefPtr<LegacyRequest> request = *m_requestList.begin();
+ m_requestList.remove(request);
+ request->abort();
+ }
+ m_state = Finishing;
+ }
+
+ if (isVersionChange()) {
+ for (auto& objectStore : m_objectStoreCleanupMap)
+ objectStore.key->setMetadata(objectStore.value);
+ m_database->setMetadata(m_previousMetadata);
+ m_database->close();
+ }
+ m_objectStoreCleanupMap.clear();
+ closeOpenCursors();
+
+ // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
+ enqueueEvent(Event::create(eventNames().abortEvent, true, false));
+ m_database->transactionFinished(this);
+}
+
+void LegacyTransaction::onComplete()
+{
+ LOG(StorageAPI, "LegacyTransaction::onComplete");
+ ASSERT(m_state != Finished);
+ m_state = Finishing;
+ m_objectStoreCleanupMap.clear();
+ closeOpenCursors();
+
+ // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
+ enqueueEvent(Event::create(eventNames().completeEvent, false, false));
+ m_database->transactionFinished(this);
+}
+
+bool LegacyTransaction::hasPendingActivity() const
+{
+ // FIXME: In an ideal world, we should return true as long as anyone has a or can
+ // get a handle to us or any child request object and any of those have
+ // event listeners. This is in order to handle user generated events properly.
+ return m_hasPendingActivity && !m_contextStopped;
+}
+
+bool LegacyTransaction::dispatchEvent(PassRefPtr<Event> event)
+{
+ LOG(StorageAPI, "LegacyTransaction::dispatchEvent");
+ ASSERT(m_state != Finished);
+ ASSERT(m_hasPendingActivity);
+ ASSERT(scriptExecutionContext());
+ ASSERT(event->target() == this);
+ m_state = Finished;
+
+ // Break reference cycles.
+ for (auto& objectStore : m_objectStoreMap)
+ objectStore.value->transactionFinished();
+ m_objectStoreMap.clear();
+ for (auto& objectStore : m_deletedObjectStores)
+ objectStore->transactionFinished();
+ m_deletedObjectStores.clear();
+
+ Vector<RefPtr<EventTarget>> targets;
+ targets.append(this);
+ targets.append(db());
+
+ // FIXME: When we allow custom event dispatching, this will probably need to change.
+ ASSERT(event->type() == eventNames().completeEvent || event->type() == eventNames().abortEvent);
+ bool returnValue = IDBEventDispatcher::dispatch(event.get(), targets);
+ // FIXME: Try to construct a test where |this| outlives openDBRequest and we
+ // get a crash.
+ if (m_openDBRequest) {
+ ASSERT(isVersionChange());
+ m_openDBRequest->transactionDidFinishAndDispatch();
+ }
+ m_hasPendingActivity = false;
+ return returnValue;
+}
+
+bool LegacyTransaction::canSuspendForPageCache() const
+{
+ // FIXME: Technically we can suspend before the first request is schedule
+ // and after the complete/abort event is enqueued.
+ return m_state == Finished;
+}
+
+void LegacyTransaction::stop()
+{
+ m_contextStopped = true;
+
+ abort(IGNORE_EXCEPTION);
+}
+
+const char* LegacyTransaction::activeDOMObjectName() const
+{
+ return "LegacyTransaction";
+}
+
+void LegacyTransaction::enqueueEvent(PassRefPtr<Event> event)
+{
+ ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().string().utf8().data());
+ if (m_contextStopped || !scriptExecutionContext())
+ return;
+
+ event->setTarget(this);
+ scriptExecutionContext()->eventQueue().enqueueEvent(event);
+}
+
+IDBDatabaseBackend* LegacyTransaction::backendDB() const
+{
+ return m_database->backend();
+}
+
+}
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h
new file mode 100644
index 0000000..c39e968
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ *
+ * 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 LegacyTransaction_h
+#define LegacyTransaction_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "ActiveDOMObject.h"
+#include "DOMError.h"
+#include "Event.h"
+#include "EventListener.h"
+#include "EventTarget.h"
+#include "IDBDatabaseMetadata.h"
+#include "IDBTransaction.h"
+#include "IndexedDB.h"
+#include "LegacyDatabase.h"
+#include "LegacyRequest.h"
+#include "ScriptWrappable.h"
+#include <wtf/HashSet.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class IDBDatabaseBackend;
+class IDBDatabaseError;
+class LegacyCursor;
+class LegacyObjectStore;
+class LegacyOpenDBRequest;
+struct IDBObjectStoreMetadata;
+
+class LegacyTransaction final : public IDBTransaction {
+public:
+ static Ref<LegacyTransaction> create(ScriptExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, LegacyDatabase*);
+ static Ref<LegacyTransaction> create(ScriptExecutionContext*, int64_t, LegacyDatabase*, LegacyOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
+ virtual ~LegacyTransaction();
+
+ IDBDatabaseBackend* backendDB() const;
+
+ int64_t id() const { return m_id; }
+ bool isActive() const { return m_state == Active; }
+ bool isFinished() const { return m_state == Finished; }
+ bool isReadOnly() const { return m_mode == IndexedDB::TransactionMode::ReadOnly; }
+ bool isVersionChange() const { return m_mode == IndexedDB::TransactionMode::VersionChange; }
+
+ virtual const String& mode() const override final;
+ virtual IDBDatabase* db() const override final;
+ virtual PassRefPtr<DOMError> error() const override final { return m_error; }
+ virtual PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&) override final;
+ virtual void abort(ExceptionCode&) override final;
+
+ class OpenCursorNotifier {
+ public:
+ OpenCursorNotifier(PassRefPtr<LegacyTransaction>, LegacyCursor*);
+ ~OpenCursorNotifier();
+ void cursorFinished();
+ private:
+ RefPtr<LegacyTransaction> m_transaction;
+ LegacyCursor* m_cursor;
+ };
+
+ void registerRequest(LegacyRequest*);
+ void unregisterRequest(LegacyRequest*);
+ void objectStoreCreated(const String&, PassRefPtr<LegacyObjectStore>);
+ void objectStoreDeleted(const String&);
+ void setActive(bool);
+ void setError(PassRefPtr<DOMError>, const String& errorMessage);
+
+ void onAbort(PassRefPtr<IDBDatabaseError>);
+ void onComplete();
+
+ // EventTarget
+ virtual EventTargetInterface eventTargetInterface() const override final { return IDBTransactionEventTargetInterfaceType; }
+ virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
+
+ using EventTarget::dispatchEvent;
+ virtual bool dispatchEvent(PassRefPtr<Event>) override final;
+
+ // ActiveDOMObject
+ virtual bool hasPendingActivity() const override final;
+
+private:
+ LegacyTransaction(ScriptExecutionContext*, int64_t, const Vector<String>&, IndexedDB::TransactionMode, LegacyDatabase*, LegacyOpenDBRequest*, const IDBDatabaseMetadata&);
+
+ void enqueueEvent(PassRefPtr<Event>);
+ void closeOpenCursors();
+
+ void registerOpenCursor(LegacyCursor*);
+ void unregisterOpenCursor(LegacyCursor*);
+
+ // ActiveDOMObject API.
+ bool canSuspendForPageCache() const override;
+ void stop() override;
+ const char* activeDOMObjectName() const override;
+
+ // EventTarget API.
+ virtual void refEventTarget() override { ref(); }
+ virtual void derefEventTarget() override { deref(); }
+
+ enum State {
+ Inactive, // Created or started, but not in an event callback
+ Active, // Created or started, in creation scope or an event callback
+ Finishing, // In the process of aborting or completing.
+ Finished, // No more events will fire and no new requests may be filed.
+ };
+
+ int64_t m_id;
+ RefPtr<LegacyDatabase> m_database;
+ const Vector<String> m_objectStoreNames;
+ LegacyOpenDBRequest* m_openDBRequest;
+ const IndexedDB::TransactionMode m_mode;
+ State m_state;
+ bool m_hasPendingActivity;
+ bool m_contextStopped;
+ RefPtr<DOMError> m_error;
+ String m_errorMessage;
+
+ ListHashSet<RefPtr<LegacyRequest>> m_requestList;
+
+ typedef HashMap<String, RefPtr<LegacyObjectStore>> IDBObjectStoreMap;
+ IDBObjectStoreMap m_objectStoreMap;
+
+ typedef HashSet<RefPtr<LegacyObjectStore>> IDBObjectStoreSet;
+ IDBObjectStoreSet m_deletedObjectStores;
+
+ typedef HashMap<RefPtr<LegacyObjectStore>, IDBObjectStoreMetadata> IDBObjectStoreMetadataMap;
+ IDBObjectStoreMetadataMap m_objectStoreCleanupMap;
+ IDBDatabaseMetadata m_previousMetadata;
+
+ HashSet<LegacyCursor*> m_openCursors;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // LegacyTransaction_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
similarity index 68%
copy from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
copy to Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
index 70e91c2..2adc5db 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
@@ -23,35 +23,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef IDBDatabaseCallbacks_h
-#define IDBDatabaseCallbacks_h
+#include "config.h"
+#include "LegacyVersionChangeEvent.h"
#if ENABLE(INDEXED_DATABASE)
-#include "IDBDatabaseError.h"
-#include "IndexedDB.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
namespace WebCore {
-class IDBDatabase;
+LegacyVersionChangeEvent::LegacyVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType)
+ : IDBVersionChangeEvent(eventType)
+ , m_oldVersion(oldVersion)
+ , m_newVersion(newVersion)
+{
+}
-class IDBDatabaseCallbacks : public RefCounted<IDBDatabaseCallbacks> {
-public:
- virtual ~IDBDatabaseCallbacks() { }
+LegacyVersionChangeEvent::~LegacyVersionChangeEvent()
+{
+}
- virtual void onForcedClose() = 0;
- virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion) = 0;
-
- virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) = 0;
- virtual void onComplete(int64_t transactionId) = 0;
-
- virtual void connect(IDBDatabase*) = 0;
-};
+EventInterface LegacyVersionChangeEvent::eventInterface() const
+{
+ return IDBVersionChangeEventInterfaceType;
+}
} // namespace WebCore
#endif
-
-#endif // IDBDatabaseCallbacks_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h
new file mode 100644
index 0000000..635b743
--- /dev/null
+++ b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 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 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 LegacyVersionChangeEvent_h
+#define LegacyVersionChangeEvent_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBVersionChangeEvent.h"
+#include "IndexedDB.h"
+
+namespace WebCore {
+
+class LegacyVersionChangeEvent : public IDBVersionChangeEvent {
+public:
+ static Ref<LegacyVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, const AtomicString& eventType = AtomicString())
+ {
+ return adoptRef(*new LegacyVersionChangeEvent(oldVersion, newVersion, eventType));
+ }
+
+ virtual ~LegacyVersionChangeEvent();
+
+ virtual uint64_t oldVersion() const override final { return m_oldVersion; }
+ virtual uint64_t newVersion() const override final { return m_newVersion; }
+
+ virtual EventInterface eventInterface() const override final;
+
+private:
+ LegacyVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType);
+
+ uint64_t m_oldVersion;
+ uint64_t m_newVersion;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#endif // LegacyVersionChangeEvent_h
diff --git a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
index 61bacd0..d31cbf2 100644
--- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
+++ b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
@@ -6775,7 +6775,7 @@
<ClCompile Include="..\Modules\indexeddb\DOMWindowIndexedDatabase.cpp" />
<ClCompile Include="..\Modules\indexeddb\IDBAny.cpp" />
<ClCompile Include="..\Modules\indexeddb\IDBCursor.cpp" />
- <ClCompile Include="..\Modules\indexeddb\IDBCursorBackend.cpp" />
+ <ClCompile Include="..\Modules\indexeddb\legacy\IDBCursorBackend.cpp" />
<ClCompile Include="..\Modules\indexeddb\IDBDatabase.cpp" />
<ClCompile Include="..\Modules\indexeddb\IDBFactory.cpp" />
<ClCompile Include="..\Modules\indexeddb\IDBIndex.cpp" />
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index c2f758f..54ec85a 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1906,15 +1906,18 @@
510192D218B6B9AB007FC7A1 /* ImageControlsRootElementMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 510192D018B6B9AB007FC7A1 /* ImageControlsRootElementMac.h */; };
510192D518B6B9B7007FC7A1 /* ImageControlsRootElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510192D318B6B9B7007FC7A1 /* ImageControlsRootElement.cpp */; };
510192D618B6B9B7007FC7A1 /* ImageControlsRootElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 510192D418B6B9B7007FC7A1 /* ImageControlsRootElement.h */; };
- 510194441836F7E400925523 /* IDBCursorBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510194421836F7E400925523 /* IDBCursorBackendOperations.cpp */; };
- 510194451836F7E500925523 /* IDBCursorBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 510194431836F7E400925523 /* IDBCursorBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51059DDD1820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51059DD91820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp */; };
- 51059DDE1820B17600DFF9B1 /* IDBTransactionBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 51059DDA1820B17600DFF9B1 /* IDBTransactionBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5103C2B11BA22D1A00E26337 /* LegacyAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B6E1BA0A76100F789CE /* LegacyAny.cpp */; };
+ 5103C2B21BA2317400E26337 /* IDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B501B9F889B00F789CE /* IDBTransaction.cpp */; };
+ 5103C2B31BA2324D00E26337 /* IDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B541B9F88E800F789CE /* IDBCursor.cpp */; };
+ 5103C2B41BA232AE00E26337 /* IDBCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */; };
+ 5103C2B51BA232D400E26337 /* IDBDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B441B9F889B00F789CE /* IDBDatabase.cpp */; };
+ 5103C2B61BA233BF00E26337 /* IDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4E1B9F889B00F789CE /* IDBRequest.cpp */; };
+ 5103C2B71BA233C400E26337 /* IDBOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4C1B9F889B00F789CE /* IDBOpenDBRequest.cpp */; };
+ 5103C2B81BA235C500E26337 /* IDBVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B521B9F889B00F789CE /* IDBVersionChangeEvent.cpp */; };
+ 5103C2B91BA23A2600E26337 /* LegacyAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B6F1BA0A76100F789CE /* LegacyAny.h */; };
5106D7BD18BDB76F000AB166 /* ContextMenuContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106D7BB18BDB76F000AB166 /* ContextMenuContext.cpp */; };
5106D7BE18BDB76F000AB166 /* ContextMenuContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 5106D7BC18BDB76F000AB166 /* ContextMenuContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
510A326F18318431003C5326 /* IDBServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A326E18318431003C5326 /* IDBServerConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 510B7DB7182D9F5D009BF957 /* IDBTransactionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510B7DB5182D9F5D009BF957 /* IDBTransactionBackend.cpp */; };
- 510B7DB8182D9F5D009BF957 /* IDBTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 510B7DB6182D9F5D009BF957 /* IDBTransactionBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
510D4A33103165EE0049EA54 /* SocketStreamErrorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A2D103165EE0049EA54 /* SocketStreamErrorBase.cpp */; };
510D4A34103165EE0049EA54 /* SocketStreamErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A2E103165EE0049EA54 /* SocketStreamErrorBase.h */; };
510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A30103165EE0049EA54 /* SocketStreamHandleBase.cpp */; };
@@ -1952,7 +1955,6 @@
512DD8FB0D91E6AF000F89EE /* ArchiveResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512DD8F10D91E6AF000F89EE /* ArchiveResource.cpp */; };
512DD8FC0D91E6AF000F89EE /* ArchiveResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 512DD8F20D91E6AF000F89EE /* ArchiveResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
512DD8FD0D91E6AF000F89EE /* ArchiveFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 512DD8F30D91E6AF000F89EE /* ArchiveFactory.h */; };
- 512EA9BC181F2EE0001D01E0 /* IDBPendingOpenCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 512EA9BB181F2EE0001D01E0 /* IDBPendingOpenCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
512EA9BE18202857001D01E0 /* IDBOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 512EA9BD18202857001D01E0 /* IDBOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 51327D5E11A33A2B004F9D65 /* SinkDocument.h */; };
51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */; };
@@ -1989,14 +1991,35 @@
514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76680CE923A1007EF3CD /* ResourceRequestBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
514C767E0CE923A1007EF3CD /* ResourceResponseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76690CE923A1007EF3CD /* ResourceResponseBase.cpp */; };
514C767F0CE923A1007EF3CD /* ResourceResponseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C766A0CE923A1007EF3CD /* ResourceResponseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5157D4641BA24AEE0085CA2F /* IDBFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B461B9F889B00F789CE /* IDBFactory.cpp */; };
+ 5157D4651BA24AF80085CA2F /* IDBIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B481B9F889B00F789CE /* IDBIndex.cpp */; };
+ 5157D4661BA24AFD0085CA2F /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4A1B9F889B00F789CE /* IDBObjectStore.cpp */; };
5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; };
5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; };
5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
5163117D1851242B00534647 /* IDBDatabaseMetadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5163117C1851242B00534647 /* IDBDatabaseMetadata.cpp */; };
- 516730A3182D8FBB003FAF5C /* IDBCursorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516730A1182D8FBB003FAF5C /* IDBCursorBackend.cpp */; };
- 516730A4182D8FBB003FAF5C /* IDBCursorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 516730A2182D8FBB003FAF5C /* IDBCursorBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51645B5A1B9FA6C800F789CE /* LegacyCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B281B9F639100F789CE /* LegacyCursor.cpp */; };
+ 51645B5B1B9FA6C800F789CE /* LegacyCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B291B9F639100F789CE /* LegacyCursor.h */; };
+ 51645B5C1B9FA6C800F789CE /* LegacyCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2A1B9F639100F789CE /* LegacyCursorWithValue.cpp */; };
+ 51645B5D1B9FA6C800F789CE /* LegacyCursorWithValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2B1B9F639100F789CE /* LegacyCursorWithValue.h */; };
+ 51645B5E1B9FA6C800F789CE /* LegacyDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2C1B9F639100F789CE /* LegacyDatabase.cpp */; };
+ 51645B5F1B9FA6C800F789CE /* LegacyDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2D1B9F639100F789CE /* LegacyDatabase.h */; };
+ 51645B601B9FA6C800F789CE /* LegacyFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2E1B9F639100F789CE /* LegacyFactory.cpp */; };
+ 51645B611B9FA6C800F789CE /* LegacyFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2F1B9F639100F789CE /* LegacyFactory.h */; };
+ 51645B621B9FA6C800F789CE /* LegacyIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B301B9F639100F789CE /* LegacyIndex.cpp */; };
+ 51645B631B9FA6C800F789CE /* LegacyIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B311B9F639100F789CE /* LegacyIndex.h */; };
+ 51645B641B9FA6C800F789CE /* LegacyObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B321B9F639100F789CE /* LegacyObjectStore.cpp */; };
+ 51645B651B9FA6C800F789CE /* LegacyObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B331B9F639100F789CE /* LegacyObjectStore.h */; };
+ 51645B661B9FA6C800F789CE /* LegacyOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B341B9F639100F789CE /* LegacyOpenDBRequest.cpp */; };
+ 51645B671B9FA6C800F789CE /* LegacyOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B351B9F639100F789CE /* LegacyOpenDBRequest.h */; };
+ 51645B681B9FA6C800F789CE /* LegacyRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B361B9F639100F789CE /* LegacyRequest.cpp */; };
+ 51645B691B9FA6C800F789CE /* LegacyRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B371B9F639100F789CE /* LegacyRequest.h */; };
+ 51645B6A1B9FA6C800F789CE /* LegacyTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B381B9F639100F789CE /* LegacyTransaction.cpp */; };
+ 51645B6B1B9FA6C800F789CE /* LegacyTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B391B9F639100F789CE /* LegacyTransaction.h */; };
+ 51645B6C1B9FA6C800F789CE /* LegacyVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B3A1B9F639100F789CE /* LegacyVersionChangeEvent.cpp */; };
+ 51645B6D1B9FA6C800F789CE /* LegacyVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B3B1B9F639100F789CE /* LegacyVersionChangeEvent.h */; };
516953971329A3C800B92D04 /* IconDatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516953951329A3C800B92D04 /* IconDatabaseBase.cpp */; };
516953981329A3C800B92D04 /* IconDatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 516953961329A3C800B92D04 /* IconDatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
@@ -2007,8 +2030,6 @@
51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
5174E20A10A1F44F00F95E6F /* PopStateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5174E20810A1F44F00F95E6F /* PopStateEvent.h */; };
- 51771C8E182DB4B7008E781E /* IDBDatabaseBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51771C8C182DB4B7008E781E /* IDBDatabaseBackend.cpp */; };
- 51771C8F182DB4B7008E781E /* IDBDatabaseBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51771C8D182DB4B7008E781E /* IDBDatabaseBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
5179CE24195C81420019C198 /* GamepadProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5179CE23195C81420019C198 /* GamepadProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
5179CE26195C821D0019C198 /* GamepadProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5179CE25195C821D0019C198 /* GamepadProvider.cpp */; };
5179CE2A195C91860019C198 /* GamepadProviderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5179CE29195C91860019C198 /* GamepadProviderClient.h */; };
@@ -2044,7 +2065,6 @@
51ABB5B9186D0ED1008391A1 /* IDBObjectStoreMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABB5B7186D0ED1008391A1 /* IDBObjectStoreMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
51ABF64D16392E2800132A7A /* LoaderStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */; };
51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51B07A441823248B00AA8D1A /* IDBPendingDeleteCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B07A431823248B00AA8D1A /* IDBPendingDeleteCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */; };
51B454EA1B4DAE7D0085EAA6 /* PingHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B454E91B4DAE7D0085EAA6 /* PingHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
51B45D201AB8D1E200117CD2 /* ContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B45D1E1AB8D1E200117CD2 /* ContentExtension.cpp */; };
@@ -2062,44 +2082,17 @@
51D719B7181106E00016DC51 /* DOMWindowIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */; };
51D719B9181106E00016DC51 /* IDBAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196F181106DF0016DC51 /* IDBAny.cpp */; };
51D719BA181106E00016DC51 /* IDBAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71970181106DF0016DC51 /* IDBAny.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51D719BE181106E00016DC51 /* IDBCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71974181106DF0016DC51 /* IDBCallbacks.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51D719BF181106E00016DC51 /* IDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71975181106DF0016DC51 /* IDBCursor.cpp */; };
- 51D719C0181106E00016DC51 /* IDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71976181106DF0016DC51 /* IDBCursor.h */; };
- 51D719C3181106E00016DC51 /* IDBCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71979181106DF0016DC51 /* IDBCursorWithValue.cpp */; };
- 51D719C4181106E00016DC51 /* IDBCursorWithValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7197A181106DF0016DC51 /* IDBCursorWithValue.h */; };
- 51D719C6181106E00016DC51 /* IDBDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7197C181106DF0016DC51 /* IDBDatabase.cpp */; };
- 51D719C7181106E00016DC51 /* IDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7197D181106DF0016DC51 /* IDBDatabase.h */; };
- 51D719CA181106E00016DC51 /* IDBDatabaseCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71980181106DF0016DC51 /* IDBDatabaseCallbacks.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51D719CB181106E00016DC51 /* IDBDatabaseCallbacksImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71981181106DF0016DC51 /* IDBDatabaseCallbacksImpl.cpp */; };
- 51D719CC181106E00016DC51 /* IDBDatabaseCallbacksImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71982181106DF0016DC51 /* IDBDatabaseCallbacksImpl.h */; };
51D719CD181106E00016DC51 /* IDBDatabaseError.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71983181106DF0016DC51 /* IDBDatabaseError.h */; settings = {ATTRIBUTES = (Private, ); }; };
51D719CE181106E00016DC51 /* IDBDatabaseException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71984181106DF0016DC51 /* IDBDatabaseException.cpp */; };
51D719CF181106E00016DC51 /* IDBDatabaseException.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71985181106DF0016DC51 /* IDBDatabaseException.h */; settings = {ATTRIBUTES = (Private, ); }; };
51D719D0181106E00016DC51 /* IDBEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71986181106DF0016DC51 /* IDBEventDispatcher.cpp */; };
51D719D1181106E00016DC51 /* IDBEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71987181106DF0016DC51 /* IDBEventDispatcher.h */; };
- 51D719D2181106E00016DC51 /* IDBFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71988181106DF0016DC51 /* IDBFactory.cpp */; };
- 51D719D3181106E00016DC51 /* IDBFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71989181106DF0016DC51 /* IDBFactory.h */; };
- 51D719D6181106E00016DC51 /* IDBFactoryBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7198C181106E00016DC51 /* IDBFactoryBackendInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51D719D8181106E00016DC51 /* IDBIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7198E181106E00016DC51 /* IDBIndex.cpp */; };
- 51D719D9181106E00016DC51 /* IDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7198F181106E00016DC51 /* IDBIndex.h */; };
51D719DB181106E00016DC51 /* IDBKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71991181106E00016DC51 /* IDBKey.cpp */; };
51D719DC181106E00016DC51 /* IDBKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71992181106E00016DC51 /* IDBKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
51D719DD181106E00016DC51 /* IDBKeyPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71993181106E00016DC51 /* IDBKeyPath.cpp */; };
51D719DE181106E00016DC51 /* IDBKeyPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71994181106E00016DC51 /* IDBKeyPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
51D719DF181106E00016DC51 /* IDBKeyRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71995181106E00016DC51 /* IDBKeyRange.cpp */; };
51D719E0181106E00016DC51 /* IDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71996181106E00016DC51 /* IDBKeyRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51D719E3181106E00016DC51 /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71999181106E00016DC51 /* IDBObjectStore.cpp */; };
- 51D719E4181106E00016DC51 /* IDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7199A181106E00016DC51 /* IDBObjectStore.h */; };
- 51D719E6181106E00016DC51 /* IDBOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7199C181106E00016DC51 /* IDBOpenDBRequest.cpp */; };
- 51D719E7181106E00016DC51 /* IDBOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7199D181106E00016DC51 /* IDBOpenDBRequest.h */; };
- 51D719E9181106E00016DC51 /* IDBPendingTransactionMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7199F181106E00016DC51 /* IDBPendingTransactionMonitor.cpp */; };
- 51D719EA181106E00016DC51 /* IDBPendingTransactionMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719A0181106E00016DC51 /* IDBPendingTransactionMonitor.h */; };
- 51D719EB181106E00016DC51 /* IDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D719A1181106E00016DC51 /* IDBRequest.cpp */; };
- 51D719EC181106E00016DC51 /* IDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719A2181106E00016DC51 /* IDBRequest.h */; };
- 51D719EE181106E00016DC51 /* IDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D719A4181106E00016DC51 /* IDBTransaction.cpp */; };
- 51D719EF181106E00016DC51 /* IDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719A5181106E00016DC51 /* IDBTransaction.h */; };
- 51D719F5181106E00016DC51 /* IDBVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D719AB181106E00016DC51 /* IDBVersionChangeEvent.cpp */; };
- 51D719F6181106E00016DC51 /* IDBVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719AC181106E00016DC51 /* IDBVersionChangeEvent.h */; };
51D719F8181106E00016DC51 /* IndexedDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719AE181106E00016DC51 /* IndexedDB.h */; settings = {ATTRIBUTES = (Private, ); }; };
51D719FB181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D719B1181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.cpp */; };
51D719FC181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D719B2181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.h */; };
@@ -2123,12 +2116,31 @@
51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9D40DA05E1D00250911 /* JSStorage.cpp */; };
51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4143216A6595100C633C7 /* ResourceHandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6820F16387302003BBF3C /* LoaderStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 51EAC5671815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EAC5651815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp */; };
- 51EAC5681815ED3E004F1BA4 /* IDBTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EAC5661815ED3E004F1BA4 /* IDBTransactionCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
51EAC5B218163F4E004F1BA4 /* IDBRecordIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */; };
51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */; };
51EE7B381AA50B0500F92B21 /* ResourceLoadInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
51EE7B3A1AA5123100F92B21 /* ResourceLoadInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EE7B391AA5123100F92B21 /* ResourceLoadInfo.cpp */; };
+ 51F41A681BA73B5B002E053B /* IDBCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A481BA73B2C002E053B /* IDBCallbacks.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A691BA73B5B002E053B /* IDBCursorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A491BA73B2C002E053B /* IDBCursorBackend.cpp */; };
+ 51F41A6A1BA73B5B002E053B /* IDBCursorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A4A1BA73B2C002E053B /* IDBCursorBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A6B1BA73B5B002E053B /* IDBCursorBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A4B1BA73B2C002E053B /* IDBCursorBackendOperations.cpp */; };
+ 51F41A6C1BA73B5B002E053B /* IDBCursorBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A4C1BA73B2C002E053B /* IDBCursorBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A6D1BA73B5B002E053B /* IDBDatabaseBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A4D1BA73B2C002E053B /* IDBDatabaseBackend.cpp */; };
+ 51F41A6E1BA73B5B002E053B /* IDBDatabaseBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A4E1BA73B2C002E053B /* IDBDatabaseBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A6F1BA73B5B002E053B /* IDBDatabaseCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B401B9F695E00F789CE /* IDBDatabaseCallbacks.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A701BA73B5B002E053B /* IDBDatabaseCallbacksImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B3E1B9F692300F789CE /* IDBDatabaseCallbacksImpl.cpp */; };
+ 51F41A711BA73B5B002E053B /* IDBDatabaseCallbacksImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B3F1B9F692300F789CE /* IDBDatabaseCallbacksImpl.h */; };
+ 51F41A721BA73B5B002E053B /* IDBFactoryBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A4F1BA73B2C002E053B /* IDBFactoryBackendInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A731BA73B5B002E053B /* IDBTransactionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A521BA73B2C002E053B /* IDBTransactionBackend.cpp */; };
+ 51F41A741BA73B5B002E053B /* IDBTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A531BA73B2C002E053B /* IDBTransactionBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A751BA73B5B002E053B /* IDBTransactionBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A541BA73B2C002E053B /* IDBTransactionBackendOperations.cpp */; };
+ 51F41A761BA73B5B002E053B /* IDBTransactionBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A551BA73B2C002E053B /* IDBTransactionBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A771BA73B5B002E053B /* IDBTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F41A561BA73B2C002E053B /* IDBTransactionCoordinator.cpp */; };
+ 51F41A781BA73B5B002E053B /* IDBTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A571BA73B2C002E053B /* IDBTransactionCoordinator.h */; };
+ 51F41A791BA73B5B002E053B /* IDBPendingDeleteCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A501BA73B2C002E053B /* IDBPendingDeleteCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A7A1BA73B5B002E053B /* IDBPendingOpenCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F41A511BA73B2C002E053B /* IDBPendingOpenCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51F41A7B1BA73B5B002E053B /* IDBPendingTransactionMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B3C1B9F68CF00F789CE /* IDBPendingTransactionMonitor.cpp */; };
+ 51F41A7C1BA73B5B002E053B /* IDBPendingTransactionMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B3D1B9F68CF00F789CE /* IDBPendingTransactionMonitor.h */; };
51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 517FBA18151AA71B00B57959 /* DOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
51FB5504113E3E9100821176 /* JSCloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB5502113E3E9100821176 /* JSCloseEvent.h */; };
51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
@@ -9171,15 +9183,9 @@
510192D318B6B9B7007FC7A1 /* ImageControlsRootElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageControlsRootElement.cpp; sourceTree = "<group>"; };
510192D418B6B9B7007FC7A1 /* ImageControlsRootElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageControlsRootElement.h; sourceTree = "<group>"; };
510192D818B7D7AB007FC7A1 /* imageControlsMac.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = imageControlsMac.css; sourceTree = "<group>"; };
- 510194421836F7E400925523 /* IDBCursorBackendOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorBackendOperations.cpp; sourceTree = "<group>"; };
- 510194431836F7E400925523 /* IDBCursorBackendOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackendOperations.h; sourceTree = "<group>"; };
- 51059DD91820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionBackendOperations.cpp; sourceTree = "<group>"; };
- 51059DDA1820B17600DFF9B1 /* IDBTransactionBackendOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionBackendOperations.h; sourceTree = "<group>"; };
5106D7BB18BDB76F000AB166 /* ContextMenuContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContextMenuContext.cpp; sourceTree = "<group>"; };
5106D7BC18BDB76F000AB166 /* ContextMenuContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuContext.h; sourceTree = "<group>"; };
510A326E18318431003C5326 /* IDBServerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBServerConnection.h; sourceTree = "<group>"; };
- 510B7DB5182D9F5D009BF957 /* IDBTransactionBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionBackend.cpp; sourceTree = "<group>"; };
- 510B7DB6182D9F5D009BF957 /* IDBTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionBackend.h; sourceTree = "<group>"; };
510D4A2D103165EE0049EA54 /* SocketStreamErrorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamErrorBase.cpp; sourceTree = "<group>"; };
510D4A2E103165EE0049EA54 /* SocketStreamErrorBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamErrorBase.h; sourceTree = "<group>"; };
510D4A30103165EE0049EA54 /* SocketStreamHandleBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandleBase.cpp; sourceTree = "<group>"; };
@@ -9218,7 +9224,6 @@
512DD8F10D91E6AF000F89EE /* ArchiveResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchiveResource.cpp; sourceTree = "<group>"; };
512DD8F20D91E6AF000F89EE /* ArchiveResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchiveResource.h; sourceTree = "<group>"; };
512DD8F30D91E6AF000F89EE /* ArchiveFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchiveFactory.h; sourceTree = "<group>"; };
- 512EA9BB181F2EE0001D01E0 /* IDBPendingOpenCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingOpenCall.h; sourceTree = "<group>"; };
512EA9BD18202857001D01E0 /* IDBOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBOperation.h; sourceTree = "<group>"; };
51327D5E11A33A2B004F9D65 /* SinkDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinkDocument.h; sourceTree = "<group>"; };
51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SinkDocument.cpp; sourceTree = "<group>"; };
@@ -9262,8 +9267,53 @@
5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchemeRegistry.cpp; sourceTree = "<group>"; };
5162C7F311F77EFB00612EFE /* SchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeRegistry.h; sourceTree = "<group>"; };
5163117C1851242B00534647 /* IDBDatabaseMetadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseMetadata.cpp; sourceTree = "<group>"; };
- 516730A1182D8FBB003FAF5C /* IDBCursorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorBackend.cpp; sourceTree = "<group>"; };
- 516730A2182D8FBB003FAF5C /* IDBCursorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackend.h; sourceTree = "<group>"; };
+ 51645B281B9F639100F789CE /* LegacyCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCursor.cpp; sourceTree = "<group>"; };
+ 51645B291B9F639100F789CE /* LegacyCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCursor.h; sourceTree = "<group>"; };
+ 51645B2A1B9F639100F789CE /* LegacyCursorWithValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCursorWithValue.cpp; sourceTree = "<group>"; };
+ 51645B2B1B9F639100F789CE /* LegacyCursorWithValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCursorWithValue.h; sourceTree = "<group>"; };
+ 51645B2C1B9F639100F789CE /* LegacyDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyDatabase.cpp; sourceTree = "<group>"; };
+ 51645B2D1B9F639100F789CE /* LegacyDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyDatabase.h; sourceTree = "<group>"; };
+ 51645B2E1B9F639100F789CE /* LegacyFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyFactory.cpp; sourceTree = "<group>"; };
+ 51645B2F1B9F639100F789CE /* LegacyFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyFactory.h; sourceTree = "<group>"; };
+ 51645B301B9F639100F789CE /* LegacyIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyIndex.cpp; sourceTree = "<group>"; };
+ 51645B311B9F639100F789CE /* LegacyIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIndex.h; sourceTree = "<group>"; };
+ 51645B321B9F639100F789CE /* LegacyObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyObjectStore.cpp; sourceTree = "<group>"; };
+ 51645B331B9F639100F789CE /* LegacyObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyObjectStore.h; sourceTree = "<group>"; };
+ 51645B341B9F639100F789CE /* LegacyOpenDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyOpenDBRequest.cpp; sourceTree = "<group>"; };
+ 51645B351B9F639100F789CE /* LegacyOpenDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyOpenDBRequest.h; sourceTree = "<group>"; };
+ 51645B361B9F639100F789CE /* LegacyRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRequest.cpp; sourceTree = "<group>"; };
+ 51645B371B9F639100F789CE /* LegacyRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRequest.h; sourceTree = "<group>"; };
+ 51645B381B9F639100F789CE /* LegacyTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyTransaction.cpp; sourceTree = "<group>"; };
+ 51645B391B9F639100F789CE /* LegacyTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyTransaction.h; sourceTree = "<group>"; };
+ 51645B3A1B9F639100F789CE /* LegacyVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyVersionChangeEvent.cpp; sourceTree = "<group>"; };
+ 51645B3B1B9F639100F789CE /* LegacyVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyVersionChangeEvent.h; sourceTree = "<group>"; };
+ 51645B3C1B9F68CF00F789CE /* IDBPendingTransactionMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBPendingTransactionMonitor.cpp; sourceTree = "<group>"; };
+ 51645B3D1B9F68CF00F789CE /* IDBPendingTransactionMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingTransactionMonitor.h; sourceTree = "<group>"; };
+ 51645B3E1B9F692300F789CE /* IDBDatabaseCallbacksImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseCallbacksImpl.cpp; sourceTree = "<group>"; };
+ 51645B3F1B9F692300F789CE /* IDBDatabaseCallbacksImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseCallbacksImpl.h; sourceTree = "<group>"; };
+ 51645B401B9F695E00F789CE /* IDBDatabaseCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseCallbacks.h; sourceTree = "<group>"; };
+ 51645B411B9F889B00F789CE /* IDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursor.h; sourceTree = "<group>"; };
+ 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorWithValue.cpp; sourceTree = "<group>"; };
+ 51645B431B9F889B00F789CE /* IDBCursorWithValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorWithValue.h; sourceTree = "<group>"; };
+ 51645B441B9F889B00F789CE /* IDBDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabase.cpp; sourceTree = "<group>"; };
+ 51645B451B9F889B00F789CE /* IDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabase.h; sourceTree = "<group>"; };
+ 51645B461B9F889B00F789CE /* IDBFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBFactory.cpp; sourceTree = "<group>"; };
+ 51645B471B9F889B00F789CE /* IDBFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBFactory.h; sourceTree = "<group>"; };
+ 51645B481B9F889B00F789CE /* IDBIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBIndex.cpp; sourceTree = "<group>"; };
+ 51645B491B9F889B00F789CE /* IDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBIndex.h; sourceTree = "<group>"; };
+ 51645B4A1B9F889B00F789CE /* IDBObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStore.cpp; sourceTree = "<group>"; };
+ 51645B4B1B9F889B00F789CE /* IDBObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStore.h; sourceTree = "<group>"; };
+ 51645B4C1B9F889B00F789CE /* IDBOpenDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBOpenDBRequest.cpp; sourceTree = "<group>"; };
+ 51645B4D1B9F889B00F789CE /* IDBOpenDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBOpenDBRequest.h; sourceTree = "<group>"; };
+ 51645B4E1B9F889B00F789CE /* IDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBRequest.cpp; sourceTree = "<group>"; };
+ 51645B4F1B9F889B00F789CE /* IDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRequest.h; sourceTree = "<group>"; };
+ 51645B501B9F889B00F789CE /* IDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransaction.cpp; sourceTree = "<group>"; };
+ 51645B511B9F889B00F789CE /* IDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransaction.h; sourceTree = "<group>"; };
+ 51645B521B9F889B00F789CE /* IDBVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBVersionChangeEvent.cpp; sourceTree = "<group>"; };
+ 51645B531B9F889B00F789CE /* IDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBVersionChangeEvent.h; sourceTree = "<group>"; };
+ 51645B541B9F88E800F789CE /* IDBCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursor.cpp; sourceTree = "<group>"; };
+ 51645B6E1BA0A76100F789CE /* LegacyAny.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyAny.cpp; sourceTree = "<group>"; };
+ 51645B6F1BA0A76100F789CE /* LegacyAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyAny.h; sourceTree = "<group>"; };
516953951329A3C800B92D04 /* IconDatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabaseBase.cpp; sourceTree = "<group>"; };
516953961329A3C800B92D04 /* IconDatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconDatabaseBase.h; sourceTree = "<group>"; };
516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; };
@@ -9277,8 +9327,6 @@
51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = "<group>"; };
5174E20810A1F44F00F95E6F /* PopStateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopStateEvent.h; sourceTree = "<group>"; };
5174E20B10A1F49A00F95E6F /* PopStateEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PopStateEvent.idl; sourceTree = "<group>"; };
- 51771C8C182DB4B7008E781E /* IDBDatabaseBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseBackend.cpp; sourceTree = "<group>"; };
- 51771C8D182DB4B7008E781E /* IDBDatabaseBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseBackend.h; sourceTree = "<group>"; };
5179CE23195C81420019C198 /* GamepadProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GamepadProvider.h; sourceTree = "<group>"; };
5179CE25195C821D0019C198 /* GamepadProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GamepadProvider.cpp; sourceTree = "<group>"; };
5179CE29195C91860019C198 /* GamepadProviderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GamepadProviderClient.h; sourceTree = "<group>"; };
@@ -9323,7 +9371,6 @@
51ABB5B7186D0ED1008391A1 /* IDBObjectStoreMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStoreMetadata.h; sourceTree = "<group>"; };
51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoaderStrategy.cpp; sourceTree = "<group>"; };
51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderTypes.h; sourceTree = "<group>"; };
- 51B07A431823248B00AA8D1A /* IDBPendingDeleteCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingDeleteCall.h; sourceTree = "<group>"; };
51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyWebArchiveMac.mm; sourceTree = "<group>"; };
51B454E91B4DAE7D0085EAA6 /* PingHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PingHandle.h; sourceTree = "<group>"; };
51B45D1E1AB8D1E200117CD2 /* ContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtension.cpp; sourceTree = "<group>"; };
@@ -9342,30 +9389,15 @@
51D7196F181106DF0016DC51 /* IDBAny.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBAny.cpp; sourceTree = "<group>"; };
51D71970181106DF0016DC51 /* IDBAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBAny.h; sourceTree = "<group>"; };
51D71971181106DF0016DC51 /* IDBAny.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBAny.idl; sourceTree = "<group>"; };
- 51D71974181106DF0016DC51 /* IDBCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCallbacks.h; sourceTree = "<group>"; };
- 51D71975181106DF0016DC51 /* IDBCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursor.cpp; sourceTree = "<group>"; };
- 51D71976181106DF0016DC51 /* IDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursor.h; sourceTree = "<group>"; };
51D71977181106DF0016DC51 /* IDBCursor.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursor.idl; sourceTree = "<group>"; };
- 51D71979181106DF0016DC51 /* IDBCursorWithValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorWithValue.cpp; sourceTree = "<group>"; };
- 51D7197A181106DF0016DC51 /* IDBCursorWithValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorWithValue.h; sourceTree = "<group>"; };
51D7197B181106DF0016DC51 /* IDBCursorWithValue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursorWithValue.idl; sourceTree = "<group>"; };
- 51D7197C181106DF0016DC51 /* IDBDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabase.cpp; sourceTree = "<group>"; };
- 51D7197D181106DF0016DC51 /* IDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabase.h; sourceTree = "<group>"; };
51D7197E181106DF0016DC51 /* IDBDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBDatabase.idl; sourceTree = "<group>"; };
- 51D71980181106DF0016DC51 /* IDBDatabaseCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseCallbacks.h; sourceTree = "<group>"; };
- 51D71981181106DF0016DC51 /* IDBDatabaseCallbacksImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseCallbacksImpl.cpp; sourceTree = "<group>"; };
- 51D71982181106DF0016DC51 /* IDBDatabaseCallbacksImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseCallbacksImpl.h; sourceTree = "<group>"; };
51D71983181106DF0016DC51 /* IDBDatabaseError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseError.h; sourceTree = "<group>"; };
51D71984181106DF0016DC51 /* IDBDatabaseException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseException.cpp; sourceTree = "<group>"; };
51D71985181106DF0016DC51 /* IDBDatabaseException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseException.h; sourceTree = "<group>"; };
51D71986181106DF0016DC51 /* IDBEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBEventDispatcher.cpp; sourceTree = "<group>"; };
51D71987181106DF0016DC51 /* IDBEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBEventDispatcher.h; sourceTree = "<group>"; };
- 51D71988181106DF0016DC51 /* IDBFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBFactory.cpp; sourceTree = "<group>"; };
- 51D71989181106DF0016DC51 /* IDBFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBFactory.h; sourceTree = "<group>"; };
51D7198A181106DF0016DC51 /* IDBFactory.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBFactory.idl; sourceTree = "<group>"; };
- 51D7198C181106E00016DC51 /* IDBFactoryBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBFactoryBackendInterface.h; sourceTree = "<group>"; };
- 51D7198E181106E00016DC51 /* IDBIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBIndex.cpp; sourceTree = "<group>"; };
- 51D7198F181106E00016DC51 /* IDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBIndex.h; sourceTree = "<group>"; };
51D71990181106E00016DC51 /* IDBIndex.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBIndex.idl; sourceTree = "<group>"; };
51D71991181106E00016DC51 /* IDBKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKey.cpp; sourceTree = "<group>"; };
51D71992181106E00016DC51 /* IDBKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBKey.h; sourceTree = "<group>"; };
@@ -9374,22 +9406,10 @@
51D71995181106E00016DC51 /* IDBKeyRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKeyRange.cpp; sourceTree = "<group>"; };
51D71996181106E00016DC51 /* IDBKeyRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBKeyRange.h; sourceTree = "<group>"; };
51D71997181106E00016DC51 /* IDBKeyRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBKeyRange.idl; sourceTree = "<group>"; };
- 51D71999181106E00016DC51 /* IDBObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStore.cpp; sourceTree = "<group>"; };
- 51D7199A181106E00016DC51 /* IDBObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStore.h; sourceTree = "<group>"; };
51D7199B181106E00016DC51 /* IDBObjectStore.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBObjectStore.idl; sourceTree = "<group>"; };
- 51D7199C181106E00016DC51 /* IDBOpenDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBOpenDBRequest.cpp; sourceTree = "<group>"; };
- 51D7199D181106E00016DC51 /* IDBOpenDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBOpenDBRequest.h; sourceTree = "<group>"; };
51D7199E181106E00016DC51 /* IDBOpenDBRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBOpenDBRequest.idl; sourceTree = "<group>"; };
- 51D7199F181106E00016DC51 /* IDBPendingTransactionMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBPendingTransactionMonitor.cpp; sourceTree = "<group>"; };
- 51D719A0181106E00016DC51 /* IDBPendingTransactionMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingTransactionMonitor.h; sourceTree = "<group>"; };
- 51D719A1181106E00016DC51 /* IDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBRequest.cpp; sourceTree = "<group>"; };
- 51D719A2181106E00016DC51 /* IDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRequest.h; sourceTree = "<group>"; };
51D719A3181106E00016DC51 /* IDBRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBRequest.idl; sourceTree = "<group>"; };
- 51D719A4181106E00016DC51 /* IDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransaction.cpp; sourceTree = "<group>"; };
- 51D719A5181106E00016DC51 /* IDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransaction.h; sourceTree = "<group>"; };
51D719A6181106E00016DC51 /* IDBTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBTransaction.idl; sourceTree = "<group>"; };
- 51D719AB181106E00016DC51 /* IDBVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBVersionChangeEvent.cpp; sourceTree = "<group>"; };
- 51D719AC181106E00016DC51 /* IDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBVersionChangeEvent.h; sourceTree = "<group>"; };
51D719AD181106E00016DC51 /* IDBVersionChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBVersionChangeEvent.idl; sourceTree = "<group>"; };
51D719AE181106E00016DC51 /* IndexedDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexedDB.h; sourceTree = "<group>"; };
51D719B1181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerGlobalScopeIndexedDatabase.cpp; sourceTree = "<group>"; };
@@ -9419,12 +9439,26 @@
51E3F9D50DA05E1D00250911 /* JSStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStorage.h; sourceTree = "<group>"; };
51E4143216A6595100C633C7 /* ResourceHandleTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleTypes.h; sourceTree = "<group>"; };
51E6820F16387302003BBF3C /* LoaderStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoaderStrategy.h; sourceTree = "<group>"; };
- 51EAC5651815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionCoordinator.cpp; sourceTree = "<group>"; };
- 51EAC5661815ED3E004F1BA4 /* IDBTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionCoordinator.h; sourceTree = "<group>"; };
51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRecordIdentifier.h; sourceTree = "<group>"; };
51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomSQLStatementErrorCallback.cpp; sourceTree = "<group>"; };
51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadInfo.h; sourceTree = "<group>"; };
51EE7B391AA5123100F92B21 /* ResourceLoadInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadInfo.cpp; sourceTree = "<group>"; };
+ 51F41A481BA73B2C002E053B /* IDBCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCallbacks.h; sourceTree = "<group>"; };
+ 51F41A491BA73B2C002E053B /* IDBCursorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorBackend.cpp; sourceTree = "<group>"; };
+ 51F41A4A1BA73B2C002E053B /* IDBCursorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackend.h; sourceTree = "<group>"; };
+ 51F41A4B1BA73B2C002E053B /* IDBCursorBackendOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorBackendOperations.cpp; sourceTree = "<group>"; };
+ 51F41A4C1BA73B2C002E053B /* IDBCursorBackendOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackendOperations.h; sourceTree = "<group>"; };
+ 51F41A4D1BA73B2C002E053B /* IDBDatabaseBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseBackend.cpp; sourceTree = "<group>"; };
+ 51F41A4E1BA73B2C002E053B /* IDBDatabaseBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseBackend.h; sourceTree = "<group>"; };
+ 51F41A4F1BA73B2C002E053B /* IDBFactoryBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBFactoryBackendInterface.h; sourceTree = "<group>"; };
+ 51F41A501BA73B2C002E053B /* IDBPendingDeleteCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingDeleteCall.h; sourceTree = "<group>"; };
+ 51F41A511BA73B2C002E053B /* IDBPendingOpenCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBPendingOpenCall.h; sourceTree = "<group>"; };
+ 51F41A521BA73B2C002E053B /* IDBTransactionBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionBackend.cpp; sourceTree = "<group>"; };
+ 51F41A531BA73B2C002E053B /* IDBTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionBackend.h; sourceTree = "<group>"; };
+ 51F41A541BA73B2C002E053B /* IDBTransactionBackendOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionBackendOperations.cpp; sourceTree = "<group>"; };
+ 51F41A551BA73B2C002E053B /* IDBTransactionBackendOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionBackendOperations.h; sourceTree = "<group>"; };
+ 51F41A561BA73B2C002E053B /* IDBTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionCoordinator.cpp; sourceTree = "<group>"; };
+ 51F41A571BA73B2C002E053B /* IDBTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionCoordinator.h; sourceTree = "<group>"; };
51F6A3D50663BF04004D2919 /* HTMLCanvasElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLCanvasElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLCanvasElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51FB5502113E3E9100821176 /* JSCloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCloseEvent.h; sourceTree = "<group>"; };
@@ -16552,6 +16586,56 @@
path = mac;
sourceTree = "<group>";
};
+ 51645B271B9F637E00F789CE /* legacy */ = {
+ isa = PBXGroup;
+ children = (
+ 51F41A481BA73B2C002E053B /* IDBCallbacks.h */,
+ 51F41A491BA73B2C002E053B /* IDBCursorBackend.cpp */,
+ 51F41A4A1BA73B2C002E053B /* IDBCursorBackend.h */,
+ 51F41A4B1BA73B2C002E053B /* IDBCursorBackendOperations.cpp */,
+ 51F41A4C1BA73B2C002E053B /* IDBCursorBackendOperations.h */,
+ 51F41A4D1BA73B2C002E053B /* IDBDatabaseBackend.cpp */,
+ 51F41A4E1BA73B2C002E053B /* IDBDatabaseBackend.h */,
+ 51645B401B9F695E00F789CE /* IDBDatabaseCallbacks.h */,
+ 51645B3E1B9F692300F789CE /* IDBDatabaseCallbacksImpl.cpp */,
+ 51645B3F1B9F692300F789CE /* IDBDatabaseCallbacksImpl.h */,
+ 51F41A4F1BA73B2C002E053B /* IDBFactoryBackendInterface.h */,
+ 51F41A521BA73B2C002E053B /* IDBTransactionBackend.cpp */,
+ 51F41A531BA73B2C002E053B /* IDBTransactionBackend.h */,
+ 51F41A541BA73B2C002E053B /* IDBTransactionBackendOperations.cpp */,
+ 51F41A551BA73B2C002E053B /* IDBTransactionBackendOperations.h */,
+ 51F41A561BA73B2C002E053B /* IDBTransactionCoordinator.cpp */,
+ 51F41A571BA73B2C002E053B /* IDBTransactionCoordinator.h */,
+ 51F41A501BA73B2C002E053B /* IDBPendingDeleteCall.h */,
+ 51F41A511BA73B2C002E053B /* IDBPendingOpenCall.h */,
+ 51645B3C1B9F68CF00F789CE /* IDBPendingTransactionMonitor.cpp */,
+ 51645B3D1B9F68CF00F789CE /* IDBPendingTransactionMonitor.h */,
+ 51645B6E1BA0A76100F789CE /* LegacyAny.cpp */,
+ 51645B6F1BA0A76100F789CE /* LegacyAny.h */,
+ 51645B281B9F639100F789CE /* LegacyCursor.cpp */,
+ 51645B291B9F639100F789CE /* LegacyCursor.h */,
+ 51645B2A1B9F639100F789CE /* LegacyCursorWithValue.cpp */,
+ 51645B2B1B9F639100F789CE /* LegacyCursorWithValue.h */,
+ 51645B2C1B9F639100F789CE /* LegacyDatabase.cpp */,
+ 51645B2D1B9F639100F789CE /* LegacyDatabase.h */,
+ 51645B2E1B9F639100F789CE /* LegacyFactory.cpp */,
+ 51645B2F1B9F639100F789CE /* LegacyFactory.h */,
+ 51645B301B9F639100F789CE /* LegacyIndex.cpp */,
+ 51645B311B9F639100F789CE /* LegacyIndex.h */,
+ 51645B321B9F639100F789CE /* LegacyObjectStore.cpp */,
+ 51645B331B9F639100F789CE /* LegacyObjectStore.h */,
+ 51645B341B9F639100F789CE /* LegacyOpenDBRequest.cpp */,
+ 51645B351B9F639100F789CE /* LegacyOpenDBRequest.h */,
+ 51645B361B9F639100F789CE /* LegacyRequest.cpp */,
+ 51645B371B9F639100F789CE /* LegacyRequest.h */,
+ 51645B381B9F639100F789CE /* LegacyTransaction.cpp */,
+ 51645B391B9F639100F789CE /* LegacyTransaction.h */,
+ 51645B3A1B9F639100F789CE /* LegacyVersionChangeEvent.cpp */,
+ 51645B3B1B9F639100F789CE /* LegacyVersionChangeEvent.h */,
+ );
+ path = legacy;
+ sourceTree = "<group>";
+ };
51741D080B07257000ED442C /* history */ = {
isa = PBXGroup;
children = (
@@ -18651,31 +18735,22 @@
9712A55315004E3C0048AF10 /* indexeddb */ = {
isa = PBXGroup;
children = (
+ 51645B271B9F637E00F789CE /* legacy */,
51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */,
51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */,
51D7196E181106DF0016DC51 /* DOMWindowIndexedDatabase.idl */,
51D7196F181106DF0016DC51 /* IDBAny.cpp */,
51D71970181106DF0016DC51 /* IDBAny.h */,
51D71971181106DF0016DC51 /* IDBAny.idl */,
- 51D71974181106DF0016DC51 /* IDBCallbacks.h */,
- 51D71975181106DF0016DC51 /* IDBCursor.cpp */,
- 51D71976181106DF0016DC51 /* IDBCursor.h */,
+ 51645B541B9F88E800F789CE /* IDBCursor.cpp */,
+ 51645B411B9F889B00F789CE /* IDBCursor.h */,
51D71977181106DF0016DC51 /* IDBCursor.idl */,
- 516730A1182D8FBB003FAF5C /* IDBCursorBackend.cpp */,
- 516730A2182D8FBB003FAF5C /* IDBCursorBackend.h */,
- 510194421836F7E400925523 /* IDBCursorBackendOperations.cpp */,
- 510194431836F7E400925523 /* IDBCursorBackendOperations.h */,
- 51D71979181106DF0016DC51 /* IDBCursorWithValue.cpp */,
- 51D7197A181106DF0016DC51 /* IDBCursorWithValue.h */,
+ 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */,
+ 51645B431B9F889B00F789CE /* IDBCursorWithValue.h */,
51D7197B181106DF0016DC51 /* IDBCursorWithValue.idl */,
- 51D7197C181106DF0016DC51 /* IDBDatabase.cpp */,
- 51D7197D181106DF0016DC51 /* IDBDatabase.h */,
+ 51645B441B9F889B00F789CE /* IDBDatabase.cpp */,
+ 51645B451B9F889B00F789CE /* IDBDatabase.h */,
51D7197E181106DF0016DC51 /* IDBDatabase.idl */,
- 51771C8C182DB4B7008E781E /* IDBDatabaseBackend.cpp */,
- 51771C8D182DB4B7008E781E /* IDBDatabaseBackend.h */,
- 51D71980181106DF0016DC51 /* IDBDatabaseCallbacks.h */,
- 51D71981181106DF0016DC51 /* IDBDatabaseCallbacksImpl.cpp */,
- 51D71982181106DF0016DC51 /* IDBDatabaseCallbacksImpl.h */,
51D71983181106DF0016DC51 /* IDBDatabaseError.h */,
51D71984181106DF0016DC51 /* IDBDatabaseException.cpp */,
51D71985181106DF0016DC51 /* IDBDatabaseException.h */,
@@ -18683,13 +18758,12 @@
51C9611A183D2B8000D2002E /* IDBDatabaseMetadata.h */,
51D71986181106DF0016DC51 /* IDBEventDispatcher.cpp */,
51D71987181106DF0016DC51 /* IDBEventDispatcher.h */,
- 51D71988181106DF0016DC51 /* IDBFactory.cpp */,
- 51D71989181106DF0016DC51 /* IDBFactory.h */,
+ 51645B461B9F889B00F789CE /* IDBFactory.cpp */,
+ 51645B471B9F889B00F789CE /* IDBFactory.h */,
51D7198A181106DF0016DC51 /* IDBFactory.idl */,
- 51D7198C181106E00016DC51 /* IDBFactoryBackendInterface.h */,
5123AF1C18918AE40031CDC9 /* IDBGetResult.h */,
- 51D7198E181106E00016DC51 /* IDBIndex.cpp */,
- 51D7198F181106E00016DC51 /* IDBIndex.h */,
+ 51645B481B9F889B00F789CE /* IDBIndex.cpp */,
+ 51645B491B9F889B00F789CE /* IDBIndex.h */,
51D71990181106E00016DC51 /* IDBIndex.idl */,
51ABB5B6186D0ED1008391A1 /* IDBIndexMetadata.h */,
51D71991181106E00016DC51 /* IDBKey.cpp */,
@@ -18703,34 +18777,24 @@
51D71997181106E00016DC51 /* IDBKeyRange.idl */,
5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.cpp */,
5123AF171890A4CA0031CDC9 /* IDBKeyRangeData.h */,
- 51D71999181106E00016DC51 /* IDBObjectStore.cpp */,
- 51D7199A181106E00016DC51 /* IDBObjectStore.h */,
+ 51645B4A1B9F889B00F789CE /* IDBObjectStore.cpp */,
+ 51645B4B1B9F889B00F789CE /* IDBObjectStore.h */,
51D7199B181106E00016DC51 /* IDBObjectStore.idl */,
51ABB5B7186D0ED1008391A1 /* IDBObjectStoreMetadata.h */,
- 51D7199C181106E00016DC51 /* IDBOpenDBRequest.cpp */,
- 51D7199D181106E00016DC51 /* IDBOpenDBRequest.h */,
+ 51645B4C1B9F889B00F789CE /* IDBOpenDBRequest.cpp */,
+ 51645B4D1B9F889B00F789CE /* IDBOpenDBRequest.h */,
51D7199E181106E00016DC51 /* IDBOpenDBRequest.idl */,
512EA9BD18202857001D01E0 /* IDBOperation.h */,
- 51B07A431823248B00AA8D1A /* IDBPendingDeleteCall.h */,
- 512EA9BB181F2EE0001D01E0 /* IDBPendingOpenCall.h */,
- 51D7199F181106E00016DC51 /* IDBPendingTransactionMonitor.cpp */,
- 51D719A0181106E00016DC51 /* IDBPendingTransactionMonitor.h */,
51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */,
- 51D719A1181106E00016DC51 /* IDBRequest.cpp */,
- 51D719A2181106E00016DC51 /* IDBRequest.h */,
+ 51645B4E1B9F889B00F789CE /* IDBRequest.cpp */,
+ 51645B4F1B9F889B00F789CE /* IDBRequest.h */,
51D719A3181106E00016DC51 /* IDBRequest.idl */,
510A326E18318431003C5326 /* IDBServerConnection.h */,
- 51D719A4181106E00016DC51 /* IDBTransaction.cpp */,
- 51D719A5181106E00016DC51 /* IDBTransaction.h */,
+ 51645B501B9F889B00F789CE /* IDBTransaction.cpp */,
+ 51645B511B9F889B00F789CE /* IDBTransaction.h */,
51D719A6181106E00016DC51 /* IDBTransaction.idl */,
- 510B7DB5182D9F5D009BF957 /* IDBTransactionBackend.cpp */,
- 510B7DB6182D9F5D009BF957 /* IDBTransactionBackend.h */,
- 51059DD91820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp */,
- 51059DDA1820B17600DFF9B1 /* IDBTransactionBackendOperations.h */,
- 51EAC5651815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp */,
- 51EAC5661815ED3E004F1BA4 /* IDBTransactionCoordinator.h */,
- 51D719AB181106E00016DC51 /* IDBVersionChangeEvent.cpp */,
- 51D719AC181106E00016DC51 /* IDBVersionChangeEvent.h */,
+ 51645B521B9F889B00F789CE /* IDBVersionChangeEvent.cpp */,
+ 51645B531B9F889B00F789CE /* IDBVersionChangeEvent.h */,
51D719AD181106E00016DC51 /* IDBVersionChangeEvent.idl */,
51D719AE181106E00016DC51 /* IndexedDB.h */,
51D719B1181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.cpp */,
@@ -23984,6 +24048,7 @@
073AB4B317F8BACA006E0D6F /* AllVideoCapabilities.h in Headers */,
CEDA12D7152CA1CB00D9E08D /* AlternativeTextClient.h in Headers */,
CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */,
+ 51F41A761BA73B5B002E053B /* IDBTransactionBackendOperations.h in Headers */,
CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */,
FD31603E12B0267600C1A359 /* AnalyserNode.h in Headers */,
31A795C71888BCB200382F90 /* ANGLEInstancedArrays.h in Headers */,
@@ -24014,6 +24079,7 @@
0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */,
37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
A8C4A80D09D563270003AC8D /* Attr.h in Headers */,
+ 51645B5D1B9FA6C800F789CE /* LegacyCursorWithValue.h in Headers */,
A8C4A80B09D563270003AC8D /* Attribute.h in Headers */,
FD31607A12B026F700C1A359 /* AudioArray.h in Headers */,
FD629EA3154B47160006D026 /* AudioBasicInspectorNode.h in Headers */,
@@ -24547,6 +24613,7 @@
85B498ED0ADB32FB00925CBB /* DOMCSSRuleInternal.h in Headers */,
85032DE30AA8C9BE007D3B7D /* DOMCSSRuleList.h in Headers */,
85E711920AC5D5350053270F /* DOMCSSRuleListInternal.h in Headers */,
+ 51645B5B1B9FA6C800F789CE /* LegacyCursor.h in Headers */,
85032DE50AA8C9BE007D3B7D /* DOMCSSStyleDeclaration.h in Headers */,
2DB9C4AA1B3231F40070F27F /* NSEventSPI.h in Headers */,
85E711930AC5D5350053270F /* DOMCSSStyleDeclarationInternal.h in Headers */,
@@ -24561,6 +24628,7 @@
858C381C0AA8E29600B187A4 /* DOMCSSValue.h in Headers */,
85B498F30ADB336A00925CBB /* DOMCSSValueInternal.h in Headers */,
26F756B31B3B66F70005DD79 /* ImmutableNFA.h in Headers */,
+ 51F41A781BA73B5B002E053B /* IDBTransactionCoordinator.h in Headers */,
858C383C0AA8ED8200B187A4 /* DOMCSSValueList.h in Headers */,
85909D2B0ACC7D5500DF01F1 /* DOMCSSValueListInternal.h in Headers */,
E10B9CCC0B747A44003ED890 /* DOMCustomXPathNSResolver.h in Headers */,
@@ -24797,6 +24865,7 @@
85ACA99C0A9B575900671E90 /* DOMText.h in Headers */,
DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */,
85E711D90AC5D5350053270F /* DOMTextInternal.h in Headers */,
+ 51645B6D1B9FA6C800F789CE /* LegacyVersionChangeEvent.h in Headers */,
188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */,
@@ -24950,6 +25019,7 @@
976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */,
2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
1A88A90517553CD7000C74F9 /* FileIconLoader.h in Headers */,
+ 51645B631B9FA6C800F789CE /* LegacyIndex.h in Headers */,
F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */,
976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */,
@@ -25105,6 +25175,7 @@
93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */,
A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */,
+ 51F41A6A1BA73B5B002E053B /* IDBCursorBackend.h in Headers */,
7C3E510A18DF8F3500C112F7 /* HTMLConverter.h in Headers */,
F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */,
D359D78A129CA2710006E5D2 /* HTMLDetailsElement.h in Headers */,
@@ -25224,44 +25295,21 @@
45BAC2B01360BBAB005DA258 /* IconURL.h in Headers */,
51D719BA181106E00016DC51 /* IDBAny.h in Headers */,
C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */,
- 51D719BE181106E00016DC51 /* IDBCallbacks.h in Headers */,
- 51D719C0181106E00016DC51 /* IDBCursor.h in Headers */,
- 516730A4182D8FBB003FAF5C /* IDBCursorBackend.h in Headers */,
- 510194451836F7E500925523 /* IDBCursorBackendOperations.h in Headers */,
- 51D719C4181106E00016DC51 /* IDBCursorWithValue.h in Headers */,
- 51D719C7181106E00016DC51 /* IDBDatabase.h in Headers */,
- 51771C8F182DB4B7008E781E /* IDBDatabaseBackend.h in Headers */,
- 51D719CA181106E00016DC51 /* IDBDatabaseCallbacks.h in Headers */,
- 51D719CC181106E00016DC51 /* IDBDatabaseCallbacksImpl.h in Headers */,
51D719CD181106E00016DC51 /* IDBDatabaseError.h in Headers */,
51D719CF181106E00016DC51 /* IDBDatabaseException.h in Headers */,
51C9611B183D2B8000D2002E /* IDBDatabaseMetadata.h in Headers */,
51D719D1181106E00016DC51 /* IDBEventDispatcher.h in Headers */,
- 51D719D3181106E00016DC51 /* IDBFactory.h in Headers */,
- 51D719D6181106E00016DC51 /* IDBFactoryBackendInterface.h in Headers */,
5123AF1D18918AE40031CDC9 /* IDBGetResult.h in Headers */,
- 51D719D9181106E00016DC51 /* IDBIndex.h in Headers */,
51ABB5B8186D0ED1008391A1 /* IDBIndexMetadata.h in Headers */,
51D719DC181106E00016DC51 /* IDBKey.h in Headers */,
511EC1A6188DACA400BA3EB6 /* IDBKeyData.h in Headers */,
51D719DE181106E00016DC51 /* IDBKeyPath.h in Headers */,
51D719E0181106E00016DC51 /* IDBKeyRange.h in Headers */,
5123AF191890A4CA0031CDC9 /* IDBKeyRangeData.h in Headers */,
- 51D719E4181106E00016DC51 /* IDBObjectStore.h in Headers */,
51ABB5B9186D0ED1008391A1 /* IDBObjectStoreMetadata.h in Headers */,
- 51D719E7181106E00016DC51 /* IDBOpenDBRequest.h in Headers */,
512EA9BE18202857001D01E0 /* IDBOperation.h in Headers */,
- 51B07A441823248B00AA8D1A /* IDBPendingDeleteCall.h in Headers */,
- 512EA9BC181F2EE0001D01E0 /* IDBPendingOpenCall.h in Headers */,
- 51D719EA181106E00016DC51 /* IDBPendingTransactionMonitor.h in Headers */,
51EAC5B218163F4E004F1BA4 /* IDBRecordIdentifier.h in Headers */,
- 51D719EC181106E00016DC51 /* IDBRequest.h in Headers */,
510A326F18318431003C5326 /* IDBServerConnection.h in Headers */,
- 51D719EF181106E00016DC51 /* IDBTransaction.h in Headers */,
- 510B7DB8182D9F5D009BF957 /* IDBTransactionBackend.h in Headers */,
- 51059DDE1820B17600DFF9B1 /* IDBTransactionBackendOperations.h in Headers */,
- 51EAC5681815ED3E004F1BA4 /* IDBTransactionCoordinator.h in Headers */,
- 51D719F6181106E00016DC51 /* IDBVersionChangeEvent.h in Headers */,
1A71D57C0F33819000F9CE4E /* IdentifierRep.h in Headers */,
49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */,
C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */,
@@ -25352,6 +25400,7 @@
E134F5AB12EE343F004EC58D /* IntRectHash.h in Headers */,
B27535750B053814002CE64F /* IntSize.h in Headers */,
B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
+ 51F41A6C1BA73B5B002E053B /* IDBCursorBackendOperations.h in Headers */,
CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
44DEF6431A6FF92700D45EEC /* IOReturnSPI.h in Headers */,
2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
@@ -25368,6 +25417,7 @@
65DF31DB09D1C123000BE325 /* JSAttr.h in Headers */,
FDA15E9E12B03EE1003A583A /* JSAudioBuffer.h in Headers */,
FDF7E9C413AC21DB00A51EAC /* JSAudioBufferCallback.h in Headers */,
+ 51645B5F1B9FA6C800F789CE /* LegacyDatabase.h in Headers */,
FDA15EA012B03EE1003A583A /* JSAudioBufferSourceNode.h in Headers */,
FDA15EA612B03EE1003A583A /* JSAudioContext.h in Headers */,
51B454EA1B4DAE7D0085EAA6 /* PingHandle.h in Headers */,
@@ -25402,6 +25452,7 @@
93F9B6E10BA0FB7200854064 /* JSComment.h in Headers */,
79AC9219109945C80021266E /* JSCompositionEvent.h in Headers */,
FDA15EBE12B03F0B003A583A /* JSConvolverNode.h in Headers */,
+ 5103C2B91BA23A2600E26337 /* LegacyAny.h in Headers */,
FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */,
930705DA09E0C9BF00B17FE4 /* JSCounter.h in Headers */,
975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
@@ -25486,6 +25537,7 @@
5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */,
3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */,
724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */,
+ 51F41A791BA73B5B002E053B /* IDBPendingDeleteCall.h in Headers */,
5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */,
7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */,
BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
@@ -25777,6 +25829,7 @@
B2FA3D8B0AB75A6F000E5AC4 /* JSSVGFEOffsetElement.h in Headers */,
B2FA3D8D0AB75A6F000E5AC4 /* JSSVGFEPointLightElement.h in Headers */,
B2FA3D8F0AB75A6F000E5AC4 /* JSSVGFESpecularLightingElement.h in Headers */,
+ 51F41A6E1BA73B5B002E053B /* IDBDatabaseBackend.h in Headers */,
B2FA3D910AB75A6F000E5AC4 /* JSSVGFESpotLightElement.h in Headers */,
B2FA3D930AB75A6F000E5AC4 /* JSSVGFETileElement.h in Headers */,
B2FA3D950AB75A6F000E5AC4 /* JSSVGFETurbulenceElement.h in Headers */,
@@ -25820,6 +25873,7 @@
B2FA3DC70AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticAbs.h in Headers */,
B2FA3DC90AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticRel.h in Headers */,
B2FA3DCB0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothAbs.h in Headers */,
+ 51645B611B9FA6C800F789CE /* LegacyFactory.h in Headers */,
B2FA3DCD0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothRel.h in Headers */,
B2FA3DCF0AB75A6F000E5AC4 /* JSSVGPathSegLinetoAbs.h in Headers */,
B2FA3DD10AB75A6F000E5AC4 /* JSSVGPathSegLinetoHorizontalAbs.h in Headers */,
@@ -25933,6 +25987,7 @@
65DF320609D1CC60000BE325 /* JSWheelEvent.h in Headers */,
E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */,
E18256900EF2B02D00933242 /* JSWorkerGlobalScope.h in Headers */,
+ 51F41A7C1BA73B5B002E053B /* IDBPendingTransactionMonitor.h in Headers */,
150524F41B712FF600696AA9 /* MediaPlayerPrivateMediaStreamAVFObjC.h in Headers */,
E1C36D350EB0A094007410BC /* JSWorkerGlobalScopeBase.h in Headers */,
E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
@@ -26010,6 +26065,7 @@
2D413F611A187A3F0041A521 /* LookupSPI.h in Headers */,
1A0409DC1A4360B5009E47F3 /* MachSendRight.h in Headers */,
CE12524F1A1A78D200864480 /* MachVMSPI.h in Headers */,
+ 51645B6B1B9FA6C800F789CE /* LegacyTransaction.h in Headers */,
932AD70617EFA2C40038F8FF /* MainFrame.h in Headers */,
1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
@@ -26188,6 +26244,7 @@
1A569D0F0D7E2B82007C3983 /* npruntime_impl.h in Headers */,
1A569D100D7E2B82007C3983 /* npruntime_internal.h in Headers */,
1A569D110D7E2B82007C3983 /* npruntime_priv.h in Headers */,
+ 51645B691B9FA6C800F789CE /* LegacyRequest.h in Headers */,
1A927FD41416A15B003A83C8 /* nptypes.h in Headers */,
CE1252511A1BEBD800864480 /* NSCalendarDateSPI.h in Headers */,
31DF63571AF187DD0078FD91 /* NSColorSPI.h in Headers */,
@@ -26197,6 +26254,7 @@
9321D5901A390704008052BE /* NSImmediateActionGestureRecognizerSPI.h in Headers */,
937F4CCE1A2D4B0100BB39F5 /* NSMenuSPI.h in Headers */,
CE1252471A16C2C200864480 /* NSPointerFunctionsSPI.h in Headers */,
+ 51F41A741BA73B5B002E053B /* IDBTransactionBackend.h in Headers */,
93F1E1EC1A40FDDC00348D13 /* NSPopoverSPI.h in Headers */,
93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */,
2DCB837919F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h in Headers */,
@@ -26246,6 +26304,7 @@
2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */,
FBDB61A116D6037E00BB3394 /* PageRuleCollector.h in Headers */,
F3820895147D35F90010BC06 /* PageRuntimeAgent.h in Headers */,
+ 51F41A6F1BA73B5B002E053B /* IDBDatabaseCallbacks.h in Headers */,
A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */,
371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */,
A7197F24175689C4007B9442 /* PageThrottler.h in Headers */,
@@ -26419,6 +26478,7 @@
A871DED30A1530C700B12A68 /* RenderFrame.h in Headers */,
0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */,
A871DED10A1530C700B12A68 /* RenderFrameSet.h in Headers */,
+ 51645B671B9FA6C800F789CE /* LegacyOpenDBRequest.h in Headers */,
CDEA7C841276230400B846DD /* RenderFullScreen.h in Headers */,
0F3F0E5A157030C3006DA57F /* RenderGeometryMap.h in Headers */,
BC128A73137C867C00CAC845 /* RenderGrid.h in Headers */,
@@ -26613,6 +26673,7 @@
078E092C17D14D1C00420AA1 /* RTCStatsResponse.h in Headers */,
078E094617D16E1C00420AA1 /* RTCStatsResponseBase.h in Headers */,
078E094717D16E1C00420AA1 /* RTCVoidRequest.h in Headers */,
+ 51F41A711BA73B5B002E053B /* IDBDatabaseCallbacksImpl.h in Headers */,
078E092D17D14D1C00420AA1 /* RTCVoidRequestImpl.h in Headers */,
5824ABA31AE81116009074B7 /* RubyElement.h in Headers */,
5824ABA71AE81384009074B7 /* RubyTextElement.h in Headers */,
@@ -26783,6 +26844,7 @@
1A22464C0CC98DDB00C05240 /* SQLiteStatement.h in Headers */,
1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */,
97BC6A421505F081001B74AC /* SQLResultSet.h in Headers */,
+ 51F41A721BA73B5B002E053B /* IDBFactoryBackendInterface.h in Headers */,
97BC6A451505F081001B74AC /* SQLResultSetRowList.h in Headers */,
FE8A674816CDD19E00930BF8 /* SQLStatement.h in Headers */,
97BC6A491505F081001B74AC /* SQLStatementCallback.h in Headers */,
@@ -27247,6 +27309,7 @@
868160D618766A130021E79D /* UserActivity.h in Headers */,
26255F0318878E110006E1FD /* UserAgent.h in Headers */,
CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */,
+ 51645B651B9FA6C800F789CE /* LegacyObjectStore.h in Headers */,
656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */,
1AE79D43188DB61F002239C2 /* UserContentController.h in Headers */,
003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */,
@@ -27254,6 +27317,7 @@
2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */,
9920398318B95BC600B39AF9 /* UserInputBridge.h in Headers */,
078E092E17D14D1C00420AA1 /* UserMediaClient.h in Headers */,
+ 51F41A681BA73B5B002E053B /* IDBCallbacks.h in Headers */,
078E092F17D14D1C00420AA1 /* UserMediaController.h in Headers */,
078E093017D14D1C00420AA1 /* UserMediaRequest.h in Headers */,
7C3B79721908757B00B47A2D /* UserMessageHandler.h in Headers */,
@@ -27337,6 +27401,7 @@
A14832CC187F67C400DA63A6 /* WebCoreThreadRun.h in Headers */,
A14832CD187F682E00DA63A6 /* WebCoreThreadSafe.h in Headers */,
A14832CF187F684700DA63A6 /* WebCoreThreadSystemInterface.h in Headers */,
+ 51F41A7A1BA73B5B002E053B /* IDBPendingOpenCall.h in Headers */,
0F099D0917B968A100FF84B9 /* WebCoreTypedArrayController.h in Headers */,
37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */,
44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */,
@@ -28036,6 +28101,7 @@
41D015CB0F4B5C71004A662F /* ContentType.cpp in Sources */,
97627B8D14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp in Sources */,
5106D7BD18BDB76F000AB166 /* ContextMenuContext.cpp in Sources */,
+ 51F41A6D1BA73B5B002E053B /* IDBDatabaseBackend.cpp in Sources */,
065AD4F60B0C2EDA005A2B1D /* ContextMenuController.cpp in Sources */,
06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
93B6A0EA0B0BCA8400F5027A /* ContextMenuMac.mm in Sources */,
@@ -28060,6 +28126,7 @@
E1C415DE0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp in Sources */,
2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */,
E16980491133644700894115 /* CRuntimeObject.cpp in Sources */,
+ 51645B601B9FA6C800F789CE /* LegacyFactory.cpp in Sources */,
975CA28A130365F800E99AD9 /* Crypto.cpp in Sources */,
E172AF6D180F24C600FBADB9 /* CryptoAlgorithm.cpp in Sources */,
E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */,
@@ -28134,6 +28201,7 @@
A80E6CF50A1989CA007FB8C5 /* CSSPageRule.cpp in Sources */,
BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */,
BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */,
+ 5103C2B41BA232AE00E26337 /* IDBCursorWithValue.cpp in Sources */,
977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
@@ -28373,6 +28441,7 @@
52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */,
8518DD790A9CF31B0091B7A6 /* DOMNamedNodeMap.mm in Sources */,
853BF4DC0ABB6B55008647BB /* DOMNode.mm in Sources */,
+ 51645B661B9FA6C800F789CE /* LegacyOpenDBRequest.cpp in Sources */,
85526C380AB0A17E000302EA /* DOMNodeIterator.mm in Sources */,
85ACAA8E0A9B759C00671E90 /* DOMNodeList.mm in Sources */,
856C8AE50A912649005C687B /* DOMObject.mm in Sources */,
@@ -28452,6 +28521,7 @@
A8C4A80809D563270003AC8D /* Element.cpp in Sources */,
B5B7A17017C10AA800E4AA0A /* ElementData.cpp in Sources */,
4FFC022D1643B726004E1638 /* ElementRareData.cpp in Sources */,
+ 51F41A691BA73B5B002E053B /* IDBCursorBackend.cpp in Sources */,
FBDB619B16D6032A00BB3394 /* ElementRuleCollector.cpp in Sources */,
A8CFF6CB0A1561CD000A4234 /* EllipsisBox.cpp in Sources */,
F55B3DBB1251F12D003EF269 /* EmailInputType.cpp in Sources */,
@@ -28549,6 +28619,7 @@
51E3AA0A1B98BCAB0036AD81 /* SecurityOriginData.cpp in Sources */,
B6D9D23614EABD260090D75E /* FocusEvent.cpp in Sources */,
B2C3DA640D006CD600EF6F26 /* Font.cpp in Sources */,
+ 51645B6C1B9FA6C800F789CE /* LegacyVersionChangeEvent.cpp in Sources */,
B2C3DA620D006CD600EF6F26 /* FontCache.cpp in Sources */,
3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */,
B2AFFC7C0D00A5C10030074D /* FontCacheMac.mm in Sources */,
@@ -28660,6 +28731,7 @@
93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
+ 5103C2B51BA232D400E26337 /* IDBDatabase.cpp in Sources */,
977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */,
A871D45F0A127CBC00B12A68 /* HTMLEmbedElement.cpp in Sources */,
977B3869122883E900B81FF8 /* HTMLEntityParser.cpp in Sources */,
@@ -28751,6 +28823,7 @@
E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
839AAFEC1A0C0C8D00605F99 /* HTMLWBRElement.cpp in Sources */,
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
+ 51645B5A1B9FA6C800F789CE /* LegacyCursor.cpp in Sources */,
1AC900C31943C0FC008625B5 /* HTTPHeaderNames.cpp in Sources */,
514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */,
@@ -28764,32 +28837,14 @@
51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
51D719B9181106E00016DC51 /* IDBAny.cpp in Sources */,
C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
- 51D719BF181106E00016DC51 /* IDBCursor.cpp in Sources */,
- 516730A3182D8FBB003FAF5C /* IDBCursorBackend.cpp in Sources */,
- 510194441836F7E400925523 /* IDBCursorBackendOperations.cpp in Sources */,
- 51D719C3181106E00016DC51 /* IDBCursorWithValue.cpp in Sources */,
- 51D719C6181106E00016DC51 /* IDBDatabase.cpp in Sources */,
- 51771C8E182DB4B7008E781E /* IDBDatabaseBackend.cpp in Sources */,
- 51D719CB181106E00016DC51 /* IDBDatabaseCallbacksImpl.cpp in Sources */,
51D719CE181106E00016DC51 /* IDBDatabaseException.cpp in Sources */,
5163117D1851242B00534647 /* IDBDatabaseMetadata.cpp in Sources */,
51D719D0181106E00016DC51 /* IDBEventDispatcher.cpp in Sources */,
- 51D719D2181106E00016DC51 /* IDBFactory.cpp in Sources */,
- 51D719D8181106E00016DC51 /* IDBIndex.cpp in Sources */,
51D719DB181106E00016DC51 /* IDBKey.cpp in Sources */,
511EC1A8188DAE7B00BA3EB6 /* IDBKeyData.cpp in Sources */,
51D719DD181106E00016DC51 /* IDBKeyPath.cpp in Sources */,
51D719DF181106E00016DC51 /* IDBKeyRange.cpp in Sources */,
5123AF181890A4CA0031CDC9 /* IDBKeyRangeData.cpp in Sources */,
- 51D719E3181106E00016DC51 /* IDBObjectStore.cpp in Sources */,
- 51D719E6181106E00016DC51 /* IDBOpenDBRequest.cpp in Sources */,
- 51D719E9181106E00016DC51 /* IDBPendingTransactionMonitor.cpp in Sources */,
- 51D719EB181106E00016DC51 /* IDBRequest.cpp in Sources */,
- 51D719EE181106E00016DC51 /* IDBTransaction.cpp in Sources */,
- 510B7DB7182D9F5D009BF957 /* IDBTransactionBackend.cpp in Sources */,
- 51059DDD1820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp in Sources */,
- 51EAC5671815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp in Sources */,
- 51D719F5181106E00016DC51 /* IDBVersionChangeEvent.cpp in Sources */,
1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */,
C3CF17A415B0063F00276D39 /* IdTargetObserver.cpp in Sources */,
C3CF17A615B0063F00276D39 /* IdTargetObserverRegistry.cpp in Sources */,
@@ -28842,6 +28897,7 @@
1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */,
4A9CC82016BF9BB400EC645A /* InspectorCSSOMWrappers.cpp in Sources */,
+ 51F41A771BA73B5B002E053B /* IDBTransactionCoordinator.cpp in Sources */,
7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */,
41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */,
7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */,
@@ -29351,6 +29407,7 @@
B2FA3D520AB75A6F000E5AC4 /* JSSVGAnimateElement.cpp in Sources */,
4496E39D1398136C003EE32A /* JSSVGAnimateMotionElement.cpp in Sources */,
B2FA3D540AB75A6F000E5AC4 /* JSSVGAnimateTransformElement.cpp in Sources */,
+ 5103C2B31BA2324D00E26337 /* IDBCursor.cpp in Sources */,
B2FA3D560AB75A6F000E5AC4 /* JSSVGAnimationElement.cpp in Sources */,
B2FA3D580AB75A6F000E5AC4 /* JSSVGCircleElement.cpp in Sources */,
B2FA3D5A0AB75A6F000E5AC4 /* JSSVGClipPathElement.cpp in Sources */,
@@ -29448,6 +29505,7 @@
B2FA3DE20AB75A6F000E5AC4 /* JSSVGPointList.cpp in Sources */,
B2FA3DE50AB75A6F000E5AC4 /* JSSVGPolygonElement.cpp in Sources */,
B2FA3DE70AB75A6F000E5AC4 /* JSSVGPolylineElement.cpp in Sources */,
+ 51F41A701BA73B5B002E053B /* IDBDatabaseCallbacksImpl.cpp in Sources */,
B2FA3DE90AB75A6F000E5AC4 /* JSSVGPreserveAspectRatio.cpp in Sources */,
B2FA3DEB0AB75A6F000E5AC4 /* JSSVGRadialGradientElement.cpp in Sources */,
8542A7940AE5C94000DF58DF /* JSSVGRect.cpp in Sources */,
@@ -29466,6 +29524,7 @@
B22362280C3AF04A0008CA9B /* JSSVGTextPathElement.cpp in Sources */,
B2FA3E060AB75A6F000E5AC4 /* JSSVGTextPositioningElement.cpp in Sources */,
B2FA3E080AB75A6F000E5AC4 /* JSSVGTitleElement.cpp in Sources */,
+ 5103C2B21BA2317400E26337 /* IDBTransaction.cpp in Sources */,
B2FA3E0A0AB75A6F000E5AC4 /* JSSVGTransform.cpp in Sources */,
B2FA3E0C0AB75A6F000E5AC4 /* JSSVGTransformList.cpp in Sources */,
B2FA3E0E0AB75A6F000E5AC4 /* JSSVGTRefElement.cpp in Sources */,
@@ -29568,6 +29627,7 @@
463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */,
E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
BC348BD30DB7F804004ABAB9 /* JSXMLHttpRequest.cpp in Sources */,
+ 5157D4661BA24AFD0085CA2F /* IDBObjectStore.cpp in Sources */,
BC348BBE0DB7F531004ABAB9 /* JSXMLHttpRequestCustom.cpp in Sources */,
BC60DA390D2A302800B9918F /* JSXMLHttpRequestException.cpp in Sources */,
F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */,
@@ -29620,6 +29680,7 @@
656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
7EE6846812D26E3800E79415 /* LoaderRunLoopCF.cpp in Sources */,
51ABF64D16392E2800132A7A /* LoaderStrategy.cpp in Sources */,
+ 5103C2B81BA235C500E26337 /* IDBVersionChangeEvent.cpp in Sources */,
06E81EEC0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm in Sources */,
F5973DE115CFB2030027F804 /* LocaleMac.mm in Sources */,
7633A72713D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp in Sources */,
@@ -29785,6 +29846,7 @@
1A569D1A0D7E2B82007C3983 /* objc_utility.mm in Sources */,
1CF6BDFB0E9BB26A0025E1CD /* ObjCEventListener.mm in Sources */,
1CF6BE140E9BB4670025E1CD /* ObjCNodeFilterCondition.mm in Sources */,
+ 51645B5C1B9FA6C800F789CE /* LegacyCursorWithValue.cpp in Sources */,
E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */,
7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */,
9001774012E0347800648462 /* OESStandardDerivatives.cpp in Sources */,
@@ -29814,10 +29876,12 @@
9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */,
7A674BDB0F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp in Sources */,
1C26497C0D7E24EC00BD10F2 /* PageMac.cpp in Sources */,
+ 5103C2B61BA233BF00E26337 /* IDBRequest.cpp in Sources */,
2D5C9CFF19C7B52E00B3C5C1 /* PageOverlay.cpp in Sources */,
2D5C9D0119C7B52E00B3C5C1 /* PageOverlayController.cpp in Sources */,
FBDB619D16D6034600BB3394 /* PageRuleCollector.cpp in Sources */,
F3820894147D35F90010BC06 /* PageRuntimeAgent.cpp in Sources */,
+ 51645B621B9FA6C800F789CE /* LegacyIndex.cpp in Sources */,
A5F36D3A18F758720054C024 /* PageScriptDebugServer.cpp in Sources */,
371E65CE13661EED00BEEDB0 /* PageSerializer.cpp in Sources */,
A7197F2617568AE5007B9442 /* PageThrottler.cpp in Sources */,
@@ -29861,6 +29925,7 @@
41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */,
C598902E14E9B0F800E8D18B /* PlatformPasteboardMac.mm in Sources */,
+ 51F41A731BA73B5B002E053B /* IDBTransactionBackend.cpp in Sources */,
E45390430EAFD637003695C8 /* PlatformScreenIOS.mm in Sources */,
BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */,
2934940B16C02C0A00901318 /* PlatformSpeechSynthesisUtterance.cpp in Sources */,
@@ -30007,6 +30072,7 @@
BC3BE9930E9C1C7C00835588 /* RenderScrollbar.cpp in Sources */,
BC3BE9AB0E9C242000835588 /* RenderScrollbarPart.cpp in Sources */,
BC3BE9A50E9C239600835588 /* RenderScrollbarTheme.cpp in Sources */,
+ 51F41A751BA73B5B002E053B /* IDBTransactionBackendOperations.cpp in Sources */,
458FE4091589DF0B005609E6 /* RenderSearchField.cpp in Sources */,
58DEED8619873FF000888FF3 /* RenderSelectionInfo.cpp in Sources */,
AB247A6C0AFD6383003FA5FD /* RenderSlider.cpp in Sources */,
@@ -30036,6 +30102,7 @@
BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */,
BE20507D18A458BF0080647E /* RenderVTTCue.cpp in Sources */,
A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */,
+ 51F41A7B1BA73B5B002E053B /* IDBPendingTransactionMonitor.cpp in Sources */,
F5528DA61AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp in Sources */,
F5528DA91AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp in Sources */,
A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */,
@@ -30046,6 +30113,7 @@
99CC0B5818BE984A006CEBCC /* ReplayInputDispatchMethods.cpp in Sources */,
99CC0B5918BE984A006CEBCC /* ReplaySession.cpp in Sources */,
99CC0B5B18BE984A006CEBCC /* ReplaySessionSegment.cpp in Sources */,
+ 51645B5E1B9FA6C800F789CE /* LegacyDatabase.cpp in Sources */,
F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
7EE6846B12D26E3800E79415 /* ResourceErrorCF.cpp in Sources */,
@@ -30196,6 +30264,7 @@
E18DF33818AAF14D00773E59 /* SerializedCryptoKeyWrapMac.mm in Sources */,
077AF14418F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm in Sources */,
A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */,
+ 51645B6A1B9FA6C800F789CE /* LegacyTransaction.cpp in Sources */,
2D93AEE419DF5641002A86C3 /* ServicesOverlayController.mm in Sources */,
93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
@@ -30235,6 +30304,7 @@
CD3A496117A9D01B00274E42 /* SourceBuffer.cpp in Sources */,
CD3A496417A9D01B00274E42 /* SourceBufferList.cpp in Sources */,
CDC8B5AA18047FF10016E685 /* SourceBufferPrivateAVFObjC.mm in Sources */,
+ 5157D4641BA24AEE0085CA2F /* IDBFactory.cpp in Sources */,
84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */,
076306D717E149CF005A7C4E /* SourceInfo.cpp in Sources */,
536D5A25193F40FC00CE4CAB /* SourceSizeList.cpp in Sources */,
@@ -30246,6 +30316,7 @@
AA2A5ACD16A485FA00975A25 /* SpeechSynthesisVoice.cpp in Sources */,
A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */,
B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */,
+ 5103C2B11BA22D1A00E26337 /* LegacyAny.cpp in Sources */,
4512502215DCE37D002F84E2 /* SpinButtonElement.cpp in Sources */,
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
@@ -30282,6 +30353,7 @@
BC5EB67D0E81D42000B25965 /* StyleBoxData.cpp in Sources */,
8386A97019F61E4F00E1EC4A /* StyleBuilder.cpp in Sources */,
BCEF447A0E6747D0001C1287 /* StyleCachedImage.cpp in Sources */,
+ 5103C2B71BA233C400E26337 /* IDBOpenDBRequest.cpp in Sources */,
9393E604151A9A1800066F06 /* StyleCachedImageSet.cpp in Sources */,
A8C4A7FE09D563270003AC8D /* StyledElement.cpp in Sources */,
BC5EB8B80E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.cpp in Sources */,
@@ -30484,12 +30556,14 @@
150524F71B712FFF00696AA9 /* MediaStreamPrivateAVFObjC.mm in Sources */,
B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */,
B2227AD30D00BF220071B782 /* SVGTitleElement.cpp in Sources */,
+ 5157D4651BA24AF80085CA2F /* IDBIndex.cpp in Sources */,
1CCDF5BD1990332400BCEBAD /* SVGToOTFFontConversion.cpp in Sources */,
B2227AD60D00BF220071B782 /* SVGTransform.cpp in Sources */,
B2227AD90D00BF220071B782 /* SVGTransformable.cpp in Sources */,
B2227ADC0D00BF220071B782 /* SVGTransformDistance.cpp in Sources */,
B2227ADE0D00BF220071B782 /* SVGTransformList.cpp in Sources */,
DEC297611B4F2F8D005F5945 /* JSCustomEventCustom.cpp in Sources */,
+ 51645B641B9FA6C800F789CE /* LegacyObjectStore.cpp in Sources */,
B2227AE10D00BF220071B782 /* SVGTRefElement.cpp in Sources */,
B2227AE40D00BF220071B782 /* SVGTSpanElement.cpp in Sources */,
B2227AE90D00BF220071B782 /* SVGURIReference.cpp in Sources */,
@@ -30574,6 +30648,7 @@
7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */,
93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
+ 51645B681B9FA6C800F789CE /* LegacyRequest.cpp in Sources */,
A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */,
A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */,
070334D9145A006F008D8D45 /* TrackBase.cpp in Sources */,
@@ -30733,6 +30808,7 @@
D7613A501474F13F00DB8606 /* WebKitNamedFlow.cpp in Sources */,
7C48A6D0191C9D6500026674 /* WebKitNamespace.cpp in Sources */,
A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */,
+ 51F41A6B1BA73B5B002E053B /* IDBCursorBackendOperations.cpp in Sources */,
31C0FF240E4CEB6E007D6FE5 /* WebKitTransitionEvent.cpp in Sources */,
0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */,
0709D78E1AE55554004E42F8 /* WebMediaSessionManager.cpp in Sources */,
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt
index 8aea407..7af9004 100644
--- a/Source/WebKit2/CMakeLists.txt
+++ b/Source/WebKit2/CMakeLists.txt
@@ -70,6 +70,8 @@
"${WEBKIT2_DIR}/WebProcess/WebPage"
"${WEBCORE_DIR}"
"${WEBCORE_DIR}/Modules/battery"
+ "${WEBCORE_DIR}/Modules/indexeddb"
+ "${WEBCORE_DIR}/Modules/indexeddb/legacy"
"${WEBCORE_DIR}/Modules/mediastream"
"${WEBCORE_DIR}/Modules/networkinfo"
"${WEBCORE_DIR}/Modules/notifications"
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index dfef905..b0e3196 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,12 @@
+2015-09-14 Brady Eidson <beidson@apple.com>
+
+ Rename current concrete IDB implementation to "Legacy".
+ https://bugs.webkit.org/show_bug.cgi?id=149118
+
+ Reviewed by Alex Christensen.
+
+ * CMakeLists.txt:
+
2015-09-14 Gyuyoung Kim <gyuyoung.kim@webkit.org>
[EFL] Remove create() factory function in EvasGLContext and EvasGLSurface