OLD | NEW |
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/proxy_message_pipe_endpoint.h" | 5 #include "mojo/system/proxy_message_pipe_endpoint.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "mojo/system/channel.h" | 10 #include "mojo/system/channel.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 message->set_destination_id(remote_id_); | 76 message->set_destination_id(remote_id_); |
77 if (!channel_->WriteMessage(message.Pass())) | 77 if (!channel_->WriteMessage(message.Pass())) |
78 LOG(WARNING) << "Failed to write message to channel"; | 78 LOG(WARNING) << "Failed to write message to channel"; |
79 } else { | 79 } else { |
80 paused_message_queue_.AddMessage(message.Pass()); | 80 paused_message_queue_.AddMessage(message.Pass()); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void ProxyMessagePipeEndpoint::Attach(scoped_refptr<Channel> channel, | 84 void ProxyMessagePipeEndpoint::Attach(scoped_refptr<Channel> channel, |
85 MessageInTransit::EndpointId local_id) { | 85 MessageInTransit::EndpointId local_id) { |
86 DCHECK(channel); | 86 DCHECK(channel.get()); |
87 DCHECK_NE(local_id, MessageInTransit::kInvalidEndpointId); | 87 DCHECK_NE(local_id, MessageInTransit::kInvalidEndpointId); |
88 | 88 |
89 DCHECK(!is_attached()); | 89 DCHECK(!is_attached()); |
90 | 90 |
91 AssertConsistentState(); | 91 AssertConsistentState(); |
92 channel_ = channel; | 92 channel_ = channel; |
93 local_id_ = local_id; | 93 local_id_ = local_id; |
94 AssertConsistentState(); | 94 AssertConsistentState(); |
95 } | 95 } |
96 | 96 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 DCHECK_NE(local_id_, MessageInTransit::kInvalidEndpointId); | 139 DCHECK_NE(local_id_, MessageInTransit::kInvalidEndpointId); |
140 } else { // Not attached. | 140 } else { // Not attached. |
141 DCHECK_EQ(local_id_, MessageInTransit::kInvalidEndpointId); | 141 DCHECK_EQ(local_id_, MessageInTransit::kInvalidEndpointId); |
142 DCHECK_EQ(remote_id_, MessageInTransit::kInvalidEndpointId); | 142 DCHECK_EQ(remote_id_, MessageInTransit::kInvalidEndpointId); |
143 } | 143 } |
144 } | 144 } |
145 #endif | 145 #endif |
146 | 146 |
147 } // namespace system | 147 } // namespace system |
148 } // namespace mojo | 148 } // namespace mojo |
OLD | NEW |