Changeset 163849 in webkit
- Timestamp:
- Feb 10, 2014 6:29:22 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r163840 r163849 1 2014-02-10 Brady Eidson <beidson@apple.com> 2 3 IDB: storage/indexeddb/mozilla/indexes.html fails 4 <rdar://problem/16031590> and https://bugs.webkit.org/show_bug.cgi?id=128563 5 6 Reviewed by Tim Horton. 7 8 * platform/mac-wk2/TestExpectations: Add the test (still skipped for now due to unrelated reasons). 9 1 10 2014-02-09 Dean Jackson <dino@apple.com> 2 11 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r163817 r163849 481 481 # storage/indexeddb/mozilla/cursors.html [ Pass ] 482 482 # storage/indexeddb/mozilla/index-prev-no-duplicate.html [ Pass ] 483 # storage/indexeddb/mozilla/indexes.html [ Pass ] 483 484 # storage/indexeddb/mozilla/object-cursors.html [ Pass ] 484 485 # storage/indexeddb/mozilla/object-store-remove-values.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r163847 r163849 1 2014-02-10 Brady Eidson <beidson@apple.com> 2 3 IDB: storage/indexeddb/mozilla/indexes.html fails 4 <rdar://problem/16031590> and https://bugs.webkit.org/show_bug.cgi?id=128563 5 6 Reviewed by Tim Horton. 7 8 Tested by storage/indexeddb/mozilla/indexes.html (and probably others) 9 10 * Modules/indexeddb/IDBGetResult.h: 11 (WebCore::IDBGetResult::IDBGetResult): Add a constructor that takes an IDBKeyData argument. 12 13 * Modules/indexeddb/IDBRequest.cpp: 14 (WebCore::IDBRequest::onSuccess): If there’s no keyPath then skip the injection step. 15 1 16 2014-02-10 Benjamin Poulain <benjamin@webkit.org> 2 17 -
trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h
r162633 r163849 51 51 } 52 52 53 IDBGetResult(const IDBKeyData& keyData) 54 : keyData(keyData) 55 { 56 } 57 53 58 IDBGetResult(PassRefPtr<SharedBuffer> buffer, PassRefPtr<IDBKey> key, const IDBKeyPath& path) 54 59 : valueBuffer(buffer) -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r163627 r163849 364 364 365 365 RefPtr<IDBKey> primaryKey = prpPrimaryKey; 366 367 if (!keyPath.isNull()) { 366 368 #ifndef NDEBUG 367 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath);368 ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get()));369 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath); 370 ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get())); 369 371 #endif 370 bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath); 371 ASSERT_UNUSED(injected, injected); 372 bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath); 373 ASSERT_UNUSED(injected, injected); 374 } 375 372 376 onSuccessInternal(value); 373 377 } -
trunk/Source/WebKit2/ChangeLog
r163848 r163849 1 2014-02-10 Brady Eidson <beidson@apple.com> 2 3 IDB: storage/indexeddb/mozilla/indexes.html fails 4 <rdar://problem/16031590> and https://bugs.webkit.org/show_bug.cgi?id=128563 5 6 Reviewed by Tim Horton. 7 8 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: 9 (WebKit::UniqueIDBDatabase::getRecordFromBackingStore): Pass the cursor type to the backing store. 10 11 * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: 12 * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: 13 (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord): If it’s a key-only cursor, 14 return only the key result. 15 * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: 16 17 * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: 18 (WebKit::getIndexStatement): Fix index statement selection so ascending, unique cursors sort correctly. 19 1 20 2014-02-10 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
r163817 r163849 925 925 926 926 IDBGetResult result; 927 if (!m_backingStore->getIndexRecord(transaction, objectStoreMetadata.id, indexID, keyRangeData, result)) {927 if (!m_backingStore->getIndexRecord(transaction, objectStoreMetadata.id, indexID, keyRangeData, cursorType, result)) { 928 928 postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get index record from backing store"))); 929 929 return; -
trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
r163662 r163849 72 72 virtual bool putRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyData&, const uint8_t* valueBuffer, size_t valueSize) = 0; 73 73 virtual bool putIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyData&, const WebCore::IDBKeyData& indexKey) = 0; 74 virtual bool getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&, WebCore::I DBGetResult&) = 0;74 virtual bool getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&, WebCore::IndexedDB::CursorType, WebCore::IDBGetResult&) = 0; 75 75 virtual bool deleteRange(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRangeData&) = 0; 76 76 virtual bool deleteRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyData&) = 0; -
trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp
r163741 r163849 73 73 74 74 if (indexStatements.isEmpty()) { 75 indexStatements.reserveInitialCapacity(1 6);75 indexStatements.reserveInitialCapacity(12); 76 76 77 77 // Lower missing/open, upper missing/open. 78 78 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key, value;")); 79 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key, value DESC;"));80 79 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key DESC, value DESC;")); 81 80 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key DESC, value;")); … … 83 82 // Lower missing/open, upper closed. 84 83 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key, value;")); 85 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key, value DESC;"));86 84 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key DESC, value DESC;")); 87 85 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key DESC, value;")); … … 89 87 // Lower closed, upper missing/open. 90 88 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key, value;")); 91 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key, value DESC;"));92 89 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key DESC, value DESC;")); 93 90 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key DESC, value;")); … … 95 92 // Lower closed, upper closed. 96 93 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key, value;")); 97 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key, value DESC;"));98 94 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key DESC, value DESC;")); 99 95 indexStatements.uncheckedAppend(ASCIILiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key DESC, value;")); … … 103 99 104 100 if (hasLowerKey && !isLowerOpen) 105 i += 8;101 i += 6; 106 102 107 103 if (hasUpperKey && !isUpperOpen) 108 i += 4; 109 110 if (descending) 111 i += 2; 112 113 if (unique) 114 i += 1; 104 i += 3; 105 106 if (descending) { 107 if (!unique) 108 i += 1; 109 else 110 i += 2; 111 } 115 112 116 113 return indexStatements[i]; -
trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
r163818 r163849 910 910 } 911 911 912 bool UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData& keyRangeData, I DBGetResult& result)912 bool UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData& keyRangeData, IndexedDB::CursorType cursorType, IDBGetResult& result) 913 913 { 914 914 ASSERT(!isMainThread()); … … 922 922 } 923 923 924 SQLiteIDBCursor* cursor = transaction->openCursor(objectStoreID, indexID, IndexedDB::CursorDirection::Next, IndexedDB::CursorType::KeyAndValue, IDBDatabaseBackend::NormalTask, keyRangeData);924 SQLiteIDBCursor* cursor = transaction->openCursor(objectStoreID, indexID, IndexedDB::CursorDirection::Next, cursorType, IDBDatabaseBackend::NormalTask, keyRangeData); 925 925 926 926 if (!cursor) { … … 932 932 m_cursors.set(cursor->identifier(), cursor); 933 933 934 result = IDBGetResult(SharedBuffer::create(cursor->currentValueBuffer().data(), cursor->currentValueBuffer().size())); 935 result.keyData = cursor->currentPrimaryKey(); 934 if (cursorType == IndexedDB::CursorType::KeyOnly) 935 result = IDBGetResult(cursor->currentPrimaryKey()); 936 else { 937 result = IDBGetResult(SharedBuffer::create(cursor->currentValueBuffer().data(), cursor->currentValueBuffer().size())); 938 result.keyData = cursor->currentPrimaryKey(); 939 } 936 940 937 941 // Closing the cursor will destroy the cursor object and remove it from our cursor set. -
trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h
r163662 r163849 81 81 virtual bool putRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyData&, const uint8_t* valueBuffer, size_t valueSize) override; 82 82 virtual bool putIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyData& keyValue, const WebCore::IDBKeyData& indexKey) override; 83 virtual bool getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&, WebCore::I DBGetResult&) override;83 virtual bool getIndexRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&, WebCore::IndexedDB::CursorType, WebCore::IDBGetResult&) override; 84 84 virtual bool deleteRange(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRangeData&) override; 85 85 virtual bool deleteRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyData&) override;
Note: See TracChangeset
for help on using the changeset viewer.