DescriptionAdd fallback mechanism to release Extension ports if the JS context has been destroyed.
The bug is that chrome.runtime.sendMessage looks for when its callback is
garbage collected, and when it is, close the associated port. It's important to
close the port to notify the other end of the closure, cleanup renderer state
both locally and on that other end, and potentially browser state.
Unfortunately the port management is implemented in JS itself, and port
releasing needs to go through JS. The problem is that it's not possible to call
into JS while in the process of garbage collection, so we delay it, by which
point the JS context may have been destroyed and again it's not possible to
call into JS. We fixed the former case a while ago, and this patch fixes the
latter.
BUG=471599
R=rockot@chromium.org
Committed: https://crrev.com/70c00e241c68895fb245f53a6404866883ea0631
Cr-Commit-Position: refs/heads/master@{#330234}
Patch Set 1 #Patch Set 2 : tweak #
Total comments: 7
Patch Set 3 : comments #
Messages
Total messages: 8 (2 generated)
|