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

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

Issue 1880823005: [mojo-edk] Add explicit message object APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/c/system/message_pipe.h ('k') | mojo/public/platform/native/system_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/connector.cc
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index 938cdc99706eeee396161fcfde7c2ab4a593ee21..1d25640c0a5006840778e5d4267867e380101d14 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -160,11 +160,12 @@ bool Connector::Accept(Message* message) {
static_cast<uint32_t>(message->mutable_handles()->size()),
MOJO_WRITE_MESSAGE_FLAG_NONE);
+ // The handles are always either transferred or closed, so we don't need the
+ // message to track their lifetime any longer.
+ message->mutable_handles()->clear();
+
switch (rv) {
case MOJO_RESULT_OK:
- // The handles were successfully transferred, so we don't need the message
- // to track their lifetime any longer.
- message->mutable_handles()->clear();
break;
case MOJO_RESULT_FAILED_PRECONDITION:
// There's no point in continuing to write to this pipe since the other
« no previous file with comments | « mojo/public/c/system/message_pipe.h ('k') | mojo/public/platform/native/system_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698