Title: [195709] trunk
Revision
195709
Author
[email protected]
Date
2016-01-27 16:37:00 -0800 (Wed, 27 Jan 2016)

Log Message

Modern IDB: Incorrect handling of iterating cursors to their end.
https://bugs.webkit.org/show_bug.cgi?id=153569

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (3 tests now pass, others are closer to passing).

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::advance):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195708 => 195709)


--- trunk/LayoutTests/ChangeLog	2016-01-28 00:32:02 UTC (rev 195708)
+++ trunk/LayoutTests/ChangeLog	2016-01-28 00:37:00 UTC (rev 195709)
@@ -1,3 +1,12 @@
+2016-01-27  Brady Eidson  <[email protected]>
+
+        Modern IDB: Incorrect handling of iterating cursors to their end.
+        https://bugs.webkit.org/show_bug.cgi?id=153569
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-27  Zhuo Li  <[email protected]>
 
         Layout Test fast/forms/auto-fill-button/input-contacts-auto-fill-button.html is failing.

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195708 => 195709)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-28 00:32:02 UTC (rev 195708)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-28 00:37:00 UTC (rev 195709)
@@ -452,7 +452,6 @@
 imported/w3c/indexeddb/value.htm [ Failure ]
 imported/w3c/indexeddb/value_recursive.htm [ Failure ]
 imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
-storage/indexeddb/cursor-advance.html [ Failure ]
 storage/indexeddb/cursor-continue-validity.html [ Failure ]
 storage/indexeddb/cursor-primary-key-order.html [ Failure ]
 storage/indexeddb/cursor-update.html [ Failure ]
@@ -465,8 +464,6 @@
 storage/indexeddb/key-generator.html [ Failure ]
 storage/indexeddb/lazy-index-population.html [ Failure ]
 storage/indexeddb/lazy-index-types.html [ Failure ]
-storage/indexeddb/modern/cursor-3.html [ Failure ]
-storage/indexeddb/modern/cursor-4.html [ Failure ]
 storage/indexeddb/modern/cursor-7.html [ Failure ]
 storage/indexeddb/modern/deleteindex-1.html [ Failure ]
 storage/indexeddb/modern/deleteindex-2.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (195708 => 195709)


--- trunk/Source/WebCore/ChangeLog	2016-01-28 00:32:02 UTC (rev 195708)
+++ trunk/Source/WebCore/ChangeLog	2016-01-28 00:37:00 UTC (rev 195709)
@@ -1,3 +1,16 @@
+2016-01-27  Brady Eidson  <[email protected]>
+
+        Modern IDB: Incorrect handling of iterating cursors to their end.
+        https://bugs.webkit.org/show_bug.cgi?id=153569
+
+        Reviewed by Alex Christensen.
+
+        No new tests (3 tests now pass, others are closer to passing).
+
+        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
+        (WebCore::IDBServer::SQLiteIDBCursor::advance):
+        (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
+
 2016-01-27  Nan Wang  <[email protected]>
 
         AX: Crash in AccessibilityTableColumn::headerObject

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp (195708 => 195709)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp	2016-01-28 00:32:02 UTC (rev 195708)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp	2016-01-28 00:37:00 UTC (rev 195709)
@@ -255,6 +255,11 @@
 {
     bool isUnique = m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate || m_cursorDirection == IndexedDB::CursorDirection::PrevNoDuplicate;
 
+    if (m_completed) {
+        LOG_ERROR("Attempt to advance a completed cursor");
+        return false;
+    }
+
     for (uint64_t i = 0; i < count; ++i) {
         if (!isUnique) {
             if (!advanceOnce())
@@ -263,6 +268,9 @@
             if (!advanceUnique())
                 return false;
         }
+
+        if (m_completed)
+            break;
     }
 
     return true;
@@ -301,12 +309,8 @@
 {
     ASSERT(m_transaction->sqliteTransaction());
     ASSERT(m_statement);
+    ASSERT(!m_completed);
 
-    if (m_completed) {
-        LOG_ERROR("Attempt to advance a completed cursor");
-        return AdvanceResult::Failure;
-    }
-
     int result = m_statement->step();
     if (result == SQLITE_DONE) {
         m_completed = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to