IndexedDB: Don't wedge if page reloads with pending upgradeneeded
https://bugs.webkit.org/show_bug.cgi?id=98091

Reviewed by Tony Chang.

Source/WebCore:

Test: storage/indexeddb/dont-wedge.html

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
This got the same treatment as IDBRequest::onSuccess(Transaction).
Explicitly tell the backend objects that they are going away so that
m_runningVersionChangeTransaction is cleared and connectionCount()
decreases.

LayoutTests:

dont-wedge.js was derived from
transaction-coordination-across-databases.js.

This would have passed in DRT without this patch, but not in
content_shell.

* storage/indexeddb/dont-wedge-expected.txt: Added.
* storage/indexeddb/dont-wedge.html: Added.
* storage/indexeddb/resources/dont-wedge.js: Added.
(test):
(deleteDatabase1.request.onblocked):
(deleteDatabase1):
(deleteDatabase2):
(isAfterReload):
(reload):
(openDatabase1.request.onupgradeneeded):
(openDatabase1.request.onsuccess):
(openDatabase1):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk/LayoutTests@130199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
4 files changed