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

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

Issue 1942423002: EDK: Move DispatcherTransport to handle_transport.*. (Closed) Base URL: https://github.com/domokit/mojo.git@work789_edk_handle_9
Patch Set: rebased 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/ipc_support_unittest.cc ('k') | mojo/edk/system/message_pipe_dispatcher.cc » ('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/edk/system/message_pipe.h" 5 #include "mojo/edk/system/message_pipe.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "mojo/edk/system/channel.h" 11 #include "mojo/edk/system/channel.h"
12 #include "mojo/edk/system/channel_endpoint.h" 12 #include "mojo/edk/system/channel_endpoint.h"
13 #include "mojo/edk/system/channel_endpoint_id.h" 13 #include "mojo/edk/system/channel_endpoint_id.h"
14 #include "mojo/edk/system/handle_transport.h"
14 #include "mojo/edk/system/incoming_endpoint.h" 15 #include "mojo/edk/system/incoming_endpoint.h"
15 #include "mojo/edk/system/local_message_pipe_endpoint.h" 16 #include "mojo/edk/system/local_message_pipe_endpoint.h"
16 #include "mojo/edk/system/message_in_transit.h" 17 #include "mojo/edk/system/message_in_transit.h"
17 #include "mojo/edk/system/message_pipe_dispatcher.h" 18 #include "mojo/edk/system/message_pipe_dispatcher.h"
18 #include "mojo/edk/system/message_pipe_endpoint.h" 19 #include "mojo/edk/system/message_pipe_endpoint.h"
19 #include "mojo/edk/system/proxy_message_pipe_endpoint.h" 20 #include "mojo/edk/system/proxy_message_pipe_endpoint.h"
20 #include "mojo/edk/util/make_unique.h" 21 #include "mojo/edk/util/make_unique.h"
21 22
22 using mojo::platform::ScopedPlatformHandle; 23 using mojo::platform::ScopedPlatformHandle;
23 using mojo::util::MakeRefCounted; 24 using mojo::util::MakeRefCounted;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 GetPeerPort(port), std::unique_ptr<MessageInTransit>(message), nullptr); 311 GetPeerPort(port), std::unique_ptr<MessageInTransit>(message), nullptr);
311 DLOG_IF(WARNING, result != MOJO_RESULT_OK) 312 DLOG_IF(WARNING, result != MOJO_RESULT_OK)
312 << "EnqueueMessageNoLock() failed (result = " << result << ")"; 313 << "EnqueueMessageNoLock() failed (result = " << result << ")";
313 return true; 314 return true;
314 } 315 }
315 316
316 void MessagePipe::OnDetachFromChannel(unsigned port) { 317 void MessagePipe::OnDetachFromChannel(unsigned port) {
317 Close(port); 318 Close(port);
318 } 319 }
319 320
320 MessagePipe::MessagePipe() { 321 MessagePipe::MessagePipe() {}
321 }
322 322
323 MessagePipe::~MessagePipe() { 323 MessagePipe::~MessagePipe() {
324 // Owned by the dispatchers. The owning dispatchers should only release us via 324 // Owned by the dispatchers. The owning dispatchers should only release us via
325 // their |Close()| method, which should inform us of being closed via our 325 // their |Close()| method, which should inform us of being closed via our
326 // |Close()|. Thus these should already be null. 326 // |Close()|. Thus these should already be null.
327 DCHECK(!endpoints_[0]); 327 DCHECK(!endpoints_[0]);
328 DCHECK(!endpoints_[1]); 328 DCHECK(!endpoints_[1]);
329 } 329 }
330 330
331 MojoResult MessagePipe::EnqueueMessageNoLock( 331 MojoResult MessagePipe::EnqueueMessageNoLock(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 LOG(WARNING) << "Enqueueing null dispatcher"; 371 LOG(WARNING) << "Enqueueing null dispatcher";
372 dispatchers->push_back(nullptr); 372 dispatchers->push_back(nullptr);
373 } 373 }
374 } 374 }
375 message->SetDispatchers(std::move(dispatchers)); 375 message->SetDispatchers(std::move(dispatchers));
376 return MOJO_RESULT_OK; 376 return MOJO_RESULT_OK;
377 } 377 }
378 378
379 } // namespace system 379 } // namespace system
380 } // namespace mojo 380 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/ipc_support_unittest.cc ('k') | mojo/edk/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698