Chromium Code Reviews| 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; |