[Bug 25223] IDB exposes GC behavior

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25223

Joshua Bell <jsbell@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsbell@google.com

--- Comment #1 from Joshua Bell <jsbell@google.com> ---
Current spec text:

"The connection can be closed through several means. If the connection is GCed
or execution context where the connection is created is destroyed (for example
due to the user navigating away from that page), the connection is closed. The
connection can also be closed explicitly using the steps for closing a database
connection."

So, obviously, the spec shouldn't reference GC. It would capture the intent to
say something like:

"If the connection object can no longer be used (for example, the user has
navigated away from the page, or no references to the connection remain), the
connection may be closed."

The more fundamental issue is that script can tell if GC has happened, e.g.

db = indexedDB.open('db', 1);
indexedDB.open('db', 2).onsuccess = function() { alert('GC happened'); };
db = null;

... which would preclude the use of the API in this fashion in e.g. a
hypothetical environment with infinite memory.

I think that ship has already sailed with connection-type resources. For
example, with Web Sockets - open two sockets to a server, drop the reference to
the first, and when the server detects that the first is unusable it can signal
the second. Just riffing, though.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 2 April 2014 19:06:21 UTC