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

Unified Diff: ipc/ipc_message_pipe_reader.cc

Issue 2183963002: Revert of Mojo C++ bindings: make ipc/ mojom targets to use STL string/vector types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « ipc/ipc_message_pipe_reader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_pipe_reader.cc
diff --git a/ipc/ipc_message_pipe_reader.cc b/ipc/ipc_message_pipe_reader.cc
index 4d8ec8e503d595750e246e2d8e113114eed606ac..8e1b35565bfec09fbabb25835542fbd3e403f627 100644
--- a/ipc/ipc_message_pipe_reader.cc
+++ b/ipc/ipc_message_pipe_reader.cc
@@ -86,20 +86,20 @@
"MessagePipeReader::Send",
message->flags(),
TRACE_EVENT_FLAG_FLOW_OUT);
- base::Optional<std::vector<mojom::SerializedHandlePtr>> handles;
+ mojo::Array<mojom::SerializedHandlePtr> handles(nullptr);
MojoResult result = MOJO_RESULT_OK;
result = ChannelMojo::ReadFromMessageAttachmentSet(message.get(), &handles);
if (result != MOJO_RESULT_OK)
return false;
- std::vector<uint8_t> data(message->size());
+ mojo::Array<uint8_t> data(message->size());
std::copy(reinterpret_cast<const uint8_t*>(message->data()),
reinterpret_cast<const uint8_t*>(message->data()) + message->size(),
- data.data());
+ &data[0]);
MessageSerializer serializer;
mojom::ChannelProxy proxy(&serializer);
- proxy.Receive(data, std::move(handles));
+ proxy.Receive(std::move(data), std::move(handles));
mojo::Message* mojo_message = serializer.message();
size_t num_handles = mojo_message->handles()->size();
@@ -127,11 +127,11 @@
}
void MessagePipeReader::Receive(
- const std::vector<uint8_t>& data,
- base::Optional<std::vector<mojom::SerializedHandlePtr>> handles) {
+ mojo::Array<uint8_t> data,
+ mojo::Array<mojom::SerializedHandlePtr> handles) {
DCHECK_NE(peer_pid_, base::kNullProcessId);
Message message(
- data.empty() ? "" : reinterpret_cast<const char*>(data.data()),
+ data.size() == 0 ? "" : reinterpret_cast<const char*>(&data[0]),
static_cast<uint32_t>(data.size()));
message.set_sender_pid(peer_pid_);
@@ -151,7 +151,7 @@
}
void MessagePipeReader::GetAssociatedInterface(
- const std::string& name,
+ const mojo::String& name,
mojom::GenericInterfaceAssociatedRequest request) {
DCHECK(thread_checker_.CalledOnValidThread());
if (delegate_)
« no previous file with comments | « ipc/ipc_message_pipe_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698