IDBTransaction / IDBObjectStore should not prevent a page from entering the back...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2019 22:33:32 +0000 (22:33 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2019 22:33:32 +0000 (22:33 +0000)
commite53564ae3d63459e02d6e79b268d62b4baf60885
treee0b888b6ba1fb63c6ea99e5e4e45995bdc9b8b76
parent72bb82dc7604e0fdafe0f6a5711900cf06a8021d
IDBTransaction / IDBObjectStore should not prevent a page from entering the back / forward cache
https://bugs.webkit.org/show_bug.cgi?id=202291
<rdar://problem/55760106>

Reviewed by Geoffrey Garen.

Source/WebCore:

IDBObjectStore does not fire any events and should therefore not cause any problem while in PageCache.
IDBTransaction can only fire abort/complete/error events, all of which are being enqueued to the
DocumentEventQueue. The DocumentEventQueue subclasses SuspendableTimer which will correctly suspend
while the document is in page cache. IDBTransaction will therefore not cause events to fire (and JS
to run) while in page cache.

Test: storage/indexeddb/IDBTransaction-page-cache.html

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::canSuspendForDocumentSuspension const):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::canSuspendForDocumentSuspension const):

LayoutTests:

Add layout test coverage.

* storage/indexeddb/IDBTransaction-page-cache.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/history/page-cache-indexed-opened-db-expected.txt
LayoutTests/fast/history/page-cache-indexed-opened-db.html
LayoutTests/storage/indexeddb/IDBTransaction-page-cache-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/IDBTransaction-page-cache.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp