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

Unified Diff: mojo/system/channel.cc

Issue 600523002: Mojo: Remove MessagePipe::Attach(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_paused_message_queue-x-del_pmpe_attach
Patch Set: rebased Created 6 years, 3 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 | « no previous file | mojo/system/message_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.cc
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index 8c8be07245167bc5432b04982551bc94016a32fb..3114a59106c9e2b5f5bb3d02ab2ae06cb5dd1ca9 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -118,32 +118,7 @@ MessageInTransit::EndpointId Channel::AttachEndpoint(
}
endpoint->AttachToChannel(this, local_id);
- // This might fail if that port got an |OnPeerClose()| before attaching.
- if (endpoint->message_pipe_->Attach(endpoint->port_, endpoint.get()))
- return local_id;
-
- // Note: If it failed, quite possibly the endpoint info was removed from that
- // map (there's a race between us adding it to the map above and calling
- // |Attach()|). And even if an entry exists for |local_id|, we need to check
- // that it's the one we added (and not some other one that was added since).
- {
- base::AutoLock locker(lock_);
- IdToEndpointMap::iterator it = local_id_to_endpoint_map_.find(local_id);
- if (it != local_id_to_endpoint_map_.end() &&
- it->second->message_pipe_.get() == endpoint->message_pipe_.get() &&
- it->second->port_ == endpoint->port_) {
- DCHECK_EQ(it->second->state_, ChannelEndpoint::STATE_NORMAL);
- // TODO(vtl): FIXME -- This is wrong. We need to specify (to
- // |AttachEndpoint()| who's going to be responsible for calling
- // |RunMessagePipeEndpoint()| ("us", or the remote by sending us a
- // |kSubtypeChannelRunMessagePipeEndpoint|). If the remote is going to
- // run, then we'll get messages to an "invalid" local ID (for running, for
- // removal).
- local_id_to_endpoint_map_.erase(it);
- }
- }
- endpoint->DetachFromChannel();
- return MessageInTransit::kInvalidEndpointId;
+ return local_id;
}
bool Channel::RunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
« no previous file with comments | « no previous file | mojo/system/message_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698