If a transaction is running in any database when deleteDatabase() is called, an error event will be fired at the IDBVersionChangeRequest and the delete will fail. At the start of IDBLevelDBBackingStore.cpp there's a test: if (m_currentTransaction) return false; This guards against the deleteDatabase() logic which creates a transaction for the deletion itself - most of the WebKit IDB implementation is currently predicated on only one transaction running at a time. However, nothing outside of the IDBLevelDBBackingStore code treats the delete request as requiring a transaction, so it doesn't defer the delete until there are no transactions against any database. It *should* be safe to allow the IDBLevelDBBackingStore::deleteDatabase() call to run even if there is another transaction running since there will be no overlap in key ranges, as long as m_currentTransaction is either not modified or is restored afterwards.
Created attachment 151319 [details] Patch
dgrogan@, alecflett@ - take a look?
+jochen@, in case he remembers a reason it wasn't done like this in the first place.
Comment on attachment 151319 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=151319&action=review Interested to see if Jochen remembers anything. Not like he's been busy since or anything :) > LayoutTests/storage/indexeddb/deletedatabase-transaction.html:39 > + request.onerror = unexpectedErrorCallback; Could you add request.onblocked = unexpectedBlockedCallback ?
Comment on attachment 151319 [details] Patch IIRC a prior version of the patch used some methods that just used the default transaction. That patch looks good View in context: https://bugs.webkit.org/attachment.cgi?id=151319&action=review > LayoutTests/storage/indexeddb/deletedatabase-transaction.html:31 > + debug(""); nit. indent 4 spaces
Created attachment 151349 [details] Patch
Created attachment 151352 [details] Patch
(In reply to comment #4) > Could you add request.onblocked = unexpectedBlockedCallback ? Done. (In reply to comment #5) > nit. indent 4 spaces Fixed. tony@ - r?
Comment on attachment 151352 [details] Patch Clearing flags on attachment: 151352 Committed r122179: <http://trac.webkit.org/changeset/122179>
All reviewed patches have been landed. Closing bug.