Title: [195541] trunk
Revision
195541
Author
beid...@apple.com
Date
2016-01-25 10:20:23 -0800 (Mon, 25 Jan 2016)

Log Message

Modern IDB: Implement getIndexRecord in the SQLite backing store.
https://bugs.webkit.org/show_bug.cgi?id=153425

Reviewed by Darin Adler.

Source/WebCore:

No new tests (Some failures now pass, other failures progressed closer to passing).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195540 => 195541)


--- trunk/LayoutTests/ChangeLog	2016-01-25 17:55:17 UTC (rev 195540)
+++ trunk/LayoutTests/ChangeLog	2016-01-25 18:20:23 UTC (rev 195541)
@@ -1,3 +1,12 @@
+2016-01-25  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Implement getIndexRecord in the SQLite backing store.
+        https://bugs.webkit.org/show_bug.cgi?id=153425
+
+        Reviewed by Darin Adler.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-25  Eric Carlson  <eric.carl...@apple.com>
 
         Media "ended" event incorrectly fires when currentTime is set

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195540 => 195541)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-25 17:55:17 UTC (rev 195540)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-25 18:20:23 UTC (rev 195541)
@@ -252,6 +252,10 @@
 fast/history/page-cache-indexed-opened-db.html [ Failure ]
 imported/w3c/indexeddb/close-in-upgradeneeded.html [ Failure ]
 imported/w3c/indexeddb/cursor-overloads.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-advance-continue-async.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-advance-invalid.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-advance.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-continue.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor-direction-index-keyrange.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor-direction-index.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor-direction-objectstore-keyrange.htm [ Failure ]
@@ -260,6 +264,7 @@
 imported/w3c/indexeddb/idbcursor-key.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor-primarykey.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor-reused.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-source.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor_advance_index.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor_advance_index2.htm [ Failure ]
 imported/w3c/indexeddb/idbcursor_advance_index3.htm [ Failure ]
@@ -347,6 +352,7 @@
 imported/w3c/indexeddb/idbfactory_open5.htm [ Failure ]
 imported/w3c/indexeddb/idbfactory_open6.htm [ Failure ]
 imported/w3c/indexeddb/idbfactory_open7.htm [ Failure ]
+imported/w3c/indexeddb/idbindex-multientry-big.htm [ Failure ]
 imported/w3c/indexeddb/idbindex-multientry.htm [ Failure ]
 imported/w3c/indexeddb/idbindex_count.htm [ Failure ]
 imported/w3c/indexeddb/idbindex_count2.htm [ Failure ]
@@ -426,6 +432,7 @@
 imported/w3c/indexeddb/keygenerator-constrainterror.htm [ Failure ]
 imported/w3c/indexeddb/keygenerator-overflow.htm [ Failure ]
 imported/w3c/indexeddb/keygenerator.htm [ Failure ]
+imported/w3c/indexeddb/keypath.htm [ Failure ]
 imported/w3c/indexeddb/keypath_maxsize.htm [ Failure ]
 imported/w3c/indexeddb/list_ordering.htm [ Failure ]
 imported/w3c/indexeddb/objectstore_keyorder.htm [ Failure ]
@@ -439,6 +446,7 @@
 imported/w3c/indexeddb/value.htm [ Failure ]
 imported/w3c/indexeddb/value_recursive.htm [ Failure ]
 imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
+storage/indexeddb/closed-cursor.html [ Failure ]
 storage/indexeddb/cursor-added-bug.html [ Failure ]
 storage/indexeddb/cursor-advance.html [ Failure ]
 storage/indexeddb/cursor-basics.html [ Failure ]
@@ -534,39 +542,24 @@
 storage/indexeddb/optional-arguments.html [ Failure ]
 storage/indexeddb/prefetch-bugfix-108071.html [ Failure ]
 storage/indexeddb/readonly.html [ Failure ]
-storage/indexeddb/transaction-active-flag.html [ Failure ]
 storage/indexeddb/transaction-rollback.html [ Failure ]
 storage/indexeddb/value-undefined.html [ Failure ]
 storage/indexeddb/values-odd-types.html [ Failure ]
 
 # SQLite backend tests that timeout
 crypto/subtle/rsa-indexeddb.html [ Skip ]
