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

Unified Diff: mojo/public/cpp/bindings/lib/message.cc

Issue 1576603002: Makes bindings work with nested message loops (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 11 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/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/message.cc
diff --git a/mojo/public/cpp/bindings/lib/message.cc b/mojo/public/cpp/bindings/lib/message.cc
index 9a9e25ca5e9c36b2a8ec04bec15748e9ffd0063a..6614e87bb817a60e35e4e71da4bc41cc050d5779 100644
--- a/mojo/public/cpp/bindings/lib/message.cc
+++ b/mojo/public/cpp/bindings/lib/message.cc
@@ -46,9 +46,7 @@ void Message::CloseHandles() {
}
}
-MojoResult ReadAndDispatchMessage(MessagePipeHandle handle,
- MessageReceiver* receiver,
- bool* receiver_result) {
+MojoResult ReadMessage(MessagePipeHandle handle, Message* message) {
MojoResult rv;
uint32_t num_bytes = 0, num_handles = 0;
@@ -61,24 +59,17 @@ MojoResult ReadAndDispatchMessage(MessagePipeHandle handle,
if (rv != MOJO_RESULT_RESOURCE_EXHAUSTED)
return rv;
- Message message;
- message.Initialize(num_bytes, false /* zero_initialized */);
+ message->Initialize(num_bytes, false /* zero_initialized */);
- void* mutable_data = message.buffer()->Allocate(num_bytes);
- message.mutable_handles()->resize(num_handles);
+ void* mutable_data = message->buffer()->Allocate(num_bytes);
+ message->mutable_handles()->resize(num_handles);
rv = ReadMessageRaw(
- handle,
- mutable_data,
- &num_bytes,
- message.mutable_handles()->empty()
+ handle, mutable_data, &num_bytes,
+ message->mutable_handles()->empty()
? nullptr
- : reinterpret_cast<MojoHandle*>(message.mutable_handles()->data()),
- &num_handles,
- MOJO_READ_MESSAGE_FLAG_NONE);
- if (receiver && rv == MOJO_RESULT_OK)
- *receiver_result = receiver->Accept(&message);
-
+ : reinterpret_cast<MojoHandle*>(message->mutable_handles()->data()),
+ &num_handles, MOJO_READ_MESSAGE_FLAG_NONE);
return rv;
}
« no previous file with comments | « mojo/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698