Chromium Code Reviews
Description[Extensions] Make port creation synchronous in unload handlers
https://crrev.com/dbbe69e7a03b50940d5b7e615c04de531511cac3 made
extension message port initialization asynchronous in order to
address performance concerns around having a synchronous IPC.
Unfortunatley, this broke use cases where extensions use
chrome.runtime.sendMessage() from the unload handler for a page.
Fix this by using synchronous port creation in this case only. This is
essentially a partial revert of the above patch, but still leaves us in
a much better state than when all ports were created synchronously
(especially since we know no ports are created synchronously during page
load). In the long run, this is something we want to discourage, but
that should be done deliberately, and the original CL wasn't meant to
break anything.
Add a test to ensure we don't regress in the future.
Also add metrics for tracking the number of ports created during unload
handlers so that we can determine how common of an occurrence this is,
which can influence our decisions going forward.
BUG=660706
Committed: https://crrev.com/69424807aa1ee34516783d9dd206a95e9f034e33
Cr-Commit-Position: refs/heads/master@{#431925}
Patch Set 1 #Patch Set 2 : woot #Patch Set 3 : polish #
Total comments: 6
Patch Set 4 : Add DoNotUse warnings #
Total comments: 5
Patch Set 5 : Ilya's #Messages
Total messages: 37 (22 generated)
|