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

Unified Diff: mojo/edk/system/core.cc

Issue 2289543003: IPC->mojo of audio_renderer_host (Closed)
Patch Set: Some changes. Comments. Created 4 years, 3 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
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index d2a421ebeeee474cde11153c9f339cc1f8bac05d..61ed03486c4957b2932324497592ac0a93b430f4 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -473,21 +473,18 @@ MojoResult Core::AllocMessage(uint32_t num_bytes,
uint32_t num_handles,
MojoAllocMessageFlags flags,
MojoMessageHandle* message) {
- if (!message)
- return MOJO_RESULT_INVALID_ARGUMENT;
+ DCHECK(message);
if (num_handles == 0) { // Fast path: no handles.
std::unique_ptr<MessageForTransit> msg;
MojoResult rv = MessageForTransit::Create(&msg, num_bytes, nullptr, 0);
- if (rv != MOJO_RESULT_OK)
- return rv;
+ DCHECK(rv == MOJO_RESULT_OK) << rv;
*message = reinterpret_cast<MojoMessageHandle>(msg.release());
return MOJO_RESULT_OK;
}
- if (!handles)
- return MOJO_RESULT_INVALID_ARGUMENT;
+ DCHECK(handles);
if (num_handles > kMaxHandlesPerMessage)
return MOJO_RESULT_RESOURCE_EXHAUSTED;
@@ -496,10 +493,7 @@ MojoResult Core::AllocMessage(uint32_t num_bytes,
{
base::AutoLock lock(handles_lock_);
MojoResult rv = handles_.BeginTransit(handles, num_handles, &dispatchers);
- if (rv != MOJO_RESULT_OK) {
- handles_.CancelTransit(dispatchers);
- return rv;
- }
+ DCHECK(rv == MOJO_RESULT_OK) << rv;
}
DCHECK_EQ(num_handles, dispatchers.size());
@@ -517,6 +511,7 @@ MojoResult Core::AllocMessage(uint32_t num_bytes,
}
}
+ DCHECK(rv == MOJO_RESULT_OK) << rv;
return rv;
}
« media/mojo/interfaces/audio_output.mojom ('K') | « media/mojo/interfaces/typemaps.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698