If connections of a UniqueIDBDatabase are all closed and there is no pending request on the UniqueIDBDatabase, the UniqueIDBDatabase may not be used any more.
Created attachment 394473 [details] Patch
What's the motivation for this change? Can we test it somehow?
(In reply to Geoffrey Garen from comment #2) > What's the motivation for this change? > > Can we test it somehow? It is actually the old behavior before IDB background thread change. We don't want to keep the UniqueIDBDatabase objects in memory if they may never be used again. Current behavior is once UniqueIDBDatabase is created it will be in the map unless IDB data is deleted. I've tested the patch this manually. This should not cause any behavior change other than less memory in the case of opening a lot of IDBDatabase, closing them, and never using them again.
Comment on attachment 394473 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394473&action=review r=me > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1198 > +void UniqueIDBDatabase::destroyIfPossible() Does this function delete the UniqueIDBDatabase object, or just disconnect it from the server? I think a better name might be "tryRemoveFromServer" or "tryClose".
Comment on attachment 394473 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394473&action=review >> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1198 >> +void UniqueIDBDatabase::destroyIfPossible() > > Does this function delete the UniqueIDBDatabase object, or just disconnect it from the server? > > I think a better name might be "tryRemoveFromServer" or "tryClose". IDBServer owns UniqueIDBDatabase; this function deletes the object by removing it from the IDBServer. Will change the name to tryCloseAndRemoveFromServer.
Created attachment 394581 [details] Patch for landing
Committed r259034: <https://trac.webkit.org/changeset/259034> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394581 [details].
<rdar://problem/60906908>
Re-opened since this is blocked by bug 209700
Created attachment 394943 [details] Patch for landing
Committed r259215: <https://trac.webkit.org/changeset/259215> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394943 [details].