Chromium Code Reviews
DescriptionMessaging: 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
Committed: https://crrev.com/6ec0c90214ba34ce39e4224561235b7142d07eaa
Cr-Commit-Position: refs/heads/master@{#435190}
Patch Set 1 #Patch Set 2 : fix #Patch Set 3 : rm undeeded dcheck #
Total comments: 3
Messages
Total messages: 19 (10 generated)
|
|||||||||||||||||||||||||||||||||||||