Actually I have been working on the proposal with more details and have a separate doc about them. In that I think we don't have to care too much about the destruction since the lock holder will then be maintained in the lock struct itself. I shared that in a separate email before but probable it didn't reach everyone in the thread so maybe I should paste it here again:
https://docs.google.com/document/d/1gelstQEmImk9MDI8VpdcHSN9DsrSesvfaId36n0aI0E/edit?usp=sharing
In summary, we need to modify the indexed db code and lock manager as follows:
1. Implement a function in lock manager to query the pending queue size given lock request
2. Observe the BFCache state change from renderer's IDB module and notify IDB service to do eviction check
3. Add holder set into the lock struct and maintain it in lock acquisition and release
4. Accept a blocking callback in the IDB transaction scheduling method as well as the lock acquisition method
There is more information about the background and the rationale about those changes in the doc, pseudocode is also added for clarity. Please help to take a look at your convenience.
Also thanks
@Evan Stade for all the help in the previous IDB CLs, if you have time, please help to review this doc as well, as it's based on the previous work.
Best regards,
Mingyu