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

Unified Diff: mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java

Issue 1058143002: Fix Android for positive MojoResults. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 5 years, 9 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
« mojo/android/system/core_impl.cc ('K') | « mojo/android/system/core_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
diff --git a/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
index a32e1f347b88ff0f8cfffda40a7ba5d9c890d13c..977cc0e562c492e1af146f1ef0cb091755659146 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
@@ -326,7 +326,7 @@ public class CoreImpl implements Core, AsyncWaiter {
int discardData(DataPipeConsumerHandleImpl handle, int numBytes, DataPipe.ReadFlags flags) {
int result = nativeReadData(handle.getMojoHandle(), null, numBytes,
flags.getFlags() | MOJO_READ_DATA_FLAG_DISCARD);
- if (result < 0) {
+ if (result != MojoResult.OK) {
throw new MojoException(result);
}
return result;
viettrungluu 2015/04/02 23:02:42 This should always be MojoResult.OK, I think.
@@ -338,7 +338,7 @@ public class CoreImpl implements Core, AsyncWaiter {
int readData(DataPipeConsumerHandleImpl handle, ByteBuffer elements, DataPipe.ReadFlags flags) {
int result = nativeReadData(handle.getMojoHandle(), elements,
elements == null ? 0 : elements.capacity(), flags.getFlags());
- if (result < 0) {
+ if (result != MojoResult.OK) {
throw new MojoException(result);
}
if (elements != null) {
@@ -576,11 +576,7 @@ public class CoreImpl implements Core, AsyncWaiter {
private static MessagePipeHandle.ReadMessageResult newReadMessageResult(
int mojoResult, int messageSize, int handlesCount) {
MessagePipeHandle.ReadMessageResult result = new MessagePipeHandle.ReadMessageResult();
- if (mojoResult >= 0) {
- result.setMojoResult(MojoResult.OK);
- } else {
- result.setMojoResult(mojoResult);
- }
+ result.setMojoResult(MojoResult.OK);
result.setMessageSize(messageSize);
result.setHandlesCount(handlesCount);
return result;
« mojo/android/system/core_impl.cc ('K') | « mojo/android/system/core_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698