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

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

Issue 1957553003: EDK: Plumb Handle/HandleVector yet one more layer down: MessageInTransit. (Closed) Base URL: https://github.com/domokit/mojo.git@work787_edk_handle_13.6
Patch Set: 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 | « no previous file | mojo/edk/system/local_message_pipe_endpoint.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/channel_endpoint.h" 5 #include "mojo/edk/system/channel_endpoint.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/edk/platform/thread_utils.h" 10 #include "mojo/edk/platform/thread_utils.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 bool ChannelEndpoint::WriteMessageNoLock( 158 bool ChannelEndpoint::WriteMessageNoLock(
159 std::unique_ptr<MessageInTransit> message) { 159 std::unique_ptr<MessageInTransit> message) {
160 DCHECK(message); 160 DCHECK(message);
161 161
162 mutex_.AssertHeld(); 162 mutex_.AssertHeld();
163 163
164 DCHECK(channel_); 164 DCHECK(channel_);
165 DCHECK(local_id_.is_valid()); 165 DCHECK(local_id_.is_valid());
166 DCHECK(remote_id_.is_valid()); 166 DCHECK(remote_id_.is_valid());
167 167
168 message->SerializeAndCloseDispatchers(channel_); 168 message->SerializeAndCloseHandles(channel_);
169 message->set_source_id(local_id_); 169 message->set_source_id(local_id_);
170 message->set_destination_id(remote_id_); 170 message->set_destination_id(remote_id_);
171 return channel_->WriteMessage(std::move(message)); 171 return channel_->WriteMessage(std::move(message));
172 } 172 }
173 173
174 void ChannelEndpoint::OnReadMessageForClient( 174 void ChannelEndpoint::OnReadMessageForClient(
175 std::unique_ptr<MessageInTransit> message) { 175 std::unique_ptr<MessageInTransit> message) {
176 DCHECK_EQ(message->type(), MessageInTransit::Type::ENDPOINT_CLIENT); 176 DCHECK_EQ(message->type(), MessageInTransit::Type::ENDPOINT_CLIENT);
177 177
178 RefPtr<ChannelEndpointClient> client; 178 RefPtr<ChannelEndpointClient> client;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 DCHECK(remote_id_.is_valid()); 223 DCHECK(remote_id_.is_valid());
224 224
225 state_ = State::DEAD; 225 state_ = State::DEAD;
226 channel_ = nullptr; 226 channel_ = nullptr;
227 local_id_ = ChannelEndpointId(); 227 local_id_ = ChannelEndpointId();
228 remote_id_ = ChannelEndpointId(); 228 remote_id_ = ChannelEndpointId();
229 } 229 }
230 230
231 } // namespace system 231 } // namespace system
232 } // namespace mojo 232 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/local_message_pipe_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698