Title: [234351] branches/safari-606-branch
Revision
234351
Author
[email protected]
Date
2018-07-29 23:27:59 -0700 (Sun, 29 Jul 2018)

Log Message

Cherry-pick r234125. rdar://problem/42721214

    CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
    https://bugs.webkit.org/show_bug.cgi?id=187927
    LayoutTests/imported/w3c:

    <rdar://problem/42516426>

    Reviewed by Chris Dumez.

    * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:

    Source/WebCore:

    Reviewed by Chris Dumez.

    IDBKeyData is valid only when each key of it is valid.

    Test: LayoutTests/storage/indexeddb/index-multientry.html

    * Modules/indexeddb/IDBKeyData.cpp:
    (WebCore::IDBKeyData::isValid const):
    * Modules/indexeddb/IDBKeyData.h:
    (WebCore::IDBKeyData::isValid const): Deleted.

    LayoutTests:

    <rdar://problem/42516426>

    Reviewed by Chris Dumez.

    Add a new test case in existing test file to cover the crash case and update the expecation accordingly.

    * storage/indexeddb/index-multientry-expected.txt:
    * storage/indexeddb/index-multientry-private-expected.txt:
    * storage/indexeddb/resources/index-multientry.js:
    (addData):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-606-branch/LayoutTests/ChangeLog (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-30 06:27:59 UTC (rev 234351)
@@ -1,3 +1,61 @@
+2018-07-29  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r234125. rdar://problem/42721214
+
+    CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+    https://bugs.webkit.org/show_bug.cgi?id=187927
+    LayoutTests/imported/w3c:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:
+    
+    Source/WebCore:
+    
+    Reviewed by Chris Dumez.
+    
+    IDBKeyData is valid only when each key of it is valid.
+    
+    Test: LayoutTests/storage/indexeddb/index-multientry.html
+    
+    * Modules/indexeddb/IDBKeyData.cpp:
+    (WebCore::IDBKeyData::isValid const):
+    * Modules/indexeddb/IDBKeyData.h:
+    (WebCore::IDBKeyData::isValid const): Deleted.
+    
+    LayoutTests:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    Add a new test case in existing test file to cover the crash case and update the expecation accordingly.
+    
+    * storage/indexeddb/index-multientry-expected.txt:
+    * storage/indexeddb/index-multientry-private-expected.txt:
+    * storage/indexeddb/resources/index-multientry.js:
+    (addData):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-23  Sihui Liu  <[email protected]>
+
+            CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+            https://bugs.webkit.org/show_bug.cgi?id=187927
+            <rdar://problem/42516426>
+
+            Reviewed by Chris Dumez.
+
+            Add a new test case in existing test file to cover the crash case and update the expecation accordingly.
+
+            * storage/indexeddb/index-multientry-expected.txt:
+            * storage/indexeddb/index-multientry-private-expected.txt:
+            * storage/indexeddb/resources/index-multientry.js:
+            (addData):
+
 2018-07-26  Babak Shafiei  <[email protected]>
 
         Cherry-pick r234291. rdar://problem/42650439

Modified: branches/safari-606-branch/LayoutTests/imported/w3c/ChangeLog (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/imported/w3c/ChangeLog	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/imported/w3c/ChangeLog	2018-07-30 06:27:59 UTC (rev 234351)
@@ -1,3 +1,56 @@
+2018-07-29  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r234125. rdar://problem/42721214
+
+    CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+    https://bugs.webkit.org/show_bug.cgi?id=187927
+    LayoutTests/imported/w3c:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:
+    
+    Source/WebCore:
+    
+    Reviewed by Chris Dumez.
+    
+    IDBKeyData is valid only when each key of it is valid.
+    
+    Test: LayoutTests/storage/indexeddb/index-multientry.html
+    
+    * Modules/indexeddb/IDBKeyData.cpp:
+    (WebCore::IDBKeyData::isValid const):
+    * Modules/indexeddb/IDBKeyData.h:
+    (WebCore::IDBKeyData::isValid const): Deleted.
+    
+    LayoutTests:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    Add a new test case in existing test file to cover the crash case and update the expecation accordingly.
+    
+    * storage/indexeddb/index-multientry-expected.txt:
+    * storage/indexeddb/index-multientry-private-expected.txt:
+    * storage/indexeddb/resources/index-multientry.js:
+    (addData):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-23  Sihui Liu  <[email protected]>
+
+            CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+            https://bugs.webkit.org/show_bug.cgi?id=187927
+            <rdar://problem/42516426>
+
+            Reviewed by Chris Dumez.
+
+            * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:
+
 2018-07-11  Youenn Fablet  <[email protected]>
 
         Fix remaining Cross-Origin-Resource-Policy failures, if any

Modified: branches/safari-606-branch/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt	2018-07-30 06:27:59 UTC (rev 234351)
@@ -2,9 +2,7 @@
 FAIL IDBFactory cmp() static with throwing/invalid keys assert_throws: first key conversion with invalid key should throw DataError function "() => {
             receiver[method](invalid_key, throwing_key('getter 2'));
         }" threw object "getter 2: throwing from getter" that is not a DOMException DataError: property "code" is equal to undefined, expected 0
-FAIL IDBCursor continue() method with throwing/invalid keys assert_throws: key conversion with invalid key should throw DataError function "() => {
-            receiver[method](invalid_key);
-        }" threw object "InvalidStateError: Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end." that is not a DOMException DataError: property "code" is equal to 11, expected 0
+PASS IDBCursor continue() method with throwing/invalid keys 
 PASS IndexedDB: Exceptions thrown during key conversion 
 PASS IDBCursor update() method with throwing/invalid keys 
 PASS IDBKeyRange only() static with throwing/invalid keys 

