author Bevis Tseng <btseng@mozilla.com>
Tue, 31 May 2016 18:08:20 +0800
changeset 346554 035505ea31497d0e07d51cda4711cebb385ca987
parent 345203 63214a08673f5463749cc5f15230fda06ef6c5f8
child 359930 e1d144423657aa6b1def32f6f0c6825d8741a429
permissions -rw-r--r--
Bug 1151017 - Support the 'close' Event on Databases. r=khuey Outline of this patch: 1. Define a new ipdl message called |CloseAfterInvalidationComplete| to trigger the close event after all transactions are complete only if the database is invalidated by the user agent. 2. Make sure the following event sequence is consistent during invalidation according to the steps in |5.2. Closing a database| by the following 2 solutions: IDBRequest.onerror -> IDBTransaction.onerror -> IDBTransaction.onabort -> IDBDatabase.onclose. 2.1. In parent process, do not force to abort the transactions after invalidation but wait for all the transactions in its child process are complete. 2.2. In child process, make sure that each IDBTransaction will notify its completion to the parent after all its pending IDBRequests are finished. 3. Add test_database_onclose.js to test the close event especially when read/write operation is ongoing. 4. Add test_database_close_without_onclose.js as a XPCShell test because setTimeout() is not preferred in Mochitest to ensure that the IDBDatabase.onclose event won't be sent after closed normally.

max-line-length = 99
filename = *.py, +.lint