Changeset 195696 in webkit


Ignore:
Timestamp:
Jan 27, 2016 2:57:10 PM (8 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: Cursors are utterly broken in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153558

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (35 failures now pass, others improve).

  • Fixes incorrect usage of Index cursors when ObjectStore cursors are intended.
  • Improves the state of getting the cursor value vs. reaching the end of a cursor.
  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):

  • Modules/indexeddb/server/SQLiteIDBCursor.cpp:

(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::currentData):

  • Modules/indexeddb/server/SQLiteIDBCursor.h:

LayoutTests:

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195695 r195696  
     12016-01-27  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Cursors are utterly broken in the SQLite backend.
     4        https://bugs.webkit.org/show_bug.cgi?id=153558
     5
     6        Reviewed by Alex Christensen.
     7
     8        * platform/mac-wk1/TestExpectations:
     9
    1102016-01-27  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r195689 r195696  
    453453imported/w3c/indexeddb/value_recursive.htm [ Failure ]
    454454imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
    455 storage/indexeddb/closed-cursor.html [ Failure ]
    456 storage/indexeddb/cursor-added-bug.html [ Failure ]
    457455storage/indexeddb/cursor-advance.html [ Failure ]
    458 storage/indexeddb/cursor-basics.html [ Failure ]
    459 storage/indexeddb/cursor-continue-dir.html [ Failure ]
    460456storage/indexeddb/cursor-continue-validity.html [ Failure ]
    461457storage/indexeddb/cursor-continue.html [ Failure ]
    462 storage/indexeddb/cursor-delete.html [ Failure ]
    463 storage/indexeddb/cursor-finished.html [ Failure ]
    464 storage/indexeddb/cursor-inconsistency.html [ Failure ]
    465458storage/indexeddb/cursor-index-delete.html [ Failure ]
    466 storage/indexeddb/cursor-key-order.html [ Failure ]
    467 storage/indexeddb/cursor-prev-no-duplicate.html [ Failure ]
    468459storage/indexeddb/cursor-primary-key-order.html [ Failure ]
    469460storage/indexeddb/cursor-skip-deleted.html [ Failure ]
    470461storage/indexeddb/cursor-update.html [ Failure ]
    471 storage/indexeddb/cursor-value.html [ Failure ]
    472462storage/indexeddb/delete-range.html [ Failure ]
    473 storage/indexeddb/deleted-objects.html [ Failure ]
    474463storage/indexeddb/duplicates.html [ Failure ]
    475 storage/indexeddb/exceptions.html [ Failure ]
    476464storage/indexeddb/get-keyrange.html [ Failure ]
    477465storage/indexeddb/index-basics.html [ Failure ]
     
    483471storage/indexeddb/index-unique.html [ Failure ]
    484472storage/indexeddb/key-generator.html [ Failure ]
    485 storage/indexeddb/key-sort-order-across-types.html [ Failure ]
    486 storage/indexeddb/key-sort-order-date.html [ Failure ]
    487473storage/indexeddb/keypath-arrays.html [ Failure ]
    488 storage/indexeddb/keypath-fetch-key.html [ Failure ]
    489474storage/indexeddb/keypath-intrinsic-properties.html [ Failure ]
    490475storage/indexeddb/lazy-index-population.html [ Failure ]
    491476storage/indexeddb/lazy-index-types.html [ Failure ]
    492 storage/indexeddb/modern/cursor-1.html [ Failure ]
    493 storage/indexeddb/modern/cursor-2.html [ Failure ]
    494477storage/indexeddb/modern/cursor-3.html [ Failure ]
    495478storage/indexeddb/modern/cursor-4.html [ Failure ]
    496 storage/indexeddb/modern/cursor-5.html [ Failure ]
    497 storage/indexeddb/modern/cursor-6.html [ Failure ]
    498479storage/indexeddb/modern/cursor-7.html [ Failure ]
    499 storage/indexeddb/modern/cursor-8.html [ Failure ]
    500480storage/indexeddb/modern/deleteindex-1.html [ Failure ]
    501481storage/indexeddb/modern/deleteindex-2.html [ Failure ]
     
    510490storage/indexeddb/modern/index-cursor-3.html [ Failure ]
    511491storage/indexeddb/modern/index-get-count-basic.html [ Failure ]
    512 storage/indexeddb/modern/objectstore-cursor-advance-failures.html [ Failure ]
    513 storage/indexeddb/modern/objectstore-cursor-continue-failures.html [ Failure ]
    514 storage/indexeddb/modern/request-readystate.html [ Failure ]
    515 storage/indexeddb/mozilla/clear.html [ Failure ]
    516 storage/indexeddb/mozilla/cursor-mutation-objectstore-only.html [ Failure ]
    517492storage/indexeddb/mozilla/cursor-mutation.html [ Failure ]
    518493storage/indexeddb/mozilla/cursor-update-updates-indexes.html [ Failure ]
     
    521496storage/indexeddb/mozilla/indexes.html [ Failure ]
    522497storage/indexeddb/mozilla/object-cursors.html [ Failure ]
    523 storage/indexeddb/mozilla/remove-objectstore.html [ Failure ]
    524 storage/indexeddb/mutating-cursor.html [ Failure ]
    525498storage/indexeddb/objectstore-autoincrement.html [ Failure ]
    526499storage/indexeddb/objectstore-basics.html [ Failure ]
    527 storage/indexeddb/objectstore-clear.html [ Failure ]
    528 storage/indexeddb/objectstore-cursor.html [ Failure ]
    529 storage/indexeddb/open-cursor.html [ Failure ]
    530500storage/indexeddb/opencursor-key.html [ Failure ]
    531501storage/indexeddb/optional-arguments.html [ Failure ]
    532 storage/indexeddb/prefetch-bugfix-108071.html [ Failure ]
    533 storage/indexeddb/readonly.html [ Failure ]
    534 storage/indexeddb/transaction-rollback.html [ Failure ]
    535 storage/indexeddb/value-undefined.html [ Failure ]
    536 storage/indexeddb/values-odd-types.html [ Failure ]
    537502
    538503# SQLite backend tests that timeout
  • trunk/Source/WebCore/ChangeLog

    r195695 r195696  
     12016-01-27  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Cursors are utterly broken in the SQLite backend.
     4        https://bugs.webkit.org/show_bug.cgi?id=153558
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (35 failures now pass, others improve).
     9
     10        - Fixes incorrect usage of Index cursors when ObjectStore cursors are intended.
     11        - Improves the state of getting the cursor value vs. reaching the end of a cursor.
     12
     13        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     14        (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
     15        (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
     16
     17        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
     18        (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
     19        (WebCore::IDBServer::SQLiteIDBCursor::currentData):
     20        * Modules/indexeddb/server/SQLiteIDBCursor.h:
     21
    1222016-01-27  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r195689 r195696  
    14071407    m_cursors.set(cursor->identifier(), cursor);
    14081408
    1409     result = { cursor->currentKey(), cursor->currentPrimaryKey(), ThreadSafeDataBuffer::copyVector(cursor->currentValueBuffer()) };
     1409    cursor->currentData(result);
    14101410    return { };
    14111411}
     
    14431443    }
    14441444
    1445     result = { cursor->currentKey(), cursor->currentPrimaryKey(), ThreadSafeDataBuffer::copyVector(cursor->currentValueBuffer()) };
     1445    cursor->currentData(result);
    14461446    return { };
    14471447}
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp

    r195527 r195696  
    2929
    3030#include "IDBCursorInfo.h"
     31#include "IDBGetResult.h"
    3132#include "IDBSerialization.h"
    3233#include "Logging.h"
     
    6970    , m_cursorIdentifier(info.identifier())
    7071    , m_objectStoreID(info.objectStoreIdentifier())
    71     , m_indexID(info.sourceIdentifier())
     72    , m_indexID(info.cursorSource() == IndexedDB::CursorSource::Index ? info.sourceIdentifier() : IDBIndexMetadata::InvalidId)
    7273    , m_cursorDirection(info.cursorDirection())
    7374    , m_keyRange(info.range())
     
    8586{
    8687    ASSERT(m_objectStoreID);
     88}
     89
     90void SQLiteIDBCursor::currentData(IDBGetResult& result)
     91{
     92    if (m_completed) {
     93        ASSERT(!m_errored);
     94        result = { };
     95        return;
     96    }
     97
     98    result = { m_currentKey, m_currentPrimaryKey, ThreadSafeDataBuffer::copyVector(m_currentValueBuffer) };
    8799}
    88100
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h

    r195527 r195696  
    3838
    3939class IDBCursorInfo;
     40class IDBGetResult;
    4041
    4142namespace IDBServer {
     
    6768
    6869    void objectStoreRecordsChanged();
     70
     71    void currentData(IDBGetResult&);
    6972
    7073private:
Note: See TracChangeset for help on using the changeset viewer.