Changeset 193657 in webkit


Ignore:
Timestamp:
Dec 7, 2015 3:07:03 PM (8 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
https://bugs.webkit.org/show_bug.cgi?id=151961

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least one failing test now passes).

When an index cursor's iterator was invalidated, there were some cases where it did
not correctly find the next iterator to pick up where it left off.

  • Modules/indexeddb/client/IDBCursorImpl.cpp:

(WebCore::IDBClient::IDBCursor::update):
(WebCore::IDBClient::IDBCursor::deleteFunction):

  • Modules/indexeddb/server/IndexValueStore.cpp:

(WebCore::IDBServer::IndexValueStore::find):
(WebCore::IDBServer::IndexValueStore::loggingString):

  • Modules/indexeddb/server/IndexValueStore.h:

LayoutTests:

  • platform/mac-wk1/TestExpectations:
  • storage/indexeddb/cursor-finished-expected.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r193644 r193657  
     12015-12-07  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=151961
     5
     6        Reviewed by Alex Christensen.
     7
     8        * platform/mac-wk1/TestExpectations:
     9        * storage/indexeddb/cursor-finished-expected.txt:
     10
    1112015-12-07  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    212
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r193643 r193657  
    111111storage/indexeddb/createIndex-after-failure.html [ Failure ]
    112112storage/indexeddb/cursor-continue.html [ Failure ]
    113 storage/indexeddb/cursor-continue-validity.html [ Failure ]
    114113storage/indexeddb/cursor-continueprimarykey.html [ Failure ]
    115114storage/indexeddb/cursor-leak.html [ Failure ]
  • trunk/LayoutTests/storage/indexeddb/cursor-finished-expected.txt

    r193428 r193657  
    5050PASS code is DOMException.INVALID_STATE_ERR
    5151PASS ename is 'InvalidStateError'
    52 Exception message: An operation was called on an object on which it is not allowed or at a time when it is not allowed.
     52Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    5353Expecting exception from savedCursor.advance(1)
    5454PASS Exception was thrown.
     
    7070PASS code is DOMException.INVALID_STATE_ERR
    7171PASS ename is 'InvalidStateError'
    72 Exception message: An operation was called on an object on which it is not allowed or at a time when it is not allowed.
     72Exception message: Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
    7373
    7474PASS successfullyParsed is true
  • trunk/Source/WebCore/ChangeLog

    r193656 r193657  
     12015-12-07  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=151961
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (At least one failing test now passes).
     9
     10        When an index cursor's iterator was invalidated, there were some cases where it did
     11        not correctly find the next iterator to pick up where it left off.
     12
     13        * Modules/indexeddb/client/IDBCursorImpl.cpp:
     14        (WebCore::IDBClient::IDBCursor::update):
     15        (WebCore::IDBClient::IDBCursor::deleteFunction):
     16       
     17        * Modules/indexeddb/server/IndexValueStore.cpp:
     18        (WebCore::IDBServer::IndexValueStore::find):
     19        (WebCore::IDBServer::IndexValueStore::loggingString):
     20        * Modules/indexeddb/server/IndexValueStore.h:
     21
    1222015-12-07  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp

    r193428 r193657  
    134134    if (!m_gotValue) {
    135135        ec.code = IDBDatabaseException::InvalidStateError;
     136        ec.message = ASCIILiteral("Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.");
    136137        return nullptr;
    137138    }
     
    307308    if (!m_gotValue) {
    308309        ec.code = IDBDatabaseException::InvalidStateError;
     310        ec.message = ASCIILiteral("Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.");
    309311        return nullptr;
    310312    }
  • trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.cpp

    r192948 r193657  
    213213    ASSERT(record);
    214214
     215    // If the main record iterator is not equal to the key we were looking for,
     216    // we know the primary key record should be the first.
     217    if (*iterator != key) {
     218        auto primaryIterator = record->begin();
     219        ASSERT(primaryIterator.isValid());
     220
     221        return { *this, iterator, primaryIterator };
     222    }
     223
    215224    auto primaryIterator = record->find(primaryKey);
    216225    if (primaryIterator.isValid())
     
    375384}
    376385
     386#ifndef NDEBUG
     387String IndexValueStore::loggingString() const
     388{
     389    String result;
     390    for (auto& key : m_orderedKeys) {
     391        result.append(makeString("Key: ", key.loggingString()));
     392        result.append(makeString("  Entry has ", String::number(m_records.get(key)->getCount()), " entries"));
     393    }
     394    return result;
     395}
     396#endif
     397
    377398} // namespace IDBServer
    378399} // namespace WebCore
  • trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h

    r192847 r193657  
    9999    Iterator reverseFind(const IDBKeyData&, const IDBKeyData& primaryKey, CursorDuplicity);
    100100
     101#ifndef NDEBUG
     102    String loggingString() const;
     103#endif
     104
    101105private:
    102106    std::set<IDBKeyData>::iterator lowestIteratorInRange(const IDBKeyRangeData&) const;
Note: See TracChangeset for help on using the changeset viewer.