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

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

Issue 253863004: Mojo: More Channel tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delete extra blank line Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/system/channel_unittest.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/system/channel.h" 5 #include "mojo/system/channel.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 it != to_destroy.end(); 85 it != to_destroy.end();
86 ++it) { 86 ++it) {
87 if (it->second.state == EndpointInfo::STATE_NORMAL) { 87 if (it->second.state == EndpointInfo::STATE_NORMAL) {
88 it->second.message_pipe->OnRemove(it->second.port); 88 it->second.message_pipe->OnRemove(it->second.port);
89 num_live++; 89 num_live++;
90 } else { 90 } else {
91 DCHECK(!it->second.message_pipe.get()); 91 DCHECK(!it->second.message_pipe.get());
92 num_zombies++; 92 num_zombies++;
93 } 93 }
94 } 94 }
95 DVLOG(2) << "Shut down Channel with " << num_live << " live endpoints and " 95 DVLOG_IF(2, num_live || num_zombies)
96 << num_zombies << " zombies"; 96 << "Shut down Channel with " << num_live << " live endpoints and "
97 << num_zombies << " zombies";
97 } 98 }
98 99
99 MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint( 100 MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint(
100 scoped_refptr<MessagePipe> message_pipe, 101 scoped_refptr<MessagePipe> message_pipe,
101 unsigned port) { 102 unsigned port) {
102 DCHECK(message_pipe); 103 DCHECK(message_pipe);
103 DCHECK(port == 0 || port == 1); 104 DCHECK(port == 0 || port == 1);
104 105
105 MessageInTransit::EndpointId local_id; 106 MessageInTransit::EndpointId local_id;
106 { 107 {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 // TODO(vtl): Is this how we really want to handle this? 474 // TODO(vtl): Is this how we really want to handle this?
474 // Sometimes we'll want to propagate the error back to the message pipe 475 // Sometimes we'll want to propagate the error back to the message pipe
475 // (endpoint), and notify it that the remote is (effectively) closed. 476 // (endpoint), and notify it that the remote is (effectively) closed.
476 // Sometimes we'll want to kill the channel (and notify all the endpoints that 477 // Sometimes we'll want to kill the channel (and notify all the endpoints that
477 // their remotes are dead. 478 // their remotes are dead.
478 LOG(WARNING) << error_message; 479 LOG(WARNING) << error_message;
479 } 480 }
480 481
481 } // namespace system 482 } // namespace system
482 } // namespace mojo 483 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/system/channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698