When exiting the main thread script state, IDBPendingTransactionMonitor::deactivateNewTransactions() is called (JSMainThreadExecState::didLeaveScriptContext() in Source/WebCore/bindings/js/JSMainThreadExecState.cpp). The same call should be made when exiting a worker script context as well. Currently these two tests fail on JSC because of this problem: storage/indexeddb/pending-activity-workers.html storage/indexeddb/transaction-complete-workers.html
Created attachment 182490 [details] Patch
Created attachment 182820 [details] Patch
Comment on attachment 182820 [details] Patch Attachment 182820 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/15904078
> "the flag be set to false when control returns to the event loop" I think you've missed a lot of cases. JSLockHolder is the object we use to indicate entry to the JS engine, and there are 218 instances of it in the WebKit project. Is there a simpler bottleneck for catching returns to the runloop? Hooking into shared timer might get you most of the way there.
I have a fix for the inspector, for V8 - it uses V8RecursionScope. Not sure if/when the JSC stuff is going in though.
(In reply to comment #4) > > "the flag be set to false when control returns to the event loop" > > I think you've missed a lot of cases. JSLockHolder is the object we use to indicate entry to the JS engine, and there are 218 instances of it in the WebKit project. > > Is there a simpler bottleneck for catching returns to the runloop? Hooking into shared timer might get you most of the way there. FWIW, if you do find a way to hook a return to the run loop, that would also provide a fix for bug 78290.
These tests appear to work properly in modern WebKit (as of 2022), so this seems to have progressed through other IndexedDB work.