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

Unified Diff: mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java

Issue 1057213003: Java: Introduce ResultAnd<> and use it. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
Index: mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
diff --git a/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java b/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
index a6683fdde7677877bcb1c5b17d9a7b01d630f1c2..4deaf0975d30f600892992252cc50c7e6cd2f00f 100644
--- a/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
+++ b/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
@@ -234,7 +234,7 @@ public interface DataPipe {
*
* @return number of written bytes.
*/
- public int writeData(ByteBuffer elements, WriteFlags flags);
+ public ResultAnd<Integer> writeData(ByteBuffer elements, WriteFlags flags);
/**
* Begins a two-phase write to the data pipe producer . On success, returns a |ByteBuffer|
@@ -276,7 +276,6 @@ public interface DataPipe {
* Handle for the consumer part of a data pipe.
*/
public static interface ConsumerHandle extends Handle {
-
/**
* @see org.chromium.mojo.system.Handle#pass()
*/
@@ -302,7 +301,7 @@ public interface DataPipe {
* If flags has |query| set, it queries the amount of data available, returning the number
* of bytes available. In this case |allOrNone| is ignored, as are |elements|.
*/
- public int readData(ByteBuffer elements, ReadFlags flags);
+ public ResultAnd<Integer> readData(ByteBuffer elements, ReadFlags flags);
/**
* Begins a two-phase read from the data pipe consumer. On success, returns a |ByteBuffer|

Powered by Google App Engine
This is Rietveld 408576698