Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1671)

Unified Diff: mojo/edk/system/ports/node.cc

Issue 1985833002: [mojo-edk] Prevent closed port from accepting new messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/ports/node.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/node.cc
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc
index 5a5d83454197d0118c13a7d46ef138e709fde9fb..75e9857731d02f163b670e8ccc6e3541f57ef60d 100644
--- a/mojo/edk/system/ports/node.cc
+++ b/mojo/edk/system/ports/node.cc
@@ -30,6 +30,8 @@ bool CanAcceptMoreMessages(const Port* port) {
// Have we already doled out the last message (i.e., do we expect to NOT
// receive further messages)?
uint64_t next_sequence_num = port->message_queue.next_sequence_num();
+ if (port->state == Port::kClosed)
+ return false;
if (port->peer_closed || port->remove_proxy_on_last_message) {
if (port->last_sequence_num_to_receive == next_sequence_num - 1)
return false;
@@ -821,11 +823,6 @@ int Node::AddPortWithName(const PortName& port_name,
return OK;
}
-void Node::ErasePort(const PortName& port_name) {
- base::AutoLock lock(ports_lock_);
- return ErasePort_Locked(port_name);
-}
-
void Node::ErasePort_Locked(const PortName& port_name) {
ports_lock_.AssertAcquired();
ports_.erase(port_name);
« no previous file with comments | « mojo/edk/system/ports/node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698