Chromium Code Reviews
DescriptionM56: Messaging: Fix crash when MessagePort is closed while messages are queued
dispatchMessages() did a check at the start of function for m_closed, but it
then looped over queued messages and dispatched each one. Each dispatch causes
the onmessage handler to run, which can trigger closing the execution context.
Since https://crrev.com/9c675cfdcf006e5ca978b0dfa04f187ed36f86cc, getExecutionContext()
would then return null and crash. Since close() is called when the execution
context dies and possibly in other cases, check |m_closed| before each dispatch.
BUG=649616
Review-Url: https://codereview.chromium.org/2533323003
Cr-Commit-Position: refs/heads/master@{#435190}
(cherry picked from commit 6ec0c90214ba34ce39e4224561235b7142d07eaa)
Committed: https://chromium.googlesource.com/chromium/src/+/b99d81b8ddc75ccbfdd0a2b1cefeec3a32af0221
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||