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

Unified Diff: components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java

Issue 1307863006: [Cronet] Change interface APIs to abstract classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update CronetPerfTestActivity too Created 5 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: components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java
diff --git a/components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java b/components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java
index ba57799ae4cce675244c55f9f698b90856eca14a..3b29d1fa5ee6ecf8d26f37d752970ff8d883d040 100644
--- a/components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java
+++ b/components/cronet/android/java/src/org/chromium/net/UploadDataProvider.java
@@ -8,7 +8,7 @@ import java.io.IOException;
import java.nio.ByteBuffer;
/**
- * Interface allowing the embedder to provide an upload body to
+ * Abstract class allowing the embedder to provide an upload body to
* {@link UrlRequest}. It supports both non-chunked (size known in advanced) and
* chunked (size not known in advance) uploads. Be aware that not all servers
* support chunked uploads.
@@ -16,13 +16,13 @@ import java.nio.ByteBuffer;
* <p>An upload is either always chunked, across multiple uploads if the data
* ends up being sent more than once, or never chunked.
*/
-public interface UploadDataProvider {
+public abstract class UploadDataProvider {
/**
* If this is a non-chunked upload, returns the length of the upload. Must
* always return -1 if this is a chunked upload.
* @return the length of the upload for non-chunked uploads, -1 otherwise.
*/
- public long getLength();
+ public abstract long getLength();
/**
* Reads upload data into {@code byteBuffer}. Upon completion, the buffer's
@@ -42,7 +42,7 @@ public interface UploadDataProvider {
* @param byteBuffer The buffer to copy the read bytes into.
* @throws IOException if any IOException occurred during the process.
*/
- public void read(UploadDataSink uploadDataSink, ByteBuffer byteBuffer)
+ public abstract void read(UploadDataSink uploadDataSink, ByteBuffer byteBuffer)
throws IOException;
/**
@@ -65,6 +65,5 @@ public interface UploadDataProvider {
* completed, successfully or otherwise.
* @throws IOException if any IOException occurred during the process.
*/
- public void rewind(UploadDataSink uploadDataSink)
- throws IOException;
+ public abstract void rewind(UploadDataSink uploadDataSink) throws IOException;
}

Powered by Google App Engine
This is Rietveld 408576698