Modified: branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-expected.txt (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-expected.txt	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-expected.txt	2018-07-30 06:27:59 UTC (rev 234351)
@@ -21,6 +21,7 @@
 transaction.objectStore('store').put({x: [4, 5, 6], y: 'b'}, 'bar')
 transaction.objectStore('store').put({x: [7, 7, 8, 7], y: 'c'}, 'baz')
 transaction.objectStore('store').put({x: [null, 9, 9], y: 'd'}, 'bloop')
+transaction.objectStore('store').put({x: [1, [2, null]], y:'e'}, 'oh')
 
 Verifying index: index
 transaction = db.transaction(['store'], 'readonly')
@@ -33,6 +34,12 @@
 cursor.continue()
 cursor = event.target.result
 PASS ex is non-null.
+PASS cursor.key is 1
+PASS cursor.primaryKey is "oh"
+PASS cursor.value.y is "e"
+cursor.continue()
+cursor = event.target.result
+PASS ex is non-null.
 PASS cursor.key is 2
 PASS cursor.primaryKey is "foo"
 PASS cursor.value.y is "a"
@@ -84,7 +91,7 @@
 transaction = db.transaction(['store'])
 transaction.objectStore('store').index('index')
 index.count()
-PASS event.target.result is 9
+PASS event.target.result is 10
 index.count(7)
 PASS event.target.result is 1
 
@@ -119,6 +126,12 @@
 cursor.continue()
 cursor = event.target.result
 PASS ex is non-null.
+PASS cursor.key is 1
+PASS cursor.primaryKey is "oh"
+PASS cursor.value.y is "e"
+cursor.continue()
+cursor = event.target.result
+PASS ex is non-null.
 PASS cursor.key is 2
 PASS cursor.primaryKey is "foo"
 PASS cursor.value.y is "a"
@@ -170,7 +183,7 @@
 transaction = db.transaction(['store'])
 transaction.objectStore('store').index('index')
 index.count()
-PASS event.target.result is 9
+PASS event.target.result is 10
 index.count(7)
 PASS event.target.result is 1
 PASS successfullyParsed is true

Modified: branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-private-expected.txt (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-private-expected.txt	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/storage/indexeddb/index-multientry-private-expected.txt	2018-07-30 06:27:59 UTC (rev 234351)
@@ -21,6 +21,7 @@
 transaction.objectStore('store').put({x: [4, 5, 6], y: 'b'}, 'bar')
 transaction.objectStore('store').put({x: [7, 7, 8, 7], y: 'c'}, 'baz')
 transaction.objectStore('store').put({x: [null, 9, 9], y: 'd'}, 'bloop')
+transaction.objectStore('store').put({x: [1, [2, null]], y:'e'}, 'oh')
 
 Verifying index: index
 transaction = db.transaction(['store'], 'readonly')
@@ -33,6 +34,12 @@
 cursor.continue()
 cursor = event.target.result
 PASS ex is non-null.
+PASS cursor.key is 1
+PASS cursor.primaryKey is "oh"
+PASS cursor.value.y is "e"
+cursor.continue()
+cursor = event.target.result
+PASS ex is non-null.
 PASS cursor.key is 2
 PASS cursor.primaryKey is "foo"
 PASS cursor.value.y is "a"
@@ -84,7 +91,7 @@
 transaction = db.transaction(['store'])
 transaction.objectStore('store').index('index')
 index.count()
-PASS event.target.result is 9
+PASS event.target.result is 10
 index.count(7)
 PASS event.target.result is 1
 
@@ -119,6 +126,12 @@
 cursor.continue()
 cursor = event.target.result
 PASS ex is non-null.
+PASS cursor.key is 1
+PASS cursor.primaryKey is "oh"
+PASS cursor.value.y is "e"
+cursor.continue()
+cursor = event.target.result
+PASS ex is non-null.
 PASS cursor.key is 2
 PASS cursor.primaryKey is "foo"
 PASS cursor.value.y is "a"
@@ -170,7 +183,7 @@
 transaction = db.transaction(['store'])
 transaction.objectStore('store').index('index')
 index.count()
-PASS event.target.result is 9
+PASS event.target.result is 10
 index.count(7)
 PASS event.target.result is 1
 PASS successfullyParsed is true

Modified: branches/safari-606-branch/LayoutTests/storage/indexeddb/resources/index-multientry.js (234350 => 234351)


--- branches/safari-606-branch/LayoutTests/storage/indexeddb/resources/index-multientry.js	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/LayoutTests/storage/indexeddb/resources/index-multientry.js	2018-07-30 06:27:59 UTC (rev 234351)
@@ -37,6 +37,7 @@
     request._onerror_ = unexpectedErrorCallback;
     request = evalAndLog("transaction.objectStore('store').put({x: [null, 9, 9], y: 'd'}, 'bloop')");
     request._onerror_ = unexpectedErrorCallback;
+    request = evalAndLog("transaction.objectStore('store').put({x: [1, [2, null]], y:'e'}, 'oh')");
 }
 
 function verifyIndexes(indexName, callback)
@@ -49,6 +50,7 @@
 
     expected = [
         { key: 1, primaryKey: 'foo', y: 'a' },
+        { key: 1, primaryKey: 'oh', y: 'e' },
         { key: 2, primaryKey: 'foo', y: 'a' },
         { key: 3, primaryKey: 'foo', y: 'a' },
         { key: 4, primaryKey: 'bar', y: 'b' },
@@ -114,7 +116,7 @@
     request = evalAndLog("index.count()");
     request._onsuccess_ = function(event) {
 
-        shouldBe("event.target.result", "9");
+        shouldBe("event.target.result", "10");
 
         request = evalAndLog("index.count(7)");
         request._onsuccess_ = function(event) {

Modified: branches/safari-606-branch/Source/WebCore/ChangeLog (234350 => 234351)


--- branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-30 06:27:59 UTC (rev 234351)
@@ -1,3 +1,62 @@
+2018-07-29  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r234125. rdar://problem/42721214
+
+    CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+    https://bugs.webkit.org/show_bug.cgi?id=187927
+    LayoutTests/imported/w3c:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:
+    
+    Source/WebCore:
+    
+    Reviewed by Chris Dumez.
+    
+    IDBKeyData is valid only when each key of it is valid.
+    
+    Test: LayoutTests/storage/indexeddb/index-multientry.html
+    
+    * Modules/indexeddb/IDBKeyData.cpp:
+    (WebCore::IDBKeyData::isValid const):
+    * Modules/indexeddb/IDBKeyData.h:
+    (WebCore::IDBKeyData::isValid const): Deleted.
+    
+    LayoutTests:
+    
+    <rdar://problem/42516426>
+    
+    Reviewed by Chris Dumez.
+    
+    Add a new test case in existing test file to cover the crash case and update the expecation accordingly.
+    
+    * storage/indexeddb/index-multientry-expected.txt:
+    * storage/indexeddb/index-multientry-private-expected.txt:
+    * storage/indexeddb/resources/index-multientry.js:
+    (addData):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-23  Sihui Liu  <[email protected]>
+
+            CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
+            https://bugs.webkit.org/show_bug.cgi?id=187927
+
+            Reviewed by Chris Dumez.
+
+            IDBKeyData is valid only when each key of it is valid.
+
+            Test: LayoutTests/storage/indexeddb/index-multientry.html
+
+            * Modules/indexeddb/IDBKeyData.cpp:
+            (WebCore::IDBKeyData::isValid const):
+            * Modules/indexeddb/IDBKeyData.h:
+            (WebCore::IDBKeyData::isValid const): Deleted.
+
 2018-07-27  Babak Shafiei  <[email protected]>
 
         Cherry-pick r234318. rdar://problem/42467016

Modified: branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (234350 => 234351)


--- branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2018-07-30 06:27:59 UTC (rev 234351)
@@ -426,6 +426,21 @@
     return result;
 }
 
+bool IDBKeyData::isValid() const
+{
+    if (m_type == KeyType::Invalid)
+        return false;
+    
+    if (m_type == KeyType::Array) {
+        for (auto& key : array()) {
+            if (!key.isValid())
+                return false;
+        }
+    }
+
+    return true;
+}
+
 bool IDBKeyData::operator<(const IDBKeyData& rhs) const
 {
     return compare(rhs) < 0;

Modified: branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.h (234350 => 234351)


--- branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2018-07-30 05:39:49 UTC (rev 234350)
+++ branches/safari-606-branch/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2018-07-30 06:27:59 UTC (rev 234351)
@@ -93,7 +93,7 @@
 #endif
 
     bool isNull() const { return m_isNull; }
-    bool isValid() const { return m_type != KeyType::Invalid; }
+    bool isValid() const;
     KeyType type() const { return m_type; }
 
     bool operator<(const IDBKeyData&) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to