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

Unified Diff: mojo/edk/system/transport_data.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/transport_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/transport_data.cc
diff --git a/mojo/edk/system/transport_data.cc b/mojo/edk/system/transport_data.cc
index fedfce60cf1eba1772fb71f884677de806a2677c..058d795af6fdca86ddf96d56d3e5ee630b3cd488 100644
--- a/mojo/edk/system/transport_data.cc
+++ b/mojo/edk/system/transport_data.cc
@@ -19,6 +19,22 @@ using mojo::platform::ScopedPlatformHandle;
namespace mojo {
namespace system {
+namespace {
+
+// TODO(vtl): Temporary, until |TransportData| really supports handles.
+std::unique_ptr<DispatcherVector> DispatcherVectorFromHandleVector(
+ std::unique_ptr<HandleVector> handles) {
+ DCHECK(handles);
+
+ std::unique_ptr<DispatcherVector> dispatchers(new DispatcherVector());
+ dispatchers->reserve(handles->size());
+ for (size_t i = 0; i < handles->size(); i++)
+ dispatchers->push_back(std::move(handles->at(i).dispatcher));
+ return dispatchers;
+}
+
+} // namespace
+
// The maximum amount of space needed per platform handle.
// (|{Channel,RawChannel}::GetSerializedPlatformHandleSize()| should always
// return a value which is at most this. This is only used to calculate
@@ -63,6 +79,12 @@ struct TransportData::PrivateStructForCompileAsserts {
"alignment");
};
+// TODO(vtl): Make this the real one.
+TransportData::TransportData(std::unique_ptr<HandleVector> handles,
+ Channel* channel)
+ : TransportData(DispatcherVectorFromHandleVector(std::move(handles)),
+ channel) {}
+
TransportData::TransportData(std::unique_ptr<DispatcherVector> dispatchers,
Channel* channel)
: buffer_size_() {
« no previous file with comments | « mojo/edk/system/transport_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698