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

Side by Side Diff: mojo/system/message_pipe.cc

Issue 604443002: Mojo: Remove ProxyMessagePipeEndpoint::OnRemove(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@del_pmpe_run-x-del_mp_attach-x-move_paused_message_queue-x-del_pmpe_attach
Patch Set: rebased Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « mojo/system/message_pipe.h ('k') | mojo/system/message_pipe_endpoint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/system/message_pipe.h" 5 #include "mojo/system/message_pipe.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/system/channel_endpoint.h" 8 #include "mojo/system/channel_endpoint.h"
9 #include "mojo/system/local_message_pipe_endpoint.h" 9 #include "mojo/system/local_message_pipe_endpoint.h"
10 #include "mojo/system/message_in_transit.h" 10 #include "mojo/system/message_in_transit.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 void MessagePipe::OnRemove(unsigned port) { 187 void MessagePipe::OnRemove(unsigned port) {
188 unsigned destination_port = GetPeerPort(port); 188 unsigned destination_port = GetPeerPort(port);
189 189
190 base::AutoLock locker(lock_); 190 base::AutoLock locker(lock_);
191 // A |OnPeerClose()| can come in first, before |OnRemove()| gets called. 191 // A |OnPeerClose()| can come in first, before |OnRemove()| gets called.
192 if (!endpoints_[port]) 192 if (!endpoints_[port])
193 return; 193 return;
194 194
195 endpoints_[port]->OnRemove();
196 if (endpoints_[destination_port]) { 195 if (endpoints_[destination_port]) {
197 if (!endpoints_[destination_port]->OnPeerClose()) 196 if (!endpoints_[destination_port]->OnPeerClose())
198 endpoints_[destination_port].reset(); 197 endpoints_[destination_port].reset();
199 } 198 }
200 endpoints_[port].reset(); 199 endpoints_[port].reset();
201 } 200 }
202 201
203 MessagePipe::MessagePipe() { 202 MessagePipe::MessagePipe() {
204 } 203 }
205 204
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 MojoResult MessagePipe::HandleControlMessage( 289 MojoResult MessagePipe::HandleControlMessage(
291 unsigned /*port*/, 290 unsigned /*port*/,
292 scoped_ptr<MessageInTransit> message) { 291 scoped_ptr<MessageInTransit> message) {
293 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " 292 LOG(WARNING) << "Unrecognized MessagePipe control message subtype "
294 << message->subtype(); 293 << message->subtype();
295 return MOJO_RESULT_UNKNOWN; 294 return MOJO_RESULT_UNKNOWN;
296 } 295 }
297 296
298 } // namespace system 297 } // namespace system
299 } // namespace mojo 298 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe.h ('k') | mojo/system/message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698