[mojo-edk] Prevent closed port from accepting new messages
Previously it was possible for a message to arrive just
before closing a port. In this case OnUserMessage would
grab a ref to the Port object (thus keeping it alive),
ClosePort would close the port (in turn closing any
ports referenced by its message queue), and then it
would be possible for OnUserMessage to continue by
locking the port and enqueueing a (potentially port-
carrying) message onto the queue.
This resolves the issue by making CanAcceptMoreMessages
fail if the port is closed.
Also minor cleanup removing the unused ErasePort method.
TBR=amistry@chromium.org
BUG=
Review-Url: https://codereview.chromium.org/1985833002
Cr-Commit-Position: refs/heads/master@{#393947}
CrOS-Libchrome-Original-Commit: 1eb892f358de593644d40d4075cadca59a327f94
2 files changed