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

Unified Diff: mojo/edk/system/message_pipe.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/message_in_transit.cc ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/message_pipe.cc
diff --git a/mojo/edk/system/message_pipe.cc b/mojo/edk/system/message_pipe.cc
index 5c73ac98ec1125c0d21e9f858c83003f4f642397..a1d2d1351f73683cf0338f8b8d1885c8e52dcdfc 100644
--- a/mojo/edk/system/message_pipe.cc
+++ b/mojo/edk/system/message_pipe.cc
@@ -356,24 +356,22 @@ MojoResult MessagePipe::AttachTransportsNoLock(
unsigned port,
MessageInTransit* message,
std::vector<HandleTransport>* transports) {
- DCHECK(!message->has_dispatchers());
+ DCHECK(!message->has_handles());
- // Clone the dispatchers and attach them to the message. (This must be done as
- // a separate loop, since we want to leave the dispatchers alone on failure.)
- std::unique_ptr<DispatcherVector> dispatchers(new DispatcherVector());
- dispatchers->reserve(transports->size());
+ // Clone the handles and attach them to the message. (This must be done as a
+ // separate loop, since we want to leave the handles alone on failure.)
+ std::unique_ptr<HandleVector> handles(new HandleVector());
+ handles->reserve(transports->size());
for (size_t i = 0; i < transports->size(); i++) {
if ((*transports)[i].is_valid()) {
- // TODO(vtl): Plumb this into |MessageInTransit|. (I.e., |dispatchers| ->
- // |handles|, etc.)
- Handle h = (*transports)[i].CreateEquivalentHandleAndClose(this, port);
- dispatchers->push_back(std::move(h.dispatcher));
+ handles->push_back(
+ transports->at(i).CreateEquivalentHandleAndClose(this, port));
} else {
LOG(WARNING) << "Enqueueing null dispatcher";
- dispatchers->push_back(nullptr);
+ handles->push_back(Handle());
}
}
- message->SetDispatchers(std::move(dispatchers));
+ message->SetHandles(std::move(handles));
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/edk/system/message_in_transit.cc ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698