-imported/w3c/indexeddb/idbcursor-advance-continue-async.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-advance-invalid.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-advance.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-continue.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-source.htm [ Skip ]
 imported/w3c/indexeddb/idbfactory_open12.htm [ Skip ]
-imported/w3c/indexeddb/idbindex-multientry-big.htm [ Skip ]
 imported/w3c/indexeddb/idbobjectstore_openCursor_invalid.htm [ Skip ]
-imported/w3c/indexeddb/keypath.htm [ Skip ]
-storage/indexeddb/closed-cursor.html [ Skip ]
 storage/indexeddb/cursor-cast.html [ Skip ]
-storage/indexeddb/deletedatabase-transaction.html [ Skip ]
-storage/indexeddb/modern/blocked-open-db-requests.html [ Skip ]
 storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
 storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
-storage/indexeddb/modern/transaction-scheduler-4.html [ Skip ]
 storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
 storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
-storage/indexeddb/noblobs.html [ Skip ]
 storage/indexeddb/pending-activity.html [ Skip ]
 storage/indexeddb/prefetch-invalidation.html [ Skip ]
 storage/indexeddb/prefetch-race.html [ Skip ]
-storage/indexeddb/primary-key-unique-to-objectstore.html [ Skip ]
 storage/indexeddb/request-result-cache.html [ Skip ]
 storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
-storage/indexeddb/transaction-ordering.html [ Skip ]
 
 # SQLite backend tests that crash or ASSERT
 storage/indexeddb/database-odd-names.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (195540 => 195541)


--- trunk/Source/WebCore/ChangeLog	2016-01-25 17:55:17 UTC (rev 195540)
+++ trunk/Source/WebCore/ChangeLog	2016-01-25 18:20:23 UTC (rev 195541)
@@ -1,3 +1,15 @@
+2016-01-25  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Implement getIndexRecord in the SQLite backing store.
+        https://bugs.webkit.org/show_bug.cgi?id=153425
+
+        Reviewed by Darin Adler.
+
+        No new tests (Some failures now pass, other failures progressed closer to passing).
+
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
+
 2016-01-25  Eric Carlson  <eric.carl...@apple.com>
 
         Media "ended" event incorrectly fires when currentTime is set

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (195540 => 195541)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2016-01-25 17:55:17 UTC (rev 195540)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2016-01-25 18:20:23 UTC (rev 195541)
@@ -1126,9 +1126,32 @@
     return { };
 }
 
-IDBError SQLiteIDBBackingStore::getIndexRecord(const IDBResourceIdentifier&, uint64_t, uint64_t, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult&)
+IDBError SQLiteIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, uint64_t indexID, IndexedDB::IndexRecordType type, const IDBKeyRangeData& range, IDBGetResult& getResult)
 {
-    return { IDBDatabaseException::UnknownError, ASCIILiteral("Not implemented") };
+    LOG(IndexedDB, "SQLiteIDBBackingStore::getIndexRecord");
+    ASSERT(m_sqliteDB);
+    ASSERT(m_sqliteDB->isOpen());
+
+    auto* transaction = m_transactions.get(transactionIdentifier);
+    if (!transaction || !transaction->inProgress()) {
+        LOG_ERROR("Attempt to get an index record from database without an in-progress transaction");
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to get an index record from database without an in-progress transaction") };
+    }
+
+    auto cursor = transaction->maybeOpenBackingStoreCursor(objectStoreID, indexID, range);
+    if (!cursor) {
+        LOG_ERROR("Cannot open cursor to perform index get in database");
+        return { IDBDatabaseException::UnknownError, ASCIILiteral("Cannot open cursor to perform index get in database") };
+    }
+
+    if (type == IndexedDB::IndexRecordType::Key)
+        getResult = { cursor->currentPrimaryKey() };
+    else {
+        getResult = { SharedBuffer::create(cursor->currentValueBuffer().data(), cursor->currentValueBuffer().size()) };
+        getResult.setKeyData(cursor->currentPrimaryKey());
+    }
+
+    return { };
 }
 
 IDBError SQLiteIDBBackingStore::getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData& range, uint64_t& outCount)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to